disasm: scroll and views

This commit is contained in:
Joshua Bell 2019-02-15 19:41:29 -08:00
parent a69a6de2e8
commit 63351ff35d
2 changed files with 42 additions and 42 deletions

View File

@ -254,13 +254,14 @@ L415B: sta active_window_id
L41CB: ldx cached_window_id
dex
lda win_view_by_table,x
bpl L41E2
bpl by_icon
jsr L6C19
copy #0, draw_window_header_flag
lda active_window_id
jmp assign_window_portbits
L41E2: copy cached_window_id, getwinport_params2::window_id
by_icon:
copy cached_window_id, getwinport_params2::window_id
jsr get_set_port2
jsr cached_icons_window_to_screen
@ -612,7 +613,7 @@ L44A6: MGTK_RELAY_CALL MGTK::SelectWindow, findwindow_window_id
ldx active_window_id
dex
lda win_view_by_table,x
and #$0F
and #$0F ; mask off menu item number
sta checkitem_params::menu_item
inc checkitem_params::menu_item
copy #MGTK::checkitem_check, checkitem_params::check
@ -1926,32 +1927,37 @@ L4E78: jsr clear_selection
ldx active_window_id
dex
lda win_view_by_table,x
bmi L4EB4
bmi iter ; list view, not icons
;; View by icon
DESKTOP_RELAY_CALL DT_CLOSE_WINDOW, active_window_id
lda icon_count
sec
sbc cached_window_icon_count
sta icon_count
ldx #$00
L4EA5: cpx cached_window_icon_count
beq L4EB4
ldx #0
: cpx cached_window_icon_count
beq iter
lda cached_window_icon_list,x
jsr FreeIcon
inx
jmp L4EA5
jmp :-
L4EB4: ldx #$00
iter: ldx #$00
txa
L4EB7: sta cached_window_icon_list,x
: sta cached_window_icon_list,x
cpx cached_window_icon_count
beq L4EC3
inx
jmp L4EB7
jmp :-
L4EC3: sta cached_window_icon_count
jsr StoreWindowIconTable
jsr LoadDesktopIconTable
MGTK_RELAY_CALL MGTK::CloseWindow, active_window_id
ldx active_window_id
dex
lda window_to_dir_icon_table,x
@ -2238,9 +2244,10 @@ fail: jsr ShowAlert
: dex
lda win_view_by_table,x
bne :+
bne :+ ; not by icon
rts
;; View by icon
entry:
: jsr LoadActiveWindowIconTable
ldx #$00
@ -2306,9 +2313,9 @@ L51A7: jsr reset_grafport3
jsr StoreWindowIconTable
jsr update_scrollbars
lda selected_window_index
beq L51E3
beq finish
lda selected_icon_count
beq L51E3
beq finish
sta L51EF
L51C0: ldx L51EF
lda selected_icon_count,x
@ -2320,7 +2327,7 @@ L51C0: ldx L51EF
jsr icon_screen_to_window
dec L51EF
bne L51C0
L51E3: jmp LoadDesktopIconTable
finish: jmp LoadDesktopIconTable
L51EB: .word 0
L51ED: .byte 0
@ -2699,9 +2706,10 @@ L544D:
L545A: tax
dex
lda win_view_by_table,x
bpl L5464
bpl L5464 ; by icon
jmp L54C5
;; View by icon
L5464: jsr LoadActiveWindowIconTable
lda active_window_id
jsr window_lookup
@ -2738,6 +2746,7 @@ L54B7: pla
inx
jmp L5485
;; No window icons
L54BD: jsr LoadDesktopIconTable
L54C5: ldx $1800
ldy #$00
@ -5184,8 +5193,7 @@ L6BDA: lda L6C0E
inc L6C0E
jmp L6BDA
L6BF4: lda cached_window_id
sta active_window_id
L6BF4: copy cached_window_id, active_window_id
jsr update_scrollbars
jsr cached_icons_screen_to_window
jsr StoreWindowIconTable
@ -5299,7 +5307,7 @@ L6CCD: lda cached_window_id
COPY_BLOCK grafport2::cliprect, tmp_rect
ldx #$00
ldx #0
txa
pha
L6CF3: cpx cached_window_icon_count
@ -5366,12 +5374,12 @@ L6D7D: lda L6DB0
inc L6DB0
jmp L6D7D
L6D9B: lda #$00
L6D9B: lda #0
ldx selected_icon_count
dex
L6DA1: sta selected_icon_list,x
: sta selected_icon_list,x
dex
bpl L6DA1
bpl :-
sta selected_icon_count
sta selected_window_index
jmp reset_grafport3
@ -5404,20 +5412,16 @@ config_port:
bmi activate_hscroll
;; deactivate horizontal scrollbar
lda #MGTK::Ctl::horizontal_scroll_bar
sta activatectl_which_ctl
lda #MGTK::activatectl_deactivate
sta activatectl_activate
copy #MGTK::Ctl::horizontal_scroll_bar, activatectl_which_ctl
copy #MGTK::activatectl_deactivate, activatectl_activate
jsr activate_ctl
jmp check_vscroll
activate_hscroll:
;; activate horizontal scrollbar
lda #MGTK::Ctl::horizontal_scroll_bar
sta activatectl_which_ctl
lda #MGTK::activatectl_activate
sta activatectl_activate
copy #MGTK::Ctl::horizontal_scroll_bar, activatectl_which_ctl
copy #MGTK::activatectl_activate, activatectl_activate
jsr activate_ctl
jsr update_hthumb
@ -5429,20 +5433,16 @@ check_vscroll:
bmi activate_vscroll
;; deactivate vertical scrollbar
lda #MGTK::Ctl::vertical_scroll_bar
sta activatectl_which_ctl
lda #MGTK::activatectl_deactivate
sta activatectl_activate
copy #MGTK::Ctl::vertical_scroll_bar, activatectl_which_ctl
copy #MGTK::activatectl_deactivate, activatectl_activate
jsr activate_ctl
rts
activate_vscroll:
;; activate vertical scrollbar
lda #MGTK::Ctl::vertical_scroll_bar
sta activatectl_which_ctl
lda #MGTK::activatectl_activate
sta activatectl_activate
copy #MGTK::Ctl::vertical_scroll_bar, activatectl_which_ctl
copy #MGTK::activatectl_activate, activatectl_activate
jsr activate_ctl
jmp update_vthumb
@ -6422,7 +6422,7 @@ L76A4: lda cached_window_id
L76AA: lda L7625
cmp L7764
beq L76BB
jsr L7768
jsr alloc_and_populate_file_icon
inc L7625
jmp L76AA
@ -6468,7 +6468,7 @@ L7710: ldy #$20
L7739: addr_jump L7744, $0032
L7740: ldax #$6C
L7740: ldax #108
L7744: ldy #$22
sta ($06),y
txa
@ -6493,7 +6493,7 @@ L7767: .byte $14
;;; ============================================================
;;; Create icon
.proc L7768
.proc alloc_and_populate_file_icon
file_entry := $6
icon_entry := $8
name_tmp := $1800

View File

@ -1196,7 +1196,7 @@ LE6C1:
.addr winfo8title_ptr
;; (low nibble must match menu order)
view_by_icon = $80
view_by_icon = $00
view_by_name = $81
view_by_date = $82
view_by_size = $83