mirror of
https://github.com/a2stuff/prodos-path.git
synced 2025-03-01 05:30:46 +00:00
Use TXBUF2 (80) for command path
This commit is contained in:
parent
3f11e3584a
commit
ec0366bb15
53
path.s
53
path.s
@ -245,9 +245,14 @@ not_ours:
|
|||||||
jmp $ffff ; Execute next command in chain
|
jmp $ffff ; Execute next command in chain
|
||||||
|
|
||||||
|
|
||||||
|
;;; ============================================================
|
||||||
|
|
||||||
|
cmd_path_buffer := $280
|
||||||
|
|
||||||
|
|
||||||
.proc get_file_info_params
|
.proc get_file_info_params
|
||||||
param_count: .byte $A
|
param_count: .byte $A
|
||||||
pathname: .addr command_path_buffer
|
pathname: .addr cmd_path_buffer
|
||||||
access: .byte 0
|
access: .byte 0
|
||||||
file_type: .byte 0
|
file_type: .byte 0
|
||||||
aux_type: .word 0
|
aux_type: .word 0
|
||||||
@ -258,16 +263,13 @@ mod_time: .word 0
|
|||||||
create_date: .word 0
|
create_date: .word 0
|
||||||
create_time: .word 0
|
create_time: .word 0
|
||||||
.endproc
|
.endproc
|
||||||
page_num9 := get_file_info_params::pathname+1
|
|
||||||
|
|
||||||
.proc open_params
|
.proc open_params
|
||||||
param_count: .byte 3
|
param_count: .byte 3
|
||||||
pathname: .addr command_path_buffer
|
pathname: .addr cmd_path_buffer
|
||||||
io_buffer: .addr handler + $200
|
io_buffer: .addr 0
|
||||||
ref_num: .byte 0
|
ref_num: .byte 0
|
||||||
.endproc
|
.endproc
|
||||||
page_num10 := open_params::pathname+1
|
|
||||||
page_num11 := open_params::io_buffer+1
|
|
||||||
|
|
||||||
.proc read_params
|
.proc read_params
|
||||||
param_count: .byte 4
|
param_count: .byte 4
|
||||||
@ -287,16 +289,14 @@ maybe_invoke:
|
|||||||
ldx #0
|
ldx #0
|
||||||
page_num12 := *+2 ; address needing updating
|
page_num12 := *+2 ; address needing updating
|
||||||
: lda path_buffer+1,x
|
: lda path_buffer+1,x
|
||||||
page_num13 := *+2 ; address needing updating
|
sta cmd_path_buffer+1,x
|
||||||
sta command_path_buffer+1,x
|
|
||||||
inx
|
inx
|
||||||
page_num14 := *+2 ; address needing updating
|
page_num14 := *+2 ; address needing updating
|
||||||
cpx path_buffer
|
cpx path_buffer
|
||||||
bne :-
|
bne :-
|
||||||
|
|
||||||
lda #'/'
|
lda #'/'
|
||||||
page_num15 := *+2 ; address needing updating
|
sta cmd_path_buffer+1,x
|
||||||
sta command_path_buffer+1,x
|
|
||||||
inx
|
inx
|
||||||
|
|
||||||
ldy #0
|
ldy #0
|
||||||
@ -317,32 +317,33 @@ maybe_invoke:
|
|||||||
cmp #'z'+1
|
cmp #'z'+1
|
||||||
bcs notok
|
bcs notok
|
||||||
|
|
||||||
page_num16 := *+2 ; address needing updating
|
ok: sta cmd_path_buffer+1,x
|
||||||
ok: sta command_path_buffer+1,x
|
|
||||||
inx
|
|
||||||
iny
|
iny
|
||||||
bne :-
|
inx
|
||||||
|
cpx #65 ; Maximum path length+1
|
||||||
|
bcc :-
|
||||||
|
bcs fail
|
||||||
|
|
||||||
page_num17 := *+2 ; address needing updating
|
notok: stx cmd_path_buffer
|
||||||
notok: stx command_path_buffer
|
|
||||||
|
|
||||||
|
;; Check to see if path exists.
|
||||||
jsr MLI
|
jsr MLI
|
||||||
.byte GET_FILE_INFO
|
.byte GET_FILE_INFO
|
||||||
page_num19 := *+1
|
page_num19 := *+1
|
||||||
.addr get_file_info_params
|
.addr get_file_info_params
|
||||||
beq :+
|
beq :+
|
||||||
sec ; no such file - signal it's not us
|
|
||||||
|
fail: sec ; no such file - signal it's not us
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
;; Check to see if type is CMD.
|
||||||
page_num23 := *+2
|
page_num23 := *+2
|
||||||
: lda get_file_info_params::file_type
|
: lda get_file_info_params::file_type
|
||||||
cmp #$F0 ; CMD
|
cmp #$F0 ; CMD
|
||||||
beq :+
|
bne fail ; wrong type - ignore it
|
||||||
sec ; wrong type - ignore it
|
|
||||||
rts
|
|
||||||
|
|
||||||
;; Tell BASIC.SYSTEM it was handled.
|
;; Tell BASIC.SYSTEM it was handled.
|
||||||
: lda #0
|
lda #0
|
||||||
sta XCNUM
|
sta XCNUM
|
||||||
sta PBITS
|
sta PBITS
|
||||||
sta PBITS+1
|
sta PBITS+1
|
||||||
@ -469,9 +470,6 @@ command_string:
|
|||||||
path_buffer:
|
path_buffer:
|
||||||
.res 65, 0
|
.res 65, 0
|
||||||
|
|
||||||
command_path_buffer:
|
|
||||||
.res 65, 0
|
|
||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
handler_end := *-1
|
handler_end := *-1
|
||||||
handler_pages = (.sizeof(handler) + $FF) / $100
|
handler_pages = (.sizeof(handler) + $FF) / $100
|
||||||
@ -492,15 +490,8 @@ relocation_table:
|
|||||||
.addr handler::page_num6
|
.addr handler::page_num6
|
||||||
.addr handler::page_num7
|
.addr handler::page_num7
|
||||||
.addr handler::page_num8
|
.addr handler::page_num8
|
||||||
.addr handler::page_num9
|
|
||||||
.addr handler::page_num10
|
|
||||||
.addr handler::page_num11
|
|
||||||
.addr handler::page_num12
|
.addr handler::page_num12
|
||||||
.addr handler::page_num13
|
|
||||||
.addr handler::page_num14
|
.addr handler::page_num14
|
||||||
.addr handler::page_num15
|
|
||||||
.addr handler::page_num16
|
|
||||||
.addr handler::page_num17
|
|
||||||
.addr handler::page_num18
|
.addr handler::page_num18
|
||||||
.addr handler::page_num19
|
.addr handler::page_num19
|
||||||
.addr handler::page_num20
|
.addr handler::page_num20
|
||||||
|
@ -8,6 +8,12 @@ OPEN = $C8
|
|||||||
READ = $CA
|
READ = $CA
|
||||||
CLOSE = $CC
|
CLOSE = $CC
|
||||||
|
|
||||||
|
.macro MLI_CALL cmd, params
|
||||||
|
jsr MLI
|
||||||
|
.byte cmd
|
||||||
|
.addr params
|
||||||
|
.endmacro
|
||||||
|
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
;;; BASIC.SYSTEM Global Page
|
;;; BASIC.SYSTEM Global Page
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user