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

@ -3,6 +3,7 @@
#include <cart.h>
#include <cpu.h>
#include <ram.h>
#include <io.h>
// 0x0000 - 0x3FFF : ROM Bank 0
// 0x4000 - 0x7FFF : ROM Bank 1 - Switchable
@ -48,9 +49,8 @@ u8 bus_read(u16 address) {
} else if (address < 0xFF80) {
//IO registers
//TODO
printf("UNSUPPORTED bus_read(%04X)\n", address);
//NO_IMPL
return 0;
return io_read(address);
} else if (address == 0xFFFF) {
//CPU ENABLE REGISTER
//TODO
@ -68,6 +68,7 @@ void bus_write(u16 address, u8 value) {
//Char/Map Data
//TODO
printf("UNSUPPORTED bus_write(%04X)\n", address);
return;
//NO_IMPL
} else if (address < 0xC000) {
//Cartridge RAM
@ -84,6 +85,7 @@ void bus_write(u16 address, u8 value) {
//OAM
//TODO
printf("UNSUPPORTED bus_write(%04X)\n", address);
return;
//NO_IMPL
} else if (address < 0xFF00) {
//reserved unusable
@ -91,7 +93,7 @@ void bus_write(u16 address, u8 value) {
} else if (address < 0xFF80) {
//IO registers
//TODO
printf("UNSUPPORTED bus_write(%04X)\n", address);
io_write(address, value);
//NO_IMPL
return;
} else if (address == 0xFFFF) {