mirror of
https://github.com/ksherlock/host-fst.git
synced 2024-06-25 20:29:39 +00:00
Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
efe6925322 | ||
|
e9f00fac8c | ||
|
524fa1a94b | ||
|
e890e33f39 | ||
|
48d132c910 | ||
|
9e0fe043ed | ||
|
ffd5cf9826 | ||
|
9cb8554d6f | ||
|
7ffd8d9052 | ||
|
af3fe8dd88 | ||
|
306176ba31 | ||
|
d0a915f58d | ||
|
9618dc2441 | ||
|
17b1a8a3f2 |
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
.o
|
||||||
|
.lst
|
29
Makefile
29
Makefile
|
@ -6,7 +6,7 @@ ASMFLAGS=-case on -l
|
||||||
LDFLAGS=
|
LDFLAGS=
|
||||||
|
|
||||||
|
|
||||||
all : host.driver host.fst
|
all : host.driver boot.driver host.fst boot.sys atinit
|
||||||
|
|
||||||
host.fst : host.fst.o
|
host.fst : host.fst.o
|
||||||
$(LD) -t \$$BD -at \$$0000 $< -o $@
|
$(LD) -t \$$BD -at \$$0000 $< -o $@
|
||||||
|
@ -18,12 +18,39 @@ host.fst : host.fst.o
|
||||||
host.driver : host.driver.o
|
host.driver : host.driver.o
|
||||||
$(LD) -t \$$BB -at \$$0101 $< -o $@
|
$(LD) -t \$$BB -at \$$0101 $< -o $@
|
||||||
|
|
||||||
|
boot.driver : boot.driver.o
|
||||||
|
$(LD) -t \$$BB -at \$$0181 $< -o $@
|
||||||
|
|
||||||
|
# -d BootDriver must come after -case on
|
||||||
host.driver.o : host.driver.aii gsos.equ
|
host.driver.o : host.driver.aii gsos.equ
|
||||||
|
boot.driver.o : host.driver.aii gsos.equ
|
||||||
|
$(ASM) $(ASMFLAGS) -d BootDriver $< -o $@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
host.fst.o : host.fst.aii gsos.equ fst.equ records.equ fst.macros
|
host.fst.o : host.fst.aii gsos.equ fst.equ records.equ fst.macros
|
||||||
|
|
||||||
|
boot: boot.o
|
||||||
|
$(LD) $< -o $@
|
||||||
|
|
||||||
|
boot.sys: boot
|
||||||
|
mpw makebiniigs -p -s -t \$$FF $< -o $@
|
||||||
|
|
||||||
|
|
||||||
|
atinit: atinit.omf
|
||||||
|
mpw makebiniigs -p -s -t \$$e2 $< -o $@
|
||||||
|
|
||||||
|
|
||||||
|
atinit.omf: atinit.o
|
||||||
|
$(LD) -x $^ -o $@
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY : clean
|
||||||
|
clean :
|
||||||
|
$(RM) -- host.fst host.driver boot.driver boot.sys boot atinit atinit.omf *.o
|
||||||
|
|
||||||
%.o : %.aii
|
%.o : %.aii
|
||||||
$(ASM) $(ASMFLAGS) $< -o $@
|
$(ASM) $(ASMFLAGS) $< -o $@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
26
README.MD
26
README.MD
|
@ -1,16 +1,38 @@
|
||||||
Host FST
|
# Host FST
|
||||||
--------
|
|
||||||
|
|
||||||
This is a file system translator (and driver) for compatible Apple IIgs
|
This is a file system translator (and driver) for compatible Apple IIgs
|
||||||
emulators. It depends on emulator support (but should not cause problems
|
emulators. It depends on emulator support (but should not cause problems
|
||||||
if run on real hardware or an unsupportive emulator).
|
if run on real hardware or an unsupportive emulator).
|
||||||
|
|
||||||
|
![Host FST](images/ss-1.png)
|
||||||
|
|
||||||
This FST exposes a shared folder from your native file system as a volume
|
This FST exposes a shared folder from your native file system as a volume
|
||||||
within GS/OS. (The volume will not be available from ProDOS 8). Reading
|
within GS/OS. (The volume will not be available from ProDOS 8). Reading
|
||||||
or writing a file on the :Host drive will read or write the file directly
|
or writing a file on the :Host drive will read or write the file directly
|
||||||
on the native file system. File Types, Finder Info, and Resource Forks
|
on the native file system. File Types, Finder Info, and Resource Forks
|
||||||
are supported.
|
are supported.
|
||||||
|
|
||||||
|
![Host FST](images/ss-2.png)
|
||||||
|
|
||||||
In general any software that works with the HFS FST should work with the
|
In general any software that works with the HFS FST should work with the
|
||||||
Host FST.
|
Host FST.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
Currently, only GSPlus (0.13+) has support for the host fst.
|
||||||
|
|
||||||
|
1. See the [releases](https://github.com/ksherlock/host-fst/releases) page for a disk image.
|
||||||
|
2. Install the `host.fst` and `host.driver` in your `*:System:` folder
|
||||||
|
3. Bleeding edge versions of GSPlus have a config option (F4, Host FST Configuration) to
|
||||||
|
select the host fst directory. (On older versions it doesn't work correctly).
|
||||||
|
4. If you're using an older version of GSPlus, shutdown GSPlus and manually edit the
|
||||||
|
`config.txt` file. Add a line like:
|
||||||
|
|
||||||
|
g_cfg_host_path = /Users/me/IIgs/
|
||||||
|
|
||||||
|
|
||||||
|
# Note
|
||||||
|
|
||||||
|
Large volume sizes can cause a buffer overflow Finder's code and cause a crash (usually when displaying the File Info window).
|
||||||
|
This is fixed as of System 6.0.4.
|
||||||
|
|
110
atinit.aii
Normal file
110
atinit.aii
Normal file
|
@ -0,0 +1,110 @@
|
||||||
|
|
||||||
|
|
||||||
|
CheckMach equ $fe1f ;Monitor Routine to check machine type
|
||||||
|
mli equ $bf00
|
||||||
|
KVersion equ $bfff
|
||||||
|
|
||||||
|
head_call equ $fc
|
||||||
|
tail_call equ $fd
|
||||||
|
|
||||||
|
;code equ $d7a9 ; end of IIgs clock driver.
|
||||||
|
code equ $c0f0 ; slot 7 devsel.
|
||||||
|
;
|
||||||
|
; n.b. - IIgs clock driver is in the language card RAM so it can't be
|
||||||
|
; used for
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
macro
|
||||||
|
&lab wdm &arg
|
||||||
|
&lab dc.b $42, &arg
|
||||||
|
endm
|
||||||
|
|
||||||
|
Macro
|
||||||
|
_ON_LINE ¶ms
|
||||||
|
jsr $BF00
|
||||||
|
dc.b $C5
|
||||||
|
dc.w ¶ms
|
||||||
|
MEnd
|
||||||
|
|
||||||
|
MACHINE M65C02
|
||||||
|
LONGA OFF
|
||||||
|
LONGI OFF
|
||||||
|
|
||||||
|
main proc ORG $2000
|
||||||
|
|
||||||
|
lda $c061 ; check open apple button
|
||||||
|
bmi exit
|
||||||
|
lda KVersion
|
||||||
|
cmp #24 ; check for ProDOS 2.4+
|
||||||
|
blt exit
|
||||||
|
sec
|
||||||
|
jsr CheckMach
|
||||||
|
bcs exit
|
||||||
|
|
||||||
|
sei
|
||||||
|
lda mli+1
|
||||||
|
sta pro_ent+1
|
||||||
|
sta mli_address
|
||||||
|
lda mli+2
|
||||||
|
sta pro_ent+2
|
||||||
|
sta mli_address+1
|
||||||
|
jsr fakemli
|
||||||
|
dc.b $99
|
||||||
|
dc.w dcb
|
||||||
|
|
||||||
|
ldx #stub_end-stub_begin
|
||||||
|
@loop
|
||||||
|
lda stub_begin,x
|
||||||
|
sta code,x
|
||||||
|
dex
|
||||||
|
bpl @loop
|
||||||
|
|
||||||
|
lda #<code
|
||||||
|
sta mli+1
|
||||||
|
lda #code>>8
|
||||||
|
sta mli+2
|
||||||
|
|
||||||
|
exit
|
||||||
|
cli
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
|
||||||
|
dcb dc.b 4 ; pcount
|
||||||
|
dc.b 1 ; version
|
||||||
|
mli_address dc.w $0000 ; mli address
|
||||||
|
dc.w code+dcb_ent-stub_begin ; patch address
|
||||||
|
mli_slot dc.b $80 ; ProDOS slot to use.
|
||||||
|
|
||||||
|
fakemli
|
||||||
|
sec
|
||||||
|
wdm head_call
|
||||||
|
; if this drops through, no gs+ support.
|
||||||
|
|
||||||
|
pla
|
||||||
|
bra exit
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;
|
||||||
|
; this code is relocated to $d7a9, after the IIgs clock driver.
|
||||||
|
;
|
||||||
|
stub_begin
|
||||||
|
wdm head_call
|
||||||
|
pro_ent jsr $0000
|
||||||
|
dcb_ent dc.b $0
|
||||||
|
dc.w $0000
|
||||||
|
wdm tail_call
|
||||||
|
rts
|
||||||
|
stub_end
|
||||||
|
if (stub_end-stub_begin)>16 then
|
||||||
|
aerror 'stub code overflow'
|
||||||
|
endif
|
||||||
|
|
||||||
|
endp
|
||||||
|
|
||||||
|
|
||||||
|
end
|
327
boot.aii
Normal file
327
boot.aii
Normal file
|
@ -0,0 +1,327 @@
|
||||||
|
;
|
||||||
|
; Host FST boot loader.
|
||||||
|
;
|
||||||
|
;
|
||||||
|
;
|
||||||
|
;
|
||||||
|
;
|
||||||
|
|
||||||
|
string asis
|
||||||
|
case on
|
||||||
|
|
||||||
|
include 'gsos.equ'
|
||||||
|
include 'fst.macros'
|
||||||
|
include 'records.equ'
|
||||||
|
|
||||||
|
|
||||||
|
macro
|
||||||
|
&lab call_host
|
||||||
|
&lab dc.b $42, $ff
|
||||||
|
endm
|
||||||
|
|
||||||
|
macro
|
||||||
|
&lab host_print
|
||||||
|
&lab dc.b $42, $fe
|
||||||
|
endm
|
||||||
|
|
||||||
|
macro
|
||||||
|
&lab host_hexdump
|
||||||
|
&lab dc.b $42, $fd
|
||||||
|
endm
|
||||||
|
|
||||||
|
gbuffer equ $9a00
|
||||||
|
|
||||||
|
|
||||||
|
header proc org $2000
|
||||||
|
|
||||||
|
import startup
|
||||||
|
import readfile
|
||||||
|
import getbootname
|
||||||
|
import getfstname
|
||||||
|
|
||||||
|
export aux_value
|
||||||
|
|
||||||
|
jmp startup
|
||||||
|
nop
|
||||||
|
dc.w readfile
|
||||||
|
dc.w getbootname
|
||||||
|
dc.w getfstname
|
||||||
|
dc.w startup-header
|
||||||
|
aux_value dc.w 0
|
||||||
|
endp
|
||||||
|
|
||||||
|
|
||||||
|
; getfst_name(name*)
|
||||||
|
;
|
||||||
|
getfstname proc
|
||||||
|
nameptr equ $0
|
||||||
|
|
||||||
|
plx ; rts
|
||||||
|
pla
|
||||||
|
sta <nameptr
|
||||||
|
pla
|
||||||
|
sta <nameptr+2
|
||||||
|
phx
|
||||||
|
ldy |fst_str
|
||||||
|
iny
|
||||||
|
short m
|
||||||
|
@loop
|
||||||
|
lda fst_str,y
|
||||||
|
sta [nameptr],y
|
||||||
|
dey
|
||||||
|
bpl @loop
|
||||||
|
long m
|
||||||
|
|
||||||
|
clc
|
||||||
|
lda #0
|
||||||
|
rts
|
||||||
|
fst_str str.w 'Host.fst'
|
||||||
|
endp
|
||||||
|
|
||||||
|
getbootname proc
|
||||||
|
nameptr equ $0
|
||||||
|
|
||||||
|
plx ; rts
|
||||||
|
pla
|
||||||
|
sta <nameptr
|
||||||
|
pla
|
||||||
|
sta <nameptr+2
|
||||||
|
phx
|
||||||
|
ldy |volume_str
|
||||||
|
iny
|
||||||
|
short m
|
||||||
|
@loop
|
||||||
|
lda volume_str,y
|
||||||
|
sta [nameptr],y
|
||||||
|
dey
|
||||||
|
bpl @loop
|
||||||
|
long m
|
||||||
|
|
||||||
|
clc
|
||||||
|
lda #0
|
||||||
|
rts
|
||||||
|
volume_str str.w ':Host'
|
||||||
|
endp
|
||||||
|
|
||||||
|
readfile proc
|
||||||
|
;
|
||||||
|
;
|
||||||
|
;
|
||||||
|
import OpenDCB:OpenRecGS
|
||||||
|
import CloseDCB:CloseRecGS
|
||||||
|
import ReadDCB:IORecGS
|
||||||
|
|
||||||
|
import open_read_close
|
||||||
|
|
||||||
|
plx ; rts
|
||||||
|
pla
|
||||||
|
sta ReadDCB.dataBuffer
|
||||||
|
pla
|
||||||
|
sta ReadDCB.dataBuffer+2
|
||||||
|
pla
|
||||||
|
sta OpenDCB.pathname
|
||||||
|
pla
|
||||||
|
sta OpenDCB.pathname+2
|
||||||
|
phx ; rts
|
||||||
|
|
||||||
|
jsr open_read_close
|
||||||
|
bcs @error
|
||||||
|
|
||||||
|
lda OpenDCB.fileType
|
||||||
|
sta 3,s
|
||||||
|
|
||||||
|
lda OpenDCB.auxType
|
||||||
|
sta 5,s
|
||||||
|
|
||||||
|
lda OpenDCB.eof
|
||||||
|
sta 7,s
|
||||||
|
lda OpenDCB.eof+2
|
||||||
|
sta 9,s
|
||||||
|
|
||||||
|
|
||||||
|
lda #0
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
|
||||||
|
@error ; A should have error code....
|
||||||
|
rts
|
||||||
|
endp
|
||||||
|
|
||||||
|
|
||||||
|
open_read_close proc
|
||||||
|
;
|
||||||
|
; pathname, dataBuffer set up in DCBs.
|
||||||
|
;
|
||||||
|
|
||||||
|
import OpenDCB:OpenRecGS
|
||||||
|
import CloseDCB:CloseRecGS
|
||||||
|
import ReadDCB:IORecGS
|
||||||
|
import fakedp
|
||||||
|
|
||||||
|
with fst_parms
|
||||||
|
phd
|
||||||
|
phb
|
||||||
|
phk
|
||||||
|
plb
|
||||||
|
|
||||||
|
lda #fakedp
|
||||||
|
tcd
|
||||||
|
|
||||||
|
lda gbuffer
|
||||||
|
sta scratch
|
||||||
|
|
||||||
|
lda #OpenDCB
|
||||||
|
sta param_blk_ptr
|
||||||
|
lda #^OpenDCB
|
||||||
|
sta param_blk_ptr+2
|
||||||
|
stz dev1_num
|
||||||
|
stz dev2_num
|
||||||
|
|
||||||
|
lda OpenDCB.pathname
|
||||||
|
sta path1_ptr
|
||||||
|
lda OpenDCB.pathname+2
|
||||||
|
sta path1_ptr+2
|
||||||
|
|
||||||
|
stz path2_ptr
|
||||||
|
stz path2_ptr+2
|
||||||
|
|
||||||
|
lda #$4000
|
||||||
|
sta path_flag
|
||||||
|
lda #11
|
||||||
|
sta span1
|
||||||
|
stz span2
|
||||||
|
|
||||||
|
|
||||||
|
ldx #$2010
|
||||||
|
stx call_number
|
||||||
|
sec
|
||||||
|
call_host
|
||||||
|
bcs @exit
|
||||||
|
; x = cookie for open/close.
|
||||||
|
|
||||||
|
txy ; cookie
|
||||||
|
|
||||||
|
lda OpenDCB.eof
|
||||||
|
sta ReadDCB.requestCount
|
||||||
|
lda OpenDCB.eof+2
|
||||||
|
sta ReadDCB.requestCount+2
|
||||||
|
|
||||||
|
|
||||||
|
; global data buffer -
|
||||||
|
; readline mask.
|
||||||
|
stz $9a00
|
||||||
|
stz ReadDCB.transferCount
|
||||||
|
stz ReadDCB.transferCount+2
|
||||||
|
lda #ReadDCB
|
||||||
|
sta param_blk_ptr
|
||||||
|
lda #^ReadDCB
|
||||||
|
sta param_blk_ptr+2
|
||||||
|
stz dev1_num
|
||||||
|
stz dev2_num
|
||||||
|
|
||||||
|
stz path1_ptr
|
||||||
|
stz path1_ptr+2
|
||||||
|
stz path2_ptr
|
||||||
|
stz path2_ptr+2
|
||||||
|
|
||||||
|
stz path_flag
|
||||||
|
stz span1
|
||||||
|
stz span2
|
||||||
|
|
||||||
|
ldx #$2012
|
||||||
|
stx call_number
|
||||||
|
sec
|
||||||
|
call_host
|
||||||
|
|
||||||
|
; close...
|
||||||
|
lda #CloseDCB
|
||||||
|
sta param_blk_ptr
|
||||||
|
lda #^CloseDCB
|
||||||
|
sta param_blk_ptr+2
|
||||||
|
|
||||||
|
ldx #$2014
|
||||||
|
stx call_number
|
||||||
|
sec
|
||||||
|
call_host
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@exit
|
||||||
|
lda scratch
|
||||||
|
sta gbuffer
|
||||||
|
|
||||||
|
plb
|
||||||
|
pld
|
||||||
|
rts
|
||||||
|
scratch ds.w 1
|
||||||
|
endp
|
||||||
|
|
||||||
|
startup proc
|
||||||
|
|
||||||
|
clc
|
||||||
|
xce
|
||||||
|
long m,x
|
||||||
|
|
||||||
|
import OpenDCB:OpenRecGS
|
||||||
|
import CloseDCB:CloseRecGS
|
||||||
|
import ReadDCB:IORecGS
|
||||||
|
import aux_value
|
||||||
|
|
||||||
|
; 0. host fst start up.
|
||||||
|
lda #0
|
||||||
|
ldx #$8001
|
||||||
|
call_host
|
||||||
|
|
||||||
|
; 1. open/read/close start.gsos
|
||||||
|
; 2. execute start.gsos
|
||||||
|
|
||||||
|
|
||||||
|
lda #15
|
||||||
|
sta OpenDCB.pCount
|
||||||
|
lda #start_str
|
||||||
|
sta OpenDCB.pathname
|
||||||
|
lda #^start_str
|
||||||
|
sta OpenDCB.pathname+2
|
||||||
|
lda #1
|
||||||
|
sta OpenDCB.requestAccess
|
||||||
|
|
||||||
|
lda #1
|
||||||
|
sta CloseDCB.pCount
|
||||||
|
lda #3
|
||||||
|
sta ReadDCB.pCount
|
||||||
|
|
||||||
|
lda #$6800
|
||||||
|
sta ReadDCB.dataBuffer
|
||||||
|
lda #$0000
|
||||||
|
sta ReadDCB.dataBuffer+2
|
||||||
|
|
||||||
|
jsr open_read_close
|
||||||
|
|
||||||
|
|
||||||
|
lda OpenDCB.auxType
|
||||||
|
sta aux_value
|
||||||
|
|
||||||
|
lda #$1000 ; want *:System:Drivers:Boot.Driver
|
||||||
|
ldx #0
|
||||||
|
ldy #0
|
||||||
|
jmp $6803
|
||||||
|
|
||||||
|
start_str str.w 'System:Start.GS.OS'
|
||||||
|
|
||||||
|
endp
|
||||||
|
|
||||||
|
|
||||||
|
Data record
|
||||||
|
|
||||||
|
export OpenDCB, CloseDCB, ReadDCB
|
||||||
|
|
||||||
|
OpenDCB ds OpenRecGS
|
||||||
|
CloseDCB ds CloseRecGS
|
||||||
|
ReadDCB ds IORecGS
|
||||||
|
|
||||||
|
; needs to be last.
|
||||||
|
export fakedp
|
||||||
|
fakedp
|
||||||
|
endr
|
||||||
|
end
|
||||||
|
|
1
fst.equ
1
fst.equ
|
@ -6,6 +6,7 @@ ptr ds.l 1 ; misc ptr
|
||||||
|
|
||||||
my_vcr ds.l 1
|
my_vcr ds.l 1
|
||||||
my_fcr ds.l 1
|
my_fcr ds.l 1
|
||||||
|
my_vcr_ptr ds.l 1
|
||||||
cookie ds.w 1
|
cookie ds.w 1
|
||||||
call_class ds.w 1
|
call_class ds.w 1
|
||||||
tmp ds.w 1
|
tmp ds.w 1
|
||||||
|
|
15
fst.macros
15
fst.macros
|
@ -272,3 +272,18 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
macro
|
||||||
|
&l post_event
|
||||||
|
bcs @no
|
||||||
|
pei call_number
|
||||||
|
lda dev_id
|
||||||
|
pha
|
||||||
|
pea 0
|
||||||
|
lda #volume_change
|
||||||
|
ldx #^volume_change
|
||||||
|
jsl post_os_event
|
||||||
|
lda #0
|
||||||
|
clc
|
||||||
|
@no
|
||||||
|
mend
|
||||||
|
|
||||||
|
|
9
gsos.equ
9
gsos.equ
|
@ -10,6 +10,7 @@
|
||||||
; ` prevents expansion during macro processing.
|
; ` prevents expansion during macro processing.
|
||||||
DEFAULT `DEBUG_S16,0
|
DEFAULT `DEBUG_S16,0
|
||||||
DEFAULT `DebugSymbols,0
|
DEFAULT `DebugSymbols,0
|
||||||
|
DEFAULT `BootDriver,0
|
||||||
|
|
||||||
****************************************************************
|
****************************************************************
|
||||||
*
|
*
|
||||||
|
@ -149,8 +150,12 @@ init_parse_path equ $01FCD4 ;initialize for parse_path.
|
||||||
;
|
;
|
||||||
; Event codes for os_event
|
; Event codes for os_event
|
||||||
;
|
;
|
||||||
volmod_event equ $0040 ; event code for volume modified
|
switch_to_p8 equ $00000002 ;Switch from GS/OS to P8.
|
||||||
disk_in_event equ $0008 ; disk inserted event
|
switch_to_gsos equ $00000004 ;Switch from P8 to GS/OS.
|
||||||
|
disk_insert equ $00000008 ;Disk inserted.
|
||||||
|
disk_eject equ $00000010 ;Disk ejected.
|
||||||
|
gsos_shutdown equ $00000020 ;OS shutdown.
|
||||||
|
volume_change equ $00000040 ;Volume changed.
|
||||||
|
|
||||||
;
|
;
|
||||||
; Driver command codes
|
; Driver command codes
|
||||||
|
|
|
@ -10,10 +10,11 @@
|
||||||
|
|
||||||
string asis
|
string asis
|
||||||
header proc
|
header proc
|
||||||
|
if not BootDriver then
|
||||||
dc.w dib-header
|
dc.w dib-header
|
||||||
dc.w 1 ; 1 device
|
dc.w 1 ; 1 device
|
||||||
dc.w 0 ; no config list
|
dc.w 0 ; no config list
|
||||||
|
endif
|
||||||
|
|
||||||
dib dc.l 0 ;Link pointer to next DIB
|
dib dc.l 0 ;Link pointer to next DIB
|
||||||
dc.l entry ;Entry pointer
|
dc.l entry ;Entry pointer
|
||||||
|
|
185
host.fst.aii
185
host.fst.aii
|
@ -18,8 +18,7 @@
|
||||||
entry check_path1, check_path2
|
entry check_path1, check_path2
|
||||||
entry build_vcr
|
entry build_vcr
|
||||||
|
|
||||||
entry fd_op
|
entry fd_op_ro
|
||||||
|
|
||||||
|
|
||||||
entry create
|
entry create
|
||||||
entry destroy
|
entry destroy
|
||||||
|
@ -50,12 +49,12 @@
|
||||||
|
|
||||||
macro
|
macro
|
||||||
&lab host_print
|
&lab host_print
|
||||||
&lab dc.b $42, $fe
|
&lab dc.b $42, $a0
|
||||||
endm
|
endm
|
||||||
|
|
||||||
macro
|
macro
|
||||||
&lab host_hexdump
|
&lab host_hexdump
|
||||||
&lab dc.b $42, $fd
|
&lab dc.b $42, $a1
|
||||||
endm
|
endm
|
||||||
|
|
||||||
|
|
||||||
|
@ -162,64 +161,80 @@ rtl_invalid_pcount proc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sys_startup proc
|
find_host_device proc
|
||||||
with dev_parms
|
with dev_parms
|
||||||
|
|
||||||
; 1. find the .host device.
|
; find .host device. if no .host, returns to gs/os.
|
||||||
|
; entry via jsr
|
||||||
|
; exit via rts (success) / sys_exit (fail).
|
||||||
|
lda dev_id
|
||||||
|
beq @search
|
||||||
|
bmi @fail
|
||||||
|
rts
|
||||||
|
@fail plx
|
||||||
|
lda #unknown_vol
|
||||||
|
sec
|
||||||
|
jml sys_exit
|
||||||
|
@search
|
||||||
|
lda #-1
|
||||||
|
sta dev_id
|
||||||
lda #1
|
lda #1
|
||||||
sta dev_dev_id
|
sta dev_dev_id
|
||||||
stz dev_num
|
stz dev_num
|
||||||
loop
|
@loop
|
||||||
lda #drvr_get_dib
|
lda #drvr_get_dib
|
||||||
sta dev_callnum
|
sta dev_callnum
|
||||||
jsl dev_dispatcher
|
jsl dev_dispatcher
|
||||||
bcs no
|
bcs @fail
|
||||||
; appletalk puts up a dialog box....
|
|
||||||
|
|
||||||
ldy #$34 ; dib device id
|
ldy #$34 ; dib device id
|
||||||
lda [dev_dib_ptr],y
|
lda [dev_dib_ptr],y
|
||||||
cmp #$10 ; file server
|
cmp #$10 ; file server
|
||||||
bne next
|
bne @next
|
||||||
|
|
||||||
short m
|
short m
|
||||||
ldy #$0e ; name $04 H O S T
|
ldy #$0e ; name $04 H O S T
|
||||||
lda [dev_dib_ptr],y
|
lda [dev_dib_ptr],y
|
||||||
cmp #$04
|
cmp #$04
|
||||||
bne next
|
bne @next
|
||||||
|
|
||||||
iny
|
iny
|
||||||
lda [dev_dib_ptr],y
|
lda [dev_dib_ptr],y
|
||||||
cmp #'H'
|
cmp #'H'
|
||||||
bne next
|
bne @next
|
||||||
|
|
||||||
iny
|
iny
|
||||||
lda [dev_dib_ptr],y
|
lda [dev_dib_ptr],y
|
||||||
cmp #'O'
|
cmp #'O'
|
||||||
bne next
|
bne @next
|
||||||
|
|
||||||
iny
|
iny
|
||||||
lda [dev_dib_ptr],y
|
lda [dev_dib_ptr],y
|
||||||
cmp #'S'
|
cmp #'S'
|
||||||
bne next
|
bne @next
|
||||||
|
|
||||||
iny
|
iny
|
||||||
lda [dev_dib_ptr],y
|
lda [dev_dib_ptr],y
|
||||||
cmp #'T'
|
cmp #'T'
|
||||||
bne next
|
bne @next
|
||||||
|
|
||||||
long m
|
long m
|
||||||
lda dev_dev_id
|
lda dev_dev_id
|
||||||
sta dev_id
|
sta dev_id
|
||||||
bra got_device
|
clc
|
||||||
|
rts
|
||||||
|
|
||||||
next
|
@next
|
||||||
long m
|
long m
|
||||||
; try the next one.
|
; try the next one.
|
||||||
inc dev_dev_id
|
inc dev_dev_id
|
||||||
bra loop
|
bra @loop
|
||||||
|
endp
|
||||||
|
|
||||||
got_device
|
sys_startup proc
|
||||||
|
|
||||||
|
|
||||||
|
stz dev_id
|
||||||
|
|
||||||
; sanity check that the global buffer location
|
; sanity check that the global buffer location
|
||||||
; is where I expect it.
|
; is where I expect it.
|
||||||
|
@ -337,11 +352,23 @@ app_entry proc
|
||||||
stz cookie
|
stz cookie
|
||||||
|
|
||||||
|
|
||||||
@check_fcr
|
|
||||||
; check fcr bit.
|
; check fcr bit.
|
||||||
|
; n = fcr/vcr-based
|
||||||
|
; v = path-based
|
||||||
bit table,x
|
bit table,x
|
||||||
bpl @check_vcr
|
bmi @vcr
|
||||||
|
bvc @call
|
||||||
|
|
||||||
|
@path
|
||||||
|
; path checking...
|
||||||
|
|
||||||
|
jsr find_host_device
|
||||||
|
jsr check_path1
|
||||||
|
bcc @call
|
||||||
|
jml sys_exit
|
||||||
|
|
||||||
|
@vcr
|
||||||
|
; deref vcr and fcr.
|
||||||
ldx fcr_ptr
|
ldx fcr_ptr
|
||||||
ldy fcr_ptr+2
|
ldy fcr_ptr+2
|
||||||
jsl deref
|
jsl deref
|
||||||
|
@ -351,35 +378,13 @@ app_entry proc
|
||||||
lda [my_fcr],y
|
lda [my_fcr],y
|
||||||
sta cookie
|
sta cookie
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@check_vcr
|
|
||||||
ldx <tmp
|
|
||||||
|
|
||||||
bit table,x
|
|
||||||
bvc @check_path
|
|
||||||
|
|
||||||
ldx vcr_ptr
|
ldx vcr_ptr
|
||||||
ldy vcr_ptr+2
|
ldy vcr_ptr+2
|
||||||
jsl deref
|
jsl deref
|
||||||
stx my_vcr
|
stx my_vcr
|
||||||
sty my_vcr+2
|
sty my_vcr+2
|
||||||
|
|
||||||
@check_path
|
|
||||||
ldx <tmp
|
|
||||||
|
|
||||||
lda #path_used
|
|
||||||
bit table,x
|
|
||||||
beq @call
|
|
||||||
; path checking...
|
|
||||||
|
|
||||||
jsr check_path1
|
|
||||||
bcc @call
|
|
||||||
jml sys_exit
|
|
||||||
|
|
||||||
@call
|
@call
|
||||||
ldx <tmp
|
|
||||||
|
|
||||||
; fake an rtl address for sys_exit
|
; fake an rtl address for sys_exit
|
||||||
; otherwise, would need to jml sys_exit from functions.
|
; otherwise, would need to jml sys_exit from functions.
|
||||||
pea |(sys_exit-1)>>8
|
pea |(sys_exit-1)>>8
|
||||||
|
@ -411,6 +416,8 @@ app_entry proc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
app_table
|
app_table
|
||||||
dc.w rtl_bad_system_call ;
|
dc.w rtl_bad_system_call ;
|
||||||
dc.w create ; ($01) Create
|
dc.w create ; ($01) Create
|
||||||
|
@ -468,10 +475,10 @@ max_app_call equ *-app_table-2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; insight - vcr and fcr always go together.
|
||||||
fcr_used equ $8000
|
vcr_used equ $8000
|
||||||
vcr_used equ $4000
|
fcr_used equ $0000
|
||||||
path_used equ $2000
|
path_used equ $4000
|
||||||
|
|
||||||
table ; stores max pcount + 1
|
table ; stores max pcount + 1
|
||||||
dc.w 0
|
dc.w 0
|
||||||
|
@ -581,7 +588,7 @@ read proc
|
||||||
ldy #fcr.mask
|
ldy #fcr.mask
|
||||||
lda [my_fcr],y
|
lda [my_fcr],y
|
||||||
sta >$009a00 ; hardcoded...
|
sta >$009a00 ; hardcoded...
|
||||||
beq fd_op
|
beq fd_op_ro
|
||||||
|
|
||||||
; zero-out the table.
|
; zero-out the table.
|
||||||
ldx #256-2
|
ldx #256-2
|
||||||
|
@ -621,7 +628,7 @@ nloop
|
||||||
bpl nloop
|
bpl nloop
|
||||||
long m
|
long m
|
||||||
|
|
||||||
bra fd_op
|
bra fd_op_ro
|
||||||
|
|
||||||
endp
|
endp
|
||||||
|
|
||||||
|
@ -630,16 +637,15 @@ nloop
|
||||||
export &lab
|
export &lab
|
||||||
&lab
|
&lab
|
||||||
endm
|
endm
|
||||||
fd_op proc
|
fd_op_ro proc
|
||||||
|
|
||||||
|
|
||||||
write global
|
|
||||||
get_eof global
|
get_eof global
|
||||||
set_eof global
|
|
||||||
get_mark global
|
get_mark global
|
||||||
set_mark global
|
|
||||||
flush global
|
flush global
|
||||||
get_dir_entry global
|
get_dir_entry global
|
||||||
|
|
||||||
|
|
||||||
with dp, fst_parms
|
with dp, fst_parms
|
||||||
|
|
||||||
; read, write, truncate, etc.
|
; read, write, truncate, etc.
|
||||||
|
@ -652,20 +658,34 @@ get_dir_entry global
|
||||||
rtl
|
rtl
|
||||||
endp
|
endp
|
||||||
|
|
||||||
path_op proc
|
|
||||||
|
fd_op_rw proc
|
||||||
|
|
||||||
|
write global
|
||||||
|
set_eof global
|
||||||
|
set_mark global
|
||||||
|
|
||||||
|
with dp, fst_parms
|
||||||
|
|
||||||
|
; read, write, truncate, etc.
|
||||||
|
; everything (except close) that uses an fcr.
|
||||||
|
lda #invalid_fst_op
|
||||||
|
ldx call_number
|
||||||
|
ldy cookie
|
||||||
|
sec
|
||||||
|
call_host
|
||||||
|
post_event
|
||||||
|
rtl
|
||||||
|
endp
|
||||||
|
|
||||||
|
|
||||||
|
path_op_ro proc
|
||||||
|
|
||||||
|
|
||||||
get_file_info global
|
get_file_info global
|
||||||
set_file_info global
|
|
||||||
create global
|
|
||||||
destroy global
|
|
||||||
|
|
||||||
erase_disk global
|
|
||||||
format global
|
|
||||||
|
|
||||||
with dp, fst_parms
|
with dp, fst_parms
|
||||||
|
|
||||||
|
|
||||||
lda #invalid_fst_op
|
lda #invalid_fst_op
|
||||||
ldx call_number
|
ldx call_number
|
||||||
sec
|
sec
|
||||||
|
@ -674,6 +694,26 @@ format global
|
||||||
|
|
||||||
endp
|
endp
|
||||||
|
|
||||||
|
path_op_rw proc
|
||||||
|
|
||||||
|
set_file_info global
|
||||||
|
create global
|
||||||
|
destroy global
|
||||||
|
erase_disk global
|
||||||
|
format global
|
||||||
|
|
||||||
|
with dp, fst_parms
|
||||||
|
|
||||||
|
lda #invalid_fst_op
|
||||||
|
ldx call_number
|
||||||
|
sec
|
||||||
|
call_host
|
||||||
|
post_event
|
||||||
|
rtl
|
||||||
|
|
||||||
|
endp
|
||||||
|
|
||||||
|
|
||||||
judge_name proc
|
judge_name proc
|
||||||
|
|
||||||
with dp, fst_parms
|
with dp, fst_parms
|
||||||
|
@ -718,7 +758,7 @@ change_path proc
|
||||||
ldx call_number
|
ldx call_number
|
||||||
sec
|
sec
|
||||||
call_host
|
call_host
|
||||||
|
post_event
|
||||||
exit
|
exit
|
||||||
rtl
|
rtl
|
||||||
|
|
||||||
|
@ -730,6 +770,13 @@ volume proc
|
||||||
|
|
||||||
with dp, fst_parms
|
with dp, fst_parms
|
||||||
|
|
||||||
|
;
|
||||||
|
; volume requires a device id. it doesn't fit
|
||||||
|
; into the standard table so we check for the
|
||||||
|
; .host device here.
|
||||||
|
;
|
||||||
|
|
||||||
|
jsr find_host_device
|
||||||
lda dev1_num
|
lda dev1_num
|
||||||
beq no
|
beq no
|
||||||
|
|
||||||
|
@ -768,6 +815,8 @@ build_vcr proc
|
||||||
lda #0
|
lda #0
|
||||||
jsl find_vcr
|
jsl find_vcr
|
||||||
bcs create_vcr
|
bcs create_vcr
|
||||||
|
stx my_vcr_ptr
|
||||||
|
sty my_vcr_ptr+2
|
||||||
jsl deref
|
jsl deref
|
||||||
|
|
||||||
stx my_vcr
|
stx my_vcr
|
||||||
|
@ -823,6 +872,9 @@ create_vcr
|
||||||
ldx #host_name
|
ldx #host_name
|
||||||
ldy #^host_name
|
ldy #^host_name
|
||||||
jsl alloc_vcr
|
jsl alloc_vcr
|
||||||
|
stx my_vcr_ptr
|
||||||
|
sty my_vcr_ptr+2
|
||||||
|
|
||||||
lda #out_of_mem
|
lda #out_of_mem
|
||||||
bcs exit
|
bcs exit
|
||||||
|
|
||||||
|
@ -1031,6 +1083,13 @@ open proc
|
||||||
sty my_fcr+2
|
sty my_fcr+2
|
||||||
|
|
||||||
; need to re-deref the vcr?
|
; need to re-deref the vcr?
|
||||||
|
; vcr_ptr is actually a pathname.
|
||||||
|
ldx my_vcr_ptr
|
||||||
|
ldy my_vcr_ptr+2
|
||||||
|
jsl deref
|
||||||
|
stx my_vcr
|
||||||
|
sty my_vcr+2
|
||||||
|
|
||||||
|
|
||||||
ldy #vcr.open_count
|
ldy #vcr.open_count
|
||||||
lda [my_vcr],y
|
lda [my_vcr],y
|
||||||
|
|
BIN
images/ss-1.png
Normal file
BIN
images/ss-1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
BIN
images/ss-2.png
Normal file
BIN
images/ss-2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 84 KiB |
10
records.equ
10
records.equ
|
@ -259,3 +259,13 @@ DevNumRec begin_struct
|
||||||
devName DS.B 4
|
devName DS.B 4
|
||||||
devNum DS.B 2
|
devNum DS.B 2
|
||||||
end_struct
|
end_struct
|
||||||
|
|
||||||
|
|
||||||
|
CloseRecGS begin_struct
|
||||||
|
pCount DS.W 1
|
||||||
|
refNum DS.W 1
|
||||||
|
end_struct
|
||||||
|
|
||||||
|
CloseRec begin_struct
|
||||||
|
refNum DS.W 1
|
||||||
|
end_struct
|
||||||
|
|
Loading…
Reference in New Issue
Block a user