summaryrefslogtreecommitdiff
path: root/src/cpu/table.c
diff options
context:
space:
mode:
authoralekseiplusplus <alekseijeaves@protonmail.com>2023-11-30 15:19:37 +1100
committeralekseiplusplus <alekseijeaves@protonmail.com>2023-11-30 15:19:37 +1100
commit016c44a28a975d04b48fd77dd112d8095876bee8 (patch)
tree87f396b03b268f3daaa8394f4513454af27419c6 /src/cpu/table.c
parent9341076be70d53aa78fae9d010c91bc93c5840b9 (diff)
fixed unchanging registers
Diffstat (limited to 'src/cpu/table.c')
-rw-r--r--src/cpu/table.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/cpu/table.c b/src/cpu/table.c
index 0af04f9..9597657 100644
--- a/src/cpu/table.c
+++ b/src/cpu/table.c
@@ -24,13 +24,15 @@ void CallInstructionTable(int i, address val){
memcpy(&func, a, sizeof(uintptr_t));
// Find the correct addressing mode.
Addressing* r = (InstructionTable + ((sizeof(uintptr_t)*256) + (sizeof(Addressing) * i)));
- // Set idata
- idata = fAddress(*r, val);
+
// Set val
- if (idata.length > 0)
+ if (fAddressGetLength(*r) > 0)
val += GetMemory(PC+1);
- if (idata.length > 1)
+ if (fAddressGetLength(*r) > 1)
val += GetMemory(PC+2) << 8;
+ // Set idata
+ idata = fAddress(*r, val);
+
// Perform function
func(*r, val);
}