initial commit

This commit is contained in:
2026-07-15 15:02:54 +10:00
commit 8e26d3e19d
8 changed files with 168 additions and 0 deletions

27
src/emu.h Normal file
View 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);