disasm: operation callbacks

This commit is contained in:
Joshua Bell 2018-12-26 09:47:26 -08:00
parent 0b65a3b27d
commit 700c0e53e4
2 changed files with 80 additions and 102 deletions

View File

@ -1576,8 +1576,7 @@ L9F98: lda #0
sta L9F92 sta L9F92
beq L9FA4 beq L9FA4
L9F9F: lda #$80 L9F9F: copy #$80, L9F92
sta L9F92
.proc L9FA4 .proc L9FA4
ldy #IconEntry::win_type ldy #IconEntry::win_type
@ -2087,8 +2086,7 @@ window_id: .byte 0
beq volume beq volume
;; File (i.e. icon in window) ;; File (i.e. icon in window)
lda #$80 copy #$80, LA3B7
sta LA3B7
MGTK_CALL MGTK::SetPattern, white_pattern MGTK_CALL MGTK::SetPattern, white_pattern
MGTK_CALL MGTK::FrontWindow, frontwindow_params MGTK_CALL MGTK::FrontWindow, frontwindow_params
lda frontwindow_params::window_id lda frontwindow_params::window_id
@ -2197,9 +2195,8 @@ LA4C5: pla
LA4CB: .byte 0 LA4CB: .byte 0
LA4CC: lda #$80 LA4CC: copy #$80, LA4CB
sta LA4CB bmi LA4E2 ; always
bmi LA4E2
LA4D3: pha LA4D3: pha
lda #$40 lda #$40
sta LA4CB sta LA4CB
@ -2466,8 +2463,7 @@ LA77D: lda LA6B3,x
bne LA7C3 bne LA7C3
sta LA6B2 sta LA6B2
beq LA7C8 beq LA7C8
LA7C3: lda #$80 LA7C3: copy #$80, LA6B2
sta LA6B2
LA7C8: ldy #4 LA7C8: ldy #4
lda ($06),y lda ($06),y
and #$80 and #$80

View File

