Refactor the Amstrad NC directory so that the NC100 build stuff is in its own
authorDavid Given <dg@cowlark.com>
Sat, 21 Apr 2018 11:02:38 +0000 (13:02 +0200)
committerDavid Given <dg@cowlark.com>
Sat, 21 Apr 2018 11:02:38 +0000 (13:02 +0200)
subdirectory --- this is to allow a hypothetical NC200 port to have different
build scripts but share as much code as possible.

This changes the platform name from nc100 to amstradnc/nc100.

28 files changed:
Kernel/platform-amstradnc/README [moved from Kernel/platform-nc100/README with 79% similarity]
Kernel/platform-amstradnc/README.NC200 [moved from Kernel/platform-nc100/README.NC200 with 100% similarity]
Kernel/platform-amstradnc/bootblock.s [moved from Kernel/platform-nc100/bootblock.s with 100% similarity]
Kernel/platform-amstradnc/commonmem.s [moved from Kernel/platform-nc100/commonmem.s with 100% similarity]
Kernel/platform-amstradnc/crt0.s [moved from Kernel/platform-nc100/crt0.s with 100% similarity]
Kernel/platform-amstradnc/devaudio.c [moved from Kernel/platform-nc100/devaudio.c with 100% similarity]
Kernel/platform-amstradnc/devgfx.c [moved from Kernel/platform-nc100/devgfx.c with 100% similarity]
Kernel/platform-amstradnc/devgfx.h [moved from Kernel/platform-nc100/devgfx.h with 100% similarity]
Kernel/platform-amstradnc/device.h [moved from Kernel/platform-nc100/device.h with 100% similarity]
Kernel/platform-amstradnc/devices.c [moved from Kernel/platform-nc100/devices.c with 100% similarity]
Kernel/platform-amstradnc/devlpr.c [moved from Kernel/platform-nc100/devlpr.c with 100% similarity]
Kernel/platform-amstradnc/devlpr.h [moved from Kernel/platform-nc100/devlpr.h with 100% similarity]
Kernel/platform-amstradnc/devrd.c [moved from Kernel/platform-nc100/devrd.c with 100% similarity]
Kernel/platform-amstradnc/devrd.h [moved from Kernel/platform-nc100/devrd.h with 100% similarity]
Kernel/platform-amstradnc/devtty.c [moved from Kernel/platform-nc100/devtty.c with 100% similarity]
Kernel/platform-amstradnc/devtty.h [moved from Kernel/platform-nc100/devtty.h with 100% similarity]
Kernel/platform-amstradnc/main.c [moved from Kernel/platform-nc100/main.c with 100% similarity]
Kernel/platform-amstradnc/nc100.def [moved from Kernel/platform-nc100/nc100.def with 100% similarity]
Kernel/platform-amstradnc/nc100.s [moved from Kernel/platform-nc100/nc100.s with 99% similarity]
Kernel/platform-amstradnc/nc100/Makefile [new file with mode: 0644]
Kernel/platform-amstradnc/nc100/config.h [moved from Kernel/platform-nc100/config.h with 100% similarity]
Kernel/platform-amstradnc/nc100/fuzix.lnk [moved from Kernel/platform-nc100/fuzix.lnk with 54% similarity]
Kernel/platform-amstradnc/nc100/kernel.def [moved from Kernel/platform-nc100/kernel.def with 100% similarity]
Kernel/platform-amstradnc/nc100/nc100emu.s [moved from Kernel/platform-nc100/nc100emu.s with 96% similarity]
Kernel/platform-amstradnc/nc100/rules.mk [new file with mode: 0644]
Kernel/platform-amstradnc/nc100/target.mk [moved from Kernel/platform-nc100/target.mk with 100% similarity]
Kernel/platform-amstradnc/tricks.s [moved from Kernel/platform-nc100/tricks.s with 98% similarity]
Kernel/platform-nc100/Makefile [deleted file]

