summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcompile-rom.sh2
-rw-r--r--src/apple.c50
-rw-r--r--wozmon.txt32
3 files changed, 42 insertions, 42 deletions
diff --git a/compile-rom.sh b/compile-rom.sh
deleted file mode 100755
index 9cea27c..0000000
--- a/compile-rom.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-cat wozmon.txt | cut -c 7- | tr -d [:space:] | xxd -r -p > rom.bin
diff --git a/src/apple.c b/src/apple.c
index 52ef358..201239a 100644
--- a/src/apple.c
+++ b/src/apple.c
@@ -1,22 +1,56 @@
#include"apple.h"
-byte* ROM;
+const byte ROM = {
+ 0xd8, 0x58, 0xa0, 0x7f, 0x8c, 0x12, 0xd0, 0xa9,
+ 0xa7, 0x8d, 0x11, 0xd0, 0x8d, 0x13, 0xd0, 0xc9,
+ 0xdf, 0xf0, 0x13, 0xc9, 0x9b, 0xf0, 0x03, 0xc8,
+ 0x10, 0x0f, 0xa9, 0xdc, 0x20, 0xef, 0xff, 0xa9,
+ 0x8d, 0x20, 0xef, 0xff, 0xa0, 0x01, 0x88, 0x30,
+ 0xf6, 0xad, 0x11, 0xd0, 0x10, 0xfb, 0xad, 0x10,
+ 0xd0, 0x99, 0x00, 0x02, 0x20, 0xef, 0xff, 0xc9,
+ 0x8d, 0xd0, 0xd4, 0xa0, 0xff, 0xa9, 0x00, 0xaa,
+ 0x0a, 0x85, 0x2b, 0xc8, 0xb9, 0x00, 0x02, 0xc9,
+ 0x8d, 0xf0, 0xd4, 0xc9, 0xae, 0x90, 0xf4, 0xf0,
+ 0xf0, 0xc9, 0xba, 0xf0, 0xeb, 0xc9, 0xd2, 0xf0,
+ 0x3b, 0x86, 0x28, 0x86, 0x29, 0x84, 0x2a, 0xb9,
+ 0x00, 0x02, 0x49, 0xb0, 0xc9, 0x0a, 0x90, 0x06,
+ 0x69, 0x88, 0xc9, 0xfa, 0x90, 0x11, 0x0a, 0x0a,
+ 0x0a, 0x0a, 0xa2, 0x04, 0x0a, 0x26, 0x28, 0x26,
+ 0x29, 0xca, 0xd0, 0xf8, 0xc8, 0xd0, 0xe0, 0xc4,
+ 0x2a, 0xf0, 0x97, 0x24, 0x2b, 0x50, 0x10, 0xa5,
+ 0x28, 0x81, 0x26, 0xe6, 0x26, 0xd0, 0xb5, 0xe6,
+ 0x27, 0x4c, 0x44, 0xff, 0x6c, 0x24, 0x00, 0x30,
+ 0x2b, 0xa2, 0x02, 0xb5, 0x27, 0x95, 0x25, 0x95,
+ 0x23, 0xca, 0xd0, 0xf7, 0xd0, 0x14, 0xa9, 0x8d,
+ 0x20, 0xef, 0xff, 0xa5, 0x25, 0x20, 0xdc, 0xff,
+ 0xa5, 0x24, 0x20, 0xdc, 0xff, 0xa9, 0xba, 0x20,
+ 0xef, 0xff, 0xa9, 0xa0, 0x20, 0xef, 0xff, 0xa1,
+ 0x24, 0x20, 0xdc, 0xff, 0x86, 0x2b, 0xa5, 0x24,
+ 0xc5, 0x28, 0xa5, 0x25, 0xe5, 0x29, 0xb0, 0xc1,
+ 0xe6, 0x24, 0xd0, 0x02, 0xe6, 0x25, 0xa5, 0x24,
+ 0x29, 0x07, 0x10, 0xc8, 0x48, 0x4a, 0x4a, 0x4a,
+ 0x4a, 0x20, 0xe5, 0xff, 0x68, 0x29, 0x0f, 0x09,
+ 0xb0, 0xc9, 0xba, 0x90, 0x02, 0x69, 0x06, 0x2c,
+ 0x12, 0xd0, 0x30, 0xfb, 0x8d, 0x12, 0xd0, 0x60,
+ 0x00, 0x00, 0x00, 0x0f, 0x00, 0xff, 0x00, 0x00
+};
void AppleOn() {
Memory = calloc(MEMORY_SIZE, sizeof(byte));
ROM = calloc(256, sizeof(byte));
InitInstructionTable();
-
- // Load ROM.
- FILE *ROM_File = fopen ("rom.bin", "rb");
+
+ // Load ROM (alternative)
+ /*FILE *ROM_File = fopen ("rom.bin", "rb");
if (ROM_File == NULL) {
printf("\n\rROM does not exist.\n");
abort();
}
- for (int i = 0; i < 256; i++) {
- ROM[i] = fgetc(ROM_File);
- printf("%x", ROM[i]);
- }
+ for (int i = 0; i < 128; i++) {
+ // Retrieve in reversed order.
+ ROM[(2*i)+1] = fgetc(ROM_File);
+ ROM[(2*i) ] = fgetc(ROM_File);
+ }*/
}
void AppleReset(){
diff --git a/wozmon.txt b/wozmon.txt
deleted file mode 100644
index d2a5b42..0000000
--- a/wozmon.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-FF00: D8 58 A0 7F 8C 12 D0 A9
-FF08: A7 8D 11 D0 8D 13 D0 C9
-FF10: DF F0 13 C9 9B F0 03 C8
-FF18: 10 0F A9 DC 20 EF FF A9
-FF20: 8D 20 EF FF A0 01 88 30
-FF28: F6 AD 11 D0 10 FB AD 10
-FF30: D0 99 00 02 20 EF FF C9
-FF38: 8D D0 D4 A0 FF A9 00 AA
-FF40: 0A 85 2B C8 B9 00 02 C9
-FF48: 8D F0 D4 C9 AE 90 F4 F0
-FF50: F0 C9 BA F0 EB C9 D2 F0
-FF58: 3B 86 28 86 29 84 2A B9
-FF60: 00 02 49 B0 C9 0A 90 06
-FF68: 69 88 C9 FA 90 11 0A 0A
-FF70: 0A 0A A2 04 0A 26 28 26
-FF78: 29 CA D0 F8 C8 D0 E0 C4
-FF80: 2A F0 97 24 2B 50 10 A5
-FF88: 28 81 26 E6 26 D0 B5 E6
-FF90: 27 4C 44 FF 6C 24 00 30
-FF98: 2B A2 02 B5 27 95 25 95
-FFA0: 23 CA D0 F7 D0 14 A9 8D
-FFA8: 20 EF FF A5 25 20 DC FF
-FFB0: A5 24 20 DC FF A9 BA 20
-FFB8: EF FF A9 A0 20 EF FF A1
-FFC0: 24 20 DC FF 86 2B A5 24
-FFC8: C5 28 A5 25 E5 29 B0 C1
-FFD0: E6 24 D0 02 E6 25 A5 24
-FFD8: 29 07 10 C8 48 4A 4A 4A
-FFE0: 4A 20 E5 FF 68 29 0F 09
-FFE8: B0 C9 BA 90 02 69 06 2C
-FFF0: 12 D0 30 FB 8D 12 D0 60
-FFF8: 00 00 00 0F 00 FF 00 00