From 016c44a28a975d04b48fd77dd112d8095876bee8 Mon Sep 17 00:00:00 2001 From: alekseiplusplus Date: Thu, 30 Nov 2023 15:19:37 +1100 Subject: fixed unchanging registers --- src/cpu/table.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') 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); } -- cgit v1.2.3