diff --git a/Readme.org b/Readme.org new file mode 100644 index 0000000..924e1d9 --- /dev/null +++ b/Readme.org @@ -0,0 +1,5 @@ +* Chip8 Suite + +Emulator and assembler for the Chip8. + +See notes taken through the development in [[file:Notes.org][Notes.org]] diff --git a/include/chip8.h b/include/chip8.h index b214a05..1f2746d 100644 --- a/include/chip8.h +++ b/include/chip8.h @@ -3,10 +3,12 @@ #include "config.h" #include "mem.h" +#include "registers.h" struct chip8 { struct chip8_memory memory; + struct chip8_registers registers; }; #endif diff --git a/include/config.h b/include/config.h index d449802..84e3a9d 100644 --- a/include/config.h +++ b/include/config.h @@ -8,4 +8,6 @@ #define CHIP8_DISPLAY_WIDTH 63 #define CHIP8_DISPLAY_HEIGHT 32 +#define CHIP8_TOTAL_DATA_REGISTERS 16 + #endif diff --git a/include/registers.h b/include/registers.h new file mode 100644 index 0000000..d80df8e --- /dev/null +++ b/include/registers.h @@ -0,0 +1,16 @@ +#ifndef __REGISTERS_H +#define __REGISTERS_H + +#include "config.h" + +struct chip8_registers +{ + unsigned char V[CHIP8_TOTAL_DATA_REGISTERS]; + unsigned short I; + unsigned char DT; // Delay timer + unsigned char ST; // Delay timer + unsigned short PC; // Program counter + unsigned char SP; // Stack pointer +}; + +#endif