mirror of
https://github.com/zoriya/ComSquare.git
synced 2026-05-22 22:45:52 +00:00
Solving timing issues
This commit is contained in:
+14
-14
@@ -14,7 +14,7 @@ Test(STA, 8bits)
|
||||
Init()
|
||||
snes.cpu->_registers.p.m = true;
|
||||
snes.cpu->_registers.a = 0x11;
|
||||
snes.cpu->STA(0x0);
|
||||
snes.cpu->STA(0x0, ComSquare::CPU::AddressingMode::Implied);
|
||||
auto data = snes.wram->_data[0];
|
||||
cr_assert_eq(data, 0x11, "The stored value should be 0x11 but it was 0x%x.", data);
|
||||
}
|
||||
@@ -24,7 +24,7 @@ Test(STA, 16bits)
|
||||
Init()
|
||||
snes.cpu->_registers.p.m = false;
|
||||
snes.cpu->_registers.a = 0x11AB;
|
||||
snes.cpu->STA(0x0);
|
||||
snes.cpu->STA(0x0, ComSquare::CPU::AddressingMode::Implied);
|
||||
auto data = snes.wram->_data[0] + (snes.wram->_data[1] << 8u);
|
||||
cr_assert_eq(data, 0x11AB, "The stored value should be 0x11AB but it was 0x%x.", data);
|
||||
}
|
||||
@@ -34,7 +34,7 @@ Test(STX, 8bits)
|
||||
Init()
|
||||
snes.cpu->_registers.p.x_b = true;
|
||||
snes.cpu->_registers.x = 0x11;
|
||||
snes.cpu->STX(0x0);
|
||||
snes.cpu->STX(0x0, ComSquare::CPU::AddressingMode::Implied);
|
||||
auto data = snes.wram->_data[0];
|
||||
cr_assert_eq(data, 0x11, "The stored value should be 0x11 but it was 0x%x.", data);
|
||||
}
|
||||
@@ -44,7 +44,7 @@ Test(STX, 16bits)
|
||||
Init()
|
||||
snes.cpu->_registers.p.x_b = false;
|
||||
snes.cpu->_registers.x = 0x11AB;
|
||||
snes.cpu->STX(0x0);
|
||||
snes.cpu->STX(0x0, ComSquare::CPU::AddressingMode::Implied);
|
||||
auto data = snes.wram->_data[0] + (snes.wram->_data[1] << 8u);
|
||||
cr_assert_eq(data, 0x11AB, "The stored value should be 0x11AB but it was 0x%x.", data);
|
||||
}
|
||||
@@ -54,7 +54,7 @@ Test(STY, 8bits)
|
||||
Init()
|
||||
snes.cpu->_registers.p.x_b = true;
|
||||
snes.cpu->_registers.y = 0x11;
|
||||
snes.cpu->STY(0x0);
|
||||
snes.cpu->STY(0x0, ComSquare::CPU::AddressingMode::Implied);
|
||||
auto data = snes.wram->_data[0];
|
||||
cr_assert_eq(data, 0x11, "The stored value should be 0x11 but it was 0x%x.", data);
|
||||
}
|
||||
@@ -64,7 +64,7 @@ Test(STY, 16bits)
|
||||
Init()
|
||||
snes.cpu->_registers.p.x_b = false;
|
||||
snes.cpu->_registers.y = 0x11AB;
|
||||
snes.cpu->STY(0x0);
|
||||
snes.cpu->STY(0x0, ComSquare::CPU::AddressingMode::Implied);
|
||||
auto data = snes.wram->_data[0] + (snes.wram->_data[1] << 8u);
|
||||
cr_assert_eq(data, 0x11AB, "The stored value should be 0x11AB but it was 0x%x.", data);
|
||||
}
|
||||
@@ -74,7 +74,7 @@ Test(STZ, 8bits)
|
||||
Init()
|
||||
snes.cpu->_registers.p.m = true;
|
||||
snes.wram->_data[0] = 0x11;
|
||||
snes.cpu->STZ(0x0);
|
||||
snes.cpu->STZ(0x0, ComSquare::CPU::AddressingMode::Implied);
|
||||
auto data = snes.wram->_data[0];
|
||||
cr_assert_eq(data, 0x00, "The stored value should be 0x00 but it was 0x%x.", data);
|
||||
}
|
||||
@@ -85,7 +85,7 @@ Test(STZ, 16bits)
|
||||
snes.cpu->_registers.p.m = false;
|
||||
snes.wram->_data[0] = 0x11;
|
||||
snes.wram->_data[1] = 0x11;
|
||||
snes.cpu->STZ(0x0);
|
||||
snes.cpu->STZ(0x0, ComSquare::CPU::AddressingMode::Implied);
|
||||
auto data = snes.wram->_data[0] + (snes.wram->_data[1] << 8u);
|
||||
cr_assert_eq(data, 0x00, "The stored value should be 0x00 but it was 0x%x.", data);
|
||||
}
|
||||
@@ -95,7 +95,7 @@ Test(LDX, 8bits)
|
||||
Init()
|
||||
snes.cpu->_registers.p.x_b = true;
|
||||
snes.wram->_data[0] = 0x01;
|
||||
snes.cpu->LDX(0x0);
|
||||
snes.cpu->LDX(0x0, ComSquare::CPU::AddressingMode::Implied);
|
||||
auto data = snes.cpu->_registers.x;
|
||||
cr_assert_eq(data, 0x01, "The stored value should be 0x01 but it was 0x%x.", data);
|
||||
cr_assert_eq(snes.cpu->_registers.p.z, false, "The zero flag register should not be set.");
|
||||
@@ -107,7 +107,7 @@ Test(LDX, 8bitsNegative)
|
||||
Init()
|
||||
snes.cpu->_registers.p.x_b = true;
|
||||
snes.wram->_data[0] = 0x11;
|
||||
snes.cpu->LDX(0x0);
|
||||
snes.cpu->LDX(0x0, ComSquare::CPU::AddressingMode::Implied);
|
||||
auto data = snes.cpu->_registers.x;
|
||||
cr_assert_eq(data, 0x11, "The stored value should be 0x11 but it was 0x%x.", data);
|
||||
cr_assert_eq(snes.cpu->_registers.p.z, false, "The zero flag register should not be set.");
|
||||
@@ -120,7 +120,7 @@ Test(LDX, 8bitsZero)
|
||||
snes.cpu->_registers.p.x_b = true;
|
||||
snes.wram->_data[0] = 0x00;
|
||||
snes.wram->_data[1] = 0x11;
|
||||
snes.cpu->LDX(0x0);
|
||||
snes.cpu->LDX(0x0, ComSquare::CPU::AddressingMode::Implied);
|
||||
auto data = snes.cpu->_registers.x;
|
||||
cr_assert_eq(data, 0x00, "The stored value should be 0x00 but it was 0x%x.", data);
|
||||
cr_assert_eq(snes.cpu->_registers.p.z, true, "The zero flag register should be set.");
|
||||
@@ -133,7 +133,7 @@ Test(LDX, 16bits)
|
||||
snes.cpu->_registers.p.x_b = false;
|
||||
snes.wram->_data[0] = 0xAB;
|
||||
snes.wram->_data[1] = 001;
|
||||
snes.cpu->LDX(0x0);
|
||||
snes.cpu->LDX(0x0, ComSquare::CPU::AddressingMode::Implied);
|
||||
auto data = snes.cpu->_registers.x;
|
||||
cr_assert_eq(data, 0x01AB, "The stored value should be 0x01AB but it was 0x%x.", data);
|
||||
cr_assert_eq(snes.cpu->_registers.p.z, false, "The zero flag register should not be set.");
|
||||
@@ -146,7 +146,7 @@ Test(LDX, 16bitsNegative)
|
||||
snes.cpu->_registers.p.x_b = false;
|
||||
snes.wram->_data[0] = 0xAB;
|
||||
snes.wram->_data[1] = 0x11;
|
||||
snes.cpu->LDX(0x0);
|
||||
snes.cpu->LDX(0x0, ComSquare::CPU::AddressingMode::Implied);
|
||||
auto data = snes.cpu->_registers.x;
|
||||
cr_assert_eq(data, 0x11AB, "The stored value should be 0x11AB but it was 0x%x.", data);
|
||||
cr_assert_eq(snes.cpu->_registers.p.z, false, "The zero flag register should not be set.");
|
||||
@@ -159,7 +159,7 @@ Test(LDX, 16bitsZero)
|
||||
snes.cpu->_registers.p.x_b = false;
|
||||
snes.wram->_data[0] = 0x00;
|
||||
snes.wram->_data[1] = 0x00;
|
||||
snes.cpu->LDX(0x0);
|
||||
snes.cpu->LDX(0x0, ComSquare::CPU::AddressingMode::Implied);
|
||||
auto data = snes.cpu->_registers.x;
|
||||
cr_assert_eq(data, 0x0000, "The stored value should be 0x0000 but it was 0x%x.", data);
|
||||
cr_assert_eq(snes.cpu->_registers.p.z, true, "The zero flag register should be set.");
|
||||
|
||||
Reference in New Issue
Block a user