summaryrefslogtreecommitdiff
path: root/src/cpu/addressing.c
diff options
context:
space:
mode:
authoralekseiplusplus <alekseijeaves@protonmail.com>2023-12-04 15:12:17 +1100
committeralekseiplusplus <alekseijeaves@protonmail.com>2023-12-04 15:12:17 +1100
commit5bb10fc4121a8c8434dcd367f2e611599a11e12e (patch)
tree8fcac1461a50fca6bec6ccd2246f7515ad26099a /src/cpu/addressing.c
parent78d3f650b2ca507e3d5376d3cad4d93df1901569 (diff)
removed stuff; various instruction improvements
Diffstat (limited to 'src/cpu/addressing.c')
-rw-r--r--src/cpu/addressing.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cpu/addressing.c b/src/cpu/addressing.c
index fd9bf7e..e5625fa 100644
--- a/src/cpu/addressing.c
+++ b/src/cpu/addressing.c
@@ -18,7 +18,7 @@ address fAddressGetAddress(Addressing mode, short x) {
case eAbsolute:
return x;
case eIndirectAbsolute:
- return GetMemory(x) + ((address)GetMemory(x+1) << 8);
+ return (address)GetMemory(x) + ((address)GetMemory(x+1) << 8);
case eAbsoluteIndexedX:
return x + X;
case eAbsoluteIndexedY:
@@ -30,9 +30,9 @@ address fAddressGetAddress(Addressing mode, short x) {
case eZeroPageIndexedY:
return ((x + Y) & 0x00FF);
case eIndexedIndirect:
- return ((GetMemory(x+X+1))<<8) + (GetMemory(x+X));
+ return ((address)(GetMemory(x+X+1))<<8) + (address)(GetMemory(x+X));
case eIndirectIndexed:
- return ((GetMemory(x+1))<<8) + (GetMemory(x)) + Y;
+ return ((address)(GetMemory(x+1))<<8) + (address)(GetMemory(x)) + Y;
}
}