bytechip-8

CHIP-8 game has an odd number of bytes


I have been working on a CHIP8 emulator and am using the hex-editor in notepad++ to view the hex values. I happened to notice that some of the games like "Blitz" by David Winter have an odd number of bytes.

Blitx properties window

Blitz hex data

In CHIP8, each opcode is 2 bytes long, so there should be an even number of bytes, right?


Solution

  • As you can see in the hex dump, the author has embedded the string BLITZ By David WINTER into the ROM. Maybe this string is shown somewhere in the game, or maybe it's just his little way of signing his creation.

    The string is 21 characters long, which is why you end up with an odd file size.
    The game begins with the instruction 0x1217, which is a jump to address 0x217. That corresponds to the first byte following the string, since games are loaded into memory at address 0x200.