summaryrefslogtreecommitdiff
path: root/src/cpu/addressing.c
diff options
context:
space:
mode:
authoralekseiplusplus <alekseijeaves@protonmail.com>2023-12-07 17:34:18 +1100
committeralekseiplusplus <alekseijeaves@protonmail.com>2023-12-07 17:34:18 +1100
commitf8df4908fe6986e691ea96b4b07ffbff349ccce0 (patch)
treea868c23e64fb41bd1e25d3e4f34d738ebd0c549a /src/cpu/addressing.c
parent68cdad3be01539e583627e1c8929f182255541be (diff)
changed shift ins.s and now log CPU state
Diffstat (limited to 'src/cpu/addressing.c')
-rw-r--r--src/cpu/addressing.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cpu/addressing.c b/src/cpu/addressing.c
index 903e5d0..b8f9330 100644
--- a/src/cpu/addressing.c
+++ b/src/cpu/addressing.c
@@ -18,7 +18,7 @@ address fAddressGetAddress(Addressing mode, address x) {
case eAbsolute:
return x;
case eIndirectAbsolute:
- return (address)GetMemory(x) + ((address)GetMemory(x+1) << 8);
+ return (address)GetMemory(x) + (((address)GetMemory(x+1)) << 8);
case eAbsoluteIndexedX:
return x + X;
case eAbsoluteIndexedY:
@@ -32,7 +32,8 @@ address fAddressGetAddress(Addressing mode, address x) {
case eIndexedIndirect:
return (((address)(GetMemory(x+X+1)))<<8) + (address)(GetMemory(x+X));
case eIndirectIndexed:
- return ((address)(GetMemory(x+1))<<8) + (address)(GetMemory(x)) + Y;
+ return ((address)(GetMemory(x+1))<<8) + ((address)(GetMemory(x))) + ((address)Y);
+ //return ((x >> 8) & 0xFF) (x & 0xFF)
}
}