implemented registers

This commit is contained in:
Ghostie 2025-02-08 18:23:13 -05:00
parent 74b997c6c7
commit 155a7f7a04
4 changed files with 25 additions and 0 deletions

5
Readme.org Normal file
View File

@ -0,0 +1,5 @@
* Chip8 Suite
Emulator and assembler for the Chip8.
See notes taken through the development in [[file:Notes.org][Notes.org]]

View File

@ -3,10 +3,12 @@
#include "config.h" #include "config.h"
#include "mem.h" #include "mem.h"
#include "registers.h"
struct chip8 struct chip8
{ {
struct chip8_memory memory; struct chip8_memory memory;
struct chip8_registers registers;
}; };
#endif #endif

View File

@ -8,4 +8,6 @@
#define CHIP8_DISPLAY_WIDTH 63 #define CHIP8_DISPLAY_WIDTH 63
#define CHIP8_DISPLAY_HEIGHT 32 #define CHIP8_DISPLAY_HEIGHT 32
#define CHIP8_TOTAL_DATA_REGISTERS 16
#endif #endif

16
include/registers.h Normal file
View File

@ -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