switch to smartport protocol for reading the device
This commit is contained in:
parent
c096f7e37c
commit
c855701ffe
|
@ -12,8 +12,7 @@
|
||||||
string asis
|
string asis
|
||||||
blanks on
|
blanks on
|
||||||
|
|
||||||
; smartport doesn't currently work ($28 no drive error because the unit isn't setup correctly?)
|
__smartport__ set 1
|
||||||
__smartport__ set 0
|
|
||||||
|
|
||||||
zp record 0
|
zp record 0
|
||||||
slot ds.w 1
|
slot ds.w 1
|
||||||
|
@ -26,16 +25,7 @@ extents ds.b 3*HFSExtentDescriptor.sizeof
|
||||||
|
|
||||||
endr
|
endr
|
||||||
|
|
||||||
if __smartport__ then
|
if not __smartport__ then
|
||||||
sp record $20
|
|
||||||
ReadBlock equ $01
|
|
||||||
pcount ds.b 1
|
|
||||||
unit ds.b 1
|
|
||||||
buffer ds.w 1
|
|
||||||
block ds.l 1 ; actually 24-bit
|
|
||||||
endr
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
pro record $42
|
pro record $42
|
||||||
cmd ds.b 1
|
cmd ds.b 1
|
||||||
|
@ -63,9 +53,7 @@ boot proc
|
||||||
|
|
||||||
dc.b $01 ; prodos boot id :D
|
dc.b $01 ; prodos boot id :D
|
||||||
|
|
||||||
if __smartport__ then
|
if not __smartport__ then
|
||||||
stx sp.unit
|
|
||||||
else
|
|
||||||
stx pro.unit
|
stx pro.unit
|
||||||
endif
|
endif
|
||||||
txa
|
txa
|
||||||
|
@ -113,10 +101,7 @@ boot proc
|
||||||
noboot brk $ea
|
noboot brk $ea
|
||||||
|
|
||||||
ok
|
ok
|
||||||
if __smartport__ then
|
if not __smartport__ then
|
||||||
lda #3
|
|
||||||
sta sp.pcount
|
|
||||||
else
|
|
||||||
lda #1 ; prodos read block
|
lda #1 ; prodos read block
|
||||||
sta pro.cmd
|
sta pro.cmd
|
||||||
endif
|
endif
|
||||||
|
@ -131,13 +116,9 @@ ok
|
||||||
stz offset
|
stz offset
|
||||||
stz bnum
|
stz bnum
|
||||||
stz count
|
stz count
|
||||||
lda #data
|
|
||||||
|
|
||||||
if __smartport__ then
|
if not __smartport__ then
|
||||||
sta sp.buffer
|
lda #data
|
||||||
; stz sp.block ; will overwrite
|
|
||||||
stz sp.block+2
|
|
||||||
else
|
|
||||||
sta pro.buffer
|
sta pro.buffer
|
||||||
endif
|
endif
|
||||||
lda #2
|
lda #2
|
||||||
|
@ -264,12 +245,13 @@ found
|
||||||
sta extents+2
|
sta extents+2
|
||||||
|
|
||||||
; now load the blocks and
|
; now load the blocks and
|
||||||
lda #$2000
|
; lda #$2000
|
||||||
if __smartport__ then
|
; if __smartport__ then
|
||||||
sta sp.buffer
|
; sta sp.buffer
|
||||||
else
|
; else
|
||||||
sta pro.buffer
|
; sta pro.buffer
|
||||||
endif
|
; endif
|
||||||
|
|
||||||
stz bnum
|
stz bnum
|
||||||
@loop
|
@loop
|
||||||
lda bnum
|
lda bnum
|
||||||
|
@ -278,8 +260,9 @@ found
|
||||||
lda #512
|
lda #512
|
||||||
clc
|
clc
|
||||||
if __smartport__ then
|
if __smartport__ then
|
||||||
adc sp.buffer
|
import sp_buffer
|
||||||
sta sp.buffer
|
adc sp_buffer
|
||||||
|
sta sp_buffer
|
||||||
else
|
else
|
||||||
adc pro.buffer
|
adc pro.buffer
|
||||||
sta pro.buffer
|
sta pro.buffer
|
||||||
|
@ -287,20 +270,34 @@ found
|
||||||
dec count
|
dec count
|
||||||
bne @loop
|
bne @loop
|
||||||
|
|
||||||
ldx slot
|
|
||||||
ldy vector
|
ldy vector
|
||||||
if __smartport__ then
|
if not __smartport__ then
|
||||||
lda sp.unit
|
ldx slot
|
||||||
else
|
|
||||||
lda pro.unit
|
lda pro.unit
|
||||||
endif
|
|
||||||
and #$00ff
|
and #$00ff
|
||||||
|
endif
|
||||||
|
|
||||||
jmp $2000 ; kiss of life.
|
jmp $2000 ; kiss of life.
|
||||||
|
|
||||||
|
|
||||||
endp
|
endp
|
||||||
|
|
||||||
|
if __smartport__ then
|
||||||
|
sp record
|
||||||
|
entry sp_buffer, sp_block
|
||||||
|
|
||||||
|
ReadBlock equ $01
|
||||||
|
pcount dc.b 3
|
||||||
|
unit dc.b 1 ; hard-coded
|
||||||
|
sp_buffer
|
||||||
|
buffer dc.w $2000
|
||||||
|
sp_block
|
||||||
|
block dc.l 1 ; actually 24-bit
|
||||||
|
|
||||||
|
|
||||||
|
endr
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
read_block proc
|
read_block proc
|
||||||
entry read_block_abs
|
entry read_block_abs
|
||||||
|
|
45
loader.aii
45
loader.aii
|
@ -16,7 +16,7 @@
|
||||||
blanks on
|
blanks on
|
||||||
|
|
||||||
|
|
||||||
__smartport__ set 0
|
__smartport__ set 1
|
||||||
|
|
||||||
buffer equ $3000
|
buffer equ $3000
|
||||||
|
|
||||||
|
@ -41,17 +41,9 @@ file_id ds.l 1
|
||||||
endr
|
endr
|
||||||
|
|
||||||
|
|
||||||
if __smartport__ then
|
|
||||||
sp record $20
|
|
||||||
ReadBlock equ $01
|
|
||||||
pcount ds.b 1
|
|
||||||
unit ds.b 1
|
|
||||||
buffer ds.w 1
|
|
||||||
block ds.l 1 ; actually 24-bit
|
|
||||||
endr
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
|
if not __smartport__ then
|
||||||
pro record $42
|
pro record $42
|
||||||
cmd ds.b 1
|
cmd ds.b 1
|
||||||
unit ds.b 1
|
unit ds.b 1
|
||||||
|
@ -113,6 +105,16 @@ cat_str dcb.b 32, 0
|
||||||
|
|
||||||
endr
|
endr
|
||||||
|
|
||||||
|
if __smartport__ then
|
||||||
|
sp record
|
||||||
|
ReadBlock equ $01
|
||||||
|
pcount dc.b 3
|
||||||
|
unit dc.b 1
|
||||||
|
buffer dc.w $3000 ; name conflict...
|
||||||
|
block dc.l 0 ; actually 24-bit
|
||||||
|
endr
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
getbootname proc
|
getbootname proc
|
||||||
; getbootname(GSString *)
|
; getbootname(GSString *)
|
||||||
|
@ -132,8 +134,10 @@ getbootname proc
|
||||||
plb
|
plb
|
||||||
|
|
||||||
; get the volume name from the HFS MDB....
|
; get the volume name from the HFS MDB....
|
||||||
|
if not __smartport__ then
|
||||||
lda #buffer
|
lda #buffer
|
||||||
sta pro.buffer
|
sta pro.buffer
|
||||||
|
endif
|
||||||
lda #2
|
lda #2
|
||||||
jsr read_block_abs
|
jsr read_block_abs
|
||||||
bcs exit
|
bcs exit
|
||||||
|
@ -237,8 +241,10 @@ readfile proc
|
||||||
beq rdone
|
beq rdone
|
||||||
stz r0 ; block
|
stz r0 ; block
|
||||||
|
|
||||||
|
if not __smartport__ then
|
||||||
lda #buffer
|
lda #buffer
|
||||||
sta pro.buffer
|
sta pro.buffer
|
||||||
|
endif
|
||||||
; need to re-set cmd/slot as well?
|
; need to re-set cmd/slot as well?
|
||||||
|
|
||||||
@rloop
|
@rloop
|
||||||
|
@ -974,12 +980,14 @@ startup proc
|
||||||
txs
|
txs
|
||||||
|
|
||||||
|
|
||||||
|
if not __smartport__ then
|
||||||
lda #buffer
|
lda #buffer
|
||||||
sta pro.buffer
|
sta pro.buffer
|
||||||
short m
|
short m
|
||||||
lda #1
|
lda #1
|
||||||
sta pro.cmd
|
sta pro.cmd
|
||||||
long m
|
long m
|
||||||
|
endif
|
||||||
|
|
||||||
with HFSMasterDirectoryBlock
|
with HFSMasterDirectoryBlock
|
||||||
lda #2
|
lda #2
|
||||||
|
@ -1104,15 +1112,24 @@ read
|
||||||
beq bad
|
beq bad
|
||||||
|
|
||||||
lda #$6800
|
lda #$6800
|
||||||
|
if __smartport__ then
|
||||||
|
sta sp.buffer
|
||||||
|
else
|
||||||
sta pro.buffer
|
sta pro.buffer
|
||||||
|
endif
|
||||||
|
|
||||||
@loop lda r0
|
@loop lda r0
|
||||||
jsr read_file_block
|
jsr read_file_block
|
||||||
bcs bad
|
bcs bad
|
||||||
lda pro.buffer
|
|
||||||
; clc
|
; clc
|
||||||
adc #512
|
lda #512
|
||||||
|
if __smartport__ then
|
||||||
|
adc sp.buffer
|
||||||
|
sta sp.buffer
|
||||||
|
else
|
||||||
|
adc pro.buffer
|
||||||
sta pro.buffer
|
sta pro.buffer
|
||||||
|
endif
|
||||||
inc r0
|
inc r0
|
||||||
dec blocks
|
dec blocks
|
||||||
bne @loop
|
bne @loop
|
||||||
|
@ -1122,7 +1139,11 @@ read
|
||||||
sta auxtype
|
sta auxtype
|
||||||
|
|
||||||
lda #buffer
|
lda #buffer
|
||||||
|
if __smartport__ then
|
||||||
|
sta sp.buffer
|
||||||
|
else
|
||||||
sta pro.buffer ; kind of important...
|
sta pro.buffer ; kind of important...
|
||||||
|
endif
|
||||||
|
|
||||||
lda #0
|
lda #0
|
||||||
jmp $6800
|
jmp $6800
|
||||||
|
|
Loading…
Reference in New Issue