mirror of https://github.com/peterferrie/0boot.git
v2 with partial track support
This commit is contained in:
parent
08ce1e0c83
commit
de713c17dd
30
0BOOT.S
30
0BOOT.S
|
@ -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
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue