summaryrefslogtreecommitdiff
path: root/src/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu')
-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);
}