mirror of
https://github.com/zoriya/ComSquare.git
synced 2026-06-02 02:05:26 +00:00
Implementing MVP
This commit is contained in:
@@ -454,4 +454,23 @@ Test(MVN, hardCase)
|
||||
cr_assert_eq(snes.cpu->_registers.y, 0x1011, "The y index should be 0x1011 but it was %x", snes.cpu->_registers.y);
|
||||
for (int i = 0; i < 0x11; i++)
|
||||
cr_assert_eq(snes.wram->_data[i + 0x1000], i, "The data in ram should be %x but it was %x", i, snes.wram->_data[i + 0x1000]);
|
||||
}
|
||||
|
||||
Test(MVP, hardCase)
|
||||
{
|
||||
Init()
|
||||
snes.cpu->_registers.a = 0x10;
|
||||
snes.cpu->_registers.x = 0x0010;
|
||||
snes.cpu->_registers.y = 0x1010;
|
||||
for (int i = 0; i <= snes.cpu->_registers.a; i++)
|
||||
snes.wram->_data[i] = i;
|
||||
|
||||
int cycles = snes.cpu->MVP(0x2010, ComSquare::CPU::AddressingMode::Implied);
|
||||
cr_assert_eq(cycles, 0x77, "The MVN should take 0x77 cycles but it took %x.", cycles);
|
||||
cr_assert_eq(snes.cpu->_registers.dbr, 0x20, "The data bank register should be 0x20 but it was %x", snes.cpu->_registers.dbr);
|
||||
cr_assert_eq(snes.cpu->_registers.a, 0xFFFF, "The c accumulator should be 0xFFFF but it was %x", snes.cpu->_registers.a);
|
||||
cr_assert_eq(snes.cpu->_registers.x, 0xFFFF, "The x index should be 0xFFFF but it was %x", snes.cpu->_registers.x);
|
||||
cr_assert_eq(snes.cpu->_registers.y, 0x0FFF, "The y index should be 0x0FFF but it was %x", snes.cpu->_registers.y);
|
||||
for (int i = 0; i < 0x11; i++)
|
||||
cr_assert_eq(snes.wram->_data[i + 0x1000], i, "The data in ram should be %x but it was %x", i, snes.wram->_data[i + 0x1000]);
|
||||
}
|
||||
Reference in New Issue
Block a user