mirror of
https://github.com/zoriya/ComSquare.git
synced 2026-05-25 15:39:28 +00:00
Solving timing issues
This commit is contained in:
@@ -14,7 +14,7 @@ Test(ADC, addingOne)
|
||||
snes.cpu->_isEmulationMode = false;
|
||||
snes.cpu->_registers.a = 0;
|
||||
snes.wram->_data[0] = 0x1;
|
||||
snes.cpu->ADC(0x0);
|
||||
snes.cpu->ADC(0x0, ComSquare::CPU::AddressingMode::Implied);
|
||||
cr_assert_eq(snes.cpu->_registers.a, 1, "The accumulator's value should be 0x1 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.");
|
||||
@@ -28,7 +28,7 @@ Test(ADC, addingOneEmulation)
|
||||
snes.cpu->_isEmulationMode = true;
|
||||
snes.cpu->_registers.a = 0;
|
||||
snes.wram->_data[0] = 0x1;
|
||||
snes.cpu->ADC(0x0);
|
||||
snes.cpu->ADC(0x0, ComSquare::CPU::AddressingMode::Implied);
|
||||
cr_assert_eq(snes.cpu->_registers.a, 1, "The accumulator's value should be 0x1 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.");
|
||||
@@ -42,7 +42,7 @@ Test(ADC, overflow)
|
||||
snes.cpu->_isEmulationMode = false;
|
||||
snes.cpu->_registers.a = 0xFFFF;
|
||||
snes.wram->_data[0] = 0x1;
|
||||
snes.cpu->ADC(0x0);
|
||||
snes.cpu->ADC(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.");
|
||||
@@ -56,7 +56,7 @@ Test(ADC, overflowEmulation)
|
||||
snes.cpu->_isEmulationMode = true;
|
||||
snes.cpu->_registers.a = 0xFF;
|
||||
snes.wram->_data[0] = 0x1;
|
||||
snes.cpu->ADC(0x0);
|
||||
snes.cpu->ADC(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.");
|
||||
@@ -70,7 +70,7 @@ Test(ADC, signedOverflow)
|
||||
snes.cpu->_isEmulationMode = false;
|
||||
snes.cpu->_registers.a = 0x7FFF;
|
||||
snes.wram->_data[0] = 0x1;
|
||||
snes.cpu->ADC(0x0);
|
||||
snes.cpu->ADC(0x0, ComSquare::CPU::AddressingMode::Implied);
|
||||
cr_assert_eq(snes.cpu->_registers.a, 0x8000, "The accumulator's value should be 0x8000 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, true, "The overflow flags should be set.");
|
||||
@@ -84,7 +84,7 @@ Test(ADC, signedOverflowEmulated)
|
||||
snes.cpu->_isEmulationMode = true;
|
||||
snes.cpu->_registers.a = 0x007F;
|
||||
snes.wram->_data[0] = 0x1;
|
||||
snes.cpu->ADC(0x0);
|
||||
snes.cpu->ADC(0x0, ComSquare::CPU::AddressingMode::Implied);
|
||||
cr_assert_eq(snes.cpu->_registers.a, 0x0080, "The accumulator's value should be 0x0080 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, true, "The overflow flags should be set.");
|
||||
@@ -98,7 +98,7 @@ Test(ADC, negative)
|
||||
snes.cpu->_isEmulationMode = false;
|
||||
snes.cpu->_registers.a = 0x8FFF;
|
||||
snes.wram->_data[0] = 0x1;
|
||||
snes.cpu->ADC(0x0);
|
||||
snes.cpu->ADC(0x0, ComSquare::CPU::AddressingMode::Implied);
|
||||
cr_assert_eq(snes.cpu->_registers.a, 0x9000, "The accumulator's value should be 0x9000 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 set.");
|
||||
@@ -114,7 +114,7 @@ Test(ADC, memoryTwoBytes)
|
||||
snes.cpu->_registers.a = 0x000F;
|
||||
snes.wram->_data[0] = 0x01;
|
||||
snes.wram->_data[1] = 0x04;
|
||||
snes.cpu->ADC(0x0);
|
||||
snes.cpu->ADC(0x0, ComSquare::CPU::AddressingMode::Implied);
|
||||
cr_assert_eq(snes.cpu->_registers.a, 0x0410, "The accumulator's value should be 0x0410 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.");
|
||||
|
||||
Reference in New Issue
Block a user