CPU testing
This commit is contained in:
21
lib/dbg.c
Normal file
21
lib/dbg.c
Normal 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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user