]> Shamusworld >> Repos - apple2/commitdiff
Created new MMU based code for R/W handling. Should be much faster now.
authorShamus Hammons <jlhamm@acm.org>
Sat, 28 Sep 2013 23:15:54 +0000 (18:15 -0500)
committerShamus Hammons <jlhamm@acm.org>
Sat, 28 Sep 2013 23:15:54 +0000 (18:15 -0500)
35 files changed:
Makefile
apple2.cfg
src/apple2.cpp
src/apple2.h
src/applevideo.cpp
src/charset.h
src/dis65c02.cpp
src/dis65c02.h
src/firmware.cpp [new file with mode: 0755]
src/firmware.h [changed mode: 0755->0644]
src/floppy.cpp
src/font14pt.h
src/gui/button.cpp
src/gui/diskwindow.cpp
src/gui/draggablewindow.cpp
src/gui/draggablewindow2.cpp
src/gui/element.cpp
src/gui/font1.h
src/gui/font14pt.h
src/gui/gui.cpp
src/gui/guimisc.cpp
src/gui/menu.cpp
src/gui/text.cpp
src/gui/text.h
src/gui/textedit.cpp
src/gui/window.cpp
src/log.cpp
src/mmu.cpp [new file with mode: 0644]
src/mmu.h [new file with mode: 0644]
src/settings.cpp
src/sound.cpp
src/sound.h
src/v65c02.cpp
src/v65c02.h
src/video.cpp

index ba62de7876a3a6cf72569082f95a5048cb242248..d1f78b53c87ab42c770ce63d0829697c2431ea62 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 #
 # Unified Makefile for Apple 2 SDL
 #
-# by James L. Hammons
+# by James Hammons
 # (C) 2005 Underground Software
 # This software is licensed under the GPL v2
 #
@@ -83,8 +83,10 @@ OBJS = \
        obj/applevideo.o      \
        obj/ay8910.o          \
        obj/dis65c02.o        \
+       obj/firmware.o        \
        obj/floppy.o          \
        obj/log.o             \
+       obj/mmu.o             \
        obj/sdlemu_config.o   \
        obj/settings.o        \
        obj/sound.o           \
index faf073e83de48d94a21b6169699cba9612acc946..c010f99446574666b48e1ac34e302ad5ae00bf5e 100755 (executable)
@@ -23,8 +23,9 @@ autoSaveState = 1
 # Yes
 #floppyImage1 = ./disks/Gumball (Mr. Krac-Man and The Disk Jockey crack).dsk
 # Yes
-#floppyImage1 = ./disks/prince_of_persia_boot.dsk
-#floppyImage2 = ./disks/prince_of_persia_a.dsk
+floppyImage1 = ./disks/prince_of_persia_boot.dsk
+floppyImage2 = ./disks/prince_of_persia_a.dsk
+#floppyImage1 = ./disks/prince_of_persia_b.dsk
 # Yes
 #floppyImage1 = ./disks/Oregon Trail (Disk 1 of 2).dsk
 #floppyImage2 = ./disks/Oregon Trail (Disk 2 of 2).dsk
@@ -32,7 +33,7 @@ autoSaveState = 1
 #floppyImage1 = ./disks/bt1_boot.dsk
 # Yes
 #floppyImage1 = ./disks/bt2_boot.dsk
-# Yes
+# Yes (no)
 #floppyImage1 = ./disks/bt3_boot_fixed.dsk
 #floppyImage2 = ./disks/bt3_character_fixed.dsk
 # Yes
@@ -42,11 +43,13 @@ autoSaveState = 1
 # Yes
 #floppyImage1 = ./disks/drol.dsk
 # Yes
+#floppyImage1 = ./disks/skyfox.dsk
+# Yes
 #floppyImage1 = ./disks/karateka.dsk
 # Yes
 #floppyImage1 = ./disks/wolfenstein_dos32.nib
 # Yes, keys??? (joystick only)
-floppyImage1 = ./disks/MidnightMagic_etc.dsk
+#floppyImage1 = ./disks/MidnightMagic_etc.dsk
 # Yes
 #floppyImage1 = ./disks/battle_chess_1.dsk
 #floppyImage2 = ./disks/battle_chess_2.dsk
index e1cde1704eb8a655e75129e099072b8bb7e73d72..f886a7d1c65fcb333acbf77f90104356001d2988 100755 (executable)
@@ -1,7 +1,7 @@
 //
 // Apple 2 SDL Portable Apple Emulator
 //
-// by James L. Hammons
+// by James Hammons
 // (C) 2005 Underground Software
 //
 // Loosely based on AppleWin by Tom Charlesworth which was based on AppleWin by
@@ -9,7 +9,7 @@
 // also derived from ApplePC. Too bad it was closed source--it could have been
 // *the* premier Apple II emulator out there.
 //
-// JLH = James L. Hammons <jlhamm@acm.org>
+// JLH = James Hammons <jlhamm@acm.org>
 //
 // WHO  WHEN        WHAT
 // ---  ----------  ------------------------------------------------------------
@@ -17,6 +17,7 @@
 // JLH  11/18/2005  Wired up graphic soft switches
 // JLH  12/02/2005  Setup timer subsystem for more accurate time keeping
 // JLH  12/12/2005  Added preliminary state saving support
+// JLH  09/24/2013  Added //e support
 //
 
 // STILL TO DO:
@@ -25,7 +26,7 @@
 // - GUI goodies
 // - Weed out unneeded functions [DONE]
 // - Disk I/O [DONE]
-// - 128K IIe related stuff
+// - 128K IIe related stuff [DONE]
 // - State loading/saving
 //
 
@@ -48,6 +49,7 @@
 #include "timing.h"
 #include "floppy.h"
 #include "firmware.h"
+#include "mmu.h"
 
 #include "gui/gui.h"
 #include "gui/window.h"
 
 uint8_t ram[0x10000], rom[0x10000];                            // RAM & ROM spaces
 uint8_t ram2[0x10000];                                                 // Auxillary RAM
-uint8_t diskRom[0x100];                                                        // Disk ROM space
+//uint8_t diskRom[0x100];                                                      // Disk ROM space
 V65C02REGS mainCPU;                                                            // v65C02 execution context
 uint8_t appleType = APPLE_TYPE_IIE;
 FloppyDrive floppyDrive;
 
 // Local variables
 
-static uint8_t lastKeyPressed = 0;
-static bool keyDown = false;
-static bool openAppleDown = false;
-static bool closedAppleDown = false;
-static bool store80Mode = false;
-static bool vbl = false;
-static bool slotCXROM = false;
-static bool slotC3ROM = false;
-static bool ramrd = false;
-static bool ramwrt = false;
-static bool altzp = false;
-static bool ioudis = true;
+uint8_t lastKeyPressed = 0;
+bool keyDown = false;
+bool openAppleDown = false;
+bool closedAppleDown = false;
+bool store80Mode = false;
+bool vbl = false;
+bool slotCXROM = false;
+bool slotC3ROM = false;
+bool ramrd = false;
+bool ramwrt = false;
+bool altzp = false;
+bool ioudis = true;
 bool dhires = false;
 
 //static FloppyDrive floppyDrive;
@@ -124,7 +126,6 @@ static SDL_sem * mainSem = NULL;
 static bool cpuFinished = false;
 static bool cpuSleep = false;
 
-
 // NB: Apple //e Manual sez 6502 is running @ 1,022,727 Hz
 
 // Let's try a thread...
@@ -204,32 +205,20 @@ WriteLog("CPU: Execute65C02(&mainCPU, cycles);\n");
                }
 #endif
 
-//WriteLog("CPUThread: Supposedly end of frame...\n");
-
 #ifdef THREAD_DEBUGGING
 WriteLog("CPU: SDL_mutexP(cpuMutex);\n");
 #endif
                SDL_mutexP(cpuMutex);
-#if 0
-               if (SDL_CondWait(cpuCond, cpuMutex) != 0)
-               {
-                       printf("SDL_CondWait != 0! (Error: '%s')\n", SDL_GetError());
-                       exit(-1);
-               }
-#else
 // increment mainSem...
 #ifdef THREAD_DEBUGGING
 WriteLog("CPU: SDL_SemPost(mainSem);\n");
 #endif
-SDL_SemPost(mainSem);
-//             SDL_CondSignal(mainCond);       // In case something is waiting on us...
-
+               SDL_SemPost(mainSem);
 #ifdef THREAD_DEBUGGING
 WriteLog("CPU: SDL_CondWait(cpuCond, cpuMutex);\n");
 #endif
                SDL_CondWait(cpuCond, cpuMutex);
 
-#endif
 #ifdef THREAD_DEBUGGING
 WriteLog("CPU: SDL_mutexV(cpuMutex);\n");
 #endif
@@ -1235,15 +1224,7 @@ WriteLog("LC(R): $C08B 49291 OECG RR Read/Write RAM bank 1\n");
        {
                floppyDrive.SetWriteMode();
        }
-//Still need to add missing I/O switches here...
 
-//DEEE: BD 10 BF       LDA   $BF10,X    [PC=DEF1, SP=01F4, CC=--.B-IZ-, A=00, X=0C, Y=07]
-#if 0
-if (addr >= 0xD000 && addr <= 0xD00F)
-{
-       WriteLog("*** Write to $%04X: $%02X (writeRAM=%s, PC=%04X, ram$D000=%02X)\n", addr, b, (writeRAM ? "T" : "F"), mainCPU.pc, ram[0xC000]);
-}
-#endif
        if (addr >= 0xC000 && addr <= 0xCFFF)
                return; // Protect LC bank #1 from being written to!
 
@@ -1372,10 +1353,18 @@ int main(int /*argc*/, char * /*argv*/[])
        memset(rom, 0, 0x10000);
        memset(ram2, 0, 0x10000);
 
+#if 1
+       // Set up MMU
+       SetupAddressMap();
+
        // Set up V65C02 execution context
        memset(&mainCPU, 0, sizeof(V65C02REGS));
+       mainCPU.RdMem = AppleReadMem;
+       mainCPU.WrMem = AppleWriteMem;
+#else
        mainCPU.RdMem = RdMem;
        mainCPU.WrMem = WrMem;
+#endif
        mainCPU.cpuFlags |= V65C02_ASSERT_LINE_RESET;
 
 //     alternateCharset = true;
