Finished CPU instructions and created ui window.

This commit is contained in:
2025-01-31 14:39:38 -07:00
parent 83c5a7cbe6
commit 9a6dc67c3e
12 changed files with 265 additions and 33 deletions

View File

@ -30,7 +30,9 @@ typedef struct {
bool stepping;
bool int_master_enabled;
bool enabling_ime;
u8 ie_register;
u8 int_flags;
} cpu_context;
void cpu_init();
@ -41,6 +43,8 @@ typedef void (*IN_PROC)(cpu_context *);
IN_PROC inst_get_processor(in_type type);
#define CPU_FLAG_Z BIT(ctx->regs.f, 7)
#define CPU_FLAG_N BIT(ctx->regs.f, 6)
#define CPU_FLAG_H BIT(ctx->regs.f, 5)
#define CPU_FLAG_C BIT(ctx->regs.f, 4)
u16 cpu_read_reg(reg_type rt);
@ -56,4 +60,7 @@ void fetch_data();
u8 cpu_get_ie_register();
void cpu_set_ie_register(u8 ie);
cpu_registers *cpu_get_regs();
cpu_registers *cpu_get_regs();
u8 cpu_get_int_flags();
void cpu_set_int_flags(u8 value);