diff options
Diffstat (limited to 'src/apple.c')
-rw-r--r-- | src/apple.c | 9 |
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){ |