get_dev_num (needed for Finder)

This commit is contained in:
Kelvin Sherlock 2015-09-02 11:41:27 -04:00
parent 73577feb81
commit fe70a36c67
5 changed files with 77 additions and 10 deletions

View File

@ -2,7 +2,7 @@
SOURCES = main.aii volume.aii get_file_info.aii \ SOURCES = main.aii volume.aii get_file_info.aii \
open.aii get_dir_entry.aii get_mark.aii set_mark.aii get_eof.aii \ open.aii get_dir_entry.aii get_mark.aii set_mark.aii get_eof.aii \
close.aii read.aii flush.aii judge_name.aii \ close.aii read.aii flush.aii judge_name.aii get_dev_num.aii \
id_disk.aii stubs.aii tables.aii device.aii params.aii globals.aii \ id_disk.aii stubs.aii tables.aii device.aii params.aii globals.aii \
debug.aii debug.aii

57
get_dev_num.aii Normal file
View File

@ -0,0 +1,57 @@
string asis
include 'gsos.equ'
include 'minix.equ'
include 'records.equ'
include 'fst.equ'
include 'fst.macros'
include 'M16.Debug'
import volume_by_name
;
; gs/os expands the path provided. that means we'll have
; an absolute path or a device number + relative path.
;
get_dev_num procname export
with dp, fst_parms
lda dev1_num
bne store
lda span1
cmp #30+1
bcs bps
jsr volume_by_name
bcs exit
lda dev_parms.dev_num
store
; a = device number
ldx call_class
ldy table,x
sta [param_blk_ptr],y
lda tool_error
cmp #1
exit
rtl
bps
lda #bad_path_syntax
sec
rtl
table
dc.w DevNumRec.devNum, DevNumRecGS.devNum
endp
end

View File

@ -446,7 +446,7 @@ done
endp endp
volume_by_name procname volume_by_name procname export
; ;
; extract the volume name from path1_ptr and find (or create) a vcr. ; extract the volume name from path1_ptr and find (or create) a vcr.
; ;
@ -490,8 +490,8 @@ done
bcs no_vcr bcs no_vcr
; store it for later... ; store it for later...
stx ptr ;stx ptr
sty ptr+2 ; sty ptr+2
jsl deref jsl deref
stx my_vcr stx my_vcr
@ -523,12 +523,12 @@ done
; I suppose reading a block could alloc memory and invalidate the vcr... ; I suppose reading a block could alloc memory and invalidate the vcr...
; ;
ldx ptr ;ldx ptr
ldy ptr+2 ;ldy ptr+2
jsl deref ;jsl deref
stx my_vcr ;stx my_vcr
sty my_vcr+2 ;sty my_vcr+2
; check the volume name here... ; check the volume name here...

View File

@ -228,3 +228,14 @@ displacement DS.L 1
end_struct end_struct
DevNumRecGS begin_struct
pCount DS.W 1
devName DS.L 1
devNum DS.W 1
end_struct
DevNumRec begin_struct
devName DS.B 4
devNum DS.B 2
end_struct

View File

@ -9,7 +9,6 @@ stubs proc
export destroy export destroy
export erase_disk export erase_disk
export format export format
export get_dev_num
export set_eof export set_eof
export set_file_info export set_file_info
export write export write