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: 8 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 (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-03-13T21:03:52.000Z (about 2 years ago)
- Last Synced: 2025-03-10T14:57:37.536Z (about 1 year ago)
- Topics: chip-8, chip8, emulator, php
- Language: PHP
- Homepage:
- Size: 171 KB
- Stars: 52
- Watchers: 4
- Forks: 2
- 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.

* [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_.

* **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.

* **CRT Effect**
Some might hate this effect; I like it, but of course, you can turn it off.

* **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 git@github.com: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.