return unix storage type for block, character, fifo, socket, white out

This commit is contained in:
Kelvin Sherlock 2015-08-12 13:13:44 -04:00
parent cb27c2e2d9
commit 656e83f002

View File

@ -177,16 +177,56 @@ do_storage_type proc
lda disk_inode.mode lda disk_inode.mode
; check for directory. GS/OS doesn't have concepts for other types (yet). ; check for directory. GS/OS doesn't have concepts for other types (yet).
phx ; save
and #S_IFMT ; $f000
xba
lsr a
lsr a
lsr a
tax
jsr (table,x)
table
dc.w unknown
dc.w fifo
dc.w chr
dc.w unknown
dc.w dir
dc.w unknown
dc.w blk
dc.w unknown
dc.w reg
dc.w unknown
dc.w lnk
dc.w unknown
dc.w sock
dc.w unknown
dc.w wht
dc.w unknown
unknown
lda #0
bra store
fifo:
chr:
blk:
lnk:
sock:
wht:
lda disk_inode.mode
and #S_IFMT and #S_IFMT
cmp #S_IFDIR
beq dir
lda #1
bra store bra store
dir dir
lda #$0d lda #$0d
bra store
reg
lda #1 ; could base it on size but whatever!
; drop through
store store
plx ; restore
sta [param_blk_ptr],y sta [param_blk_ptr],y
rts rts