@ -1618,8 +1618,7 @@ nope: dex
sta close_ref_num sta close_ref_num
jsr read jsr read
jsr close jsr close
lda #$80 copy #$80, running_da_flag
sta running_da_flag
;; Invoke it ;; Invoke it
jsr set_pointer_cursor jsr set_pointer_cursor
@ -2347,8 +2346,7 @@ L5246: lda L5263,x
dex dex
bpl L5246 bpl L5246
lda #$80 copy #$80, L4152
sta L4152
jsr reset_grafport3 jsr reset_grafport3
jsr L6C19 jsr L6C19
jsr update_scrollbars jsr update_scrollbars
@ -4060,8 +4058,7 @@ L601F: MGTK_RELAY_CALL MGTK::FrameRect, rect_E230
bit L60D3 bit L60D3
bpl L6068 bpl L6068
L6054: copy16 event_xcoord, rect_E230::x1 L6054: copy16 event_xcoord, rect_E230::x1
lda #$80 copy #$80, L60D3
sta L60D3
jmp L6079 jmp L6079
L6068: copy16 event_xcoord, rect_E230::x2 L6068: copy16 event_xcoord, rect_E230::x2
@ -4074,8 +4071,7 @@ L6079: cmp16 event_ycoord, rect_E230::y2
bit L60D4 bit L60D4
bpl L60AE bpl L60AE
L609A: copy16 event_ycoord, rect_E230::y1 L609A: copy16 event_ycoord, rect_E230::y1
lda #$80 copy #$80, L60D4
sta L60D4
jmp L60BF jmp L60BF
L60AE: copy16 event_ycoord, rect_E230::y2 L60AE: copy16 event_ycoord, rect_E230::y2
@ -4727,8 +4723,7 @@ enable:
jsr configure_menu_item jsr configure_menu_item
lda #4 ; > Run lda #4 ; > Run
jsr configure_menu_item jsr configure_menu_item
lda #$80 copy #$80, LD344
sta LD344
rts rts
configure_menu_item: configure_menu_item:
@ -4929,8 +4924,7 @@ L6989: MGTK_RELAY_CALL MGTK::FrameRect, rect_E230
bit L6A3D bit L6A3D
bpl L69D2 bpl L69D2
L69BE: copy16 event_xcoord, rect_E230::x1 L69BE: copy16 event_xcoord, rect_E230::x1
lda #$80 copy #$80, L6A3D
sta L6A3D
jmp L69E3 jmp L69E3
L69D2: copy16 event_xcoord, rect_E230::x2 L69D2: copy16 event_xcoord, rect_E230::x2
@ -4943,8 +4937,7 @@ L69E3: cmp16 event_ycoord, rect_E230::y2
bit L6A3E bit L6A3E
bpl L6A18 bpl L6A18
L6A04: copy16 event_ycoord, rect_E230::y1 L6A04: copy16 event_ycoord, rect_E230::y1
lda #$80 copy #$80, L6A3E
sta L6A3E
jmp L6A29 jmp L6A29
L6A18: copy16 event_ycoord, rect_E230::y2 L6A18: copy16 event_ycoord, rect_E230::y2
@ -5502,8 +5495,7 @@ flag: .byte 0
sta disableitem_params::menu_item sta disableitem_params::menu_item
MGTK_RELAY_CALL MGTK::DisableItem, disableitem_params MGTK_RELAY_CALL MGTK::DisableItem, disableitem_params
lda #$80 copy #$80, menu_dispatch_flag
sta menu_dispatch_flag
rts rts
.endproc .endproc
@ -6847,8 +6839,7 @@ not_pad:
clc clc
adc #'0' ; why not ORA $30 ??? adc #'0' ; why not ORA $30 ???
pha pha
lda #$80 copy #$80, nonzero_flag
sta nonzero_flag
pla pla
;; Place the character, move to next ;; Place the character, move to next
@ -7811,8 +7802,7 @@ sloop: cmp16 value, powers,x
not_pad: not_pad:
ora #'0' ora #'0'
pha pha
lda #$80 copy #$80, nonzero_flag
sta nonzero_flag
pla pla
;; Place the character, move to next ;; Place the character, move to next
@ -9029,8 +9019,7 @@ L8BC1: lda grafport2,x
sub16 $085A, $0802, L8D52 sub16 $085A, $0802, L8D52
bit L8D51 bit L8D51
bpl L8C6A bpl L8C6A
lda #$80 copy #$80, L8D4E
sta L8D4E
lda L8D50 lda L8D50
eor #$FF eor #$FF
sta L8D50 sta L8D50
@ -9040,8 +9029,7 @@ L8BC1: lda grafport2,x
inc16 L8D50 inc16 L8D50
L8C6A: bit L8D53 L8C6A: bit L8D53
bpl L8C8C bpl L8C8C
lda #$80 copy #$80, L8D4F
sta L8D4F
lda L8D52 lda L8D52
eor #$FF eor #$FF
sta L8D52 sta L8D52
@ -9304,8 +9292,7 @@ load: pha ; entry point with bit clear
restore: restore:
pha pha
lda #$80 ; entry point with bit set copy #$80, restore_flag ; entry point with bit set
sta restore_flag
: pla : pla
asl a ; y = A * 2 (to index into word table) asl a ; y = A * 2 (to index into word table)
@ -9363,8 +9350,8 @@ open: MLI_RELAY_CALL OPEN, open_params
.endenum .endenum
jt_drop: jmp do_drop jt_drop: jmp do_drop
jmp rts2 ; rts jmp do_nothing ; rts
jmp rts2 ; rts jmp do_nothing ; rts
jt_get_info: jmp do_get_info ; cmd_get_info jt_get_info: jmp do_get_info ; cmd_get_info
jt_lock: jmp do_lock ; cmd_lock jt_lock: jmp do_lock ; cmd_lock
jt_unlock: jmp do_unlock ; cmd_unlock jt_unlock: jmp do_unlock ; cmd_unlock
@ -9372,8 +9359,8 @@ jt_rename_icon: jmp do_rename_icon ; cmd_rename_icon
jt_eject: jmp do_eject ; cmd_eject ??? jt_eject: jmp do_eject ; cmd_eject ???
jt_copy_file: jmp do_copy_file ; cmd_copy_file jt_copy_file: jmp do_copy_file ; cmd_copy_file
jt_delete_file: jmp do_delete_file ; cmd_delete_file jt_delete_file: jmp do_delete_file ; cmd_delete_file
jmp rts2 ; rts jmp do_nothing ; rts
jmp rts2 ; rts jmp do_nothing ; rts
jt_run: jmp do_run ; cmd_selector_action / Run jt_run: jmp do_run ; cmd_selector_action / Run
jt_get_size: jmp do_get_size ; cmd_get_size jt_get_size: jmp do_get_size ; cmd_get_size
@ -9398,10 +9385,10 @@ do_copy_file:
copy #0, operation_flags ; copy/delete copy #0, operation_flags ; copy/delete
tsx tsx
stx stack_stash stx stack_stash
jsr prep_op_jt_overlay4_clear_system_bitmap jsr prep_callbacks_for_count_clear_system_bitmap
jsr do_copy_dialog_phase jsr do_copy_dialog_phase
jsr LA271 jsr LA271
jsr prep_op_jt_overlay1 jsr prep_callbacks_for_copy
do_run2: do_run2:
copy #$FF, LE05B copy #$FF, LE05B
@ -9420,12 +9407,12 @@ do_delete_file:
copy #0, operation_flags ; copy/delete copy #0, operation_flags ; copy/delete
tsx tsx
stx stack_stash stx stack_stash
jsr prep_op_jt_overlay4_clear_system_bitmap jsr prep_callbacks_for_count_clear_system_bitmap
lda #DeleteDialogLifecycle::open lda #DeleteDialogLifecycle::open
jsr do_delete_dialog_phase jsr do_delete_dialog_phase
jsr LA271 jsr LA271
jsr done_dialog_phase2 jsr done_dialog_phase2
jsr prep_op_jt_overlay2 jsr prep_callbacks_for_delete
jsr delete_file jsr delete_file
jsr done_dialog_phase1 jsr done_dialog_phase1
jmp L8F4F jmp L8F4F
@ -9435,7 +9422,7 @@ do_run:
copy #%11000000, operation_flags ; get size copy #%11000000, operation_flags ; get size
tsx tsx
stx stack_stash stx stack_stash
jsr prep_op_jt_overlay4_clear_system_bitmap jsr prep_callbacks_for_count_clear_system_bitmap
jsr L9984 jsr L9984
jsr LA271 jsr LA271
jsr L99BC jsr L99BC
@ -9590,7 +9577,7 @@ L9076: ldy #$FF
.proc begin_operation .proc begin_operation
copy #0, L97E4 copy #0, L97E4
jsr prep_op_jt_overlay4_clear_system_bitmap jsr prep_callbacks_for_count_clear_system_bitmap
bit operation_flags bit operation_flags
bvs @size bvs @size
bmi @lock bmi @lock
@ -9617,13 +9604,13 @@ L90BA: bit operation_flags
bmi @lock bmi @lock
bit delete_flag bit delete_flag
bmi @trash bmi @trash
jsr prep_op_jt_overlay1 jsr prep_callbacks_for_copy
jmp iterate_selection jmp iterate_selection
@trash: jsr prep_op_jt_overlay2 @trash: jsr prep_callbacks_for_delete
jmp iterate_selection jmp iterate_selection
@lock: jsr prep_op_jt_overlay3 @lock: jsr prep_callbacks_for_lock
jmp iterate_selection jmp iterate_selection
@size: jsr get_size_rts2 ; no-op ??? @size: jsr get_size_rts2 ; no-op ???
@ -10054,8 +10041,7 @@ L9356: yax_call JT_MLI_RELAY, GET_FILE_INFO, get_file_info_params5
beq L9356 beq L9356
L9366: lda selected_window_index L9366: lda selected_window_index
beq L9387 beq L9387
lda #$80 copy #$80, get_info_dialog_params::L92E3
sta get_info_dialog_params::L92E3
lda get_info_dialog_params::L92E6 lda get_info_dialog_params::L92E6
clc clc
adc #$01 adc #$01
@ -10094,8 +10080,7 @@ L93B8: lda DEVLST,y
yax_call JT_MLI_RELAY, WRITE_BLOCK, block_params yax_call JT_MLI_RELAY, WRITE_BLOCK, block_params
cmp #ERR_WRITE_PROTECTED cmp #ERR_WRITE_PROTECTED
bne L93DB bne L93DB
lda #$80 copy #$80, L942E
sta L942E
L93DB: ldx get_info_dialog_params::L92E6 L93DB: ldx get_info_dialog_params::L92E6
lda selected_icon_list,x lda selected_icon_list,x
jsr icon_entry_name_lookup jsr icon_entry_name_lookup
@ -10485,9 +10470,9 @@ file_entry_buf: .res 48, 0
op_jt_addrs: op_jt_addrs:
op_jt_addr1: .addr op_jt1_copy ; defaults are for copy op_jt_addr1: .addr op_jt1_copy ; defaults are for copy
op_jt_addr2: .addr op_jt2_copy op_jt_addr2: .addr op_jt2_copy
op_jt_addr3: .addr rts2 op_jt_addr3: .addr do_nothing
rts2: rts do_nothing: rts
L97E4: .byte $00 L97E4: .byte $00
@ -10679,10 +10664,10 @@ saved_type_and_length: ; written but not read ???
;;; ============================================================ ;;; ============================================================
;;; Overlays for copy operation ;;; Overlays for copy operation
op_jt_overlay1: callbacks_for_copy:
.addr op_jt1_copy ; Overlay for op_jt_addrs .addr op_jt1_copy ; Overlay for op_jt_addrs
.addr op_jt2_copy .addr op_jt2_copy
.addr rts2 .addr do_nothing
.enum CopyDialogLifecycle .enum CopyDialogLifecycle
open = 0 open = 0
@ -10713,9 +10698,9 @@ count: .addr 0
jmp run_copy_dialog_proc jmp run_copy_dialog_proc
.endproc .endproc
.proc prep_op_jt_overlay1 .proc prep_callbacks_for_copy
ldy #op_jt_addrs_size-1 ldy #op_jt_addrs_size-1
: copy op_jt_overlay1,y, op_jt_addrs,y : copy callbacks_for_copy,y, op_jt_addrs,y
dey dey
bpl :- bpl :-
@ -10747,11 +10732,10 @@ L9984: copy #CopyDialogLifecycle::open, copy_dialog_params::phase
.endproc .endproc
.proc L99BC .proc L99BC
lda #$80 copy #$80, all_flag
sta all_flag
ldy #op_jt_addrs_size-1 ldy #op_jt_addrs_size-1
: copy op_jt_overlay1,y, op_jt_addrs,y : copy callbacks_for_copy,y, op_jt_addrs,y
dey dey
bpl :- bpl :-
@ -10904,8 +10888,7 @@ do_create:
beq done beq done
cmp #PromptResult::all cmp #PromptResult::all
bne cancel bne cancel
lda #$80 copy #$80, all_flag
sta all_flag
do_it: jsr apply_file_info_and_size do_it: jsr apply_file_info_and_size
jmp create_ok jmp create_ok
@ -11279,7 +11262,7 @@ src_eof_flag:
cpx #3 cpx #3
bne :- bne :-
L9E26: yax_call JT_MLI_RELAY, CREATE, create_params3 create: yax_call JT_MLI_RELAY, CREATE, create_params3
beq success beq success
cmp #ERR_DUPLICATE_FILENAME cmp #ERR_DUPLICATE_FILENAME
bne err bne err
@ -11303,7 +11286,7 @@ yes: jsr apply_file_info_and_size
cancel: jmp close_files_cancel_dialog cancel: jmp close_files_cancel_dialog
err: jsr show_error_alert_dst err: jsr show_error_alert_dst
jmp L9E26 jmp create
success: success:
clc clc
@ -11319,9 +11302,9 @@ failure:
;;; ============================================================ ;;; ============================================================
;;; Overlays for delete operation ;;; Overlays for delete operation
op_jt_overlay2: callbacks_for_delete:
.addr op_jt_1_delete ; Overlay for op_jt_addrs .addr op_jt1_delete ; Overlay for op_jt_addrs
.addr rts2 .addr do_nothing
.addr destroy_with_retry .addr destroy_with_retry
.proc delete_dialog_params .proc delete_dialog_params
@ -11356,9 +11339,9 @@ count: .word 0
;;; ============================================================ ;;; ============================================================
.proc prep_op_jt_overlay2 .proc prep_callbacks_for_delete
ldy #op_jt_addrs_size-1 ldy #op_jt_addrs_size-1
: copy op_jt_overlay2,y, op_jt_addrs,y : copy callbacks_for_delete,y, op_jt_addrs,y
dey dey
bpl :- bpl :-
@ -11451,19 +11434,20 @@ L9F8E: jsr show_error_alert
;;; ============================================================ ;;; ============================================================
.proc op_jt_1_delete .proc op_jt1_delete
jsr check_escape_key_down jsr check_escape_key_down
beq :+ beq :+
jmp close_files_cancel_dialog jmp close_files_cancel_dialog
: jsr append_to_src_path : jsr append_to_src_path
bit LE05C bit LE05C
bmi L9FA7 bmi :+
jsr dec_file_count_and_run_delete_dialog_proc jsr dec_file_count_and_run_delete_dialog_proc
L9FA7: jsr decrement_op_file_count : jsr decrement_op_file_count
L9FAA: yax_call JT_MLI_RELAY, GET_FILE_INFO, src_file_info_params : 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 :-
: lda src_file_info_params::storage_type : lda src_file_info_params::storage_type
cmp #ST_LINKED_DIRECTORY cmp #ST_LINKED_DIRECTORY
@ -11471,7 +11455,7 @@ L9FAA: yax_call JT_MLI_RELAY, GET_FILE_INFO, src_file_info_params
loop: yax_call JT_MLI_RELAY, DESTROY, destroy_params loop: yax_call JT_MLI_RELAY, DESTROY, destroy_params
beq next_file beq next_file
cmp #ERR_ACCESS_ERROR cmp #ERR_ACCESS_ERROR
bne LA01C bne err
bit all_flag bit all_flag
bmi unlock bmi unlock
copy #DeleteDialogLifecycle::locked, delete_dialog_params::phase copy #DeleteDialogLifecycle::locked, delete_dialog_params::phase
@ -11485,8 +11469,7 @@ loop: yax_call JT_MLI_RELAY, DESTROY, destroy_params
beq unlock beq unlock
cmp #PromptResult::all cmp #PromptResult::all
bne :+ bne :+
lda #$80 copy #$80, all_flag
sta all_flag
bne unlock ; always bne unlock ; always
;; PromptResult::cancel ;; PromptResult::cancel
: jmp close_files_cancel_dialog : jmp close_files_cancel_dialog
@ -11497,7 +11480,7 @@ unlock: copy #ACCESS_DEFAULT, src_file_info_params::access
copy #$A,src_file_info_params ; 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 err: jsr show_error_alert
jmp loop jmp loop
next_file: next_file:
@ -11529,10 +11512,10 @@ done: rts
;;; ============================================================ ;;; ============================================================
;;; Overlays for lock/unlock operation ;;; Overlays for lock/unlock operation
op_jt_overlay3: callbacks_for_lock:
.addr op_jt_1_lock ; overlay for op_jt_addrs .addr op_jt1_lock ; overlay for op_jt_addrs
.addr rts2 .addr do_nothing
.addr rts2 .addr do_nothing
.enum LockDialogLifecycle .enum LockDialogLifecycle
open = 0 ; opening window, initial label open = 0 ; opening window, initial label
@ -11598,11 +11581,11 @@ files_remaining_count:
: rts : rts
.endproc .endproc
.proc prep_op_jt_overlay3 .proc prep_callbacks_for_lock
copy #0, LA425 copy #0, LA425
ldy #op_jt_addrs_size-1 ldy #op_jt_addrs_size-1
: copy op_jt_overlay3,y, op_jt_addrs,y : copy callbacks_for_lock,y, op_jt_addrs,y
dey dey
bpl :- bpl :-
@ -11669,7 +11652,7 @@ LA16A: jsr LA173
jmp append_to_src_path jmp append_to_src_path
.endproc .endproc
op_jt_1_lock: op_jt1_lock:
jsr append_to_src_path jsr append_to_src_path
;; fall through ;; fall through
@ -11752,19 +11735,20 @@ get_size_rts1:
get_size_rts2: get_size_rts2:
rts rts
op_jt_overlay4:
.addr op_jt_1_size ; overlay for op_jt_addrs
.addr rts2
.addr rts2
;;; ============================================================ ;;; ============================================================
;;; ??? ;;; Most operations start by doing a traversal to just count
;;; the files.
.proc prep_op_jt_overlay4_clear_system_bitmap callbacks_for_count:
.addr op_jt1_size ; overlay for op_jt_addrs
.addr do_nothing
.addr do_nothing
.proc prep_callbacks_for_count_clear_system_bitmap
copy #0, LA425 copy #0, LA425
ldy #op_jt_addrs_size-1 ldy #op_jt_addrs_size-1
: copy op_jt_overlay4,y, op_jt_addrs,y : copy callbacks_for_count,y, op_jt_addrs,y
dey dey
bpl :- bpl :-
@ -11816,16 +11800,16 @@ is_dir_flag:
storage_type: storage_type:
.byte 0 .byte 0
do_sum_file_size:
jmp op_jt1_size
.endproc .endproc
;;; ============================================================ ;;; ============================================================
do_sum_file_size:
jmp op_jt_1_size
;; First pass - visit/count all files ??? ;; First pass - visit/count all files ???
op_jt_1_size: op_jt1_size:
bit operation_flags bit operation_flags
bvc :+ ; not size bvc :+ ; not size
@ -14718,8 +14702,7 @@ sloop: cmp16 value, powers,x
not_pad: not_pad:
ora #'0' ora #'0'
pha pha
lda #$80 copy #$80, nonzero_flag
sta nonzero_flag
pla pla
;; Place the character, move to next ;; Place the character, move to next
@ -15835,8 +15818,7 @@ cloop: inx
;; Does it point at anything? If so, set flag. ;; Does it point at anything? If so, set flag.
MLI_RELAY_CALL GET_FILE_INFO, get_file_info_params2 MLI_RELAY_CALL GET_FILE_INFO, get_file_info_params2
bne config_toolkit bne config_toolkit
lda #$80 copy #$80, desktop_main::sys_start_flag
sta desktop_main::sys_start_flag
;; Final MGTK configuration ;; Final MGTK configuration
config_toolkit: config_toolkit: