summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--docs/interpreter.md (renamed from interpreter.md)0
-rw-r--r--docs/opcodes-reference.pdf (renamed from opcodes-reference.pdf)bin20266 -> 20266 bytes
-rw-r--r--headers/addressing.h2
-rw-r--r--headers/include.h4
-rw-r--r--headers/instructions/definitions.h (renamed from headers/instructions.h)6
-rw-r--r--headers/instructions/illegal/definitions.h (renamed from test/adc.test)0
-rw-r--r--headers/instructions/illegal/init.h0
-rw-r--r--headers/instructions/illegal/table-append.h0
-rw-r--r--headers/instructions/init.h (renamed from headers/instructions-init.h)8
-rw-r--r--headers/instructions/table.h (renamed from headers/instruction-table.h)6
-rw-r--r--makefile7
-rw-r--r--test/adc0
-rw-r--r--test/load (renamed from test/load.test)0
14 files changed, 25 insertions, 10 deletions
diff --git a/README.md b/README.md
index 9feb421..3a37f08 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@ My emulator has a handful of specific milestones to achieve that will demonstrat
2. Run a system monitor program correctly.
3. Successfully run a BASIC program in Wozniak's BASIC interpreter.
-There are no plans as of yet to support illegal instructions.
+There is potential to support illegal instructions in the future, but dealing with fringe cases is not a priority yet.
Planned core features for the emulator include:
1. A mode to run an SDL terminal emulator with the original Apple I font.
diff --git a/interpreter.md b/docs/interpreter.md
index 54a6c2a..54a6c2a 100644
--- a/interpreter.md
+++ b/docs/interpreter.md
diff --git a/opcodes-reference.pdf b/docs/opcodes-reference.pdf
index ecff92b..ecff92b 100644
--- a/opcodes-reference.pdf
+++ b/docs/opcodes-reference.pdf
Binary files differ
diff --git a/headers/addressing.h b/headers/addressing.h
index d1b8371..af102fd 100644
--- a/headers/addressing.h
+++ b/headers/addressing.h
@@ -28,7 +28,7 @@ struct AddData{
typedef struct AddData AddData;
-#include"instructions-init.h"
+#include"instructions/init.h"
//Holds address of current instruction.
void* current_instruction;
diff --git a/headers/include.h b/headers/include.h
index c4a2ef8..8f067c2 100644
--- a/headers/include.h
+++ b/headers/include.h
@@ -4,6 +4,6 @@
#include"string.h"
#include"6502.h"
#include"addressing.h"
-#include"instructions.h"
-#include"instruction-table.h"
+#include"instructions/definitions.h"
+#include"instructions/table.h"
#include"apple.h" \ No newline at end of file
diff --git a/headers/instructions.h b/headers/instructions/definitions.h
index bdcd442..bdeb54e 100644
--- a/headers/instructions.h
+++ b/headers/instructions/definitions.h
@@ -347,4 +347,8 @@ void fNOP(Addressing addr, address val){ idata = fAddress(addr, val);
void fBRK(Addressing addr, address val){ idata = fAddress(addr, val);
flagSet(flag_B);
-} \ No newline at end of file
+}
+
+#ifdef ILLEGAL
+#include"illegal/definitions.h"
+#endif \ No newline at end of file
diff --git a/test/adc.test b/headers/instructions/illegal/definitions.h
index e69de29..e69de29 100644
--- a/test/adc.test
+++ b/headers/instructions/illegal/definitions.h
diff --git a/headers/instructions/illegal/init.h b/headers/instructions/illegal/init.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/headers/instructions/illegal/init.h
diff --git a/headers/instructions/illegal/table-append.h b/headers/instructions/illegal/table-append.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/headers/instructions/illegal/table-append.h
diff --git a/headers/instructions-init.h b/headers/instructions/init.h
index 6fddec4..dd2d477 100644
--- a/headers/instructions-init.h
+++ b/headers/instructions/init.h
@@ -1,5 +1,5 @@
// instruction-init.h
-// Initializes every instruction function prior to addressing.h so that function addresses are accessible
+// Initializes every instruction function prior to addressing.h
// Load and Store Instructions
void fLDA(Addressing, address);
@@ -67,4 +67,8 @@ void fSED(Addressing, address);
void fSEI(Addressing, address);
// NOP/BRK Instructions
void fNOP(Addressing, address);
-void fBRK(Addressing, address); \ No newline at end of file
+void fBRK(Addressing, address);
+
+#ifdef ILLEGAL
+#include"illegal/init.h"
+#endif \ No newline at end of file
diff --git a/headers/instruction-table.h b/headers/instructions/table.h
index bb51adb..f37814b 100644
--- a/headers/instruction-table.h
+++ b/headers/instructions/table.h
@@ -261,6 +261,10 @@ void initInstructionTable(){
setInstructionTable(0xEA, (uintptr_t)&fNOP, eImplied);
//BRK(Addressing, address);
setInstructionTable(0x00, (uintptr_t)&fBRK, eImplied);
-}
+ #ifdef ILLEGAL
+ #include"illegal/table-append.h"
+ #endif
+
+}
diff --git a/makefile b/makefile
index 44bb2c1..fc09ade 100644
--- a/makefile
+++ b/makefile
@@ -1,2 +1,5 @@
-main:
- gcc interpreter.c -o interpreter \ No newline at end of file
+default:
+ gcc interpreter.c -o interpreter
+
+illegal:
+ gcc interpreter.c -o interpreter -D ILLEGAL \ No newline at end of file
diff --git a/test/adc b/test/adc
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/adc
diff --git a/test/load.test b/test/load
index 14cdc44..14cdc44 100644
--- a/test/load.test
+++ b/test/load