From: Shamus Hammons Date: Sat, 28 Sep 2013 23:15:54 +0000 (-0500) Subject: Created new MMU based code for R/W handling. Should be much faster now. X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a8c0287e81850225d835cd68393053b0b26b2ab;p=apple2 Created new MMU based code for R/W handling. Should be much faster now. --- diff --git a/Makefile b/Makefile index ba62de7..d1f78b5 100755 --- 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 \ diff --git a/apple2.cfg b/apple2.cfg index faf073e..c010f99 100755 --- a/apple2.cfg +++ b/apple2.cfg @@ -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 diff --git a/src/apple2.cpp b/src/apple2.cpp index e1cde17..f886a7d 100755 --- a/src/apple2.cpp +++ b/src/apple2.cpp @@ -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 +// JLH = James Hammons // // 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" @@ -67,25 +69,25 @@ 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 & diff --git a/src/apple2.h b/src/apple2.h index 7696c5a..98b31e1 100755 --- a/src/apple2.h +++ b/src/apple2.h @@ -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; diff --git a/src/applevideo.cpp b/src/applevideo.cpp index 807253b..d903e49 100755 --- a/src/applevideo.cpp +++ b/src/applevideo.cpp @@ -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 +// JLH = James Hammons // // WHO WHEN WHAT // --- ---------- ------------------------------------------------------------ diff --git a/src/charset.h b/src/charset.h index 1f58e30..0b32c69 100755 --- a/src/charset.h +++ b/src/charset.h @@ -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 diff --git a/src/dis65c02.cpp b/src/dis65c02.cpp index d275f38..2721d05 100755 --- a/src/dis65c02.cpp +++ b/src/dis65c02.cpp @@ -1,7 +1,7 @@ // // 65C02 disassembler // -// by James L. Hammons +// by James Hammons // (c) 2005 Underground Software // diff --git a/src/dis65c02.h b/src/dis65c02.h index ab6ba2d..fc1e4ac 100755 --- a/src/dis65c02.h +++ b/src/dis65c02.h @@ -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 index 0000000..24bf5b7 --- /dev/null +++ b/src/firmware.cpp @@ -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,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x01, 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, 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78, 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,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, 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 +}; diff --git a/src/firmware.h b/src/firmware.h old mode 100755 new mode 100644 index 63cc197..0b0e640 --- a/src/firmware.h +++ b/src/firmware.h @@ -1,237 +1,23 @@ -// -// 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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, 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 +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,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x48, 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, 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5, 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, 0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00, 0x00, 0x00 -}; diff --git a/src/floppy.cpp b/src/floppy.cpp index b014af0..b4e479f 100755 --- a/src/floppy.cpp +++ b/src/floppy.cpp @@ -1,10 +1,10 @@ // // Apple 2 floppy disk support // -// by James L. Hammons +// by James Hammons // (c) 2005 Underground Software // -// JLH = James L. Hammons +// JLH = James Hammons // // WHO WHEN WHAT // --- ---------- ------------------------------------------------------------ diff --git a/src/font14pt.h b/src/font14pt.h index ab72f3f..a84dd54 100755 --- a/src/font14pt.h +++ b/src/font14pt.h @@ -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[] = { diff --git a/src/gui/button.cpp b/src/gui/button.cpp index e5588ef..8d69fbd 100755 --- a/src/gui/button.cpp +++ b/src/gui/button.cpp @@ -2,9 +2,9 @@ // BUTTON.CPP // // Graphical User Interface button class -// by James L. Hammons +// by James Hammons // -// JLH = James L. Hammons +// JLH = James Hammons // // WHO WHEN WHAT // --- ---------- ------------------------------------------------------------ diff --git a/src/gui/diskwindow.cpp b/src/gui/diskwindow.cpp index 32973ce..1e91a6f 100644 --- a/src/gui/diskwindow.cpp +++ b/src/gui/diskwindow.cpp @@ -2,9 +2,9 @@ // DISKWINDOW.CPP // // Graphical User Interface disk window class -// by James L. Hammons +// by James Hammons // -// JLH = James L. Hammons +// JLH = James Hammons // // WHO WHEN WHAT // --- ---------- ------------------------------------------------------------ diff --git a/src/gui/draggablewindow.cpp b/src/gui/draggablewindow.cpp index 5b25649..1d9b3da 100755 --- a/src/gui/draggablewindow.cpp +++ b/src/gui/draggablewindow.cpp @@ -2,9 +2,9 @@ // DRAGGABLEWINDOW.CPP // // Graphical User Interface draggable window class -// by James L. Hammons +// by James Hammons // -// JLH = James L. Hammons +// JLH = James Hammons // // WHO WHEN WHAT // --- ---------- ------------------------------------------------------------ diff --git a/src/gui/draggablewindow2.cpp b/src/gui/draggablewindow2.cpp index a34d3d0..4b385fb 100755 --- a/src/gui/draggablewindow2.cpp +++ b/src/gui/draggablewindow2.cpp @@ -2,9 +2,9 @@ // DRAGGABLEWINDOW2.CPP // // Graphical User Interface draggable window class -// by James L. Hammons +// by James Hammons // -// JLH = James L. Hammons +// JLH = James Hammons // // WHO WHEN WHAT // --- ---------- ------------------------------------------------------------ diff --git a/src/gui/element.cpp b/src/gui/element.cpp index 5598f61..3adb4b3 100755 --- a/src/gui/element.cpp +++ b/src/gui/element.cpp @@ -2,9 +2,9 @@ // ELEMENT.CPP // // Graphical User Interface base class -// by James L. Hammons +// by James Hammons // -// JLH = James L. Hammons +// JLH = James Hammons // // WHO WHEN WHAT // --- ---------- ------------------------------------------------------------ diff --git a/src/gui/font1.h b/src/gui/font1.h index 3f4f75d..624047f 100755 --- a/src/gui/font1.h +++ b/src/gui/font1.h @@ -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] = { diff --git a/src/gui/font14pt.h b/src/gui/font14pt.h index 4a5b56e..7b97b0d 100755 --- a/src/gui/font14pt.h +++ b/src/gui/font14pt.h @@ -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[] = { diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 3b6084c..b2a3b59 100755 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -2,9 +2,9 @@ // GUI.CPP // // Graphical User Interface support -// by James L. Hammons +// by James Hammons // -// JLH = James L. Hammons +// JLH = James Hammons // // WHO WHEN WHAT // --- ---------- ------------------------------------------------------------ diff --git a/src/gui/guimisc.cpp b/src/gui/guimisc.cpp index 62358f8..8e623ac 100755 --- a/src/gui/guimisc.cpp +++ b/src/gui/guimisc.cpp @@ -2,9 +2,9 @@ // GUIMISC.CPP // // Graphical User Interface support functions -// by James L. Hammons +// by James Hammons // -// JLH = James L. Hammons +// JLH = James Hammons // // WHO WHEN WHAT // --- ---------- ------------------------------------------------------------ diff --git a/src/gui/menu.cpp b/src/gui/menu.cpp index 4c30c37..7401837 100755 --- a/src/gui/menu.cpp +++ b/src/gui/menu.cpp @@ -2,9 +2,9 @@ // MENU.CPP // // Graphical User Interface menu support -// by James L. Hammons +// by James Hammons // -// JLH = James L. Hammons +// JLH = James Hammons // // WHO WHEN WHAT // --- ---------- ------------------------------------------------------------ diff --git a/src/gui/text.cpp b/src/gui/text.cpp index 0c7ea6d..34e0140 100644 --- a/src/gui/text.cpp +++ b/src/gui/text.cpp @@ -1,7 +1,7 @@ // // Static text class // -// by James L. Hammons +// by James Hammons // #include "text.h" diff --git a/src/gui/text.h b/src/gui/text.h index ff7e8aa..afbcbf0 100644 --- a/src/gui/text.h +++ b/src/gui/text.h @@ -1,7 +1,7 @@ // // Static text class // -// by James L. Hammons +// by James Hammons // #ifndef __TEXT_H__ diff --git a/src/gui/textedit.cpp b/src/gui/textedit.cpp index 3803296..b671103 100755 --- a/src/gui/textedit.cpp +++ b/src/gui/textedit.cpp @@ -2,9 +2,9 @@ // TEXTEDIT.CPP // // Graphical User Interface button class -// by James L. Hammons +// by James Hammons // -// JLH = James L. Hammons +// JLH = James Hammons // // WHO WHEN WHAT // --- ---------- ------------------------------------------------------------ diff --git a/src/gui/window.cpp b/src/gui/window.cpp index 48e3db6..421e32a 100755 --- a/src/gui/window.cpp +++ b/src/gui/window.cpp @@ -2,9 +2,9 @@ // WINDOW.CPP // // Graphical User Interface window class -// by James L. Hammons +// by James Hammons // -// JLH = James L. Hammons +// JLH = James Hammons // // WHO WHEN WHAT // --- ---------- ------------------------------------------------------------ diff --git a/src/log.cpp b/src/log.cpp index 55d99b7..6994cc5 100755 --- a/src/log.cpp +++ b/src/log.cpp @@ -1,10 +1,10 @@ // // Log handler // -// by James L. Hammons +// by James Hammons // (C) 2006 Underground Software // -// JLH = James L. Hammons +// JLH = James Hammons // // WHO WHEN WHAT // --- ---------- ------------------------------------------------------------ diff --git a/src/mmu.cpp b/src/mmu.cpp new file mode 100644 index 0000000..045dad5 --- /dev/null +++ b/src/mmu.cpp @@ -0,0 +1,863 @@ +// +// mmu.cpp: Memory management +// +// by James Hammons +// (C) 2013 Underground Software +// +// JLH = James Hammons +// +// 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 index 0000000..c6c8448 --- /dev/null +++ b/src/mmu.h @@ -0,0 +1,11 @@ +#ifndef __MMU_H__ +#define __MMU_H__ + +#include + +void SetupAddressMap(void); +uint8_t AppleReadMem(uint16_t); +void AppleWriteMem(uint16_t, uint8_t); + +#endif // __MMU_H__ + diff --git a/src/settings.cpp b/src/settings.cpp index be7bd3f..37f8767 100755 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -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 +// JLH = James Hammons // // WHO WHEN WHAT // --- ---------- ------------------------------------------------------------ diff --git a/src/sound.cpp b/src/sound.cpp index bcee383..75f9ba2 100755 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -1,10 +1,10 @@ // // Sound Interface // -// by James L. Hammons +// by James Hammons // (C) 2005 Underground Software // -// JLH = James L. Hammons +// JLH = James Hammons // // WHO WHEN WHAT // --- ---------- ------------------------------------------------------------ diff --git a/src/sound.h b/src/sound.h index e0ea978..17a3dc0 100755 --- a/src/sound.h +++ b/src/sound.h @@ -1,7 +1,7 @@ // // SOUND.H // -// by James L. Hammons +// by James Hammons // (C) 2004 Underground Software // diff --git a/src/v65c02.cpp b/src/v65c02.cpp index 0ddf251..1eec874 100755 --- a/src/v65c02.cpp +++ b/src/v65c02.cpp @@ -1,10 +1,10 @@ // // Virtual 65C02 Emulator v1.0 // -// by James L. Hammons +// by James Hammons // (c) 2005 Underground Software // -// JLH = James L. Hammons +// JLH = James Hammons // // 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; }//*/ diff --git a/src/v65c02.h b/src/v65c02.h index 2a189c8..9b71d46 100755 --- a/src/v65c02.h +++ b/src/v65c02.h @@ -1,7 +1,7 @@ // // Virtual 65C02 Header file // -// by James L. Hammons +// by James Hammons // (c) 2005 Underground Software // diff --git a/src/video.cpp b/src/video.cpp index fbd2262..58a630a 100755 --- a/src/video.cpp +++ b/src/video.cpp @@ -1,9 +1,9 @@ // // VIDEO.CPP: SDL/local hardware specific video routines // -// by James L. Hammons +// by James Hammons // -// JLH = James L. Hammons +// JLH = James Hammons // // WHO WHEN WHAT // --- ---------- ------------------------------------------------------------