similarity index 79%
rename from Kernel/platform-nc100/README
rename to Kernel/platform-amstradnc/README
index 09fcfe0..08709a8 100644 (file)
@@ -1,3 +1,10 @@
+Support for the Amstrad NC series of Z80 portable computers.
+
+Use:
+
+    TARGET=amstradnc/nc100 for the NC100
+
+
 Memory map. All off PCMCIA root, 16K arbitrary banks
 
 No CP/M emulation (due to NMI)
@@ -39,8 +46,8 @@ then
 dd if=myfs of=mycard.img bs=16384 seek=20 conv=notrunc
 
 
-To boot from NC100emu use nc100emu.s. Compile it with sdas80 and use the
-resulting nc100.cim as the bootscript for the emulator.
+To boot from NC100emu use nc100emu.s. Compile it with the makefile and use the
+resulting nc100.cim as the boot image for the emulator.
 
 TODO
 
similarity index 99%
rename from Kernel/platform-nc100/nc100.s
rename to Kernel/platform-amstradnc/nc100.s
index 98b4c1f..15a89f9 100644 (file)
@@ -55,8 +55,8 @@
             .globl outstring
             .globl outstringhex
 
-            .include "kernel.def"
-            .include "../kernel.def"
+            .include "platform/kernel.def"
+            .include "../../kernel.def" ; Kernel
            .include "nc100.def"
 
 ; -----------------------------------------------------------------------------
diff --git a/Kernel/platform-amstradnc/nc100/Makefile b/Kernel/platform-amstradnc/nc100/Makefile
new file mode 100644 (file)
index 0000000..67dc37e
--- /dev/null
@@ -0,0 +1,40 @@
+
+CSRCS = ../devlpr.c ../devtty.c ../devrd.c ../devaudio.c ../devgfx.c
+CSRCS += ../devices.c ../main.c
+
+ASRCS = ../nc100.s ../crt0.s
+ASRCS += ../tricks.s ../commonmem.s
+
+COBJS = $(CSRCS:.c=.rel)
+AOBJS = $(ASRCS:.s=.rel)
+OBJS  = $(COBJS) $(AOBJS)
+
+JUNK = $(CSRCS:.c=.lst) $(CSRCS:.c=.asm) $(CSRCS:.c=.sym) $(ASRCS:.s=.lst) $(ASRCS:.s=.sym) $(CSRCS:.c=.rst) $(ASRCS:.s=.rst)
+
+all:   $(OBJS)
+
+$(COBJS): %.rel: %.c
+       $(CROSS_CC) $(CROSS_CCOPTS) -o $(dir $@) -c $<
+
+$(AOBJS): %.rel: %.s
+       $(CROSS_AS) $(ASOPTS) $<
+
+clean:
+       rm -f $(OBJS) $(JUNK)  core *~ 
+
+bootblock.img: ../bootblock.s
+       sdasz80 -fflopzws bootblock.rel ../bootblock.s
+       sdldz80 -nwmx -b BOOTBLOCK=0 -i bootblock.ihx bootblock.rel
+       srec_cat -disable-sequence-warning \
+                bootblock.ihx -intel \
+                -output bootblock.img -binary
+
+image: bootblock.img
+       dd if=bootblock.img of=../../fuzix.bin bs=1 conv=notrunc
+
+nc100emu.bin: nc100emu.s
+       sdasz80 -fflopzws nc100emu.rel $<
+       sdldz80 -nwmx -b _CODE=0x100 -i nc100emu.ihx nc100emu.rel
+       srec_cat -disable-sequence-warning \
+               nc100emu.ihx -intel -offset -0x100 \
+               -output nc100emu.bin -binary
similarity index 54%
rename from Kernel/platform-nc100/fuzix.lnk
rename to Kernel/platform-amstradnc/nc100/fuzix.lnk
index 5a1d6ae..c6f21f7 100644 (file)
@@ -4,18 +4,18 @@
 -b _COMMONMEM=0xF000
 -b _DISCARD=0xE000
 -l z80
-platform-nc100/crt0.rel
-platform-nc100/commonmem.rel
-platform-nc100/nc100.rel
+platform-amstradnc/crt0.rel
+platform-amstradnc/commonmem.rel
+platform-amstradnc/nc100.rel
 start.rel
 version.rel
 lowlevel-z80.rel
