CPU testing

This commit is contained in:
2025-01-31 17:07:09 -07:00
parent 9a6dc67c3e
commit 5206c3871e
11 changed files with 212 additions and 14 deletions

View File

@ -11,7 +11,7 @@ typedef uint32_t u32;
typedef uint64_t u64;
#define BIT(a, n) ((a & (1 << n)) ? 1 : 0)
#define BIT_SET(a, n, on) {if(on) a |= (1 << n); else a &= !(1 << n);}
#define BIT_SET(a, n, on) {if(on) a |= (1 << n); else a &= ~(1 << n);}
#define BETWEEN(a, b, c) ((a >= b) && (a <= c))
void delay(u32 ms);

View File

@ -63,4 +63,6 @@ void cpu_set_ie_register(u8 ie);
cpu_registers *cpu_get_regs();
u8 cpu_get_int_flags();
void cpu_set_int_flags(u8 value);
void cpu_set_int_flags(u8 value);
void inst_to_str(cpu_context *ctx, char *str);

6
include/dbg.h Normal file
View File

@ -0,0 +1,6 @@
#pragma once
#include <common.h>
void dbg_update();
void dbg_print();

6
include/io.h Normal file
View File

@ -0,0 +1,6 @@
#pragma once
#include <common.h>
u8 io_read(u16 address);
void io_write(u16 address, u8 value);