diff options
Diffstat (limited to 'src/cpu')
-rw-r--r-- | src/cpu/core.h | 26 | ||||
-rw-r--r-- | src/cpu/table.c | 1 |
2 files changed, 18 insertions, 9 deletions
diff --git a/src/cpu/core.h b/src/cpu/core.h index 03d20d0..26a6bc5 100644 --- a/src/cpu/core.h +++ b/src/cpu/core.h @@ -1,12 +1,16 @@ #ifndef CPU_CORE_H #define CPU_CORE_H -typedef unsigned char - byte; -typedef unsigned short - address; +typedef +unsigned char +byte; -enum Addressing { +typedef +unsigned short +address; + +enum Addressing +{ eImmediate, eAccumulator, eZeroPage, @@ -21,15 +25,19 @@ enum Addressing { eIndirectAbsolute, eRelative }; +typedef +int +Addressing; -typedef int Addressing; - -typedef struct AddData{ +typedef +struct AddData +{ int cycles; int length; address add; byte value; -} AddData; +} +AddData; byte getMemory(address x); diff --git a/src/cpu/table.c b/src/cpu/table.c index 0f70889..fb419d2 100644 --- a/src/cpu/table.c +++ b/src/cpu/table.c @@ -16,6 +16,7 @@ void callInstructionTable(int i, address val){ uintptr_t a = getInstructionTableFunction(i); memcpy(&func, a, sizeof(uintptr_t)); Addressing* r = (InstructionTable + ((sizeof(uintptr_t)*256) + (sizeof(Addressing) * i))); + idata = fAddress(*r, val); func(*r, val); } |