A chip-8 interpreter in python (pyglet)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Juhani Krekelä 08e3123c4a Update README.md 2 weeks ago
.gitignore First commit 4 years ago
CC0 First commit 4 years ago
README.md Update README.md 2 weeks ago
sipsi-8.py Make CPU speed configurable when running program 2 weeks ago

README.md

Name

"Sipsi" is Finnish for a potato chip.

Usage

python3 sipsi-8.py path/to/chip-8/file [instructions-per-second]

Input

Hardcoded (sorry)

1 2 3 4
Q W E R
A S D F
Z X C V

which maps to

1 2 3 C
4 5 6 D
7 8 9 E
A 0 B F

Games

Get some here or here

Code quality

Pretty bad

Emulation speed

Instructions are run 500 times a second by default. This can be changed by passing in a second argument to sipsi-8.

Draw sprint

To reduce sprite flicker, sipsi-8 can run upto two ticks' worth of cycles after a draw call. This is since chip-8 often does drawing in pairs, where the first in the pair erases the old sprite and the next one draws it back. If they happen on different frames, this results in very back flickering.

To avoid an issue of pairing one sprite's draw to other's erase, a sprint is invalidated if it hits a jump, call, or a return.

Games improved by draw sprint:

  • Brix and its descendants
  • UFO

Games unaffected by draw sprint:

  • Pong and Pong2 (Draws are too far from each other)
  • Tetris (Does jumps inbetween)
  • Blitz (Does jumps inbetween. If invalidation upon jump is disabled, ends up pairing wrong draw calls)

Issues

  • Keyboard can't be changed
  • FPS can't be changed
  • Window size can't be changed
  • No error handing on opening a file

Requirements

  • pyglet (pip3 install pyglet)

License

Creative Commons Zero 1.0