Solving timing issues

This commit is contained in:
Anonymus Raccoon
2020-03-28 20:47:13 +01:00
parent f44cd8a106
commit 9be49e283d
18 changed files with 432 additions and 485 deletions
+5 -5
View File
@@ -15,7 +15,7 @@ Test(SBC, removingOne)
snes.cpu->_registers.p.c = true;
snes.cpu->_registers.a = 0x1;
snes.wram->_data[0] = 0x1;
snes.cpu->SBC(0x0);
snes.cpu->SBC(0x0, ComSquare::CPU::AddressingMode::Implied);
cr_assert_eq(snes.cpu->_registers.a, 0, "The accumulator's value should be 0x0 but it was 0x%x.", snes.cpu->_registers.a);
cr_assert_eq(snes.cpu->_registers.p.c, true, "The carry flags should be set.");
cr_assert_eq(snes.cpu->_registers.p.v, false, "The overflow flags should not be set.");
@@ -32,7 +32,7 @@ Test(SBC, legitOverflowWithCarry)
snes.cpu->_registers.p.c = true;
snes.wram->_data[0] = 0x03;
snes.wram->_data[1] = 0x20;
snes.cpu->SBC(0x0);
snes.cpu->SBC(0x0, ComSquare::CPU::AddressingMode::Implied);
cr_assert_eq(snes.cpu->_registers.a, 0xDFFE, "The accumulator's value should be 0xDFFE but it was 0x%x.", snes.cpu->_registers.a);
cr_assert_eq(snes.cpu->_registers.p.c, false, "The carry flags should not be set.");
cr_assert_eq(snes.cpu->_registers.p.v, false, "The overflow flags should not be set.");
@@ -49,7 +49,7 @@ Test(SBC, overflowWithCarry)
snes.cpu->_registers.p.c = true;
snes.wram->_data[0] = 0x03;
snes.wram->_data[1] = 0x20;
snes.cpu->SBC(0x0);
snes.cpu->SBC(0x0, ComSquare::CPU::AddressingMode::Implied);
cr_assert_eq(snes.cpu->_registers.a, 0xDFFE, "The accumulator's value should be 0xDFFE but it was 0x%x.", snes.cpu->_registers.a);
cr_assert_eq(snes.cpu->_registers.p.c, false, "The carry flags should not be set.");
cr_assert_eq(snes.cpu->_registers.p.v, false, "The overflow flags should be not set.");
@@ -65,7 +65,7 @@ Test(SBC, overflowEmulation)
snes.cpu->_registers.p.m = false;
snes.cpu->_registers.p.c = false;
snes.wram->_data[0] = 0x02;
snes.cpu->SBC(0x0);
snes.cpu->SBC(0x0, ComSquare::CPU::AddressingMode::Implied);
cr_assert_eq(snes.cpu->_registers.a, 0xFE, "The accumulator's value should be 0xFE but it was 0x%x.", snes.cpu->_registers.a);
cr_assert_eq(snes.cpu->_registers.p.c, false, "The carry flags should not be set.");
cr_assert_eq(snes.cpu->_registers.p.v, false, "The overflow flags should not be set.");
@@ -83,7 +83,7 @@ Test(SBC, overflowEmulation)
// snes.cpu->_registers.p.m = false;
// snes.wram->_data[0] = 0x03;
// snes.wram->_data[1] = 0x20;
// snes.cpu->SBC(0x0);
// snes.cpu->SBC(0x0, ComSquare::CPU::AddressingMode::Implied);
// cr_assert_eq(snes.cpu->_registers.a, 0x7998, "The accumulator's value should be 0x7998 but it was 0x%x.", snes.cpu->_registers.a);
// cr_assert_eq(snes.cpu->_registers.p.c, false, "The carry flags should not be set.");
// cr_assert_eq(snes.cpu->_registers.p.v, false, "The overflow flags should not be set.");