summaryrefslogtreecommitdiff
path: root/src/cpu/table.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu/table.c')
-rw-r--r--src/cpu/table.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cpu/table.c b/src/cpu/table.c
index 9597657..27ec8f2 100644
--- a/src/cpu/table.c
+++ b/src/cpu/table.c
@@ -26,10 +26,10 @@ void CallInstructionTable(int i, address val){
Addressing* r = (InstructionTable + ((sizeof(uintptr_t)*256) + (sizeof(Addressing) * i)));
// Set val
- if (fAddressGetLength(*r) > 0)
- val += GetMemory(PC+1);
- if (fAddressGetLength(*r) > 1)
- val += GetMemory(PC+2) << 8;
+ if (fAddressGetLength(*r) >= 2)
+ val += (address)GetMemory(PC+1);
+ if (fAddressGetLength(*r) == 3)
+ val += (address)GetMemory(PC+2) << 8;
// Set idata
idata = fAddress(*r, val);
@@ -193,8 +193,8 @@ void InitInstructionTable(){
SetInstructionTable(0xC4, (uintptr_t)&fCPY, eZeroPage);
SetInstructionTable(0xCC, (uintptr_t)&fCPY, eAbsolute);
//BIT(Addressing, address);
- SetInstructionTable(0x4C, (uintptr_t)&fBIT, eZeroPage);
- SetInstructionTable(0x6C, (uintptr_t)&fBIT, eAbsolute);
+ SetInstructionTable(0x24, (uintptr_t)&fBIT, eZeroPage);
+ SetInstructionTable(0x2C, (uintptr_t)&fBIT, eAbsolute);
// Shift and Rotate Instructions
//ASL(Addressing, address);