summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xa.outbin30664 -> 30696 bytes
-rw-r--r--addressing.h7
-rw-r--r--debug.h4
-rw-r--r--test.c8
4 files changed, 10 insertions, 9 deletions
diff --git a/a.out b/a.out
index 502cb0b..82d3b80 100755
--- a/a.out
+++ b/a.out
Binary files differ
diff --git a/addressing.h b/addressing.h
index a179645..d764e8f 100644
--- a/addressing.h
+++ b/addressing.h
@@ -53,6 +53,8 @@ Addressing fAddressGetLength(Addressing addr){
AddData fAddress(Addressing addr, short x) {
AddData ret;
+ // might seperate the rest of these out?
+
// ADDRESS
switch(addr){
@@ -61,6 +63,7 @@ AddData fAddress(Addressing addr, short x) {
case eRelative:
case eImmediate:
case eAccumulator:
+ ret.add = 0x0000;
break;
case eAbsolute:
@@ -201,9 +204,6 @@ AddData fAddress(Addressing addr, short x) {
// Page Boundary
-
-
-
//case &fADC: case &fSBC: case &fLDA: case &fLDX: case &fLDY: case &fEOR: case &fAND: case &fORA: case &fCMP:
if ( current_instruction == &fADC || current_instruction == &fSBC || current_instruction == &fLDA || current_instruction == &fLDX || current_instruction == &fLDY
|| current_instruction == &fEOR || current_instruction == &fAND || current_instruction == &fORA || current_instruction == &fCMP ){
@@ -217,5 +217,6 @@ AddData fAddress(Addressing addr, short x) {
}
}
+ return ret;
}
diff --git a/debug.h b/debug.h
index 0ef38ce..bb6ba40 100644
--- a/debug.h
+++ b/debug.h
@@ -34,4 +34,8 @@ void dPageDump(short m){
// Dump CPU values
void dStatusDump(void){
printf(" acc:\t%x\n X:\t%x\n Y:\t%x\nstack:\t%x\nflags:\t%x\n", acc, X, Y, S, P);
+}
+
+void dIdataDump(void){
+ printf("cycles:\t%d\nlength:\t%d\n add:\t%x\n value:\t%x\n", idata.cycles, idata.length, idata.add, idata.value);
} \ No newline at end of file
diff --git a/test.c b/test.c
index 1ae1aff..29b327b 100644
--- a/test.c
+++ b/test.c
@@ -7,19 +7,15 @@ int main(){
initIT();
- //void (*func)(Addressing, address); printf("Statement OK");
-
printf("\n\n");
- func = &fLDA;
-
- dStatusDump();
+ dStatusDump(); dIdataDump(); printf("\n");
//func(*(IT + ((sizeof(uintptr_t)*256)) + (0xA9 * sizeof(Addressing))), *(IT + ((sizeof(uintptr_t)*0xA9))));
callIT(0xA9, 0x01);
- dStatusDump();
+ dStatusDump(); dIdataDump();
printf("%x\n", (IT + 31));