CHIP-8 virtual machine emulator - Load chip8 ROMs in the prime - Printable Version

+- HP Forums (http://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: HP Prime Software Library (/forum-15.html)
+--- Thread: CHIP-8 virtual machine emulator - Load chip8 ROMs in the prime (/thread-475.html)



RE: CHIP-8 virtual machine emulator - Load chip8 ROMs in the prime - Mark Power - 06-03-2015 02:47 PM

I've put together a Chip-8 App using file handling from the Gallery (PNG Viewer) App and an alternative emulator I put together. I've included Pong, Space Invaders and Tetris ROMs as samples. You can find more at http://chip8.com/?page=109.

This is only the first version so some tuning is needed.

To copy additional Chip8 ROMs to your calculator, open the HP Connectivity Kit and load Chip8 ROMS into the "Files" Folder inside Chip8 App.
Then, open the Chip8 App from Connectivity Kit and Press Save Button.

*Press [VIEW] to access the Menu.
*To Open a File, select Open and then select the file.
*To Delete a File, select Delete and then select the file, or just select Delete ALL.

Keyboard mapping (calculator to Chip8)
789/ 123C
456* 456D
123- 789E
0. + A0BF

Bugs:
*Screen size needs fixing, but when I turn BLIT scaling on in display_sprite the calculator hangs. See lines 375 onwards.
*Timing is wrong, just fast enough on the calculator to play, but way too fast on the emulator.

Thanks to:
*Andrés Vélez (mandresve) manuel.velez@uptc.edu.co for the App framework
*Vik2015 for chip8.c which is the basis of the emulator
I've fixed the display scaling problem so that the whole of the HP Prime screen is used and tidied up a few things. You now don't see the icon.png file in the list of ROMS to play.

I've included Breakout, Pong2, Space Invaders and Tetris in the zip file for you to play as samples.

Speed is the next thing to improve and then I'll add SChip functions so you can play the more advanced games.

Anyone feeling adventurous can press the D (Define) key during a game and drop into the Prime debugger.
I've added emulation of SCHIP instructions which means you can now play H.Piper!

The latest version of Chip8 along with ROMS for H.Piper!, Breakout, Lunar Lander, Pong2, Space Invaders, Tetris and Car is available to download here on the HPCC web site.

Fixes:
* Compatible with firmware 2015 6 17 (8151)
* This is my first attempt at implementing SCHIP instructions, so you may find other games don't work as expected - the original documentation is a little vague, so it is a bit of a case of trial and error. The car driving game is included in the ROMS, but looks a bit wonky at present.