Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mario-deluna/php-chip8
Yet another CHIP-8 emulator, but in PHP!
https://github.com/mario-deluna/php-chip8
chip-8 chip8 emulator php
Last synced: about 2 months ago
JSON representation
Yet another CHIP-8 emulator, but in PHP!
- Host: GitHub
- URL: https://github.com/mario-deluna/php-chip8
- Owner: mario-deluna
- License: agpl-3.0
- Created: 2024-02-05T22:51:38.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-03-13T21:03:52.000Z (9 months ago)
- Last Synced: 2024-10-15T21:17:06.381Z (2 months ago)
- Topics: chip-8, chip8, emulator, php
- Language: PHP
- Homepage:
- Size: 171 KB
- Stars: 48
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP Chip-8 Emulator
I don't know how many turing mashines deep this is but here is a Chip8 Emulator written in PHP.
Built on [PHP-GLFW](http://github.com/mario-deluna/php-glfw) and the [VISU](https://github.com/phpgl/visu) framework.
![demo](https://github.com/mario-deluna/php-chip8/assets/956212/ae03baa0-8a00-4872-8131-39ca420a6310)
* [Features](#features)
* [FAQ](#faq)
* [How To use it ](#how-to-use-it)
* [Credits](#credits)
* [License](#license)## Features
* **It runs Chip8 ROMs!**
This is obvious, but the moment it started working was magical to me, so I'm putting it here.
* **Debugger**
You can step through the code and see the state of the registers and memory.
Press `space` to pause or hit the _Pause button_.
![stepper](https://github.com/mario-deluna/php-chip8/assets/956212/dbcf3e7c-4652-4f5e-a05e-21e96745d978)
* **Drag and Drop**
As seen in the demo, you can simply drag and drop your ROMs onto the emulator.
* **Fullscreen mode**
If you don't care for all the debugging stuff, you can simply go fullscreen and enjoy the game.
* **Virtual Keyboard**
You can use the keyboard in the GUI or use the keybindings:
| | | | | | | | | |
|---|---|---|---|----|---|---|---|---|
| 1 | 2 | 3 | C | `->` | 1 | 2 | 3 | 4 |
| 4 | 5 | 6 | D | `->` | q | w | e | r |
| 7 | 8 | 9 | E | `->` | a | s | d | f |
| A | 0 | B | F | `->` | y | x | c | v |
* **Ghosting Effect**
I'm honestly not very knowledgeable about old hardware, but I'm assuming that the old CRTs would take some time for the phosphor to fade out. I tried to emulate this effect by adding a ghosting effect to the display, as the flickering otherwise is quite unpleasant.
You can change the strength of the effect.
![ghosting](https://github.com/mario-deluna/php-chip8/assets/956212/b0014e39-ed44-4bde-a6a1-2f314502a21c)* **CRT Effect**
Some might hate this effect; I like it, but of course, you can turn it off.
![crt](https://github.com/mario-deluna/php-chip8/assets/956212/5d2c269c-55fd-481a-8699-0695c258b978)* **GUI!**
The GUI is created using an immediate mode style of drawing. You get results really quickly, the code is really ugly and performance is really not great.## FAQ
* **What is this?**
It is a Chip8 Emulator written in PHP.
* **Can I use it in Production?**
Of course! Its beyond my understanding why you would want to do that, but sure go for it!
* **Why did you make this?**
Yes!
* **Thats not a real answer**
Yes!
* **Is this a real FAQ?**
Yes!
* **Yes!**
No!## How To use it
1. Clone the repository
```
$ git clone [email protected]:mario-deluna/php-chip8.git
```
2. Install the dependencies
```
$ cd php-chip8
$ composer install
```
3. Double check [PHP-GLFW](http://github.com/mario-deluna/php-glfw) is properly installed.
4. Run the emulator
```
$ php bin/start.php
```## Credits
- [Mario Döring](https://github.com/mario-deluna)
- [All Contributors](https://github.com/mario-deluna/php-chip8/contributors)## License
Please see [License File](https://github.com/mario-deluna/php-chip8/blob/master/LICENSE) for more information.