@@ -1618,6 +1607,7 @@ static void FrameCallback(void)
        {
                switch (event.type)
                {
+// Problem with using SDL_TEXTINPUT is that it causes key delay. :-/
                case SDL_TEXTINPUT:
 //Need to do some key translation here, and screen out non-apple keys as well...
 //(really, could do it all in SDL_KEYDOWN, would just have to get symbols &
index 7696c5aa915fd4581921a8ee25162a8aff6039a2..98b31e1fb844c90ddc6af65e7195901d82f615ba 100755 (executable)
@@ -11,6 +11,19 @@ enum { APPLE_TYPE_II, APPLE_TYPE_IIE, APPLE_TYPE_IIC };
 
 extern uint8_t ram[0x10000], rom[0x10000];             // RAM & ROM pointers
 extern uint8_t ram2[0x10000];                                  // Auxillary RAM
+//extern uint8_t diskRom[0x100];                                       // Floppy disk ROM
 extern uint8_t appleType;
 extern FloppyDrive floppyDrive;
+extern uint8_t lastKeyPressed;
+extern bool keyDown;
+extern bool openAppleDown;
+extern bool closedAppleDown;
+extern bool store80Mode;
+extern bool vbl;
+extern bool slotCXROM;
+extern bool slotC3ROM;
+extern bool ramrd;
+extern bool ramwrt;
+extern bool altzp;
+extern bool ioudis;
 extern bool dhires;
index 807253b1d267644d8a98dd0921f69a56dc95d918..d903e4995af2713c988616703dede210039cf70d 100755 (executable)
@@ -3,10 +3,10 @@
 //
 // All the video modes that a real Apple 2 supports are handled here
 //
-// by James L. Hammons
+// by James Hammons
 // (c) 2005 Underground Software
 //
-// JLH = James L. Hammons <jlhamm@acm.org>
+// JLH = James Hammons <jlhamm@acm.org>
 //
 // WHO  WHEN        WHAT
 // ---  ----------  ------------------------------------------------------------
index 1f58e3089277a474c610722d534660558003b504..0b32c694a0731d6fa5f45a43538b69786bc6fd03 100755 (executable)
@@ -1,7 +1,7 @@
 //
 // The Apple II/IIe video generator character set
 //
-// by James L. Hammons
+// by James Hammons
 // (C) 2005 Underground Software
 //
 // While we could pack things into bytes, it doesn't cost too much to have everything
index d275f385679d890aa8be3aa2eac764adf0d6101a..2721d056c1f1cb3a916b385215080e4af64be753 100755 (executable)
@@ -1,7 +1,7 @@
 //
 // 65C02 disassembler
 //
-// by James L. Hammons
+// by James Hammons
 // (c) 2005 Underground Software
 //
 
index ab6ba2d691f1be82572a26d5b3e8c28264a5cd73..fc1e4ac4c0e3e706575d0df49ad9e5537288aee1 100755 (executable)
@@ -1,7 +1,7 @@
 //
 // DIS65C02.H
 //
-// by James L. Hammons
+// by James Hammons
 // (C) 2004 Underground Software
 //
 
diff --git a/src/firmware.cpp b/src/firmware.cpp
new file mode 100755 (executable)
index 0000000..24bf5b7
--- /dev/null
@@ -0,0 +1,239 @@
+//
+// This file was automagically generated by bin2c (by James Hammons)
+//
+
+#include "firmware.h"
+
+uint8_t diskROM[0x100] = {             // Loads at $C600 (slot 6)
+       0xA2, 0x20, 0xA0, 0x00, 0xA2, 0x03, 0x86, 0x3C, 0x8A, 0x0A, 0x24, 0x3C, 0xF0, 0x10, 0x05, 0x3C,
+       0x49, 0xFF, 0x29, 0x7E, 0xB0, 0x08, 0x4A, 0xD0, 0xFB, 0x98, 0x9D, 0x56, 0x03, 0xC8, 0xE8, 0x10,
+       0xE5, 0x20, 0x58, 0xFF, 0xBA, 0xBD, 0x00, 0x01, 0x0A, 0x0A, 0x0A, 0x0A, 0x85, 0x2B, 0xAA, 0xBD,
+       0x8E, 0xC0, 0xBD, 0x8C, 0xC0, 0xBD, 0x8A, 0xC0, 0xBD, 0x89, 0xC0, 0xA0, 0x50, 0xBD, 0x80, 0xC0,
+       0x98, 0x29, 0x03, 0x0A, 0x05, 0x2B, 0xAA, 0xBD, 0x81, 0xC0, 0xA9, 0x56, 0x20, 0xA8, 0xFC, 0x88,
+       0x10, 0xEB, 0x85, 0x26, 0x85, 0x3D, 0x85, 0x41, 0xA9, 0x08, 0x85, 0x27, 0x18, 0x08, 0xBD, 0x8C,
+       0xC0, 0x10, 0xFB, 0x49, 0xD5, 0xD0, 0xF7, 0xBD, 0x8C, 0xC0, 0x10, 0xFB, 0xC9, 0xAA, 0xD0, 0xF3,
+       0xEA, 0xBD, 0x8C, 0xC0, 0x10, 0xFB, 0xC9, 0x96, 0xF0, 0x09, 0x28, 0x90, 0xDF, 0x49, 0xAD, 0xF0,
+       0x25, 0xD0, 0xD9, 0xA0, 0x03, 0x85, 0x40, 0xBD, 0x8C, 0xC0, 0x10, 0xFB, 0x2A, 0x85, 0x3C, 0xBD,
+       0x8C, 0xC0, 0x10, 0xFB, 0x25, 0x3C, 0x88, 0xD0, 0xEC, 0x28, 0xC5, 0x3D, 0xD0, 0xBE, 0xA5, 0x40,
+       0xC5, 0x41, 0xD0, 0xB8, 0xB0, 0xB7, 0xA0, 0x56, 0x84, 0x3C, 0xBC, 0x8C, 0xC0, 0x10, 0xFB, 0x59,
+       0xD6, 0x02, 0xA4, 0x3C, 0x88, 0x99, 0x00, 0x03, 0xD0, 0xEE, 0x84, 0x3C, 0xBC, 0x8C, 0xC0, 0x10,
+       0xFB, 0x59, 0xD6, 0x02, 0xA4, 0x3C, 0x91, 0x26, 0xC8, 0xD0, 0xEF, 0xBC, 0x8C, 0xC0, 0x10, 0xFB,
+       0x59, 0xD6, 0x02, 0xD0, 0x87, 0xA0, 0x00, 0xA2, 0x56, 0xCA, 0x30, 0xFB, 0xB1, 0x26, 0x5E, 0x00,
+       0x03, 0x2A, 0x5E, 0x00, 0x03, 0x2A, 0x91, 0x26, 0xC8, 0xD0, 0xEE, 0xE6, 0x27, 0xE6, 0x3D, 0xA5,
+       0x3D, 0xCD, 0x00, 0x08, 0xA6, 0x2B, 0x90, 0xDB, 0x4C, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+uint8_t hdROM[0x100] = {               // Loads at $C700 (slot 7)
+       0xA9, 0x20, 0xA9, 0x00, 0xA9, 0x03, 0xA9, 0x3C, 0xA9, 0x00, 0x8D, 0xF2, 0xC0, 0xA9, 0x70, 0x8D,
+       0xF3, 0xC0, 0xAD, 0xF0, 0xC0, 0x48, 0xAD, 0xF1, 0xC0, 0x18, 0xC9, 0x01, 0xD0, 0x01, 0x38, 0x68,
+       0x90, 0x03, 0x4C, 0x00, 0xC6, 0xA9, 0x70, 0x85, 0x43, 0xA9, 0x00, 0x85, 0x44, 0x85, 0x46, 0x85,
+       0x47, 0xA9, 0x08, 0x85, 0x45, 0xA9, 0x01, 0x85, 0x42, 0x20, 0x46, 0xC7, 0x90, 0x03, 0x4C, 0x00,
+       0xC6, 0xA2, 0x70, 0x4C, 0x01, 0x08, 0x18, 0xA5, 0x42, 0x8D, 0xF2, 0xC0, 0xA5, 0x43, 0x8D, 0xF3,
+       0xC0, 0xA5, 0x44, 0x8D, 0xF4, 0xC0, 0xA5, 0x45, 0x8D, 0xF5, 0xC0, 0xA5, 0x46, 0x8D, 0xF6, 0xC0,
+       0xA5, 0x47, 0x8D, 0xF7, 0xC0, 0xAd, 0xF0, 0xC0, 0x48, 0xA5, 0x42, 0xC9, 0x01, 0xD0, 0x03, 0x20,
+       0x7D, 0xC7, 0xAD, 0xF1, 0xC0, 0x18, 0xC9, 0x01, 0xD0, 0x01, 0x38, 0x68, 0x60, 0x98, 0x48, 0xA0,
+       0x00, 0xAD, 0xF8, 0xC0, 0x91, 0x44, 0xC8, 0xD0, 0xF8, 0xE6, 0x45, 0xA0, 0x00, 0xAD, 0xF8, 0xC0,
+       0x91, 0x44, 0xC8, 0xD0, 0xF8, 0x68, 0xA8, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x7F, 0xD7, 0x46
+};
+
+uint8_t parallelROM[0x100] = {
+       0x18, 0xB0, 0x38, 0x48, 0x8A, 0x48, 0x98, 0x48, 0x08, 0x78, 0x20, 0x58, 0xFF, 0xBA, 0x68, 0x68, 
+       0x68, 0x68, 0xA8, 0xCA, 0x9A, 0x68, 0x28, 0xAA, 0x90, 0x38, 0xBD, 0xB8, 0x05, 0x10, 0x19, 0x98, 
+       0x29, 0x7F, 0x49, 0x30, 0xC9, 0x0A, 0x90, 0x3B, 0xC9, 0x78, 0xB0, 0x29, 0x49, 0x3D, 0xF0, 0x21, 
+       0x98, 0x29, 0x9F, 0x9D, 0x38, 0x06, 0x90, 0x7E, 0xBD, 0xB8, 0x06, 0x30, 0x14, 0xA5, 0x24, 0xDD, 
+       0x38, 0x07, 0xB0, 0x0D, 0xC9, 0x11, 0xB0, 0x09, 0x09, 0xF0, 0x3D, 0x38, 0x07, 0x65, 0x24, 0x85, 
+       0x24, 0x4A, 0x38, 0xB0, 0x6D, 0x18, 0x6A, 0x3D, 0xB8, 0x06, 0x90, 0x02, 0x49, 0x81, 0x9D, 0xB8, 
+       0x06, 0xD0, 0x53, 0xA0, 0x0A, 0x7D, 0x38, 0x05, 0x88, 0xD0, 0xFA, 0x9D, 0xB8, 0x04, 0x9D, 0x38, 
+       0x05, 0x38, 0xB0, 0x43, 0xC5, 0x24, 0x90, 0x3A, 0x68, 0xA8, 0x68, 0xAA, 0x68, 0x4C, 0xF0, 0xFD, 
+       0x90, 0xFE, 0xB0, 0xFE, 0x99, 0x80, 0xC0, 0x90, 0x37, 0x49, 0x07, 0xA8, 0x49, 0x0A, 0x0A, 0xD0, 
+       0x06, 0xB8, 0x85, 0x24, 0x9D, 0x38, 0x07, 0xBD, 0xB8, 0x06, 0x4A, 0x70, 0x02, 0xB0, 0x23, 0x0A, 
+       0x0A, 0xA9, 0x27, 0xB0, 0xCF, 0xBD, 0x38, 0x07, 0xFD, 0xB8, 0x04, 0xC9, 0xF8, 0x90, 0x03, 0x69, 
+       0x27, 0xAC, 0xA9, 0x00, 0x85, 0x24, 0x18, 0x7E, 0xB8, 0x05, 0x68, 0xA8, 0x68, 0xAA, 0x68, 0x60, 
+       0x90, 0x27, 0xB0, 0x00, 0x10, 0x11, 0xA9, 0x89, 0x9D, 0x38, 0x06, 0x9D, 0xB8, 0x06, 0xA9, 0x28, 
+       0x9D, 0xB8, 0x04, 0xA9, 0x02, 0x85, 0x36, 0x98, 0x5D, 0x38, 0x06, 0x0A, 0xF0, 0x90, 0x5E, 0xB8, 
+       0x05, 0x98, 0x48, 0x8A, 0x0A, 0x0A, 0x0A, 0x0A, 0xA8, 0xBD, 0x38, 0x07, 0xC5, 0x24, 0x68, 0xB0, 
+       0x05, 0x48, 0x29, 0x80, 0x09, 0x20, 0x2C, 0x58, 0xFF, 0xF0, 0x03, 0xFE, 0x38, 0x07, 0x70, 0x84
+};
+
+// Various firmware from the IIe ROM file...
+
+//Not sure what the heck this is...
+uint8_t slot2e[0x100] = {
+       0x2C, 0x58, 0xFF, 0x70, 0x0C, 0x38, 0x90, 0x18, 0xB8, 0x50, 0x06, 0x01, 0x31, 0x8E, 0x94, 0x97, 
+       0x9A, 0x85, 0x27, 0x86, 0x35, 0x8A, 0x48, 0x98, 0x48, 0x08, 0x78, 0x8D, 0xFF, 0xCF, 0x20, 0x58, 
+       0xFF, 0xBA, 0xBD, 0x00, 0x01, 0x8D, 0xF8, 0x07, 0xAA, 0x0A, 0x0A, 0x0A, 0x0A, 0x85, 0x26, 0xA8, 
+       0x28, 0x50, 0x29, 0x1E, 0x38, 0x05, 0x5E, 0x38, 0x05, 0xB9, 0x8A, 0xC0, 0x29, 0x1F, 0xD0, 0x05, 
+       0xA9, 0xEF, 0x20, 0x05, 0xC8, 0xE4, 0x37, 0xD0, 0x0B, 0xA9, 0x07, 0xC5, 0x36, 0xF0, 0x05, 0x85, 
+       0x36, 0x18, 0x90, 0x08, 0xE4, 0x39, 0xD0, 0xF9, 0xA9, 0x05, 0x85, 0x38, 0xBD, 0x38, 0x07, 0x29, 
+       0x02, 0x08, 0x90, 0x03, 0x4C, 0xBF, 0xC8, 0xBD, 0xB8, 0x04, 0x48, 0x0A, 0x10, 0x0E, 0xA6, 0x35, 
+       0xA5, 0x27, 0x09, 0x20, 0x9D, 0x00, 0x02, 0x85, 0x27, 0xAE, 0xF8, 0x07, 0x68, 0x29, 0xBF, 0x9D, 
+       0xB8, 0x04, 0x28, 0xF0, 0x06, 0x20, 0x63, 0xCB, 0x4C, 0xB5, 0xC8, 0x4C, 0xFC, 0xC8, 0x20, 0x00, 
+       0xC8, 0xA2, 0x00, 0x60, 0x4C, 0x9B, 0xC8, 0x4C, 0xAA, 0xC9, 0x4A, 0x20, 0x9B, 0xC9, 0xB0, 0x08, 
+       0x20, 0xF5, 0xCA, 0xF0, 0x06, 0x18, 0x90, 0x03, 0x20, 0xD2, 0xCA, 0xBD, 0xB8, 0x05, 0xAA, 0x60, 
+       0xA2, 0x03, 0xB5, 0x36, 0x48, 0xCA, 0x10, 0xFA, 0xAE, 0xF8, 0x07, 0xBD, 0x38, 0x06, 0x85, 0x36, 
+       0xBD, 0xB8, 0x04, 0x29, 0x38, 0x4A, 0x4A, 0x4A, 0x09, 0xC0, 0x85, 0x37, 0x8A, 0x48, 0xA5, 0x27, 
+       0x48, 0x09, 0x80, 0x20, 0xED, 0xFD, 0x68, 0x85, 0x27, 0x68, 0x8D, 0xF8, 0x07, 0xAA, 0x0A, 0x0A, 
+       0x0A, 0x0A, 0x85, 0x26, 0x8D, 0xFF, 0xCF, 0xA5, 0x36, 0x9D, 0x38, 0x06, 0xA2, 0x00, 0x68, 0x95, 
+       0x36, 0xE8, 0xE0, 0x04, 0x90, 0xF8, 0xAE, 0xF8, 0x07, 0x60, 0xC1, 0xD0, 0xD0, 0xCC, 0xC5, 0x08
+};
+
+//This looks identical to diskROM
+uint8_t slot6e[0x100] = {
+       0xA2, 0x20, 0xA0, 0x00, 0xA2, 0x03, 0x86, 0x3C, 0x8A, 0x0A, 0x24, 0x3C, 0xF0, 0x10, 0x05, 0x3C, 
+       0x49, 0xFF, 0x29, 0x7E, 0xB0, 0x08, 0x4A, 0xD0, 0xFB, 0x98, 0x9D, 0x56, 0x03, 0xC8, 0xE8, 0x10, 
+       0xE5, 0x20, 0x58, 0xFF, 0xBA, 0xBD, 0x00, 0x01, 0x0A, 0x0A, 0x0A, 0x0A, 0x85, 0x2B, 0xAA, 0xBD, 
+       0x8E, 0xC0, 0xBD, 0x8C, 0xC0, 0xBD, 0x8A, 0xC0, 0xBD, 0x89, 0xC0, 0xA0, 0x50, 0xBD, 0x80, 0xC0, 
+       0x98, 0x29, 0x03, 0x0A, 0x05, 0x2B, 0xAA, 0xBD, 0x81, 0xC0, 0xA9, 0x56, 0x20, 0xA8, 0xFC, 0x88, 
+       0x10, 0xEB, 0x85, 0x26, 0x85, 0x3D, 0x85, 0x41, 0xA9, 0x08, 0x85, 0x27, 0x18, 0x08, 0xBD, 0x8C, 
+       0xC0, 0x10, 0xFB, 0x49, 0xD5, 0xD0, 0xF7, 0xBD, 0x8C, 0xC0, 0x10, 0xFB, 0xC9, 0xAA, 0xD0, 0xF3, 
+       0xEA, 0xBD, 0x8C, 0xC0, 0x10, 0xFB, 0xC9, 0x96, 0xF0, 0x09, 0x28, 0x90, 0xDF, 0x49, 0xAD, 0xF0, 
+       0x25, 0xD0, 0xD9, 0xA0, 0x03, 0x85, 0x40, 0xBD, 0x8C, 0xC0, 0x10, 0xFB, 0x2A, 0x85, 0x3C, 0xBD, 
+       0x8C, 0xC0, 0x10, 0xFB, 0x25, 0x3C, 0x88, 0xD0, 0xEC, 0x28, 0xC5, 0x3D, 0xD0, 0xBE, 0xA5, 0x40, 
+       0xC5, 0x41, 0xD0, 0xB8, 0xB0, 0xB7, 0xA0, 0x56, 0x84, 0x3C, 0xBC, 0x8C, 0xC0, 0x10, 0xFB, 0x59, 
+       0xD6, 0x02, 0xA4, 0x3C, 0x88, 0x99, 0x00, 0x03, 0xD0, 0xEE, 0x84, 0x3C, 0xBC, 0x8C, 0xC0, 0x10, 
+       0xFB, 0x59, 0xD6, 0x02, 0xA4, 0x3C, 0x91, 0x26, 0xC8, 0xD0, 0xEF, 0xBC, 0x8C, 0xC0, 0x10, 0xFB, 
+       0x59, 0xD6, 0x02, 0xD0, 0x87, 0xA0, 0x00, 0xA2, 0x56, 0xCA, 0x30, 0xFB, 0xB1, 0x26, 0x5E, 0x00, 
+       0x03, 0x2A, 0x5E, 0x00, 0x03, 0x2A, 0x91, 0x26, 0xC8, 0xD0, 0xEE, 0xE6, 0x27, 0xE6, 0x3D, 0xA5, 
+       0x3D, 0xCD, 0x00, 0x08, 0xA6, 0x2B, 0x90, 0xDB, 0x4C, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+// Various firmware from the IIc
+
+uint8_t slot1[0x100] = {
+       0x2C, 0x89, 0xC1, 0x70, 0x0C, 0x38, 0x90, 0x18, 0xB8, 0x50, 0x06, 0x01, 0x31, 0x9E, 0xA8, 0xB4, 
+       0xBB, 0xDA, 0xA2, 0xC1, 0x4C, 0x1C, 0xC2, 0x90, 0x03, 0x4C, 0xE5, 0xC7, 0x0A, 0x7A, 0x5A, 0xBD, 
+       0xB8, 0x04, 0xF0, 0x42, 0xA5, 0x24, 0xB0, 0x1C, 0xDD, 0xB8, 0x04, 0x90, 0x03, 0xBD, 0x38, 0x07, 
+       0xDD, 0x38, 0x07, 0xB0, 0x0B, 0xC9, 0x11, 0xB0, 0x11, 0x09, 0xF0, 0x3D, 0x38, 0x07, 0x65, 0x24, 
+       0x85, 0x24, 0x80, 0x06, 0xC5, 0x21, 0x90, 0x02, 0x64, 0x24, 0x7A, 0x5A, 0xBD, 0x38, 0x07, 0xDD, 
+       0xB8, 0x04, 0xB0, 0x08, 0xC5, 0x24, 0xB0, 0x0E, 0xA9, 0x40, 0x80, 0x02, 0xA9, 0x1A, 0xC0, 0x80, 
+       0x6A, 0x20, 0x9B, 0xC1, 0x80, 0xE4, 0x98, 0x20, 0x8A, 0xC1, 0xBD, 0xB8, 0x04, 0xF0, 0x17, 0x3C, 
+       0xB8, 0x06, 0x30, 0x12, 0xBD, 0x38, 0x07, 0xFD, 0xB8, 0x04, 0xC9, 0xF8, 0x90, 0x04, 0x18, 0x65, 
+       0x21, 0xAC, 0xA9, 0x00, 0x85, 0x24, 0x68, 0x7A, 0xFA, 0x60, 0x20, 0xA9, 0xC7, 0x90, 0xFA, 0x3C, 
+       0xB8, 0x06, 0x10, 0x07, 0xC9, 0x91, 0xF0, 0x03, 0x20, 0xF0, 0xFD, 0x4C, 0xCD, 0xC7, 0x5A, 0x48, 
+       0x20, 0xB6, 0xC2, 0x9E, 0xB8, 0x06, 0x80, 0x07, 0x5A, 0x20, 0xD9, 0xC7, 0x90, 0xFA, 0x90, 0x68, 
+       0x7A, 0xA2, 0x00, 0x60, 0x5A, 0x48, 0x20, 0x8A, 0xC1, 0x80, 0xF4, 0x5A, 0x48, 0x4A, 0xD0, 0x15, 
+       0x08, 0x20, 0xD3, 0xC7, 0x28, 0x90, 0x05, 0x29, 0x28, 0x0A, 0x80, 0x02, 0x29, 0x30, 0xC9, 0x10, 
+       0xF0, 0xDD, 0x18, 0x80, 0xDA, 0xA2, 0x40, 0x68, 0x7A, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+uint8_t slot2[0x100] = {
+       0x2C, 0x89, 0xC1, 0x70, 0x14, 0x38, 0x90, 0x18, 0xB8, 0x50, 0x0E, 0x01, 0x31, 0x11, 0x13, 0x15, 
+       0x17, 0x80, 0x8B, 0x80, 0x93, 0x80, 0x9D, 0x80, 0xA2, 0xDA, 0xA2, 0xC2, 0x5A, 0x48, 0x8E, 0xF8, 
+       0x07, 0x50, 0x22, 0xA5, 0x36, 0x45, 0x38, 0xF0, 0x06, 0xA5, 0x37, 0xC5, 0x39, 0xF0, 0x03, 0x20, 
+       0xB6, 0xC2, 0x8A, 0x45, 0x39, 0x05, 0x38, 0xD0, 0x07, 0xA9, 0x05, 0x85, 0x38, 0x38, 0x80, 0x05, 
+       0xA9, 0x07, 0x85, 0x36, 0x18, 0xBD, 0xB8, 0x06, 0x89, 0x01, 0xD0, 0x03, 0x4C, 0x17, 0xC1, 0x90, 
+       0xFB, 0x68, 0x80, 0x28, 0x3C, 0xB8, 0x03, 0x50, 0x1C, 0x20, 0x8F, 0xC1, 0x80, 0x1E, 0x68, 0x20, 
+       0x70, 0xCC, 0x10, 0x1B, 0x20, 0xA9, 0xC7, 0xB0, 0xEB, 0x29, 0x5F, 0xC9, 0x51, 0xF0, 0x04, 0xC9, 
+       0x52, 0xD0, 0x09, 0xA9, 0x98, 0x7A, 0xFA, 0x60, 0x18, 0x20, 0xA3, 0xC7, 0x20, 0x4C, 0xCC, 0x48, 
+       0x20, 0xD9, 0xC7, 0xB0, 0x09, 0xBD, 0xB8, 0x06, 0x29, 0x10, 0xF0, 0xD2, 0x80, 0xF2, 0xA8, 0x68, 
+       0x5A, 0x20, 0xB8, 0xC3, 0x68, 0xBC, 0x38, 0x06, 0xF0, 0x12, 0x09, 0x80, 0xC9, 0x91, 0xF0, 0xDC, 
+       0xC9, 0xFF, 0xF0, 0xD8, 0xC9, 0x92, 0xF0, 0xD0, 0xC9, 0x94, 0xF0, 0xCD, 0x3C, 0xB8, 0x03, 0x50, 
+       0xC4, 0x20, 0xED, 0xFD, 0x80, 0xC6, 0x20, 0x9A, 0xCF, 0xBC, 0x29, 0xC2, 0x20, 0x7C, 0xC3, 0x48, 
+       0x88, 0x30, 0x04, 0xC0, 0x03, 0xD0, 0xF5, 0x20, 0x9A, 0xCF, 0x68, 0xBC, 0x2B, 0xC2, 0x99, 0xFB, 
+       0xBF, 0x68, 0x99, 0xFA, 0xBF, 0x68, 0x9D, 0xB8, 0x06, 0x29, 0x01, 0xD0, 0x02, 0xA9, 0x09, 0x9D, 
+       0x38, 0x06, 0x68, 0x9D, 0xB8, 0x04, 0x9E, 0xB8, 0x03, 0x60, 0x03, 0x07, 0xA0, 0xB0, 0x00, 0x00, 
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+uint8_t slot3[0x100] = {
+       0x48, 0xDA, 0x5A, 0x80, 0x12, 0x38, 0x90, 0x18, 0x80, 0x1A, 0xEA, 0x01, 0x88, 0x2C, 0x2F, 0x32, 
+       0x35, 0x4C, 0xAF, 0xC7, 0x4C, 0xB5, 0xC7, 0x20, 0x20, 0xCE, 0x20, 0xBE, 0xCD, 0x20, 0x58, 0xFC, 
+       0x7A, 0xFA, 0x68, 0x18, 0xB0, 0x03, 0x4C, 0xF6, 0xFD, 0x4C, 0x1B, 0xFD, 0x4C, 0x41, 0xCF, 0x4C, 
+       0x35, 0xCF, 0x4C, 0xC2, 0xCE, 0x4C, 0xB1, 0xCE, 0xA9, 0x06, 0xCD, 0xB3, 0xFB, 0xF0, 0x3C, 0x20, 
+       0x60, 0xC3, 0xA9, 0xF8, 0x85, 0x37, 0x64, 0x36, 0xB2, 0x36, 0x92, 0x36, 0xE6, 0x36, 0xD0, 0xF8, 
+       0xE6, 0x37, 0xD0, 0xF4, 0xDA, 0xAE, 0x78, 0x04, 0x3C, 0x81, 0xC0, 0x3C, 0x81, 0xC0, 0xFA, 0x60, 
+       0xDA, 0xA2, 0x00, 0x2C, 0x11, 0xC0, 0x30, 0x02, 0xA2, 0x08, 0x2C, 0x12, 0xC0, 0x10, 0x02, 0xE8, 
+       0xE8, 0x2C, 0x81, 0xC0, 0x2C, 0x81, 0xC0, 0x8E, 0x78, 0x04, 0xFA, 0x60, 0xAD, 0x13, 0xC0, 0x0A, 
+       0xAD, 0x18, 0xC0, 0x08, 0x8D, 0x00, 0xC0, 0x8D, 0x03, 0xC0, 0xB9, 0x78, 0x04, 0x28, 0xB0, 0x03, 
+       0x8D, 0x02, 0xC0, 0x10, 0x03, 0x8D, 0x01, 0xC0, 0x60, 0x09, 0x80, 0xC9, 0xFB, 0xB0, 0x06, 0xC9, 
+       0xE1, 0x90, 0x02, 0x29, 0xDF, 0x60, 0x48, 0xA9, 0x08, 0x1C, 0xFB, 0x04, 0x68, 0x20, 0xED, 0xFD, 
+       0x4C, 0x44, 0xFD, 0x20, 0x9D, 0xCC, 0x80, 0x09, 0x20, 0x9D, 0xCC, 0x24, 0x32, 0x30, 0x02, 0x29, 
+       0x7F, 0x5A, 0x09, 0x00, 0x30, 0x15, 0x48, 0xAD, 0xFB, 0x04, 0x6A, 0x68, 0x90, 0x0D, 0x2C, 0x1E, 
+       0xC0, 0x10, 0x08, 0x49, 0x40, 0x89, 0x60, 0xF0, 0x02, 0x49, 0x40, 0x2C, 0x1F, 0xC0, 0x10, 0x19, 
+       0x48, 0x8D, 0x01, 0xC0, 0x98, 0x45, 0x20, 0x4A, 0xB0, 0x04, 0xAD, 0x55, 0xC0, 0xC8, 0x98, 0x4A, 
+       0xA8, 0x68, 0x91, 0x28, 0x2C, 0x54, 0xC0, 0x7A, 0x60, 0x91, 0x28, 0x7A, 0x60, 0x00, 0x00, 0x00
+};
+
+uint8_t slot4[0x100] = {
+       0x80, 0x05, 0xA2, 0x03, 0x60, 0x38, 0x90, 0x18, 0x4C, 0xCF, 0xC5, 0x01, 0x20, 0x02, 0x02, 0x02, 
+       0x02, 0x00, 0x3B, 0xDC, 0x93, 0x82, 0x69, 0xBD, 0x6B, 0x1A, 0x9C, 0x7C, 0x07, 0xA2, 0x80, 0xA0, 
+       0x01, 0x9E, 0x7D, 0x04, 0x9E, 0x7D, 0x05, 0xA9, 0xFF, 0x9D, 0x7D, 0x06, 0xA9, 0x03, 0x9D, 0x7D, 
+       0x07, 0xA2, 0x00, 0x88, 0x10, 0xEB, 0x20, 0x6B, 0xC4, 0xA9, 0x00, 0xAA, 0x20, 0x9A, 0xCF, 0x8A, 
+       0x8D, 0x78, 0x04, 0x4A, 0x0D, 0x78, 0x04, 0xC9, 0x10, 0xB0, 0x1F, 0x29, 0x05, 0xF0, 0x01, 0x58, 
+       0x69, 0x55, 0x08, 0x78, 0x8E, 0xFC, 0x07, 0x8D, 0x79, 0xC0, 0xA2, 0x08, 0xCA, 0x0A, 0x90, 0x03, 
+       0x9D, 0x58, 0xC0, 0xD0, 0xF7, 0x8D, 0x78, 0xC0, 0x28, 0x18, 0x60, 0xA2, 0x80, 0x80, 0x02, 0xA2, 
+       0x00, 0xBD, 0x7D, 0x04, 0x9D, 0x7C, 0x04, 0xBD, 0x7D, 0x05, 0x9D, 0x7C, 0x05, 0xCA, 0x10, 0xEF, 
+       0x80, 0x0C, 0x9C, 0x7C, 0x04, 0x9C, 0x7C, 0x05, 0x9C, 0xFC, 0x04, 0x9C, 0xFC, 0x05, 0x9C, 0x7C, 
+       0x06, 0x18, 0x60, 0xA9, 0x20, 0x1C, 0x7C, 0x07, 0x2D, 0x7C, 0x06, 0x1C, 0x7C, 0x06, 0x2C, 0xFC, 
+       0x07, 0x30, 0x13, 0x2C, 0x63, 0xC0, 0x30, 0x02, 0x09, 0x80, 0x2C, 0x7C, 0x07, 0x10, 0x02, 0x09, 
+       0x40, 0x8D, 0x7C, 0x07, 0x18, 0x60, 0x0D, 0x7C, 0x07, 0x29, 0xE0, 0x80, 0xF4, 0x6A, 0x6A, 0x29, 
+       0x80, 0xAA, 0xAD, 0x78, 0x04, 0x9D, 0x7D, 0x04, 0xAD, 0x78, 0x05, 0x9D, 0x7D, 0x05, 0xAD, 0xF8, 
+       0x04, 0x9D, 0x7D, 0x06, 0xAD, 0xF8, 0x05, 0x9D, 0x7D, 0x07, 0x18, 0x60, 0x48, 0x18, 0xA9, 0x0E, 
+       0x2D, 0x7C, 0x07, 0xD0, 0x01, 0x38, 0x68, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD6, 0x00, 0x00, 0x00, 0x00
+};
+
+uint8_t slot5[0x100] = {
+       0xA2, 0x20, 0xA2, 0x00, 0xA2, 0x03, 0xC9, 0x00, 0xB0, 0x17, 0x38, 0xB0, 0x01, 0x18, 0xA2, 0x05, 
+       0x7E, 0x73, 0x04, 0x18, 0xA2, 0xC5, 0x8E, 0xF8, 0x07, 0xA2, 0x05, 0xAD, 0xFF, 0xCF, 0x4C, 0x97, 
+       0xC7, 0xA2, 0x05, 0x86, 0x58, 0xA9, 0xC5, 0x8D, 0xF8, 0x07, 0x20, 0x76, 0xC5, 0xA0, 0x05, 0xB9, 
+       0x70, 0xC5, 0x99, 0x42, 0x00, 0x88, 0x10, 0xF7, 0x20, 0x0A, 0xC5, 0xB0, 0x15, 0xAE, 0x00, 0x08, 
+       0xCA, 0xD0, 0x0F, 0xAE, 0x01, 0x08, 0xF0, 0x0A, 0xA5, 0x58, 0x0A, 0x0A, 0x0A, 0x0A, 0xAA, 0x4C, 
+       0x01, 0x08, 0xA2, 0x10, 0xBD, 0x5F, 0xC5, 0x9D, 0xDB, 0x07, 0xCA, 0x10, 0xF7, 0x80, 0xFE, 0xC3, 
+       0xE8, 0xE5, 0xE3, 0xEB, 0xA0, 0xC4, 0xE9, 0xF3, 0xEB, 0xA0, 0xC4, 0xF2, 0xE9, 0xF6, 0xE5, 0xAE, 
+       0x01, 0x50, 0x00, 0x08, 0x00, 0x00, 0xA2, 0x08, 0xBD, 0x83, 0xC5, 0x95, 0x00, 0xCA, 0x10, 0xF8, 
+       0x4C, 0x00, 0x00, 0x20, 0x0D, 0xC5, 0x05, 0x07, 0x00, 0x60, 0x01, 0x00, 0x00, 0x00, 0xA2, 0x03, 
+       0xA0, 0x00, 0x86, 0x3C, 0x8A, 0x0A, 0x24, 0x3C, 0xF0, 0x10, 0x05, 0x3C, 0x49, 0xFF, 0x29, 0x7E, 
+       0xB0, 0x08, 0x4A, 0xD0, 0xFB, 0x98, 0x9D, 0x56, 0x03, 0xC8, 0xE8, 0x10, 0xE5, 0xA9, 0x08, 0x85, 
+       0x27, 0xA0, 0x7F, 0x60, 0xB9, 0x00, 0x02, 0xC8, 0x4C, 0x99, 0xC3, 0xC1, 0xF0, 0xF0, 0xEC, 0xE5, 
+       0xA0, 0xAF, 0xAF, 0xE3, 0x20, 0xD0, 0xF8, 0x20, 0x53, 0xF9, 0x85, 0x3A, 0x84, 0x3B, 0x60, 0x5A, 
+       0xB0, 0x1C, 0xA0, 0xC4, 0xC4, 0x39, 0xD0, 0x04, 0xA4, 0x38, 0xF0, 0x12, 0xDA, 0x48, 0x29, 0x7F, 
+       0xC9, 0x02, 0xB0, 0x06, 0x20, 0x3B, 0xC4, 0x20, 0x6B, 0xC4, 0x68, 0xFA, 0x7A, 0x60, 0x4C, 0x9D, 
+       0xC7, 0x00, 0x00, 0x00, 0x00, 0x4C, 0x52, 0xC5, 0x4C, 0x76, 0xC5, 0x00, 0x00, 0x00, 0xBF, 0x0A
+};
+
+uint8_t slot6[0x100] = {
+       0xA2, 0x20, 0xA0, 0x00, 0x64, 0x03, 0x64, 0x3C, 0xA9, 0x60, 0xAA, 0x86, 0x2B, 0x85, 0x4F, 0x5A, 
+       0xBD, 0x8E, 0xC0, 0xBD, 0x8C, 0xC0, 0x7A, 0xB9, 0xEA, 0xC0, 0xBD, 0x89, 0xC0, 0xA0, 0x50, 0xBD, 
+       0x80, 0xC0, 0x98, 0x29, 0x03, 0x0A, 0x05, 0x2B, 0xAA, 0xBD, 0x81, 0xC0, 0xA9, 0x56, 0x20, 0xA8, 
+       0xFC, 0x88, 0x10, 0xEB, 0x85, 0x26, 0x85, 0x3D, 0x85, 0x41, 0x20, 0x8E, 0xC5, 0x64, 0x03, 0x18, 
+       0x08, 0x28, 0xA6, 0x2B, 0xC6, 0x03, 0xD0, 0x0E, 0xBD, 0x88, 0xC0, 0xA5, 0x01, 0xC9, 0xC6, 0xD0, 
+       0xA4, 0x4C, 0x00, 0xC5, 0x00, 0x00, 0x08, 0x88, 0xD0, 0x04, 0xF0, 0xE5, 0x80, 0xDF, 0xBD, 0x8C, 
+       0xC0, 0x10, 0xFB, 0x49, 0xD5, 0xD0, 0xF0, 0xBD, 0x8C, 0xC0, 0x10, 0xFB, 0xC9, 0xAA, 0xD0, 0xF3, 
+       0xEA, 0xBD, 0x8C, 0xC0, 0x10, 0xFB, 0xC9, 0x96, 0xF0, 0x09, 0x28, 0x90, 0xC2, 0x49, 0xAD, 0xF0, 
+       0x25, 0xD0, 0xBC, 0xA0, 0x03, 0x85, 0x40, 0xBD, 0x8C, 0xC0, 0x10, 0xFB, 0x2A, 0x85, 0x3C, 0xBD, 
+       0x8C, 0xC0, 0x10, 0xFB, 0x25, 0x3C, 0x88, 0xD0, 0xEC, 0x28, 0xC5, 0x3D, 0xD0, 0xA1, 0xA5, 0x40, 
+       0xC5, 0x41, 0xD0, 0x9B, 0xB0, 0x9C, 0xA0, 0x56, 0x84, 0x3C, 0xBC, 0x8C, 0xC0, 0x10, 0xFB, 0x59, 
+       0xD6, 0x02, 0xA4, 0x3C, 0x88, 0x99, 0x00, 0x03, 0xD0, 0xEE, 0x84, 0x3C, 0xBC, 0x8C, 0xC0, 0x10, 
+       0xFB, 0x59, 0xD6, 0x02, 0xA4, 0x3C, 0x91, 0x26, 0xC8, 0xD0, 0xEF, 0xBC, 0x8C, 0xC0, 0x10, 0xFB, 
+       0x59, 0xD6, 0x02, 0xD0, 0xCD, 0xA0, 0x00, 0xA2, 0x56, 0xCA, 0x30, 0xFB, 0xB1, 0x26, 0x5E, 0x00, 
+       0x03, 0x2A, 0x5E, 0x00, 0x03, 0x2A, 0x91, 0x26, 0xC8, 0xD0, 0xEE, 0xE6, 0x27, 0xE6, 0x3D, 0xA5, 
+       0x3D, 0xCD, 0x00, 0x08, 0xA6, 0x4F, 0x90, 0xDB, 0x4C, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+uint8_t slot7[0x100] = {
+       0x2C, 0x03, 0xC7, 0x70, 0x1B, 0x38, 0x90, 0x18, 0xB8, 0x50, 0x15, 0x01, 0x9B, 0x1C, 0x1C, 0x1C, 
+       0x1C, 0x88, 0x18, 0x80, 0x2A, 0x38, 0x78, 0xA2, 0xFF, 0x9A, 0x80, 0x26, 0x38, 0xA2, 0x03, 0x60, 
+       0x8D, 0x78, 0x04, 0xA9, 0xC7, 0x8D, 0xF8, 0x07, 0x08, 0xC5, 0x39, 0xF0, 0xE8, 0x28, 0x4D, 0x7F, 
+       0x04, 0xD0, 0x1A, 0xAD, 0xFF, 0x07, 0x48, 0xAD, 0x7F, 0x07, 0x48, 0xAD, 0x78, 0x04, 0x60, 0x8D, 
+       0xF8, 0x07, 0x20, 0xD3, 0xC7, 0x70, 0x01, 0x60, 0xB0, 0x03, 0x6C, 0xCB, 0x00, 0xAD, 0x81, 0xC0, 
+       0xAD, 0x81, 0xC0, 0x20, 0x84, 0xFE, 0x20, 0x2F, 0xFB, 0x20, 0x58, 0xFC, 0x20, 0x93, 0xFE, 0x20, 
+       0x89, 0xFE, 0xA0, 0x10, 0xB9, 0x6F, 0xC7, 0x99, 0xDB, 0x07, 0x88, 0x10, 0xF7, 0x80, 0xFE, 0xC1, 
+       0xF0, 0xF0, 0xEC, 0xE5, 0xD4, 0xE1, 0xEC, 0xEB, 0xA0, 0xCF, 0xE6, 0xE6, 0xEC, 0xE9, 0xEE, 0xE5, 
+       0x8D, 0x28, 0xC0, 0x40, 0x8D, 0x28, 0xC0, 0x60, 0x8D, 0x28, 0xC0, 0x4C, 0x62, 0xFA, 0x8D, 0x28, 
+       0xC0, 0x2C, 0x87, 0xC7, 0x4C, 0x04, 0xC8, 0x8D, 0x28, 0xC0, 0x4C, 0xF1, 0xC7, 0x8D, 0x28, 0xC0, 
+       0x4C, 0xF6, 0xC7, 0x8D, 0x28, 0xC0, 0x4C, 0xF1, 0xC7, 0x8D, 0x28, 0xC0, 0x4C, 0x06, 0xC8, 0x8D, 
+       0x28, 0xC0, 0x4C, 0x4E, 0xC3, 0x8D, 0x28, 0xC0, 0x4C, 0x97, 0xC3, 0x8D, 0x28, 0xC0, 0x4C, 0x00, 
+       0xC1, 0x8D, 0x28, 0xC0, 0x4C, 0xA9, 0xD4, 0x8D, 0x28, 0xC0, 0x4C, 0x80, 0xC5, 0x8D, 0x28, 0xC0, 
+       0x4C, 0x4F, 0xC2, 0x8D, 0x28, 0xC0, 0x4C, 0xAC, 0xC2, 0x8D, 0x28, 0xC0, 0x4C, 0xC3, 0xC2, 0x8D, 
+       0x28, 0xC0, 0x4C, 0xF7, 0xC2, 0x8D, 0x28, 0xC0, 0x4C, 0xE0, 0xD4, 0x8D, 0x28, 0xC0, 0x6C, 0xED, 
+       0x03, 0x20, 0x23, 0xCE, 0x80, 0x8E, 0x20, 0x4D, 0xCE, 0x80, 0x89, 0x00, 0x00, 0x00, 0x00, 0x00
+};
old mode 100755 (executable)
new mode 100644 (file)
index 63cc197..0b0e640
-//
-// This file was automagically generated by bin2c (by James L. Hammons)
-//
+#ifndef __FIRMWARE_H__
+#define __FIRMWARE_H__
 
-char diskROM[0x100] = {                // Loads at $C600 (slot 6)
-       0xA2, 0x20, 0xA0, 0x00, 0xA2, 0x03, 0x86, 0x3C, 0x8A, 0x0A, 0x24, 0x3C, 0xF0, 0x10, 0x05, 0x3C,
-       0x49, 0xFF, 0x29, 0x7E, 0xB0, 0x08, 0x4A, 0xD0, 0xFB, 0x98, 0x9D, 0x56, 0x03, 0xC8, 0xE8, 0x10,
-       0xE5, 0x20, 0x58, 0xFF, 0xBA, 0xBD, 0x00, 0x01, 0x0A, 0x0A, 0x0A, 0x0A, 0x85, 0x2B, 0xAA, 0xBD,
-       0x8E, 0xC0, 0xBD, 0x8C, 0xC0, 0xBD, 0x8A, 0xC0, 0xBD, 0x89, 0xC0, 0xA0, 0x50, 0xBD, 0x80, 0xC0,
-       0x98, 0x29, 0x03, 0x0A, 0x05, 0x2B, 0xAA, 0xBD, 0x81, 0xC0, 0xA9, 0x56, 0x20, 0xA8, 0xFC, 0x88,
-       0x10, 0xEB, 0x85, 0x26, 0x85, 0x3D, 0x85, 0x41, 0xA9, 0x08, 0x85, 0x27, 0x18, 0x08, 0xBD, 0x8C,
-       0xC0, 0x10, 0xFB, 0x49, 0xD5, 0xD0, 0xF7, 0xBD, 0x8C, 0xC0, 0x10, 0xFB, 0xC9, 0xAA, 0xD0, 0xF3,
-       0xEA, 0xBD, 0x8C, 0xC0, 0x10, 0xFB, 0xC9, 0x96, 0xF0, 0x09, 0x28, 0x90, 0xDF, 0x49, 0xAD, 0xF0,
-       0x25, 0xD0, 0xD9, 0xA0, 0x03, 0x85, 0x40, 0xBD, 0x8C, 0xC0, 0x10, 0xFB, 0x2A, 0x85, 0x3C, 0xBD,
-       0x8C, 0xC0, 0x10, 0xFB, 0x25, 0x3C, 0x88, 0xD0, 0xEC, 0x28, 0xC5, 0x3D, 0xD0, 0xBE, 0xA5, 0x40,
-       0xC5, 0x41, 0xD0, 0xB8, 0xB0, 0xB7, 0xA0, 0x56, 0x84, 0x3C, 0xBC, 0x8C, 0xC0, 0x10, 0xFB, 0x59,
-       0xD6, 0x02, 0xA4, 0x3C, 0x88, 0x99, 0x00, 0x03, 0xD0, 0xEE, 0x84, 0x3C, 0xBC, 0x8C, 0xC0, 0x10,
-       0xFB, 0x59, 0xD6, 0x02, 0xA4, 0x3C, 0x91, 0x26, 0xC8, 0xD0, 0xEF, 0xBC, 0x8C, 0xC0, 0x10, 0xFB,
-       0x59, 0xD6, 0x02, 0xD0, 0x87, 0xA0, 0x00, 0xA2, 0x56, 0xCA, 0x30, 0xFB, 0xB1, 0x26, 0x5E, 0x00,
-       0x03, 0x2A, 0x5E, 0x00, 0x03, 0x2A, 0x91, 0x26, 0xC8, 0xD0, 0xEE, 0xE6, 0x27, 0xE6, 0x3D, 0xA5,
-       0x3D, 0xCD, 0x00, 0x08, 0xA6, 0x2B, 0x90, 0xDB, 0x4C, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-char hdROM[0x100] = {          // Loads at $C700 (slot 7)
-       0xA9, 0x20, 0xA9, 0x00, 0xA9, 0x03, 0xA9, 0x3C, 0xA9, 0x00, 0x8D, 0xF2, 0xC0, 0xA9, 0x70, 0x8D,
-       0xF3, 0xC0, 0xAD, 0xF0, 0xC0, 0x48, 0xAD, 0xF1, 0xC0, 0x18, 0xC9, 0x01, 0xD0, 0x01, 0x38, 0x68,
-       0x90, 0x03, 0x4C, 0x00, 0xC6, 0xA9, 0x70, 0x85, 0x43, 0xA9, 0x00, 0x85, 0x44, 0x85, 0x46, 0x85,
-       0x47, 0xA9, 0x08, 0x85, 0x45, 0xA9, 0x01, 0x85, 0x42, 0x20, 0x46, 0xC7, 0x90, 0x03, 0x4C, 0x00,
-       0xC6, 0xA2, 0x70, 0x4C, 0x01, 0x08, 0x18, 0xA5, 0x42, 0x8D, 0xF2, 0xC0, 0xA5, 0x43, 0x8D, 0xF3,
-       0xC0, 0xA5, 0x44, 0x8D, 0xF4, 0xC0, 0xA5, 0x45, 0x8D, 0xF5, 0xC0, 0xA5, 0x46, 0x8D, 0xF6, 0xC0,
-       0xA5, 0x47, 0x8D, 0xF7, 0xC0, 0xAd, 0xF0, 0xC0, 0x48, 0xA5, 0x42, 0xC9, 0x01, 0xD0, 0x03, 0x20,
-       0x7D, 0xC7, 0xAD, 0xF1, 0xC0, 0x18, 0xC9, 0x01, 0xD0, 0x01, 0x38, 0x68, 0x60, 0x98, 0x48, 0xA0,
-       0x00, 0xAD, 0xF8, 0xC0, 0x91, 0x44, 0xC8, 0xD0, 0xF8, 0xE6, 0x45, 0xA0, 0x00, 0xAD, 0xF8, 0xC0,
-       0x91, 0x44, 0xC8, 0xD0, 0xF8, 0x68, 0xA8, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x7F, 0xD7, 0x46
-};
-
-char parallelROM[0x100] = {
-       0x18, 0xB0, 0x38, 0x48, 0x8A, 0x48, 0x98, 0x48, 0x08, 0x78, 0x20, 0x58, 0xFF, 0xBA, 0x68, 0x68, 
-       0x68, 0x68, 0xA8, 0xCA, 0x9A, 0x68, 0x28, 0xAA, 0x90, 0x38, 0xBD, 0xB8, 0x05, 0x10, 0x19, 0x98, 
-       0x29, 0x7F, 0x49, 0x30, 0xC9, 0x0A, 0x90, 0x3B, 0xC9, 0x78, 0xB0, 0x29, 0x49, 0x3D, 0xF0, 0x21, 
-       0x98, 0x29, 0x9F, 0x9D, 0x38, 0x06, 0x90, 0x7E, 0xBD, 0xB8, 0x06, 0x30, 0x14, 0xA5, 0x24, 0xDD, 
-       0x38, 0x07, 0xB0, 0x0D, 0xC9, 0x11, 0xB0, 0x09, 0x09, 0xF0, 0x3D, 0x38, 0x07, 0x65, 0x24, 0x85, 
-       0x24, 0x4A, 0x38, 0xB0, 0x6D, 0x18, 0x6A, 0x3D, 0xB8, 0x06, 0x90, 0x02, 0x49, 0x81, 0x9D, 0xB8, 
-       0x06, 0xD0, 0x53, 0xA0, 0x0A, 0x7D, 0x38, 0x05, 0x88, 0xD0, 0xFA, 0x9D, 0xB8, 0x04, 0x9D, 0x38, 
-       0x05, 0x38, 0xB0, 0x43, 0xC5, 0x24, 0x90, 0x3A, 0x68, 0xA8, 0x68, 0xAA, 0x68, 0x4C, 0xF0, 0xFD, 
-       0x90, 0xFE, 0xB0, 0xFE, 0x99, 0x80, 0xC0, 0x90, 0x37, 0x49, 0x07, 0xA8, 0x49, 0x0A, 0x0A, 0xD0, 
-       0x06, 0xB8, 0x85, 0x24, 0x9D, 0x38, 0x07, 0xBD, 0xB8, 0x06, 0x4A, 0x70, 0x02, 0xB0, 0x23, 0x0A, 
-       0x0A, 0xA9, 0x27, 0xB0, 0xCF, 0xBD, 0x38, 0x07, 0xFD, 0xB8, 0x04, 0xC9, 0xF8, 0x90, 0x03, 0x69, 
-       0x27, 0xAC, 0xA9, 0x00, 0x85, 0x24, 0x18, 0x7E, 0xB8, 0x05, 0x68, 0xA8, 0x68, 0xAA, 0x68, 0x60, 
-       0x90, 0x27, 0xB0, 0x00, 0x10, 0x11, 0xA9, 0x89, 0x9D, 0x38, 0x06, 0x9D, 0xB8, 0x06, 0xA9, 0x28, 
-       0x9D, 0xB8, 0x04, 0xA9, 0x02, 0x85, 0x36, 0x98, 0x5D, 0x38, 0x06, 0x0A, 0xF0, 0x90, 0x5E, 0xB8, 
-       0x05, 0x98, 0x48, 0x8A, 0x0A, 0x0A, 0x0A, 0x0A, 0xA8, 0xBD, 0x38, 0x07, 0xC5, 0x24, 0x68, 0xB0, 
-       0x05, 0x48, 0x29, 0x80, 0x09, 0x20, 0x2C, 0x58, 0xFF, 0xF0, 0x03, 0xFE, 0x38, 0x07, 0x70, 0x84
-};
-
-// Various firmware from the IIe ROM file...
+#include <stdint.h>
 
+extern uint8_t diskROM[0x100]; // Loads at $C600 (slot 6)
+extern uint8_t hdROM[0x100];           // Loads at $C700 (slot 7)
+extern uint8_t parallelROM[0x100];// (slot 1)
 //Not sure what the heck this is...
-char slot2e[0x100] = {
-       0x2C, 0x58, 0xFF, 0x70, 0x0C, 0x38, 0x90, 0x18, 0xB8, 0x50, 0x06, 0x01, 0x31, 0x8E, 0x94, 0x97, 
-       0x9A, 0x85, 0x27, 0x86, 0x35, 0x8A, 0x48, 0x98, 0x48, 0x08, 0x78, 0x8D, 0xFF, 0xCF, 0x20, 0x58, 
-       0xFF, 0xBA, 0xBD, 0x00, 0x01, 0x8D, 0xF8, 0x07, 0xAA, 0x0A, 0x0A, 0x0A, 0x0A, 0x85, 0x26, 0xA8, 
-       0x28, 0x50, 0x29, 0x1E, 0x38, 0x05, 0x5E, 0x38, 0x05, 0xB9, 0x8A, 0xC0, 0x29, 0x1F, 0xD0, 0x05, 
-       0xA9, 0xEF, 0x20, 0x05, 0xC8, 0xE4, 0x37, 0xD0, 0x0B, 0xA9, 0x07, 0xC5, 0x36, 0xF0, 0x05, 0x85, 
-       0x36, 0x18, 0x90, 0x08, 0xE4, 0x39, 0xD0, 0xF9, 0xA9, 0x05, 0x85, 0x38, 0xBD, 0x38, 0x07, 0x29, 
-       0x02, 0x08, 0x90, 0x03, 0x4C, 0xBF, 0xC8, 0xBD, 0xB8, 0x04, 0x48, 0x0A, 0x10, 0x0E, 0xA6, 0x35, 
-       0xA5, 0x27, 0x09, 0x20, 0x9D, 0x00, 0x02, 0x85, 0x27, 0xAE, 0xF8, 0x07, 0x68, 0x29, 0xBF, 0x9D, 
-       0xB8, 0x04, 0x28, 0xF0, 0x06, 0x20, 0x63, 0xCB, 0x4C, 0xB5, 0xC8, 0x4C, 0xFC, 0xC8, 0x20, 0x00, 
-       0xC8, 0xA2, 0x00, 0x60, 0x4C, 0x9B, 0xC8, 0x4C, 0xAA, 0xC9, 0x4A, 0x20, 0x9B, 0xC9, 0xB0, 0x08, 
-       0x20, 0xF5, 0xCA, 0xF0, 0x06, 0x18, 0x90, 0x03, 0x20, 0xD2, 0xCA, 0xBD, 0xB8, 0x05, 0xAA, 0x60, 
-       0xA2, 0x03, 0xB5, 0x36, 0x48, 0xCA, 0x10, 0xFA, 0xAE, 0xF8, 0x07, 0xBD, 0x38, 0x06, 0x85, 0x36, 
-       0xBD, 0xB8, 0x04, 0x29, 0x38, 0x4A, 0x4A, 0x4A, 0x09, 0xC0, 0x85, 0x37, 0x8A, 0x48, 0xA5, 0x27, 
-       0x48, 0x09, 0x80, 0x20, 0xED, 0xFD, 0x68, 0x85, 0x27, 0x68, 0x8D, 0xF8, 0x07, 0xAA, 0x0A, 0x0A, 
-       0x0A, 0x0A, 0x85, 0x26, 0x8D, 0xFF, 0xCF, 0xA5, 0x36, 0x9D, 0x38, 0x06, 0xA2, 0x00, 0x68, 0x95, 
-       0x36, 0xE8, 0xE0, 0x04, 0x90, 0xF8, 0xAE, 0xF8, 0x07, 0x60, 0xC1, 0xD0, 0xD0, 0xCC, 0xC5, 0x08
-};
-
+extern uint8_t slot2e[0x100];
 //This looks identical to diskROM
-char slot6e[0x100] = {
-       0xA2, 0x20, 0xA0, 0x00, 0xA2, 0x03, 0x86, 0x3C, 0x8A, 0x0A, 0x24, 0x3C, 0xF0, 0x10, 0x05, 0x3C, 
-       0x49, 0xFF, 0x29, 0x7E, 0xB0, 0x08, 0x4A, 0xD0, 0xFB, 0x98, 0x9D, 0x56, 0x03, 0xC8, 0xE8, 0x10, 
-       0xE5, 0x20, 0x58, 0xFF, 0xBA, 0xBD, 0x00, 0x01, 0x0A, 0x0A, 0x0A, 0x0A, 0x85, 0x2B, 0xAA, 0xBD, 
-       0x8E, 0xC0, 0xBD, 0x8C, 0xC0, 0xBD, 0x8A, 0xC0, 0xBD, 0x89, 0xC0, 0xA0, 0x50, 0xBD, 0x80, 0xC0, 
-       0x98, 0x29, 0x03, 0x0A, 0x05, 0x2B, 0xAA, 0xBD, 0x81, 0xC0, 0xA9, 0x56, 0x20, 0xA8, 0xFC, 0x88, 
-       0x10, 0xEB, 0x85, 0x26, 0x85, 0x3D, 0x85, 0x41, 0xA9, 0x08, 0x85, 0x27, 0x18, 0x08, 0xBD, 0x8C, 
-       0xC0, 0x10, 0xFB, 0x49, 0xD5, 0xD0, 0xF7, 0xBD, 0x8C, 0xC0, 0x10, 0xFB, 0xC9, 0xAA, 0xD0, 0xF3, 
-       0xEA, 0xBD, 0x8C, 0xC0, 0x10, 0xFB, 0xC9, 0x96, 0xF0, 0x09, 0x28, 0x90, 0xDF, 0x49, 0xAD, 0xF0, 
-       0x25, 0xD0, 0xD9, 0xA0, 0x03, 0x85, 0x40, 0xBD, 0x8C, 0xC0, 0x10, 0xFB, 0x2A, 0x85, 0x3C, 0xBD, 
-       0x8C, 0xC0, 0x10, 0xFB, 0x25, 0x3C, 0x88, 0xD0, 0xEC, 0x28, 0xC5, 0x3D, 0xD0, 0xBE, 0xA5, 0x40, 
-       0xC5, 0x41, 0xD0, 0xB8, 0xB0, 0xB7, 0xA0, 0x56, 0x84, 0x3C, 0xBC, 0x8C, 0xC0, 0x10, 0xFB, 0x59, 
-       0xD6, 0x02, 0xA4, 0x3C, 0x88, 0x99, 0x00, 0x03, 0xD0, 0xEE, 0x84, 0x3C, 0xBC, 0x8C, 0xC0, 0x10, 
-       0xFB, 0x59, 0xD6, 0x02, 0xA4, 0x3C, 0x91, 0x26, 0xC8, 0xD0, 0xEF, 0xBC, 0x8C, 0xC0, 0x10, 0xFB, 
-       0x59, 0xD6, 0x02, 0xD0, 0x87, 0xA0, 0x00, 0xA2, 0x56, 0xCA, 0x30, 0xFB, 0xB1, 0x26, 0x5E, 0x00, 
-       0x03, 0x2A, 0x5E, 0x00, 0x03, 0x2A, 0x91, 0x26, 0xC8, 0xD0, 0xEE, 0xE6, 0x27, 0xE6, 0x3D, 0xA5, 
-       0x3D, 0xCD, 0x00, 0x08, 0xA6, 0x2B, 0x90, 0xDB, 0x4C, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
+extern uint8_t slot6e[0x100];
 // Various firmware from the IIc
+extern uint8_t slot1[0x100];
+extern uint8_t slot2[0x100];
+extern uint8_t slot3[0x100];
+extern uint8_t slot4[0x100];
+extern uint8_t slot5[0x100];
+extern uint8_t slot6[0x100];
+extern uint8_t slot7[0x100];
 
-char slot1[0x100] = {
-       0x2C, 0x89, 0xC1, 0x70, 0x0C, 0x38, 0x90, 0x18, 0xB8, 0x50, 0x06, 0x01, 0x31, 0x9E, 0xA8, 0xB4, 
-       0xBB, 0xDA, 0xA2, 0xC1, 0x4C, 0x1C, 0xC2, 0x90, 0x03, 0x4C, 0xE5, 0xC7, 0x0A, 0x7A, 0x5A, 0xBD, 
-       0xB8, 0x04, 0xF0, 0x42, 0xA5, 0x24, 0xB0, 0x1C, 0xDD, 0xB8, 0x04, 0x90, 0x03, 0xBD, 0x38, 0x07, 
-       0xDD, 0x38, 0x07, 0xB0, 0x0B, 0xC9, 0x11, 0xB0, 0x11, 0x09, 0xF0, 0x3D, 0x38, 0x07, 0x65, 0x24, 
-       0x85, 0x24, 0x80, 0x06, 0xC5, 0x21, 0x90, 0x02, 0x64, 0x24, 0x7A, 0x5A, 0xBD, 0x38, 0x07, 0xDD, 
-       0xB8, 0x04, 0xB0, 0x08, 0xC5, 0x24, 0xB0, 0x0E, 0xA9, 0x40, 0x80, 0x02, 0xA9, 0x1A, 0xC0, 0x80, 
-       0x6A, 0x20, 0x9B, 0xC1, 0x80, 0xE4, 0x98, 0x20, 0x8A, 0xC1, 0xBD, 0xB8, 0x04, 0xF0, 0x17, 0x3C, 
-       0xB8, 0x06, 0x30, 0x12, 0xBD, 0x38, 0x07, 0xFD, 0xB8, 0x04, 0xC9, 0xF8, 0x90, 0x04, 0x18, 0x65, 
-       0x21, 0xAC, 0xA9, 0x00, 0x85, 0x24, 0x68, 0x7A, 0xFA, 0x60, 0x20, 0xA9, 0xC7, 0x90, 0xFA, 0x3C, 
-       0xB8, 0x06, 0x10, 0x07, 0xC9, 0x91, 0xF0, 0x03, 0x20, 0xF0, 0xFD, 0x4C, 0xCD, 0xC7, 0x5A, 0x48, 
-       0x20, 0xB6, 0xC2, 0x9E, 0xB8, 0x06, 0x80, 0x07, 0x5A, 0x20, 0xD9, 0xC7, 0x90, 0xFA, 0x90, 0x68, 
-       0x7A, 0xA2, 0x00, 0x60, 0x5A, 0x48, 0x20, 0x8A, 0xC1, 0x80, 0xF4, 0x5A, 0x48, 0x4A, 0xD0, 0x15, 
-       0x08, 0x20, 0xD3, 0xC7, 0x28, 0x90, 0x05, 0x29, 0x28, 0x0A, 0x80, 0x02, 0x29, 0x30, 0xC9, 0x10, 
-       0xF0, 0xDD, 0x18, 0x80, 0xDA, 0xA2, 0x40, 0x68, 0x7A, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-char slot2[0x100] = {
-       0x2C, 0x89, 0xC1, 0x70, 0x14, 0x38, 0x90, 0x18, 0xB8, 0x50, 0x0E, 0x01, 0x31, 0x11, 0x13, 0x15, 
-       0x17, 0x80, 0x8B, 0x80, 0x93, 0x80, 0x9D, 0x80, 0xA2, 0xDA, 0xA2, 0xC2, 0x5A, 0x48, 0x8E, 0xF8, 
-       0x07, 0x50, 0x22, 0xA5, 0x36, 0x45, 0x38, 0xF0, 0x06, 0xA5, 0x37, 0xC5, 0x39, 0xF0, 0x03, 0x20, 
-       0xB6, 0xC2, 0x8A, 0x45, 0x39, 0x05, 0x38, 0xD0, 0x07, 0xA9, 0x05, 0x85, 0x38, 0x38, 0x80, 0x05, 
-       0xA9, 0x07, 0x85, 0x36, 0x18, 0xBD, 0xB8, 0x06, 0x89, 0x01, 0xD0, 0x03, 0x4C, 0x17, 0xC1, 0x90, 
-       0xFB, 0x68, 0x80, 0x28, 0x3C, 0xB8, 0x03, 0x50, 0x1C, 0x20, 0x8F, 0xC1, 0x80, 0x1E, 0x68, 0x20, 
-       0x70, 0xCC, 0x10, 0x1B, 0x20, 0xA9, 0xC7, 0xB0, 0xEB, 0x29, 0x5F, 0xC9, 0x51, 0xF0, 0x04, 0xC9, 
-       0x52, 0xD0, 0x09, 0xA9, 0x98, 0x7A, 0xFA, 0x60, 0x18, 0x20, 0xA3, 0xC7, 0x20, 0x4C, 0xCC, 0x48, 
-       0x20, 0xD9, 0xC7, 0xB0, 0x09, 0xBD, 0xB8, 0x06, 0x29, 0x10, 0xF0, 0xD2, 0x80, 0xF2, 0xA8, 0x68, 
-       0x5A, 0x20, 0xB8, 0xC3, 0x68, 0xBC, 0x38, 0x06, 0xF0, 0x12, 0x09, 0x80, 0xC9, 0x91, 0xF0, 0xDC, 
-       0xC9, 0xFF, 0xF0, 0xD8, 0xC9, 0x92, 0xF0, 0xD0, 0xC9, 0x94, 0xF0, 0xCD, 0x3C, 0xB8, 0x03, 0x50, 
-       0xC4, 0x20, 0xED, 0xFD, 0x80, 0xC6, 0x20, 0x9A, 0xCF, 0xBC, 0x29, 0xC2, 0x20, 0x7C, 0xC3, 0x48, 
-       0x88, 0x30, 0x04, 0xC0, 0x03, 0xD0, 0xF5, 0x20, 0x9A, 0xCF, 0x68, 0xBC, 0x2B, 0xC2, 0x99, 0xFB, 
-       0xBF, 0x68, 0x99, 0xFA, 0xBF, 0x68, 0x9D, 0xB8, 0x06, 0x29, 0x01, 0xD0, 0x02, 0xA9, 0x09, 0x9D, 
-       0x38, 0x06, 0x68, 0x9D, 0xB8, 0x04, 0x9E, 0xB8, 0x03, 0x60, 0x03, 0x07, 0xA0, 0xB0, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-char slot3[0x100] = {
-       0x48, 0xDA, 0x5A, 0x80, 0x12, 0x38, 0x90, 0x18, 0x80, 0x1A, 0xEA, 0x01, 0x88, 0x2C, 0x2F, 0x32, 
-       0x35, 0x4C, 0xAF, 0xC7, 0x4C, 0xB5, 0xC7, 0x20, 0x20, 0xCE, 0x20, 0xBE, 0xCD, 0x20, 0x58, 0xFC, 
-       0x7A, 0xFA, 0x68, 0x18, 0xB0, 0x03, 0x4C, 0xF6, 0xFD, 0x4C, 0x1B, 0xFD, 0x4C, 0x41, 0xCF, 0x4C, 
-       0x35, 0xCF, 0x4C, 0xC2, 0xCE, 0x4C, 0xB1, 0xCE, 0xA9, 0x06, 0xCD, 0xB3, 0xFB, 0xF0, 0x3C, 0x20, 
-       0x60, 0xC3, 0xA9, 0xF8, 0x85, 0x37, 0x64, 0x36, 0xB2, 0x36, 0x92, 0x36, 0xE6, 0x36, 0xD0, 0xF8, 
-       0xE6, 0x37, 0xD0, 0xF4, 0xDA, 0xAE, 0x78, 0x04, 0x3C, 0x81, 0xC0, 0x3C, 0x81, 0xC0, 0xFA, 0x60, 
-       0xDA, 0xA2, 0x00, 0x2C, 0x11, 0xC0, 0x30, 0x02, 0xA2, 0x08, 0x2C, 0x12, 0xC0, 0x10, 0x02, 0xE8, 
-       0xE8, 0x2C, 0x81, 0xC0, 0x2C, 0x81, 0xC0, 0x8E, 0x78, 0x04, 0xFA, 0x60, 0xAD, 0x13, 0xC0, 0x0A, 
-       0xAD, 0x18, 0xC0, 0x08, 0x8D, 0x00, 0xC0, 0x8D, 0x03, 0xC0, 0xB9, 0x78, 0x04, 0x28, 0xB0, 0x03, 
-       0x8D, 0x02, 0xC0, 0x10, 0x03, 0x8D, 0x01, 0xC0, 0x60, 0x09, 0x80, 0xC9, 0xFB, 0xB0, 0x06, 0xC9, 
-       0xE1, 0x90, 0x02, 0x29, 0xDF, 0x60, 0x48, 0xA9, 0x08, 0x1C, 0xFB, 0x04, 0x68, 0x20, 0xED, 0xFD, 
-       0x4C, 0x44, 0xFD, 0x20, 0x9D, 0xCC, 0x80, 0x09, 0x20, 0x9D, 0xCC, 0x24, 0x32, 0x30, 0x02, 0x29, 
-       0x7F, 0x5A, 0x09, 0x00, 0x30, 0x15, 0x48, 0xAD, 0xFB, 0x04, 0x6A, 0x68, 0x90, 0x0D, 0x2C, 0x1E, 
-       0xC0, 0x10, 0x08, 0x49, 0x40, 0x89, 0x60, 0xF0, 0x02, 0x49, 0x40, 0x2C, 0x1F, 0xC0, 0x10, 0x19, 
-       0x48, 0x8D, 0x01, 0xC0, 0x98, 0x45, 0x20, 0x4A, 0xB0, 0x04, 0xAD, 0x55, 0xC0, 0xC8, 0x98, 0x4A, 
-       0xA8, 0x68, 0x91, 0x28, 0x2C, 0x54, 0xC0, 0x7A, 0x60, 0x91, 0x28, 0x7A, 0x60, 0x00, 0x00, 0x00
-};
-
-char slot4[0x100] = {
-       0x80, 0x05, 0xA2, 0x03, 0x60, 0x38, 0x90, 0x18, 0x4C, 0xCF, 0xC5, 0x01, 0x20, 0x02, 0x02, 0x02, 
-       0x02, 0x00, 0x3B, 0xDC, 0x93, 0x82, 0x69, 0xBD, 0x6B, 0x1A, 0x9C, 0x7C, 0x07, 0xA2, 0x80, 0xA0, 
-       0x01, 0x9E, 0x7D, 0x04, 0x9E, 0x7D, 0x05, 0xA9, 0xFF, 0x9D, 0x7D, 0x06, 0xA9, 0x03, 0x9D, 0x7D, 
-       0x07, 0xA2, 0x00, 0x88, 0x10, 0xEB, 0x20, 0x6B, 0xC4, 0xA9, 0x00, 0xAA, 0x20, 0x9A, 0xCF, 0x8A, 
-       0x8D, 0x78, 0x04, 0x4A, 0x0D, 0x78, 0x04, 0xC9, 0x10, 0xB0, 0x1F, 0x29, 0x05, 0xF0, 0x01, 0x58, 
-       0x69, 0x55, 0x08, 0x78, 0x8E, 0xFC, 0x07, 0x8D, 0x79, 0xC0, 0xA2, 0x08, 0xCA, 0x0A, 0x90, 0x03, 
-       0x9D, 0x58, 0xC0, 0xD0, 0xF7, 0x8D, 0x78, 0xC0, 0x28, 0x18, 0x60, 0xA2, 0x80, 0x80, 0x02, 0xA2, 
-       0x00, 0xBD, 0x7D, 0x04, 0x9D, 0x7C, 0x04, 0xBD, 0x7D, 0x05, 0x9D, 0x7C, 0x05, 0xCA, 0x10, 0xEF, 
-       0x80, 0x0C, 0x9C, 0x7C, 0x04, 0x9C, 0x7C, 0x05, 0x9C, 0xFC, 0x04, 0x9C, 0xFC, 0x05, 0x9C, 0x7C, 
-       0x06, 0x18, 0x60, 0xA9, 0x20, 0x1C, 0x7C, 0x07, 0x2D, 0x7C, 0x06, 0x1C, 0x7C, 0x06, 0x2C, 0xFC, 
-       0x07, 0x30, 0x13, 0x2C, 0x63, 0xC0, 0x30, 0x02, 0x09, 0x80, 0x2C, 0x7C, 0x07, 0x10, 0x02, 0x09, 
-       0x40, 0x8D, 0x7C, 0x07, 0x18, 0x60, 0x0D, 0x7C, 0x07, 0x29, 0xE0, 0x80, 0xF4, 0x6A, 0x6A, 0x29, 
-       0x80, 0xAA, 0xAD, 0x78, 0x04, 0x9D, 0x7D, 0x04, 0xAD, 0x78, 0x05, 0x9D, 0x7D, 0x05, 0xAD, 0xF8, 
-       0x04, 0x9D, 0x7D, 0x06, 0xAD, 0xF8, 0x05, 0x9D, 0x7D, 0x07, 0x18, 0x60, 0x48, 0x18, 0xA9, 0x0E, 
-       0x2D, 0x7C, 0x07, 0xD0, 0x01, 0x38, 0x68, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD6, 0x00, 0x00, 0x00, 0x00
-};
-
-char slot5[0x100] = {
-       0xA2, 0x20, 0xA2, 0x00, 0xA2, 0x03, 0xC9, 0x00, 0xB0, 0x17, 0x38, 0xB0, 0x01, 0x18, 0xA2, 0x05, 
-       0x7E, 0x73, 0x04, 0x18, 0xA2, 0xC5, 0x8E, 0xF8, 0x07, 0xA2, 0x05, 0xAD, 0xFF, 0xCF, 0x4C, 0x97, 
-       0xC7, 0xA2, 0x05, 0x86, 0x58, 0xA9, 0xC5, 0x8D, 0xF8, 0x07, 0x20, 0x76, 0xC5, 0xA0, 0x05, 0xB9, 
-       0x70, 0xC5, 0x99, 0x42, 0x00, 0x88, 0x10, 0xF7, 0x20, 0x0A, 0xC5, 0xB0, 0x15, 0xAE, 0x00, 0x08, 
-       0xCA, 0xD0, 0x0F, 0xAE, 0x01, 0x08, 0xF0, 0x0A, 0xA5, 0x58, 0x0A, 0x0A, 0x0A, 0x0A, 0xAA, 0x4C, 
-       0x01, 0x08, 0xA2, 0x10, 0xBD, 0x5F, 0xC5, 0x9D, 0xDB, 0x07, 0xCA, 0x10, 0xF7, 0x80, 0xFE, 0xC3, 
-       0xE8, 0xE5, 0xE3, 0xEB, 0xA0, 0xC4, 0xE9, 0xF3, 0xEB, 0xA0, 0xC4, 0xF2, 0xE9, 0xF6, 0xE5, 0xAE, 
-       0x01, 0x50, 0x00, 0x08, 0x00, 0x00, 0xA2, 0x08, 0xBD, 0x83, 0xC5, 0x95, 0x00, 0xCA, 0x10, 0xF8, 
-       0x4C, 0x00, 0x00, 0x20, 0x0D, 0xC5, 0x05, 0x07, 0x00, 0x60, 0x01, 0x00, 0x00, 0x00, 0xA2, 0x03, 
-       0xA0, 0x00, 0x86, 0x3C, 0x8A, 0x0A, 0x24, 0x3C, 0xF0, 0x10, 0x05, 0x3C, 0x49, 0xFF, 0x29, 0x7E, 
-       0xB0, 0x08, 0x4A, 0xD0, 0xFB, 0x98, 0x9D, 0x56, 0x03, 0xC8, 0xE8, 0x10, 0xE5, 0xA9, 0x08, 0x85, 
-       0x27, 0xA0, 0x7F, 0x60, 0xB9, 0x00, 0x02, 0xC8, 0x4C, 0x99, 0xC3, 0xC1, 0xF0, 0xF0, 0xEC, 0xE5, 
-       0xA0, 0xAF, 0xAF, 0xE3, 0x20, 0xD0, 0xF8, 0x20, 0x53, 0xF9, 0x85, 0x3A, 0x84, 0x3B, 0x60, 0x5A, 
-       0xB0, 0x1C, 0xA0, 0xC4, 0xC4, 0x39, 0xD0, 0x04, 0xA4, 0x38, 0xF0, 0x12, 0xDA, 0x48, 0x29, 0x7F, 
-       0xC9, 0x02, 0xB0, 0x06, 0x20, 0x3B, 0xC4, 0x20, 0x6B, 0xC4, 0x68, 0xFA, 0x7A, 0x60, 0x4C, 0x9D, 
-       0xC7, 0x00, 0x00, 0x00, 0x00, 0x4C, 0x52, 0xC5, 0x4C, 0x76, 0xC5, 0x00, 0x00, 0x00, 0xBF, 0x0A
-};
-
-char slot6[0x100] = {
-       0xA2, 0x20, 0xA0, 0x00, 0x64, 0x03, 0x64, 0x3C, 0xA9, 0x60, 0xAA, 0x86, 0x2B, 0x85, 0x4F, 0x5A, 
-       0xBD, 0x8E, 0xC0, 0xBD, 0x8C, 0xC0, 0x7A, 0xB9, 0xEA, 0xC0, 0xBD, 0x89, 0xC0, 0xA0, 0x50, 0xBD, 
-       0x80, 0xC0, 0x98, 0x29, 0x03, 0x0A, 0x05, 0x2B, 0xAA, 0xBD, 0x81, 0xC0, 0xA9, 0x56, 0x20, 0xA8, 
-       0xFC, 0x88, 0x10, 0xEB, 0x85, 0x26, 0x85, 0x3D, 0x85, 0x41, 0x20, 0x8E, 0xC5, 0x64, 0x03, 0x18, 
-       0x08, 0x28, 0xA6, 0x2B, 0xC6, 0x03, 0xD0, 0x0E, 0xBD, 0x88, 0xC0, 0xA5, 0x01, 0xC9, 0xC6, 0xD0, 
-       0xA4, 0x4C, 0x00, 0xC5, 0x00, 0x00, 0x08, 0x88, 0xD0, 0x04, 0xF0, 0xE5, 0x80, 0xDF, 0xBD, 0x8C, 
-       0xC0, 0x10, 0xFB, 0x49, 0xD5, 0xD0, 0xF0, 0xBD, 0x8C, 0xC0, 0x10, 0xFB, 0xC9, 0xAA, 0xD0, 0xF3, 
-       0xEA, 0xBD, 0x8C, 0xC0, 0x10, 0xFB, 0xC9, 0x96, 0xF0, 0x09, 0x28, 0x90, 0xC2, 0x49, 0xAD, 0xF0, 
-       0x25, 0xD0, 0xBC, 0xA0, 0x03, 0x85, 0x40, 0xBD, 0x8C, 0xC0, 0x10, 0xFB, 0x2A, 0x85, 0x3C, 0xBD, 
-       0x8C, 0xC0, 0x10, 0xFB, 0x25, 0x3C, 0x88, 0xD0, 0xEC, 0x28, 0xC5, 0x3D, 0xD0, 0xA1, 0xA5, 0x40, 
-       0xC5, 0x41, 0xD0, 0x9B, 0xB0, 0x9C, 0xA0, 0x56, 0x84, 0x3C, 0xBC, 0x8C, 0xC0, 0x10, 0xFB, 0x59, 
-       0xD6, 0x02, 0xA4, 0x3C, 0x88, 0x99, 0x00, 0x03, 0xD0, 0xEE, 0x84, 0x3C, 0xBC, 0x8C, 0xC0, 0x10, 
-       0xFB, 0x59, 0xD6, 0x02, 0xA4, 0x3C, 0x91, 0x26, 0xC8, 0xD0, 0xEF, 0xBC, 0x8C, 0xC0, 0x10, 0xFB, 
-       0x59, 0xD6, 0x02, 0xD0, 0xCD, 0xA0, 0x00, 0xA2, 0x56, 0xCA, 0x30, 0xFB, 0xB1, 0x26, 0x5E, 0x00, 
-       0x03, 0x2A, 0x5E, 0x00, 0x03, 0x2A, 0x91, 0x26, 0xC8, 0xD0, 0xEE, 0xE6, 0x27, 0xE6, 0x3D, 0xA5, 
-       0x3D, 0xCD, 0x00, 0x08, 0xA6, 0x4F, 0x90, 0xDB, 0x4C, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00
-};
+#endif // __FIRMWARE_H__
 
-char slot7[0x100] = {
-       0x2C, 0x03, 0xC7, 0x70, 0x1B, 0x38, 0x90, 0x18, 0xB8, 0x50, 0x15, 0x01, 0x9B, 0x1C, 0x1C, 0x1C, 
-       0x1C, 0x88, 0x18, 0x80, 0x2A, 0x38, 0x78, 0xA2, 0xFF, 0x9A, 0x80, 0x26, 0x38, 0xA2, 0x03, 0x60, 
-       0x8D, 0x78, 0x04, 0xA9, 0xC7, 0x8D, 0xF8, 0x07, 0x08, 0xC5, 0x39, 0xF0, 0xE8, 0x28, 0x4D, 0x7F, 
-       0x04, 0xD0, 0x1A, 0xAD, 0xFF, 0x07, 0x48, 0xAD, 0x7F, 0x07, 0x48, 0xAD, 0x78, 0x04, 0x60, 0x8D, 
-       0xF8, 0x07, 0x20, 0xD3, 0xC7, 0x70, 0x01, 0x60, 0xB0, 0x03, 0x6C, 0xCB, 0x00, 0xAD, 0x81, 0xC0, 
-       0xAD, 0x81, 0xC0, 0x20, 0x84, 0xFE, 0x20, 0x2F, 0xFB, 0x20, 0x58, 0xFC, 0x20, 0x93, 0xFE, 0x20, 
-       0x89, 0xFE, 0xA0, 0x10, 0xB9, 0x6F, 0xC7, 0x99, 0xDB, 0x07, 0x88, 0x10, 0xF7, 0x80, 0xFE, 0xC1, 
-       0xF0, 0xF0, 0xEC, 0xE5, 0xD4, 0xE1, 0xEC, 0xEB, 0xA0, 0xCF, 0xE6, 0xE6, 0xEC, 0xE9, 0xEE, 0xE5, 
-       0x8D, 0x28, 0xC0, 0x40, 0x8D, 0x28, 0xC0, 0x60, 0x8D, 0x28, 0xC0, 0x4C, 0x62, 0xFA, 0x8D, 0x28, 
-       0xC0, 0x2C, 0x87, 0xC7, 0x4C, 0x04, 0xC8, 0x8D, 0x28, 0xC0, 0x4C, 0xF1, 0xC7, 0x8D, 0x28, 0xC0, 
-       0x4C, 0xF6, 0xC7, 0x8D, 0x28, 0xC0, 0x4C, 0xF1, 0xC7, 0x8D, 0x28, 0xC0, 0x4C, 0x06, 0xC8, 0x8D, 
-       0x28, 0xC0, 0x4C, 0x4E, 0xC3, 0x8D, 0x28, 0xC0, 0x4C, 0x97, 0xC3, 0x8D, 0x28, 0xC0, 0x4C, 0x00, 
-       0xC1, 0x8D, 0x28, 0xC0, 0x4C, 0xA9, 0xD4, 0x8D, 0x28, 0xC0, 0x4C, 0x80, 0xC5, 0x8D, 0x28, 0xC0, 
-       0x4C, 0x4F, 0xC2, 0x8D, 0x28, 0xC0, 0x4C, 0xAC, 0xC2, 0x8D, 0x28, 0xC0, 0x4C, 0xC3, 0xC2, 0x8D, 
-       0x28, 0xC0, 0x4C, 0xF7, 0xC2, 0x8D, 0x28, 0xC0, 0x4C, 0xE0, 0xD4, 0x8D, 0x28, 0xC0, 0x6C, 0xED, 
-       0x03, 0x20, 0x23, 0xCE, 0x80, 0x8E, 0x20, 0x4D, 0xCE, 0x80, 0x89, 0x00, 0x00, 0x00, 0x00, 0x00
-};
index b014af08bb4fe515344948b8e99fc8d1913a9c35..b4e479f361424b6d73d6eab8ba4dc759593b08f9 100755 (executable)
@@ -1,10 +1,10 @@
 //
 // Apple 2 floppy disk support
 //
-// by James L. Hammons
+// by James Hammons
 // (c) 2005 Underground Software
 //
-// JLH = James L. Hammons <jlhamm@acm.org>
+// JLH = James Hammons <jlhamm@acm.org>
 //
 // WHO  WHEN        WHAT
 // ---  ----------  ------------------------------------------------------------
index ab72f3fd0da0baa656492e6139fdabc4ef4e2c21..a84dd54892f3eec9274d1f52040e41c78fde0f20 100755 (executable)
@@ -2,7 +2,7 @@
 #define FONT_HEIGHT            16
 
 //
-// This file was automagically generated by rawfont2c (by James L. Hammons)
+// This file was automagically generated by rawfont2c (by James Hammons)
 //
 
 char font1[] = {
index e5588efcd82f933110f8f7c5e3d4aa52a19e5318..8d69fbda044a9b025a88a0b7d0ed2d975f615297 100755 (executable)
@@ -2,9 +2,9 @@
 // BUTTON.CPP
 //
 // Graphical User Interface button class
-// by James L. Hammons
+// by James Hammons
 //
-// JLH = James L. Hammons <jlhamm@acm.org>
+// JLH = James Hammons <jlhamm@acm.org>
 //
 // WHO  WHEN        WHAT
 // ---  ----------  ------------------------------------------------------------
index 32973ce618b4e3f2bd9f94bbae74d2b739f1e534..1e91a6fe5f6af0455ec53bf06d27909532ac73dd 100644 (file)
@@ -2,9 +2,9 @@
 // DISKWINDOW.CPP
 //
 // Graphical User Interface disk window class
-// by James L. Hammons
+// by James Hammons
 //
-// JLH = James L. Hammons <jlhamm@acm.org>
+// JLH = James Hammons <jlhamm@acm.org>
 //
 // WHO  WHEN        WHAT
 // ---  ----------  ------------------------------------------------------------
index 5b256499c3ba044e19d440da41365c4d99c52323..1d9b3dada9a4164ba8e312eb2d2a8af295a2a38d 100755 (executable)
@@ -2,9 +2,9 @@
 // DRAGGABLEWINDOW.CPP
 //
 // Graphical User Interface draggable window class
-// by James L. Hammons
+// by James Hammons
 //
-// JLH = James L. Hammons <jlhamm@acm.org>
+// JLH = James Hammons <jlhamm@acm.org>
 //
 // WHO  WHEN        WHAT
 // ---  ----------  ------------------------------------------------------------
index a34d3d0453bcfc16125c5d92287ea2de0450ec5c..4b385fb9b026d3a9d6dfc5bcb3c4e6bf96ff786f 100755 (executable)
@@ -2,9 +2,9 @@
 // DRAGGABLEWINDOW2.CPP
 //
 // Graphical User Interface draggable window class
-// by James L. Hammons
+// by James Hammons
 //
-// JLH = James L. Hammons <jlhamm@acm.org>
+// JLH = James Hammons <jlhamm@acm.org>
 //
 // WHO  WHEN        WHAT
 // ---  ----------  ------------------------------------------------------------
index 5598f6126306622ee40d4ffe4f0331d876c5d42a..3adb4b3eba5bd70943d41685fb140dfa92f86c36 100755 (executable)
@@ -2,9 +2,9 @@
 // ELEMENT.CPP
 //
 // Graphical User Interface base class
-// by James L. Hammons
+// by James Hammons
 //
-// JLH = James L. Hammons <jlhamm@acm.org>
+// JLH = James Hammons <jlhamm@acm.org>
 //
 // WHO  WHEN        WHAT
 // ---  ----------  ------------------------------------------------------------
index 3f4f75d47cf8e5ed98d9c3001177fd2a5c7904ed..624047fc8f09ab4c4b5007f9b58cb8b4a1a6140f 100755 (executable)
@@ -1,5 +1,5 @@
 //
-// This file was automagically generated by bin2c (by James L. Hammons)
+// This file was automagically generated by bin2c (by James Hammons)
 //
 
 char font1[0x4000] = {
index 4a5b56e19b957a67f6e35ff6646fefc4c73c410b..7b97b0d2822fb296f22eb3d37f79c6a96e602ee2 100755 (executable)
@@ -2,7 +2,7 @@
 #define FONT_HEIGHT            16
 
 //
-// This file was automagically generated by rawfont2c (by James L. Hammons)
+// This file was automagically generated by rawfont2c (by James Hammons)
 //
 
 char font2[] = {
index 3b6084c2388df82ae92613743cb8360e93c1183a..b2a3b594586a848cff8dafa6056952afce55bb54 100755 (executable)
@@ -2,9 +2,9 @@
 // GUI.CPP
 //
 // Graphical User Interface support
-// by James L. Hammons
+// by James Hammons
 //
-// JLH = James L. Hammons <jlhamm@acm.org>
+// JLH = James Hammons <jlhamm@acm.org>
 //
 // WHO  WHEN        WHAT
 // ---  ----------  ------------------------------------------------------------
index 62358f82ec90f5b08c75aa9fab686e645d1249c5..8e623ac016491a9992198d76539cba96f14c8c5c 100755 (executable)
@@ -2,9 +2,9 @@
 // GUIMISC.CPP
 //
 // Graphical User Interface support functions
-// by James L. Hammons
+// by James Hammons
 //
-// JLH = James L. Hammons <jlhamm@acm.org>
+// JLH = James Hammons <jlhamm@acm.org>
 //
 // WHO  WHEN        WHAT
 // ---  ----------  ------------------------------------------------------------
index 4c30c37125c2bbab42e4751a81da9a2e0a9863fb..7401837dd6e9c611e700158883f82ab8c58a99c4 100755 (executable)
@@ -2,9 +2,9 @@
 // MENU.CPP
 //
 // Graphical User Interface menu support
-// by James L. Hammons
+// by James Hammons
 //
-// JLH = James L. Hammons <jlhamm@acm.org>
+// JLH = James Hammons <jlhamm@acm.org>
 //
 // WHO  WHEN        WHAT
 // ---  ----------  ------------------------------------------------------------
index 0c7ea6d21d3047db05f99e74b5df78a85a154b3d..34e01403c604419448a8712237a6e65c7d664014 100644 (file)
@@ -1,7 +1,7 @@
 //
 // Static text class
 //
-// by James L. Hammons
+// by James Hammons
 //
 
 #include "text.h"
index ff7e8aaf91493a822775ae715dbff1f70025c606..afbcbf081468c3db98e1c3e1fca6389cc19c6478 100644 (file)
@@ -1,7 +1,7 @@
 //
 // Static text class
 //
-// by James L. Hammons
+// by James Hammons
 //
 
 #ifndef __TEXT_H__
index 38032969e4b85b18e209866cf40ebb06cde19f62..b67110319761a59afbe49b5b368653a32ddb95d7 100755 (executable)
@@ -2,9 +2,9 @@
 // TEXTEDIT.CPP
 //
 // Graphical User Interface button class
-// by James L. Hammons
+// by James Hammons
 //
-// JLH = James L. Hammons <jlhamm@acm.org>
+// JLH = James Hammons <jlhamm@acm.org>
 //
 // WHO  WHEN        WHAT
 // ---  ----------  ------------------------------------------------------------
index 48e3db62241d1b308170149b517d2772884ee5ce..421e32a230bb01d8ebb5131e0cf6da7c8f07ba11 100755 (executable)
@@ -2,9 +2,9 @@
 // WINDOW.CPP
 //
 // Graphical User Interface window class
-// by James L. Hammons
+// by James Hammons
 //
-// JLH = James L. Hammons <jlhamm@acm.org>
+// JLH = James Hammons <jlhamm@acm.org>
 //
 // WHO  WHEN        WHAT
 // ---  ----------  ------------------------------------------------------------
index 55d99b7a18b4d50db85308af956f0c5e67fcaaf6..6994cc5ac1d1649838e7938fdc052e8a0437c4b1 100755 (executable)
@@ -1,10 +1,10 @@
 //
 // Log handler
 //
-// by James L. Hammons
+// by James Hammons
 // (C) 2006 Underground Software
 //
-// JLH = James L. Hammons <jlhamm@acm.org>
+// JLH = James Hammons <jlhamm@acm.org>
 //
 // WHO  WHEN        WHAT
 // ---  ----------  ------------------------------------------------------------
diff --git a/src/mmu.cpp b/src/mmu.cpp
new file mode 100644 (file)
index 0000000..045dad5
--- /dev/null
@@ -0,0 +1,863 @@
+//
+// mmu.cpp: Memory management
+//
+// by James Hammons
+// (C) 2013 Underground Software
+//
+// JLH = James Hammons <jlhamm@acm.org>
+//
+// WHO  WHEN        WHAT
+// ---  ----------  ------------------------------------------------------------
+// JLH  09/27/2013  Created this file
+
+
+#include "mmu.h"
+#include "apple2.h"
+#include "applevideo.h"
+#include "firmware.h"
+#include "log.h"
+#include "sound.h"
+
+
+// Debug defines
+//#define LC_DEBUG
+
+// Address Map enumeration
+enum { AM_RAM, AM_ROM, AM_BANKED, AM_READ, AM_WRITE, AM_READ_WRITE, AM_END_OF_LIST };
+
+// Macros for function pointers
+// The typedef would be something like:
+//typedef ReadFunc (uint8_t (*)(uint16_t));
+//typedef WriteFunc (void (*)(uint16_t, uint8_t));
+#define READFUNC(x) uint8_t (* x)(uint16_t)
+#define WRITEFUNC(x) void (* x)(uint16_t, uint8_t)
+
+// Internal vars
+uint8_t ** addrPtrRead[0x10000];
+uint8_t ** addrPtrWrite[0x10000];
+uint16_t addrOffset[0x10000];
+
+READFUNC(funcMapRead[0x10000]);
+WRITEFUNC(funcMapWrite[0x10000]);
+
+// Language card state (ROM read, no write)
+uint8_t lcState = 0x02;
+
+struct AddressMap
+{
+       uint16_t start;
+       uint16_t end;
+       int type;
+       uint8_t ** memory;
+       uint8_t ** altMemory;
+       READFUNC(read);
+       WRITEFUNC(write);
+};
+
+
+// Dunno if I like this approach or not...
+//ADDRESS_MAP_START()
+//     AM_RANGE(0x0000, 0xBFFF) AM_RAM AM_BASE(ram) AM_SHARE(1)
+//     AM_RANGE(0xC000, 0xC001) AM_READWRITE(readFunc, writeFunc)
+//ADDRESS_MAP_END
+
+// Would need a pointer for 80STORE as well...
+
+uint8_t * pageZeroMemory  = &ram[0x0000];      // $0000 - $01FF
+uint8_t * mainMemoryR     = &ram[0x0200];      // $0200 - $BFFF (read)
+uint8_t * mainMemoryW     = &ram[0x0200];      // $0200 - $BFFF (write)
+
+uint8_t * mainMemoryTextR = &ram[0x0400];      // $0400 - $07FF (read)
+uint8_t * mainMemoryTextW = &ram[0x0400];      // $0400 - $07FF (write)
+uint8_t * mainMemoryHGRR  = &ram[0x2000];      // $2000 - $3FFF (read)
+uint8_t * mainMemoryHGRW  = &ram[0x2000];      // $2000 - $3FFF (write)
+
+uint8_t * slotMemory      = &rom[0xC100];      // $C100 - $CFFF
+uint8_t * slot3Memory     = &rom[0xC300];      // $C300 - $C3FF
+uint8_t * slot6Memory     = &diskROM[0];       // $C600 - $C6FF
+uint8_t * lcBankMemoryR   = &ram[0xD000];      // $D000 - $DFFF (read)
+uint8_t * lcBankMemoryW   = &ram[0xD000];      // $D000 - $DFFF (write)
+uint8_t * upperMemoryR    = &ram[0xE000];      // $E000 - $FFFF (read)
+uint8_t * upperMemoryW    = &ram[0xE000];      // $E000 - $FFFF (write)
+
+
+// Function prototypes
+uint8_t ReadNOP(uint16_t);
+void WriteNOP(uint16_t, uint8_t);
+uint8_t ReadMemory(uint16_t);
+void WriteMemory(uint16_t, uint8_t);
+uint8_t ReadKeyboard(uint16_t);
+void Switch80STORE(uint16_t, uint8_t);
+void SwitchRAMRD(uint16_t, uint8_t);
+void SwitchRAMWRT(uint16_t, uint8_t);
+void SwitchSLOTCXROM(uint16_t, uint8_t);
+void SwitchALTZP(uint16_t, uint8_t);
+void SwitchSLOTC3ROM(uint16_t, uint8_t);
+void Switch80COL(uint16_t, uint8_t);
+void SwitchALTCHARSET(uint16_t, uint8_t);
+uint8_t ReadKeyStrobe(uint16_t);
+uint8_t ReadBANK2(uint16_t);
+uint8_t ReadLCRAM(uint16_t);
+uint8_t ReadRAMRD(uint16_t);
+uint8_t ReadRAMWRT(uint16_t);
+uint8_t ReadSLOTCXROM(uint16_t);
+uint8_t ReadALTZP(uint16_t);
+uint8_t ReadSLOTC3ROM(uint16_t);
+uint8_t Read80STORE(uint16_t);
+uint8_t ReadVBL(uint16_t);
+uint8_t ReadTEXT(uint16_t);
+uint8_t ReadMIXED(uint16_t);
+uint8_t ReadPAGE2(uint16_t);
+uint8_t ReadHIRES(uint16_t);
+uint8_t ReadALTCHARSET(uint16_t);
+uint8_t Read80COL(uint16_t);
+void WriteKeyStrobe(uint16_t, uint8_t);
+uint8_t ReadSpeaker(uint16_t);
+void WriteSpeaker(uint16_t, uint8_t);
+uint8_t SwitchLCR(uint16_t);
+void SwitchLCW(uint16_t, uint8_t);
+void SwitchLC(void);
+uint8_t SwitchTEXTR(uint16_t);
+void SwitchTEXTW(uint16_t, uint8_t);
+uint8_t SwitchMIXEDR(uint16_t);
+void SwitchMIXEDW(uint16_t, uint8_t);
+uint8_t SwitchPAGE2R(uint16_t);
+void SwitchPAGE2W(uint16_t, uint8_t);
+uint8_t SwitchHIRESR(uint16_t);
+void SwitchHIRESW(uint16_t, uint8_t);
+uint8_t SwitchDHIRESR(uint16_t);
+void SwitchDHIRESW(uint16_t, uint8_t);
+void SwitchIOUDIS(uint16_t, uint8_t);
+uint8_t Slot6R(uint16_t);
+void Slot6W(uint16_t, uint8_t);
+void HandleSlot6(uint16_t, uint8_t);
+uint8_t ReadButton0(uint16_t);
+uint8_t ReadButton1(uint16_t);
+uint8_t ReadPaddle0(uint16_t);
+uint8_t ReadIOUDIS(uint16_t);
+uint8_t ReadDHIRES(uint16_t);
+//uint8_t SwitchR(uint16_t);
+//void SwitchW(uint16_t, uint8_t);
+
+
+// The main Apple //e memory map
+AddressMap memoryMap[] = {
+       { 0x0000, 0x01FF, AM_RAM, &pageZeroMemory, 0, 0, 0 },
+       { 0x0200, 0xBFFF, AM_BANKED, &mainMemoryR, &mainMemoryW, 0, 0 },
+
+       // These will overlay over the previously written memory accessors
+       { 0x0400, 0x07FF, AM_BANKED, &mainMemoryTextR, &mainMemoryTextW, 0, 0 },
+       { 0x2000, 0x3FFF, AM_BANKED, &mainMemoryHGRR, &mainMemoryHGRW, 0, 0 },
+
+       { 0xC000, 0xC001, AM_READ_WRITE, 0, 0, ReadKeyboard, Switch80STORE },
+       { 0xC002, 0xC003, AM_READ_WRITE, 0, 0, ReadKeyboard, SwitchRAMRD },
+       { 0xC004, 0xC005, AM_READ_WRITE, 0, 0, ReadKeyboard, SwitchRAMWRT },
+       { 0xC006, 0xC007, AM_READ_WRITE, 0, 0, ReadKeyboard, SwitchSLOTCXROM },
+       { 0xC008, 0xC009, AM_READ_WRITE, 0, 0, ReadKeyboard, SwitchALTZP },
+       { 0xC00A, 0xC00B, AM_READ_WRITE, 0, 0, ReadKeyboard, SwitchSLOTC3ROM },
+       { 0xC00C, 0xC00D, AM_READ_WRITE, 0, 0, ReadKeyboard, Switch80COL },
+       { 0xC00E, 0xC00F, AM_READ_WRITE, 0, 0, ReadKeyboard, SwitchALTCHARSET },
+       { 0xC010, 0xC010, AM_READ_WRITE, 0, 0, ReadKeyStrobe, WriteKeyStrobe },
+       { 0xC011, 0xC011, AM_READ_WRITE, 0, 0, ReadBANK2, WriteKeyStrobe },
+       { 0xC012, 0xC012, AM_READ_WRITE, 0, 0, ReadLCRAM, WriteKeyStrobe },
+       { 0xC013, 0xC013, AM_READ_WRITE, 0, 0, ReadRAMRD, WriteKeyStrobe },
+       { 0xC014, 0xC014, AM_READ_WRITE, 0, 0, ReadRAMWRT, WriteKeyStrobe },
+       { 0xC015, 0xC015, AM_READ_WRITE, 0, 0, ReadSLOTCXROM, WriteKeyStrobe },
+       { 0xC016, 0xC016, AM_READ_WRITE, 0, 0, ReadALTZP, WriteKeyStrobe },
+       { 0xC017, 0xC017, AM_READ_WRITE, 0, 0, ReadSLOTC3ROM, WriteKeyStrobe },
+       { 0xC018, 0xC018, AM_READ_WRITE, 0, 0, Read80STORE, WriteKeyStrobe },
+       { 0xC019, 0xC019, AM_READ_WRITE, 0, 0, ReadVBL, WriteKeyStrobe },
+       { 0xC01A, 0xC01A, AM_READ_WRITE, 0, 0, ReadTEXT, WriteKeyStrobe },
+       { 0xC01B, 0xC01B, AM_READ_WRITE, 0, 0, ReadMIXED, WriteKeyStrobe },
+       { 0xC01C, 0xC01C, AM_READ_WRITE, 0, 0, ReadPAGE2, WriteKeyStrobe },
+       { 0xC01D, 0xC01D, AM_READ_WRITE, 0, 0, ReadHIRES, WriteKeyStrobe },
+       { 0xC01E, 0xC01E, AM_READ_WRITE, 0, 0, ReadALTCHARSET, WriteKeyStrobe },
+       { 0xC01F, 0xC01F, AM_READ_WRITE, 0, 0, Read80COL, WriteKeyStrobe },
+       { 0xC030, 0xC03F, AM_READ_WRITE, 0, 0, ReadSpeaker, WriteSpeaker },
+       { 0xC050, 0xC051, AM_READ_WRITE, 0, 0, SwitchTEXTR, SwitchTEXTW },
+       { 0xC052, 0xC053, AM_READ_WRITE, 0, 0, SwitchMIXEDR, SwitchMIXEDW },
+       { 0xC054, 0xC055, AM_READ_WRITE, 0, 0, SwitchPAGE2R, SwitchPAGE2W },
+       { 0xC056, 0xC057, AM_READ_WRITE, 0, 0, SwitchHIRESR, SwitchHIRESW },
+       { 0xC05E, 0xC05F, AM_READ_WRITE, 0, 0, SwitchDHIRESR, SwitchDHIRESW },
+       { 0xC061, 0xC061, AM_READ, 0, 0, ReadButton0, 0 },
+       { 0xC062, 0xC062, AM_READ, 0, 0, ReadButton1, 0 },
+       { 0xC064, 0xC067, AM_READ, 0, 0, ReadPaddle0, 0 },
+//     { 0xC07E, 0xC07F, AM_READ_WRITE, 0, 0, SwitchIOUDISR, SwitchIOUDISW },
+       { 0xC07E, 0xC07E, AM_READ_WRITE, 0, 0, ReadIOUDIS, SwitchIOUDIS },
+       { 0xC07F, 0xC07F, AM_READ_WRITE, 0, 0, ReadDHIRES, SwitchIOUDIS },
+       { 0xC080, 0xC08F, AM_READ_WRITE, 0, 0, SwitchLCR, SwitchLCW },
+       { 0xC0E0, 0xC0EF, AM_READ_WRITE, 0, 0, Slot6R, Slot6W },
+       { 0xC100, 0xCFFF, AM_ROM, &slotMemory, 0, 0, 0 },
+
+       // This will overlay the slotMemory accessors for slot 6 ROM
+       { 0xC300, 0xC3FF, AM_ROM, &slot3Memory, 0, 0, 0 },
+       { 0xC600, 0xC6FF, AM_ROM, &slot6Memory, 0, 0, 0 },
+
+       { 0xD000, 0xDFFF, AM_BANKED, &lcBankMemoryR, &lcBankMemoryW, 0, 0 },
+       { 0xE000, 0xFFFF, AM_BANKED, &upperMemoryR, &upperMemoryW, 0, 0 },
+       { 0x0000, 0x0000, AM_END_OF_LIST, 0, 0, 0, 0 }
+};
+
+
+void SetupAddressMap(void)
+{
+       for(uint32_t i=0; i<0x10000; i++)
+       {
+               funcMapRead[i] = ReadNOP;
+               funcMapWrite[i] = WriteNOP;
+               addrPtrRead[i] = 0;
+               addrPtrWrite[i] = 0;
+               addrOffset[i] = 0;
+       }
+
+       uint32_t i=0;
+
+       while (memoryMap[i].type != AM_END_OF_LIST)
+       {
+               switch (memoryMap[i].type)
+               {
+               case AM_RAM:
+                       for(uint32_t j=memoryMap[i].start; j<=memoryMap[i].end; j++)
+                       {
+                               funcMapRead[j] = ReadMemory;
+                               funcMapWrite[j] = WriteMemory;
+                               addrPtrRead[j] = memoryMap[i].memory;
+                               addrPtrWrite[j] = memoryMap[i].memory;
+                               addrOffset[j] = j - memoryMap[i].start;
+//WriteLog("SetupAddressMap: j=$%04X, addrOffset[j]=$%04X\n", j, addrOffset[j]);
+                       }
+
+                       break;
+               case AM_ROM:
+                       for(uint32_t j=memoryMap[i].start; j<=memoryMap[i].end; j++)
+                       {
+                               funcMapRead[j] = ReadMemory;
+                               addrPtrRead[j] = memoryMap[i].memory;
+                               addrOffset[j] = j - memoryMap[i].start;
+                       }
+
+                       break;
+               case AM_BANKED:
+                       for(uint32_t j=memoryMap[i].start; j<=memoryMap[i].end; j++)
+                       {
+                               funcMapRead[j] = ReadMemory;
+                               funcMapWrite[j] = WriteMemory;
+                               addrPtrRead[j] = memoryMap[i].memory;
+                               addrPtrWrite[j] = memoryMap[i].altMemory;
+                               addrOffset[j] = j - memoryMap[i].start;
+                       }
+
+                       break;
+               case AM_READ:
+                       for(uint32_t j=memoryMap[i].start; j<=memoryMap[i].end; j++)
+                               funcMapRead[j] = memoryMap[i].read;
+
+                       break;
+               case AM_WRITE:
+                       for(uint32_t j=memoryMap[i].start; j<=memoryMap[i].end; j++)
+                               funcMapWrite[j] = memoryMap[i].write;
+
+                       break;
+               case AM_READ_WRITE:
+                       for(uint32_t j=memoryMap[i].start; j<=memoryMap[i].end; j++)
+                       {
+                               funcMapRead[j] = memoryMap[i].read;
+                               funcMapWrite[j] = memoryMap[i].write;
+                       }
+
+                       break;
+               }
+
+               i++;
+       };
+
+       // This should correctly set up the LC pointers, but it doesn't
+       // for some reason... :-/
+       // It's because we were storing pointers directly, instead of pointers
+       // to the pointer... It's complicated. :-)
+       SwitchLC();
+}
+
+
+//
+// Built-in functions
+//
+uint8_t ReadNOP(uint16_t)
+{
+       return 0;
+}
+
+
+void WriteNOP(uint16_t, uint8_t)
+{
+}
+
+
+uint8_t ReadMemory(uint16_t address)
+{
+//WriteLog("ReadMemory: addr=$%04X, addrPtrRead[addr]=$%X, addrOffset[addr]=$%X, val=$%02X\n", address, addrPtrRead[address], addrOffset[address], addrPtrRead[address][addrOffset[address]]);
+       // We are guaranteed a valid address here by the setup function, so there's
+       // no need to do any checking here.
+       return (*addrPtrRead[address])[addrOffset[address]];
+}
+
+
+void WriteMemory(uint16_t address, uint8_t byte)
+{
+       // We can write protect memory this way, but it adds a branch to the mix. :-/
+       // (this can be avoided by setting up another bank of memory which we
+       //  ignore... hmm...)
+       if ((*addrPtrWrite[address]) == 0)
+               return;
+
+       (*addrPtrWrite[address])[addrOffset[address]] = byte;
+}
+
+
+//
+// The main memory access functions used by V65C02
+//
+uint8_t AppleReadMem(uint16_t address)
+{
+       return (*(funcMapRead[address]))(address);
+}
+
+
+void AppleWriteMem(uint16_t address, uint8_t byte)
+{
+       (*(funcMapWrite[address]))(address, byte);
+}
+
+
+//
+// Actual emulated I/O functions follow
+//
+uint8_t ReadKeyboard(uint16_t /*addr*/)
+{
+       return lastKeyPressed | ((uint8_t)keyDown << 7);
+}
+
+
+void Switch80STORE(uint16_t address, uint8_t)
+{
+       store80Mode = (bool)(address & 0x01);
+WriteLog("Setting 80STORE to %s...\n", (store80Mode ? "ON" : "off"));
+
+       if (store80Mode)
+       {
+               mainMemoryTextR = (displayPage2 ? &ram2[0x0400] : &ram[0x0400]);
+               mainMemoryTextW = (displayPage2 ? &ram2[0x0400] : &ram[0x0400]);
+               mainMemoryHGRR = (displayPage2 ? &ram2[0x2000] : &ram[0x2000]);
+               mainMemoryHGRW = (displayPage2 ? &ram2[0x2000] : &ram[0x2000]);
+       }
+       else
+       {
+               mainMemoryTextR = (ramwrt ? &ram2[0x0400] : &ram[0x0400]);
+               mainMemoryTextW = (ramwrt ? &ram2[0x0400] : &ram[0x0400]);
+               mainMemoryHGRR = (ramwrt ? &ram2[0x2000] : &ram[0x2000]);
+               mainMemoryHGRW = (ramwrt ? &ram2[0x2000] : &ram[0x2000]);
+       }
+}
+
+
+void SwitchRAMRD(uint16_t address, uint8_t)
+{
+       ramrd = (bool)(address & 0x01);
+       mainMemoryR = (ramrd ? &ram2[0x0200] : &ram[0x0200]);
+
+       if (store80Mode)
+               return;
+
+       mainMemoryTextR = (ramrd ? &ram2[0x0400] : &ram[0x0400]);
+       mainMemoryHGRR = (ramrd ? &ram2[0x2000] : &ram[0x2000]);
+}
+
+
+void SwitchRAMWRT(uint16_t address, uint8_t)
+{
+       ramwrt = (bool)(address & 0x01);
+       mainMemoryW = (ramwrt ?  &ram2[0x0200] : &ram[0x0200]);
+
+       if (store80Mode)
+               return;
+
+       mainMemoryTextW = (ramwrt ? &ram2[0x0400] : &ram[0x0400]);
+       mainMemoryHGRW = (ramwrt ? &ram2[0x2000] : &ram[0x2000]);
+}
+
+
+void SwitchSLOTCXROM(uint16_t address, uint8_t)
+{
+WriteLog("Setting SLOTCXROM to %s...\n", ((address & 0x01) ^ 0x01 ? "ON" : "off"));
+       // This is the only soft switch that breaks the usual convention.
+       slotCXROM = !((bool)(address & 0x01));
+//     slot3Memory = (slotCXROM ? &rom[0] : &rom[0xC300]);
+       slot6Memory = (slotCXROM ? &diskROM[0] : &rom[0xC600]);
+}
+
+
+void SwitchALTZP(uint16_t address, uint8_t)
+{
+       altzp = (bool)(address & 0x01);
+       pageZeroMemory = (altzp ? &ram2[0x0000] : &ram[0x0000]);
+       SwitchLC();
+}
+
+//extern bool dumpDis;
+
+void SwitchSLOTC3ROM(uint16_t address, uint8_t)
+{
+//dumpDis = true;
+WriteLog("Setting SLOTC3ROM to %s...\n", (address & 0x01 ? "ON" : "off"));
+       slotC3ROM = (bool)(address & 0x01);
+//     slotC3ROM = false;
+// Seems the h/w forces this with an 80 column card in slot 3...
+       slot3Memory = (slotC3ROM ? &rom[0] : &rom[0xC300]);
+//     slot3Memory = &rom[0xC300];
+}
+
+
+void Switch80COL(uint16_t address, uint8_t)
+{
+       col80Mode = (bool)(address & 0x01);
+}
+
+
+void SwitchALTCHARSET(uint16_t address, uint8_t)
+{
+       alternateCharset = (bool)(address & 0x01);
+}
+
+
+uint8_t ReadKeyStrobe(uint16_t)
+{
+       uint8_t byte = lastKeyPressed | ((uint8_t)keyDown << 7);
+       keyDown = false;
+       return byte;
+}
+
+
+uint8_t ReadBANK2(uint16_t)
+{
+       return (lcState < 0x04 ? 0x80 : 0x00);
+}
+
+
+uint8_t ReadLCRAM(uint16_t)
+{
+       // If bits 0 & 1 are set, but not at the same time, then it's ROM
+       uint8_t lcROM = (lcState & 0x1) ^ ((lcState & 0x02) >> 1);
+       return (lcROM ? 0x00 : 0x80);
+}
+
+
+uint8_t ReadRAMRD(uint16_t)
+{
+       return (uint8_t)ramrd << 7;
+}
+
+
+uint8_t ReadRAMWRT(uint16_t)
+{
+       return (uint8_t)ramwrt << 7;
+}
+
+
+uint8_t ReadSLOTCXROM(uint16_t)
+{
+       return (uint8_t)slotCXROM << 7;
+}
+
+
+uint8_t ReadALTZP(uint16_t)
+{
+       return (uint8_t)altzp << 7;
+}
+
+
+uint8_t ReadSLOTC3ROM(uint16_t)
+{
+//     return 0;
+       return (uint8_t)slotC3ROM << 7;
+}
+
+
+uint8_t Read80STORE(uint16_t)
+{
+       return (uint8_t)store80Mode << 7;
+}
+
+
+uint8_t ReadVBL(uint16_t)
+{
+       return (uint8_t)vbl << 7;
+}
+
+
+uint8_t ReadTEXT(uint16_t)
+{
+       return (uint8_t)textMode << 7;
+}
+
+
+uint8_t ReadMIXED(uint16_t)
+{
+       return (uint8_t)mixedMode << 7;
+}
+
+
+uint8_t ReadPAGE2(uint16_t)
+{
+       return (uint8_t)displayPage2 << 7;
+}
+
+
+uint8_t ReadHIRES(uint16_t)
+{
+       return (uint8_t)hiRes << 7;
+}
+
+
+uint8_t ReadALTCHARSET(uint16_t)
+{
+       return (uint8_t)alternateCharset << 7;
+}
+
+
+uint8_t Read80COL(uint16_t)
+{
+       return (uint8_t)col80Mode << 7;
+}
+
+
+void WriteKeyStrobe(uint16_t, uint8_t)
+{
+       keyDown = false;
+}
+
+
+uint8_t ReadSpeaker(uint16_t)
+{
+       ToggleSpeaker();
+       return 0;
+}
+
+
+void WriteSpeaker(uint16_t, uint8_t)
+{
+       ToggleSpeaker();
+}
+
+
+uint8_t SwitchLCR(uint16_t address)
+{
+       lcState = address & 0x0B;
+       SwitchLC();
+       return 0;
+}
+
+
+void SwitchLCW(uint16_t address, uint8_t)
+{
+       lcState = address & 0x0B;
+       SwitchLC();
+}
+
+
+void SwitchLC(void)
+{
+       switch (lcState)
+       {
+       case 0x00:
+#ifdef LC_DEBUG
+WriteLog("SwitchLC: Read RAM bank 2, no write\n");
+#endif
+               // [R ] Read RAM bank 2; no write
+               lcBankMemoryR = (altzp ? &ram2[0xD000] : &ram[0xD000]);
+               lcBankMemoryW = 0;
+               upperMemoryR = (altzp ? &ram2[0xE000] : &ram[0xE000]);
+               upperMemoryW = 0;
+               break;
+       case 0x01:
+#ifdef LC_DEBUG
+WriteLog("SwitchLC: Read ROM, write bank 2\n");
+#endif
+               // [RR] Read ROM; write RAM bank 2
+               lcBankMemoryR = &rom[0xD000];
+               lcBankMemoryW = (altzp ? &ram2[0xD000] : &ram[0xD000]);
+               upperMemoryR = &rom[0xE000];
+               upperMemoryW = (altzp ? &ram2[0xE000] : &ram[0xE000]);
+               break;
+       case 0x02:
+#ifdef LC_DEBUG
+WriteLog("SwitchLC: Read ROM, no write\n");
+#endif
+               // [R ] Read ROM; no write
+               lcBankMemoryR = &rom[0xD000];
+               lcBankMemoryW = 0;
+               upperMemoryR = &rom[0xE000];
+               upperMemoryW = 0;
+               break;
+       case 0x03:
+#ifdef LC_DEBUG
+WriteLog("SwitchLC: Read/write bank 2\n");
+#endif
+               // [RR] Read RAM bank 2; write RAM bank 2
+               lcBankMemoryR = (altzp ? &ram2[0xD000] : &ram[0xD000]);
+               lcBankMemoryW = (altzp ? &ram2[0xD000] : &ram[0xD000]);
+               upperMemoryR = (altzp ? &ram2[0xE000] : &ram[0xE000]);
+               upperMemoryW = (altzp ? &ram2[0xE000] : &ram[0xE000]);
+               break;
+       case 0x08:
+               // [R ] Read RAM bank 1; no write
+               lcBankMemoryR = (altzp ? &ram2[0xC000] : &ram[0xC000]);
+               lcBankMemoryW = 0;
+               upperMemoryR = (altzp ? &ram2[0xE000] : &ram[0xE000]);
+               upperMemoryW = 0;
+               break;
+       case 0x09:
+               // [RR] Read ROM; write RAM bank 1
+               lcBankMemoryR = &rom[0xD000];
+               lcBankMemoryW = (altzp ? &ram2[0xC000] : &ram[0xC000]);
+               upperMemoryR = &rom[0xE000];
+               upperMemoryW = (altzp ? &ram2[0xE000] : &ram[0xE000]);
+               break;
+       case 0x0A:
+               // [R ] Read ROM; no write
+               lcBankMemoryR = &rom[0xD000];
+               lcBankMemoryW = 0;
+               upperMemoryR = &rom[0xE000];
+               upperMemoryW = 0;
+               break;
+       case 0x0B:
+               // [RR] Read RAM bank 1; write RAM bank 1
+               lcBankMemoryR = (altzp ? &ram2[0xC000] : &ram[0xC000]);
+               lcBankMemoryW = (altzp ? &ram2[0xC000] : &ram[0xC000]);
+               upperMemoryR = (altzp ? &ram2[0xE000] : &ram[0xE000]);
+               upperMemoryW = (altzp ? &ram2[0xE000] : &ram[0xE000]);
+               break;
+       }
+}
+
+
+uint8_t SwitchTEXTR(uint16_t address)
+{
+       textMode = (bool)(address & 0x01);
+       return 0;
+}
+
+
+void SwitchTEXTW(uint16_t address, uint8_t)
+{
+       textMode = (bool)(address & 0x01);
+}
+
+
+uint8_t SwitchMIXEDR(uint16_t address)
+{
+       mixedMode = (bool)(address & 0x01);
+       return 0;
+}
+
+
+void SwitchMIXEDW(uint16_t address, uint8_t)
+{
+       mixedMode = (bool)(address & 0x01);
+}
+
+
+uint8_t SwitchPAGE2R(uint16_t address)
+{
+       displayPage2 = (bool)(address & 0x01);
+
+       if (store80Mode)
+       {
+               mainMemoryTextR = (displayPage2 ? &ram2[0x0400] : &ram[0x0400]);
+               mainMemoryTextW = (displayPage2 ? &ram2[0x0400] : &ram[0x0400]);
+               mainMemoryHGRR = (displayPage2 ? &ram2[0x2000] : &ram[0x2000]);
+               mainMemoryHGRW = (displayPage2 ? &ram2[0x2000] : &ram[0x2000]);
+       }
+
+       return 0;
+}
+
+
+void SwitchPAGE2W(uint16_t address, uint8_t)
+{
+       displayPage2 = (bool)(address & 0x01);
+
+       if (store80Mode)
+       {
+               mainMemoryTextR = (displayPage2 ? &ram2[0x0400] : &ram[0x0400]);
+               mainMemoryTextW = (displayPage2 ? &ram2[0x0400] : &ram[0x0400]);
+               mainMemoryHGRR = (displayPage2 ? &ram2[0x2000] : &ram[0x2000]);
+               mainMemoryHGRW = (displayPage2 ? &ram2[0x2000] : &ram[0x2000]);
+       }
+}
+
+
+uint8_t SwitchHIRESR(uint16_t address)
+{
+       hiRes = (bool)(address & 0x01);
+       return 0;
+}
+
+
+void SwitchHIRESW(uint16_t address, uint8_t)
+{
+       hiRes = (bool)(address & 0x01);
+}
+
+
+uint8_t SwitchDHIRESR(uint16_t address)
+{
+WriteLog("Setting DHIRES to %s (ioudis = %s)...\n", ((address & 0x01) ^ 0x01 ? "ON" : "off"), (ioudis ? "ON" : "off"));
+       // Hmm, this breaks convention too, like SLOTCXROM
+       if (ioudis)
+               dhires = !((bool)(address & 0x01));
+
+       return 0;
+}
+
+
+void SwitchDHIRESW(uint16_t address, uint8_t)
+{
+WriteLog("Setting DHIRES to %s (ioudis = %s)...\n", ((address & 0x01) ^ 0x01 ? "ON" : "off"), (ioudis ? "ON" : "off"));
+       if (ioudis)
+               dhires = !((bool)(address & 0x01));
+}
+
+
+void SwitchIOUDIS(uint16_t address, uint8_t)
+{
+       ioudis = !((bool)(address & 0x01));
+}
+
+
+uint8_t Slot6R(uint16_t address)
+{
+//WriteLog("Slot6R: address = %X\n", address & 0x0F);
+//     HandleSlot6(address, 0);
+//     return 0;
+       uint8_t state = address & 0x0F;
+
+       switch (state)
+       {
+       case 0x00:
+       case 0x01:
+       case 0x02:
+       case 0x03:
+       case 0x04:
+       case 0x05:
+       case 0x06:
+       case 0x07:
+               floppyDrive.ControlStepper(state);
+               break;
+       case 0x08:
+       case 0x09:
+               floppyDrive.ControlMotor(state & 0x01);
+               break;
+       case 0x0A:
+       case 0x0B:
+               floppyDrive.DriveEnable(state & 0x01);
+               break;
+       case 0x0C:
+               return floppyDrive.ReadWrite();
+               break;
+       case 0x0D:
+               return floppyDrive.GetLatchValue();
+               break;
+       case 0x0E:
+               floppyDrive.SetReadMode();
+               break;
+       case 0x0F:
+               floppyDrive.SetWriteMode();
+               break;
+       }
+
+       return 0;
+}
+
+
+void Slot6W(uint16_t address, uint8_t byte)
+{
+//WriteLog("Slot6W: address = %X, byte= %X\n", address & 0x0F, byte);
+//     HandleSlot6(address, byte);
+       uint8_t state = address & 0x0F;
+
+       switch (state)
+       {
+       case 0x00:
+       case 0x01:
+       case 0x02:
+       case 0x03:
+       case 0x04:
+       case 0x05:
+       case 0x06:
+       case 0x07:
+               floppyDrive.ControlStepper(state);
+               break;
+       case 0x08:
+       case 0x09:
+               floppyDrive.ControlMotor(state & 0x01);
+               break;
+       case 0x0A:
+       case 0x0B:
+               floppyDrive.DriveEnable(state & 0x01);
+               break;
+       case 0x0C:
+               floppyDrive.ReadWrite();
+               break;
+       case 0x0D:
+               floppyDrive.SetLatchValue(byte);
+               break;
+       case 0x0E:
+               floppyDrive.SetReadMode();
+               break;
+       case 0x0F:
+               floppyDrive.SetWriteMode();
+               break;
+       }
+}
+
+
+void HandleSlot6(uint16_t address, uint8_t byte)
+{
+}
+
+
+uint8_t ReadButton0(uint16_t)
+{
+       return (uint8_t)openAppleDown << 7;
+}
+
+
+uint8_t ReadButton1(uint16_t)
+{
+       return (uint8_t)closedAppleDown << 7;
+}
+
+
+// The way the paddles work is that a strobe is written (or read) to $C070,
+// then software counts down the time that it takes for the paddle outputs
+// to have bit 7 return to 0. If there are no paddles connected, bit 7
+// stays at 1.
+// NB: This is really paddles 0-3, not just 0 :-P
+uint8_t ReadPaddle0(uint16_t)
+{
+       return 0xFF;
+}
+
+
+uint8_t ReadIOUDIS(uint16_t)
+{
+       return (uint8_t)ioudis << 7;
+}
+
+
+uint8_t ReadDHIRES(uint16_t)
+{
+       return (uint8_t)dhires << 7;
+}
+
+
diff --git a/src/mmu.h b/src/mmu.h
new file mode 100644 (file)
index 0000000..c6c8448
--- /dev/null
+++ b/src/mmu.h
@@ -0,0 +1,11 @@
+#ifndef __MMU_H__
+#define __MMU_H__
+
+#include <stdint.h>
+
+void SetupAddressMap(void);
+uint8_t AppleReadMem(uint16_t);
+void AppleWriteMem(uint16_t, uint8_t);
+
+#endif // __MMU_H__
+
index be7bd3f5964f230cd9a4383735cd2a79951769a4..37f87676215d3936c4ef8b0036c9f09e52b5a2e7 100755 (executable)
@@ -1,10 +1,10 @@
 //
 // SETTINGS.CPP: Game configuration loading/saving support
 //
-// by James L. Hammons
+// by James Hammons
 // (C) 2005 Underground Software
 //
-// JLH = James L. Hammons <jlhamm@acm.org>
+// JLH = James Hammons <jlhamm@acm.org>
 //
 // WHO  WHEN        WHAT
 // ---  ----------  ------------------------------------------------------------
index bcee383056da9e408d21f53aa363e0db131a504b..75f9ba2bae9779c3493752f28867905f59fd0d8d 100755 (executable)
@@ -1,10 +1,10 @@
 //
 // Sound Interface
 //
-// by James L. Hammons
+// by James Hammons
 // (C) 2005 Underground Software
 //
-// JLH = James L. Hammons <jlhamm@acm.org>
+// JLH = James Hammons <jlhamm@acm.org>
 //
 // WHO  WHEN        WHAT
 // ---  ----------  ------------------------------------------------------------
index e0ea978f4054df4d4b5650080b024482c7bb1456..17a3dc0c837272607c7bd91225357bdd5a6f81cd 100755 (executable)
@@ -1,7 +1,7 @@
 //
 // SOUND.H
 //
-// by James L. Hammons
+// by James Hammons
 // (C) 2004 Underground Software
 //
 
index 0ddf25143011ef8bc8158b1ac13180bb105c9c1f..1eec87491138bee39f4edb0f2fe0502be8779440 100755 (executable)
@@ -1,10 +1,10 @@
 //
 // Virtual 65C02 Emulator v1.0
 //
-// by James L. Hammons
+// by James Hammons
 // (c) 2005 Underground Software
 //
-// JLH = James L. Hammons <jlhamm@acm.org>
+// JLH = James Hammons <jlhamm@acm.org>
 //
 // WHO  WHEN        WHAT
 // ---  ----------  ------------------------------------------------------------
@@ -1260,6 +1260,16 @@ BRK      Implied         BRK                     00      1       7
 
 static void Op00(void)                                                 // BRK
 {
+//#ifdef __DEBUG__
+#if 1
+WriteLog("\n*** BRK ***\n\n");
+WriteLog(" [PC=%04X, SP=%04X, CC=%s%s.%s%s%s%s%s, A=%02X, X=%02X, Y=%02X]\n",
+       regs.pc, 0x0100 + regs.sp,
+       (regs.cc & FLAG_N ? "N" : "-"), (regs.cc & FLAG_V ? "V" : "-"),
+       (regs.cc & FLAG_B ? "B" : "-"), (regs.cc & FLAG_D ? "D" : "-"),
+       (regs.cc & FLAG_I ? "I" : "-"), (regs.cc & FLAG_Z ? "Z" : "-"),
+       (regs.cc & FLAG_C ? "C" : "-"), regs.a, regs.x, regs.y);
+#endif
        regs.cc |= FLAG_B;                                                      // Set B
        regs.pc++;                                                                      // RTI comes back to the instruction one byte after the BRK
        regs.WrMem(0x0100 + regs.sp--, regs.pc >> 8);   // Save PC and CC
@@ -2892,7 +2902,13 @@ if (regs.pc == 0x444E)
        dumpDis = false;
 }//*/
 #endif
-/*if (regs.pc == 0xBF4C)
+/*if (regs.pc >= 0xC600 && regs.pc <=0xC6FF)
+{
+       dumpDis = true;
+}
+else
+       dumpDis = false;//*/
+/*if (regs.pc == 0xE039)
 {
        dumpDis = true;
 }//*/
index 2a189c82c3a11e4176e738df1a064b5e5922ed64..9b71d46260c9d8119d83b7b5e137cfe9a27b2b0f 100755 (executable)
@@ -1,7 +1,7 @@
 //
 // Virtual 65C02 Header file
 //
-// by James L. Hammons
+// by James Hammons
 // (c) 2005 Underground Software
 //
 
index fbd2262181b6762ecb201d6c66b16640eaf420f0..58a630a98c7e728acf247df5c1a871424b9d036a 100755 (executable)
@@ -1,9 +1,9 @@
 //
 // VIDEO.CPP: SDL/local hardware specific video routines
 //
-// by James L. Hammons
+// by James Hammons
 //
-// JLH = James L. Hammons <jlhamm@acm.org>
+// JLH = James Hammons <jlhamm@acm.org>
 //
 // WHO  WHEN        WHAT
 // ---  ----------  ------------------------------------------------------------