From 99a3d7bc66cad04b07dd6aea386efa449c349b5f Mon Sep 17 00:00:00 2001 From: Tormod Volden Date: Sat, 28 Jul 2018 12:36:36 +0200 Subject: [PATCH] dragon-nx32: Update README Also remove XRoar patch which went upstream. Signed-off-by: Tormod Volden --- .../0001-XRoar-emulate-nx32.patch | 92 ------------------- Kernel/platform-dragon-nx32/README | 59 +++++++----- 2 files changed, 34 insertions(+), 117 deletions(-) delete mode 100644 Kernel/platform-dragon-nx32/0001-XRoar-emulate-nx32.patch diff --git a/Kernel/platform-dragon-nx32/0001-XRoar-emulate-nx32.patch b/Kernel/platform-dragon-nx32/0001-XRoar-emulate-nx32.patch deleted file mode 100644 index e59c2c98..00000000 --- a/Kernel/platform-dragon-nx32/0001-XRoar-emulate-nx32.patch +++ /dev/null @@ -1,92 +0,0 @@ -From a62ae62d94dd5d1e015fc6acd978b2c24d42d442 Mon Sep 17 00:00:00 2001 -From: Tormod Volden -Date: Sat, 10 Jan 2015 12:40:36 +0100 -Subject: [PATCH] XRoar: Emulate Tormod's nx32 memory cartridge for Dragon - -* This patch is for the XRoar emulator at http://www.6809.org.uk/xroar/ * -* It is based off the 0.33.2 release. * - -EXTBANKS is the number of 32KB banks and can be 1, 4 or 16. - -Writing a number to 0xFFBF activates the corresponding bank, -available at 0x8000-0xFFEF. Writing to 0xFFBE deactivates the -cartridge, and makes the internal ROM available again. - -The cartridge is only activated in SAM map type 0 (it keeps -track of it by "listening" on 0xFFDE/F). - -Note that the cartridge "firmware" is subject to change. - -Signed-off-by: Tormod Volden ---- - src/machine.c | 33 +++++++++++++++++++++++++++++++++ - 1 file changed, 33 insertions(+) - -diff --git a/src/machine.c b/src/machine.c -index 56db6e0..80da258 100644 ---- a/src/machine.c -+++ b/src/machine.c -@@ -60,6 +60,13 @@ - #include "xconfig.h" - #include "xroar.h" - -+/* number of 32KB banks in external memory cartridge: 1, 4 or 16 */ -+#define EXTBANKS 4 -+static uint8_t extmem[0x8000 * EXTBANKS]; -+static _Bool extmem_map; /* external memory mapped in or not */ -+static _Bool extmem_ty; /* tracks SAM ty register */ -+static uint8_t extmem_bank; /* which bank */ -+ - unsigned int machine_ram_size = 0x10000; /* RAM in bytes, up to 64K */ - uint8_t machine_ram[0x10000]; - static uint8_t *machine_rom; -@@ -943,6 +950,8 @@ void machine_reset(_Bool hard) { - } - if (hard) { - initialise_ram(); -+ extmem_map = 0; -+ extmem_ty = 0; - } - mc6821_reset(PIA0); - mc6821_reset(PIA1); -@@ -1057,6 +1066,13 @@ static uint8_t read_byte(unsigned A) { - // produce a different "null" result on his 16K CoCo - if (SAM0->RAS) - CPU0->D = 0xff; -+ -+ /* external memory cartridge */ -+ if (A < 0xff00 && (A > 0xbfff || (!extmem_ty && extmem_map && A > 0x7fff))) { -+ CPU0->D = extmem[0x8000 * extmem_bank + (A & 0x7fff)]; -+ SAM0->S = 8; /* decoder disabled */ -+ } -+ - switch (SAM0->S) { - case 0: - if (SAM0->RAS) { -@@ -1120,6 +1136,23 @@ static uint8_t read_byte(unsigned A) { - } - - static uint8_t write_byte(unsigned A) { -+ -+ /* external memory cartridge */ -+ if ((A & ~1) == 0xffde) { -+ extmem_ty = A & 1; -+ LOG_PRINT("Switching to SAM map type %d\n", extmem_ty); -+ } else if ((A & ~1) == 0xffbe) { -+ extmem_map = A & 1; -+ extmem_bank = CPU0->D & (EXTBANKS - 1); -+ if (extmem_map) -+ LOG_DEBUG(3, "Switching to bank %d\n", extmem_bank); -+ else -+ LOG_DEBUG(3, "Switching off bank %d\n", extmem_bank); -+ } else if (A < 0xff00 && (A > 0xbfff || (!extmem_ty && extmem_map && A > 0x7fff))) { -+ extmem[0x8000 * extmem_bank + (A & 0x7fff)] = CPU0->D; -+ SAM0->S = 8; /* decoder disabled */ -+ } -+ - if ((SAM0->S & 4) || unexpanded_dragon32) { - switch (SAM0->S) { - case 1: --- -1.9.1 - diff --git a/Kernel/platform-dragon-nx32/README b/Kernel/platform-dragon-nx32/README index 2b140dcc..b2678dab 100644 --- a/Kernel/platform-dragon-nx32/README +++ b/Kernel/platform-dragon-nx32/README @@ -4,36 +4,35 @@ dragon-nx32 Dragon (32 or 64) + external memory cartridge This port is for running FUZIX on real Dragons using an external -memory cartridge which is being prototyped. +memory cartridge (like Spinx-512 or MOOH). The cartridge can have from 2 to 256 banks of 32KB each (hence "nx32"). It will map the active bank at 0x8000-0xFEFF, using the EXMEM (SLENB) signal to -hide the internal ROMs. Writing the bank number to FFBF selects the +hide the internal ROM/RAM. Writing the bank number to FFBF selects the bank and activates the cartridge. Writing to FFBE deactivates the cartridge. It is only active if the SAM is in map type 0. The port reserves the internal RAM at 0-0x7FFF plus bank 0 for the kernel. -The port can use DriveWire to mount the root filesystem, and most userland -tools are working. +The port can use the cartridge's SD card or DriveWire to mount the root +filesystem, and most userland tools are working. -Swapping to disk has not been implemented yet. +Swapping to disk is supported over DriveWire (device 2049 = drive 1). Emulating in XRoar ================== -XRoar can be patched with the included 0001-XRoar-emulate-nx32.patch -to emulate this memory cartridge. +XRoar supports Spinx-512 and MOOH boards (including SD card emulation) +in the 0.35 development branch. Using DriveWire =============== For bootstrapping, the fuzix.bin DECB binary must be loaded into -internal RAM and cartridge bank 0. This is currently done over -DriveWire, using a "DWLOAD" program tweaked for FUZIX. The changes -from stock DWLOAD are: +internal RAM and cartridge bank 0. For DriveWire this is done using +the "DWLOAD" program, with these changes from stock DWLOAD: - do not enable interrupts upon execution of the payload -- jmp instead of jsr so that stack is not used +- jmp instead of jsr so that stack location is not written to - default name of payload is "fuzix.bin" - activate cartridge memory when writing payload to RAM Additionally it is built to run from 0x600 so that FUZIX can @@ -42,7 +41,7 @@ be loaded anywhere from 0x800 and up. lwasm --pragma=condundefzero -r -b -odwfuz.bin dwload.asm -DFUZIX -DRAMORG=0x600 Or for an emulator with Becker port: lwasm --pragma=condundefzero -r -b -odwfuzb.bin dwload.asm -DFUZIX -DRAMORG=0x600 -DBECKER -For XRoar, just add -load dwfuzb.bin to its invocation, and on the Dragon: +For XRoar, just add "-load dwfuzb.bin" to its invocation, and on the Dragon: EXEC&H600 For an emulator with Becker port while using the DragonDOS cartridge @@ -64,28 +63,38 @@ a multiple of 256 bytes! Use for instance Kernel/tools/pad256 Quick build instructions ======================== +(save the below in a script file, run it with "clean" as needed) + # 1. Build the kernel: -make -C Kernel TARGET=dragon-nx32 +make -C Kernel TARGET=dragon-nx32 $@ -- or for using DriveWire in an emulator (i.e. XRoar): + # If building for the MOOH boards, append MOOH=1 to above make command. -make -C Kernel TARGET=dragon-nx32 BECKER=1 + # If using DriveWire in an emulator (i.e. XRoar), append BECKER=1 # 2. Build the libraries -make -C Library tools/syscall_6809 -make -C Library/libs -f Makefile.6809 +make -C Library tools/syscall_6809 $@ +make -C Library/libs -f Makefile.6809 $@ # 3. Build the utils and applications -make -C Applications/util -f Makefile.6809 TARGET=dragon-nx32 -make -C Applications/V7/cmd/sh -f Makefile.6809 TARGET=dragon-nx32 -make -C Applications/levee -f Makefile.6809 TARGET=dragon-nx32 -make -C Applications/cave -f Makefile.6809 TARGET=dragon-nx32 -make -C Applications/dw -f Makefile.6809 TARGET=dragon-nx32 +make -f Makefile.6809 TARGET=dragon-nx32 -C Applications/util $@ +make -f Makefile.6809 TARGET=dragon-nx32 -C Applications/games $@ +make -f Makefile.6809 TARGET=dragon-nx32 -C Applications/V7/games $@ +make -f Makefile.6809 TARGET=dragon-nx32 -C Applications/V7/cmd $@ +make -f Makefile.6809 TARGET=dragon-nx32 -C Applications/V7/cmd/sh $@ +make -f Makefile.6809 TARGET=dragon-nx32 -C Applications/levee $@ +make -f Makefile.6809 TARGET=dragon-nx32 -C Applications/cave $@ +make -f Makefile.6809 TARGET=dragon-nx32 -C Applications/dw $@ +make -f Makefile.6809 TARGET=dragon-nx32 -C Applications/MWC/cmd $@ +make -f Makefile.6809 TARGET=dragon-nx32 -C Applications/ue $@ +#make TARGET=dragon-nx32 -C Applications/cpp $@ +#make -f Makefile.6809 TARGET=dragon-nx32 -C Applications/as09 $@ +#make -f Makefile.6809 TARGET=dragon-nx32 -C Applications/ld09 $@ # 4. Build disk tools -make -C Standalone +make -C Standalone $@ # 5. Build boot disk image -cd Standalone/filesystem-src -./build-filesystem -X fuzix.dsk 256 65535 +[ -f "Applications/util/init" ] && +cd Standalone/filesystem-src && { ./build-filesystem-ng -y -v -X -f fuzix.dsk -g 256 16383 ; cd - ; } -- 2.34.1