summaryrefslogtreecommitdiff
path: root/src/apple.c
diff options
context:
space:
mode:
authoralekseiplusplus <alekseijeaves@protonmail.com>2023-11-30 14:36:15 +1100
committeralekseiplusplus <alekseijeaves@protonmail.com>2023-11-30 14:36:15 +1100
commitd0f5e175f713a52d76d102780e0b899f3984c416 (patch)
treecfb4b030b186bf3dd4a155a78a9b232e4d971139 /src/apple.c
parent401a2171b1fa2bcc077934191cc609208368152e (diff)
overall progress
Diffstat (limited to 'src/apple.c')
-rw-r--r--src/apple.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/apple.c b/src/apple.c
index 201239a..fbb85f7 100644
--- a/src/apple.c
+++ b/src/apple.c
@@ -1,6 +1,6 @@
#include"apple.h"
-const byte ROM = {
+const byte ROM[256] = {
0xd8, 0x58, 0xa0, 0x7f, 0x8c, 0x12, 0xd0, 0xa9,
0xa7, 0x8d, 0x11, 0xd0, 0x8d, 0x13, 0xd0, 0xc9,
0xdf, 0xf0, 0x13, 0xc9, 0x9b, 0xf0, 0x03, 0xc8,
@@ -37,7 +37,7 @@ const byte ROM = {
void AppleOn() {
Memory = calloc(MEMORY_SIZE, sizeof(byte));
- ROM = calloc(256, sizeof(byte));
+ //ROM = calloc(256, sizeof(byte));
InitInstructionTable();
// Load ROM (alternative)
@@ -92,6 +92,11 @@ byte GetMemory(address x){
if (x >= 0xFF00 && x <= 0xFFFF) {
return ROM[0x00FF & x];
}
+
+ if (x < MEMORY_SIZE)
+ return Memory[x];
+
+ return -1;
}
void SetMemory(address x, byte y){