initial commit
This commit is contained in:
27
src/emu.h
Normal file
27
src/emu.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#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;
|
||||
} Emulator;
|
||||
|
||||
// -- FUNCTIONS -- //
|
||||
Emulator* initEmulator(uint32_t memorySize);
|
||||
Reference in New Issue
Block a user