qboot: sample tests

This commit is contained in:
Vince Weaver 2020-08-21 01:26:14 -04:00
parent acbf9cb7c2
commit 9ad4a8c17b
5 changed files with 91 additions and 27 deletions

19
qboot/80s.s Normal file
View File

@ -0,0 +1,19 @@
SET_GR = $C050
FULLGR = $C052
PAGE0 = $C054
HIRES = $C057
the_1980s:
forever:
bit SET_GR
bit FULLGR
bit PAGE0
bit HIRES
jmp forever
.align $100
.incbin "new_80s.hgr"

View File

@ -1,12 +1,20 @@
include ../Makefile.inc
DOS33 = ../dos33fs-utils/dos33
DOS33_RAW = ../dos33fs-utils/dos33_raw
all: boot.dsk
all: boot.dsk compare.dsk
boot.dsk: BOOT
compare.dsk: THE80S
cp empty.dsk compare.dsk
$(DOS33) -y compare.dsk BSAVE -a 0x1f00 THE80S
boot.dsk: BOOT THE80S
cp empty.dsk boot.dsk
$(DOS33_RAW) boot.dsk 0 0 BOOT
$(DOS33_RAW) boot.dsk 0 0 BOOT 0 1
$(DOS33_RAW) boot.dsk 0 2 BOOT 1 1
$(DOS33_RAW) boot.dsk 0 4 BOOT 2 1
$(DOS33_RAW) boot.dsk 3 0 THE80S 0 33
BOOT: boot_sector.o
ld65 -o BOOT boot_sector.o -C ../linker_scripts/apple2_800.inc
@ -14,6 +22,16 @@ BOOT: boot_sector.o
boot_sector.o: boot_sector.s stage2.s
ca65 -o boot_sector.o boot_sector.s -l boot_sector.lst
clean:
rm -f *~ *.o *.lst BOOT
THE80S: 80s.o
ld65 -o THE80S 80s.o -C ../linker_scripts/apple2_1f00.inc
80s.o: 80s.s new_80s.hgr
ca65 -o 80s.o 80s.s -l 80s.lst
new_80s.hgr: new_80s.png
../hgr-utils/png2hgr new_80s.png > new_80s.hgr
clean:
rm -f *~ *.o *.lst BOOT THE80S

View File

@ -1,11 +1,11 @@
; fast seek/multi-read
; copyright (c) Peter Ferrie 2015-16
sectors = $d1 ; user-defined
firsttrk = $d1 ; user-defined, first track to read
firstsec = $d1 ; user-defined, first sector to read
address = $d1 ; user-defined
entry = $d1d1 ; user-defined
sectors = 33 ; user-defined
firsttrk = 3 ; user-defined, first track to read
firstsec = 0 ; user-defined, first sector to read
address = $1f ; user-defined
entry = $1f00 ; user-defined
version = 1
;memory usage:
@ -13,13 +13,13 @@
grouped = $bd00
;106 bytes ($xx00-xx69) static table
preshift = code_end
zvalue = $fd ;only during init
znibble = $fe ;only during init
zmask = $ff ;only during init
zvalue = $fd ; only during init
znibble = $fe ; only during init
zmask = $ff ; only during init
; $26/$27 sector read location (ROM), scratch space (RWTS)
; $3D sector number
; $26/$27 sector read location (ROM)
; $3D sector number (ROM)
; at entry (at least on AppleWin) A=1, X=60, Y=0
@ -68,19 +68,32 @@ boot_entry:
rts
not_three:
; patch self modifying code for Q6L read
txa
ora #$8c ; slot to Q6L
; Q6L?
; 1000 1100
; if slot 6, after this A is $EC
patch_loop:
iny
ldx patchtbl-3, y
sta code_begin, x ;replace placeholders with Q6L
ldx patchtbl-3, Y
sta code_begin, X ; replace placeholders with Q6L
; BE02 = EC? lda c0ec
; so sets to c08c (Q6L)
bne patch_loop
and #$f8 ;MOTOROFF
; patch self-modifying code for turning motor off
and #$f8 ; MOTOROFF (c088)
sta slotpatch7+1
eor #8 ;PHASEOFF
; patch self-modifying code for phase off
eor #8 ; PHASEOFF (c080)
sta slotpatch8+1
ldx #$3f
stx zmask
inx
@ -89,17 +102,21 @@ patch_loop:
bne skip_ahead ; branch always
; pad with zeros until $839
; $839 is the entry point
; adjusts address at $8FE to be entry point
; jumps to boot 2
.res $839-*
;*=$839
lda #>(entry-1)
pha
lda #<(entry-1)
pha
jsr preread
jmp $bf00 ;DOS 3.3 launcher entrypoint
jmp $bf00 ; DOS 3.3 launcher entrypoint
patchtbl:
.byte <(slotpatch1+1), <(slotpatch2+1), <(slotpatch3+1), <(slotpatch4+1), <(slotpatch5+1), <(slotpatch6+1)
.byte <(slotpatch1+1), <(slotpatch2+1), <(slotpatch3+1)
.byte <(slotpatch4+1), <(slotpatch5+1), <(slotpatch6+1)
indextbl: ;the 0 also terminates the patchtbl list!
.byte 0, 2, 1, 3

BIN
qboot/new_80s.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -1,5 +1,15 @@
;the following lives on sectors $0E and $0D
; ????
; the following lives on sectors $0E and $0D
; why?
; request sector 2 and 4, and the interleave is
; beneath apple dos (3-23)
; Physical (firmware) : 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
; DOS33 mapping : 0, 7, 14, 6, 13, 5, 12, 4, 11, 3, 10, 2, 9, 1, 8, 15
; Beneath Apple DOS
; p86 (dos reference)
;
.org $be00
@ -8,8 +18,8 @@ code_begin:
.byte version
readnib:
slotpatch1:
lda $c0d1 ; ???
slotpatch1: ; smc
lda $c0d1 ; gets set to C08C (Q6L) read
bpl readnib
rts