From fdb4fe69714703a88848bf3590ffa079a2901f47 Mon Sep 17 00:00:00 2001 From: scawful Date: Tue, 5 Dec 2023 03:44:57 -0500 Subject: [PATCH] Update CPX and CPY arg length for long addressing --- src/app/emu/cpu/instructions.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/emu/cpu/instructions.cc b/src/app/emu/cpu/instructions.cc index 414a9165..b735e339 100644 --- a/src/app/emu/cpu/instructions.cc +++ b/src/app/emu/cpu/instructions.cc @@ -202,7 +202,7 @@ void CPU::COP() { SetDecimalFlag(false); } -void CPU::CPX(uint16_t value, bool isImmediate) { +void CPU::CPX(uint32_t value, bool isImmediate) { if (GetIndexSize()) { // 8-bit uint8_t memory_value = isImmediate ? value : memory.ReadByte(value); compare(X, memory_value); @@ -212,7 +212,7 @@ void CPU::CPX(uint16_t value, bool isImmediate) { } } -void CPU::CPY(uint16_t value, bool isImmediate) { +void CPU::CPY(uint32_t value, bool isImmediate) { if (GetIndexSize()) { // 8-bit uint8_t memory_value = isImmediate ? value : memory.ReadByte(value); compare(Y, memory_value);