diff --git a/Makefile b/Makefile index 73679f3..6bfaeda 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ host.driver : host.driver.o host.driver.o : host.driver.aii gsos.equ -host.fst.o : host.fst.aii gsos.equ fst.equ +host.fst.o : host.fst.aii gsos.equ fst.equ records.equ fst.macros diff --git a/fst.equ b/fst.equ index 2b82832..e215548 100644 --- a/fst.equ +++ b/fst.equ @@ -7,7 +7,8 @@ ptr ds.l 1 ; misc ptr my_vcr ds.l 1 my_fcr ds.l 1 cookie ds.w 1 - +call_class ds.w 1 +tmp ds.w 1 __end equ * IF *>=$d4 THEN @@ -51,4 +52,17 @@ __sizeof equ * ; 5 = mfs, we're stealing it for now. -fst_id equ 5 \ No newline at end of file +fst_id equ 5 + +; Upper-case pathnames +; |Character-based FST +; ||Format capable +; |||Strip high bits from pathname characters +; ||||Read-Only FST +; |||||Reserved +; ||||||||||||||Format type +; |||||||||||||||| (00 = Universal) +; |||||||||||||||| (01 = Apple-generic) +; |||||||||||||||| (10 = Non-Apple) +; |||||||||||||||| (11 = Apple-][ specific) +fst_attr equ %0000000000000000 diff --git a/fst_open.aii b/fst_open.aii index d2cfe73..cfa5663 100644 --- a/fst_open.aii +++ b/fst_open.aii @@ -5,7 +5,7 @@ open proc - with fst_parms + with dp, fst_parms jsr check_path bcs exit diff --git a/host.fst.aii b/host.fst.aii index c2b9968..bef17b2 100644 --- a/host.fst.aii +++ b/host.fst.aii @@ -8,14 +8,53 @@ longi on string asis - entry app_entry, sys_entry + entry app_entry + entry sys_entry + + entry rtl_no_error + entry sys_startup + entry sys_shutdown + + entry check_path1, check_path2 + entry build_vcr + + entry fd_op + + + entry create + entry destroy + entry change_path + entry set_file_info + entry get_file_info + entry judge_name + entry volume + entry open + entry close + entry read + entry write + entry flush + entry get_mark + entry set_mark + entry get_eof + entry set_eof + entry get_dir_entry + entry get_dev_num + entry format + entry erase_disk + + + macro +&lab call_host +&lab dc.b $42, $ff + endm header proc str 'FST ' dc.l app_entry dc.l sys_entry dc.w fst_id - dc.w $0000 ; attributes + + dc.w fst_attr ; attributes dc.w $0100 ; version dc.w $0200 ; block size dc.l $007FFFFF ; maximum volume size @@ -33,7 +72,12 @@ header proc data record export dev_id ; device id of the .host driver. -dev_id ds.w 0 +dev_id dc.w 0 + + export colon_host, colon_HOST, colon_Host +colon_host str.w ':host' +colon_Host str.w ':Host' +colon_HOST str.w ':HOST' endr @@ -58,6 +102,32 @@ max_sys_call equ *-@sys_table-2 endp +rtl_no_error proc + lda #0 + clc + rtl + endp + + +rtl_invalid_fst_op proc + lda #invalid_fst_op + sec + rtl + endp + +rtl_bad_system_call proc + lda #bad_system_call + sec + rtl + endp + +rtl_invalid_pcount proc + lda #invalid_pcount + sec + rtl + endp + + sys_startup proc with dev_parms @@ -105,7 +175,7 @@ loop cmp #'T' bne next - lon m + long m lda dev_dev_id sta dev_id bra got_device @@ -131,7 +201,7 @@ got_device lda #0 sec ldx #$8001 - wdm #$ff + call_host ; wdm will clear carry if active. rtl @@ -146,34 +216,10 @@ sys_shutdown proc lda #0 clc ldx #$8002 - wdm #$ff + call_host rtl endp -rtl_no_error proc - lda #0 - clc - rtl - endp - - -rtl_invalid_fst_op proc - lda #invalid_fst_op - sec - rtl - endp - -rtl_bad_system_call proc - lda #bad_system_call - sec - rtl - endp - -rtl_invalid_pcount proc - lda #invalid_pcount - sec - rtl - endp app_entry proc @@ -182,19 +228,16 @@ app_entry proc with dp with fst_parms - import max_pcount - import want_fcr - import want_vcr phk plb rep #$30 - - ;brk $42 - + ; x = call number * 2 + ; y = call class * 2 sty >8 + pea |(sys_exit-1)>>8 phb - lda #