Skip to content
Putting It Together
step 1/5

Reading — step 1 of 5

Read

~2 min readProduction

Putting It Together

The complete cycle:

python

Main loop:

python

500 Hz is standard. Some games need 700 Hz to feel right. Make it configurable.

Testing:

  • BC_test.ch8: tests core opcodes.
  • chip8-test-suite (Timendus): comprehensive ROM test.
  • Run famous games: Pong (PONG), Tetris, Space Invaders.

Common issues debugging:

  • Sprites disappear: didn't wrap coordinates.
  • Game runs too fast/slow: CPU rate misconfigured.
  • Garbage on screen: not clearing display, or DRW XOR bug.
  • Keys not detected: check key mapping.
  • Crashes on RET: stack underflow (forgot to push on CALL).

Quirks (different per implementation):

  • Shift opcodes: shift VX (modern) or VY then to VX (original).
  • I increment in FX55/FX65: yes (original) or no (modern).
  • Display wait: some games expect DRW to wait for vblank.

Have a quirks config so different ROMs can be played.

Discussion

Ask a question, share an insight, or help someone who’s stuck.

Sign in to post a comment or reply.

Loading…