Fixing a bug with the write in 0x0

This commit is contained in:
AnonymusRaccoon
2020-02-13 11:09:18 +01:00
parent b1a2222b55
commit a6c3e54f9f
11 changed files with 96 additions and 9 deletions
+32
View File
@@ -261,12 +261,31 @@ Test(BusAccessor, GetRomMirror3)
cr_assert_eq(accessor->_initial.get(), pair.second.cartridge.get());
}
Test(BusAccessor, Get0x0)
{
auto pair = Init();
std::shared_ptr<Memory::RectangleShadow> accessor = nullptr;
accessor = std::static_pointer_cast<Memory::RectangleShadow>(pair.first->getAccessor(0x0));
cr_assert_eq(accessor->_initial.get(), pair.second.wram.get());
}
///////////////////////////
// //
// MemoryBus::read tests //
// //
///////////////////////////
Test(BusRead, Read0x0)
{
auto pair = Init();
uint8_t data;
pair.second.wram->_data[0] = 123;
data = pair.first->read(0x0);
cr_assert_eq(data, 123);
}
Test(BusRead, ReadOutside, .init = cr_redirect_stdout)
{
auto pair = Init();
@@ -394,6 +413,19 @@ Test(BusRead, ReadWRAMMirror)
// //
////////////////////////////
Test(BusWrite, Write0x0)
{
auto pair = Init();
try {
pair.first->write(0x0, 123);
} catch (std::exception &ex) {
std::cout << ex.what() << std::endl;
}
cr_assert_eq(pair.second.wram->_data[0], 123);
}
Test(BusWrite, WriteAPU)
{
auto pair = Init();