From 98dd41e2ce7dedb81ab91342eed29da017006ea4 Mon Sep 17 00:00:00 2001 From: alekseiplusplus Date: Thu, 7 Dec 2023 02:19:48 +1100 Subject: about to rip apart my code, so saving progress --- src/cpu/addressing.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/cpu/addressing.c') 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); -- cgit v1.2.3