mirror of
https://github.com/mi57730/a2d.git
synced 2025-02-20 02:29:11 +00:00
disasm: volume/folder opening
This commit is contained in:
parent
dd30201bcc
commit
4dfd612333
@ -1950,7 +1950,7 @@ L4E71: .byte 0
|
|||||||
rts
|
rts
|
||||||
|
|
||||||
L4E78: jsr clear_selection
|
L4E78: jsr clear_selection
|
||||||
dec LEC2E
|
dec num_open_windows
|
||||||
copy active_window_id, cached_window_id
|
copy active_window_id, cached_window_id
|
||||||
jsr LoadWindowIconTable
|
jsr LoadWindowIconTable
|
||||||
ldx active_window_id
|
ldx active_window_id
|
||||||
@ -4325,7 +4325,7 @@ L6206: cpx cached_window_icon_count
|
|||||||
inx
|
inx
|
||||||
jmp L6206
|
jmp L6206
|
||||||
|
|
||||||
L6215: dec LEC2E
|
L6215: dec num_open_windows
|
||||||
ldx #$00
|
ldx #$00
|
||||||
txa
|
txa
|
||||||
L621B: sta cached_window_icon_list,x
|
L621B: sta cached_window_icon_list,x
|
||||||
@ -5089,57 +5089,73 @@ L6A80: inx
|
|||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
|
;;; Open a folder/volume icon
|
||||||
|
;;; Input: A = icon
|
||||||
|
;;; Note: stack will be restored via saved_stack on failure
|
||||||
|
|
||||||
.proc open_folder_or_volume_icon
|
.proc open_folder_or_volume_icon
|
||||||
|
ptr := $06
|
||||||
|
|
||||||
sta icon_params2
|
sta icon_params2
|
||||||
jsr StoreWindowIconTable
|
jsr StoreWindowIconTable
|
||||||
lda icon_params2
|
lda icon_params2
|
||||||
ldx #$07
|
|
||||||
L6A95: cmp window_to_dir_icon_table,x
|
|
||||||
beq L6AA0
|
|
||||||
dex
|
|
||||||
bpl L6A95
|
|
||||||
jmp L6B1E
|
|
||||||
|
|
||||||
L6AA0: inx
|
;; Already an open window for the icon?
|
||||||
|
ldx #7
|
||||||
|
: cmp window_to_dir_icon_table,x
|
||||||
|
beq found_win
|
||||||
|
dex
|
||||||
|
bpl :-
|
||||||
|
jmp no_win
|
||||||
|
|
||||||
|
found_win:
|
||||||
|
;; Is it the active window? If so, done!
|
||||||
|
inx
|
||||||
cpx active_window_id
|
cpx active_window_id
|
||||||
bne L6AA7
|
bne :+
|
||||||
rts
|
rts
|
||||||
|
|
||||||
L6AA7: stx cached_window_id
|
;; Otherwise, bring the window to the front.
|
||||||
|
: stx cached_window_id
|
||||||
jsr LoadWindowIconTable
|
jsr LoadWindowIconTable
|
||||||
|
|
||||||
lda icon_params2
|
lda icon_params2
|
||||||
jsr icon_entry_lookup
|
jsr icon_entry_lookup
|
||||||
stax $06
|
stax ptr
|
||||||
|
|
||||||
ldy #IconEntry::win_type
|
ldy #IconEntry::win_type
|
||||||
lda ($06),y
|
lda (ptr),y
|
||||||
ora #icon_entry_open_mask ; set open_flag
|
ora #icon_entry_open_mask ; set open_flag
|
||||||
sta ($06),y
|
sta (ptr),y
|
||||||
ldy #IconEntry::win_type
|
|
||||||
lda ($06),y
|
ldy #IconEntry::win_type ; get window id
|
||||||
|
lda (ptr),y
|
||||||
and #icon_entry_winid_mask
|
and #icon_entry_winid_mask
|
||||||
sta getwinport_params2::window_id
|
sta getwinport_params2::window_id
|
||||||
beq L6AD8
|
|
||||||
cmp active_window_id
|
beq :+ ; window 0 = desktop
|
||||||
bne L6AEF
|
cmp active_window_id ; prep to redraw windowed (file) icon
|
||||||
|
bne skip ; but only if active window
|
||||||
jsr get_set_port2
|
jsr get_set_port2
|
||||||
lda icon_params2
|
lda icon_params2
|
||||||
jsr icon_window_to_screen
|
jsr icon_window_to_screen
|
||||||
L6AD8: DESKTOP_RELAY_CALL DT_REDRAW_ICON, icon_params2
|
: DESKTOP_RELAY_CALL DT_REDRAW_ICON, icon_params2
|
||||||
|
|
||||||
lda getwinport_params2::window_id
|
lda getwinport_params2::window_id
|
||||||
beq L6AEF
|
beq skip ; skip if on desktop
|
||||||
lda icon_params2
|
lda icon_params2 ; restore from drawing
|
||||||
jsr icon_screen_to_window
|
jsr icon_screen_to_window
|
||||||
jsr reset_grafport3
|
jsr reset_grafport3
|
||||||
L6AEF: lda icon_params2
|
|
||||||
|
skip: lda icon_params2
|
||||||
ldx LE1F1
|
ldx LE1F1
|
||||||
dex
|
dex
|
||||||
L6AF6: cmp LE1F1+1,x
|
: cmp LE1F1+1,x
|
||||||
beq L6B01
|
beq :+
|
||||||
dex
|
dex
|
||||||
bpl L6AF6
|
bpl :-
|
||||||
jsr open_directory
|
jsr open_directory
|
||||||
L6B01: MGTK_RELAY_CALL MGTK::SelectWindow, cached_window_id
|
: MGTK_RELAY_CALL MGTK::SelectWindow, cached_window_id
|
||||||
lda cached_window_id
|
lda cached_window_id
|
||||||
sta active_window_id
|
sta active_window_id
|
||||||
jsr L6C19
|
jsr L6C19
|
||||||
@ -5147,70 +5163,94 @@ L6B01: MGTK_RELAY_CALL MGTK::SelectWindow, cached_window_id
|
|||||||
copy #0, cached_window_id
|
copy #0, cached_window_id
|
||||||
jmp LoadWindowIconTable
|
jmp LoadWindowIconTable
|
||||||
|
|
||||||
L6B1E: lda LEC2E
|
;; --------------------------------------------------
|
||||||
cmp #$08
|
;; No window - need to open one.
|
||||||
bcc L6B2F
|
|
||||||
|
no_win:
|
||||||
|
|
||||||
|
;; Is there a free window?
|
||||||
|
lda num_open_windows
|
||||||
|
cmp #8
|
||||||
|
bcc :+
|
||||||
|
|
||||||
|
;; Nope, show error.
|
||||||
lda #warning_msg_too_many_windows
|
lda #warning_msg_too_many_windows
|
||||||
jsr warning_dialog_proc_num
|
jsr warning_dialog_proc_num
|
||||||
ldx saved_stack
|
ldx saved_stack
|
||||||
txs
|
txs
|
||||||
rts
|
rts
|
||||||
|
|
||||||
L6B2F: ldx #$00
|
;; Search window-icon map to find an unused window.
|
||||||
L6B31: lda window_to_dir_icon_table,x
|
: ldx #0
|
||||||
beq L6B3A
|
: lda window_to_dir_icon_table,x
|
||||||
|
beq :+
|
||||||
inx
|
inx
|
||||||
jmp L6B31
|
jmp :-
|
||||||
|
|
||||||
L6B3A: lda icon_params2
|
;; Map the window to its source icon
|
||||||
|
: lda icon_params2
|
||||||
sta window_to_dir_icon_table,x
|
sta window_to_dir_icon_table,x
|
||||||
inx
|
inx ; 0-based to 1-based
|
||||||
|
|
||||||
stx cached_window_id
|
stx cached_window_id
|
||||||
jsr LoadWindowIconTable
|
jsr LoadWindowIconTable
|
||||||
inc LEC2E
|
|
||||||
|
;; Update View and other menus
|
||||||
|
inc num_open_windows
|
||||||
ldx cached_window_id
|
ldx cached_window_id
|
||||||
dex
|
dex
|
||||||
copy #0, win_view_by_table,x
|
copy #0, win_view_by_table,x
|
||||||
lda LEC2E
|
|
||||||
cmp #$02
|
|
||||||
bcs L6B60
|
|
||||||
jsr enable_various_file_menu_items
|
|
||||||
jmp L6B68
|
|
||||||
|
|
||||||
L6B60: copy #0, checkitem_params::check
|
lda num_open_windows ; Was there already a window open?
|
||||||
|
cmp #2
|
||||||
|
bcs :+ ; yes, no need to enable file menu
|
||||||
|
jsr enable_various_file_menu_items
|
||||||
|
jmp update_view
|
||||||
|
|
||||||
|
: copy #0, checkitem_params::check
|
||||||
jsr check_item
|
jsr check_item
|
||||||
L6B68: lda #desktop_aux::menu_item_id_view_by_icon
|
|
||||||
|
update_view:
|
||||||
|
lda #desktop_aux::menu_item_id_view_by_icon
|
||||||
sta checkitem_params::menu_item
|
sta checkitem_params::menu_item
|
||||||
sta checkitem_params::check
|
sta checkitem_params::check
|
||||||
jsr check_item
|
jsr check_item
|
||||||
|
|
||||||
|
;; Update icon
|
||||||
lda icon_params2
|
lda icon_params2
|
||||||
jsr icon_entry_lookup
|
jsr icon_entry_lookup
|
||||||
stax $06
|
stax ptr
|
||||||
|
|
||||||
ldy #IconEntry::win_type
|
ldy #IconEntry::win_type
|
||||||
lda ($06),y
|
lda (ptr),y
|
||||||
ora #icon_entry_open_mask ; set open_flag
|
ora #icon_entry_open_mask ; set open_flag
|
||||||
sta ($06),y
|
sta (ptr),y
|
||||||
ldy #IconEntry::win_type
|
|
||||||
lda ($06),y
|
ldy #IconEntry::win_type ; get window id
|
||||||
|
lda (ptr),y
|
||||||
and #icon_entry_winid_mask
|
and #icon_entry_winid_mask
|
||||||
sta getwinport_params2::window_id
|
sta getwinport_params2::window_id
|
||||||
beq L6BA1
|
|
||||||
cmp active_window_id
|
beq :+ ; 0 = desktop
|
||||||
bne L6BB8
|
cmp active_window_id ; prep to redraw windowed (file) icon
|
||||||
|
bne skip2 ; but only if active window
|
||||||
jsr get_set_port2
|
jsr get_set_port2
|
||||||
jsr offset_grafport2_and_set
|
jsr offset_grafport2_and_set
|
||||||
lda icon_params2
|
lda icon_params2
|
||||||
jsr icon_window_to_screen
|
jsr icon_window_to_screen
|
||||||
L6BA1: DESKTOP_RELAY_CALL DT_REDRAW_ICON, icon_params2
|
: DESKTOP_RELAY_CALL DT_REDRAW_ICON, icon_params2
|
||||||
|
|
||||||
lda getwinport_params2::window_id
|
lda getwinport_params2::window_id
|
||||||
beq L6BB8
|
beq skip2 ; skip if on desktop
|
||||||
lda icon_params2
|
lda icon_params2 ; restore from drawing
|
||||||
jsr icon_screen_to_window
|
jsr icon_screen_to_window
|
||||||
jsr reset_grafport3
|
jsr reset_grafport3
|
||||||
L6BB8: jsr L744B
|
|
||||||
|
|
||||||
|
skip2: jsr L744B
|
||||||
|
|
||||||
|
;; Create the window
|
||||||
lda cached_window_id
|
lda cached_window_id
|
||||||
jsr window_lookup
|
jsr window_lookup ; A,X points at Winfo
|
||||||
ldy #MGTK::OpenWindow
|
ldy #MGTK::OpenWindow
|
||||||
jsr MGTK_RELAY
|
jsr MGTK_RELAY
|
||||||
|
|
||||||
@ -5218,20 +5258,23 @@ L6BB8: jsr L744B
|
|||||||
jsr get_set_port2
|
jsr get_set_port2
|
||||||
|
|
||||||
jsr draw_window_header
|
jsr draw_window_header
|
||||||
|
|
||||||
|
;; Restore and add the icons
|
||||||
jsr cached_icons_window_to_screen
|
jsr cached_icons_window_to_screen
|
||||||
copy #0, L6C0E
|
copy #0, num
|
||||||
L6BDA: lda L6C0E
|
: lda num
|
||||||
cmp cached_window_icon_count
|
cmp cached_window_icon_count
|
||||||
beq L6BF4
|
beq done
|
||||||
tax
|
tax
|
||||||
lda cached_window_icon_list,x
|
lda cached_window_icon_list,x
|
||||||
jsr icon_entry_lookup
|
jsr icon_entry_lookup ; A,X points at IconEntry
|
||||||
ldy #DT_ADD_ICON
|
ldy #DT_ADD_ICON
|
||||||
jsr DESKTOP_RELAY ; icon entry addr in A,X
|
jsr DESKTOP_RELAY ; icon entry addr in A,X
|
||||||
inc L6C0E
|
inc num
|
||||||
jmp L6BDA
|
jmp :-
|
||||||
|
|
||||||
L6BF4: copy cached_window_id, active_window_id
|
;; Finish up
|
||||||
|
done: copy cached_window_id, active_window_id
|
||||||
jsr update_scrollbars
|
jsr update_scrollbars
|
||||||
jsr cached_icons_screen_to_window
|
jsr cached_icons_screen_to_window
|
||||||
jsr StoreWindowIconTable
|
jsr StoreWindowIconTable
|
||||||
@ -5239,7 +5282,7 @@ L6BF4: copy cached_window_id, active_window_id
|
|||||||
jsr LoadWindowIconTable
|
jsr LoadWindowIconTable
|
||||||
jmp reset_grafport3
|
jmp reset_grafport3
|
||||||
|
|
||||||
L6C0E: .byte 0
|
num: .byte 0
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
@ -5857,9 +5900,9 @@ L710A: lsr16 L72A8
|
|||||||
sub16_8 L72A8, DEVCNT, L72A8
|
sub16_8 L72A8, DEVCNT, L72A8
|
||||||
cmp16 L72A8, L70C1
|
cmp16 L72A8, L70C1
|
||||||
bcs L7169
|
bcs L7169
|
||||||
L7147: lda LEC2E
|
L7147: lda num_open_windows
|
||||||
jsr mark_icons_not_opened_1
|
jsr mark_icons_not_opened_1
|
||||||
dec LEC2E
|
dec num_open_windows
|
||||||
jsr redraw_windows_and_desktop
|
jsr redraw_windows_and_desktop
|
||||||
jsr do_close
|
jsr do_close
|
||||||
lda active_window_id
|
lda active_window_id
|
||||||
@ -6265,7 +6308,7 @@ L74D3: tay
|
|||||||
lda #ERR_INVALID_PATHNAME
|
lda #ERR_INVALID_PATHNAME
|
||||||
jsr ShowAlert
|
jsr ShowAlert
|
||||||
jsr mark_icons_not_opened_2
|
jsr mark_icons_not_opened_2
|
||||||
dec LEC2E
|
dec num_open_windows
|
||||||
ldx saved_stack
|
ldx saved_stack
|
||||||
txs
|
txs
|
||||||
rts
|
rts
|
||||||
|
@ -1389,7 +1389,11 @@ active_window_id:
|
|||||||
window_to_dir_icon_table:
|
window_to_dir_icon_table:
|
||||||
.res 8, 0
|
.res 8, 0
|
||||||
|
|
||||||
LEC2E: .res 21, 0 ; ???
|
num_open_windows:
|
||||||
|
.byte 0
|
||||||
|
|
||||||
|
LEC2F: .res 20, 0 ; unreferenced???
|
||||||
|
|
||||||
LEC43: .res 16, 0 ; ???
|
LEC43: .res 16, 0 ; ???
|
||||||
LEC53: .byte 0
|
LEC53: .byte 0
|
||||||
LEC54: .word 0
|
LEC54: .word 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user