mirror of
https://github.com/zoriya/ComSquare.git
synced 2026-05-24 23:24:54 +00:00
Creating the structures of the register viewer
This commit is contained in:
+49
-49
@@ -29,7 +29,7 @@ Test(BusAccessor, GetWramStart)
|
||||
Init()
|
||||
std::shared_ptr<Memory::AMemory> accessor = nullptr;
|
||||
|
||||
accessor = snes._bus->getAccessor(0x7E0000);
|
||||
accessor = snes.bus->getAccessor(0x7E0000);
|
||||
cr_assert_eq(accessor.get(), snes.wram.get());
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ Test(BusAccessor, GetWramEnd)
|
||||
Init()
|
||||
std::shared_ptr<Memory::AMemory> accessor = nullptr;
|
||||
|
||||
accessor = snes._bus->getAccessor(0x7FFFFF);
|
||||
accessor = snes.bus->getAccessor(0x7FFFFF);
|
||||
cr_assert_eq(accessor.get(), snes.wram.get());
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ Test(BusAccessor, GetWramMirror)
|
||||
Init()
|
||||
std::shared_ptr<Memory::RectangleShadow> accessor = nullptr;
|
||||
|
||||
accessor = std::static_pointer_cast<Memory::RectangleShadow>(snes._bus->getAccessor(0x2F11FF));
|
||||
accessor = std::static_pointer_cast<Memory::RectangleShadow>(snes.bus->getAccessor(0x2F11FF));
|
||||
cr_assert_neq(accessor, nullptr);
|
||||
cr_assert_eq(accessor->_initial.get(), snes.wram.get());
|
||||
}
|
||||
@@ -57,7 +57,7 @@ Test(BusAccessor, GetWramMirror2)
|
||||
Init()
|
||||
std::shared_ptr<Memory::RectangleShadow> accessor = nullptr;
|
||||
|
||||
accessor = std::static_pointer_cast<Memory::RectangleShadow>(snes._bus->getAccessor(0x100000));
|
||||
accessor = std::static_pointer_cast<Memory::RectangleShadow>(snes.bus->getAccessor(0x100000));
|
||||
cr_assert_neq(accessor, nullptr);
|
||||
cr_assert_eq(accessor->_initial.get(), snes.wram.get());
|
||||
}
|
||||
@@ -67,7 +67,7 @@ Test(BusAccessor, GetWramMirror3)
|
||||
Init()
|
||||
std::shared_ptr<Memory::RectangleShadow> accessor = nullptr;
|
||||
|
||||
accessor = std::static_pointer_cast<Memory::RectangleShadow>(snes._bus->getAccessor(0x1010));
|
||||
accessor = std::static_pointer_cast<Memory::RectangleShadow>(snes.bus->getAccessor(0x1010));
|
||||
cr_assert_neq(accessor, nullptr);
|
||||
cr_assert_eq(accessor->_initial.get(), snes.wram.get());
|
||||
}
|
||||
@@ -75,7 +75,7 @@ Test(BusAccessor, GetWramMirror3)
|
||||
Test(BusAccessor, GetOpenBus)
|
||||
{
|
||||
Init()
|
||||
std::shared_ptr<Memory::AMemory> accessor = snes._bus->getAccessor(0x897654);
|
||||
std::shared_ptr<Memory::AMemory> accessor = snes.bus->getAccessor(0x897654);
|
||||
cr_assert_eq(accessor.get(), nullptr);
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ Test(BusAccessor, GetSramStart)
|
||||
Init()
|
||||
std::shared_ptr<Memory::RectangleShadow> accessor = nullptr;
|
||||
|
||||
accessor = std::static_pointer_cast<Memory::RectangleShadow>(snes._bus->getAccessor(0x700000));
|
||||
accessor = std::static_pointer_cast<Memory::RectangleShadow>(snes.bus->getAccessor(0x700000));
|
||||
cr_assert_eq(accessor->_initial.get(), snes.sram.get());
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ Test(BusAccessor, GetSramEnd)
|
||||
Init()
|
||||
std::shared_ptr<Memory::RectangleShadow> accessor = nullptr;
|
||||
|
||||
accessor = std::static_pointer_cast<Memory::RectangleShadow>(snes._bus->getAccessor(0x7D7FFF));
|
||||
accessor = std::static_pointer_cast<Memory::RectangleShadow>(snes.bus->getAccessor(0x7D7FFF));
|
||||
cr_assert_eq(accessor->_initial.get(), snes.sram.get());
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ Test(BusAccessor, GetSramMirror)
|
||||
Init()
|
||||
std::shared_ptr<Memory::ARectangleMemory> accessor = nullptr;
|
||||
|
||||
accessor = std::static_pointer_cast<Memory::ARectangleMemory>(snes._bus->getAccessor(0xF00123));
|
||||
accessor = std::static_pointer_cast<Memory::ARectangleMemory>(snes.bus->getAccessor(0xF00123));
|
||||
cr_assert_eq(accessor.get(), snes.sram.get());
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ Test(BusAccessor, GetAPUStart)
|
||||
Init()
|
||||
std::shared_ptr<Memory::AMemory> accessor = nullptr;
|
||||
|
||||
accessor = snes._bus->getAccessor(0x002140);
|
||||
accessor = snes.bus->getAccessor(0x002140);
|
||||
cr_assert_eq(accessor.get(), snes.apu.get());
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ Test(BusAccessor, GetAPUEnd)
|
||||
Init()
|
||||
std::shared_ptr<Memory::AMemory> accessor = nullptr;
|
||||
|
||||
accessor = snes._bus->getAccessor(0x002143);
|
||||
accessor = snes.bus->getAccessor(0x002143);
|
||||
cr_assert_eq(accessor.get(), snes.apu.get());
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ Test(BusAccessor, GetAPUMirror)
|
||||
Init()
|
||||
std::shared_ptr<Memory::MemoryShadow> accessor = nullptr;
|
||||
|
||||
accessor = std::static_pointer_cast<Memory::MemoryShadow>(snes._bus->getAccessor(0xAB2143));
|
||||
accessor = std::static_pointer_cast<Memory::MemoryShadow>(snes.bus->getAccessor(0xAB2143));
|
||||
cr_assert_eq(accessor->_initial.get(), snes.apu.get());
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ Test(BusAccessor, GetAPUMirrorFirstHalf)
|
||||
Init()
|
||||
std::shared_ptr<Memory::MemoryShadow> accessor = nullptr;
|
||||
|
||||
accessor = std::static_pointer_cast<Memory::MemoryShadow>(snes._bus->getAccessor(0x052143));
|
||||
accessor = std::static_pointer_cast<Memory::MemoryShadow>(snes.bus->getAccessor(0x052143));
|
||||
cr_assert_eq(accessor->_initial.get(), snes.apu.get());
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ Test(BusAccessor, GetCPUStart)
|
||||
Init()
|
||||
std::shared_ptr<Memory::AMemory> accessor = nullptr;
|
||||
|
||||
accessor = snes._bus->getAccessor(0x004200);
|
||||
accessor = snes.bus->getAccessor(0x004200);
|
||||
cr_assert_eq(accessor.get(), snes.cpu.get());
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ Test(BusAccessor, GetCPUEnd)
|
||||
Init()
|
||||
std::shared_ptr<Memory::AMemory> accessor = nullptr;
|
||||
|
||||
accessor = snes._bus->getAccessor(0x00421F);
|
||||
accessor = snes.bus->getAccessor(0x00421F);
|
||||
cr_assert_eq(accessor.get(), snes.cpu.get());
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ Test(BusAccessor, GetPPU1Start)
|
||||
Init()
|
||||
std::shared_ptr<Memory::AMemory> accessor = nullptr;
|
||||
|
||||
accessor = snes._bus->getAccessor(0x00213E);
|
||||
accessor = snes.bus->getAccessor(0x00213E);
|
||||
cr_assert_eq(accessor.get(), snes.ppu.get());
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ Test(BusAccessor, GetPPU1End)
|
||||
Init()
|
||||
std::shared_ptr<Memory::AMemory> accessor = nullptr;
|
||||
|
||||
accessor = snes._bus->getAccessor(0x00213F);
|
||||
accessor = snes.bus->getAccessor(0x00213F);
|
||||
cr_assert_eq(accessor.get(), snes.ppu.get());
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ Test(BusAccessor, GetCPU)
|
||||
Init()
|
||||
std::shared_ptr<Memory::AMemory> accessor = nullptr;
|
||||
|
||||
accessor = snes._bus->getAccessor(0x004212);
|
||||
accessor = snes.bus->getAccessor(0x004212);
|
||||
cr_assert_eq(accessor.get(), snes.cpu.get());
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ Test(BusAccessor, GetPPU1Mirror)
|
||||
Init()
|
||||
std::shared_ptr<Memory::MemoryShadow> accessor = nullptr;
|
||||
|
||||
accessor = std::static_pointer_cast<Memory::MemoryShadow>(snes._bus->getAccessor(0x80213F));
|
||||
accessor = std::static_pointer_cast<Memory::MemoryShadow>(snes.bus->getAccessor(0x80213F));
|
||||
cr_assert_eq(accessor->_initial.get(), snes.ppu.get());
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ Test(BusAccessor, GetCPU2Mirror)
|
||||
Init()
|
||||
std::shared_ptr<Memory::MemoryShadow> accessor = nullptr;
|
||||
|
||||
accessor = std::static_pointer_cast<Memory::MemoryShadow>(snes._bus->getAccessor(0x804212));
|
||||
accessor = std::static_pointer_cast<Memory::MemoryShadow>(snes.bus->getAccessor(0x804212));
|
||||
cr_assert_eq(accessor->_initial.get(), snes.cpu.get());
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ Test(BusAccessor, GetRomStart)
|
||||
Init()
|
||||
std::shared_ptr<Memory::AMemory> accessor = nullptr;
|
||||
|
||||
accessor = snes._bus->getAccessor(0x808000);
|
||||
accessor = snes.bus->getAccessor(0x808000);
|
||||
cr_assert_eq(accessor.get(), snes.cartridge.get());
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ Test(BusAccessor, GetRomEnd)
|
||||
Init()
|
||||
std::shared_ptr<Memory::AMemory> accessor = nullptr;
|
||||
|
||||
accessor = snes._bus->getAccessor(0xFFFFFF);
|
||||
accessor = snes.bus->getAccessor(0xFFFFFF);
|
||||
cr_assert_eq(accessor.get(), snes.cartridge.get());
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ Test(BusAccessor, GetRomMirror)
|
||||
Init()
|
||||
std::shared_ptr<Memory::RectangleShadow> accessor = nullptr;
|
||||
|
||||
accessor = std::static_pointer_cast<Memory::RectangleShadow>(snes._bus->getAccessor(0x694200));
|
||||
accessor = std::static_pointer_cast<Memory::RectangleShadow>(snes.bus->getAccessor(0x694200));
|
||||
cr_assert_eq(accessor->_initial.get(), snes.cartridge.get());
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ Test(BusAccessor, GetRomMirror2)
|
||||
Init()
|
||||
std::shared_ptr<Memory::RectangleShadow> accessor = nullptr;
|
||||
|
||||
accessor = std::static_pointer_cast<Memory::RectangleShadow>(snes._bus->getAccessor(0x01FEDC));
|
||||
accessor = std::static_pointer_cast<Memory::RectangleShadow>(snes.bus->getAccessor(0x01FEDC));
|
||||
cr_assert_eq(accessor->_initial.get(), snes.cartridge.get());
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ Test(BusAccessor, GetRomMirror3)
|
||||
Init()
|
||||
std::shared_ptr<Memory::RectangleShadow> accessor = nullptr;
|
||||
|
||||
accessor = std::static_pointer_cast<Memory::RectangleShadow>(snes._bus->getAccessor(0xDE1248));
|
||||
accessor = std::static_pointer_cast<Memory::RectangleShadow>(snes.bus->getAccessor(0xDE1248));
|
||||
cr_assert_eq(accessor->_initial.get(), snes.cartridge.get());
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ Test(BusAccessor, Get0x0)
|
||||
Init()
|
||||
std::shared_ptr<Memory::RectangleShadow> accessor = nullptr;
|
||||
|
||||
accessor = std::static_pointer_cast<Memory::RectangleShadow>(snes._bus->getAccessor(0x0));
|
||||
accessor = std::static_pointer_cast<Memory::RectangleShadow>(snes.bus->getAccessor(0x0));
|
||||
cr_assert_eq(accessor->_initial.get(), snes.wram.get());
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ Test(BusRead, Read0x0)
|
||||
uint8_t data;
|
||||
|
||||
snes.wram->_data[0] = 123;
|
||||
data = snes._bus->read(0x0);
|
||||
data = snes.bus->read(0x0);
|
||||
cr_assert_eq(data, 123);
|
||||
}
|
||||
|
||||
@@ -280,8 +280,8 @@ Test(BusRead, ReadOutside, .init = cr_redirect_stdout)
|
||||
Init()
|
||||
uint8_t data;
|
||||
|
||||
snes._bus->_openBus = 123;
|
||||
data = snes._bus->read(0x002000);
|
||||
snes.bus->_openBus = 123;
|
||||
data = snes.bus->read(0x002000);
|
||||
cr_assert_eq(data, 123);
|
||||
}
|
||||
|
||||
@@ -290,8 +290,8 @@ Test(BusRead, ReadOutside2, .init = cr_redirect_stdout)
|
||||
Init()
|
||||
uint8_t data;
|
||||
|
||||
snes._bus->_openBus = 123;
|
||||
data = snes._bus->read(0xBF2FFF);
|
||||
snes.bus->_openBus = 123;
|
||||
data = snes.bus->read(0xBF2FFF);
|
||||
cr_assert_eq(data, 123);
|
||||
}
|
||||
|
||||
@@ -300,8 +300,8 @@ Test(BusRead, ReadOutside3, .init = cr_redirect_stdout)
|
||||
Init()
|
||||
uint8_t data;
|
||||
|
||||
snes._bus->_openBus = 123;
|
||||
data = snes._bus->read(0x127654);
|
||||
snes.bus->_openBus = 123;
|
||||
data = snes.bus->read(0x127654);
|
||||
cr_assert_eq(data, 123);
|
||||
}
|
||||
|
||||
@@ -311,7 +311,7 @@ Test(BusRead, ReadAPU)
|
||||
uint8_t data;
|
||||
|
||||
snes.apu->_registers.port0 = 123;
|
||||
data = snes._bus->read(0x002140);
|
||||
data = snes.bus->read(0x002140);
|
||||
cr_assert_eq(data, 123);
|
||||
}
|
||||
|
||||
@@ -321,7 +321,7 @@ Test(BusRead, ReadROM)
|
||||
uint8_t data;
|
||||
|
||||
snes.cartridge->_data[5] = 123;
|
||||
data = snes._bus->read(0x808005);
|
||||
data = snes.bus->read(0x808005);
|
||||
cr_assert_eq(data, 123);
|
||||
}
|
||||
|
||||
@@ -331,7 +331,7 @@ Test(BusRead, ReadROMStart)
|
||||
uint8_t data;
|
||||
|
||||
snes.cartridge->_data[0] = 123;
|
||||
data = snes._bus->read(0x808000);
|
||||
data = snes.bus->read(0x808000);
|
||||
cr_assert_eq(data, 123);
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ Test(BusRead, ReadCPU)
|
||||
uint8_t data;
|
||||
|
||||
snes.cpu->_internalRegisters.wrio = 123;
|
||||
data = snes._bus->read(0x004201);
|
||||
data = snes.bus->read(0x004201);
|
||||
cr_assert_eq(data, 123);
|
||||
}
|
||||
|
||||
@@ -351,7 +351,7 @@ Test(BusRead, ReadPPU)
|
||||
uint8_t data;
|
||||
|
||||
snes.ppu->_registers._mpy.mpyl = 123;
|
||||
data = snes._bus->read(0x002134);
|
||||
data = snes.bus->read(0x002134);
|
||||
cr_assert_eq(data, 123);
|
||||
}
|
||||
|
||||
@@ -361,7 +361,7 @@ Test(BusRead, ReadSRAM)
|
||||
uint8_t data;
|
||||
|
||||
snes.sram->_data[7] = 123;
|
||||
data = snes._bus->read(0x700007);
|
||||
data = snes.bus->read(0x700007);
|
||||
cr_assert_eq(data, 123);
|
||||
}
|
||||
|
||||
@@ -371,7 +371,7 @@ Test(BusRead, ReadWRAM)
|
||||
uint8_t data;
|
||||
|
||||
snes.wram->_data[3] = 123;
|
||||
data = snes._bus->read(0x7E0003);
|
||||
data = snes.bus->read(0x7E0003);
|
||||
cr_assert_eq(data, 123);
|
||||
}
|
||||
|
||||
@@ -381,7 +381,7 @@ Test(BusRead, ReadWRAM2)
|
||||
uint8_t data;
|
||||
|
||||
snes.wram->_data[0x1010] = 123;
|
||||
data = snes._bus->read(0x7E1010);
|
||||
data = snes.bus->read(0x7E1010);
|
||||
cr_assert_eq(data, 123);
|
||||
}
|
||||
|
||||
@@ -392,7 +392,7 @@ Test(BusRead, ReadWRAMMirror)
|
||||
uint8_t data;
|
||||
|
||||
snes.wram->_data[0x1010] = 123;
|
||||
data = snes._bus->read(0x1010);
|
||||
data = snes.bus->read(0x1010);
|
||||
cr_assert_eq(data, 123);
|
||||
}
|
||||
|
||||
@@ -407,7 +407,7 @@ Test(BusWrite, Write0x0)
|
||||
Init()
|
||||
|
||||
try {
|
||||
snes._bus->write(0x0, 123);
|
||||
snes.bus->write(0x0, 123);
|
||||
} catch (std::exception &ex) {
|
||||
std::cout << ex.what() << std::endl;
|
||||
}
|
||||
@@ -419,7 +419,7 @@ Test(BusWrite, WriteAPU)
|
||||
{
|
||||
Init()
|
||||
|
||||
snes._bus->write(0x002143, 123);
|
||||
snes.bus->write(0x002143, 123);
|
||||
cr_assert_eq(snes.apu->_registers.port3, 123);
|
||||
}
|
||||
|
||||
@@ -427,7 +427,7 @@ Test(BusWrite, WritePPU)
|
||||
{
|
||||
Init()
|
||||
|
||||
snes._bus->write(0x002106, 123);
|
||||
snes.bus->write(0x002106, 123);
|
||||
cr_assert_eq(snes.ppu->_registers._mosaic.raw, 123);
|
||||
}
|
||||
|
||||
@@ -435,7 +435,7 @@ Test(BusWrite, WriteCPU)
|
||||
{
|
||||
Init()
|
||||
|
||||
snes._bus->write(0x00420D, 123);
|
||||
snes.bus->write(0x00420D, 123);
|
||||
cr_assert_eq(snes.cpu->_internalRegisters.memsel, 123);
|
||||
}
|
||||
|
||||
@@ -443,14 +443,14 @@ Test(BusWrite, WriteROM)
|
||||
{
|
||||
Init()
|
||||
|
||||
cr_assert_throw(snes._bus->write(0x808005, 123), InvalidAction);
|
||||
cr_assert_throw(snes.bus->write(0x808005, 123), InvalidAction);
|
||||
}
|
||||
|
||||
Test(BusWrite, WriteWRAM)
|
||||
{
|
||||
Init()
|
||||
|
||||
snes._bus->write(0x7E0002, 123);
|
||||
snes.bus->write(0x7E0002, 123);
|
||||
cr_assert_eq(snes.wram->_data[2], 123);
|
||||
}
|
||||
|
||||
@@ -458,6 +458,6 @@ Test(BusWrite, WriteSRAM)
|
||||
{
|
||||
Init()
|
||||
|
||||
snes._bus->write(0x700009, 123);
|
||||
snes.bus->write(0x700009, 123);
|
||||
cr_assert_eq(snes.sram->_data[9], 123);
|
||||
}
|
||||
Reference in New Issue
Block a user