--- /dev/null
+CSRCS = devtty.c devices.c main.c
+CDSRCS = discard.c
+DSRCS = ../dev/devide.c ../dev/blkdev.c ../dev/devfdc765.c ../dev/devsd.c
+DDSRCS = ../dev/devide_discard.c ../dev/mbr.c ../dev/devsd_discard.c
+DZSRCS = ../dev/zx/divide.c ../dev/zx/zxkeyboard.c ../dev/zx/devinput.c ../dev/zx/zxmmc.c
+DDZSRCS =
+ASRCS = crt0.s plus3.s zxvideo.s fdc765.s
+ASRCS += tricks.s commonmem.s
+
+COBJS = $(CSRCS:.c=.rel)
+CDOBJS = $(CDSRCS:.c=.rel)
+AOBJS = $(ASRCS:.s=.rel)
+DOBJS = $(patsubst ../dev/%.c,%.rel, $(DSRCS))
+DDOBJS = $(patsubst ../dev/%.c,%.rel, $(DDSRCS))
+DZOBJS = $(patsubst ../dev/zx/%.c,%.rel, $(DZSRCS))
+DDZOBJS = $(patsubst ../dev/zx/%.c,%.rel, $(DDZSRCS))
+OBJS = $(COBJS) $(CDOBJS) $(AOBJS) $(DOBJS) $(DDOBJS) $(DZOBJS) $(DDZOBJS)
+
+CROSS_CCOPTS += -I../dev/ -I../dev/zx/
+
+CROSS_CC_SEG3 = --codeseg CODE3
+
+all: $(OBJS)
+
+$(COBJS): %.rel: %.c
+ $(CROSS_CC) $(CROSS_CCOPTS) $(CROSS_CC_SEG3) -c $<
+
+$(CDOBJS): %.rel: %.c
+ $(CROSS_CC) $(CROSS_CCOPTS) $(CROSS_CC_SEGDISC) -c $<
+
+$(DOBJS): %.rel: ../dev/%.c
+ $(CROSS_CC) $(CROSS_CCOPTS) $(CROSS_CC_SEG3) -c $<
+
+$(DDOBJS): %.rel: ../dev/%.c
+ $(CROSS_CC) $(CROSS_CCOPTS) $(CROSS_CC_SEGDISC) -c $<
+
+$(DZOBJS): %.rel: ../dev/zx/%.c
+ $(CROSS_CC) $(CROSS_CCOPTS) $(CROSS_CC_SEG3) -c $<
+
+$(DDZOBJS): %.rel: ../dev/zx/%.c
+ $(CROSS_CC) $(CROSS_CCOPTS) $(CROSS_CC_SEGDISC) -c $<
+
+$(AOBJS): %.rel: %.s
+ $(CROSS_AS) $(ASOPTS) $<
+
+clean:
+ rm -f $(OBJS) *.lst *.asm *.sym *.rst *.rel core *~
+ rm -f loader.tmp loader.ihx loader.bin padding.bin disk.raw
+ rm -rf fuzix.dsk
+
+image:
+ sdasz80 -o loader.s
+ sdldz80 -i loader.rel
+ makebin -s 65536 loader.ihx loader.tmp
+ # Extract the loader itself
+ dd if=loader.tmp bs=512 skip=127 | ../tools/plus3boot >loader.bin
+ # Padding to fill the virtual disk
+ dd if=/dev/zero of=padding.bin bs=512 count=360
+ # Make a disk image to work from
+ cat loader.bin ../fuzix.bin padding.bin >disk.raw
+ # And generate a 40 track plus3 disk from it
+ ../tools/raw2dsk disk.raw fuzix.dsk
\ No newline at end of file
;
start:
di
+ ld bc,#0x7ffd
+ ld a,#0x08 ; screen on 7
+ out (c),a
;
; The boot loader turns the motor off, so turn it back on but wait
; a bit otherwise some 3.5" disks won't boot right
;
+
motor_on:
+ ; Wait for the motor to catch back up - clear the screen !
+ ld bc,#0x7ffd
+ ld a,#0x08 ; screen on 7
+ out (c),a
+ ld hl,#0x4000
+ ld de,#0x4001
+ ld bc,#0x6911
+ xor a
+ ldir
+
+
ld bc,#0x1ffd
ld a,#0x0D ; special paging 4/5/6/3. motor on
out (c),a
-
- ; Wait for the motor to catch back up
- ld bc,#0x3548
-waitm:
- dec bc
- ld a,b
- or c
- jr nz, waitm
;
; Ok now we can try and load stuff
; 9 sectors per track and we need to start from 0/2
ld c,#0xfd ; low bits of I/O
ld d,#0x20 ; mask
- jp read_wait
+ jp read_begin
read_loop:
ld b,#0x3f
ini
+read_begin:
ld b,#0x2f
read_wait:
in a,(c)