summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoralekseiplusplus <alekseijeaves@protonmail.com>2023-08-15 17:03:03 +1000
committeralekseiplusplus <alekseijeaves@protonmail.com>2023-08-15 17:03:03 +1000
commitdc2e476c52a24ca910d2c1e60347fd5bce889169 (patch)
treefdb37eb252d2dd7cbf3f6eb7c8ba8ff3768ddf1a /src
parentdb83125332af3622d5dfec5d73a93b7593898d5b (diff)
forgone build process & misc stuff
Diffstat (limited to 'src')
-rw-r--r--src/apple.h16
-rw-r--r--src/cpu/addressing.c2
-rw-r--r--src/cpu/core.h4
-rw-r--r--src/debug.h7
-rw-r--r--src/interpreter.c1
5 files changed, 18 insertions, 12 deletions
diff --git a/src/apple.h b/src/apple.h
index 01452cf..2fe3fcb 100644
--- a/src/apple.h
+++ b/src/apple.h
@@ -1,12 +1,12 @@
-#ifndef APPLE
-#define APPLE
+#ifndef APPLE_H
+#define APPLE_H
-#include"cpu/6502.h"
-#include"cpu/addressing.h"
+#include"cpu/6502.c"
+#include"cpu/addressing.c"
#include"cpu/core.h"
-#include"cpu/instructions.h"
-#include"cpu/table.h"
+#include"cpu/instructions.c"
+#include"cpu/table.c"
#define MEMORY_SIZE 4096
@@ -28,8 +28,4 @@ void AppleOn();
void AppleReset();
-byte getMemory(address x);
-
-void setMemory(address x, byte y);
-
#endif \ No newline at end of file
diff --git a/src/cpu/addressing.c b/src/cpu/addressing.c
index 97ebb00..3fd640a 100644
--- a/src/cpu/addressing.c
+++ b/src/cpu/addressing.c
@@ -169,7 +169,7 @@ AddData fAddress(Addressing mode, short x) {
AddData ret;
ret.add = fAddressGetAddress (mode, x);
ret.value = fAddressGetValue (mode, x, ret.add);
- ret.length = fAddressGetLength (mode, x);
+ ret.length = fAddressGetLength (mode);
ret.cycles = fAddressGetCycles (mode, x, ret.add);
return ret;
} \ No newline at end of file
diff --git a/src/cpu/core.h b/src/cpu/core.h
index 71a420b..03d20d0 100644
--- a/src/cpu/core.h
+++ b/src/cpu/core.h
@@ -31,4 +31,8 @@ typedef struct AddData{
byte value;
} AddData;
+byte getMemory(address x);
+
+void setMemory(address x, byte y);
+
#endif \ No newline at end of file
diff --git a/src/debug.h b/src/debug.h
index b36d187..9a365db 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -32,7 +32,12 @@ void dPageDump(short m){
for(int i = 0; i < 256; i+=16){
printf("\t");
for(int j = 0; j < 16; j+=1){
- printf("%02x ", Memory[(m+(i+j))]);
+ if ((j+1) % 4 == 0){
+ printf("%02x ", Memory[(m+(i+j))]);
+ }
+ else {
+ printf("%02x ", Memory[(m+(i+j))]);
+ }
}
printf("\n");
}
diff --git a/src/interpreter.c b/src/interpreter.c
index 5d41522..4005998 100644
--- a/src/interpreter.c
+++ b/src/interpreter.c
@@ -2,6 +2,7 @@
// Useful for carrying out tests of the CPU instructions.
// Refer to interpreter.md for the manual
+#include"apple.c"
#include"debug.h"
//Write a custom getc function here which ignores spaces