cemulationchip-8

(CHIP8 Emulator) Why is memory taken as char datatype


new to emudev starting out by building a CHIP8 emulator in C. why is its 4k memory takes as char datatype? I believe I am missing some really fundamental information. help

also, what are flags? CHIP8 has 16 (15?) registers VN from 0-F to carry flags. What does it mean?

Thanks :)


Solution

  • The emulator use char * datatype because in most systems the char size is 1 (1 byte) so is the ideal type to identify generic bytes in memory. As said by others unsigned char or uint8_t (form stdint.h) would be preferable for this usage.

    You can think about flags as a set of booleans that get set, unset automatically. The most simple one is the Overflow flag that is set if the result of the previous operation add an overflow.