-platform-nc100/tricks.rel
-platform-nc100/main.rel
+platform-amstradnc/tricks.rel
+platform-amstradnc/main.rel
 timer.rel
 kdata.rel
-platform-nc100/devrd.rel
-platform-nc100/devices.rel
+platform-amstradnc/devrd.rel
+platform-amstradnc/devices.rel
 devio.rel
 filesys.rel
 process.rel
@@ -35,9 +35,9 @@ devsys.rel
 audio.rel
 usermem.rel
 usermem_std-z80.rel
-platform-nc100/devlpr.rel
-platform-nc100/devtty.rel
-platform-nc100/devaudio.rel
-platform-nc100/devgfx.rel
+platform-amstradnc/devlpr.rel
+platform-amstradnc/devtty.rel
+platform-amstradnc/devaudio.rel
+platform-amstradnc/devgfx.rel
 font4x6.rel
 -e
similarity index 96%
rename from Kernel/platform-nc100/nc100emu.s
rename to Kernel/platform-amstradnc/nc100/nc100emu.s
index 652ab3f..0d20433 100644 (file)
@@ -3,11 +3,10 @@
 ;
 
                .area ASEG(ABS)
-               .org 0x0
+               .org 0x100
 ;
 ;      Switch to the PCMCIA card as if run by FN-x
 ;
-               .ds #0x100
 start:         di
                ld a, #0x43             ; screen RAM
                out (0x13),a
diff --git a/Kernel/platform-amstradnc/nc100/rules.mk b/Kernel/platform-amstradnc/nc100/rules.mk
new file mode 100644 (file)
index 0000000..f2eefe5
--- /dev/null
@@ -0,0 +1,3 @@
+CROSS_CCOPTS += -I$(ROOT_DIR)/platform-amstradnc
+ASOPTS += -I$(ROOT_DIR)
+
similarity index 98%
rename from Kernel/platform-nc100/tricks.s
rename to Kernel/platform-amstradnc/tricks.s
index ff1ba23..f1f8003 100644 (file)
@@ -22,8 +22,8 @@
         ; imported debug symbols
         .globl outstring, outde, outhl, outbc, outnewline, outchar, outcharhex
 
-        .include "kernel.def"
-        .include "../kernel.def"
+        .include "platform/kernel.def"
+        .include "../../kernel.def" ; Kernel
 
         .area _COMMONMEM
 
diff --git a/Kernel/platform-nc100/Makefile b/Kernel/platform-nc100/Makefile
deleted file mode 100644 (file)
index f897aa8..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-
-CSRCS = devlpr.c devtty.c devrd.c devaudio.c devgfx.c
-CSRCS += devices.c main.c
-
-ASRCS = nc100.s crt0.s
-ASRCS += tricks.s commonmem.s
-
-COBJS = $(CSRCS:.c=.rel)
-AOBJS = $(ASRCS:.s=.rel)
-OBJS  = $(COBJS) $(AOBJS)
-
-JUNK = $(CSRCS:.c=.lst) $(CSRCS:.c=.asm) $(CSRCS:.c=.sym) $(ASRCS:.s=.lst) $(ASRCS:.s=.sym) $(CSRCS:.c=.rst) $(ASRCS:.s=.rst)
-
-all:   $(OBJS)
-
-$(COBJS): %.rel: %.c
-       $(CROSS_CC) $(CROSS_CCOPTS) -c $<
-
-$(AOBJS): %.rel: %.s
-       $(CROSS_AS) $(ASOPTS) $<
-
-clean:
-       rm -f $(OBJS) $(JUNK)  core *~ 
-
-bootblock.img: bootblock.s
-       sdasz80 -fflopzws bootblock.rel bootblock.s
-       sdldz80 -nwmx -b BOOTBLOCK=0 -i bootblock.ihx bootblock.rel
-       srec_cat -disable-sequence-warning \
-                bootblock.ihx -intel \
-                -output bootblock.img -binary
-
-image:
-       dd if=bootblock.img of=../fuzix.bin bs=1 conv=notrunc