passed json tests

This commit is contained in:
2024-04-04 02:56:13 -07:00
parent 5c573789c9
commit 028eca6ffc
511 changed files with 25664 additions and 115 deletions

View File

@@ -13,6 +13,9 @@ class AddressSpace {
bool bootromLoaded = true;
Byte bootrom[BOOTROM_SIZE] = {0};
std::vector<Byte> game;
bool testing;
Byte testRam[0xFFFF];
Byte* cartridgeRam = nullptr;
public:
AddressSpace() {
@@ -20,8 +23,6 @@ public:
memoryLayout = {};
}
Byte* cartridgeRam = nullptr;
struct {
Byte* romBank0; //[ROM_BANK_SIZE] Mapped to 0x0000
Byte* romBankSwitch; //[ROM_BANK_SIZE] Mapped to 0x4000
@@ -117,8 +118,12 @@ public:
Byte latchClockData = 0x00;
Byte ramBankRTCRegister = 0x00;
void setTesting(bool state);
//read
Byte operator[](const Word address) const {
if (testing)
return testRam[address];
if (address < 0x0100 && bootromLoaded)
return bootrom[address];
if (address < 0x4000)
@@ -248,6 +253,8 @@ public:
//write
Byte& operator[](const Word address) {
if (testing)
return testRam[address];
if (address < 0x0100 && bootromLoaded)
return bootrom[address];
if (address < 0x8000)