a2d/desktop/ovl3.s

1545 lines
33 KiB
ArmAsm
Raw Normal View History

2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 21:19:11 +00:00
;;; Overlay for Selector (part of it, anyway)
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-24 04:54:37 +00:00
2018-02-25 23:19:38 +00:00
.proc selector_overlay2
.org $9000
2018-02-24 04:54:37 +00:00
sta L938E
ldx #$FF
stx L938F
cmp #$01
beq L903C
jmp L9105
L900F: pha
lda L938F
bpl L9017
L9015: pla
L9016: rts
L9017: lda $0C00
clc
adc $0C01
sta num_selector_list_items
2018-02-24 04:54:37 +00:00
lda #$00
sta LD344
jsr get_copied_to_ramcard_flag
2018-02-24 04:54:37 +00:00
cmp #$80
bne L9015
2018-02-25 07:19:29 +00:00
jsr JUMP_TABLE_REDRAW_ALL
2018-02-24 04:54:37 +00:00
lda #$06
jsr L9C09
bne L9015
jsr L9C26
pla
rts
L903C: ldx #$01
copy16 selector_menu_addr, @load
@load := *+1
2018-02-26 03:20:43 +00:00
lda dummy1234
2018-02-24 04:54:37 +00:00
cmp #$0D
bcc L9052
inx
L9052: lda #$00
sta path_buf0
sta path_buf1
2018-02-24 04:54:37 +00:00
ldy #$03
lda #$02
2018-02-26 03:20:43 +00:00
jsr common_overlay_L5000
2018-02-24 04:54:37 +00:00
pha
txa
pha
tya
pha
lda #$07
2018-04-28 03:40:39 +00:00
jsr JUMP_TABLE_RESTORE_OVL
2018-02-25 07:19:29 +00:00
jsr JUMP_TABLE_REDRAW_ALL
2018-02-24 04:54:37 +00:00
pla
tay
pla
tax
pla
bne L900F
inc L938F
stx L9103
sty L9104
lda #$00
L9080: dey
beq L9088
sec
ror a
jmp L9080
L9088: sta L9104
jsr L9CBA
bpl L9093
jmp L9016
2018-02-26 03:05:59 +00:00
L9093: copy16 $0C00, L938B
2018-02-24 04:54:37 +00:00
lda L9103
cmp #$01
bne L90D3
lda L938B
cmp #$08
beq L90F4
ldy L9104
lda L938B
jsr L9A0A
inc $0C00
2018-11-23 18:07:33 +00:00
copy16 selector_menu_addr, @addr
2018-02-26 03:40:53 +00:00
@addr := *+1
inc dummy1234
2018-02-24 04:54:37 +00:00
jsr L9CEA
bpl L90D0
jmp L9016
L90D0: jmp L900F
L90D3: lda L938C
cmp #$10
beq L90FF
ldy L9104
lda L938C
clc
adc #$08
jsr L9A61
inc $0C01
jsr L9CEA
bpl L90F1
jmp L9016
L90F1: jmp L900F
L90F4: lda #$01
L90F6: jsr L9C09
dec L938F
jmp L9016
L90FF: lda #$02
bne L90F6
2018-02-24 05:07:11 +00:00
L9103: .byte 0
L9104: .byte 0
2018-02-24 04:54:37 +00:00
L9105: lda #$00
sta L938B
sta L938C
lda #$FF
sta L938D
jsr L9390
jsr L9D22
bpl L911D
jmp L936E
L911D: jsr L99B3
L9120: jsr L9646
bmi L9120
beq L912A
jmp L933F
L912A: lda L938D
bmi L9120
lda L938E
cmp #$02
bne L9139
jmp L9174
L9139: cmp #$03
bne L913F
beq L9146
L913F: cmp #$04
bne L9120
jmp L9282
L9146: lda L938D
jsr L979D
jsr desktop_main::set_cursor_watch
2018-02-24 04:54:37 +00:00
lda L938D
jsr L9A97
beq L915D
jsr desktop_main::set_cursor_pointer
2018-02-24 04:54:37 +00:00
jmp L933F
L915D: jsr desktop_main::set_cursor_pointer
2018-02-24 04:54:37 +00:00
lda #$FF
sta L938D
jsr L99F5
jsr L9D28
jsr L99B3
inc L938F
jmp L9120
L9174: lda L938D
jsr L979D
jsr L936E
lda L938D
jsr L9BD5
2018-02-26 00:10:27 +00:00
stax $06
2018-02-24 04:54:37 +00:00
ldy #$00
lda ($06),y
tay
L918C: lda ($06),y
sta path_buf1,y
2018-02-24 04:54:37 +00:00
dey
bpl L918C
ldy #$0F
lda ($06),y
sta L9281
lda L938D
jsr L9BE2
2018-02-26 00:10:27 +00:00
stax $06
2018-02-24 04:54:37 +00:00
ldy #$00
lda ($06),y
tay
L91AA: lda ($06),y
sta path_buf0,y
2018-02-24 04:54:37 +00:00
dey
bpl L91AA
ldx #$01
lda L938D
cmp #$09
bcc L91BC
inx
L91BC: clc
lda L9281
rol a
rol a
adc #$01
tay
lda #$02
2018-02-26 03:20:43 +00:00
jsr common_overlay_L5000
2018-02-24 04:54:37 +00:00
pha
txa
pha
tya
pha
lda #$07
2018-04-28 03:40:39 +00:00
jsr JUMP_TABLE_RESTORE_OVL
2018-02-25 07:19:29 +00:00
jsr JUMP_TABLE_REDRAW_ALL
2018-02-24 04:54:37 +00:00
pla
tay
pla
tax
pla
beq L91DF
rts
L91DF: inc L938F
stx L9103
sty L9104
lda #$00
L91EA: dey
beq L91F2
sec
ror a
jmp L91EA
L91F2: sta L9104
jsr L9CBA
bpl L91FD
jmp L936E
L91FD: lda L938D
cmp #$09
bcc L923C
lda L9103
cmp #$02
beq L926A
lda L938B
cmp #$08
bne L9215
jmp L90F4
L9215: lda L938D
jsr L9A97
beq L9220
jmp L936E
L9220: ldx L938B
inc L938B
inc $0C00
2018-11-23 18:07:33 +00:00
copy16 selector_menu_addr, @addr
2018-02-26 03:40:53 +00:00
@addr := *+1
inc dummy1234
2018-02-24 04:54:37 +00:00
txa
jmp L926D
L923C: lda L9103
cmp #$01
beq L926A
lda L938C
cmp #$10
bne L924D
jmp L9105
L924D: lda L938D
jsr L9A97
beq L9258
jmp L936E
L9258: ldx L938C
inc L938C
inc $0C01
lda L938C
clc
adc #$07
jmp L926D
L926A: lda L938D
L926D: ldy L9104
jsr L9A0A
jsr L9CEA
beq L927B
jmp L936E
L927B: jsr desktop_main::set_cursor_pointer
2018-02-24 04:54:37 +00:00
jmp L900F
2018-02-24 05:07:11 +00:00
L9281: .byte 0
2018-02-24 04:54:37 +00:00
L9282: lda L938D
jsr L979D
jsr desktop_main::set_cursor_watch
2018-02-24 04:54:37 +00:00
lda L938D
jsr L9BD5
2018-02-26 00:10:27 +00:00
stax $06
2018-02-24 04:54:37 +00:00
ldy #$0F
lda ($06),y
cmp #$C0
beq L92F0
sta L938A
jsr get_copied_to_ramcard_flag
2018-02-24 04:54:37 +00:00
beq L92F0
lda L938A
beq L92CE
lda L938D
jsr L9E61
beq L92D6
lda L938D
jsr L9BE2
2018-02-26 00:10:27 +00:00
stax $06
2018-02-24 04:54:37 +00:00
ldy #$00
lda ($06),y
tay
L92C1: lda ($06),y
2018-11-17 04:02:54 +00:00
sta buf_win_path,y
2018-02-24 04:54:37 +00:00
dey
bpl L92C1
lda #$FF
jmp L933F
L92CE: lda L938D
jsr L9E61
bne L92F0
L92D6: lda L938D
jsr L9E74
2018-02-26 00:10:27 +00:00
stax $06
2018-02-24 04:54:37 +00:00
ldy #$00
lda ($06),y
tay
L92E5: lda ($06),y
2018-11-17 04:02:54 +00:00
sta buf_win_path,y
2018-02-24 04:54:37 +00:00
dey
bpl L92E5
jmp L9307
L92F0: lda L938D
jsr L9BE2
2018-02-26 00:10:27 +00:00
stax $06
2018-02-24 04:54:37 +00:00
ldy #$00
lda ($06),y
tay
L92FF: lda ($06),y
2018-11-17 04:02:54 +00:00
sta buf_win_path,y
2018-02-24 04:54:37 +00:00
dey
bpl L92FF
2018-11-17 04:02:54 +00:00
L9307: ldy buf_win_path
L930A: lda buf_win_path,y
2018-02-24 04:54:37 +00:00
cmp #$2F
beq L9314
dey
bne L930A
L9314: dey
sty L938A
iny
ldx #$00
L931B: iny
inx
2018-11-17 04:02:54 +00:00
lda buf_win_path,y
sta buf_filename2,x
2018-11-17 04:02:54 +00:00
cpy buf_win_path
2018-02-24 04:54:37 +00:00
bne L931B
stx buf_filename2
2018-02-24 04:54:37 +00:00
lda L938A
2018-11-17 04:02:54 +00:00
sta buf_win_path
2018-02-25 07:19:29 +00:00
jsr JUMP_TABLE_LAUNCH_FILE
jsr desktop_main::set_cursor_pointer
2018-02-24 04:54:37 +00:00
lda #$FF
sta L938D
jmp L936E
L933F: pha
lda L938E
cmp #$02
bne L934F
lda #$07
2018-04-28 03:40:39 +00:00
jsr JUMP_TABLE_RESTORE_OVL
2018-02-25 07:19:29 +00:00
jsr JUMP_TABLE_REDRAW_ALL
L934F: MGTK_RELAY_CALL MGTK::InitPort, grafport3
MGTK_RELAY_CALL MGTK::SetPort, grafport3
2018-03-15 04:10:08 +00:00
MGTK_RELAY_CALL MGTK::CloseWindow, winfo_entry_picker
2018-02-24 04:54:37 +00:00
pla
jmp L900F
L936E: MGTK_RELAY_CALL MGTK::InitPort, grafport3
MGTK_RELAY_CALL MGTK::SetPort, grafport3
2018-03-15 04:10:08 +00:00
MGTK_RELAY_CALL MGTK::CloseWindow, winfo_entry_picker
2018-02-24 04:54:37 +00:00
rts
2018-02-24 05:07:11 +00:00
L938A: .byte 0
L938B: .byte 0
L938C: .byte 0
L938D: .byte 0
L938E: .byte 0
L938F: .byte 0
2018-02-26 03:40:53 +00:00
2018-03-15 04:10:08 +00:00
L9390: MGTK_RELAY_CALL MGTK::OpenWindow, winfo_entry_picker
lda winfo_entry_picker
jsr desktop_main::set_port_from_window_id
2018-03-02 02:25:42 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2019-02-09 21:10:24 +00:00
MGTK_RELAY_CALL MGTK::FrameRect, entry_picker_outer_rect
MGTK_RELAY_CALL MGTK::FrameRect, entry_picker_inner_rect
MGTK_RELAY_CALL MGTK::MoveTo, entry_picker_line1_start
MGTK_RELAY_CALL MGTK::LineTo, entry_picker_line1_end
MGTK_RELAY_CALL MGTK::MoveTo, entry_picker_line2_start
MGTK_RELAY_CALL MGTK::LineTo, entry_picker_line2_end
2018-03-02 02:25:42 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, pencopy
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2019-02-09 21:10:24 +00:00
MGTK_RELAY_CALL MGTK::FrameRect, entry_picker_ok_rect
MGTK_RELAY_CALL MGTK::FrameRect, entry_picker_cancel_rect
2018-02-24 04:54:37 +00:00
jsr L94A9
jsr L94BA
lda L938E
cmp #$02
bne L9417
addr_call L94F0, edit_an_entry_label
2018-02-24 04:54:37 +00:00
rts
L9417: cmp #$03
bne L9423
addr_call L94F0, delete_an_entry_label
2018-02-24 04:54:37 +00:00
rts
L9423: addr_call L94F0, run_an_entry_label
2018-02-24 04:54:37 +00:00
rts
L942B: stx $07
sta $06
lda dialog_label_pos::xcoord
2018-02-24 04:54:37 +00:00
sta L94A8
tya
pha
cmp #16 ; 3rd column (16-24)
2018-02-24 04:54:37 +00:00
bcc L9441
sec
sbc #16
2018-02-24 04:54:37 +00:00
jmp L9448
;; 8 rows
L9441: cmp #8 ; 2nd column (8-15)
2018-02-24 04:54:37 +00:00
bcc L9448
sec
sbc #8
;; A has row
L9448: ldx #0
ldy #entry_picker_item_height
jsr Multiply_16_8_16 ; A,X = A,X * Y
2018-02-24 04:54:37 +00:00
clc
adc #32
sta dialog_label_pos::ycoord
txa
adc #0
sta dialog_label_pos::ycoord+1
2018-02-24 04:54:37 +00:00
pla
cmp #8
bcs :+
lda #0 ; col 1
2018-02-24 04:54:37 +00:00
tax
beq L947F ; always
: cmp #16
bcs :+
ldx #0
lda #115 ; col 2
bne L947F ; always
: ldax #220 ; col 3
2018-02-24 04:54:37 +00:00
L947F: clc
2019-02-09 21:10:24 +00:00
adc #10
sta dialog_label_pos::xcoord
2018-02-24 04:54:37 +00:00
txa
2019-02-09 21:10:24 +00:00
adc #0
sta dialog_label_pos::xcoord+1
MGTK_RELAY_CALL MGTK::MoveTo, dialog_label_pos
2019-02-09 21:10:24 +00:00
ldax $06
2018-02-24 04:54:37 +00:00
jsr L94CB
lda L94A8
sta dialog_label_pos::xcoord
lda #0
sta dialog_label_pos::xcoord+1
2018-02-24 04:54:37 +00:00
rts
2018-02-24 05:07:11 +00:00
L94A8: .byte 0
2018-02-26 03:40:53 +00:00
2019-02-09 21:10:24 +00:00
L94A9: MGTK_RELAY_CALL MGTK::MoveTo, entry_picker_ok_pos
2018-11-23 18:07:33 +00:00
addr_call desktop_main::draw_text1, desktop_aux::str_ok_label
2018-02-24 04:54:37 +00:00
rts
2019-02-09 21:10:24 +00:00
L94BA: MGTK_RELAY_CALL MGTK::MoveTo, entry_picker_cancel_pos
2018-11-23 18:07:33 +00:00
addr_call desktop_main::draw_text1, desktop_aux::str_cancel_label
2018-02-24 04:54:37 +00:00
rts
2018-02-26 00:10:27 +00:00
L94CB: stax $06
2018-02-24 04:54:37 +00:00
ldy #$00
lda ($06),y
tay
L94D4: lda ($06),y
sta path_buf2+2,y
2018-02-24 04:54:37 +00:00
dey
bpl L94D4
2018-11-23 18:07:33 +00:00
copy16 #path_buf2+3, path_buf2
MGTK_RELAY_CALL MGTK::DrawText, path_buf2
2018-02-24 04:54:37 +00:00
rts
2018-02-26 00:10:27 +00:00
L94F0: stax $06
2018-02-24 04:54:37 +00:00
ldy #$00
lda ($06),y
sta $08
2018-02-26 00:06:17 +00:00
inc16 $06
2018-02-26 03:40:53 +00:00
MGTK_RELAY_CALL MGTK::TextWidth, $06
2018-02-26 00:10:27 +00:00
lsr16 $09
2018-02-24 04:54:37 +00:00
lda #$01
sta L9539
lda #$5E
lsr L9539
ror a
sec
sbc $09
sta pos_dialog_title
2018-02-24 04:54:37 +00:00
lda L9539
sbc $0A
sta pos_dialog_title+1
MGTK_RELAY_CALL MGTK::MoveTo, pos_dialog_title
2018-02-26 03:40:53 +00:00
MGTK_RELAY_CALL MGTK::DrawText, $06
2018-02-24 04:54:37 +00:00
rts
2018-02-24 05:07:11 +00:00
L9539: .byte 0
2018-02-24 04:54:37 +00:00
L953A: lda #$00
sta L95BF
2018-03-02 02:25:42 +00:00
L953F: MGTK_RELAY_CALL MGTK::GetEvent, event_params
lda event_kind
2018-11-18 04:34:17 +00:00
cmp #MGTK::EventKind::button_up
2018-02-24 04:54:37 +00:00
beq L95A2
2018-03-15 04:10:08 +00:00
lda winfo_entry_picker
2018-03-02 02:25:42 +00:00
sta screentowindow_window_id
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
MGTK_RELAY_CALL MGTK::MoveTo, screentowindow_windowx
2019-02-09 21:10:24 +00:00
MGTK_RELAY_CALL MGTK::InRect, entry_picker_ok_rect
2018-02-25 21:47:06 +00:00
cmp #MGTK::inrect_inside
2018-02-24 04:54:37 +00:00
beq L957C
lda L95BF
beq L9584
jmp L953F
L957C: lda L95BF
bne L9584
jmp L953F
2018-03-02 02:25:42 +00:00
L9584: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2019-02-09 21:10:24 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, entry_picker_ok_rect
2018-02-24 04:54:37 +00:00
lda L95BF
clc
adc #$80
sta L95BF
jmp L953F
L95A2: lda L95BF
beq L95AA
return #$FF
2018-02-24 04:54:37 +00:00
2018-03-02 02:25:42 +00:00
L95AA: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2019-02-09 21:10:24 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, entry_picker_ok_rect
return #$00
2018-02-24 04:54:37 +00:00
2018-02-24 05:07:11 +00:00
L95BF: .byte 0
2018-02-24 04:54:37 +00:00
L95C0: lda #$00
sta L9645
2018-03-02 02:25:42 +00:00
L95C5: MGTK_RELAY_CALL MGTK::GetEvent, event_params
lda event_kind
2018-11-18 04:34:17 +00:00
cmp #MGTK::EventKind::button_up
2018-02-24 04:54:37 +00:00
beq L9628
2018-03-15 04:10:08 +00:00
lda winfo_entry_picker
2018-03-02 02:25:42 +00:00
sta screentowindow_window_id
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
MGTK_RELAY_CALL MGTK::MoveTo, screentowindow_windowx
2019-02-09 21:10:24 +00:00
MGTK_RELAY_CALL MGTK::InRect, entry_picker_cancel_rect
2018-02-25 21:47:06 +00:00
cmp #MGTK::inrect_inside
2018-02-24 04:54:37 +00:00
beq L9602
lda L9645
beq L960A
jmp L95C5
L9602: lda L9645
bne L960A
jmp L95C5
2018-03-02 02:25:42 +00:00
L960A: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2019-02-09 21:10:24 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, entry_picker_cancel_rect
2018-02-24 04:54:37 +00:00
lda L9645
clc
adc #$80
sta L9645
jmp L95C5
L9628: lda L9645
beq L9630
return #$FF
2018-02-24 04:54:37 +00:00
2018-03-02 02:25:42 +00:00
L9630: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2019-02-09 21:10:24 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, entry_picker_cancel_rect
return #$01
2018-02-24 04:54:37 +00:00
2018-02-24 05:07:11 +00:00
L9645: .byte 0
2018-03-02 02:25:42 +00:00
L9646: MGTK_RELAY_CALL MGTK::GetEvent, event_params
lda event_kind
2018-11-18 04:34:17 +00:00
cmp #MGTK::EventKind::button_down
2018-02-24 04:54:37 +00:00
bne L9659
jmp L9660
2018-11-18 04:34:17 +00:00
L9659: cmp #MGTK::EventKind::key_down
2018-02-24 04:54:37 +00:00
bne L9646
jmp L9822
2018-03-02 02:25:42 +00:00
L9660: MGTK_RELAY_CALL MGTK::FindWindow, findwindow_params
lda findwindow_which_area
2018-02-24 04:54:37 +00:00
bne L9671
return #$FF
2018-02-24 04:54:37 +00:00
2018-11-18 04:34:17 +00:00
L9671: cmp #MGTK::Area::content
2018-02-24 04:54:37 +00:00
beq L9678
return #$FF
2018-02-24 04:54:37 +00:00
2018-03-02 02:25:42 +00:00
L9678: lda findwindow_window_id
2018-03-15 04:10:08 +00:00
cmp winfo_entry_picker
2018-02-24 04:54:37 +00:00
beq L9683
return #$FF
2018-02-24 04:54:37 +00:00
2018-03-15 04:10:08 +00:00
L9683: lda winfo_entry_picker
jsr desktop_main::set_port_from_window_id
2018-03-15 04:10:08 +00:00
lda winfo_entry_picker
2018-03-02 02:25:42 +00:00
sta screentowindow_window_id
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
MGTK_RELAY_CALL MGTK::MoveTo, screentowindow_windowx
2019-02-09 21:10:24 +00:00
MGTK_RELAY_CALL MGTK::InRect, entry_picker_ok_rect
2018-02-25 21:47:06 +00:00
cmp #MGTK::inrect_inside
2018-02-24 04:54:37 +00:00
bne L96C8
2018-03-02 02:25:42 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2019-02-09 21:10:24 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, entry_picker_ok_rect
2018-02-24 04:54:37 +00:00
jsr L953A
bmi L96C7
lda #$00
L96C7: rts
2019-02-09 21:10:24 +00:00
L96C8: MGTK_RELAY_CALL MGTK::InRect, entry_picker_cancel_rect
2018-02-25 21:47:06 +00:00
cmp #MGTK::inrect_inside
2018-02-24 04:54:37 +00:00
bne L96EF
2018-03-02 02:25:42 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2019-02-09 21:10:24 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, entry_picker_cancel_rect
2018-02-24 04:54:37 +00:00
jsr L95C0
bmi L96EE
lda #$01
L96EE: rts
L96EF: sub16 screentowindow_windowx, #10, screentowindow_windowx
sub16 screentowindow_windowy, #25, screentowindow_windowy
2018-02-24 04:54:37 +00:00
bpl L9716
return #$FF
2018-02-24 04:54:37 +00:00
2019-02-09 21:10:24 +00:00
;; Determine column
L9716: cmp16 screentowindow_windowx, #110
2018-02-24 04:54:37 +00:00
bmi L9736
cmp16 screentowindow_windowx, #220
2018-02-24 04:54:37 +00:00
bmi L9732
2019-02-09 21:10:24 +00:00
lda #2
2018-02-24 04:54:37 +00:00
bne L9738
2019-02-09 21:10:24 +00:00
L9732: lda #1
2018-02-24 04:54:37 +00:00
bne L9738
2019-02-09 21:10:24 +00:00
L9736: lda #0
;; Determine row
2018-02-24 04:54:37 +00:00
L9738: pha
ldax screentowindow_windowy
ldy #entry_picker_item_height
jsr Divide_16_8_16
stax screentowindow_windowy
cmp #8
bcc :+
2018-02-24 04:54:37 +00:00
pla
return #$FF
2018-02-24 04:54:37 +00:00
: pla
2018-02-24 04:54:37 +00:00
asl a
asl a
asl a
clc
adc screentowindow_windowy
2018-02-24 04:54:37 +00:00
sta L979C
2019-02-09 21:10:24 +00:00
cmp #8
2018-02-24 04:54:37 +00:00
bcs L9782
cmp L938B
bcs L9790
L976A: cmp L938D
beq L977E
lda L938D
jsr L979D
lda L979C
sta L938D
jsr L979D
L977E: jsr desktop_main::detect_double_click
2018-02-24 04:54:37 +00:00
rts
L9782: sec
2019-02-09 21:10:24 +00:00
sbc #8
2018-02-24 04:54:37 +00:00
cmp L938C
bcs L9790
clc
2019-02-09 21:10:24 +00:00
adc #8
2018-02-24 04:54:37 +00:00
jmp L976A
L9790: lda L938D
jsr L979D
lda #$FF
sta L938D
rts
2018-02-24 05:07:11 +00:00
L979C: .byte 0
2018-02-24 04:54:37 +00:00
L979D: bpl L97A0
rts
L97A0: pha
lsr a
lsr a
lsr a
tax
beq L97B6
2019-02-09 21:10:24 +00:00
cmp #1
2018-02-24 04:54:37 +00:00
bne L97B2
addr_jump L97B6, $0069
2018-02-24 04:54:37 +00:00
L97B2: ldax #210
2018-02-24 04:54:37 +00:00
L97B6: clc
adc #9
2019-02-09 21:10:24 +00:00
sta entry_picker_item_rect::x1
2018-02-24 04:54:37 +00:00
txa
adc #0
2019-02-09 21:10:24 +00:00
sta entry_picker_item_rect::x1+1
2018-02-24 04:54:37 +00:00
pla
cmp #8
2018-02-24 04:54:37 +00:00
bcc L97D4
cmp #16
2018-02-24 04:54:37 +00:00
bcs L97D1
sec
sbc #8
2018-02-24 04:54:37 +00:00
jmp L97D4
L97D1: sec
sbc #16
L97D4: ldx #0
ldy #entry_picker_item_height
jsr Multiply_16_8_16
2018-02-24 04:54:37 +00:00
clc
adc #24
2019-02-09 21:10:24 +00:00
sta entry_picker_item_rect::y1
txa
adc #0
2019-02-09 21:10:24 +00:00
sta entry_picker_item_rect::y1+1
add16 entry_picker_item_rect::x1, #106, entry_picker_item_rect::x2
add16 entry_picker_item_rect::y1, #entry_picker_item_height-1, entry_picker_item_rect::y2
2018-03-02 02:25:42 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2019-02-09 21:10:24 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, entry_picker_item_rect
2018-03-02 02:25:42 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, pencopy
2018-02-24 04:54:37 +00:00
rts
2018-03-15 03:38:47 +00:00
;; key down handler
L9822: lda event_modifiers
cmp #MGTK::event_modifier_solid_apple
bne :+
return #$FF
2018-03-15 03:38:47 +00:00
: lda event_key
and #CHAR_MASK
2018-03-15 03:38:47 +00:00
cmp #CHAR_LEFT
bne :+
2018-02-24 04:54:37 +00:00
jmp L98F8
2018-03-15 03:38:47 +00:00
: cmp #CHAR_RIGHT
bne :+
2018-02-24 04:54:37 +00:00
jmp L98AC
2018-03-15 03:38:47 +00:00
: cmp #CHAR_RETURN
bne :+
2018-02-24 04:54:37 +00:00
jmp L985E
2018-03-15 03:38:47 +00:00
: cmp #CHAR_ESCAPE
bne :+
2018-02-24 04:54:37 +00:00
jmp L9885
2018-03-15 03:38:47 +00:00
: cmp #CHAR_DOWN
bne :+
2018-02-24 04:54:37 +00:00
jmp L9978
2018-03-15 03:38:47 +00:00
: cmp #CHAR_UP
bne :+
2018-02-24 04:54:37 +00:00
jmp L993F
2018-03-15 03:38:47 +00:00
: return #$FF
2018-02-24 04:54:37 +00:00
2018-03-02 02:25:42 +00:00
L985E: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2019-02-09 21:10:24 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, entry_picker_ok_rect
2018-03-02 02:25:42 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2019-02-09 21:10:24 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, entry_picker_ok_rect
return #0
2018-02-24 04:54:37 +00:00
2018-03-02 02:25:42 +00:00
L9885: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2019-02-09 21:10:24 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, entry_picker_cancel_rect
2018-03-02 02:25:42 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2019-02-09 21:10:24 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, entry_picker_cancel_rect
return #1
2018-02-24 04:54:37 +00:00
L98AC: lda L938B
ora L938C
beq L98F5
lda L938D
bpl L98CE
ldx #$00
lda L99DD
bpl L98EE
ldx #$08
lda L99E5
bpl L98EE
ldx #$10
lda L99ED
bpl L98EE
L98CE: lda L938D
jsr L979D
lda L938D
L98D7: clc
adc #$08
cmp #$18
bcc L98E4
sec
sbc #$20
jmp L98D7
L98E4: tax
lda L99DD,x
bpl L98EE
txa
jmp L98D7
L98EE: txa
sta L938D
jsr L979D
L98F5: return #$FF
2018-02-24 04:54:37 +00:00
L98F8: lda L938B
ora L938C
beq L993C
lda L938D
bpl L9917
ldx #$10
lda L99ED
bpl L9935
ldx #$08
lda L99E5
bpl L9935
lda #$00
beq L9936
L9917: lda L938D
jsr L979D
lda L938D
L9920: sec
sbc #$08
bpl L992B
clc
adc #$20
jmp L9920
L992B: tax
lda L99DD,x
bpl L9935
txa
jmp L9920
L9935: txa
L9936: sta L938D
jsr L979D
L993C: return #$FF
2018-02-24 04:54:37 +00:00
L993F: lda L938B
ora L938C
beq L9975
lda L938D
bpl L9956
ldx #$17
L994E: lda L99DD,x
bpl L996F
dex
bpl L994E
L9956: lda L938D
jsr L979D
ldx L938D
L995F: dex
bmi L996A
lda L99DD,x
bpl L996F
jmp L995F
L996A: ldx #$18
jmp L995F
L996F: sta L938D
jsr L979D
L9975: return #$FF
2018-02-24 04:54:37 +00:00
L9978: lda L938B
ora L938C
beq L99B0
lda L938D
bpl L998F
ldx #$00
L9987: lda L99DD,x
bpl L99AA
inx
bne L9987
L998F: lda L938D
jsr L979D
ldx L938D
L9998: inx
cpx #$18
bcs L99A5
lda L99DD,x
bpl L99AA
jmp L9998
L99A5: ldx #$FF
jmp L9998
L99AA: sta L938D
jsr L979D
L99B0: return #$FF
2018-02-24 04:54:37 +00:00
L99B3: ldx #$17
lda #$FF
L99B7: sta L99DD,x
dex
bpl L99B7
ldx #$00
L99BF: cpx L938B
beq L99CB
txa
sta L99DD,x
inx
bne L99BF
L99CB: ldx #$00
L99CD: cpx L938C
beq L99DC
txa
clc
adc #$08
sta L99E5,x
inx
bne L99CD
L99DC: rts
2018-02-24 05:07:11 +00:00
L99DD: .byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
L99E5: .byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
L99ED: .byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
2018-03-02 02:25:42 +00:00
L99F5: MGTK_RELAY_CALL MGTK::SetPenMode, pencopy
2019-02-09 21:10:24 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, entry_picker_all_items_rect
2018-02-24 04:54:37 +00:00
rts
rts
rts
L9A0A: cmp #$08
bcc L9A11
jmp L9A61
L9A11: sta L9A60
tya
pha
lda L9A60
jsr L9BD5
2018-02-26 00:10:27 +00:00
stax $06
2018-02-24 04:54:37 +00:00
lda L9A60
jsr L9BEF
2018-02-26 00:10:27 +00:00
stax $08
ldy path_buf1
L9A2D: lda path_buf1,y
2018-02-24 04:54:37 +00:00
sta ($06),y
sta ($08),y
dey
bpl L9A2D
ldy #$0F
pla
sta ($06),y
sta ($08),y
lda L9A60
jsr L9BE2
2018-02-26 00:10:27 +00:00
stax $06
2018-02-24 04:54:37 +00:00
lda L9A60
jsr L9BFC
2018-02-26 00:10:27 +00:00
stax $08
ldy path_buf0
L9A55: lda path_buf0,y
2018-02-24 04:54:37 +00:00
sta ($06),y
sta ($08),y
dey
bpl L9A55
rts
2018-02-24 05:07:11 +00:00
L9A60: .byte 0
2018-02-24 04:54:37 +00:00
L9A61: sta L9A96
tya
pha
lda L9A96
jsr L9BD5
2018-02-26 00:10:27 +00:00
stax $06
ldy path_buf1
L9A73: lda path_buf1,y
2018-02-24 04:54:37 +00:00
sta ($06),y
dey
bpl L9A73
ldy #$0F
pla
sta ($06),y
lda L9A96
jsr L9BE2
2018-02-26 00:10:27 +00:00
stax $06
ldy path_buf0
L9A8D: lda path_buf0,y
2018-02-24 04:54:37 +00:00
sta ($06),y
dey
bpl L9A8D
rts
2018-02-24 05:07:11 +00:00
L9A96: .byte 0
2018-02-24 04:54:37 +00:00
L9A97: sta L9BD4
cmp #$08
bcc L9AA1
jmp L9B5F
L9AA1: tax
inx
cpx L938B
bne L9AC0
L9AA8: dec $0C00
dec L938B
2018-11-23 18:07:33 +00:00
copy16 selector_menu_addr, @addr
2018-02-26 03:40:53 +00:00
@addr := *+1
dec dummy1234
2018-02-24 04:54:37 +00:00
jmp L9CEA
L9AC0: lda L9BD4
cmp L938B
beq L9AA8
jsr L9BD5
2018-02-26 00:10:27 +00:00
stax $06
2018-02-24 04:54:37 +00:00
lda $06
adc #$10
sta $08
lda $07
adc #$00
sta $09
ldy #$00
lda ($08),y
tay
L9AE0: lda ($08),y
sta ($06),y
dey
bpl L9AE0
ldy #$0F
lda ($08),y
sta ($06),y
lda L9BD4
jsr L9BEF
2018-02-26 00:10:27 +00:00
stax $06
2018-02-24 04:54:37 +00:00
lda $06
adc #$10
sta $08
lda $07
adc #$00
sta $09
ldy #$00
lda ($08),y
tay
L9B08: lda ($08),y
sta ($06),y
dey
bpl L9B08
ldy #$0F
lda ($08),y
sta ($06),y
lda L9BD4
jsr L9BE2
2018-02-26 00:10:27 +00:00
stax $06
2018-02-24 04:54:37 +00:00
lda $06
adc #$40
sta $08
lda $07
adc #$00
sta $09
ldy #$00
lda ($08),y
tay
L9B30: lda ($08),y
sta ($06),y
dey
bpl L9B30
lda L9BD4
jsr L9BFC
2018-02-26 00:10:27 +00:00
stax $06
2018-02-24 04:54:37 +00:00
lda $06
adc #$40
sta $08
lda $07
adc #$00
sta $09
ldy #$00
lda ($08),y
tay
L9B52: lda ($08),y
sta ($06),y
dey
bpl L9B52
inc L9BD4
jmp L9AC0
L9B5F: sec
sbc #$07
cmp L938C
bne L9B70
dec $0C01
dec L938C
jmp L9CEA
L9B70: lda L9BD4
sec
sbc #$08
cmp L938C
bne L9B84
dec $0C01
dec L938C
jmp L9CEA
L9B84: lda L9BD4
jsr L9BD5
2018-02-26 00:10:27 +00:00
stax $06
2018-02-24 04:54:37 +00:00
lda $06
adc #$10
sta $08
lda $07
adc #$00
sta $09
ldy #$00
lda ($08),y
tay
L9B9F: lda ($08),y
sta ($06),y
dey
bpl L9B9F
lda L9BD4
jsr L9BE2
2018-02-26 00:10:27 +00:00
stax $06
2018-02-24 04:54:37 +00:00
lda $06
adc #$40
sta $08
lda $07
adc #$00
sta $09
ldy #$00
lda ($08),y
tay
L9BC1: lda ($08),y
sta ($06),y
dey
bpl L9BC1
ldy #$0F
lda ($08),y
sta ($06),y
inc L9BD4
jmp L9B70
2018-02-24 05:07:11 +00:00
L9BD4: .byte 0
2018-02-24 04:54:37 +00:00
L9BD5: jsr L9D8D
clc
adc #$02
tay
txa
adc #$0C
tax
tya
rts
L9BE2: jsr L9DA7
clc
adc #$82
tay
txa
adc #$0D
tax
tya
rts
L9BEF: jsr L9D8D
clc
adc #$1E
tay
txa
adc #$DB
tax
tya
rts
L9BFC: jsr L9DA7
clc
adc #$9E
tay
txa
adc #$DB
tax
tya
rts
L9C09: sta warning_dialog_num
yax_call desktop_main::invoke_dialog_proc, $0C, warning_dialog_num
2018-02-24 04:54:37 +00:00
rts
2018-02-26 04:28:23 +00:00
DEFINE_OPEN_PARAMS open_params, $1C00, $800
DEFINE_WRITE_PARAMS write_params, $C00, $800
DEFINE_CLOSE_PARAMS flush_close_params
2018-02-26 03:40:53 +00:00
L9C26: addr_call copy_desktop_orig_prefix, $1C00
2018-02-24 04:54:37 +00:00
inc $1C00
ldx $1C00
2018-11-25 22:38:06 +00:00
lda #'/'
2018-02-24 04:54:37 +00:00
sta $1C00,x
ldx #$00
ldy $1C00
L9C3D: inx
iny
lda L9C9A,x
sta $1C00,y
cpx L9C9A
bne L9C3D
sty $1C00
2018-02-26 03:40:53 +00:00
L9C4D: yax_call MLI_RELAY, OPEN, open_params
2018-02-24 04:54:37 +00:00
beq L9C60
lda #$00
jsr L9C09
beq L9C4D
L9C5F: rts
2018-02-26 03:40:53 +00:00
L9C60: lda open_params::ref_num
sta write_params::ref_num
sta flush_close_params::ref_num
L9C69: yax_call MLI_RELAY, WRITE, write_params
2018-02-24 04:54:37 +00:00
beq L9C81
pha
2018-02-25 07:19:29 +00:00
jsr JUMP_TABLE_REDRAW_ALL
2018-02-24 04:54:37 +00:00
pla
2018-02-25 07:19:29 +00:00
jsr JUMP_TABLE_ALERT_0
2018-02-24 04:54:37 +00:00
beq L9C69
jmp L9C5F
2018-02-26 03:40:53 +00:00
L9C81: yax_call MLI_RELAY, FLUSH, flush_close_params
yax_call MLI_RELAY, CLOSE, flush_close_params
2018-02-24 04:54:37 +00:00
rts
2018-11-23 18:07:33 +00:00
DEFINE_OPEN_PARAMS open_params2, L9C9A, $800
2018-02-26 03:40:53 +00:00
2018-02-24 05:07:11 +00:00
L9C9A: PASCAL_STRING "Selector.List"
2018-02-26 04:28:23 +00:00
DEFINE_READ_PARAMS read_params2, $C00, $800
DEFINE_WRITE_PARAMS write_params2, $C00, $800
DEFINE_CLOSE_PARAMS close_params2
2018-02-26 03:40:53 +00:00
L9CBA: yax_call MLI_RELAY, OPEN, open_params2
2018-02-24 04:54:37 +00:00
beq L9CCF
lda #$00
jsr L9C09
beq L9CBA
return #$FF
2018-02-24 04:54:37 +00:00
2018-02-26 03:40:53 +00:00
L9CCF: lda open_params2::ref_num
sta read_params2::ref_num
yax_call MLI_RELAY, READ, read_params2
2018-02-24 04:54:37 +00:00
bne L9CE9
2018-02-26 03:40:53 +00:00
yax_call MLI_RELAY, CLOSE, close_params2
2018-02-24 04:54:37 +00:00
L9CE9: rts
2018-02-26 03:40:53 +00:00
L9CEA: yax_call MLI_RELAY, OPEN, open_params2
2018-02-24 04:54:37 +00:00
beq L9CFF
2018-02-26 03:40:53 +00:00
lda #0
2018-02-24 04:54:37 +00:00
jsr L9C09
beq L9CBA
return #$FF
2018-02-24 04:54:37 +00:00
2018-02-26 03:40:53 +00:00
L9CFF: lda open_params2::ref_num
sta write_params2::ref_num
L9D05: yax_call MLI_RELAY, WRITE, write_params2
2018-02-24 04:54:37 +00:00
beq L9D18
2018-02-25 07:19:29 +00:00
jsr JUMP_TABLE_ALERT_0
2018-02-24 04:54:37 +00:00
beq L9D05
jmp L9D21
2018-02-26 03:40:53 +00:00
L9D18: yax_call MLI_RELAY, CLOSE, close_params2
2018-02-24 04:54:37 +00:00
L9D21: rts
L9D22: jsr L9CBA
bpl L9D28
rts
L9D28: lda $0C00
sta L938B
beq L9D55
lda #$00
sta L9D8C
L9D35: lda L9D8C
cmp L938B
beq L9D55
jsr L9D8D
clc
adc #$02
pha
txa
adc #$0C
tax
pla
ldy L9D8C
jsr L942B
inc L9D8C
jmp L9D35
L9D55: lda $0C01
sta L938C
beq L9D89
lda #$00
sta L9D8C
L9D62: lda L9D8C
cmp L938C
beq L9D89
clc
adc #$08
jsr L9D8D
clc
adc #$02
pha
txa
adc #$0C
tax
lda L9D8C
clc
adc #$08
tay
pla
jsr L942B
inc L9D8C
jmp L9D62
L9D89: return #$00
2018-02-24 04:54:37 +00:00
2018-02-24 05:07:11 +00:00
L9D8C: .byte 0
2018-02-24 04:54:37 +00:00
L9D8D: ldx #$00
stx L9DA6
asl a
rol L9DA6
asl a
rol L9DA6
asl a
rol L9DA6
asl a
rol L9DA6
ldx L9DA6
rts
2018-02-24 05:07:11 +00:00
L9DA6: .byte 0
2018-02-24 04:54:37 +00:00
L9DA7: ldx #$00
stx L9DC8
asl a
rol L9DC8
asl a
rol L9DC8
asl a
rol L9DC8
asl a
rol L9DC8
asl a
rol L9DC8
asl a
rol L9DC8
ldx L9DC8
rts
2018-02-24 05:07:11 +00:00
L9DC8: .byte 0
2018-02-25 21:52:16 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-26 03:40:53 +00:00
2018-02-25 21:52:16 +00:00
.proc MLI_RELAY
sty call
stax params
2018-02-24 04:54:37 +00:00
sta ALTZPOFF
2018-02-25 21:47:06 +00:00
sta ROMIN2
2018-02-24 04:54:37 +00:00
jsr MLI
2018-02-25 21:52:16 +00:00
call: .byte 0
params: .addr 0
2018-02-24 04:54:37 +00:00
sta ALTZPON
tax
lda LCBANK1
lda LCBANK1
txa
rts
2018-02-25 21:52:16 +00:00
.endproc
2018-02-24 04:54:37 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-26 03:40:53 +00:00
.proc get_copied_to_ramcard_flag
2018-11-25 22:38:06 +00:00
sta ALTZPOFF
lda LCBANK2
lda LCBANK2
lda copied_to_ramcard_flag
2018-02-24 04:54:37 +00:00
tax
sta ALTZPON
lda LCBANK1
lda LCBANK1
txa
rts
2018-11-25 22:38:06 +00:00
.endproc
2018-02-24 04:54:37 +00:00
.proc copy_ramcard_prefix
2018-11-25 22:38:06 +00:00
stax @addr
2018-02-24 04:54:37 +00:00
sta ALTZPOFF
lda LCBANK2
lda LCBANK2
2018-11-25 22:38:06 +00:00
ldx ramcard_prefix
: lda ramcard_prefix,x
@addr := *+1
2018-11-23 18:07:33 +00:00
sta dummy1234,x
2018-02-24 04:54:37 +00:00
dex
bpl :-
2018-11-25 22:38:06 +00:00
2018-02-24 04:54:37 +00:00
sta ALTZPON
lda LCBANK1
lda LCBANK1
rts
2018-11-25 22:38:06 +00:00
.endproc
2018-02-24 04:54:37 +00:00
.proc copy_desktop_orig_prefix
2018-11-25 22:38:06 +00:00
stax @addr
2018-02-24 04:54:37 +00:00
sta ALTZPOFF
lda LCBANK2
lda LCBANK2
2018-11-25 22:38:06 +00:00
ldx desktop_orig_prefix
: lda desktop_orig_prefix,x
@addr := *+1
2018-11-23 18:07:33 +00:00
sta dummy1234,x
2018-02-24 04:54:37 +00:00
dex
bpl :-
2018-11-25 22:38:06 +00:00
2018-02-24 04:54:37 +00:00
sta ALTZPON
lda LCBANK1
lda LCBANK1
rts
2018-11-25 22:38:06 +00:00
.endproc
;;; ============================================================
2018-02-24 04:54:37 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_GET_FILE_INFO_PARAMS get_file_info_params, 0
2018-02-26 03:40:53 +00:00
2018-02-24 04:54:37 +00:00
L9E61: jsr L9E74
2018-02-26 03:40:53 +00:00
stax get_file_info_params::pathname
yax_call MLI_RELAY, GET_FILE_INFO, get_file_info_params
2018-02-24 04:54:37 +00:00
rts
L9E74: sta L9EBF
addr_call copy_ramcard_prefix, L9EC1
2018-02-24 04:54:37 +00:00
lda L9EBF
jsr L9BE2
2018-02-26 00:10:27 +00:00
stax $06
2018-02-24 04:54:37 +00:00
ldy #$00
lda ($06),y
sta L9EC0
tay
L9E90: lda ($06),y
and #CHAR_MASK
cmp #'/'
2018-02-24 04:54:37 +00:00
beq L9E9B
dey
bne L9E90
L9E9B: dey
L9E9C: lda ($06),y
and #CHAR_MASK
cmp #'/'
2018-02-24 04:54:37 +00:00
beq L9EA7
dey
bne L9E9C
L9EA7: dey
ldx L9EC1
L9EAB: inx
iny
lda ($06),y
sta L9EC1,x
cpy L9EC0
bne L9EAB
stx L9EC1
2018-11-23 18:07:33 +00:00
ldax #L9EC1
2018-02-24 04:54:37 +00:00
rts
2018-02-24 05:07:11 +00:00
L9EBF: .byte 0
L9EC0: .byte 0
L9EC1: .byte 0
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 23:19:38 +00:00
2018-02-24 05:07:11 +00:00
PAD_TO $A000
2018-02-25 23:19:38 +00:00
.endproc ; selector_overlay2