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

21
lib/dbg.c Normal file
View File

@ -0,0 +1,21 @@
#include <dbg.h>
#include <bus.h>
static char dbg_msg[1024] = {0};
static int msg_size = 0;
void dbg_update(){
if (bus_read(0xFF02) == 0x81) {
char c = bus_read(0xFF01);
dbg_msg[msg_size++] = c;
bus_write(0xFF02, 0);
}
}
void dbg_print(){
if(dbg_msg[0]) {
printf("DBG: %s\n", dbg_msg);
}
}