mattmikolay / chip-8

A collection of CHIP-8 programs and documentation
MIT License
293 stars 10 forks source link

Memory address typo in CHIP-8 Technical Reference #9

Open tysonliddell opened 1 year ago

tysonliddell commented 1 year ago

Hi @mattmikolay,

Thanks for the awesome CHIP-8 resources. I'm writing my first emulator now using your wiki and its links as a reference and I think I have come across a typo. On a system with 4096 bytes of memory, if the final 352 bytes are reserved (and the first 0x200), then addresses 0x200 to 0xE9F should be free for a CHIP-8 program. However the CHIP-8 Technical Reference says otherwise. This is the change that I think is needed:

- On VIPs with 4096 bytes of RAM (and modern implementations), this leaves addresses 0x200 to 0xE8F free. 
+ On VIPs with 4096 bytes of RAM (and modern implementations), this leaves addresses 0x200 to 0xE9F free. 
tysonliddell commented 1 year ago

Interestingly, I found the following in the RCA COSMAC VIC CDP18S711 Instruction Manual:

After the above practice you are ready to design more sophisticated CHIP-8 programs. Always prepare a flowchart before actually writing a program. The last 352 bytes of on-card RAM are used for variables and display refresh. In a 2048-byte RAM system you can use locations 0200-069F for your programs. This area is enough for 592 CHIP-8 instructions (1184 bytes). In a 4096-byte RAM system you can use locations 0200-0E8F. This area is equal to 1608-CHIP-8 instructions (3216 bytes).

I wonder if this was the source of the typo, or if there's something else I'm not getting.

pyrsmk commented 6 months ago

I deleted my last comment because it was erroneous. Anyway, stumbled upon the same typo ;)