Immediate addressing sized based on register used
This commit is contained in:
@@ -98,8 +98,9 @@ uint32_t CPU::DirectPageIndirectLongIndexedY() {
|
|||||||
return effective_address;
|
return effective_address;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t CPU::Immediate() {
|
uint16_t CPU::Immediate(bool index_size) {
|
||||||
if (GetAccumulatorSize()) {
|
bool bit_mode = index_size ? GetIndexSize() : GetAccumulatorSize();
|
||||||
|
if (bit_mode) {
|
||||||
return memory.ReadByte((PB << 16) | PC + 1);
|
return memory.ReadByte((PB << 16) | PC + 1);
|
||||||
} else {
|
} else {
|
||||||
return memory.ReadWord((PB << 16) | PC + 1);
|
return memory.ReadWord((PB << 16) | PC + 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user