Gamebuino CHIP-8 emulator

Share your games and programs with the community.

Gamebuino CHIP-8 emulator

Postby deepsheet » Sun Aug 24, 2014 10:59 pm

Gamebuino CHIP-8 emulator (Alpha version 0.1)

gamebuino_chip8.png
gamebuino_chip8.png (18.37 KiB) Viewed 5797 times


This is a WIP, started this afternoon. I'll add more info about CHIP-8 here, but for now I just want to make a first release. Source will follow soon, after some needed refactoring!

I started coding this emulator back in November 2011, when I was preparing for my BSc final year project (CompSci yay). I wanted to make and document an emulator on a microcontroller. Arduino and the CHIP-8 were the perfect choices. Finally, the idea was scrapped and I was left with some code I had hacked as an early prototype. The code worked fine on a KS0108 LCD display and an Arduino Mega 2560.

The code is a port from various C/C++ CHIP-8 emulators, with changes to work on the Gamebuino hardware and the limitations of the AVR microcontrollers. It requires many improvements and serious refactoring before releasing, or else git will mess everything up.

What doesn't work and/or needs fixing (the list will grow):
  • Controls. CHIP-8 uses a hexadecimal keypad and games don't follow a pattern, for example for direction keys. Ideas?
  • Speed of emulation. Currently I have set the Gamebuino to run at 120 fps (I don't think it does though). There is no need to update the screen 120 times per second, but the emulator should run faster than that.
  • Games loading. Games should be loaded from the SD card. All available CHIP-8 games fit into the 128MB SD of the Gamebuino ;)
  • RAM handling. Currently everything is stored on the RAM, from fonts to games. This is stupid, we can access the Flash and save alot of space!

Download: https://dl.dropboxusercontent.com/u/1733459/CHIP8.HEX
deepsheet
 
Posts: 10
Joined: Fri Aug 01, 2014 6:18 pm

Re: Gamebuino CHIP-8 emulator

Postby Myndale » Mon Aug 25, 2014 1:46 am

Awesome! I wrote a CHIP-8 emulator a few years back, I was tempted to port it to Gamebuino but immediately hit that problem of the 4K address space. I was toying with the idea of writing something like a 2-way set associative cache (similar to what ARM-based architectures like the PSP use) with a swap buffer on the SD card, although I don't know how it would hold up performance-wise. If you supplemented it by keeping read-only cache lines for the program code in EEPROM or even Flash then I suspect it would be doable.

With regards to the key mapping I'd suggest going through all the CHIP-8 games and storing the mapping for each one individually along with a check-sum to the corresponding game.

Good luck! I'll be keeping an eye on this one. :)
Myndale
 
Posts: 507
Joined: Sat Mar 01, 2014 1:25 am

Re: Gamebuino CHIP-8 emulator

Postby Sushi » Wed Nov 19, 2014 11:38 pm

I think it's pretty interesting. Just wondering why you wouldn't just rewrite the game? They're pretty simple. Anyway, found this. Runs on an 60mhz ARM chip, and you've managed to get it on a 16mhz microcontroller. Kudos!
User avatar
Sushi
 
Posts: 52
Joined: Tue Oct 07, 2014 12:12 am


Return to Games Gallery

Who is online

Users browsing this forum: No registered users and 19 guests

cron