work in progress dump. mostly assembles.
This commit is contained in:
parent
d012019dd8
commit
2456c1fc4b
21
Makefile
21
Makefile
|
@ -4,12 +4,18 @@ bootblock : bootblock.omf hfs.po
|
||||||
mpw makebiniigs -s -org 2048 bootblock.omf -o bootblock
|
mpw makebiniigs -s -org 2048 bootblock.omf -o bootblock
|
||||||
dd bs=512 if=bootblock of=hfs.po conv=notrunc oseek=0
|
dd bs=512 if=bootblock of=hfs.po conv=notrunc oseek=0
|
||||||
|
|
||||||
|
loader : loader.omf
|
||||||
|
mpw makebiniigs -s -org 8192 loader.omf -o loader
|
||||||
|
|
||||||
bootblock.omf : bootblock.obj
|
|
||||||
mpw linkiigs bootblock.obj -o bootblock.omf
|
# bootblock.omf : bootblock.obj
|
||||||
|
# mpw linkiigs bootblock.obj -o bootblock.omf
|
||||||
|
|
||||||
bootblock.obj : bootblock.aii hfs.aii
|
bootblock.obj : bootblock.aii hfs.aii
|
||||||
mpw asmiigs bootblock.aii -o bootblock.obj
|
# mpw asmiigs bootblock.aii -o bootblock.obj
|
||||||
|
|
||||||
|
loader.obj : loader.aii hfs.aii macros.aii
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
@ -18,3 +24,12 @@ clean:
|
||||||
|
|
||||||
hfs.po:
|
hfs.po:
|
||||||
mkfs-profuse --fst=hfs --size=800k --name="hfs boot" hfs.po
|
mkfs-profuse --fst=hfs --size=800k --name="hfs boot" hfs.po
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%.obj : %.aii
|
||||||
|
mpw asmiigs -l $< -o $@
|
||||||
|
|
||||||
|
%.omf : %.obj
|
||||||
|
mpw linkiigs $< -o $@
|
||||||
|
|
354
loader.aii
354
loader.aii
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
include 'hfs.aii'
|
include 'hfs.aii'
|
||||||
include 'macros.aii'
|
include 'macros.aii'
|
||||||
|
include 'e16.gsos'
|
||||||
|
|
||||||
string asis
|
string asis
|
||||||
blanks on
|
blanks on
|
||||||
|
@ -15,15 +16,20 @@
|
||||||
__smartport__ set 0
|
__smartport__ set 0
|
||||||
|
|
||||||
buffer equ $3000
|
buffer equ $3000
|
||||||
file_not_found equ $46
|
|
||||||
|
|
||||||
dp record 0
|
dp record 0
|
||||||
_dp ds.w 1
|
ptr ds.l 1
|
||||||
ptr ds.1 1
|
|
||||||
path ds.l 1
|
path ds.l 1
|
||||||
|
|
||||||
|
|
||||||
|
r0 ds.w 1
|
||||||
|
r1 ds.w 1
|
||||||
|
r2 ds.w 1
|
||||||
|
r3 ds.w 1
|
||||||
|
|
||||||
; readfile
|
; readfile
|
||||||
eof ds.l 1
|
eof ds.l 1
|
||||||
|
blocks ds.w 1 ; shouldn't exceed...
|
||||||
ft ds.w 1
|
ft ds.w 1
|
||||||
at ds.w 1
|
at ds.w 1
|
||||||
st ds.w 1
|
st ds.w 1
|
||||||
|
@ -31,6 +37,33 @@ 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
|
||||||
|
|
||||||
|
pro record $42
|
||||||
|
cmd ds.b 1
|
||||||
|
unit ds.b 1
|
||||||
|
buffer ds.b 2
|
||||||
|
block ds.b 2
|
||||||
|
endr
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
entry read_block, read_block_abs
|
||||||
|
entry prepare_path, cat_lookup
|
||||||
|
entry read_cat_block, read_file_block
|
||||||
|
|
||||||
|
|
||||||
header proc
|
header proc
|
||||||
|
|
||||||
import readfile, getbootname, getfstname, startup
|
import readfile, getbootname, getfstname, startup
|
||||||
|
@ -50,29 +83,30 @@ auxtype dc.w 0
|
||||||
|
|
||||||
data record
|
data record
|
||||||
; store catalog info
|
; store catalog info
|
||||||
slot ds.w 0
|
slot dc.w 0
|
||||||
unit ds.w 0
|
unit dc.w 0
|
||||||
vector ds.w 0
|
vector dc.w 0
|
||||||
|
|
||||||
block_offset ds.w 0
|
block_offset dc.w 0
|
||||||
|
|
||||||
cat_extents ds.w 6
|
cat_extents dcb.w 6, 0
|
||||||
file_extents ds.w 6
|
file_extents dcb.w 6, 0
|
||||||
|
|
||||||
cat_root dc.w 0
|
cat_root dc.w 0
|
||||||
|
|
||||||
system_id dc.l 0
|
system_id dc.l 0
|
||||||
fsts_id dc.l 0
|
fsts_id dc.l 0
|
||||||
driver_id dc.l 0
|
drivers_id dc.l 0
|
||||||
|
|
||||||
|
|
||||||
; ctree lookup
|
; ctree lookup
|
||||||
target_parent dc.l 0
|
target_parent dc.l 0
|
||||||
|
|
||||||
target_str_len dc.w 0
|
target_str_len dc.w 0
|
||||||
target_str ds.b 32
|
target_str dcb.b 32, 0
|
||||||
|
|
||||||
cat_str_len dc.w 0
|
cat_str_len dc.w 0
|
||||||
cat_str ds.b 32
|
cat_str dcb.b 32, 0
|
||||||
|
|
||||||
endr
|
endr
|
||||||
|
|
||||||
|
@ -82,10 +116,6 @@ getbootname proc
|
||||||
|
|
||||||
with dp
|
with dp
|
||||||
|
|
||||||
tcd ; save
|
|
||||||
pea fakedp
|
|
||||||
pld
|
|
||||||
|
|
||||||
plx ; rts
|
plx ; rts
|
||||||
ply
|
ply
|
||||||
sty ptr
|
sty ptr
|
||||||
|
@ -93,8 +123,6 @@ getbootname proc
|
||||||
sty ptr+2
|
sty ptr+2
|
||||||
phx
|
phx
|
||||||
|
|
||||||
pha ; saved d
|
|
||||||
|
|
||||||
phb
|
phb
|
||||||
phk
|
phk
|
||||||
plb
|
plb
|
||||||
|
@ -113,6 +141,7 @@ getbootname proc
|
||||||
inc a
|
inc a
|
||||||
lsr a
|
lsr a
|
||||||
tax ; count
|
tax ; count
|
||||||
|
dex
|
||||||
|
|
||||||
ldy #2
|
ldy #2
|
||||||
@loop lda buffer+drVN-1,y
|
@loop lda buffer+drVN-1,y
|
||||||
|
@ -127,7 +156,6 @@ getbootname proc
|
||||||
|
|
||||||
exit
|
exit
|
||||||
plb
|
plb
|
||||||
pld
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
endp
|
endp
|
||||||
|
@ -138,10 +166,6 @@ getfstname proc
|
||||||
|
|
||||||
with dp
|
with dp
|
||||||
|
|
||||||
tcd ; save
|
|
||||||
pea fakedp
|
|
||||||
pld
|
|
||||||
|
|
||||||
plx ; rts
|
plx ; rts
|
||||||
ply
|
ply
|
||||||
sty ptr
|
sty ptr
|
||||||
|
@ -149,8 +173,6 @@ getfstname proc
|
||||||
sty ptr+2
|
sty ptr+2
|
||||||
phx
|
phx
|
||||||
|
|
||||||
pha ; save d
|
|
||||||
|
|
||||||
phb
|
phb
|
||||||
phk
|
phk
|
||||||
plb
|
plb
|
||||||
|
@ -164,14 +186,12 @@ getfstname proc
|
||||||
bpl @loop
|
bpl @loop
|
||||||
|
|
||||||
plb
|
plb
|
||||||
pld
|
|
||||||
clc
|
clc
|
||||||
lda #0
|
lda #0
|
||||||
rts
|
rts
|
||||||
|
|
||||||
name dc.w 7
|
name str.w 'hfs.fst'
|
||||||
dc.b 'hfs.fst'
|
dcb.b 1,0
|
||||||
dc.b 0
|
|
||||||
|
|
||||||
endp
|
endp
|
||||||
|
|
||||||
|
@ -181,10 +201,6 @@ readfile proc
|
||||||
; (eof, aux type, file type) readfile(GSString *, void *)
|
; (eof, aux type, file type) readfile(GSString *, void *)
|
||||||
with dp
|
with dp
|
||||||
|
|
||||||
tcd ; save
|
|
||||||
pea fakedp
|
|
||||||
pld
|
|
||||||
|
|
||||||
plx ; rts
|
plx ; rts
|
||||||
ply
|
ply
|
||||||
sty ptr ; data buffer
|
sty ptr ; data buffer
|
||||||
|
@ -196,48 +212,84 @@ readfile proc
|
||||||
sty path+2
|
sty path+2
|
||||||
phx
|
phx
|
||||||
|
|
||||||
pha ; save d
|
|
||||||
|
|
||||||
phb
|
phb
|
||||||
phk
|
phk
|
||||||
plb
|
plb
|
||||||
|
|
||||||
|
|
||||||
lda [path]
|
jsr prepare_path
|
||||||
cmp #8
|
bcs exit
|
||||||
blt notfound
|
|
||||||
|
|
||||||
|
jsr cat_lookup
|
||||||
|
bcs exit
|
||||||
|
|
||||||
|
; now read file, one block at a time,
|
||||||
|
; and copy to ptr.
|
||||||
|
lda blocks
|
||||||
|
beq rdone
|
||||||
|
stz r0 ; block
|
||||||
|
|
||||||
|
@rloop
|
||||||
|
lda r0
|
||||||
|
jsr read_file_block
|
||||||
|
bcs exit
|
||||||
|
|
||||||
|
|
||||||
|
; copy to destination
|
||||||
|
pea buffer>>16 ; src
|
||||||
|
pea buffer
|
||||||
|
pei ptr+2 ; dest
|
||||||
|
pei ptr
|
||||||
|
pea 0 ; count
|
||||||
|
pea 512
|
||||||
|
_BlockMove
|
||||||
|
|
||||||
|
|
||||||
|
lda ptr
|
||||||
|
clc
|
||||||
|
adc #512
|
||||||
|
sta ptr
|
||||||
|
lda ptr+2
|
||||||
|
adc #0
|
||||||
|
sta ptr+2
|
||||||
|
|
||||||
|
inc r0
|
||||||
|
dec blocks
|
||||||
|
bne @rloop
|
||||||
|
|
||||||
|
rdone
|
||||||
|
|
||||||
|
|
||||||
; ...
|
; ...
|
||||||
|
|
||||||
; stack: b, d, rts,
|
; stack: b, rts,
|
||||||
lda ft
|
lda ft
|
||||||
sta 3+3,s
|
sta 4,s
|
||||||
lda at
|
lda at
|
||||||
sta 5+3,s
|
sta 6,s
|
||||||
lda eof
|
lda eof
|
||||||
sta 7+3,s
|
sta 8,s
|
||||||
lda eof+2
|
lda eof+2
|
||||||
sta 9+3,s
|
sta 10,s
|
||||||
|
|
||||||
lda #0
|
lda #0
|
||||||
clc
|
clc
|
||||||
exit
|
exit
|
||||||
plb
|
plb
|
||||||
pld
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
endp
|
endp
|
||||||
|
|
||||||
find_parent proc
|
prepare_path proc
|
||||||
|
|
||||||
with dp
|
with dp, data
|
||||||
|
|
||||||
; optimism
|
; optimism
|
||||||
stz offset
|
stz r0 ; offset into path
|
||||||
lda system_id
|
lda system_id
|
||||||
sta parent_id
|
sta target_parent
|
||||||
|
sta system_id+2
|
||||||
|
sta target_parent+2
|
||||||
|
|
||||||
|
|
||||||
lda [path]
|
lda [path]
|
||||||
|
@ -257,7 +309,7 @@ find_parent proc
|
||||||
|
|
||||||
lda [path],y
|
lda [path],y
|
||||||
iny
|
iny
|
||||||
sty offset
|
sty r0
|
||||||
|
|
||||||
cmp #'D:'
|
cmp #'D:'
|
||||||
beq d
|
beq d
|
||||||
|
@ -266,43 +318,42 @@ find_parent proc
|
||||||
|
|
||||||
and #$ff
|
and #$ff
|
||||||
cmp #':'
|
cmp #':'
|
||||||
beq s
|
beq sys
|
||||||
err lda #file_not_found
|
err lda #fileNotFound
|
||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
|
|
||||||
s
|
sys brl target
|
||||||
clc
|
|
||||||
rts
|
|
||||||
; check for more ':' ?
|
; check for more ':' ?
|
||||||
|
|
||||||
d ; check for a driver folder.
|
d ; check for a driver folder.
|
||||||
lda [path]
|
lda [path]
|
||||||
cmp #16
|
cmp #16
|
||||||
blt s
|
blt sys
|
||||||
ldx #4
|
ldx #4
|
||||||
@loop lda [path],y
|
@loop lda [path],y
|
||||||
cmp s2,y
|
cmp s2,y
|
||||||
bne s
|
bne sys
|
||||||
iny
|
iny
|
||||||
iny
|
iny
|
||||||
dex
|
dex
|
||||||
bne @loop
|
bne @loop
|
||||||
; match!
|
; match!
|
||||||
sty offset
|
sty r0
|
||||||
lda driver_id
|
lda drivers_id
|
||||||
sta parent_id
|
sta target_parent
|
||||||
clc
|
lda drivers_id+2
|
||||||
rts
|
sta target_parent+2
|
||||||
|
brl target
|
||||||
|
|
||||||
f ; check for FSTs folder
|
f ; check for FSTs folder
|
||||||
lda [path]
|
lda [path]
|
||||||
cmp #13
|
cmp #13
|
||||||
blt s
|
blt sys
|
||||||
ldx #2
|
ldx #2
|
||||||
@loop lda [path],y
|
@loop lda [path],y
|
||||||
cmp s3,y
|
cmp s3,y
|
||||||
bne s
|
bne sys
|
||||||
iny
|
iny
|
||||||
iny
|
iny
|
||||||
dex
|
dex
|
||||||
|
@ -310,14 +361,61 @@ f ; check for FSTs folder
|
||||||
lda [path],y
|
lda [path],y
|
||||||
and #$ff
|
and #$ff
|
||||||
cmp #':'
|
cmp #':'
|
||||||
bne s
|
bne sys
|
||||||
iny
|
iny
|
||||||
sty offset
|
sty r0
|
||||||
lda fsts_id
|
lda fsts_id
|
||||||
sta parent_id
|
sta target_parent
|
||||||
|
lda fsts_id+2
|
||||||
|
sta target_parent+2
|
||||||
|
|
||||||
|
; drop through
|
||||||
|
|
||||||
|
target
|
||||||
|
; now set target_str / len
|
||||||
|
lda [path]
|
||||||
|
sec
|
||||||
|
sbc r0
|
||||||
|
beq fnf ; close enough
|
||||||
|
sta target_str_len
|
||||||
|
cmp #16
|
||||||
|
bcs fnf
|
||||||
|
|
||||||
|
ldx #30
|
||||||
|
@zloop stz target_str,x
|
||||||
|
dex
|
||||||
|
dex
|
||||||
|
bpl @zloop
|
||||||
|
|
||||||
|
short m
|
||||||
|
ldx #0
|
||||||
|
@loop
|
||||||
|
lda [path],y
|
||||||
|
cmp #':'
|
||||||
|
beq fnf
|
||||||
|
cmp #'z'+1
|
||||||
|
bge @next
|
||||||
|
cmp #'a'
|
||||||
|
blt @next
|
||||||
|
and #$ff xor $20
|
||||||
|
|
||||||
|
@next sta target_str_len,x
|
||||||
|
iny
|
||||||
|
inx
|
||||||
|
cpx target_str_len
|
||||||
|
blt @loop
|
||||||
|
|
||||||
|
long m
|
||||||
|
lda #0
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
fnf long m
|
||||||
|
lda #fileNotFound
|
||||||
|
sec
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
s1 dc.b 'xxSYSTEM:'
|
s1 dc.b 'xxSYSTEM:'
|
||||||
s2 dc.b 'xxSYSTEM:DRIVERS:'
|
s2 dc.b 'xxSYSTEM:DRIVERS:'
|
||||||
s3 dc.b 'xxSYSTEM:FSTS:'
|
s3 dc.b 'xxSYSTEM:FSTS:'
|
||||||
|
@ -378,6 +476,12 @@ vector dc.w $ffff
|
||||||
|
|
||||||
cat_lookup proc
|
cat_lookup proc
|
||||||
|
|
||||||
|
with data
|
||||||
|
|
||||||
|
bnum equ dp.r0
|
||||||
|
prev equ dp.r1
|
||||||
|
count equ dp.r2
|
||||||
|
|
||||||
; search for a file and a parent directory.
|
; search for a file and a parent directory.
|
||||||
|
|
||||||
lda cat_root
|
lda cat_root
|
||||||
|
@ -405,15 +509,15 @@ eloop
|
||||||
xba
|
xba
|
||||||
cmp target_parent+2
|
cmp target_parent+2
|
||||||
beq @p2
|
beq @p2
|
||||||
blt lt
|
blt @lt
|
||||||
bge gt
|
bge @gt
|
||||||
|
|
||||||
@p2 lda data+HFSCatalogKey.parentID+2,y
|
@p2 lda data+HFSCatalogKey.parentID+2,y
|
||||||
xba
|
xba
|
||||||
cmp target_parent+2
|
cmp target_parent
|
||||||
beq @nm
|
beq @nm
|
||||||
blt lt
|
blt @lt
|
||||||
bge gt
|
bge @gt
|
||||||
|
|
||||||
@gt
|
@gt
|
||||||
; if this is an index node,
|
; if this is an index node,
|
||||||
|
@ -428,6 +532,7 @@ eloop
|
||||||
|
|
||||||
; now do a name check....
|
; now do a name check....
|
||||||
; target_name is UPPER CASE
|
; target_name is UPPER CASE
|
||||||
|
@nm
|
||||||
jsr name_check
|
jsr name_check
|
||||||
cmp #0
|
cmp #0
|
||||||
beq @found
|
beq @found
|
||||||
|
@ -468,7 +573,7 @@ advance
|
||||||
bra ix
|
bra ix
|
||||||
|
|
||||||
nope
|
nope
|
||||||
lda #file_not_found
|
lda #fileNotFound
|
||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
@ -514,7 +619,7 @@ upper
|
||||||
bge @next
|
bge @next
|
||||||
cmp #'a'
|
cmp #'a'
|
||||||
blt @next
|
blt @next
|
||||||
and #$20
|
and #$ff xor $20
|
||||||
sta cat_str,y
|
sta cat_str,y
|
||||||
|
|
||||||
@next iny
|
@next iny
|
||||||
|
@ -559,6 +664,10 @@ exit
|
||||||
match ; a match!
|
match ; a match!
|
||||||
; store the file type, aux type, eof, and extent pointers.
|
; store the file type, aux type, eof, and extent pointers.
|
||||||
; a match!
|
; a match!
|
||||||
|
|
||||||
|
|
||||||
|
with dp
|
||||||
|
|
||||||
lda buffer+HFSCatalogKey.keyLength,y
|
lda buffer+HFSCatalogKey.keyLength,y
|
||||||
and #$ff
|
and #$ff
|
||||||
inc a ; doesn't include itself
|
inc a ; doesn't include itself
|
||||||
|
@ -573,13 +682,14 @@ match ; a match!
|
||||||
cmp #kHFSFileRecord
|
cmp #kHFSFileRecord
|
||||||
beq file
|
beq file
|
||||||
; folder thread, file thread.... invalid for us.
|
; folder thread, file thread.... invalid for us.
|
||||||
lda #file_not_found
|
lda #fileNotFound
|
||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
folder
|
folder
|
||||||
with HFSCatalogFolder
|
with HFSCatalogFolder
|
||||||
stz eof
|
stz eof
|
||||||
stz eof+2
|
stz eof+2
|
||||||
|
stz blocks
|
||||||
stz at
|
stz at
|
||||||
lda #$f
|
lda #$f
|
||||||
sta ft
|
sta ft
|
||||||
|
@ -614,6 +724,15 @@ file
|
||||||
xba
|
xba
|
||||||
sta eof+2
|
sta eof+2
|
||||||
|
|
||||||
|
; blocks
|
||||||
|
; update if variable block size?
|
||||||
|
lda buffer+dataPhysicalSize+2,y
|
||||||
|
; xba
|
||||||
|
lsr a ; >>9 since already xba
|
||||||
|
and #%01111111
|
||||||
|
sta blocks
|
||||||
|
|
||||||
|
|
||||||
lda #1
|
lda #1
|
||||||
sta st ; storage type
|
sta st ; storage type
|
||||||
|
|
||||||
|
@ -658,16 +777,16 @@ file
|
||||||
stz at
|
stz at
|
||||||
lda data+userInfo+4,y
|
lda data+userInfo+4,y
|
||||||
cmp #'dp'
|
cmp #'dp'
|
||||||
bne @noft
|
bne noft
|
||||||
lda data+userInfo+4+2,y
|
lda data+userInfo+4+2,y
|
||||||
cmp #'so'
|
cmp #'so'
|
||||||
bne @noft
|
bne noft
|
||||||
pdos
|
pdos
|
||||||
lda data+userInfo,y
|
lda data+userInfo,y
|
||||||
tax
|
tax
|
||||||
and #$ff
|
and #$ff
|
||||||
cmp #'p'
|
cmp #'p'
|
||||||
bne @noft
|
bne noft
|
||||||
txa
|
txa
|
||||||
xba
|
xba
|
||||||
and #$ff
|
and #$ff
|
||||||
|
@ -675,7 +794,7 @@ pdos
|
||||||
lda data+userInfo+2,y
|
lda data+userInfo+2,y
|
||||||
xba
|
xba
|
||||||
sta at
|
sta at
|
||||||
@noft
|
noft
|
||||||
|
|
||||||
lda #0
|
lda #0
|
||||||
clc
|
clc
|
||||||
|
@ -685,6 +804,17 @@ pdos
|
||||||
endp
|
endp
|
||||||
|
|
||||||
|
|
||||||
|
macro
|
||||||
|
&lab ifc_fail &str
|
||||||
|
&lab bcc @ok
|
||||||
|
pha
|
||||||
|
pea @str>>16
|
||||||
|
pea @str
|
||||||
|
_SysFailMgr
|
||||||
|
brk $ea
|
||||||
|
@str str.b &str
|
||||||
|
@ok
|
||||||
|
mend
|
||||||
|
|
||||||
;
|
;
|
||||||
; everything below here will be clobbered.
|
; everything below here will be clobbered.
|
||||||
|
@ -707,8 +837,10 @@ startup proc
|
||||||
sty vector
|
sty vector
|
||||||
sta unit
|
sta unit
|
||||||
|
|
||||||
pea fakedp
|
lda #0
|
||||||
pld
|
tcd
|
||||||
|
ldx #$1ff
|
||||||
|
txs
|
||||||
|
|
||||||
|
|
||||||
with HFSMasterDirectoryBlock
|
with HFSMasterDirectoryBlock
|
||||||
|
@ -754,15 +886,15 @@ startup proc
|
||||||
bpl @zloop
|
bpl @zloop
|
||||||
|
|
||||||
ldx #14-2
|
ldx #14-2
|
||||||
@sloop
|
sloop
|
||||||
lda sys,x
|
lda sys,x
|
||||||
sta target_str_len,x
|
sta target_str_len,x
|
||||||
dex
|
dex
|
||||||
dex
|
dex
|
||||||
bpl @sloop
|
bpl sloop
|
||||||
|
|
||||||
jsr cat_lookup
|
jsr cat_lookup
|
||||||
bcs bad
|
ifc_fail 'Unable to locate System folder. Error=$'
|
||||||
|
|
||||||
; also check if dir?
|
; also check if dir?
|
||||||
|
|
||||||
|
@ -776,15 +908,16 @@ startup proc
|
||||||
; lookup System:FSTs
|
; lookup System:FSTs
|
||||||
|
|
||||||
ldx #14-2
|
ldx #14-2
|
||||||
@floop
|
floop
|
||||||
lda fsts,x
|
lda fsts,x
|
||||||
sta target_str_len,x
|
sta target_str_len,x
|
||||||
dex
|
dex
|
||||||
dex
|
dex
|
||||||
bpl @floop
|
bpl floop
|
||||||
|
|
||||||
jsr cat_lookup
|
jsr cat_lookup
|
||||||
bcs bad
|
ifc_fail 'Unable to locate System:FSTs folder. Error=$'
|
||||||
|
|
||||||
; also check if dir?
|
; also check if dir?
|
||||||
|
|
||||||
lda file_id
|
lda file_id
|
||||||
|
@ -795,21 +928,22 @@ startup proc
|
||||||
; lookup System:Drivers
|
; lookup System:Drivers
|
||||||
|
|
||||||
ldx #14-2
|
ldx #14-2
|
||||||
@dloop
|
dloop
|
||||||
lda drv,x
|
lda drv,x
|
||||||
sta target_str_len,x
|
sta target_str_len,x
|
||||||
dex
|
dex
|
||||||
dex
|
dex
|
||||||
bpl @dloop
|
bpl dloop
|
||||||
|
|
||||||
jsr cat_lookup
|
jsr cat_lookup
|
||||||
bcs bad
|
ifc_fail 'Unable to locate System:Drivers folder. Error=$'
|
||||||
|
|
||||||
; also check if dir?
|
; also check if dir?
|
||||||
|
|
||||||
lda file_id
|
lda file_id
|
||||||
sta driver_id
|
sta drivers_id
|
||||||
lda file_id+2
|
lda file_id+2
|
||||||
sta driver_id+2
|
sta drivers_id+2
|
||||||
|
|
||||||
|
|
||||||
; lookup System:Start.GS.OS
|
; lookup System:Start.GS.OS
|
||||||
|
@ -822,19 +956,44 @@ startup proc
|
||||||
bpl @gloop
|
bpl @gloop
|
||||||
|
|
||||||
jsr cat_lookup
|
jsr cat_lookup
|
||||||
bcs bad
|
ifc_fail 'Unable to locate System:Start.GS.OS. Error=$'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
read
|
||||||
|
stz r0
|
||||||
|
lda blocks
|
||||||
|
beq bad
|
||||||
|
|
||||||
|
lda #$6800
|
||||||
|
sta pro.buffer
|
||||||
|
|
||||||
|
@loop lda r0
|
||||||
|
jsr read_file_block
|
||||||
|
bcs bad
|
||||||
|
lda pro.buffer
|
||||||
|
; clc
|
||||||
|
adc #512
|
||||||
|
sta pro.buffer
|
||||||
|
inc r0
|
||||||
|
dec blocks
|
||||||
|
bne @loop
|
||||||
|
|
||||||
|
|
||||||
lda at
|
lda at
|
||||||
sta auxtype
|
sta auxtype
|
||||||
|
|
||||||
; lda #$1000 ; drivers:boot.driver support
|
|
||||||
; ldx #0
|
|
||||||
; ldy #0
|
|
||||||
jmp $6800
|
jmp $6800
|
||||||
|
|
||||||
|
bad pha
|
||||||
|
pea @str>>16
|
||||||
|
pea @str
|
||||||
|
_SysFailMgr
|
||||||
|
brk $ea
|
||||||
|
@str str.b 'Error reading Start.GS.OS. Error=$'
|
||||||
|
|
||||||
|
|
||||||
|
; buffered out to same length.
|
||||||
sys str.w 'SYSTEM'
|
sys str.w 'SYSTEM'
|
||||||
dcb.b 6,0
|
dcb.b 6,0
|
||||||
fsts str.w 'FSTS'
|
fsts str.w 'FSTS'
|
||||||
|
@ -845,9 +1004,4 @@ gsos str.w 'START.GS.OS'
|
||||||
dcb.b 1,0
|
dcb.b 1,0
|
||||||
endp
|
endp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
fakedp proc
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
14
macros.aii
14
macros.aii
|
@ -76,3 +76,17 @@
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|
||||||
MEND
|
MEND
|
||||||
|
|
||||||
|
|
||||||
|
MACRO
|
||||||
|
&lab _BlockMove
|
||||||
|
&lab ldx #$2B02
|
||||||
|
jsl $E10000
|
||||||
|
MEND
|
||||||
|
|
||||||
|
MACRO
|
||||||
|
&lab _SysFailMgr
|
||||||
|
&lab ldx #$1503
|
||||||
|
jsl $E10000
|
||||||
|
MEND
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue