o
odinpkg.dev
packages / library / CHIP-8

CHIP-8

ad07206library

A CHIP-8 emulator written in Odin

No license · updated 2 months ago

Specifications

CHIP-8 has the following components:

  • Memory: CHIP-8 has direct access to up to 4 kilobytes of RAM Display:
  • 64 x 32 pixels (or 128 x 64 for SUPER-CHIP) monochrome, ie. black or white
  • A program counter ("PC”) which points at the current instruction in memory
  • One 16-bit index register called “I” which is used to point at locations in memory
  • A stack for 16-bit addresses, which is used to call subroutines/functions and return from them
  • An 8-bit delay timer which is decremented at a rate of 60 Hz (60 times per second) until it reaches 0
  • An 8-bit sound timer which functions like the delay timer, but which also gives off a beeping sound as long as it’s not 0
  • 16 8-bit (one byte) general-purpose variable registers numbered 0 through F hexadecimal, ie. 0 through 15 in decimal, called V0 through VF
  • VF is also used as a flag register; many instructions will set it to either 1 or 0 based on some rule, for example using it as a carry flag