I don't know how many turing mashines deep this is but here is a Chip8 Emulator written in PHP.
Built on PHP-GLFW and the VISU framework.
-
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.
Pressspace
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.
- 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!
- Clone the repository
$ git clone [email protected]:mario-deluna/php-chip8.git
- Install the dependencies
$ cd php-chip8 $ composer install
- Double check PHP-GLFW is properly installed.
- Run the emulator
$ php bin/start.php
Please see License File for more information.