Skip to content

mario-deluna/php-chip8

Repository files navigation

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 and the VISU framework.

demo

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

  • 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:

    keyboard
    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

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

  • 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 is properly installed.
  4. Run the emulator
    $ php bin/start.php
    

Credits

License

Please see License File for more information.

About

Yet another CHIP-8 emulator, but in PHP!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages