instruction decoding
This commit is contained in:
19
src/emu.h
19
src/emu.h
@@ -6,22 +6,15 @@
|
||||
#include "memory.h"
|
||||
|
||||
// -- TYPES -- //
|
||||
typedef enum {
|
||||
REG_A, REG_B, REG_C,
|
||||
|
||||
REG_X, REG_Y, REG_Z,
|
||||
REG_R,
|
||||
|
||||
REG_PC, REG_IHP, REG_SP, REG_F,
|
||||
|
||||
REG_MAX // all registers should come before this one, this is so we can
|
||||
// automatically know the length of the registers array
|
||||
} Register;
|
||||
|
||||
typedef struct {
|
||||
uint16_t regs[REG_MAX];
|
||||
Memory* mem;
|
||||
|
||||
uint32_t pc;
|
||||
uint32_t ihp;
|
||||
uint32_t sp;
|
||||
} Emulator;
|
||||
|
||||
// -- FUNCTIONS -- //
|
||||
Emulator* initEmulator(uint32_t memorySize);
|
||||
Emulator* initEmulator(uint32_t memorySize);
|
||||
void freeEmulator(Emulator* emu);
|
||||
Reference in New Issue
Block a user