Instruction length fixes

This commit is contained in:
scawful
2023-12-03 06:16:17 -05:00
parent ca9cc42d6b
commit db91b0401a
4 changed files with 83 additions and 31 deletions

View File

@@ -1343,10 +1343,12 @@ TEST_F(CPUTest, CMP_AbsoluteLongIndexedX) {
// ============================================================================
TEST_F(CPUTest, COP) {
mock_memory.SetSP(0x01FF);
std::vector<uint8_t> data = {0x02}; // COP
mock_memory.SetMemoryContents(data);
mock_memory.InsertMemory(0xFFF4, {0x10, 0x20}); // [0xFFFE] = 0x2010
ON_CALL(mock_memory, SetSP(_)).WillByDefault(::testing::Return());
EXPECT_CALL(mock_memory, PushWord(0x0002));
EXPECT_CALL(mock_memory, PushByte(0x30));
EXPECT_CALL(mock_memory, ReadWord(0xFFF4)).WillOnce(Return(0x2010));
@@ -1354,6 +1356,7 @@ TEST_F(CPUTest, COP) {
cpu.ExecuteInstruction(0x02); // COP
EXPECT_TRUE(cpu.GetInterruptFlag());
EXPECT_FALSE(cpu.GetDecimalFlag());
EXPECT_EQ(mock_memory.SP(), 0x01FD);
}
// ============================================================================
@@ -4170,7 +4173,6 @@ TEST_F(CPUTest, XCESwitchBackAndForth) {
EXPECT_FALSE(cpu.E); // Emulation mode flag should be cleared
}
// ============================================================================
} // namespace emu
} // namespace app