summaryrefslogtreecommitdiff
path: root/src/cpu/addressing.c
diff options
context:
space:
mode:
authoralekseiplusplus <alekseijeaves@protonmail.com>2023-12-07 02:19:48 +1100
committeralekseiplusplus <alekseijeaves@protonmail.com>2023-12-07 02:19:48 +1100
commit98dd41e2ce7dedb81ab91342eed29da017006ea4 (patch)
treede5efd1f899815dcad218accda405873687cbaf1 /src/cpu/addressing.c
parent5bb10fc4121a8c8434dcd367f2e611599a11e12e (diff)
about to rip apart my code, so saving progress
Diffstat (limited to 'src/cpu/addressing.c')
-rw-r--r--src/cpu/addressing.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/cpu/addressing.c b/src/cpu/addressing.c
index e5625fa..60ec4f0 100644
--- a/src/cpu/addressing.c
+++ b/src/cpu/addressing.c
@@ -8,7 +8,7 @@
//Holds address of current instruction.
void* current_instruction;
-address fAddressGetAddress(Addressing mode, short x) {
+address fAddressGetAddress(Addressing mode, address x) {
switch(mode){
case eImplied:
case eRelative:
@@ -47,12 +47,11 @@ int fAddressGetLength(Addressing mode){
}
}
-byte fAddressGetValue(Addressing mode, short x, address addr) {
+byte fAddressGetValue(Addressing mode, address x, address addr) {
switch(mode){
case eImplied:
- case eIndirectAbsolute:
return 0;
- case eRelative: // TODO: MARKER FOR 3/12/2023
+ case eRelative:
case eImmediate:
return x;
case eAccumulator:
@@ -62,7 +61,7 @@ byte fAddressGetValue(Addressing mode, short x, address addr) {
}
}
-int fAddressGetCycles(Addressing mode, short x, address addr) {
+int fAddressGetCycles(Addressing mode, address x, address addr) {
int cycles;
//case &fADC: case &fAND: case &fBIT: case &fCMP: case &fCPX: case &fCPY: case &fEOR: case &fLDA:
@@ -170,7 +169,7 @@ int fAddressGetCycles(Addressing mode, short x, address addr) {
return cycles;
}
-AddData fAddress(Addressing mode, short x) {
+AddData fAddress(Addressing mode, address x) {
AddData ret;
ret.add = fAddressGetAddress (mode, x);
ret.value = fAddressGetValue (mode, x, ret.add);