a2d/desktop/ovl4.s

3192 lines
74 KiB
ArmAsm
Raw Normal View History

2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 21:19:11 +00:00
;;; Overlay for Common Routines (Selector, File Copy/Delete)
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 23:19:38 +00:00
.proc common_overlay
.org $5000
2018-02-25 21:19:11 +00:00
2018-02-28 02:25:03 +00:00
;;; ============================================================
2018-02-26 03:20:43 +00:00
L5000: jmp L50B1
2018-02-25 21:19:11 +00:00
2018-03-01 05:11:59 +00:00
DEFINE_ON_LINE_PARAMS on_line_params,, on_line_buffer
DEFINE_OPEN_PARAMS open_params, path_buf, $1000
DEFINE_READ_PARAMS read_params, $1400, $200
DEFINE_CLOSE_PARAMS close_params
on_line_buffer: .res 16, 0
2018-05-17 15:54:22 +00:00
device_num: .byte $00 ; next device number to try
2018-03-01 05:11:59 +00:00
path_buf: .res 128, 0
2018-02-25 21:19:11 +00:00
L50A8: .byte $00
L50A9: .byte $00
2018-02-25 23:19:38 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 23:19:38 +00:00
2018-03-01 05:11:59 +00:00
stash_stack: .byte 0
routine_table: .addr $7000, $7000, $7000
.proc L50B1
sty stash_y
stx stash_x
2018-02-25 21:19:11 +00:00
tsx
2018-03-01 05:11:59 +00:00
stx stash_stack
2018-02-25 21:19:11 +00:00
pha
2018-03-01 05:11:59 +00:00
lda #0
2018-05-17 15:54:22 +00:00
sta device_num
2018-02-25 21:19:11 +00:00
sta L50A8
2018-05-09 03:14:59 +00:00
sta prompt_ip_flag
sta LD8EC
2018-11-23 22:33:37 +00:00
sta LD8F0
sta LD8F1
sta LD8F2
sta cursor_ip_flag
2018-02-25 21:19:11 +00:00
sta L5104
sta L5103
sta L5105
2018-05-18 16:07:41 +00:00
lda #prompt_insertion_point_blink_count
sta prompt_ip_counter
2018-02-25 21:19:11 +00:00
lda #$FF
2018-11-23 22:33:37 +00:00
sta LD920
2018-02-25 21:19:11 +00:00
pla
asl a
tax
copy16 routine_table,x, @jump
2018-03-01 05:11:59 +00:00
ldy stash_y
ldx stash_x
@jump := *+1
2018-02-25 21:19:11 +00:00
jmp dummy1234
2018-03-01 05:11:59 +00:00
stash_x: .byte 0
stash_y: .byte 0
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-05-18 16:07:41 +00:00
;;; Flags set by invoker to alter behavior
2018-02-25 23:19:38 +00:00
2018-12-18 03:43:25 +00:00
L5103: .byte 0 ; ??? something before jt_handle_click invoked
2018-05-18 16:07:41 +00:00
L5104: .byte 0 ; ??? something about inputs
L5105: .byte 0 ; ??? something about the picker
2018-02-25 23:19:38 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 23:19:38 +00:00
L5106: bit LD8EC
2018-03-01 05:11:59 +00:00
bpl :+
2018-12-18 03:01:37 +00:00
2018-05-18 16:07:41 +00:00
dec prompt_ip_counter
2018-03-01 05:11:59 +00:00
bne :+
2018-12-18 04:13:02 +00:00
jsr jt_blink_ip
2018-12-18 03:01:37 +00:00
copy #prompt_insertion_point_blink_count, prompt_ip_counter
2018-03-01 05:11:59 +00:00
: MGTK_RELAY_CALL MGTK::GetEvent, event_params
2018-02-28 02:38:18 +00:00
lda event_kind
2018-11-18 04:34:17 +00:00
cmp #MGTK::EventKind::button_down
2018-02-28 02:25:03 +00:00
bne :+
2018-02-25 21:19:11 +00:00
jsr L51AF
jmp L5106
2018-11-18 04:34:17 +00:00
: cmp #MGTK::EventKind::key_down
2018-02-28 02:25:03 +00:00
bne :+
2018-02-25 21:19:11 +00:00
jsr L59B9
2018-02-28 02:25:03 +00:00
: MGTK_RELAY_CALL MGTK::FindWindow, findwindow_params
2018-02-28 02:38:18 +00:00
lda findwindow_which_area
2018-02-28 02:25:03 +00:00
bne :+
2018-02-25 21:19:11 +00:00
jmp L5106
2018-02-28 02:38:18 +00:00
: lda findwindow_window_id
2018-03-15 04:10:08 +00:00
cmp winfo_entrydlg
2018-02-25 21:19:11 +00:00
beq L5151
jmp L5106
2018-03-15 04:10:08 +00:00
L5151: lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
2018-03-15 04:10:08 +00:00
lda winfo_entrydlg
2018-02-28 02:25:03 +00:00
sta screentowindow_window_id
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
MGTK_RELAY_CALL MGTK::MoveTo, screentowindow_windowx
2018-02-25 21:19:11 +00:00
bit L51AE
bmi L5183
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::InRect, common_input1_rect
2018-02-25 21:47:06 +00:00
cmp #MGTK::inrect_inside
2018-02-25 21:19:11 +00:00
bne L5196
beq L5190
2018-05-08 02:35:36 +00:00
L5183: MGTK_RELAY_CALL MGTK::InRect, common_input2_rect
2018-02-25 21:47:06 +00:00
cmp #MGTK::inrect_inside
2018-02-25 21:19:11 +00:00
bne L5196
L5190: jsr set_cursor_insertion
2018-02-25 21:19:11 +00:00
jmp L5199
L5196: jsr set_cursor_pointer
L5199: MGTK_RELAY_CALL MGTK::InitPort, grafport3
MGTK_RELAY_CALL MGTK::SetPort, grafport3
2018-02-25 21:19:11 +00:00
jmp L5106
2018-02-25 21:21:55 +00:00
L51AE: .byte 0
2018-05-18 16:07:41 +00:00
;;; ============================================================
2018-02-28 02:25:03 +00:00
L51AF: MGTK_RELAY_CALL MGTK::FindWindow, findwindow_params
2018-02-28 02:38:18 +00:00
lda findwindow_which_area
2018-05-18 16:07:41 +00:00
bne :+
2018-02-25 21:19:11 +00:00
rts
2018-11-18 04:34:17 +00:00
: cmp #MGTK::Area::content
bne :+
2018-02-25 21:19:11 +00:00
jmp L51C7
rts ; ???
: rts
2018-02-25 21:19:11 +00:00
L51C7: lda findwindow_window_id
2018-03-15 04:10:08 +00:00
cmp winfo_entrydlg
2018-02-25 21:19:11 +00:00
beq L51D2
jmp L531F
2018-03-15 04:10:08 +00:00
L51D2: lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
2018-03-15 04:10:08 +00:00
lda winfo_entrydlg
2018-02-28 02:25:03 +00:00
sta screentowindow_window_id
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
MGTK_RELAY_CALL MGTK::MoveTo, screentowindow_windowx
2018-05-18 16:07:41 +00:00
;; In open button?
.proc check_open_button
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::InRect, common_open_button_rect
2018-02-25 21:47:06 +00:00
cmp #MGTK::inrect_inside
2018-05-18 16:07:41 +00:00
beq clicked
jmp check_change_drive_button
2018-02-25 21:19:11 +00:00
2018-05-18 16:07:41 +00:00
clicked:
bit L5105
2018-02-25 21:19:11 +00:00
bmi L520A
2018-11-23 22:33:37 +00:00
lda LD920
2018-02-25 21:19:11 +00:00
bpl L520D
2018-05-18 16:07:41 +00:00
L520A: jmp set_up_ports
2018-02-25 21:19:11 +00:00
L520D: tax
lda $1780,x
bmi L5216
2018-05-18 16:07:41 +00:00
L5213: jmp set_up_ports
2018-02-25 21:19:11 +00:00
2018-03-15 04:10:08 +00:00
L5216: lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, common_open_button_rect
2018-05-18 02:10:47 +00:00
jsr track_open_button_click
2018-02-25 21:19:11 +00:00
bmi L5213
jsr L5607
2018-05-18 16:07:41 +00:00
jmp set_up_ports
.endproc
2018-02-25 21:19:11 +00:00
2018-05-18 16:07:41 +00:00
.proc check_change_drive_button
MGTK_RELAY_CALL MGTK::InRect, common_change_drive_button_rect
2018-02-25 21:47:06 +00:00
cmp #MGTK::inrect_inside
2018-05-18 16:07:41 +00:00
beq :+
jmp check_close_button
: bit L5105
2018-02-25 21:19:11 +00:00
bmi L5268
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, common_change_drive_button_rect
2018-05-18 02:10:47 +00:00
jsr track_change_drive_button_click
2018-02-25 21:19:11 +00:00
bmi L5268
jsr L565C
2018-05-18 16:07:41 +00:00
L5268: jmp set_up_ports
.endproc
2018-02-25 21:19:11 +00:00
2018-05-18 16:07:41 +00:00
.proc check_close_button
MGTK_RELAY_CALL MGTK::InRect, common_close_button_rect
2018-02-25 21:47:06 +00:00
cmp #MGTK::inrect_inside
2018-05-18 16:07:41 +00:00
beq :+
jmp check_ok_button
: bit L5105
2018-02-25 21:19:11 +00:00
bmi L529A
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, common_close_button_rect
2018-05-18 02:10:47 +00:00
jsr track_close_button_click
2018-02-25 21:19:11 +00:00
bmi L529A
jsr L567F
2018-05-18 16:07:41 +00:00
L529A: jmp set_up_ports
.endproc
2018-02-25 21:19:11 +00:00
2018-05-18 16:07:41 +00:00
.proc check_ok_button
MGTK_RELAY_CALL MGTK::InRect, common_ok_button_rect
2018-02-25 21:47:06 +00:00
cmp #MGTK::inrect_inside
2018-05-18 16:07:41 +00:00
beq :+
jmp check_cancel_button
: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, common_ok_button_rect
2018-05-18 02:10:47 +00:00
jsr track_ok_button_click
2018-02-25 21:19:11 +00:00
bmi L52CA
2018-12-18 03:43:25 +00:00
jsr jt_handle_meta_right_key
jsr jt_handle_ok
2018-05-18 16:07:41 +00:00
L52CA: jmp set_up_ports
.endproc
2018-02-25 21:19:11 +00:00
2018-05-18 16:07:41 +00:00
.proc check_cancel_button
MGTK_RELAY_CALL MGTK::InRect, common_cancel_button_rect
2018-02-25 21:47:06 +00:00
cmp #MGTK::inrect_inside
2018-05-18 16:07:41 +00:00
beq :+
jmp check_other_click
: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, common_cancel_button_rect
2018-05-18 02:10:47 +00:00
jsr track_cancel_button_click
2018-02-25 21:19:11 +00:00
bmi L52F7
2018-12-18 03:43:25 +00:00
jsr jt_handle_cancel
2018-05-18 16:07:41 +00:00
L52F7: jmp set_up_ports
.endproc
2018-02-25 21:19:11 +00:00
2018-05-18 16:07:41 +00:00
.proc check_other_click
bit L5103
bpl :+
2018-02-25 21:19:11 +00:00
jsr L531B
2018-05-18 16:07:41 +00:00
bmi set_up_ports
2018-12-18 03:43:25 +00:00
: jsr jt_handle_click
2018-02-25 21:19:11 +00:00
rts
2018-05-18 16:07:41 +00:00
.endproc
2018-02-25 21:19:11 +00:00
2018-05-18 16:07:41 +00:00
set_up_ports:
MGTK_RELAY_CALL MGTK::InitPort, grafport3
MGTK_RELAY_CALL MGTK::SetPort, grafport2
2018-02-25 21:19:11 +00:00
rts
2018-11-23 22:33:37 +00:00
L531B: jsr noop
2018-02-25 21:19:11 +00:00
rts
L531F: bit L5105
bmi L5340
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::FindControl, findcontrol_params
lda findcontrol_which_ctl
2018-02-25 21:19:11 +00:00
beq L5341
2018-11-18 04:34:17 +00:00
cmp #MGTK::Ctl::vertical_scroll_bar
2018-02-25 21:19:11 +00:00
bne L5340
lda winfo_entrydlg_file_picker::vscroll
2018-02-25 21:19:11 +00:00
and #$01
beq L5340
jmp L5469
L5340: rts
2018-03-15 04:10:08 +00:00
L5341: lda winfo_entrydlg_file_picker
2018-02-28 02:25:03 +00:00
sta screentowindow_window_id
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
add16 screentowindow_windowy, winfo_entrydlg_file_picker::cliprect+2, screentowindow_windowy
2018-02-28 02:25:03 +00:00
lsr16 screentowindow_windowy
lsr16 screentowindow_windowy
lsr16 screentowindow_windowy
2018-11-23 22:33:37 +00:00
lda LD920
2018-02-28 02:25:03 +00:00
cmp screentowindow_windowy
2018-02-25 21:19:11 +00:00
beq L5380
jmp L542F
2018-12-17 02:54:03 +00:00
L5380: jsr detect_double_click
2018-02-25 21:19:11 +00:00
beq L5386
rts
2018-11-23 22:33:37 +00:00
L5386: ldx LD920
2018-02-25 21:19:11 +00:00
lda $1780,x
bmi L53B5
2018-03-15 04:10:08 +00:00
lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, common_ok_button_rect
MGTK_RELAY_CALL MGTK::PaintRect, common_ok_button_rect
2018-12-18 03:43:25 +00:00
jsr jt_handle_ok
2018-02-25 21:19:11 +00:00
jmp L5340
L53B5: and #$7F
pha
2018-03-15 04:10:08 +00:00
lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, common_open_button_rect
MGTK_RELAY_CALL MGTK::PaintRect, common_open_button_rect
2018-02-25 21:19:11 +00:00
lda #$00
sta L542E
2018-02-28 02:25:03 +00:00
copy16 #$1800, $08
2018-02-25 21:19:11 +00:00
pla
asl a
rol L542E
asl a
rol L542E
asl a
rol L542E
asl a
rol L542E
clc
adc $08
sta $08
lda L542E
adc $09
sta $09
ldx $09
lda $08
jsr L5F0D
jsr L5F5B
jsr L6161
lda #$00
jsr L6227
jsr L61B1
jsr L606D
MGTK_RELAY_CALL MGTK::InitPort, grafport3
MGTK_RELAY_CALL MGTK::SetPort, grafport2
2018-02-25 21:19:11 +00:00
rts
2018-02-25 21:21:55 +00:00
L542E: .byte 0
2018-02-28 02:25:03 +00:00
L542F: lda screentowindow_windowy
2018-02-25 21:19:11 +00:00
cmp $177F
bcc L5438
rts
2018-11-23 22:33:37 +00:00
L5438: lda LD920
2018-02-25 21:19:11 +00:00
bmi L5446
2018-12-18 04:36:49 +00:00
jsr jt_strip_path_segment
2018-11-23 22:33:37 +00:00
lda LD920
2018-02-25 21:19:11 +00:00
jsr L6274
L5446: lda screentowindow_windowy
2018-11-23 22:33:37 +00:00
sta LD920
bit LD8F0
2018-02-25 21:19:11 +00:00
bpl L5457
2018-12-18 04:22:29 +00:00
jsr jt_prep_path
jsr jt_redraw_input
2018-11-23 22:33:37 +00:00
L5457: lda LD920
2018-02-25 21:19:11 +00:00
jsr L6274
2018-05-17 15:54:22 +00:00
jsr jt_05
2018-12-17 02:54:03 +00:00
jsr detect_double_click
2018-02-25 21:19:11 +00:00
bmi L5468
jmp L5386
L5468: rts
L5469: lda findcontrol_which_part
2018-11-18 04:34:17 +00:00
cmp #MGTK::Part::up_arrow
2018-02-25 21:19:11 +00:00
bne L5473
jmp L550A
2018-11-18 04:34:17 +00:00
L5473: cmp #MGTK::Part::down_arrow
2018-02-25 21:19:11 +00:00
bne L547A
jmp L5533
2018-11-18 04:34:17 +00:00
L547A: cmp #MGTK::Part::page_up
2018-02-25 21:19:11 +00:00
bne L5481
jmp L54BA
2018-11-18 04:34:17 +00:00
L5481: cmp #MGTK::Part::page_down
2018-02-25 21:19:11 +00:00
bne L5488
jmp L54DF
2018-11-18 04:34:17 +00:00
L5488: lda #MGTK::Ctl::vertical_scroll_bar
2018-02-28 02:25:03 +00:00
sta trackthumb_params
MGTK_RELAY_CALL MGTK::TrackThumb, trackthumb_params
lda trackthumb_thumbmoved
bne :+
2018-02-25 21:19:11 +00:00
rts
2018-02-28 02:25:03 +00:00
: lda trackthumb_thumbpos
2018-02-28 02:38:18 +00:00
sta updatethumb_thumbpos
2018-11-18 04:34:17 +00:00
lda #MGTK::Ctl::vertical_scroll_bar
2018-02-28 02:38:18 +00:00
sta updatethumb_which_ctl
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::UpdateThumb, updatethumb_params
lda updatethumb_stash
2018-02-25 21:19:11 +00:00
jsr L6227
jsr L606D
rts
L54BA: lda winfo_entrydlg_file_picker::vthumbpos
2018-02-25 21:19:11 +00:00
sec
sbc #$09
bpl L54C4
lda #$00
2018-02-28 02:38:18 +00:00
L54C4: sta updatethumb_thumbpos
2018-11-18 04:34:17 +00:00
lda #MGTK::Ctl::vertical_scroll_bar
2018-02-28 02:38:18 +00:00
sta updatethumb_which_ctl
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::UpdateThumb, updatethumb_params
2018-02-28 02:38:18 +00:00
lda updatethumb_thumbpos
2018-02-25 21:19:11 +00:00
jsr L6227
jsr L606D
rts
L54DF: lda winfo_entrydlg_file_picker::vthumbpos
2018-02-25 21:19:11 +00:00
clc
adc #$09
cmp $177F
beq L54EF
bcc L54EF
lda $177F
2018-02-28 02:38:18 +00:00
L54EF: sta updatethumb_thumbpos
2018-11-18 04:34:17 +00:00
lda #MGTK::Ctl::vertical_scroll_bar
2018-02-28 02:38:18 +00:00
sta updatethumb_which_ctl
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::UpdateThumb, updatethumb_params
2018-02-28 02:38:18 +00:00
lda updatethumb_thumbpos
2018-02-25 21:19:11 +00:00
jsr L6227
jsr L606D
rts
L550A: lda winfo_entrydlg_file_picker::vthumbpos
2018-02-25 21:19:11 +00:00
bne L5510
rts
L5510: sec
sbc #$01
2018-02-28 02:38:18 +00:00
sta updatethumb_thumbpos
2018-11-18 04:34:17 +00:00
lda #MGTK::Ctl::vertical_scroll_bar
2018-02-28 02:38:18 +00:00
sta updatethumb_which_ctl
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::UpdateThumb, updatethumb_params
2018-02-28 02:38:18 +00:00
lda updatethumb_thumbpos
2018-02-25 21:19:11 +00:00
jsr L6227
jsr L606D
jsr L555F
jmp L550A
L5533: lda winfo_entrydlg_file_picker::vthumbpos
cmp winfo_entrydlg_file_picker::vthumbmax
2018-02-25 21:19:11 +00:00
bne L553C
rts
L553C: clc
adc #$01
2018-02-28 02:38:18 +00:00
sta updatethumb_thumbpos
2018-11-18 04:34:17 +00:00
lda #MGTK::Ctl::vertical_scroll_bar
2018-02-28 02:38:18 +00:00
sta updatethumb_which_ctl
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::UpdateThumb, updatethumb_params
2018-02-28 02:38:18 +00:00
lda updatethumb_thumbpos
2018-02-25 21:19:11 +00:00
jsr L6227
jsr L606D
jsr L555F
jmp L5533
2018-02-28 02:25:03 +00:00
L555F: MGTK_RELAY_CALL MGTK::PeekEvent, event_params
2018-02-28 02:38:18 +00:00
lda event_kind
2018-11-18 04:34:17 +00:00
cmp #MGTK::EventKind::button_down
2018-02-25 21:19:11 +00:00
beq L5576
2018-11-18 04:34:17 +00:00
cmp #MGTK::EventKind::drag
2018-02-25 21:19:11 +00:00
beq L5576
pla
pla
rts
2018-02-28 02:25:03 +00:00
L5576: MGTK_RELAY_CALL MGTK::GetEvent, event_params
MGTK_RELAY_CALL MGTK::FindWindow, findwindow_params
2018-02-28 02:38:18 +00:00
lda findwindow_window_id
2018-03-15 04:10:08 +00:00
cmp winfo_entrydlg_file_picker
2018-02-28 02:25:03 +00:00
beq :+
2018-02-25 21:19:11 +00:00
pla
pla
rts
2018-02-28 02:38:18 +00:00
: lda findwindow_which_area
2018-11-18 04:34:17 +00:00
cmp #MGTK::Area::content
2018-02-28 02:25:03 +00:00
beq :+
2018-02-25 21:19:11 +00:00
pla
pla
rts
2018-02-28 02:25:03 +00:00
: MGTK_RELAY_CALL MGTK::FindControl, findcontrol_params
lda findcontrol_which_ctl
2018-11-18 04:34:17 +00:00
cmp #MGTK::Ctl::vertical_scroll_bar
2018-02-28 02:25:03 +00:00
beq :+
2018-02-25 21:19:11 +00:00
pla
pla
rts
2018-02-28 02:25:03 +00:00
: lda findcontrol_which_part
2018-11-18 04:34:17 +00:00
cmp #MGTK::Part::page_up
2018-02-25 21:19:11 +00:00
bcc L55B9
pla
pla
L55B9: rts
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 23:19:38 +00:00
.proc set_cursor_pointer
bit cursor_ip_flag
bpl done
2018-02-25 23:19:38 +00:00
MGTK_RELAY_CALL MGTK::HideCursor
MGTK_RELAY_CALL MGTK::SetCursor, pointer_cursor
2018-02-25 23:19:38 +00:00
MGTK_RELAY_CALL MGTK::ShowCursor
2018-02-25 21:19:11 +00:00
lda #$00
sta cursor_ip_flag
done: rts
.endproc
2018-02-25 21:19:11 +00:00
.proc set_cursor_insertion
bit cursor_ip_flag
bmi done
2018-02-25 23:19:38 +00:00
MGTK_RELAY_CALL MGTK::HideCursor
MGTK_RELAY_CALL MGTK::SetCursor, insertion_point_cursor
2018-02-25 23:19:38 +00:00
MGTK_RELAY_CALL MGTK::ShowCursor
2018-02-25 21:19:11 +00:00
lda #$80
sta cursor_ip_flag
done: rts
.endproc
cursor_ip_flag: ; high bit set when cursor is IP
.byte 0
;;; ============================================================
2018-02-25 21:19:11 +00:00
2018-11-23 22:33:37 +00:00
L5607: ldx LD920
2018-02-25 21:19:11 +00:00
lda $1780,x
and #$7F
pha
2018-11-23 22:33:37 +00:00
bit LD8F0
2018-02-25 21:19:11 +00:00
bpl L5618
2018-12-18 04:22:29 +00:00
jsr jt_prep_path
2018-02-25 21:19:11 +00:00
L5618: lda #$00
sta L565B
2018-02-28 02:25:03 +00:00
copy16 #$1800, $08
2018-02-25 21:19:11 +00:00
pla
asl a
rol L565B
asl a
rol L565B
asl a
rol L565B
asl a
rol L565B
clc
adc $08
sta $08
lda L565B
adc $09
sta $09
ldx $09
lda $08
jsr L5F0D
jsr L5F5B
jsr L6161
lda #$00
jsr L6227
jsr L61B1
jsr L606D
rts
2018-02-25 21:21:55 +00:00
L565B: .byte 0
2018-05-18 02:10:47 +00:00
2018-02-25 21:19:11 +00:00
L565C: lda #$FF
2018-11-23 22:33:37 +00:00
sta LD920
2018-05-17 15:54:22 +00:00
jsr inc_device_num
jsr device_on_line
2018-02-25 21:19:11 +00:00
jsr L5F5B
jsr L6161
lda #$00
jsr L6227
jsr L61B1
jsr L606D
2018-12-18 04:22:29 +00:00
jsr jt_prep_path
jsr jt_redraw_input
2018-02-25 21:19:11 +00:00
rts
L567F: lda #$00
sta L56E2
2018-03-01 05:11:59 +00:00
ldx path_buf
2018-02-25 21:19:11 +00:00
bne L568C
jmp L56E1
2018-03-01 05:11:59 +00:00
L568C: lda path_buf,x
and #CHAR_MASK
2018-05-18 16:07:41 +00:00
cmp #'/'
2018-02-25 21:19:11 +00:00
beq L569B
dex
bpl L568C
jmp L56E1
L569B: cpx #$01
bne L56A2
jmp L56E1
L56A2: jsr L5F49
2018-11-23 22:33:37 +00:00
lda LD920
2018-02-25 21:19:11 +00:00
pha
lda #$FF
2018-11-23 22:33:37 +00:00
sta LD920
2018-02-25 21:19:11 +00:00
jsr L5F5B
jsr L6161
lda #$00
jsr L6227
jsr L61B1
jsr L606D
pla
2018-11-23 22:33:37 +00:00
sta LD920
2018-02-25 21:19:11 +00:00
bit L56E2
bmi L56D6
2018-12-18 04:36:49 +00:00
jsr jt_strip_path_segment
2018-11-23 22:33:37 +00:00
lda LD920
2018-02-25 21:19:11 +00:00
bmi L56DC
2018-12-18 04:36:49 +00:00
jsr jt_strip_path_segment
2018-02-25 21:19:11 +00:00
jmp L56DC
2018-12-18 04:22:29 +00:00
L56D6: jsr jt_prep_path
jsr jt_redraw_input
2018-02-25 21:19:11 +00:00
L56DC: lda #$FF
2018-11-23 22:33:37 +00:00
sta LD920
2018-02-25 21:19:11 +00:00
L56E1: rts
2018-02-25 21:21:55 +00:00
L56E2: .byte 0
2018-05-18 02:10:47 +00:00
L56E3: MGTK_RELAY_CALL MGTK::InitPort, grafport3
MGTK_RELAY_CALL MGTK::SetPort, grafport3
2018-02-25 21:19:11 +00:00
rts
2018-05-18 02:10:47 +00:00
;;; ============================================================
.proc track_ok_button_click
lda #$00
2018-02-25 21:19:11 +00:00
sta L577B
2018-02-28 02:25:03 +00:00
L56FB: MGTK_RELAY_CALL MGTK::GetEvent, event_params
2018-02-28 02:38:18 +00:00
lda event_kind
2018-11-18 04:34:17 +00:00
cmp #MGTK::EventKind::button_up
2018-02-25 21:19:11 +00:00
beq L575E
2018-03-15 04:10:08 +00:00
lda winfo_entrydlg
2018-02-28 02:25:03 +00:00
sta screentowindow_window_id
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
MGTK_RELAY_CALL MGTK::MoveTo, screentowindow_windowx
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::InRect, common_ok_button_rect
2018-02-25 21:47:06 +00:00
cmp #MGTK::inrect_inside
2018-02-25 21:19:11 +00:00
beq L5738
lda L577B
beq L5740
jmp L56FB
L5738: lda L577B
bne L5740
jmp L56FB
2018-02-28 02:25:03 +00:00
L5740: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, common_ok_button_rect
2018-02-25 21:19:11 +00:00
lda L577B
clc
adc #$80
sta L577B
jmp L56FB
L575E: lda L577B
beq L5766
2018-02-25 21:21:55 +00:00
return #$FF
2018-02-25 21:19:11 +00:00
2018-02-28 02:25:03 +00:00
L5766: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, common_ok_button_rect
2018-02-25 21:21:55 +00:00
return #$00
2018-02-25 21:19:11 +00:00
2018-02-25 21:21:55 +00:00
L577B: .byte 0
2018-05-18 02:10:47 +00:00
.endproc
;;; ============================================================
.proc track_close_button_click
lda #$00
2018-02-25 21:19:11 +00:00
sta L5801
2018-02-28 02:25:03 +00:00
L5781: MGTK_RELAY_CALL MGTK::GetEvent, event_params
2018-02-28 02:38:18 +00:00
lda event_kind
2018-11-18 04:34:17 +00:00
cmp #MGTK::EventKind::button_up
2018-02-25 21:19:11 +00:00
beq L57E4
2018-03-15 04:10:08 +00:00
lda winfo_entrydlg
2018-02-28 02:25:03 +00:00
sta screentowindow_window_id
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
MGTK_RELAY_CALL MGTK::MoveTo, screentowindow_windowx
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::InRect, common_close_button_rect
2018-02-25 21:47:06 +00:00
cmp #MGTK::inrect_inside
2018-02-25 21:19:11 +00:00
beq L57BE
lda L5801
beq L57C6
jmp L5781
L57BE: lda L5801
bne L57C6
jmp L5781
2018-02-28 02:25:03 +00:00
L57C6: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, common_close_button_rect
2018-02-25 21:19:11 +00:00
lda L5801
clc
adc #$80
sta L5801
jmp L5781
L57E4: lda L5801
beq L57EC
2018-02-25 21:21:55 +00:00
return #$FF
2018-02-25 21:19:11 +00:00
2018-02-28 02:25:03 +00:00
L57EC: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, common_close_button_rect
2018-02-25 21:21:55 +00:00
return #$00
2018-02-25 21:19:11 +00:00
2018-02-25 21:21:55 +00:00
L5801: .byte 0
2018-05-18 02:10:47 +00:00
.endproc
;;; ============================================================
.proc track_cancel_button_click
lda #$00
2018-02-25 21:19:11 +00:00
sta L5887
2018-02-28 02:25:03 +00:00
L5807: MGTK_RELAY_CALL MGTK::GetEvent, event_params
2018-02-28 02:38:18 +00:00
lda event_kind
2018-11-18 04:34:17 +00:00
cmp #MGTK::EventKind::button_up
2018-02-25 21:19:11 +00:00
beq L586A
2018-03-15 04:10:08 +00:00
lda winfo_entrydlg
2018-02-28 02:25:03 +00:00
sta screentowindow_window_id
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
MGTK_RELAY_CALL MGTK::MoveTo, screentowindow_windowx
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::InRect, common_cancel_button_rect
2018-02-25 21:47:06 +00:00
cmp #MGTK::inrect_inside
2018-02-25 21:19:11 +00:00
beq L5844
lda L5887
beq L584C
jmp L5807
L5844: lda L5887
bne L584C
jmp L5807
2018-02-28 02:25:03 +00:00
L584C: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, common_cancel_button_rect
2018-02-25 21:19:11 +00:00
lda L5887
clc
adc #$80
sta L5887
jmp L5807
L586A: lda L5887
beq L5872
2018-02-25 21:21:55 +00:00
return #$FF
2018-02-25 21:19:11 +00:00
2018-02-28 02:25:03 +00:00
L5872: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, common_cancel_button_rect
2018-02-25 21:21:55 +00:00
return #$01
2018-02-25 21:19:11 +00:00
2018-02-25 21:21:55 +00:00
L5887: .byte 0
2018-05-18 02:10:47 +00:00
.endproc
;;; ============================================================
.proc track_open_button_click
lda #$00
2018-02-25 21:19:11 +00:00
sta L590D
2018-02-28 02:25:03 +00:00
L588D: MGTK_RELAY_CALL MGTK::GetEvent, event_params
2018-02-28 02:38:18 +00:00
lda event_kind
2018-11-18 04:34:17 +00:00
cmp #MGTK::EventKind::button_up
2018-02-25 21:19:11 +00:00
beq L58F0
2018-03-15 04:10:08 +00:00
lda winfo_entrydlg
2018-02-28 02:25:03 +00:00
sta screentowindow_window_id
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
MGTK_RELAY_CALL MGTK::MoveTo, screentowindow_windowx
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::InRect, common_open_button_rect
2018-02-25 21:47:06 +00:00
cmp #MGTK::inrect_inside
2018-02-25 21:19:11 +00:00
beq L58CA
lda L590D
beq L58D2
jmp L588D
L58CA: lda L590D
bne L58D2
jmp L588D
2018-02-28 02:25:03 +00:00
L58D2: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, common_open_button_rect
2018-02-25 21:19:11 +00:00
lda L590D
clc
adc #$80
sta L590D
jmp L588D
L58F0: lda L590D
beq L58F8
2018-02-25 21:21:55 +00:00
return #$FF
2018-02-25 21:19:11 +00:00
2018-02-28 02:25:03 +00:00
L58F8: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, common_open_button_rect
2018-02-25 21:21:55 +00:00
return #$00
2018-02-25 21:19:11 +00:00
2018-02-25 21:21:55 +00:00
L590D: .byte 0
2018-05-18 02:10:47 +00:00
.endproc
;;; ============================================================
.proc track_change_drive_button_click
lda #$00
2018-02-25 21:19:11 +00:00
sta L5993
2018-02-28 02:25:03 +00:00
L5913: MGTK_RELAY_CALL MGTK::GetEvent, event_params
2018-02-28 02:38:18 +00:00
lda event_kind
2018-11-18 04:34:17 +00:00
cmp #MGTK::EventKind::button_up
2018-02-25 21:19:11 +00:00
beq L5976
2018-03-15 04:10:08 +00:00
lda winfo_entrydlg
2018-02-28 02:25:03 +00:00
sta screentowindow_window_id
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
MGTK_RELAY_CALL MGTK::MoveTo, screentowindow_windowx
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::InRect, common_change_drive_button_rect
2018-02-25 21:47:06 +00:00
cmp #MGTK::inrect_inside
2018-02-25 21:19:11 +00:00
beq L5950
lda L5993
beq L5958
jmp L5913
L5950: lda L5993
bne L5958
jmp L5913
2018-02-28 02:25:03 +00:00
L5958: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, common_change_drive_button_rect
2018-02-25 21:19:11 +00:00
lda L5993
clc
adc #$80
sta L5993
jmp L5913
L5976: lda L5993
beq L597E
2018-02-25 21:21:55 +00:00
return #$FF
2018-02-25 21:19:11 +00:00
2018-02-28 02:25:03 +00:00
L597E: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, common_change_drive_button_rect
2018-02-25 21:21:55 +00:00
return #$01
2018-02-25 21:19:11 +00:00
2018-02-25 21:21:55 +00:00
L5993: .byte 0
2018-05-18 02:10:47 +00:00
.endproc
;;; ============================================================
2018-02-25 21:52:16 +00:00
.proc MLI_RELAY
sty call
stax params
2018-02-25 21:19:11 +00:00
php
sei
sta ALTZPOFF
lda ROMIN2
jsr MLI
2018-02-25 21:52:16 +00:00
call: .byte 0
params: .addr 0
2018-02-25 21:19:11 +00:00
sta ALTZPON
tax
lda LCBANK1
lda LCBANK1
plp
txa
rts
2018-02-25 21:52:16 +00:00
.endproc
2018-02-25 21:19:11 +00:00
2018-05-18 02:10:47 +00:00
;;; ============================================================
2018-11-23 22:33:37 +00:00
.proc noop
rts
.endproc
2018-02-25 21:19:11 +00:00
2018-05-18 02:10:47 +00:00
;;; ============================================================
;;; Key handler
.proc L59B9
lda event_modifiers
2018-02-25 21:19:11 +00:00
beq L59F7
2018-05-18 02:10:47 +00:00
;; With modifiers
2018-03-15 03:38:47 +00:00
lda event_key
and #CHAR_MASK
2018-05-18 02:10:47 +00:00
2018-03-15 03:38:47 +00:00
cmp #CHAR_LEFT
2018-05-18 02:10:47 +00:00
bne :+
2018-12-18 03:43:25 +00:00
jmp jt_handle_meta_left_key ; start of line
2018-02-25 21:19:11 +00:00
2018-05-18 02:10:47 +00:00
: cmp #CHAR_RIGHT
bne :+
2018-12-18 03:43:25 +00:00
jmp jt_handle_meta_right_key ; end of line
2018-02-25 21:19:11 +00:00
2018-05-18 02:10:47 +00:00
: bit L5105
2018-02-25 21:19:11 +00:00
bmi L59E4
2018-03-15 03:38:47 +00:00
cmp #CHAR_DOWN
2018-05-18 02:10:47 +00:00
bne :+
jmp scroll_list_bottom ; end of list
2018-02-25 21:19:11 +00:00
2018-05-18 02:10:47 +00:00
: cmp #CHAR_UP
2018-02-25 21:19:11 +00:00
bne L59E4
2018-05-18 02:10:47 +00:00
jmp scroll_list_top ; start of list
2018-02-25 21:19:11 +00:00
2018-03-15 03:38:47 +00:00
L59E4: cmp #'0'
2018-05-18 02:10:47 +00:00
bcc :+
2018-03-15 03:38:47 +00:00
cmp #'9'+1
2018-05-18 02:10:47 +00:00
bcs :+
jmp key_meta_digit
2018-02-25 21:19:11 +00:00
2018-05-18 02:10:47 +00:00
: bit L5105
2018-02-25 21:19:11 +00:00
bmi L5A4F
jmp L5B70
2018-05-18 02:10:47 +00:00
;;; ============================================================
;;; Key - without modifiers
2018-03-15 03:38:47 +00:00
L59F7: lda event_key
and #CHAR_MASK
2018-05-18 02:10:47 +00:00
2018-03-15 03:38:47 +00:00
cmp #CHAR_LEFT
2018-05-18 02:10:47 +00:00
bne :+
2018-12-18 03:43:25 +00:00
jmp jt_handle_left_key
2018-02-25 21:19:11 +00:00
2018-05-18 02:10:47 +00:00
: cmp #CHAR_RIGHT
bne :+
2018-12-18 03:43:25 +00:00
jmp jt_handle_right_key
2018-02-25 21:19:11 +00:00
2018-05-18 02:10:47 +00:00
: cmp #CHAR_RETURN
bne :+
jmp key_return
2018-02-25 21:19:11 +00:00
2018-05-18 02:10:47 +00:00
: cmp #CHAR_ESCAPE
bne :+
jmp key_escape
2018-02-25 21:19:11 +00:00
2018-05-18 02:10:47 +00:00
: cmp #CHAR_DELETE
bne :+
jmp key_delete
2018-02-25 21:19:11 +00:00
2018-05-18 02:10:47 +00:00
: bit L5105
2018-02-25 21:19:11 +00:00
bpl L5A27
jmp L5AC4
2018-03-15 03:38:47 +00:00
L5A27: cmp #CHAR_TAB
2018-02-25 21:19:11 +00:00
bne L5A52
2018-03-15 04:10:08 +00:00
lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, common_change_drive_button_rect
MGTK_RELAY_CALL MGTK::PaintRect, common_change_drive_button_rect
2018-02-25 21:19:11 +00:00
jsr L565C
L5A4F: jmp L5AC8
2018-05-18 06:54:10 +00:00
L5A52: cmp #CHAR_CTRL_O ; Open
2018-02-25 21:19:11 +00:00
bne L5A8B
2018-11-23 22:33:37 +00:00
lda LD920
2018-02-25 21:19:11 +00:00
bmi L5AC8
tax
lda $1780,x
2018-05-18 02:10:47 +00:00
bmi :+
2018-02-25 21:19:11 +00:00
jmp L5AC8
2018-05-18 02:10:47 +00:00
: lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, common_open_button_rect
MGTK_RELAY_CALL MGTK::PaintRect, common_open_button_rect
2018-02-25 21:19:11 +00:00
jsr L5607
jmp L5AC8
2018-05-18 06:54:10 +00:00
L5A8B: cmp #CHAR_CTRL_C ; Close
2018-05-18 02:10:47 +00:00
bne :+
2018-03-15 04:10:08 +00:00
lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, common_close_button_rect
MGTK_RELAY_CALL MGTK::PaintRect, common_close_button_rect
2018-02-25 21:19:11 +00:00
jsr L567F
jmp L5AC8
2018-05-18 02:10:47 +00:00
: cmp #CHAR_DOWN
bne :+
jmp key_down
2018-02-25 21:19:11 +00:00
2018-05-18 02:10:47 +00:00
: cmp #CHAR_UP
2018-02-25 21:19:11 +00:00
bne L5AC4
2018-05-18 02:10:47 +00:00
jmp key_up
2018-02-25 21:19:11 +00:00
2018-12-18 03:43:25 +00:00
L5AC4: jsr jt_handle_other_key
2018-02-25 21:19:11 +00:00
rts
L5AC8: jsr L56E3
rts
2018-05-18 02:10:47 +00:00
key_return:
lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR ; flash the button
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, common_ok_button_rect
MGTK_RELAY_CALL MGTK::PaintRect, common_ok_button_rect
2018-12-18 03:43:25 +00:00
jsr jt_handle_meta_right_key
jsr jt_handle_ok
2018-02-25 21:19:11 +00:00
jsr L56E3
rts
2018-05-18 02:10:47 +00:00
key_escape:
lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR ; flash the button
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, common_cancel_button_rect
MGTK_RELAY_CALL MGTK::PaintRect, common_cancel_button_rect
2018-12-18 03:43:25 +00:00
jsr jt_handle_cancel
2018-02-25 21:19:11 +00:00
jsr L56E3
rts
2018-05-18 02:10:47 +00:00
key_delete:
2018-12-18 03:43:25 +00:00
jsr jt_handle_delete_key
2018-02-25 21:19:11 +00:00
rts
2018-05-18 02:10:47 +00:00
key_meta_digit:
2018-11-23 22:33:37 +00:00
jmp noop
2018-02-25 21:19:11 +00:00
2018-05-18 02:10:47 +00:00
.proc key_down
lda $177F
2018-02-25 21:19:11 +00:00
beq L5B37
2018-11-23 22:33:37 +00:00
lda LD920
2018-02-25 21:19:11 +00:00
bmi L5B47
tax
inx
cpx $177F
bcc L5B38
L5B37: rts
L5B38: jsr L6274
2018-12-18 04:36:49 +00:00
jsr jt_strip_path_segment
2018-11-23 22:33:37 +00:00
inc LD920
lda LD920
2018-05-18 02:10:47 +00:00
jmp update_list_selection
2018-02-25 21:19:11 +00:00
2018-05-18 02:10:47 +00:00
L5B47: lda #0
jmp update_list_selection
.endproc
2018-02-25 21:19:11 +00:00
2018-05-18 02:10:47 +00:00
.proc key_up
lda $177F
2018-02-25 21:19:11 +00:00
beq L5B58
2018-11-23 22:33:37 +00:00
lda LD920
2018-02-25 21:19:11 +00:00
bmi L5B68
bne L5B59
L5B58: rts
L5B59: jsr L6274
2018-12-18 04:36:49 +00:00
jsr jt_strip_path_segment
2018-11-23 22:33:37 +00:00
dec LD920
lda LD920
2018-05-18 02:10:47 +00:00
jmp update_list_selection
2018-02-25 21:19:11 +00:00
L5B68: ldx $177F
dex
txa
2018-05-18 02:10:47 +00:00
jmp update_list_selection
.endproc
2018-02-25 21:19:11 +00:00
2018-05-18 02:10:47 +00:00
L5B70: cmp #'A' ; upper alpha?
bcs :+
done: rts
: cmp #'Z'+1
2018-02-25 21:19:11 +00:00
bcc L5B83
2018-05-18 02:10:47 +00:00
cmp #'a' ; Lower alpha?
bcc done
cmp #'z'+1
bcs done
and #$5F ; convert lowercase to uppercase
2018-05-18 02:10:47 +00:00
2018-02-25 21:19:11 +00:00
L5B83: jsr L5B9D
2018-05-18 02:10:47 +00:00
bmi done
2018-11-23 22:33:37 +00:00
cmp LD920
2018-05-18 02:10:47 +00:00
beq done
2018-02-25 21:19:11 +00:00
pha
2018-11-23 22:33:37 +00:00
lda LD920
2018-02-25 21:19:11 +00:00
bmi L5B99
jsr L6274
2018-12-18 04:36:49 +00:00
jsr jt_strip_path_segment
2018-02-25 21:19:11 +00:00
L5B99: pla
2018-05-18 02:10:47 +00:00
jmp update_list_selection
2018-02-25 21:19:11 +00:00
L5B9D: sta L5BF5
2018-05-18 02:10:47 +00:00
lda #0
2018-02-25 21:19:11 +00:00
sta L5BF3
L5BA5: lda L5BF3
cmp $177F
beq L5BC4
jsr L5BCB
2018-05-18 02:10:47 +00:00
ldy #1
2018-02-25 21:19:11 +00:00
lda ($06),y
cmp L5BF5
bcc L5BBE
beq L5BC7
jmp L5BC4
L5BBE: inc L5BF3
jmp L5BA5
2018-02-25 21:21:55 +00:00
L5BC4: return #$FF
2018-02-25 21:19:11 +00:00
2018-02-25 21:21:55 +00:00
L5BC7: return L5BF3
2018-02-25 21:19:11 +00:00
L5BCB: tax
lda $1780,x
and #$7F
ldx #$00
stx L5BF4
asl a
rol L5BF4
asl a
rol L5BF4
asl a
rol L5BF4
asl a
rol L5BF4
clc
adc #$00
sta $06
lda L5BF4
adc #$18
sta $07
rts
2018-02-25 21:21:55 +00:00
L5BF3: .byte 0
L5BF4: .byte 0
L5BF5: .byte 0
2018-05-18 02:10:47 +00:00
.endproc
;;; ============================================================
.proc scroll_list_top
lda $177F
2018-02-25 21:19:11 +00:00
beq L5C02
2018-11-23 22:33:37 +00:00
lda LD920
2018-02-25 21:19:11 +00:00
bmi L5C09
bne L5C03
L5C02: rts
L5C03: jsr L6274
2018-12-18 04:36:49 +00:00
jsr jt_strip_path_segment
2018-02-25 21:19:11 +00:00
L5C09: lda #$00
2018-05-18 02:10:47 +00:00
jmp update_list_selection
.endproc
2018-02-25 21:19:11 +00:00
2018-05-18 02:10:47 +00:00
.proc scroll_list_bottom
lda $177F
2018-02-25 21:19:11 +00:00
beq L5C1E
2018-11-23 22:33:37 +00:00
ldx LD920
2018-02-25 21:19:11 +00:00
bmi L5C27
inx
cpx $177F
bne L5C1F
L5C1E: rts
L5C1F: dex
txa
jsr L6274
2018-12-18 04:36:49 +00:00
jsr jt_strip_path_segment
2018-02-25 21:19:11 +00:00
L5C27: ldx $177F
dex
txa
2018-05-18 02:10:47 +00:00
jmp update_list_selection
.endproc
2018-02-25 21:19:11 +00:00
2018-05-18 02:10:47 +00:00
;;; ============================================================
.proc update_list_selection
2018-11-23 22:33:37 +00:00
sta LD920
2018-05-17 15:54:22 +00:00
jsr jt_05
2018-11-23 22:33:37 +00:00
lda LD920
2018-02-25 21:19:11 +00:00
jsr L6586
jsr L6163
jsr L606D
2018-05-08 02:35:36 +00:00
copy #1, path_buf2
copy #' ', path_buf2+1
2018-12-18 04:22:29 +00:00
jsr jt_redraw_input
2018-02-25 21:19:11 +00:00
rts
2018-05-18 02:10:47 +00:00
.endproc
;;; ============================================================
2018-12-17 02:54:03 +00:00
;;; Detect double-click in file list
2018-02-25 21:19:11 +00:00
2018-12-17 02:54:03 +00:00
.proc detect_double_click
double_click_deltax = 5
double_click_deltay = 4
2018-12-17 02:54:03 +00:00
COPY_STRUCT MGTK::Point, event_coords, coords
;; Initialize counter (varies based on machine type)
lda machine_type
sta counter
;; Decrement counter, bail if time delta exceeded
loop: dec counter
beq exit
2018-05-08 02:35:36 +00:00
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::PeekEvent, event_params
2018-12-17 02:54:03 +00:00
;; Check coords, bail if pixel delta exceeded
jsr check_delta
bmi exit
copy #$FF, unused ; unused ???
lda event_kind
2018-12-17 02:54:03 +00:00
sta kind ; unused ???
2018-11-18 04:34:17 +00:00
cmp #MGTK::EventKind::no_event
2018-12-17 02:54:03 +00:00
beq loop
2018-11-18 04:34:17 +00:00
cmp #MGTK::EventKind::drag
2018-12-17 02:54:03 +00:00
beq loop
2018-11-18 04:34:17 +00:00
cmp #MGTK::EventKind::button_up
2018-12-17 02:54:03 +00:00
bne :+
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::GetEvent, event_params
2018-12-17 02:54:03 +00:00
jmp loop
: cmp #MGTK::EventKind::button_down
bne exit
2018-02-25 21:19:11 +00:00
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::GetEvent, event_params
2018-12-17 02:54:03 +00:00
return #0 ; double-click
2018-02-25 21:19:11 +00:00
2018-12-17 02:54:03 +00:00
exit: return #$FF ; not double-click
2018-02-25 21:19:11 +00:00
2018-12-17 02:54:03 +00:00
.proc check_delta
;; compute x delta
lda event_xcoord
2018-02-25 21:19:11 +00:00
sec
2018-12-17 02:54:03 +00:00
sbc xcoord
sta delta
lda event_xcoord+1
2018-12-17 02:54:03 +00:00
sbc xcoord+1
bpl :+
;; is -delta < x < 0 ?
lda delta
2018-12-20 17:12:19 +00:00
cmp #AS_BYTE(-double_click_deltax)
2018-12-17 02:54:03 +00:00
bcs check_y
fail: return #$FF
: lda delta
cmp #double_click_deltax
bcs fail
;; compute y delta
check_y:
lda event_ycoord
2018-02-25 21:19:11 +00:00
sec
2018-12-17 02:54:03 +00:00
sbc ycoord
sta delta
lda event_ycoord+1
2018-12-17 02:54:03 +00:00
sbc ycoord+1
bpl :+
;; is -delta < y < 0 ?
lda delta
2018-12-20 17:12:19 +00:00
cmp #AS_BYTE(-double_click_deltay)
2018-12-17 02:54:03 +00:00
bcs ok
: lda delta
cmp #double_click_deltay
bcs fail
ok: return #0
.endproc
counter:
2018-05-09 03:14:59 +00:00
.byte 0
2018-12-17 02:54:03 +00:00
coords:
xcoord: .word 0
ycoord: .word 0
delta: .byte 0
2018-05-09 03:14:59 +00:00
2018-12-17 02:54:03 +00:00
kind: .byte 0
unused: .byte 0
2018-05-18 02:10:47 +00:00
.endproc
2018-02-25 23:19:38 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 23:19:38 +00:00
2018-05-08 02:35:36 +00:00
.proc create_common_dialog
MGTK_RELAY_CALL MGTK::OpenWindow, winfo_entrydlg
2018-03-15 04:10:08 +00:00
MGTK_RELAY_CALL MGTK::OpenWindow, winfo_entrydlg_file_picker
lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::FrameRect, common_dialog_frame_rect
MGTK_RELAY_CALL MGTK::FrameRect, common_ok_button_rect
MGTK_RELAY_CALL MGTK::FrameRect, common_open_button_rect
MGTK_RELAY_CALL MGTK::FrameRect, common_close_button_rect
MGTK_RELAY_CALL MGTK::FrameRect, common_cancel_button_rect
MGTK_RELAY_CALL MGTK::FrameRect, common_change_drive_button_rect
jsr draw_ok_button_label
jsr draw_open_button_label
jsr draw_close_button_label
jsr draw_cancel_button_label
jsr draw_change_drive_button_label
MGTK_RELAY_CALL MGTK::MoveTo, common_dialog_sep_start
MGTK_RELAY_CALL MGTK::LineTo, common_dialog_sep_end
MGTK_RELAY_CALL MGTK::InitPort, grafport3
MGTK_RELAY_CALL MGTK::SetPort, grafport3
2018-02-25 21:19:11 +00:00
rts
2018-05-08 02:35:36 +00:00
.endproc
2018-02-25 21:19:11 +00:00
2018-05-08 02:35:36 +00:00
draw_ok_button_label:
MGTK_RELAY_CALL MGTK::MoveTo, ok_button_pos
addr_call draw_string, ok_button_label
2018-02-25 21:19:11 +00:00
rts
2018-05-08 02:35:36 +00:00
draw_open_button_label:
MGTK_RELAY_CALL MGTK::MoveTo, open_button_pos
addr_call draw_string, open_button_label
2018-02-25 21:19:11 +00:00
rts
2018-05-08 02:35:36 +00:00
draw_close_button_label:
MGTK_RELAY_CALL MGTK::MoveTo, close_button_pos
addr_call draw_string, close_button_label
2018-02-25 21:19:11 +00:00
rts
2018-05-08 02:35:36 +00:00
draw_cancel_button_label:
MGTK_RELAY_CALL MGTK::MoveTo, cancel_button_pos
addr_call draw_string, cancel_button_label
2018-02-25 21:21:55 +00:00
rts
2018-05-08 02:35:36 +00:00
draw_change_drive_button_label:
MGTK_RELAY_CALL MGTK::MoveTo, change_drive_button_pos
addr_call draw_string, change_drive_button_label
2018-02-25 21:19:11 +00:00
rts
2018-05-08 02:35:36 +00:00
;;; ============================================================
.proc copy_string_to_lcbuf
ptr := $06
stax ptr
ldy #0
lda (ptr),y
2018-02-25 21:19:11 +00:00
tay
2018-05-08 02:35:36 +00:00
: lda (ptr),y
sta temp_string_buf,y
2018-02-25 21:19:11 +00:00
dey
2018-05-08 02:35:36 +00:00
bpl :-
ldax #temp_string_buf
2018-02-25 21:19:11 +00:00
rts
2018-05-08 02:35:36 +00:00
.endproc
2018-02-25 21:19:11 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 23:19:38 +00:00
2018-05-08 02:35:36 +00:00
.proc draw_string
jsr copy_string_to_lcbuf
2018-02-26 00:10:27 +00:00
stax $06
2018-02-25 21:19:11 +00:00
ldy #$00
lda ($06),y
sta $08
2018-02-26 00:06:17 +00:00
inc16 $06
2018-02-26 00:10:27 +00:00
MGTK_RELAY_CALL MGTK::DrawText, $06
2018-02-25 21:19:11 +00:00
rts
2018-05-08 02:35:36 +00:00
.endproc
2018-02-25 21:19:11 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 23:19:38 +00:00
2018-05-08 02:35:36 +00:00
.proc L5E0A
jsr copy_string_to_lcbuf
2018-02-26 00:10:27 +00:00
stax $06
2018-02-25 21:19:11 +00:00
ldy #$00
lda ($06),y
sta $08
2018-02-26 00:06:17 +00:00
inc16 $06
2018-02-26 00:10:27 +00:00
MGTK_RELAY_CALL MGTK::TextWidth, $06
lsr16 $09
2018-02-25 21:19:11 +00:00
lda #$01
sta L5E56
lda #$F4
lsr L5E56
ror a
sec
sbc $09
sta pos_D90B
2018-02-25 21:19:11 +00:00
lda L5E56
sbc $0A
sta pos_D90B+1
MGTK_RELAY_CALL MGTK::MoveTo, pos_D90B
2018-02-25 23:19:38 +00:00
MGTK_RELAY_CALL MGTK::DrawText, $06
2018-02-25 21:19:11 +00:00
rts
2018-02-25 21:21:55 +00:00
L5E56: .byte 0
2018-05-08 02:35:36 +00:00
.endproc
2018-02-25 23:19:38 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 23:19:38 +00:00
2018-05-08 02:35:36 +00:00
L5E57: jsr copy_string_to_lcbuf
2018-02-26 00:10:27 +00:00
stax $06
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, common_input1_label_pos
ldax $06
2018-05-08 02:35:36 +00:00
jsr draw_string
2018-02-25 21:19:11 +00:00
rts
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 23:19:38 +00:00
2018-05-08 02:35:36 +00:00
L5E6F: jsr copy_string_to_lcbuf
2018-02-26 00:10:27 +00:00
stax $06
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, common_input2_label_pos
ldax $06
2018-05-08 02:35:36 +00:00
jsr draw_string
2018-02-25 21:19:11 +00:00
rts
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 23:19:38 +00:00
2018-05-17 15:54:22 +00:00
.proc device_on_line
: ldx device_num
2018-02-26 00:17:11 +00:00
lda DEVLST,x
2018-02-25 21:19:11 +00:00
and #$F0
2018-03-01 05:11:59 +00:00
sta on_line_params::unit_num
yax_call MLI_RELAY, ON_LINE, on_line_params
lda on_line_buffer
2018-02-25 21:19:11 +00:00
and #$0F
2018-03-01 05:11:59 +00:00
sta on_line_buffer
2018-05-17 15:54:22 +00:00
bne found
jsr inc_device_num
jmp :-
2018-02-25 21:19:11 +00:00
2018-05-17 15:54:22 +00:00
found: lda #0
2018-03-01 05:11:59 +00:00
sta path_buf
addr_call L5F0D, on_line_buffer
2018-02-25 21:19:11 +00:00
rts
2018-05-17 15:54:22 +00:00
.endproc
;;; ============================================================
2018-02-25 21:19:11 +00:00
2018-05-17 15:54:22 +00:00
.proc inc_device_num
inc device_num
lda device_num
2018-02-25 23:19:38 +00:00
cmp DEVCNT
2018-05-17 15:54:22 +00:00
beq :+
bcc :+
lda #0
sta device_num
: rts
.endproc
;;; ============================================================
2018-02-25 21:19:11 +00:00
L5ECB: lda #$00
sta L5F0C
2018-03-01 05:11:59 +00:00
L5ED0: yax_call MLI_RELAY, OPEN, open_params
2018-02-25 21:19:11 +00:00
beq L5EE9
2018-05-17 15:54:22 +00:00
jsr device_on_line
2018-02-25 21:19:11 +00:00
lda #$FF
2018-11-23 22:33:37 +00:00
sta LD920
2018-02-25 21:19:11 +00:00
sta L5F0C
jmp L5ED0
2018-03-01 05:11:59 +00:00
L5EE9: lda open_params::ref_num
sta read_params::ref_num
sta close_params::ref_num
yax_call MLI_RELAY, READ, read_params
2018-02-25 21:19:11 +00:00
beq L5F0B
2018-05-17 15:54:22 +00:00
jsr device_on_line
2018-02-25 21:19:11 +00:00
lda #$FF
2018-11-23 22:33:37 +00:00
sta LD920
2018-02-25 21:19:11 +00:00
sta L5F0C
jmp L5ED0
L5F0B: rts
2018-02-25 21:21:55 +00:00
L5F0C: .byte 0
2018-05-08 02:35:36 +00:00
L5F0D: jsr copy_string_to_lcbuf
2018-02-26 00:10:27 +00:00
stax $06
2018-03-01 05:11:59 +00:00
ldx path_buf
2018-05-08 02:35:36 +00:00
lda #'/'
2018-03-01 05:11:59 +00:00
sta path_buf+1,x
inc path_buf
2018-05-08 02:35:36 +00:00
ldy #0
2018-02-25 21:19:11 +00:00
lda ($06),y
tay
clc
2018-03-01 05:11:59 +00:00
adc path_buf
2018-05-08 02:35:36 +00:00
cmp #'A'
2018-02-25 21:19:11 +00:00
bcc L5F2F
2018-02-25 21:21:55 +00:00
return #$FF
2018-02-25 21:19:11 +00:00
L5F2F: pha
tax
L5F31: lda ($06),y
2018-03-01 05:11:59 +00:00
sta path_buf,x
2018-02-25 21:19:11 +00:00
dey
dex
2018-03-01 05:11:59 +00:00
cpx path_buf
2018-02-25 21:19:11 +00:00
bne L5F31
pla
2018-03-01 05:11:59 +00:00
sta path_buf
2018-02-25 21:19:11 +00:00
lda #$FF
2018-11-23 22:33:37 +00:00
sta LD920
2018-02-25 21:21:55 +00:00
return #$00
2018-02-25 21:19:11 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 23:19:38 +00:00
2018-03-01 05:11:59 +00:00
L5F49: ldx path_buf
2018-02-25 21:19:11 +00:00
cpx #$00
beq L5F5A
2018-03-01 05:11:59 +00:00
dec path_buf
lda path_buf,x
2018-05-18 16:07:41 +00:00
cmp #'/'
2018-02-25 21:19:11 +00:00
bne L5F49
L5F5A: rts
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 23:19:38 +00:00
2018-02-25 21:19:11 +00:00
L5F5B: jsr L5ECB
lda #$00
sta L6067
sta L6068
sta L50A9
lda #$01
sta L6069
2018-02-26 03:05:59 +00:00
copy16 $1423, L606A
2018-02-25 21:19:11 +00:00
lda $1425
and #$7F
sta $177F
bne L5F87
jmp L6012
2018-02-25 21:21:55 +00:00
L5F87: copy16 #$142B, $06
2018-02-25 21:19:11 +00:00
L5F8F: ldy #$00
lda ($06),y
and #$0F
bne L5F9A
jmp L6007
L5F9A: ldx L6067
txa
sta $1780,x
ldy #$00
lda ($06),y
and #$F0
cmp #$D0
beq L5FB6
bit L50A8
bpl L5FC1
inc L6068
jmp L6007
L5FB6: lda $1780,x
ora #$80
sta $1780,x
inc L50A9
L5FC1: ldy #$00
lda ($06),y
and #$0F
sta ($06),y
2018-02-25 21:21:55 +00:00
copy16 #$1800, $08
2018-02-25 21:19:11 +00:00
lda #$00
sta L606C
lda L6067
asl a
rol L606C
asl a
rol L606C
asl a
rol L606C
asl a
rol L606C
clc
adc $08
sta $08
lda L606C
adc $09
sta $09
ldy #$00
lda ($06),y
tay
L5FFA: lda ($06),y
sta ($08),y
dey
bpl L5FFA
inc L6067
inc L6068
L6007: inc L6069
lda L6068
cmp $177F
bne L6035
2018-03-01 05:11:59 +00:00
L6012: yax_call MLI_RELAY, CLOSE, close_params
2018-02-25 21:19:11 +00:00
bit L50A8
bpl L6026
lda L50A9
sta $177F
L6026: jsr L62DE
jsr L64E2
lda L5F0C
bpl L6033
sec
rts
L6033: clc
rts
L6035: lda L6069
cmp L606B
beq L604E
lda $06
clc
adc L606A
sta $06
lda $07
adc #$00
sta $07
jmp L5F8F
2018-03-01 05:11:59 +00:00
L604E: yax_call MLI_RELAY, READ, read_params
2018-02-25 21:21:55 +00:00
copy16 #$1404, $06
2018-02-25 21:19:11 +00:00
lda #$00
sta L6069
jmp L5F8F
2018-02-25 21:21:55 +00:00
L6067: .byte 0
L6068: .byte 0
L6069: .byte 0
L606A: .byte 0
L606B: .byte 0
L606C: .byte 0
2018-02-25 23:19:38 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 23:19:38 +00:00
2018-03-15 04:10:08 +00:00
L606D: lda winfo_entrydlg_file_picker
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
MGTK_RELAY_CALL MGTK::PaintRect, winfo_entrydlg_file_picker::cliprect
2018-02-25 21:19:11 +00:00
lda #$10
sta picker_entry_pos
2018-02-25 21:19:11 +00:00
lda #$08
sta picker_entry_pos+2
2018-02-25 21:19:11 +00:00
lda #$00
sta picker_entry_pos+3
2018-02-25 21:19:11 +00:00
sta L6128
L608E: lda L6128
cmp $177F
bne L60A9
MGTK_RELAY_CALL MGTK::InitPort, grafport3
MGTK_RELAY_CALL MGTK::SetPort, grafport3
2018-02-25 21:21:55 +00:00
rts
L60A9: MGTK_RELAY_CALL MGTK::MoveTo, picker_entry_pos
2018-02-25 21:19:11 +00:00
ldx L6128
lda $1780,x
and #$7F
ldx #$00
stx L6127
asl a
rol L6127
asl a
rol L6127
asl a
rol L6127
asl a
rol L6127
clc
adc #$00
tay
lda L6127
adc #$18
tax
tya
2018-05-08 02:35:36 +00:00
jsr draw_string
2018-02-25 21:19:11 +00:00
ldx L6128
lda $1780,x
bpl L60FF
lda #$01
sta picker_entry_pos
MGTK_RELAY_CALL MGTK::MoveTo, picker_entry_pos
2018-05-08 02:35:36 +00:00
addr_call draw_string, str_folder
2018-02-25 21:19:11 +00:00
lda #$10
sta picker_entry_pos
2018-02-25 21:19:11 +00:00
L60FF: lda L6128
2018-11-23 22:33:37 +00:00
cmp LD920
2018-02-25 21:19:11 +00:00
bne L6110
jsr L6274
2018-03-15 04:10:08 +00:00
lda winfo_entrydlg_file_picker
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
2018-02-25 21:19:11 +00:00
L6110: inc L6128
add16 picker_entry_pos+2, #8, picker_entry_pos+2
2018-02-25 21:19:11 +00:00
jmp L608E
2018-02-25 21:21:55 +00:00
L6127: .byte 0
L6128: .byte 0
2018-02-25 23:19:38 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 23:19:38 +00:00
2018-05-18 16:07:41 +00:00
.proc adjust_filename_case
ptr := $A
stx ptr+1
sta ptr
2018-05-18 16:07:41 +00:00
ldy #0
lda (ptr),y
2018-02-25 21:19:11 +00:00
tay
2018-05-18 16:07:41 +00:00
bne loop
2018-02-25 21:19:11 +00:00
rts
2018-05-18 16:07:41 +00:00
loop: dey
beq done
bpl :+
done: rts
: lda (ptr),y
and #CHAR_MASK ; convert to ASCII
2018-05-18 16:07:41 +00:00
cmp #'/'
beq next
cmp #'.'
bne check_alpha
2018-05-18 16:07:41 +00:00
next: dey
jmp loop
check_alpha:
iny
lda (ptr),y
and #CHAR_MASK
2018-05-18 16:07:41 +00:00
cmp #'A'
bcc :+
2018-05-18 16:07:41 +00:00
cmp #'Z'+1
bcs :+
2018-02-25 21:19:11 +00:00
clc
adc #('a' - 'A') ; convert to lower case
sta (ptr),y
: dey
2018-05-18 16:07:41 +00:00
jmp loop
.endproc
2018-02-25 21:19:11 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 23:19:38 +00:00
2018-02-25 21:19:11 +00:00
L6161: lda #$00
L6163: sta L61B0
lda $177F
cmp #$0A
bcs L6181
2018-11-18 04:34:17 +00:00
lda #MGTK::Ctl::vertical_scroll_bar
2018-02-28 02:38:18 +00:00
sta activatectl_which_ctl
2018-02-28 02:25:03 +00:00
lda #MGTK::activatectl_deactivate
2018-02-28 02:38:18 +00:00
sta activatectl_activate
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::ActivateCtl, activatectl_params
2018-02-25 21:19:11 +00:00
rts
L6181: lda $177F
sta winfo_entrydlg_file_picker::vthumbmax
2018-11-18 04:34:17 +00:00
.assert MGTK::Ctl::vertical_scroll_bar = MGTK::activatectl_activate, error, "need to match"
lda #MGTK::Ctl::vertical_scroll_bar
2018-02-28 02:38:18 +00:00
sta activatectl_which_ctl
sta activatectl_activate
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::ActivateCtl, activatectl_params
2018-02-25 21:19:11 +00:00
lda L61B0
2018-02-28 02:38:18 +00:00
sta updatethumb_thumbpos
2018-02-25 21:19:11 +00:00
jsr L6227
2018-11-18 04:34:17 +00:00
lda #MGTK::Ctl::vertical_scroll_bar
2018-02-28 02:38:18 +00:00
sta updatethumb_which_ctl
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::UpdateThumb, updatethumb_params
2018-02-25 21:19:11 +00:00
rts
2018-02-25 21:21:55 +00:00
L61B0: .byte 0
2018-02-25 23:19:38 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 23:19:38 +00:00
2018-03-15 04:10:08 +00:00
L61B1: lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
MGTK_RELAY_CALL MGTK::PaintRect, rect_D9C8
2018-03-01 05:11:59 +00:00
copy16 #path_buf, $06
2018-02-25 21:19:11 +00:00
ldy #$00
lda ($06),y
sta L6226
iny
L61D0: iny
lda ($06),y
2018-05-18 16:07:41 +00:00
cmp #'/'
2018-02-25 21:19:11 +00:00
beq L61DE
cpy L6226
bne L61D0
beq L61E2
L61DE: dey
sty L6226
L61E2: ldy #$00
ldx #$00
L61E6: inx
iny
lda ($06),y
sta $0220,x
cpy L6226
bne L61E6
stx $0220
2018-05-18 16:07:41 +00:00
addr_call adjust_filename_case, $0220
MGTK_RELAY_CALL MGTK::MoveTo, disk_label_pos
2018-05-08 02:35:36 +00:00
addr_call draw_string, disk_label
addr_call draw_string, $0220
MGTK_RELAY_CALL MGTK::InitPort, grafport3
MGTK_RELAY_CALL MGTK::SetPort, grafport3
2018-02-25 21:19:11 +00:00
rts
2018-02-25 21:21:55 +00:00
L6226: .byte 0
2018-02-25 23:19:38 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 23:19:38 +00:00
2018-02-25 21:19:11 +00:00
L6227: sta L6273
clc
adc #$09
cmp $177F
beq L6234
bcs L623A
L6234: lda L6273
jmp L624A
L623A: lda $177F
cmp #$0A
bcs L6247
lda L6273
jmp L624A
L6247: sec
sbc #$09
L624A: ldx #$00
stx L6273
asl a
rol L6273
asl a
rol L6273
asl a
rol L6273
sta winfo_entrydlg_file_picker::cliprect+2
2018-02-25 21:19:11 +00:00
ldx L6273
stx winfo_entrydlg_file_picker::cliprect+3
2018-02-25 21:19:11 +00:00
clc
adc #70
sta winfo_entrydlg_file_picker::cliprect+6
2018-02-25 21:19:11 +00:00
lda L6273
adc #0
sta winfo_entrydlg_file_picker::cliprect+7
2018-02-25 21:19:11 +00:00
rts
2018-02-25 21:21:55 +00:00
L6273: .byte 0
L6274: ldx #0
2018-02-25 21:19:11 +00:00
stx L62C7
asl a
rol L62C7
asl a
rol L62C7
asl a
rol L62C7
sta rect_D90F+2
2018-02-25 21:19:11 +00:00
ldx L62C7
stx rect_D90F+3
2018-02-25 21:19:11 +00:00
clc
adc #7
sta rect_D90F+6
2018-02-25 21:19:11 +00:00
lda L62C7
adc #0
sta rect_D90F+7
2018-03-15 04:10:08 +00:00
lda winfo_entrydlg_file_picker
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
MGTK_RELAY_CALL MGTK::PaintRect, rect_D90F
MGTK_RELAY_CALL MGTK::InitPort, grafport3
MGTK_RELAY_CALL MGTK::SetPort, grafport3
2018-02-25 21:21:55 +00:00
rts
L62C7: .byte 0
2018-02-25 23:19:38 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 23:19:38 +00:00
2018-05-18 06:54:10 +00:00
.proc set_port_for_window
sta getwinport_params2::window_id
MGTK_RELAY_CALL MGTK::GetWinPort, getwinport_params2
MGTK_RELAY_CALL MGTK::SetPort, grafport2
2018-02-25 21:19:11 +00:00
rts
2018-05-18 06:54:10 +00:00
.endproc
;;; ============================================================
2018-02-25 21:19:11 +00:00
2018-12-15 04:01:36 +00:00
L62DE: lda #'Z'
ldx #15
: sta L63C2,x
2018-02-25 21:19:11 +00:00
dex
2018-12-15 04:01:36 +00:00
bpl :-
2018-02-25 21:19:11 +00:00
lda #$00
sta L63BF
sta L63BE
L62F0: lda L63BF
cmp $177F
bne L62FB
jmp L6377
L62FB: lda L63BE
jsr L6451
ldy #$00
lda ($06),y
bmi L633D
and #$0F
sta L63C1
ldy #$01
L630E: lda ($06),y
cmp L63C1,y
beq L631A
bcs L633D
jmp L6322
L631A: iny
cpy #$10
bne L630E
jmp L633D
L6322: lda L63BE
sta L63C0
ldx #$0F
lda #' '
2018-02-25 21:19:11 +00:00
L632C: sta L63C2,x
dex
bpl L632C
ldy L63C1
L6335: lda ($06),y
sta L63C1,y
dey
bne L6335
L633D: inc L63BE
lda L63BE
cmp $177F
beq L634B
jmp L62FB
L634B: lda L63C0
jsr L6451
ldy #$00
lda ($06),y
ora #$80
sta ($06),y
2018-12-15 04:01:36 +00:00
lda #'Z'
ldx #15
: sta L63C2,x
2018-02-25 21:19:11 +00:00
dex
2018-12-15 04:01:36 +00:00
bpl :-
2018-02-25 21:19:11 +00:00
ldx L63BF
lda L63C0
sta L63D2,x
lda #$00
sta L63BE
inc L63BF
jmp L62F0
L6377: ldx $177F
dex
stx L63BF
L637E: lda L63BF
bpl L63AD
ldx $177F
beq L63AC
dex
L6389: lda L63D2,x
tay
lda $1780,y
bpl L639A
lda L63D2,x
ora #$80
sta L63D2,x
L639A: dex
bpl L6389
ldx $177F
beq L63AC
dex
L63A3: lda L63D2,x
sta $1780,x
dex
bpl L63A3
L63AC: rts
L63AD: jsr L6451
ldy #$00
lda ($06),y
and #$7F
sta ($06),y
dec L63BF
jmp L637E
2018-02-25 21:21:55 +00:00
L63BE: .byte 0
L63BF: .byte 0
L63C0: .byte 0
L63C1: .byte 0
2018-02-25 21:27:08 +00:00
L63C2: .res 16, 0
L63D2: .res 127, 0
2018-02-25 21:19:11 +00:00
L6451: ldx #$00
stx $06
ldx #$18
stx $07
ldx #$00
stx L647B
asl a
rol L647B
asl a
rol L647B
asl a
rol L647B
asl a
rol L647B
clc
adc $06
sta $06
lda L647B
adc $07
sta $07
rts
2018-02-25 21:21:55 +00:00
L647B: .byte 0
2018-02-25 23:19:38 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 23:19:38 +00:00
2018-02-26 00:10:27 +00:00
L647C: stax $06
2018-02-25 21:19:11 +00:00
ldy #$01
lda ($06),y
2018-05-18 16:07:41 +00:00
cmp #'/'
2018-02-25 21:19:11 +00:00
bne L64DE
dey
lda ($06),y
cmp #$02
bcc L64DE
tay
lda ($06),y
2018-05-18 16:07:41 +00:00
cmp #'/'
2018-02-25 21:19:11 +00:00
beq L64DE
ldx #$00
stx L64E1
L649B: lda ($06),y
2018-05-18 16:07:41 +00:00
cmp #'/'
2018-02-25 21:19:11 +00:00
beq L64AB
inx
cpx #$10
beq L64DE
dey
bne L649B
beq L64B3
L64AB: inc L64E1
ldx #$00
dey
bne L649B
L64B3: ldy #$00
lda ($06),y
tay
L64B8: lda ($06),y
and #CHAR_MASK
2018-05-18 16:07:41 +00:00
cmp #'.'
2018-02-25 21:19:11 +00:00
beq L64D8
2018-05-18 16:07:41 +00:00
cmp #'/'
2018-02-25 21:19:11 +00:00
bcc L64DE
2018-05-18 16:07:41 +00:00
cmp #'9'+1
2018-02-25 21:19:11 +00:00
bcc L64D8
2018-05-18 16:07:41 +00:00
cmp #'A'
2018-02-25 21:19:11 +00:00
bcc L64DE
2018-05-18 16:07:41 +00:00
cmp #'Z'+1
2018-02-25 21:19:11 +00:00
bcc L64D8
2018-05-18 16:07:41 +00:00
cmp #'a'
2018-02-25 21:19:11 +00:00
bcc L64DE
2018-05-18 16:07:41 +00:00
cmp #'z'+1
2018-02-25 21:19:11 +00:00
bcs L64DE
L64D8: dey
bne L64B8
2018-02-25 21:21:55 +00:00
return #$00
2018-02-25 21:19:11 +00:00
2018-02-25 21:21:55 +00:00
L64DE: return #$FF
2018-02-25 21:19:11 +00:00
2018-02-25 21:21:55 +00:00
L64E1: .byte 0
2018-02-25 21:19:11 +00:00
L64E2: lda $177F
bne L64E8
L64E7: rts
L64E8: lda #$00
sta L6515
2018-02-28 02:25:03 +00:00
copy16 #$1800, $06
2018-02-25 21:19:11 +00:00
L64F5: lda L6515
cmp $177F
beq L64E7
2018-12-16 02:15:47 +00:00
addr_call_indirect adjust_filename_case, $06
2018-02-25 21:19:11 +00:00
inc L6515
lda $06
clc
adc #$10
sta $06
bcc L64F5
inc $07
jmp L64F5
2018-02-25 21:21:55 +00:00
L6515: .byte 0
2018-02-25 23:19:38 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 23:19:38 +00:00
2018-02-26 00:10:27 +00:00
L6516: stax $06
2018-02-25 21:19:11 +00:00
ldy #$00
lda ($06),y
tay
L651F: lda ($06),y
sta L6576,y
dey
bpl L651F
lda #$00
sta L6575
2018-02-28 02:25:03 +00:00
copy16 #$1800, $06
2018-02-25 21:19:11 +00:00
L6534: lda L6575
cmp $177F
beq L6564
ldy #$00
lda ($06),y
cmp L6576
bne L6553
tay
L6546: lda ($06),y
cmp L6576,y
bne L6553
dey
bne L6546
jmp L6567
L6553: inc L6575
lda $06
clc
adc #$10
sta $06
bcc L6534
inc $07
jmp L6534
2018-02-25 21:21:55 +00:00
L6564: return #$FF
2018-02-25 21:19:11 +00:00
L6567: ldx $177F
lda L6575
L656D: dex
cmp $1780,x
bne L656D
txa
rts
2018-02-25 21:21:55 +00:00
L6575: .byte 0
2018-02-25 21:27:08 +00:00
L6576: .res 16, 0
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 23:19:38 +00:00
2018-02-25 21:19:11 +00:00
L6586: bpl L658B
2018-02-25 21:21:55 +00:00
L6588: return #$00
2018-02-25 21:19:11 +00:00
L658B: cmp #$09
bcc L6588
sec
sbc #$08
rts
2018-12-18 04:13:02 +00:00
;;; ============================================================
.proc blink_f1_ip
ptr := $06
lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
2018-12-18 04:13:02 +00:00
jsr calc_path_buf0_input1_endpos
2018-02-26 00:10:27 +00:00
stax $06
2018-05-08 02:35:36 +00:00
copy16 common_input1_textpos+2, $08
2018-12-18 04:13:02 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, ptr
2018-05-09 03:14:59 +00:00
bit prompt_ip_flag
2018-12-18 04:13:02 +00:00
bpl bg2
MGTK_RELAY_CALL MGTK::SetTextBG, textbg1
2018-12-18 04:13:02 +00:00
copy #$00, prompt_ip_flag
beq :+
bg2: MGTK_RELAY_CALL MGTK::SetTextBG, textbg2
copy #$FF, prompt_ip_flag
: copy16 #str_insertion_point+1, ptr
2018-11-23 22:33:37 +00:00
lda str_insertion_point
2018-02-25 21:19:11 +00:00
sta $08
2018-12-18 04:13:02 +00:00
MGTK_RELAY_CALL MGTK::DrawText, ptr
2018-02-25 21:19:11 +00:00
jsr L56E3
rts
2018-12-18 04:13:02 +00:00
.endproc
;;; ============================================================
2018-02-25 21:19:11 +00:00
2018-12-18 04:13:02 +00:00
.proc blink_f2_ip
ptr := $06
lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
2018-12-18 04:13:02 +00:00
jsr calc_path_buf1_input2_endpos
2018-02-26 00:10:27 +00:00
stax $06
2018-05-08 02:35:36 +00:00
copy16 common_input2_textpos+2, $08
2018-12-18 04:13:02 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, ptr
2018-05-09 03:14:59 +00:00
bit prompt_ip_flag
2018-12-18 04:13:02 +00:00
bpl bg2
MGTK_RELAY_CALL MGTK::SetTextBG, textbg1
2018-12-18 04:13:02 +00:00
copy #$00, prompt_ip_flag
jmp :+
2018-02-25 21:19:11 +00:00
2018-12-18 04:13:02 +00:00
bg2: MGTK_RELAY_CALL MGTK::SetTextBG, textbg2
copy #$FF, prompt_ip_flag
: copy16 #str_insertion_point+1, ptr
2018-11-23 22:33:37 +00:00
lda str_insertion_point
2018-02-25 21:19:11 +00:00
sta $08
2018-12-18 04:13:02 +00:00
MGTK_RELAY_CALL MGTK::DrawText, ptr
2018-02-25 21:19:11 +00:00
jsr L56E3
rts
2018-12-18 04:13:02 +00:00
.endproc
2018-02-25 21:19:11 +00:00
2018-12-18 04:13:02 +00:00
;;; ============================================================
.proc redraw_f1
lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, common_input1_rect
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::FrameRect, common_input1_rect
MGTK_RELAY_CALL MGTK::MoveTo, common_input1_textpos
lda path_buf0
2018-12-18 04:13:02 +00:00
beq :+
2018-05-08 02:35:36 +00:00
addr_call draw_string, path_buf0
2018-12-18 04:13:02 +00:00
: addr_call draw_string, path_buf2
2018-05-08 02:35:36 +00:00
addr_call draw_string, str_2_spaces
2018-02-25 21:19:11 +00:00
rts
2018-12-18 04:13:02 +00:00
.endproc
2018-02-25 21:19:11 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 23:19:38 +00:00
2018-12-18 04:13:02 +00:00
.proc redraw_f2
lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, common_input2_rect
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::FrameRect, common_input2_rect
MGTK_RELAY_CALL MGTK::MoveTo, common_input2_textpos
lda path_buf1
2018-12-18 04:13:02 +00:00
beq :+
2018-05-08 02:35:36 +00:00
addr_call draw_string, path_buf1
2018-12-18 04:13:02 +00:00
: addr_call draw_string, path_buf2
2018-05-08 02:35:36 +00:00
addr_call draw_string, str_2_spaces
2018-02-25 21:19:11 +00:00
rts
2018-12-18 04:13:02 +00:00
.endproc
;;; ============================================================
2018-02-25 21:19:11 +00:00
2018-12-18 04:13:02 +00:00
.proc handle_f1_click
2018-12-18 03:11:26 +00:00
lda winfo_entrydlg
2018-02-28 02:25:03 +00:00
sta screentowindow_window_id
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
2018-03-15 04:10:08 +00:00
lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, screentowindow_windowx
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::InRect, common_input1_rect
2018-02-25 21:47:06 +00:00
cmp #MGTK::inrect_inside
2018-02-25 21:19:11 +00:00
beq L6719
bit L5104
bpl L6718
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::InRect, common_input2_rect
2018-02-25 21:47:06 +00:00
cmp #MGTK::inrect_inside
2018-02-25 21:19:11 +00:00
bne L6718
2018-12-18 03:43:25 +00:00
jmp jt_handle_ok
2018-02-25 21:19:11 +00:00
L6718: rts
2018-12-18 04:13:02 +00:00
L6719: jsr calc_path_buf0_input1_endpos
2018-02-26 00:10:27 +00:00
stax $06
cmp16 screentowindow_windowx, $06
2018-02-25 21:19:11 +00:00
bcs L672F
jmp L67C4
2018-12-18 04:13:02 +00:00
L672F: jsr calc_path_buf0_input1_endpos
2018-02-25 21:21:55 +00:00
stax L684D
ldx path_buf2
2018-02-25 21:19:11 +00:00
inx
lda #' '
sta path_buf2,x
inc path_buf2
copy16 #path_buf2, $06
lda path_buf2
2018-02-25 21:19:11 +00:00
sta $08
2018-02-25 23:19:38 +00:00
L6751: MGTK_RELAY_CALL MGTK::TextWidth, $06
2018-02-25 21:47:06 +00:00
add16 $09, L684D, $09
cmp16 $09, screentowindow_windowx
2018-02-25 21:19:11 +00:00
bcc L6783
dec $08
lda $08
cmp #$01
bne L6751
dec path_buf2
2018-02-25 21:19:11 +00:00
jmp L6846
L6783: lda $08
cmp path_buf2
2018-02-25 21:19:11 +00:00
bcc L6790
dec path_buf2
2018-12-18 03:11:26 +00:00
jmp handle_f1_meta_right_key
2018-02-25 21:19:11 +00:00
L6790: ldx #$02
ldy path_buf0
2018-02-25 21:19:11 +00:00
iny
L6796: lda path_buf2,x
sta path_buf0,y
2018-02-25 21:19:11 +00:00
cpx $08
beq L67A5
iny
inx
jmp L6796
L67A5: sty path_buf0
2018-02-25 21:19:11 +00:00
ldy #$02
ldx $08
inx
L67AD: lda path_buf2,x
sta path_buf2,y
cpx path_buf2
2018-02-25 21:19:11 +00:00
beq L67BD
iny
inx
jmp L67AD
L67BD: dey
sty path_buf2
2018-02-25 21:19:11 +00:00
jmp L6846
L67C4: copy16 #path_buf0, $06
lda path_buf0
2018-02-25 21:19:11 +00:00
sta $08
2018-02-25 23:19:38 +00:00
L67D1: MGTK_RELAY_CALL MGTK::TextWidth, $06
2018-05-08 02:35:36 +00:00
add16 $09, common_input1_textpos, $09
cmp16 $09, screentowindow_windowx
2018-02-25 21:19:11 +00:00
bcc L6800
dec $08
lda $08
cmp #$01
bcs L67D1
2018-12-18 03:11:26 +00:00
jmp handle_f1_meta_left_key
2018-02-25 21:19:11 +00:00
L6800: inc $08
ldy #$00
ldx $08
L6806: cpx path_buf0
2018-02-25 21:19:11 +00:00
beq L6816
inx
iny
lda path_buf0,x
2018-12-25 18:55:14 +00:00
sta split_buf+1,y
2018-02-25 21:19:11 +00:00
jmp L6806
L6816: iny
2018-12-25 18:55:14 +00:00
sty split_buf
2018-02-25 21:19:11 +00:00
ldx #$01
2018-12-25 18:55:14 +00:00
ldy split_buf
L681F: cpx path_buf2
2018-02-25 21:19:11 +00:00
beq L682F
inx
iny
lda path_buf2,x
2018-12-25 18:55:14 +00:00
sta split_buf,y
2018-02-25 21:19:11 +00:00
jmp L681F
2018-12-25 18:55:14 +00:00
L682F: sty split_buf
2018-11-23 22:33:37 +00:00
lda str_insertion_point+1
2018-12-25 18:55:14 +00:00
sta split_buf+1
L6838: lda split_buf,y
sta path_buf2,y
2018-02-25 21:19:11 +00:00
dey
bpl L6838
lda $08
sta path_buf0
2018-12-18 04:22:29 +00:00
L6846: jsr jt_redraw_input
2018-02-25 21:19:11 +00:00
jsr L6EA3
rts
2018-02-25 21:47:06 +00:00
L684D: .word 0
2018-12-18 04:13:02 +00:00
.endproc
;;; ============================================================
.proc handle_f2_click
2018-12-18 03:11:26 +00:00
lda winfo_entrydlg
2018-02-28 02:25:03 +00:00
sta screentowindow_window_id
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
2018-03-15 04:10:08 +00:00
lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
2018-02-28 02:25:03 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, screentowindow_windowx
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::InRect, common_input2_rect
2018-02-25 21:47:06 +00:00
cmp #MGTK::inrect_inside
2018-02-25 21:19:11 +00:00
beq L6890
bit L5104
bpl L688F
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::InRect, common_input1_rect
2018-02-25 21:47:06 +00:00
cmp #MGTK::inrect_inside
2018-02-25 21:19:11 +00:00
bne L688F
2018-12-18 03:43:25 +00:00
jmp jt_handle_cancel
2018-02-25 21:19:11 +00:00
L688F: rts
2018-12-18 04:13:02 +00:00
L6890: jsr calc_path_buf1_input2_endpos
2018-02-26 00:10:27 +00:00
stax $06
cmp16 screentowindow_windowx, $06
2018-02-25 21:19:11 +00:00
bcs L68A6
jmp L693B
2018-12-18 04:13:02 +00:00
L68A6: jsr calc_path_buf1_input2_endpos
2018-02-25 21:21:55 +00:00
stax L69C4
ldx path_buf2
2018-02-25 21:19:11 +00:00
inx
2018-05-08 02:35:36 +00:00
lda #' '
sta path_buf2,x
inc path_buf2
copy16 #path_buf2, $06
lda path_buf2
2018-02-25 21:19:11 +00:00
sta $08
2018-02-25 23:19:38 +00:00
L68C8: MGTK_RELAY_CALL MGTK::TextWidth, $06
2018-02-25 21:47:06 +00:00
add16 $09, L69C4, $09
cmp16 $09, screentowindow_windowx
2018-02-25 21:19:11 +00:00
bcc L68FA
dec $08
lda $08
cmp #$01
bne L68C8
dec path_buf2
2018-02-25 21:19:11 +00:00
jmp L69BD
L68FA: lda $08
cmp path_buf2
2018-02-25 21:19:11 +00:00
bcc L6907
dec path_buf2
2018-12-18 03:11:26 +00:00
jmp handle_f2_meta_right_key
2018-02-25 21:19:11 +00:00
L6907: ldx #$02
ldy path_buf1
2018-02-25 21:19:11 +00:00
iny
L690D: lda path_buf2,x
sta path_buf1,y
2018-02-25 21:19:11 +00:00
cpx $08
beq L691C
iny
inx
jmp L690D
L691C: sty path_buf1
2018-02-25 21:19:11 +00:00
ldy #$02
ldx $08
inx
L6924: lda path_buf2,x
sta path_buf2,y
cpx path_buf2
2018-02-25 21:19:11 +00:00
beq L6934
iny
inx
jmp L6924
L6934: dey
sty path_buf2
2018-02-25 21:19:11 +00:00
jmp L69BD
L693B: copy16 #path_buf1, $06
lda path_buf1
2018-02-25 21:19:11 +00:00
sta $08
2018-02-25 23:19:38 +00:00
L6948: MGTK_RELAY_CALL MGTK::TextWidth, $06
2018-05-08 02:35:36 +00:00
add16 $09, common_input2_textpos, $09
cmp16 $09, screentowindow_windowx
2018-02-25 21:19:11 +00:00
bcc L6977
dec $08
lda $08
cmp #$01
bcs L6948
2018-12-18 03:11:26 +00:00
jmp handle_f2_meta_left_key
2018-02-25 21:19:11 +00:00
L6977: inc $08
ldy #$00
ldx $08
L697D: cpx path_buf1
2018-02-25 21:19:11 +00:00
beq L698D
inx
iny
lda path_buf1,x
2018-12-25 18:55:14 +00:00
sta split_buf+1,y
2018-02-25 21:19:11 +00:00
jmp L697D
L698D: iny
2018-12-25 18:55:14 +00:00
sty split_buf
2018-02-25 21:19:11 +00:00
ldx #$01
2018-12-25 18:55:14 +00:00
ldy split_buf
L6996: cpx path_buf2
2018-02-25 21:19:11 +00:00
beq L69A6
inx
iny
lda path_buf2,x
2018-12-25 18:55:14 +00:00
sta split_buf,y
2018-02-25 21:19:11 +00:00
jmp L6996
2018-12-25 18:55:14 +00:00
L69A6: sty split_buf
2018-11-23 22:33:37 +00:00
lda str_insertion_point+1
2018-12-25 18:55:14 +00:00
sta split_buf+1
L69AF: lda split_buf,y
sta path_buf2,y
2018-02-25 21:19:11 +00:00
dey
bpl L69AF
lda $08
sta path_buf1
2018-12-18 04:22:29 +00:00
L69BD: jsr jt_redraw_input
2018-02-25 21:19:11 +00:00
jsr L6E9F
rts
2018-02-25 21:47:06 +00:00
L69C4: .word 0
2018-12-18 04:13:02 +00:00
.endproc
2018-12-18 03:43:25 +00:00
;;; ============================================================
.proc handle_f1_other_key
sta L6A17
lda path_buf0
2018-02-25 21:19:11 +00:00
clc
adc path_buf2
2018-02-25 21:19:11 +00:00
cmp #$3F
bcc L69D5
rts
L69D5: lda L6A17
ldx path_buf0
2018-02-25 21:19:11 +00:00
inx
sta path_buf0,x
sta str_1_char+1
2018-12-18 04:13:02 +00:00
jsr calc_path_buf0_input1_endpos
inc path_buf0
2018-02-26 00:10:27 +00:00
stax $06
2018-05-08 02:35:36 +00:00
copy16 common_input1_textpos+2, $08
2018-03-15 04:10:08 +00:00
lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
2018-02-25 23:19:38 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, $06
2018-05-08 02:35:36 +00:00
addr_call draw_string, str_1_char
addr_call draw_string, path_buf2
2018-02-25 21:19:11 +00:00
jsr L6EA3
rts
2018-02-25 21:21:55 +00:00
L6A17: .byte 0
2018-12-18 03:43:25 +00:00
.endproc
2018-12-18 03:11:26 +00:00
;;; ============================================================
.proc handle_f1_delete_key
lda path_buf0
2018-02-25 21:19:11 +00:00
bne L6A1E
rts
L6A1E: dec path_buf0
2018-12-18 04:13:02 +00:00
jsr calc_path_buf0_input1_endpos
2018-02-26 00:10:27 +00:00
stax $06
2018-05-08 02:35:36 +00:00
copy16 common_input1_textpos+2, $08
2018-03-15 04:10:08 +00:00
lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
2018-02-25 23:19:38 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, $06
2018-05-08 02:35:36 +00:00
addr_call draw_string, path_buf2
addr_call draw_string, str_2_spaces
2018-02-25 21:19:11 +00:00
jsr L6EA3
rts
2018-12-18 03:11:26 +00:00
.endproc
2018-02-25 21:19:11 +00:00
2018-12-18 03:11:26 +00:00
;;; ============================================================
.proc handle_f1_left_key
lda path_buf0
2018-02-25 21:19:11 +00:00
bne L6A59
rts
L6A59: ldx path_buf2
2018-02-25 21:19:11 +00:00
cpx #$01
beq L6A6B
L6A60: lda path_buf2,x
sta path_buf2+1,x
2018-02-25 21:19:11 +00:00
dex
cpx #$01
bne L6A60
L6A6B: ldx path_buf0
lda path_buf0,x
sta path_buf2+2
dec path_buf0
inc path_buf2
2018-12-18 04:13:02 +00:00
jsr calc_path_buf0_input1_endpos
2018-02-26 00:10:27 +00:00
stax $06
2018-05-08 02:35:36 +00:00
copy16 common_input1_textpos+2, $08
2018-03-15 04:10:08 +00:00
lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
2018-02-25 23:19:38 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, $06
2018-05-08 02:35:36 +00:00
addr_call draw_string, path_buf2
addr_call draw_string, str_2_spaces
2018-02-25 21:19:11 +00:00
jsr L6EA3
rts
2018-12-18 03:11:26 +00:00
.endproc
;;; ============================================================
2018-02-25 21:19:11 +00:00
2018-12-18 03:11:26 +00:00
.proc handle_f1_right_key
lda path_buf2
2018-02-25 21:19:11 +00:00
cmp #$02
bcs L6AB4
rts
L6AB4: ldx path_buf0
2018-02-25 21:19:11 +00:00
inx
lda path_buf2+2
sta path_buf0,x
inc path_buf0
ldx path_buf2
2018-02-25 21:19:11 +00:00
cpx #$03
bcc L6AD6
ldx #$02
L6ACA: lda path_buf2+1,x
sta path_buf2,x
2018-02-25 21:19:11 +00:00
inx
cpx path_buf2
2018-02-25 21:19:11 +00:00
bne L6ACA
L6AD6: dec path_buf2
2018-03-15 04:10:08 +00:00
lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, common_input1_textpos
addr_call draw_string, path_buf0
addr_call draw_string, path_buf2
addr_call draw_string, str_2_spaces
2018-02-25 21:19:11 +00:00
jsr L6EA3
rts
2018-12-18 03:11:26 +00:00
.endproc
;;; ============================================================
2018-02-25 21:19:11 +00:00
2018-12-18 03:11:26 +00:00
.proc handle_f1_meta_left_key
lda path_buf0
2018-02-25 21:19:11 +00:00
bne L6B07
rts
L6B07: ldy path_buf0
lda path_buf2
2018-02-25 21:19:11 +00:00
cmp #$02
bcc L6B20
ldx #$01
L6B13: iny
inx
lda path_buf2,x
sta path_buf0,y
cpx path_buf2
2018-02-25 21:19:11 +00:00
bne L6B13
L6B20: sty path_buf0
L6B23: lda path_buf0,y
sta path_buf2+1,y
2018-02-25 21:19:11 +00:00
dey
bne L6B23
ldx path_buf0
2018-02-25 21:19:11 +00:00
inx
stx path_buf2
2018-05-08 02:35:36 +00:00
lda #GLYPH_INSPT
sta path_buf2+1
2018-02-25 21:19:11 +00:00
lda #$00
sta path_buf0
2018-12-18 04:22:29 +00:00
jsr jt_redraw_input
2018-02-25 21:19:11 +00:00
jsr L6EA3
rts
2018-12-18 03:11:26 +00:00
.endproc
2018-02-25 21:19:11 +00:00
2018-12-18 03:11:26 +00:00
;;; ============================================================
.proc handle_f1_meta_right_key
lda path_buf2
2018-02-25 21:19:11 +00:00
cmp #$02
bcs L6B4C
rts
L6B4C: ldx #$01
ldy path_buf0
2018-02-25 21:19:11 +00:00
L6B51: inx
iny
lda path_buf2,x
sta path_buf0,y
cpx path_buf2
2018-02-25 21:19:11 +00:00
bne L6B51
sty path_buf0
2018-05-08 02:35:36 +00:00
copy #1, path_buf2
copy #GLYPH_INSPT, path_buf2+1
2018-12-18 04:22:29 +00:00
jsr jt_redraw_input
2018-02-25 21:19:11 +00:00
jsr L6EA3
rts
2018-12-18 03:11:26 +00:00
.endproc
2018-02-25 21:19:11 +00:00
2018-12-18 03:11:26 +00:00
;;; ============================================================
2018-12-18 03:43:25 +00:00
.proc handle_f2_other_key
2018-12-18 03:11:26 +00:00
sta L6BC3
lda path_buf1
2018-02-25 21:19:11 +00:00
clc
adc path_buf2
2018-02-25 21:19:11 +00:00
cmp #$3F
bcc L6B81
rts
L6B81: lda L6BC3
ldx path_buf1
2018-02-25 21:19:11 +00:00
inx
sta path_buf1,x
sta str_1_char+1
2018-12-18 04:13:02 +00:00
jsr calc_path_buf1_input2_endpos
inc path_buf1
2018-02-26 00:10:27 +00:00
stax $06
2018-05-08 02:35:36 +00:00
copy16 common_input2_textpos+2, $08
2018-03-15 04:10:08 +00:00
lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
2018-02-25 23:19:38 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, $06
2018-05-08 02:35:36 +00:00
addr_call draw_string, str_1_char
addr_call draw_string, path_buf2
2018-02-25 21:19:11 +00:00
jsr L6E9F
rts
2018-02-25 21:21:55 +00:00
L6BC3: .byte 0
2018-12-18 03:11:26 +00:00
.endproc
;;; ============================================================
.proc handle_f2_delete_key
lda path_buf1
2018-02-25 21:19:11 +00:00
bne L6BCA
rts
L6BCA: dec path_buf1
2018-12-18 04:13:02 +00:00
jsr calc_path_buf1_input2_endpos
2018-02-26 00:10:27 +00:00
stax $06
2018-05-08 02:35:36 +00:00
copy16 common_input2_textpos+2, $08
2018-03-15 04:10:08 +00:00
lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
2018-02-25 23:19:38 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, $06
2018-05-08 02:35:36 +00:00
addr_call draw_string, path_buf2
addr_call draw_string, str_2_spaces
2018-02-25 21:19:11 +00:00
jsr L6E9F
rts
2018-12-18 03:11:26 +00:00
.endproc
;;; ============================================================
2018-02-25 21:19:11 +00:00
2018-12-18 03:11:26 +00:00
.proc handle_f2_left_key
lda path_buf1
2018-02-25 21:19:11 +00:00
bne L6C05
rts
L6C05: ldx path_buf2
2018-02-25 21:19:11 +00:00
cpx #$01
beq L6C17
L6C0C: lda path_buf2,x
sta path_buf2+1,x
2018-02-25 21:19:11 +00:00
dex
cpx #$01
bne L6C0C
L6C17: ldx path_buf1
lda path_buf1,x
sta path_buf2+2
dec path_buf1
inc path_buf2
2018-12-18 04:13:02 +00:00
jsr calc_path_buf1_input2_endpos
2018-02-26 00:10:27 +00:00
stax $06
2018-05-08 02:35:36 +00:00
copy16 common_input2_textpos+2, $08
2018-03-15 04:10:08 +00:00
lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
2018-02-25 23:19:38 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, $06
2018-05-08 02:35:36 +00:00
addr_call draw_string, path_buf2
addr_call draw_string, str_2_spaces
2018-02-25 21:19:11 +00:00
jsr L6E9F
rts
2018-12-18 03:11:26 +00:00
.endproc
;;; ============================================================
2018-02-25 21:19:11 +00:00
2018-12-18 03:11:26 +00:00
.proc handle_f2_right_key
lda path_buf2
2018-02-25 21:19:11 +00:00
cmp #$02
bcs L6C60
rts
L6C60: ldx path_buf1
2018-02-25 21:19:11 +00:00
inx
lda path_buf2+2
sta path_buf1,x
inc path_buf1
ldx path_buf2
2018-02-25 21:19:11 +00:00
cpx #$03
bcc L6C82
ldx #$02
L6C76: lda path_buf2+1,x
sta path_buf2,x
2018-02-25 21:19:11 +00:00
inx
cpx path_buf2
2018-02-25 21:19:11 +00:00
bne L6C76
L6C82: dec path_buf2
2018-03-15 04:10:08 +00:00
lda winfo_entrydlg
2018-05-18 06:54:10 +00:00
jsr set_port_for_window
2018-05-08 02:35:36 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, common_input2_textpos
addr_call draw_string, path_buf1
addr_call draw_string, path_buf2
addr_call draw_string, str_2_spaces
2018-02-25 21:19:11 +00:00
jsr L6E9F
rts
2018-12-18 03:11:26 +00:00
.endproc
2018-02-25 21:19:11 +00:00
2018-12-18 03:11:26 +00:00
;;; ============================================================
.proc handle_f2_meta_left_key
lda path_buf1
2018-02-25 21:19:11 +00:00
bne L6CB3
rts
L6CB3: ldy path_buf1
lda path_buf2
2018-02-25 21:19:11 +00:00
cmp #$02
bcc L6CCC
ldx #$01
L6CBF: iny
inx
lda path_buf2,x
sta path_buf1,y
cpx path_buf2
2018-02-25 21:19:11 +00:00
bne L6CBF
L6CCC: sty path_buf1
L6CCF: lda path_buf1,y
sta path_buf2+1,y
2018-02-25 21:19:11 +00:00
dey
bne L6CCF
ldx path_buf1
2018-02-25 21:19:11 +00:00
inx
stx path_buf2
2018-05-08 02:35:36 +00:00
lda #GLYPH_INSPT
sta path_buf2+1
2018-02-25 21:19:11 +00:00
lda #$00
sta path_buf1
2018-12-18 04:22:29 +00:00
jsr jt_redraw_input
2018-02-25 21:19:11 +00:00
jsr L6E9F
rts
2018-12-18 03:11:26 +00:00
.endproc
;;; ============================================================
2018-02-25 21:19:11 +00:00
2018-12-18 03:11:26 +00:00
.proc handle_f2_meta_right_key
lda path_buf2
2018-02-25 21:19:11 +00:00
cmp #$02
bcs L6CF8
rts
L6CF8: ldx #$01
ldy path_buf1
2018-02-25 21:19:11 +00:00
L6CFD: inx
iny
lda path_buf2,x
sta path_buf1,y
cpx path_buf2
2018-02-25 21:19:11 +00:00
bne L6CFD
sty path_buf1
2018-05-08 02:35:36 +00:00
copy #1, path_buf2
copy #GLYPH_INSPT, path_buf2+1
2018-12-18 04:22:29 +00:00
jsr jt_redraw_input
2018-02-25 21:19:11 +00:00
jsr L6E9F
rts
2018-12-18 03:11:26 +00:00
.endproc
;;; ============================================================
2018-02-25 21:19:11 +00:00
2018-12-18 03:01:37 +00:00
;;; Dynamically altered table of handlers for focused
;;; input field (e.g. source/destination filename, etc)
2018-05-17 15:54:22 +00:00
jump_table:
2018-12-18 03:43:25 +00:00
jt_handle_ok: jmp 0
jt_handle_cancel: jmp 0
2018-12-18 04:13:02 +00:00
jt_blink_ip: jmp 0
2018-12-18 04:36:49 +00:00
jt_redraw_input: jmp 0
jt_strip_path_segment: jmp 0
2018-05-17 15:54:22 +00:00
jt_05: jmp 0
2018-12-18 04:22:29 +00:00
jt_prep_path: jmp 0
2018-12-18 03:43:25 +00:00
jt_handle_other_key: jmp 0
jt_handle_delete_key: jmp 0
jt_handle_left_key: jmp 0
jt_handle_right_key: jmp 0
jt_handle_meta_left_key: jmp 0
jt_handle_meta_right_key: jmp 0
jt_handle_click: jmp 0
2018-12-18 03:11:26 +00:00
;;; ============================================================
2018-02-25 21:19:11 +00:00
2018-12-18 04:36:49 +00:00
.proc append_to_path_buf0
ptr := $06
stax ptr
ldx path_buf0
2018-05-18 16:07:41 +00:00
lda #'/'
sta path_buf0+1,x
inc path_buf0
2018-12-18 04:36:49 +00:00
ldy #0
lda (ptr),y
2018-02-25 21:19:11 +00:00
tay
clc
adc path_buf0
2018-02-25 21:19:11 +00:00
pha
tax
2018-12-18 04:36:49 +00:00
: lda (ptr),y
sta path_buf0,x
2018-02-25 21:19:11 +00:00
dey
dex
cpx path_buf0
2018-12-18 04:36:49 +00:00
bne :-
2018-02-25 21:19:11 +00:00
pla
sta path_buf0
2018-02-25 21:19:11 +00:00
rts
2018-12-18 04:36:49 +00:00
.endproc
;;; ============================================================
.proc append_to_path_buf1
ptr := $06
stax ptr
2018-02-25 21:19:11 +00:00
ldx path_buf1
2018-05-18 16:07:41 +00:00
lda #'/'
sta path_buf1+1,x
inc path_buf1
2018-12-18 04:36:49 +00:00
2018-02-25 21:19:11 +00:00
ldy #$00
2018-12-18 04:36:49 +00:00
lda (ptr),y
2018-02-25 21:19:11 +00:00
tay
clc
adc path_buf1
2018-02-25 21:19:11 +00:00
pha
tax
2018-12-18 04:36:49 +00:00
: lda (ptr),y
sta path_buf1,x
2018-02-25 21:19:11 +00:00
dey
dex
cpx path_buf1
2018-12-18 04:36:49 +00:00
bne :-
2018-02-25 21:19:11 +00:00
pla
sta path_buf1
2018-02-25 21:19:11 +00:00
rts
2018-12-18 04:36:49 +00:00
.endproc
2018-02-25 21:19:11 +00:00
2018-12-18 04:36:49 +00:00
;;; ============================================================
.proc strip_path_buf0_segment
: ldx path_buf0
cpx #0
beq :+
dec path_buf0
lda path_buf0,x
2018-05-18 16:07:41 +00:00
cmp #'/'
2018-12-18 04:36:49 +00:00
bne :-
: rts
.endproc
2018-02-25 21:19:11 +00:00
2018-12-18 04:36:49 +00:00
;;; ============================================================
.proc strip_path_buf1_segment
: ldx path_buf1
cpx #0
beq :+
dec path_buf1
lda path_buf1,x
2018-05-18 16:07:41 +00:00
cmp #'/'
2018-12-18 04:36:49 +00:00
bne :-
: rts
.endproc
2018-02-25 21:19:11 +00:00
2018-12-18 04:13:02 +00:00
;;; ============================================================
2018-12-18 04:36:49 +00:00
.proc strip_f1_path_segment
jsr strip_path_buf0_segment
2018-12-18 04:22:29 +00:00
jsr jt_redraw_input
2018-02-25 21:19:11 +00:00
rts
2018-12-18 04:13:02 +00:00
.endproc
;;; ============================================================
2018-02-25 21:19:11 +00:00
2018-12-18 04:36:49 +00:00
.proc strip_f2_path_segment
jsr strip_path_buf1_segment
2018-12-18 04:22:29 +00:00
jsr jt_redraw_input
2018-02-25 21:19:11 +00:00
rts
2018-12-18 04:13:02 +00:00
.endproc
;;; ============================================================
2018-02-25 21:19:11 +00:00
2018-12-18 04:13:02 +00:00
jt_handle_f1_tbd05:
lda #$00
2018-02-25 21:19:11 +00:00
beq L6DD6
2018-12-18 04:13:02 +00:00
jt_handle_f2_tbd05:
lda #$80
2018-12-18 04:36:49 +00:00
.proc L6DD6
ptr := $06
sta flag
copy16 #$1800, ptr
2018-11-23 22:33:37 +00:00
ldx LD920
2018-02-25 21:19:11 +00:00
lda $1780,x
and #$7F
2018-12-18 04:36:49 +00:00
ldx #0
stx hi
asl a ; * 16
rol hi
2018-02-25 21:19:11 +00:00
asl a
2018-12-18 04:36:49 +00:00
rol hi
2018-02-25 21:19:11 +00:00
asl a
2018-12-18 04:36:49 +00:00
rol hi
2018-02-25 21:19:11 +00:00
asl a
2018-12-18 04:36:49 +00:00
rol hi
2018-02-25 21:19:11 +00:00
clc
2018-12-18 04:36:49 +00:00
adc ptr
2018-02-25 21:19:11 +00:00
tay
2018-12-18 04:36:49 +00:00
lda hi
adc ptr+1
2018-02-25 21:19:11 +00:00
tax
tya
2018-12-18 04:36:49 +00:00
bit flag
bpl f1
jsr append_to_path_buf1
jmp :+
f1: jsr append_to_path_buf0
: jsr jt_redraw_input
2018-02-25 21:19:11 +00:00
rts
2018-12-18 04:36:49 +00:00
hi: .byte 0 ; high byte
flag: .byte 0
.endproc
2018-12-18 04:13:02 +00:00
;;; ============================================================
2018-12-18 04:22:29 +00:00
.proc prep_path_buf0
2018-12-18 04:13:02 +00:00
COPY_STRING path_buf, path_buf0
2018-05-18 16:07:41 +00:00
addr_call adjust_filename_case, path_buf0
2018-02-25 21:19:11 +00:00
rts
2018-12-18 04:13:02 +00:00
.endproc
2018-02-25 21:19:11 +00:00
2018-12-18 04:13:02 +00:00
;;; ============================================================
2018-12-18 04:22:29 +00:00
.proc prep_path_buf1
2018-12-18 04:13:02 +00:00
COPY_STRING path_buf, path_buf1
2018-05-18 16:07:41 +00:00
addr_call adjust_filename_case, path_buf1
2018-02-25 21:19:11 +00:00
rts
2018-12-18 04:13:02 +00:00
.endproc
2018-02-25 21:19:11 +00:00
2018-12-18 04:13:02 +00:00
;;; ============================================================
.proc calc_path_buf0_input1_endpos
str := $6
str_data := $6
str_len := $8
str_width := $9
lda #0
sta str_width
sta str_width+1
lda path_buf0
2018-12-18 04:13:02 +00:00
beq :+
sta str_len
copy16 #path_buf0+1, str_data
MGTK_RELAY_CALL MGTK::TextWidth, str
: lda str_width
2018-02-25 21:19:11 +00:00
clc
2018-05-08 02:35:36 +00:00
adc common_input1_textpos
2018-02-25 21:19:11 +00:00
tay
2018-12-18 04:13:02 +00:00
lda str_width+1
2018-05-08 02:35:36 +00:00
adc common_input1_textpos+1
2018-02-25 21:19:11 +00:00
tax
tya
rts
2018-12-18 04:13:02 +00:00
.endproc
2018-02-25 21:19:11 +00:00
2018-12-18 04:13:02 +00:00
;;; ============================================================
.proc calc_path_buf1_input2_endpos
str := $6
str_data := $6
str_len := $8
str_width := $9
lda #0
sta str_width
sta str_width+1
lda path_buf1
2018-12-18 04:13:02 +00:00
beq :+
sta str_len
copy16 #path_buf1+1, str_data
MGTK_RELAY_CALL MGTK::TextWidth, str
: lda str_width
2018-02-25 21:19:11 +00:00
clc
2018-05-08 02:35:36 +00:00
adc common_input2_textpos
2018-02-25 21:19:11 +00:00
tay
2018-12-18 04:13:02 +00:00
lda str_width+1
2018-05-08 02:35:36 +00:00
adc common_input2_textpos+1
2018-02-25 21:19:11 +00:00
tax
tya
rts
2018-12-18 04:13:02 +00:00
.endproc
;;; ============================================================
2018-02-25 21:19:11 +00:00
L6E9F: lda #$FF
bmi L6EA5
L6EA3: lda #$00
L6EA5: bmi L6EB6
ldx path_buf0
L6EAA: lda path_buf0,x
2018-12-25 18:55:14 +00:00
sta split_buf,x
2018-02-25 21:19:11 +00:00
dex
bpl L6EAA
jmp L6EC2
L6EB6: ldx path_buf1
L6EB9: lda path_buf1,x
2018-12-25 18:55:14 +00:00
sta split_buf,x
2018-02-25 21:19:11 +00:00
dex
bpl L6EB9
2018-11-23 22:33:37 +00:00
L6EC2: lda LD920
2018-02-25 21:19:11 +00:00
sta L6F3D
bmi L6EFB
ldx #$00
stx $06
ldx #$18
stx $07
ldx #$00
stx L6F3C
tax
lda $1780,x
and #$7F
asl a
rol L6F3C
asl a
rol L6F3C
asl a
rol L6F3C
asl a
rol L6F3C
clc
adc $06
tay
lda L6F3C
adc $07
tax
tya
jsr L5F0D
2018-12-25 18:55:14 +00:00
L6EFB: addr_call adjust_filename_case, split_buf
2018-05-18 16:07:41 +00:00
addr_call adjust_filename_case, path_buf
2018-12-25 18:55:14 +00:00
lda split_buf
2018-03-01 05:11:59 +00:00
cmp path_buf
2018-02-25 21:19:11 +00:00
bne L6F26
tax
2018-12-25 18:55:14 +00:00
L6F12: lda split_buf,x
2018-03-01 05:11:59 +00:00
cmp path_buf,x
2018-02-25 21:19:11 +00:00
bne L6F26
dex
bne L6F12
lda #$00
2018-11-23 22:33:37 +00:00
sta LD8F0
2018-02-25 21:19:11 +00:00
jsr L6F2F
rts
L6F26: lda #$FF
2018-11-23 22:33:37 +00:00
sta LD8F0
2018-02-25 21:19:11 +00:00
jsr L6F2F
rts
L6F2F: lda L6F3D
2018-11-23 22:33:37 +00:00
sta LD920
2018-02-25 21:19:11 +00:00
bpl L6F38
rts
L6F38: jsr L5F49
rts
2018-02-25 21:21:55 +00:00
L6F3C: .byte 0
L6F3D: .byte 0
2018-02-25 21:19:11 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 23:19:38 +00:00
2018-02-25 21:19:11 +00:00
PAD_TO $7000
2018-02-25 23:19:38 +00:00
.endproc ; common_overlay