Immediate addressing sized based on register used

This commit is contained in:
scawful
2023-12-05 03:46:08 -05:00
parent 6931ed4500
commit c2dba25b91

View File

@@ -98,8 +98,9 @@ uint32_t CPU::DirectPageIndirectLongIndexedY() {
return effective_address;
}
uint16_t CPU::Immediate() {
if (GetAccumulatorSize()) {
uint16_t CPU::Immediate(bool index_size) {
bool bit_mode = index_size ? GetIndexSize() : GetAccumulatorSize();
if (bit_mode) {
return memory.ReadByte((PB << 16) | PC + 1);
} else {
return memory.ReadWord((PB << 16) | PC + 1);