disasm: copy logic

This commit is contained in:
Joshua Bell 2018-12-25 22:07:22 -08:00
parent feaf2a9312
commit 0b65a3b27d
2 changed files with 227 additions and 188 deletions

View File

@ -9403,9 +9403,10 @@ do_copy_file:
jsr LA271 jsr LA271
jsr prep_op_jt_overlay1 jsr prep_op_jt_overlay1
L8F3F: copy #$FF, LE05B do_run2:
copy #$FF, LE05B
copy #0, LE05C copy #0, LE05C
jsr copy_file_with_flag jsr copy_file_for_run
jsr done_dialog_phase1 jsr done_dialog_phase1
L8F4F: jsr redraw_desktop_and_windows L8F4F: jsr redraw_desktop_and_windows
@ -9438,7 +9439,7 @@ do_run:
jsr L9984 jsr L9984
jsr LA271 jsr LA271
jsr L99BC jsr L99BC
jmp L8F3F jmp do_run2
;;; -------------------------------------------------- ;;; --------------------------------------------------
;;; Lock ;;; Lock
@ -9745,7 +9746,7 @@ stack_stash:
.byte 0 .byte 0
;; $80 = lock/unlock ;; $80 = lock/unlock
;; $C0 = get size (easily probed with oVerflow flag) ;; $C0 = get size/run (easily probed with oVerflow flag)
;; $00 = copy/delete ;; $00 = copy/delete
operation_flags: operation_flags:
.byte 0 .byte 0
@ -9759,10 +9760,12 @@ unlock_flag:
.byte 0 .byte 0
;; high bit set = from Selector > Run command (download???) ;; high bit set = from Selector > Run command (download???)
;; high bit clear = Get Size
run_flag: run_flag:
.byte 0 .byte 0
all_flag: .byte 0 all_flag:
.byte 0
;;; ============================================================ ;;; ============================================================
;;; For icon index in A, put pointer to name in $6 ;;; For icon index in A, put pointer to name in $6
@ -10444,23 +10447,25 @@ skip5_buf: .res 5, 0
.res 4, 0 ; unused??? .res 4, 0 ; unused???
buf_size = $AC0
DEFINE_CLOSE_PARAMS close_src_params DEFINE_CLOSE_PARAMS close_src_params
DEFINE_CLOSE_PARAMS close_dst_params DEFINE_CLOSE_PARAMS close_dst_params
DEFINE_DESTROY_PARAMS destroy_params, src_path_buf DEFINE_DESTROY_PARAMS destroy_params, src_path_buf
DEFINE_OPEN_PARAMS open_src_params, src_path_buf, $0D00 DEFINE_OPEN_PARAMS open_src_params, src_path_buf, $0D00
DEFINE_OPEN_PARAMS open_dst_params, dst_path_buf, $1100 DEFINE_OPEN_PARAMS open_dst_params, dst_path_buf, $1100
DEFINE_READ_PARAMS read_src_params, $1500, $AC0 DEFINE_READ_PARAMS read_src_params, $1500, buf_size
DEFINE_WRITE_PARAMS write_dst_params, $1500, $AC0 DEFINE_WRITE_PARAMS write_dst_params, $1500, buf_size
DEFINE_CREATE_PARAMS create_params3, dst_path_buf, ACCESS_DEFAULT DEFINE_CREATE_PARAMS create_params3, dst_path_buf, ACCESS_DEFAULT
DEFINE_CREATE_PARAMS create_params2, dst_path_buf DEFINE_CREATE_PARAMS create_params2, dst_path_buf
.byte 0,0 .byte 0,0
DEFINE_GET_FILE_INFO_PARAMS file_info_params2, src_path_buf DEFINE_GET_FILE_INFO_PARAMS src_file_info_params, src_path_buf
.byte 0 .byte 0
DEFINE_GET_FILE_INFO_PARAMS file_info_params3, dst_path_buf DEFINE_GET_FILE_INFO_PARAMS dst_file_info_params, dst_path_buf
.byte 0 .byte 0
@ -10776,78 +10781,82 @@ cancel: jmp close_files_cancel_dialog
;; copy logic (for drag/drop only) ??? ;; copy logic (for drag/drop only) ???
.proc copy_file .proc copy_file
copy #$80, LE05B copy #$80, LE05B
lda #0 copy #0, LE05C
sta LE05C beq :+ ; always
beq L9A0F ; always
with_flag: for_run:
lda #$FF lda #$FF
L9A0F: sta flag : sta is_run_flag
copy #CopyDialogLifecycle::show, copy_dialog_params::phase copy #CopyDialogLifecycle::show, copy_dialog_params::phase
jsr copy_paths_to_src_and_dst_paths jsr copy_paths_to_src_and_dst_paths
bit operation_flags bit operation_flags
bvc @not_size bvc @not_run
jsr L9BC9 jsr check_vol_blocks_free ; dst is a volume path (RAM Card)
@not_size: @not_run:
bit LE05B bit LE05B
bpl L9A70 bpl get_src_info ; never taken ???
bvs L9A50 bvs L9A50
lda flag lda is_run_flag
bne L9A36 bne :+
lda selected_window_index lda selected_window_index ; dragging from window?
bne L9A36 bne :+
jmp L9B28 jmp L9B28
L9A36: ldx dst_path_buf : ldx dst_path_buf
ldy src_path_slash_index ldy src_path_slash_index
dey dey
L9A3D: iny : iny
inx inx
lda src_path_buf,y lda src_path_buf,y
sta dst_path_buf,x sta dst_path_buf,x
cpy src_path_buf cpy src_path_buf
bne L9A3D bne :-
stx dst_path_buf
jmp L9A70
stx dst_path_buf
jmp get_src_info
;; Append filename to dst_path_buf
L9A50: ldx dst_path_buf L9A50: ldx dst_path_buf
lda #'/' lda #'/'
sta dst_path_buf+1,x sta dst_path_buf+1,x
inc dst_path_buf inc dst_path_buf
ldy #$00 ldy #0
ldx dst_path_buf ldx dst_path_buf
L9A60: iny : iny
inx inx
lda filename_buf,y lda filename_buf,y
sta dst_path_buf,x sta dst_path_buf,x
cpy filename_buf cpy filename_buf
bne L9A60 bne :-
stx dst_path_buf stx dst_path_buf
L9A70: yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params2
beq L9A81
jsr show_error_alert
jmp L9A70
L9A81: lda file_info_params2::storage_type get_src_info:
: yax_call JT_MLI_RELAY, GET_FILE_INFO, src_file_info_params
beq :+
jsr show_error_alert
jmp :- ; retry
: lda src_file_info_params::storage_type
cmp #ST_VOLUME_DIRECTORY cmp #ST_VOLUME_DIRECTORY
beq L9A90 beq is_dir
cmp #ST_LINKED_DIRECTORY cmp #ST_LINKED_DIRECTORY
beq L9A90 beq is_dir
lda #$00 lda #$00
beq L9A95 beq store
L9A90: jsr decrement_op_file_count is_dir: jsr decrement_op_file_count
lda #$FF lda #$FF
L9A95: sta L9B30 store: sta L9B30
jsr dec_file_count_and_run_copy_dialog_proc jsr dec_file_count_and_run_copy_dialog_proc
lda op_file_count+1 lda op_file_count+1
bne L9AA8 bne :+
lda op_file_count lda op_file_count
bne L9AA8 bne :+
jmp close_files_cancel_dialog jmp close_files_cancel_dialog
L9AA8: ldy #7 ;; Copy access, file_type, aux_type, storage_type
: lda file_info_params2,y : ldy #7
: lda src_file_info_params,y
sta create_params2,y sta create_params2,y
dey dey
cpy #2 cpy #2
@ -10855,28 +10864,33 @@ L9AA8: ldy #7
copy #ACCESS_DEFAULT, create_params2::access copy #ACCESS_DEFAULT, create_params2::access
lda LE05B lda LE05B
beq L9B23 beq create_ok ; never taken ???
jsr L9C01 jsr check_space_and_show_prompt
bcs done bcs done
;; Copy create_time/create_date
ldy #17 ldy #17
ldx #11 ldx #11
: lda file_info_params2,y : lda src_file_info_params,y
sta create_params2,x sta create_params2,x
dex dex
dey dey
cpy #13 cpy #13
bne :- bne :-
;; If a volume, need to create a subdir instead
lda create_params2::storage_type lda create_params2::storage_type
cmp #ST_VOLUME_DIRECTORY cmp #ST_VOLUME_DIRECTORY
bne L9AE0 bne do_create
lda #ST_LINKED_DIRECTORY lda #ST_LINKED_DIRECTORY
sta create_params2::storage_type sta create_params2::storage_type
L9AE0: yax_call JT_MLI_RELAY, CREATE, create_params2
beq L9B23 do_create:
yax_call JT_MLI_RELAY, CREATE, create_params2
beq create_ok
cmp #ERR_DUPLICATE_FILENAME cmp #ERR_DUPLICATE_FILENAME
bne L9B1D bne err
bit all_flag bit all_flag
bmi do_it bmi do_it
copy #CopyDialogLifecycle::exists, copy_dialog_params::phase copy #CopyDialogLifecycle::exists, copy_dialog_params::phase
@ -10892,28 +10906,31 @@ L9AE0: yax_call JT_MLI_RELAY, CREATE, create_params2
bne cancel bne cancel
lda #$80 lda #$80
sta all_flag sta all_flag
do_it: jsr LA426 do_it: jsr apply_file_info_and_size
jmp L9B23 jmp create_ok
;; PromptResult::cancel ;; PromptResult::cancel
cancel: jmp close_files_cancel_dialog cancel: jmp close_files_cancel_dialog
L9B1D: jsr show_error_alert err: jsr show_error_alert
jmp L9AE0 jmp do_create ; retry
L9B23: lda L9B30 create_ok:
lda L9B30
beq L9B2D beq L9B2D
L9B28: jmp process_dir L9B28: jmp process_dir
.byte 0 ; ??? .byte 0 ; ???
done: rts done: rts
L9B2D: jmp L9CDA L9B2D: jmp do_file_copy
L9B30: .byte 0 L9B30: .byte 0
flag: .byte 0 ; ???
is_run_flag:
.byte 0
.endproc .endproc
copy_file_with_flag := copy_file::with_flag copy_file_for_run := copy_file::for_run
src_path_slash_index: src_path_slash_index:
.byte 0 .byte 0
@ -10937,7 +10954,7 @@ op_jt2_copy:
;; Directory ;; Directory
jsr append_to_src_path jsr append_to_src_path
: yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params2 : yax_call JT_MLI_RELAY, GET_FILE_INFO, src_file_info_params
beq :+ beq :+
jsr show_error_alert jsr show_error_alert
jmp :- jmp :-
@ -10951,39 +10968,39 @@ op_jt2_copy:
bne :+ bne :+
jmp close_files_cancel_dialog jmp close_files_cancel_dialog
: jsr L9E19 : jsr try_create_dst
bcs :+ bcs :+
jsr remove_src_path_segment jsr remove_src_path_segment
jmp L9BBE jmp done
: jsr remove_dst_path_segment : jsr remove_dst_path_segment
jsr remove_src_path_segment jsr remove_src_path_segment
lda #$FF lda #$FF
sta cancel_descent_flag sta cancel_descent_flag
jmp L9BBE jmp done
;; File ;; File
regular_file: regular_file:
jsr append_to_dst_path jsr append_to_dst_path
jsr append_to_src_path jsr append_to_src_path
jsr dec_file_count_and_run_copy_dialog_proc jsr dec_file_count_and_run_copy_dialog_proc
L9B91: yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params2 : yax_call JT_MLI_RELAY, GET_FILE_INFO, src_file_info_params
beq L9BA2 beq :+
jsr show_error_alert jsr show_error_alert
jmp L9B91 jmp :- ; retry
L9BA2: jsr L9C01 : jsr check_space_and_show_prompt
bcc L9BAA bcc :+
jmp close_files_cancel_dialog jmp close_files_cancel_dialog
L9BAA: jsr remove_src_path_segment : jsr remove_src_path_segment
jsr L9E19 jsr try_create_dst
bcs L9BBB bcs :+
jsr append_to_src_path jsr append_to_src_path
jsr L9CDA jsr do_file_copy
jsr remove_src_path_segment jsr remove_src_path_segment
L9BBB: jsr remove_dst_path_segment : jsr remove_dst_path_segment
L9BBE: rts done: rts
.endproc .endproc
;;; ============================================================ ;;; ============================================================
@ -10995,25 +11012,26 @@ L9BBE: rts
;;; ============================================================ ;;; ============================================================
.proc L9BC9 .proc check_vol_blocks_free
yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params3 : yax_call JT_MLI_RELAY, GET_FILE_INFO, dst_file_info_params
beq L9BDA beq :+
jsr show_error_alert_dst jsr show_error_alert_dst
jmp L9BC9 jmp :-
L9BDA: sub16 file_info_params3::aux_type, file_info_params3::blocks_used, L9BFF : sub16 dst_file_info_params::aux_type, dst_file_info_params::blocks_used, blocks_free
cmp16 L9BFF, op_block_count cmp16 blocks_free, op_block_count
bcs L9BFE bcs :+
jmp done_dialog_phase3 jmp done_dialog_phase3
L9BFE: rts : rts
L9BFF: .word 0 blocks_free:
.word 0
.endproc .endproc
;;; ============================================================ ;;; ============================================================
.proc L9C01 .proc check_space_and_show_prompt
jsr check_space jsr check_space
bcc done bcc done
copy #CopyDialogLifecycle::too_large, copy_dialog_params::phase copy #CopyDialogLifecycle::too_large, copy_dialog_params::phase
@ -11026,7 +11044,7 @@ done: rts
.proc check_space .proc check_space
;; Size of source ;; Size of source
: yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params2 : yax_call JT_MLI_RELAY, GET_FILE_INFO, src_file_info_params
beq :+ beq :+
jsr show_error_alert jsr show_error_alert
jmp :- jmp :-
@ -11037,7 +11055,7 @@ done: rts
sta existing_size+1 sta existing_size+1
;; Does destination exist? ;; Does destination exist?
: yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params3 : yax_call JT_MLI_RELAY, GET_FILE_INFO, dst_file_info_params
beq got_exist_size beq got_exist_size
cmp #ERR_FILE_NOT_FOUND cmp #ERR_FILE_NOT_FOUND
beq :+ beq :+
@ -11045,7 +11063,7 @@ done: rts
jmp :- jmp :-
got_exist_size: got_exist_size:
copy16 file_info_params3::blocks_used, existing_size copy16 dst_file_info_params::blocks_used, existing_size
;; Compute destination volume path ;; Compute destination volume path
: lda dst_path_buf : lda dst_path_buf
@ -11062,7 +11080,7 @@ got_exist_size:
sta vol_path_length sta vol_path_length
;; Total blocks/used blocks on destination volume ;; Total blocks/used blocks on destination volume
: yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params3 : yax_call JT_MLI_RELAY, GET_FILE_INFO, dst_file_info_params
beq got_info beq got_info
pha ; on failure, restore path pha ; on failure, restore path
lda saved_length ; in case copy is aborted lda saved_length ; in case copy is aborted
@ -11080,9 +11098,9 @@ got_exist_size:
got_info: got_info:
;; aux = total blocks ;; aux = total blocks
sub16 file_info_params3::aux_type, file_info_params3::blocks_used, blocks_free sub16 dst_file_info_params::aux_type, dst_file_info_params::blocks_used, blocks_free
add16 blocks_free, existing_size, blocks_free add16 blocks_free, existing_size, blocks_free
cmp16 blocks_free, file_info_params2::blocks_used cmp16 blocks_free, src_file_info_params::blocks_used
bcs has_room bcs has_room
;; not enough room ;; not enough room
@ -11107,11 +11125,12 @@ existing_size:
.endproc .endproc
;;; ============================================================ ;;; ============================================================
;;; Actual byte-for-byte file copy routine
.proc L9CDA .proc do_file_copy
jsr decrement_op_file_count jsr decrement_op_file_count
lda #$00 lda #0
sta dst_ok_flag sta src_dst_exclusive_flag
sta src_eof_flag sta src_eof_flag
sta mark_src_params::position sta mark_src_params::position
sta mark_src_params::position+1 sta mark_src_params::position+1
@ -11119,56 +11138,67 @@ existing_size:
sta mark_dst_params::position sta mark_dst_params::position
sta mark_dst_params::position+1 sta mark_dst_params::position+1
sta mark_dst_params::position+2 sta mark_dst_params::position+2
jsr open_src jsr open_src
jsr copy_src_ref_num jsr copy_src_ref_num
jsr open_dst jsr open_dst
beq L9D09 beq :+
;; Destination not available; note it, can prompt later
lda #$FF lda #$FF
sta dst_ok_flag sta src_dst_exclusive_flag
bne L9D0C bne read
L9D09: jsr copy_dst_ref_num : jsr copy_dst_ref_num
L9D0C: jsr L9DA9
bit dst_ok_flag ;; Read
bpl L9D28 read: jsr read_src
jsr close_src bit src_dst_exclusive_flag
L9D17: jsr open_dst bpl write
bne L9D17 jsr close_src ; swap if necessary
: jsr open_dst
bne :-
jsr copy_dst_ref_num jsr copy_dst_ref_num
yax_call JT_MLI_RELAY, SET_MARK, mark_dst_params yax_call JT_MLI_RELAY, SET_MARK, mark_dst_params
L9D28: bit src_eof_flag
bmi L9D51 ;; Write
write: bit src_eof_flag
bmi eof
jsr write_dst jsr write_dst
bit dst_ok_flag bit src_dst_exclusive_flag
bpl L9D0C bpl read
jsr close_dst jsr close_dst ; swap if necessary
jsr open_src jsr open_src
jsr copy_src_ref_num jsr copy_src_ref_num
yax_call JT_MLI_RELAY, SET_MARK, mark_src_params yax_call JT_MLI_RELAY, SET_MARK, mark_src_params
beq L9D0C beq read
lda #$FF lda #$FF
sta src_eof_flag sta src_eof_flag
jmp L9D0C jmp read
L9D51: jsr close_dst ;; EOF
bit dst_ok_flag eof: jsr close_dst
bmi L9D5C bit src_dst_exclusive_flag
bmi :+
jsr close_src jsr close_src
L9D5C: jsr LA46D : jsr copy_file_info
jmp LA479 jmp set_dst_file_info
open_src: .proc open_src
: yax_call JT_MLI_RELAY, OPEN, open_src_params : yax_call JT_MLI_RELAY, OPEN, open_src_params
beq :+ beq :+
jsr show_error_alert jsr show_error_alert
jmp :- jmp :-
: rts : rts
.endproc
copy_src_ref_num: .proc copy_src_ref_num
lda open_src_params::ref_num lda open_src_params::ref_num
sta read_src_params::ref_num sta read_src_params::ref_num
sta close_src_params::ref_num sta close_src_params::ref_num
sta mark_src_params::ref_num sta mark_src_params::ref_num
rts rts
.endproc
.proc open_dst .proc open_dst
: yax_call JT_MLI_RELAY, OPEN, open_dst_params : yax_call JT_MLI_RELAY, OPEN, open_dst_params
@ -11185,15 +11215,16 @@ not_found:
done: rts done: rts
.endproc .endproc
copy_dst_ref_num: .proc copy_dst_ref_num
lda open_dst_params::ref_num lda open_dst_params::ref_num
sta write_dst_params::ref_num sta write_dst_params::ref_num
sta close_dst_params::ref_num sta close_dst_params::ref_num
sta mark_dst_params::ref_num sta mark_dst_params::ref_num
rts rts
.endproc
.proc L9DA9 .proc read_src
copy16 #$0AC0, read_src_params::request_count copy16 #buf_size, read_src_params::request_count
: yax_call JT_MLI_RELAY, READ, read_src_params : yax_call JT_MLI_RELAY, READ, read_src_params
beq :+ beq :+
cmp #ERR_END_OF_FILE cmp #ERR_END_OF_FILE
@ -11229,7 +11260,8 @@ eof: lda #$FF
rts rts
.endproc .endproc
dst_ok_flag: ;; Set if src/dst can't be open simultaneously.
src_dst_exclusive_flag:
.byte 0 .byte 0
src_eof_flag: src_eof_flag:
@ -11237,45 +11269,48 @@ src_eof_flag:
.endproc .endproc
;;; ============================================================
.proc L9E19 .proc try_create_dst
ldx #7 ldx #7
: lda file_info_params2,x : lda src_file_info_params,x
sta create_params3,x sta create_params3,x
dex dex
cpx #3 cpx #3
bne :- bne :-
L9E26: yax_call JT_MLI_RELAY, CREATE, create_params3 L9E26: yax_call JT_MLI_RELAY, CREATE, create_params3
beq L9E6F beq success
cmp #ERR_DUPLICATE_FILENAME cmp #ERR_DUPLICATE_FILENAME
bne L9E69 bne err
bit all_flag bit all_flag
bmi L9E60 bmi yes
copy #CopyDialogLifecycle::exists, copy_dialog_params::phase copy #CopyDialogLifecycle::exists, copy_dialog_params::phase
yax_call invoke_dialog_proc, index_copy_dialog, copy_dialog_params yax_call invoke_dialog_proc, index_copy_dialog, copy_dialog_params
pha pha
copy #CopyDialogLifecycle::show, copy_dialog_params::phase copy #CopyDialogLifecycle::show, copy_dialog_params::phase
pla pla
cmp #2 cmp #PromptResult::yes
beq L9E60 beq yes
cmp #3 cmp #PromptResult::no
beq L9E71 beq failure
cmp #4 cmp #PromptResult::all
bne L9E66 bne cancel
copy #$80, all_flag copy #$80, all_flag
L9E60: jsr LA426 yes: jsr apply_file_info_and_size
jmp L9E6F jmp success
L9E66: jmp close_files_cancel_dialog cancel: jmp close_files_cancel_dialog
L9E69: jsr show_error_alert_dst err: jsr show_error_alert_dst
jmp L9E26 jmp L9E26
L9E6F: clc success:
clc
rts rts
L9E71: sec failure:
sec
rts rts
.endproc .endproc
@ -11343,12 +11378,12 @@ count: .word 0
.proc delete_file .proc delete_file
copy #DeleteDialogLifecycle::show, delete_dialog_params::phase copy #DeleteDialogLifecycle::show, delete_dialog_params::phase
jsr copy_paths_to_src_and_dst_paths jsr copy_paths_to_src_and_dst_paths
L9EE3: yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params2 L9EE3: yax_call JT_MLI_RELAY, GET_FILE_INFO, src_file_info_params
beq L9EF4 beq L9EF4
jsr show_error_alert jsr show_error_alert
jmp L9EE3 jmp L9EE3
L9EF4: lda file_info_params2::storage_type L9EF4: lda src_file_info_params::storage_type
sta L9F1D sta L9F1D
cmp #ST_LINKED_DIRECTORY cmp #ST_LINKED_DIRECTORY
beq L9F02 beq L9F02
@ -11395,17 +11430,17 @@ L9F29: yax_call JT_MLI_RELAY, DESTROY, destroy_params
L9F5F: jmp close_files_cancel_dialog L9F5F: jmp close_files_cancel_dialog
do_it: yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params2 do_it: yax_call JT_MLI_RELAY, GET_FILE_INFO, src_file_info_params
lda file_info_params2::access lda src_file_info_params::access
and #$80 and #$80
bne done bne done
lda #ACCESS_DEFAULT lda #ACCESS_DEFAULT
sta file_info_params2::access sta src_file_info_params::access
lda #7 ; param count for SET_FILE_INFO lda #7 ; param count for SET_FILE_INFO
sta file_info_params2 sta src_file_info_params
yax_call JT_MLI_RELAY, SET_FILE_INFO, file_info_params2 yax_call JT_MLI_RELAY, SET_FILE_INFO, src_file_info_params
lda #$A ; param count for GET_FILE_INFO lda #$A ; param count for GET_FILE_INFO
sta file_info_params2 sta src_file_info_params
jmp L9F29 jmp L9F29
done: rts done: rts
@ -11425,12 +11460,12 @@ L9F8E: jsr show_error_alert
bmi L9FA7 bmi L9FA7
jsr dec_file_count_and_run_delete_dialog_proc jsr dec_file_count_and_run_delete_dialog_proc
L9FA7: jsr decrement_op_file_count L9FA7: jsr decrement_op_file_count
L9FAA: yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params2 L9FAA: yax_call JT_MLI_RELAY, GET_FILE_INFO, src_file_info_params
beq :+ beq :+
jsr show_error_alert jsr show_error_alert
jmp L9FAA jmp L9FAA
: lda file_info_params2::storage_type : lda src_file_info_params::storage_type
cmp #ST_LINKED_DIRECTORY cmp #ST_LINKED_DIRECTORY
beq next_file beq next_file
loop: yax_call JT_MLI_RELAY, DESTROY, destroy_params loop: yax_call JT_MLI_RELAY, DESTROY, destroy_params
@ -11456,10 +11491,10 @@ loop: yax_call JT_MLI_RELAY, DESTROY, destroy_params
;; PromptResult::cancel ;; PromptResult::cancel
: jmp close_files_cancel_dialog : jmp close_files_cancel_dialog
unlock: copy #ACCESS_DEFAULT, file_info_params2::access unlock: copy #ACCESS_DEFAULT, src_file_info_params::access
copy #7, file_info_params2 ; param count for SET_FILE_INFO copy #7, src_file_info_params ; param count for SET_FILE_INFO
yax_call JT_MLI_RELAY, SET_FILE_INFO, file_info_params2 yax_call JT_MLI_RELAY, SET_FILE_INFO, src_file_info_params
copy #$A,file_info_params2 ; param count for GET_FILE_INFO copy #$A,src_file_info_params ; param count for GET_FILE_INFO
jmp loop jmp loop
LA01C: jsr show_error_alert LA01C: jsr show_error_alert
@ -11605,12 +11640,12 @@ LA123: iny
cpy src_path_buf cpy src_path_buf
bne LA123 bne LA123
stx dst_path_buf stx dst_path_buf
LA133: yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params2 LA133: yax_call JT_MLI_RELAY, GET_FILE_INFO, src_file_info_params
beq LA144 beq LA144
jsr show_error_alert jsr show_error_alert
jmp LA133 jmp LA133
LA144: lda file_info_params2::storage_type LA144: lda src_file_info_params::storage_type
sta LA169 sta LA169
cmp #ST_VOLUME_DIRECTORY cmp #ST_VOLUME_DIRECTORY
beq LA156 beq LA156
@ -11642,11 +11677,11 @@ op_jt_1_lock:
jsr update_dialog jsr update_dialog
jsr decrement_op_file_count jsr decrement_op_file_count
: yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params2 : yax_call JT_MLI_RELAY, GET_FILE_INFO, src_file_info_params
beq :+ beq :+
jsr show_error_alert jsr show_error_alert
jmp :- jmp :-
: lda file_info_params2::storage_type : lda src_file_info_params::storage_type
cmp #ST_VOLUME_DIRECTORY cmp #ST_VOLUME_DIRECTORY
beq ok beq ok
cmp #ST_LINKED_DIRECTORY cmp #ST_LINKED_DIRECTORY
@ -11656,12 +11691,12 @@ op_jt_1_lock:
lda #ACCESS_DEFAULT lda #ACCESS_DEFAULT
bne set bne set
: lda #ACCESS_LOCKED : lda #ACCESS_LOCKED
set: sta file_info_params2::access set: sta src_file_info_params::access
: copy #7, file_info_params2 ; param count for SET_FILE_INFO : copy #7, src_file_info_params ; param count for SET_FILE_INFO
yax_call JT_MLI_RELAY, SET_FILE_INFO, file_info_params2 yax_call JT_MLI_RELAY, SET_FILE_INFO, src_file_info_params
pha pha
copy #$A, file_info_params2 ; param count for GET_FILE_INFO copy #$A, src_file_info_params ; param count for GET_FILE_INFO
pla pla
beq ok beq ok
jsr show_error_alert jsr show_error_alert
@ -11752,12 +11787,12 @@ op_jt_overlay4:
.proc LA271 .proc LA271
jsr copy_paths_to_src_and_dst_paths jsr copy_paths_to_src_and_dst_paths
: yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params2 : yax_call JT_MLI_RELAY, GET_FILE_INFO, src_file_info_params
beq :+ beq :+
jsr show_error_alert jsr show_error_alert
jmp :- jmp :-
: copy file_info_params2::storage_type, storage_type : copy src_file_info_params::storage_type, storage_type
cmp #ST_VOLUME_DIRECTORY cmp #ST_VOLUME_DIRECTORY
beq is_dir beq is_dir
cmp #ST_LINKED_DIRECTORY cmp #ST_LINKED_DIRECTORY
@ -11796,9 +11831,9 @@ op_jt_1_size:
;; If operation is "get size", add the block count to the sum ;; If operation is "get size", add the block count to the sum
jsr append_to_src_path jsr append_to_src_path
yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params2 yax_call JT_MLI_RELAY, GET_FILE_INFO, src_file_info_params
bne :+ bne :+
add16 op_block_count, file_info_params2::blocks_used, op_block_count add16 op_block_count, src_file_info_params::blocks_used, op_block_count
: inc16 op_file_count : inc16 op_file_count
@ -12005,44 +12040,46 @@ LA425: .byte 0 ; ??? only written to (with 0)
;;; ============================================================ ;;; ============================================================
.proc LA426 .proc apply_file_info_and_size
jsr LA46D : jsr copy_file_info
copy #ACCESS_DEFAULT, file_info_params3::access copy #ACCESS_DEFAULT, dst_file_info_params::access
jsr LA479 jsr set_dst_file_info
lda file_info_params2::file_type lda src_file_info_params::file_type
cmp #$0F cmp #FT_DIRECTORY
beq LA46C beq done
yax_call JT_MLI_RELAY, OPEN, open_dst_params
beq LA449
jsr show_error_alert_dst
jmp LA426
LA449: lda open_dst_params::ref_num ;; If a regular file, open/set eof/close
yax_call JT_MLI_RELAY, OPEN, open_dst_params
beq :+
jsr show_error_alert_dst
jmp :- ; retry
: lda open_dst_params::ref_num
sta set_eof_params::ref_num sta set_eof_params::ref_num
sta close_dst_params::ref_num sta close_dst_params::ref_num
LA452: yax_call JT_MLI_RELAY, SET_EOF, set_eof_params : yax_call JT_MLI_RELAY, SET_EOF, set_eof_params
beq LA463 beq close
jsr show_error_alert_dst jsr show_error_alert_dst
jmp LA452 jmp :- ; retry
LA463: yax_call JT_MLI_RELAY, CLOSE, close_dst_params close: yax_call JT_MLI_RELAY, CLOSE, close_dst_params
LA46C: rts done: rts
.endproc .endproc
.proc LA46D .proc copy_file_info
COPY_BYTES 11, file_info_params2::access, file_info_params3::access COPY_BYTES 11, src_file_info_params::access, dst_file_info_params::access
rts rts
.endproc .endproc
.proc LA479 .proc set_dst_file_info
copy #7, file_info_params3 ; SET_FILE_INFO param_count : copy #7, dst_file_info_params ; SET_FILE_INFO param_count
yax_call JT_MLI_RELAY, SET_FILE_INFO, file_info_params3 yax_call JT_MLI_RELAY, SET_FILE_INFO, dst_file_info_params
pha pha
copy #$A, file_info_params3 ; GET_FILE_INFO param_count copy #$A, dst_file_info_params ; GET_FILE_INFO param_count
pla pla
beq done beq done
jsr show_error_alert_dst jsr show_error_alert_dst
jmp LA479 jmp :-
done: rts done: rts
.endproc .endproc

View File

@ -942,7 +942,9 @@ path_buf3:
filename_buf: filename_buf:
.res 16, 0 .res 16, 0
;; Set to $80 for Copy, $FF for Run
LE05B: .byte 0 LE05B: .byte 0
LE05C: .byte 0 ; flag - always set to 0 ??? LE05C: .byte 0 ; flag - always set to 0 ???
process_depth: process_depth: