v2 with partial track support

This commit is contained in:
Peter Ferrie 2016-04-20 09:35:47 -07:00
parent 08ce1e0c83
commit de713c17dd
3 changed files with 65 additions and 3 deletions

30
0BOOT.S
View File

@ -1,5 +1,5 @@
;bootable zpage seek/read
;copyright (c) Peter Ferrie 2015
;copyright (c) Peter Ferrie 2015-16
;thanks to 4am for inspiration and testing
;assemble using ACME
!cpu 6502
@ -8,7 +8,8 @@
tracks = $d1 ;user-defined
address = $d1 ;user-defined
entry = $d1d1 ;user-defined
version = 1
sectors = $00 ;user-defined, sectors to load from partial track (increase tracks first)
version = 2
;memory usage:
;256 bytes ($200-2FF) static table
@ -62,17 +63,35 @@
bne + ;branch always
*=$839
jsr preread
lda #>(entry-1)
pha
lda #<(entry-1)
pha
ldx #<((tracks*16)+sectors)
lda #address
jmp $bf00 ;DOS 3.3 launcher entrypoint
;build read/seek call-sequence per track
+
!if sectors>0 {
txa
pha
lda #<initsec
pha
txa
clc
bcc ++
}
- txa
bcc + ;set initially by LSR above
pha
pha
!byte $c9 ;CMP masks SEC, clears carry on even rounds
+ sec ;SEC is reached on odd rounds
!if sectors>0 {
++
}
pha
lda #<(seek-1)
pha ;push seek twice for two phases
@ -143,6 +162,11 @@ count
inittrk
ldx #$f0
initsec
!if sectors>0 {
!byte $2c
ldx #<(-sectors)
}
stx <count
rdpage
lda #address

37
DOS33L.S Normal file
View File

@ -0,0 +1,37 @@
;0boot DOS 3.3 launcher support
;copyright (c) Peter Ferrie 2016
;assemble using ACME
!cpu 6502
!to "dos33l",plain
;place on sector 1
*=$BF00
stx sectors
sta address
index ldy #0
- lda xlatsec, y
sta sector
lda #>iocb
ldy #<iocb
jsr $bd00
ldy index + 1
iny
tya
and #$0f
sta index + 1
tay
bne +
inc track
+ inc address
dec sectors
bne -
rts
sectors !byte $d1
xlatsec !byte 0, 7, $e, 6, $d, 5, $c, 4, $b, 3, $a, 2, 9, 1, 8, $f
iocb !byte 1, $60, 1, 0
track !byte 1
sector !byte 0
!byte <dct, >dct, 0
address !byte 0
!byte 0, 0, 1, 0, 0, $60, 1
dct !byte 1, $ef, $d8, 0

View File

@ -5,5 +5,6 @@ fast bootable Read Track/Sector routine.
- full-track read in one revolution
- runs entirely from zpage
- can load up to 11 complete tracks
- can load up to 12 additional sectors ($0400-bfff)
- DOS 3.3 Launcher compatible
- requires only 3 pages in memory