• the emulator contains the font to render

  • fonts are 4 pixels wide by 5 pixels tall

  • assigned from 0 to F (i.e. 16 fonts)

  • ROMs will read the fonts and render

    1. set I to character’s memory location
    2. draw character
  • should exist within the CHIP-8 interpreter memory region

    image.png

  • common font set:

    0xF0, 0x90, 0x90, 0x90, 0xF0, // 0
    0x20, 0x60, 0x20, 0x20, 0x70, // 1
    0xF0, 0x10, 0xF0, 0x80, 0xF0, // 2
    0xF0, 0x10, 0xF0, 0x10, 0xF0, // 3
    0x90, 0x90, 0xF0, 0x10, 0x10, // 4
    0xF0, 0x80, 0xF0, 0x10, 0xF0, // 5
    0xF0, 0x80, 0xF0, 0x90, 0xF0, // 6
    0xF0, 0x10, 0x20, 0x40, 0x40, // 7
    0xF0, 0x90, 0xF0, 0x90, 0xF0, // 8
    0xF0, 0x90, 0xF0, 0x10, 0xF0, // 9
    0xF0, 0x90, 0xF0, 0x90, 0x90, // A
    0xE0, 0x90, 0xE0, 0x90, 0xE0, // B
    0xF0, 0x80, 0x80, 0x80, 0xF0, // C
    0xE0, 0x90, 0x90, 0x90, 0xE0, // D
    0xF0, 0x80, 0xF0, 0x80, 0xF0, // E
    0xF0, 0x80, 0xF0, 0x80, 0x80  // F
    
    • every byte corresponds to a row

    • every bit corresponds to a pixel drawn

    • for all fonts (only fonts), they occupy at most 4 pixels (so the leading 4 bits are set)

    • e.g. 0 → 0xF0, 0x90, 0x90, 0x90, 0xF0

      1111 0000
      1001 0000
      1001 0000
      1001 0000
      1111 0000
      
    • when rendered:

      image.png