CHIP-8 Emulator (Beta Version)

Good morning!

I’m learning to use C again, with the idea of writing one or more emulators for simple platforms. I started with this one, and in just a few days I’ve achieved a “decent” version that I’d like to share.

We’re nearing the end of the year, which makes it a difficult time to move projects forward. At least in my country, there are many social gatherings and end-of-year celebrations. And in January I’ll be traveling. Still, I wanted to start this thread and share the progress so far, since the program works and is playable.


CHIP-8 Emulator for PicoCalc (RP2040)

I’ve been working on a CHIP-8 emulator for the Clockwork PicoCalc, written in C and running directly on the PicoCalc hardware (RP2040) .

The project started as an exploration of the PicoCalc SDK and gradually evolved into a fully playable emulator capable of running classic CHIP-8 programs such as PONG, Tetris, and similar early titles.

This work is built on top of Blair’s PicoCalc SDK (thanks @BlairLeduc !), which provided the foundation for graphics, input, storage, and overall system integration.


What the emulator currently does

At its current stage, the emulator:

  • Implements the full standard CHIP-8 instruction set
  • Runs on a RP2040-based PicoCalc
  • Uses the PicoCalc LCD with:
    • Centered 64×32 CHIP-8 display
    • Scaled pixels for good readability
    • Incremental (diff-based) rendering for decent performance
  • Supports:
    • Delay and sound timers at 60 Hz
    • Keyboard input mapped to the CHIP-8 hex keypad
    • A ROM selection menu that scans .CH8 files from the /roms directory
  • Allows:
    • Selecting a ROM from a menu at startup
    • Exiting a running game with ESC and returning to the ROM menu

Overall, classic CHIP-8 games are fully playable and responsive.


Current state of the project

  • The emulator is functional and stable
  • Performance is good enough for real gameplay on the PicoCalc
  • Some visual details (minor flicker in certain ROMs, menu polish) are still being refined
  • The codebase is intentionally kept simple and readable, with future expansion in mind

This is very much a working, usable emulator, not just a proof of concept, but there is still room to grow.


UF2 and some roms…

EDIT: I’ve just uploaded the code to GitHub so you can take a look at it.


Planned future work

Once development resumes, the next steps include:

  • Super-CHIP (SCHIP) support
    • 128×64 resolution
    • Extended instructions
  • Better timing control and fine-tuning of CPU speed
  • Small UI improvements in the ROM menu
  • Optional emulator “quirks” configuration for broader ROM compatibility
  • Code cleanup and documentation

Development pause & GitHub release

I’m about to enter a vacation period and will be out of the country until the end of January, so development will slow down significantly during that time.

Once I’m back, I plan to:

  • Clean up the code
  • Add documentation
  • Publish the full source code on GitHub

At that point, others will be able to build, study, and extend the emulator easily.


More to come soon — after the holidays. :grin:





11 Likes

If you have time would it be possible to post a RP2350/pico2 build?

Ariel… si no te importa, comparte el fuente ahora que vienen 4 dias de vacaciones… y asi podremos echarle un ojo estos dias.

(Edtoy trabajando en una VM de cosecha propia, y tu fuente me puede servir para ayudarme a entender como “portarla” a Picocalc) :wink:

Muchas gracias!

1 Like

Hi @adcockm , @Hark0 !
I’ve just uploaded the code to GitHub so you can take a look at it.

I need to be very honest here: it’s been many years since I last wrote a single line of C code . The code I’ve shared works, but I’m quite sure it can be improved a lot. This is a very preliminary version, so please keep that in mind. My apologies for that.

Also… I’m pretty sure I’ve “broken” a good part of @BlairLeduc excellent work. Simply put, my limited knowledge of the platform and the language wasn’t enough to use his work properly.

I’m also not entirely sure how to build a version for the RP2350, although I’m confident you’ll be able to do it based on the files I’ve shared.

For all these reasons, I was planning to wait until I return from vacation to review the project and only then share the code.

I’m open to suggestions, changes, or whatever comes out of reviewing this messy code. I promise to improve it in 2026.

Thanks again.

1 Like

I built and uploaded a .u2f for the pico2 here. The menu works and I could load and run the example chip8 files. (I’m guessing it’s functionally the same as the pico build.) I just used

cmake -DPICO_PLATFORM=rp2350 -DPICO_BOARD=pico2 ..

from a build subdirectory and it completed fine.

For anyonenot wanting to dig into the code, keymapping from the source is:
PicoCalc keys 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 and A, B, C, D, E, F
along with convenient duplicate mappings for:
LEFT = 4
RIGHT = 6
UP = 2
DOWN = 8
ENTER = 5
SPACE = 0

Download the .u2f file here
(I used a free file hosting service for this, and the file will apparently be deleted in 6 days.)

Don’t apologize for your code, @ArielPalazzesi! I think it’s cool you ported CHIP-8 over to the PicoCalc. The only things I noticed that seemed a bit rough at the moment were the key handling (which makes “action” games a bit difficult at times), display animation/refresh sometimes, and maybe some speed issues.

Since the CHIP-8 screen doesn’t fully scale to the PicoCalc display, you may want to consider having some sort of background color other than black for the unused portion of the screen. Currently it looks a bit weird when something moves off the bottom of the screen and wraps to the top, and vice-versa (like the pong paddle) since the wrap isn’t happening at the edge of the actual screen.

This looks like a very solid start though! Thanks for sharing your project and making the code available.

3 Likes

Hi @adcockm!
Thanks for all the comments. :clap:

Yes, I’m aware of almost everything you mention. In fact, in some of the tests I ran I had added a colored frame around the CHIP-8 display area. It looks like I removed it at some point.

I’m also aware of some display issues. I try to redraw only the pixels that change from one frame to the next, but some games — like Pong — constantly redraw certain elements (the paddles, in that case), and the emulator correctly redraws them as well. With a bit of luck, I hope to be able to implement an algorithm that detects those cases too and avoids unnecessary redraws.

The keyboard handling is another area that needs improvement. PicoCalc is a new platform for me, and I’m still getting fully familiar with it.

But the important thing — at least for me — is that with this project and others I have in mind, regardless of how useful they may or may not be, I’m going to have a lot of fun experimenting and learning during their development.

PS: Would you mind if I upload the UF2 file you just shared to my GitHub repository, so it can remain available for longer? :fire:

2 Likes

Sure, feel free to upload the UF2 file to your github repo. :slight_smile:

Enjoy your holidays!

1 Like