a2d/desktop/ovl1b.s

3140 lines
80 KiB
ArmAsm
Raw Normal View History

;;; ============================================================
;;; Overlay for Disk Copy - $D000 - $F1FF (file 3/4)
;;; ============================================================
2018-02-26 00:17:11 +00:00
.proc disk_copy_overlay3
.org $D000
2018-03-29 04:05:12 +00:00
2018-11-21 23:29:24 +00:00
.scope disk_copy_overlay4
2018-11-22 05:00:49 +00:00
.scope on_line_params2
unit_num := $0C42
.endscope
.scope on_line_params
unit_num := $0C46
.endscope
on_line_buffer := $0C49
.scope block_params
unit_num := $0C5A
data_buffer := $0C5B
block_num := $0C5D
.endscope
2018-11-23 22:33:37 +00:00
noop := $0C83
2018-11-22 05:00:49 +00:00
quit := $0C84
2018-11-21 23:29:24 +00:00
L0CAF := $0CAF
2018-04-02 03:36:02 +00:00
eject_disk := $0CED
2018-12-06 03:35:04 +00:00
unit_number_to_driver_address := $0D26
2018-11-21 23:29:24 +00:00
L0D51 := $0D51
L0D5F := $0D5F
L0DB5 := $0DB5
L0EB2 := $0EB2
L0ED7 := $0ED7
L10FB := $10FB
L127E := $127E
L1291 := $1291
L129B := $129B
L12A5 := $12A5
L12AF := $12AF
.endscope
2018-03-30 04:17:18 +00:00
.macro MGTK_RELAY_CALL2 call, params
2018-03-30 04:40:39 +00:00
.if .paramcount > 1
2018-03-30 04:17:18 +00:00
yax_call MGTK_RELAY2, call, params
2018-03-30 04:40:39 +00:00
.else
yax_call MGTK_RELAY2, call, 0
.endif
2018-03-30 04:17:18 +00:00
.endmacro
2018-03-29 04:05:12 +00:00
2018-02-26 00:17:11 +00:00
jmp LD5E1
2018-03-30 04:40:39 +00:00
;;; ============================================================
;;; Resources
pencopy: .byte 0
penOR: .byte 1
penXOR: .byte 2
penBIC: .byte 3
notpencopy: .byte 4
notpenOR: .byte 5
notpenXOR: .byte 6
notpenBIC: .byte 7
2018-11-23 00:53:50 +00:00
stack_stash: .byte 0
2018-03-31 02:34:44 +00:00
.proc hilitemenu_params
menu_id := * + 0
.endproc
.proc menuselect_params
menu_id := * + 0
menu_item := * + 1
.endproc
.proc menukey_params
menu_id := * + 0
menu_item := * + 1
which_key := * + 2
key_mods := * + 3
.endproc
.res 4, 0
2018-03-29 04:05:12 +00:00
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
2018-02-26 00:17:11 +00:00
2018-03-30 04:40:39 +00:00
;;; ============================================================
;;; Menu definition
menu_id_apple := 1
menu_id_file := 2
menu_id_facilities := 3
menu_definition:
DEFINE_MENU_BAR 3
DEFINE_MENU_BAR_ITEM menu_id_apple, label_apple, menu_apple
DEFINE_MENU_BAR_ITEM menu_id_file, label_file, menu_file
DEFINE_MENU_BAR_ITEM menu_id_facilities, label_facilities, menu_facilities
menu_apple:
DEFINE_MENU 5
DEFINE_MENU_ITEM label_desktop
DEFINE_MENU_ITEM label_blank
DEFINE_MENU_ITEM label_copyright1
DEFINE_MENU_ITEM label_copyright2
DEFINE_MENU_ITEM label_rights
menu_file:
DEFINE_MENU 1
DEFINE_MENU_ITEM label_quit, 'Q', 'q'
label_apple:
PASCAL_STRING GLYPH_SAPPLE
menu_facilities:
DEFINE_MENU 2
DEFINE_MENU_ITEM label_quick_copy
DEFINE_MENU_ITEM label_disk_copy
label_file:
2018-03-29 04:28:03 +00:00
PASCAL_STRING "File"
2018-03-30 04:40:39 +00:00
label_facilities:
2018-03-29 04:28:03 +00:00
PASCAL_STRING "Facilities"
2018-03-30 04:40:39 +00:00
label_desktop:
2018-11-19 07:35:25 +00:00
PASCAL_STRING .sprintf("Apple II DeskTop version %d.%d",::VERSION_MAJOR,::VERSION_MINOR)
2018-03-30 04:40:39 +00:00
label_blank:
2018-03-29 04:28:03 +00:00
PASCAL_STRING " "
2018-03-30 04:40:39 +00:00
label_copyright1:
2018-03-29 04:28:03 +00:00
PASCAL_STRING "Copyright Apple Computer Inc., 1986 "
2018-03-30 04:40:39 +00:00
label_copyright2:
2018-03-29 04:28:03 +00:00
PASCAL_STRING "Copyright Version Soft, 1985 - 1986 "
2018-03-30 04:40:39 +00:00
label_rights:
2018-03-29 04:28:03 +00:00
PASCAL_STRING "All Rights reserved"
2018-03-30 04:40:39 +00:00
label_quit:
2018-03-29 04:28:03 +00:00
PASCAL_STRING "Quit"
2018-03-29 15:38:20 +00:00
2018-03-30 04:40:39 +00:00
label_quick_copy:
2018-03-29 04:28:03 +00:00
PASCAL_STRING "Quick Copy "
2018-03-29 15:38:20 +00:00
2018-03-30 04:40:39 +00:00
label_disk_copy:
2018-03-29 04:28:03 +00:00
PASCAL_STRING "Disk Copy "
2018-02-26 00:17:11 +00:00
2018-03-30 04:40:39 +00:00
;;; ============================================================
2018-11-23 04:49:48 +00:00
.proc disablemenu_params
menu_id: .byte 3
disable: .byte 0
.endproc
2018-03-31 02:34:44 +00:00
2018-11-23 04:49:48 +00:00
.proc checkitem_params
menu_id: .byte 3
menu_item: .byte 0
check: .byte 0
.endproc
2018-03-31 02:34:44 +00:00
event_params := *
event_kind := event_params + 0
;; if kind is key_down
event_key := event_params + 1
event_modifiers := event_params + 2
;; if kind is no_event, button_down/up, drag, or apple_key:
event_coords := event_params + 1
event_xcoord := event_params + 1
event_ycoord := event_params + 3
;; if kind is update:
event_window_id := event_params + 1
screentowindow_params := *
screentowindow_window_id := screentowindow_params + 0
screentowindow_screenx := screentowindow_params + 1
screentowindow_screeny := screentowindow_params + 3
screentowindow_windowx := screentowindow_params + 5
screentowindow_windowy := screentowindow_params + 7
findwindow_params := * + 1 ; offset to x/y overlap event_params x/y
findwindow_mousex := findwindow_params + 0
findwindow_mousey := findwindow_params + 2
findwindow_which_area := findwindow_params + 4
findwindow_window_id := findwindow_params + 5
2018-03-29 04:05:12 +00:00
.byte 0
.byte 0
2018-03-31 02:34:44 +00:00
LD12F: .byte 0
2018-03-29 04:05:12 +00:00
.byte 0
.byte 0
.byte 0
2018-03-31 02:34:44 +00:00
LD133: .byte 0
2018-11-23 00:20:54 +00:00
.byte 0
2018-03-29 04:05:12 +00:00
.byte 0
.byte 0
2018-03-31 02:34:44 +00:00
2018-05-26 01:39:43 +00:00
grafport: .res .sizeof(MGTK::GrafPort), 0
2018-03-31 02:34:44 +00:00
2018-03-31 04:11:36 +00:00
.proc getwinport_params
window_id: .byte 0
port: .addr grafport_win
.endproc
2018-05-26 01:39:43 +00:00
grafport_win: .res .sizeof(MGTK::GrafPort), 0
2018-03-31 04:11:36 +00:00
2018-11-21 18:46:14 +00:00
;; Rest of a winfo???
2018-11-21 16:49:09 +00:00
.byte $06, $EA, 0, 0, 0, 0, $88, 0, $08, 0, $08
2018-03-31 04:11:36 +00:00
.proc winfo_dialog
window_id: .byte 1
2018-11-18 04:34:17 +00:00
options: .byte MGTK::Option::dialog_box
2018-03-31 04:11:36 +00:00
title: .addr 0
2018-11-18 04:34:17 +00:00
hscroll: .byte MGTK::Scroll::option_none
vscroll: .byte MGTK::Scroll::option_none
2018-03-31 04:11:36 +00:00
hthumbmax: .byte 0
hthumbpos: .byte 0
vthumbmax: .byte 0
vthumbpos: .byte 0
status: .byte 0
reserved: .byte 0
mincontwidth: .word 150
mincontlength: .word 50
maxcontwidth: .word 500
2018-03-31 04:11:36 +00:00
maxcontlength: .word 140
port:
viewloc: DEFINE_POINT 25, 20
mapbits: .addr MGTK::screen_mapbits
mapwidth: .word MGTK::screen_mapwidth
cliprect: DEFINE_RECT 0, 0, 500, 150
penpattern: .res 8, $FF
colormasks: .byte MGTK::colormask_and, MGTK::colormask_or
penloc: DEFINE_POINT 0, 0
penwidth: .byte 1
penheight: .byte 1
penmode: .byte 0
textbg: .byte MGTK::textbg_white
fontptr: .addr DEFAULT_FONT
nextwinfo: .addr 0
.endproc
.proc winfo_drive_select
window_id: .byte $02
2018-11-18 04:34:17 +00:00
options: .byte MGTK::Option::dialog_box
2018-03-31 04:11:36 +00:00
title: .addr 0
2018-11-18 04:34:17 +00:00
hscroll: .byte MGTK::Scroll::option_none
vscroll: .byte MGTK::Scroll::option_present
2018-03-31 04:11:36 +00:00
hthumbmax: .byte 0
hthumbpos: .byte 0
vthumbmax: .byte 3
vthumbpos: .byte 0
status: .byte 0
reserved: .byte 0
mincontwidth: .word 100
mincontlength: .word 50
maxcontwidth: .word 150
2018-03-31 04:11:36 +00:00
maxcontlength: .word 150
port:
viewloc: DEFINE_POINT 45, 50
mapbits: .addr MGTK::screen_mapbits
mapwidth: .word MGTK::screen_mapwidth
cliprect: DEFINE_RECT 0, 0, 150, 70
penpattern: .res 8, $FF
colormasks: .byte MGTK::colormask_and, MGTK::colormask_or
penloc: DEFINE_POINT 0, 0
penwidth: .byte 1
penheight: .byte 1
penmode: .byte 0
textbg: .byte MGTK::textbg_white
fontptr: .addr DEFAULT_FONT
nextwinfo: .addr 0
.endproc
2018-11-21 20:11:35 +00:00
rect_outer_frame: DEFINE_RECT 4, 2, 496, 148
rect_inner_frame: DEFINE_RECT 5, 3, 495, 147
2018-11-21 16:49:09 +00:00
rect_D211: DEFINE_RECT 6, 20, 494, 102
rect_D219: DEFINE_RECT 6, 103, 494, 145
2018-11-22 22:12:31 +00:00
rect_ok_button: DEFINE_RECT 350, 90, 450, 101
rect_read_drive: DEFINE_RECT 210, 90, 310, 101
2018-11-21 20:11:35 +00:00
point_ok_label: DEFINE_POINT 355, 100
2018-03-29 15:38:20 +00:00
str_ok_label:
PASCAL_STRING {"OK ",CHAR_RETURN}
2018-03-30 04:17:18 +00:00
2018-11-21 20:11:35 +00:00
;;; Label positions
point_read_drive: DEFINE_POINT 215, 100
2018-11-22 22:12:31 +00:00
point_title: DEFINE_POINT 0, 15
2018-11-21 20:11:35 +00:00
point_slot_drive_name: DEFINE_POINT 20, 28
point_select_source: DEFINE_POINT 270, 46
2018-11-21 16:49:09 +00:00
rect_D255: DEFINE_RECT 270, 38, 420, 46
2018-11-21 20:11:35 +00:00
point_formatting: DEFINE_POINT 210, 68
point_writing: DEFINE_POINT 210, 68
point_reading: DEFINE_POINT 210, 68
2018-02-26 00:17:11 +00:00
2018-03-29 15:38:20 +00:00
str_read_drive:
PASCAL_STRING "Read Drive D"
str_disk_copy_padded:
PASCAL_STRING " Disk Copy "
str_quick_copy_padded:
PASCAL_STRING "Quick Copy "
str_slot_drive_name:
PASCAL_STRING "Slot, Drive, Name"
str_select_source:
PASCAL_STRING "Select source disk"
str_select_destination:
PASCAL_STRING "Select destination disk"
str_formatting:
PASCAL_STRING "Formatting the disk ...."
str_writing:
PASCAL_STRING "Writing .... "
str_reading:
PASCAL_STRING "Reading .... "
str_unknown:
PASCAL_STRING "Unknown"
str_select_quit:
PASCAL_STRING {"Select Quit from the file menu (",GLYPH_OAPPLE,"Q) to go back to the DeskTop"}
2018-11-21 16:49:09 +00:00
2018-11-21 18:46:14 +00:00
bg_black:
2018-03-29 15:38:20 +00:00
.byte 0
2018-11-21 18:46:14 +00:00
bg_white:
2018-03-30 04:17:18 +00:00
.byte $7F
2018-11-21 18:46:14 +00:00
2018-11-22 22:12:31 +00:00
rect_D35B: DEFINE_RECT 0, 0, 150, 0, rect_D35B
2018-11-21 18:46:14 +00:00
2018-11-23 00:20:54 +00:00
current_drive_selection: ; $FF if no selection
.byte 0
2018-03-29 04:05:12 +00:00
.byte 0
.byte 0
.byte 0
LD367: .byte 0
LD368: .byte 0
.byte 0
.byte 0
.byte 0
.byte 0
2018-11-21 18:46:14 +00:00
point_D36D: DEFINE_POINT 0, 0, point_D36D
2018-03-29 04:05:12 +00:00
.byte 0
.byte 0
2018-02-26 00:17:11 +00:00
.byte $47
2018-03-29 04:05:12 +00:00
.byte 0
2018-11-23 00:20:54 +00:00
num_drives:
.byte 0
2018-03-29 04:05:12 +00:00
LD376: .byte 0
2018-11-21 18:46:14 +00:00
2018-11-21 16:49:09 +00:00
LD377: .res 128, 0
2018-11-23 00:20:54 +00:00
drive_unitnum_table: .res 8, 0
2018-11-21 16:49:09 +00:00
LD3FF: .res 8, 0
LD407: .res 16, 0
2018-11-21 18:46:14 +00:00
2018-11-23 00:20:54 +00:00
source_drive_index: .byte 0
dest_drive_index: .byte 0
2018-03-29 15:38:20 +00:00
str_d: PASCAL_STRING 0
str_s: PASCAL_STRING 0
2018-03-29 04:05:12 +00:00
LD41D: .byte 0
LD41E: .byte 0
2018-11-22 05:00:49 +00:00
LD41F: .byte 0
LD420: .byte 0
LD421: .word 0
2018-03-29 04:05:12 +00:00
LD423: .byte 0
2018-11-22 05:00:49 +00:00
LD424: .word 0
LD426: .byte 0
LD427: .word 0
2018-03-29 04:05:12 +00:00
LD429: .byte 0
2018-11-21 18:46:14 +00:00
rect_D42A: DEFINE_RECT 18, 20, 490, 88
rect_D432: DEFINE_RECT 19, 29, 195, 101
2018-03-29 15:38:20 +00:00
LD43A: .res 18, 0
2018-03-29 04:05:12 +00:00
LD44C: .byte 0
LD44D: .byte 0
LD44E: .byte 0
.byte 0
.byte 0
2018-11-22 22:12:31 +00:00
quick_copy_flag: .byte 0
.byte 1, 0
2018-11-21 18:46:14 +00:00
2018-03-29 15:38:20 +00:00
str_2_spaces: PASCAL_STRING " "
2018-11-22 22:37:58 +00:00
str_number: PASCAL_STRING " " ; filled in by string_to_number
2018-11-21 16:49:09 +00:00
2018-11-21 20:11:35 +00:00
;;; Label positions
point_blocks_read: DEFINE_POINT 300, 125
point_blocks_written: DEFINE_POINT 300, 135
point_source: DEFINE_POINT 300, 115
point_source2: DEFINE_POINT 40, 125
point_slot_drive: DEFINE_POINT 110, 125
point_destination: DEFINE_POINT 40, 135
point_slot_drive2: DEFINE_POINT 110, 135
point_disk_copy: DEFINE_POINT 40, 115
point_select_quit: DEFINE_POINT 20, 145
2018-11-21 18:46:14 +00:00
rect_D483: DEFINE_RECT 20, 136, 400, 145
2018-11-21 20:11:35 +00:00
point_escape_stop_copy: DEFINE_POINT 300, 145
point_error_writing: DEFINE_POINT 40, 100
point_error_reading: DEFINE_POINT 40, 90
2018-11-21 18:46:14 +00:00
slot_char: .byte 10
drive_char: .byte 14
2018-02-26 00:17:11 +00:00
2018-03-29 15:38:20 +00:00
str_blocks_read:
PASCAL_STRING "Blocks Read: "
str_blocks_written:
PASCAL_STRING "Blocks Written: "
str_blocks_to_transfer:
PASCAL_STRING "Blocks to transfer: "
str_source:
PASCAL_STRING "Source "
str_destination:
PASCAL_STRING "Destination "
str_slot:
PASCAL_STRING "Slot "
str_drive:
PASCAL_STRING " Drive "
2018-02-26 00:17:11 +00:00
2018-03-29 15:38:20 +00:00
str_dos33_s_d:
PASCAL_STRING "DOS 3.3 S , D "
2018-02-26 00:17:11 +00:00
2018-03-29 15:38:20 +00:00
str_dos33_disk_copy:
PASCAL_STRING "DOS 3.3 disk copy"
2018-02-26 00:17:11 +00:00
2018-03-29 15:38:20 +00:00
str_pascal_disk_copy:
PASCAL_STRING "Pascal disk copy"
str_prodos_disk_copy:
PASCAL_STRING "ProDOS disk copy"
str_escape_stop_copy:
PASCAL_STRING " ESC stop the copy"
str_error_writing:
PASCAL_STRING "Error when writing block "
str_error_reading:
PASCAL_STRING "Error when reading block "
2018-11-21 16:49:09 +00:00
;;; ============================================================
;; cursor definition - pointer
2018-11-21 18:46:14 +00:00
pointer_cursor:
.byte px(%0000000),px(%0000000)
.byte px(%0100000),px(%0000000)
.byte px(%0110000),px(%0000000)
.byte px(%0111000),px(%0000000)
.byte px(%0111100),px(%0000000)
.byte px(%0111110),px(%0000000)
.byte px(%0111111),px(%0000000)
.byte px(%0101100),px(%0000000)
.byte px(%0000110),px(%0000000)
.byte px(%0000110),px(%0000000)
.byte px(%0000011),px(%0000000)
.byte px(%0000000),px(%0000000)
.byte px(%1100000),px(%0000000)
.byte px(%1110000),px(%0000000)
.byte px(%1111000),px(%0000000)
.byte px(%1111100),px(%0000000)
.byte px(%1111110),px(%0000000)
.byte px(%1111111),px(%0000000)
.byte px(%1111111),px(%1000000)
.byte px(%1111111),px(%0000000)
.byte px(%0001111),px(%0000000)
.byte px(%0001111),px(%0000000)
.byte px(%0000111),px(%1000000)
.byte px(%0000111),px(%1000000)
.byte 1,1
2018-11-21 16:49:09 +00:00
;; Cursor definition - watch
2018-11-21 18:46:14 +00:00
watch_cursor:
.byte px(%0000000),px(%0000000)
.byte px(%0011111),px(%1100000)
.byte px(%0011111),px(%1100000)
.byte px(%0100000),px(%0010000)
.byte px(%0100001),px(%0010000)
.byte px(%0100110),px(%0011000)
.byte px(%0100000),px(%0010000)
.byte px(%0100000),px(%0010000)
.byte px(%0011111),px(%1100000)
.byte px(%0011111),px(%1100000)
.byte px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000)
.byte px(%0011111),px(%1100000)
.byte px(%0111111),px(%1110000)
.byte px(%0111111),px(%1110000)
.byte px(%1111111),px(%1111000)
.byte px(%1111111),px(%1111000)
.byte px(%1111111),px(%1111100)
.byte px(%1111111),px(%1111000)
.byte px(%1111111),px(%1111000)
.byte px(%0111111),px(%1110000)
.byte px(%0111111),px(%1110000)
.byte px(%0011111),px(%1100000)
.byte px(%0000000),px(%0000000)
.byte 5, 5
2018-11-21 16:49:09 +00:00
;;; ============================================================
2018-03-29 04:05:12 +00:00
LD5E0: .byte 0
2018-11-22 22:12:31 +00:00
LD5E1: jsr remove_ram_disk
2018-03-31 02:34:44 +00:00
MGTK_RELAY_CALL2 MGTK::SetMenu, menu_definition
2018-11-21 18:46:14 +00:00
jsr set_cursor_pointer
2018-11-23 04:49:48 +00:00
copy #1, checkitem_params::menu_item
copy #1, checkitem_params::check
2018-03-31 02:34:44 +00:00
MGTK_RELAY_CALL2 MGTK::CheckItem, checkitem_params
2018-11-23 04:49:48 +00:00
copy #1, disablemenu_params::disable
2018-03-31 02:34:44 +00:00
MGTK_RELAY_CALL2 MGTK::DisableMenu, disablemenu_params
2018-02-26 00:17:11 +00:00
lda #$00
2018-11-22 22:12:31 +00:00
sta quick_copy_flag
2018-02-26 00:17:11 +00:00
sta LD5E0
2018-11-22 22:12:31 +00:00
jsr open_dialog
2018-02-26 00:17:11 +00:00
LD61C: lda #$00
sta LD367
sta LD368
sta LD44C
lda #$FF
2018-11-23 00:20:54 +00:00
sta current_drive_selection
2018-02-26 00:17:11 +00:00
lda #$81
sta LD44D
2018-11-23 04:49:48 +00:00
copy #0, disablemenu_params::disable
2018-03-31 02:34:44 +00:00
MGTK_RELAY_CALL2 MGTK::DisableMenu, disablemenu_params
2018-11-23 04:49:48 +00:00
lda #1
sta checkitem_params::check
2018-03-31 02:34:44 +00:00
MGTK_RELAY_CALL2 MGTK::CheckItem, checkitem_params
2018-11-22 22:12:31 +00:00
jsr draw_dialog
2018-03-31 04:11:36 +00:00
MGTK_RELAY_CALL2 MGTK::OpenWindow, winfo_drive_select
2018-02-26 00:17:11 +00:00
lda #$00
sta LD429
lda #$FF
sta LD44C
jsr LE16C
lda LD5E0
bne LD66E
jsr LE3A3
LD66E: jsr LE28D
inc LD5E0
LD674: jsr LD986
bmi LD674
beq LD687
2018-03-31 04:11:36 +00:00
MGTK_RELAY_CALL2 MGTK::CloseWindow, winfo_drive_select
2018-02-26 00:17:11 +00:00
jmp LD61C
2018-11-23 00:20:54 +00:00
LD687: lda current_drive_selection
2018-02-26 00:17:11 +00:00
bmi LD674
2018-11-23 04:49:48 +00:00
copy #1, disablemenu_params::disable
2018-03-31 02:34:44 +00:00
MGTK_RELAY_CALL2 MGTK::DisableMenu, disablemenu_params
2018-11-23 00:20:54 +00:00
lda current_drive_selection
sta source_drive_index
2018-03-31 04:11:36 +00:00
lda winfo_drive_select
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-03-30 04:40:39 +00:00
MGTK_RELAY_CALL2 MGTK::SetPenMode, pencopy
2018-11-21 18:46:14 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, winfo_drive_select::cliprect
2018-03-31 04:11:36 +00:00
lda winfo_dialog::window_id
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-03-30 04:40:39 +00:00
MGTK_RELAY_CALL2 MGTK::SetPenMode, pencopy
2018-11-21 16:49:09 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, rect_D255
2018-11-21 20:11:35 +00:00
MGTK_RELAY_CALL2 MGTK::MoveTo, point_select_source
2018-03-31 23:50:58 +00:00
addr_call draw_text, str_select_destination
2018-02-26 00:17:11 +00:00
jsr LE559
jsr LE2B1
LD6E6: jsr LD986
bmi LD6E6
beq LD6F9
2018-03-31 04:11:36 +00:00
MGTK_RELAY_CALL2 MGTK::CloseWindow, winfo_drive_select
2018-02-26 00:17:11 +00:00
jmp LD61C
2018-11-23 00:20:54 +00:00
LD6F9: lda current_drive_selection
2018-02-26 00:17:11 +00:00
bmi LD6E6
tax
lda LD3FF,x
2018-11-23 00:20:54 +00:00
sta dest_drive_index
2018-02-26 00:17:11 +00:00
lda #$00
sta LD44C
2018-03-31 04:11:36 +00:00
lda winfo_dialog::window_id
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-03-30 04:40:39 +00:00
MGTK_RELAY_CALL2 MGTK::SetPenMode, pencopy
2018-11-21 16:49:09 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, rect_D211
2018-03-31 04:11:36 +00:00
MGTK_RELAY_CALL2 MGTK::CloseWindow, winfo_drive_select
2018-11-21 18:46:14 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, rect_D432
2018-11-22 22:27:03 +00:00
LD734: addr_call show_alert_dialog, $0000 ; Insert Source
2018-02-26 00:17:11 +00:00
beq LD740
jmp LD61C
LD740: lda #$00
sta LD44D
2018-11-23 00:20:54 +00:00
ldx source_drive_index
lda drive_unitnum_table,x
2018-11-22 05:00:49 +00:00
sta disk_copy_overlay4::on_line_params2::unit_num
2018-11-21 23:29:24 +00:00
jsr disk_copy_overlay4::L1291
2018-02-26 00:17:11 +00:00
beq LD77E
cmp #$52
bne LD763
2018-11-21 23:29:24 +00:00
jsr disk_copy_overlay4::L0D5F
2018-02-26 00:17:11 +00:00
jsr LE674
jsr LE559
jmp LD7AD
2018-03-31 04:11:36 +00:00
LD763: lda winfo_dialog::window_id
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-03-30 04:40:39 +00:00
MGTK_RELAY_CALL2 MGTK::SetPenMode, pencopy
2018-11-21 18:46:14 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, rect_D42A
2018-02-26 00:17:11 +00:00
jmp LD734
LD77E: lda $1300
and #$0F
bne LD798
lda $1301
cmp #$52
bne LD763
2018-11-21 23:29:24 +00:00
jsr disk_copy_overlay4::L0D5F
2018-02-26 00:17:11 +00:00
jsr LE674
jsr LE559
jmp LD7AD
LD798: lda $1300
and #$0F
sta $1300
addr_call adjust_case, $1300
2018-02-26 00:17:11 +00:00
jsr LE674
jsr LE559
2018-11-23 00:20:54 +00:00
LD7AD: lda source_drive_index
2018-02-26 00:17:11 +00:00
jsr LE3B8
jsr LE5E1
jsr LE63F
2018-11-23 00:20:54 +00:00
ldx dest_drive_index
lda drive_unitnum_table,x
2018-02-26 00:17:11 +00:00
tay
ldx #$00
2018-11-22 22:27:03 +00:00
lda #1 ; Insert Destination
jsr show_alert_dialog
2018-02-26 00:17:11 +00:00
beq LD7CC
jmp LD61C
2018-11-23 00:20:54 +00:00
LD7CC: ldx dest_drive_index
lda drive_unitnum_table,x
2018-11-22 05:00:49 +00:00
sta disk_copy_overlay4::on_line_params2::unit_num
2018-11-21 23:29:24 +00:00
jsr disk_copy_overlay4::L1291
2018-02-26 00:17:11 +00:00
beq LD7E1
cmp #$52
beq LD7F2
jmp LD852
LD7E1: lda $1300
and #$0F
bne LD7F2
lda $1301
cmp #$52
beq LD7F2
jmp LD852
2018-11-23 00:20:54 +00:00
LD7F2: ldx dest_drive_index
lda drive_unitnum_table,x
2018-02-26 00:17:11 +00:00
and #$0F
beq LD817
2018-11-23 00:20:54 +00:00
lda drive_unitnum_table,x
2018-12-06 03:35:04 +00:00
jsr disk_copy_overlay4::unit_number_to_driver_address
2018-02-26 00:17:11 +00:00
ldy #$FF
2018-03-31 02:34:44 +00:00
lda ($06),y
2018-02-26 00:17:11 +00:00
beq LD817
cmp #$FF
beq LD817
ldy #$FE
2018-03-31 02:34:44 +00:00
lda ($06),y
2018-02-26 00:17:11 +00:00
and #$08
bne LD817
jmp LD8A9
LD817: lda $1300
and #$0F
bne LD82C
2018-11-23 00:20:54 +00:00
ldx dest_drive_index
lda drive_unitnum_table,x
2018-02-26 00:17:11 +00:00
and #$F0
tax
lda #$07
jmp LD83C
LD82C: sta $1300
addr_call adjust_case, $1300
2018-02-26 00:17:11 +00:00
ldx #$00
ldy #$13
2018-11-22 22:27:03 +00:00
lda #2 ; Confirm Erase
LD83C: jsr show_alert_dialog
2018-02-26 00:17:11 +00:00
cmp #$01
beq LD847
cmp #$02
beq LD84A
LD847: jmp LD61C
2018-11-22 22:12:31 +00:00
LD84A: lda quick_copy_flag
2018-02-26 00:17:11 +00:00
bne LD852
jmp LD8A9
2018-11-23 00:20:54 +00:00
LD852: ldx dest_drive_index
lda drive_unitnum_table,x
2018-02-26 00:17:11 +00:00
and #$0F
beq LD87C
2018-11-23 00:20:54 +00:00
lda drive_unitnum_table,x
2018-12-06 03:35:04 +00:00
jsr disk_copy_overlay4::unit_number_to_driver_address
2018-02-26 00:17:11 +00:00
ldy #$FE
2018-03-31 02:34:44 +00:00
lda ($06),y
2018-02-26 00:17:11 +00:00
and #$08
bne LD87C
ldy #$FF
2018-03-31 02:34:44 +00:00
lda ($06),y
2018-02-26 00:17:11 +00:00
beq LD87C
cmp #$FF
beq LD87C
2018-11-22 22:27:03 +00:00
lda #3 ; Destination format failed
jsr show_alert_dialog
2018-02-26 00:17:11 +00:00
jmp LD61C
2018-11-21 20:11:35 +00:00
LD87C: MGTK_RELAY_CALL2 MGTK::MoveTo, point_formatting
2018-03-31 23:50:58 +00:00
addr_call draw_text, str_formatting
2018-11-21 23:29:24 +00:00
jsr disk_copy_overlay4::L0CAF
2018-02-26 00:17:11 +00:00
bcc LD8A9
cmp #$2B
beq LD89F
2018-11-22 22:27:03 +00:00
lda #4 ; Format error
jsr show_alert_dialog
2018-02-26 00:17:11 +00:00
beq LD852
jmp LD61C
2018-11-22 22:27:03 +00:00
LD89F: lda #5 ; Destination protected
jsr show_alert_dialog
2018-02-26 00:17:11 +00:00
beq LD852
jmp LD61C
2018-03-31 04:11:36 +00:00
LD8A9: lda winfo_dialog::window_id
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-03-30 04:40:39 +00:00
MGTK_RELAY_CALL2 MGTK::SetPenMode, pencopy
2018-11-21 16:49:09 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, rect_D211
2018-11-23 00:20:54 +00:00
lda source_drive_index
cmp dest_drive_index
2018-02-26 00:17:11 +00:00
bne LD8DF
tax
2018-11-23 00:20:54 +00:00
lda drive_unitnum_table,x
2018-02-26 00:17:11 +00:00
pha
2018-11-21 23:29:24 +00:00
jsr disk_copy_overlay4::eject_disk
2018-02-26 00:17:11 +00:00
pla
tay
ldx #$80
2018-11-22 22:27:03 +00:00
lda #0 ; Insert source
jsr show_alert_dialog
2018-02-26 00:17:11 +00:00
beq LD8DF
jmp LD61C
2018-11-21 23:29:24 +00:00
LD8DF: jsr disk_copy_overlay4::L0DB5
2018-02-26 00:17:11 +00:00
lda #$00
sta LD421
2018-11-22 05:00:49 +00:00
sta LD421+1
2018-02-26 00:17:11 +00:00
lda #$07
sta LD423
jsr LE4BF
jsr LE4EC
jsr LE507
jsr LE694
LD8FB: jsr LE4A8
lda #$00
2018-11-21 23:29:24 +00:00
jsr disk_copy_overlay4::L0ED7
2018-02-26 00:17:11 +00:00
cmp #$01
beq LD97A
jsr LE4EC
2018-11-23 00:20:54 +00:00
lda source_drive_index
cmp dest_drive_index
2018-02-26 00:17:11 +00:00
bne LD928
tax
2018-11-23 00:20:54 +00:00
lda drive_unitnum_table,x
2018-02-26 00:17:11 +00:00
pha
2018-11-21 23:29:24 +00:00
jsr disk_copy_overlay4::eject_disk
2018-02-26 00:17:11 +00:00
pla
tay
ldx #$80
2018-11-22 22:27:03 +00:00
lda #1 ; Insert destination
jsr show_alert_dialog
2018-02-26 00:17:11 +00:00
beq LD928
jmp LD61C
LD928: jsr LE491
lda #$80
2018-11-21 23:29:24 +00:00
jsr disk_copy_overlay4::L0ED7
2018-02-26 00:17:11 +00:00
bmi LD955
bne LD97A
jsr LE507
2018-11-23 00:20:54 +00:00
lda source_drive_index
cmp dest_drive_index
2018-02-26 00:17:11 +00:00
bne LD8FB
tax
2018-11-23 00:20:54 +00:00
lda drive_unitnum_table,x
2018-02-26 00:17:11 +00:00
pha
2018-11-21 23:29:24 +00:00
jsr disk_copy_overlay4::eject_disk
2018-02-26 00:17:11 +00:00
pla
tay
ldx #$80
2018-11-22 22:27:03 +00:00
lda #0 ; Insert source
jsr show_alert_dialog
2018-02-26 00:17:11 +00:00
beq LD8FB
jmp LD61C
LD955: jsr LE507
2018-11-21 23:29:24 +00:00
jsr disk_copy_overlay4::L10FB
2018-11-23 00:20:54 +00:00
ldx source_drive_index
lda drive_unitnum_table,x
2018-11-21 23:29:24 +00:00
jsr disk_copy_overlay4::eject_disk
2018-11-23 00:20:54 +00:00
ldx dest_drive_index
cpx source_drive_index
2018-11-22 22:12:31 +00:00
beq :+
2018-11-23 00:20:54 +00:00
lda drive_unitnum_table,x
2018-11-21 23:29:24 +00:00
jsr disk_copy_overlay4::eject_disk
2018-11-22 22:27:03 +00:00
: lda #9 ; Copy success
jsr show_alert_dialog
2018-02-26 00:17:11 +00:00
jmp LD61C
2018-11-21 23:29:24 +00:00
LD97A: jsr disk_copy_overlay4::L10FB
2018-11-22 22:27:03 +00:00
lda #10 ; Copy failed
jsr show_alert_dialog
2018-02-26 00:17:11 +00:00
jmp LD61C
2018-03-29 04:05:12 +00:00
.byte 0
2018-03-31 02:34:44 +00:00
LD986: MGTK_RELAY_CALL2 MGTK::InitPort, grafport
MGTK_RELAY_CALL2 MGTK::SetPort, grafport
2018-02-26 00:17:11 +00:00
LD998: bit LD368
2018-11-22 22:12:31 +00:00
bpl :+
2018-02-26 00:17:11 +00:00
dec LD367
2018-11-22 22:12:31 +00:00
bne :+
2018-02-26 00:17:11 +00:00
lda #$00
sta LD368
2018-11-22 22:12:31 +00:00
: MGTK_RELAY_CALL2 MGTK::GetEvent, event_params
2018-03-31 02:34:44 +00:00
lda event_kind
2018-11-18 04:34:17 +00:00
cmp #MGTK::EventKind::button_down
2018-02-26 00:17:11 +00:00
bne LD9BA
2018-11-22 22:37:58 +00:00
jmp handle_button_down
2018-02-26 00:17:11 +00:00
2018-11-18 04:34:17 +00:00
LD9BA: cmp #MGTK::EventKind::key_down
2018-02-26 00:17:11 +00:00
bne LD998
jmp LD9D5
2018-11-23 00:53:50 +00:00
menu_command_table:
;; Apple menu
2018-11-23 22:33:37 +00:00
.addr disk_copy_overlay4::noop
.addr disk_copy_overlay4::noop
.addr disk_copy_overlay4::noop
.addr disk_copy_overlay4::noop
.addr disk_copy_overlay4::noop
2018-11-23 00:53:50 +00:00
;; File menu
2018-11-22 05:00:49 +00:00
.addr disk_copy_overlay4::quit
2018-11-23 00:53:50 +00:00
;; Facilities menu
.addr cmd_quick_copy
.addr cmd_disk_copy
2018-03-31 23:50:58 +00:00
2018-11-23 00:53:50 +00:00
menu_offset_table:
.byte 0, 5*2, 6*2, 8*2
2018-03-31 02:34:44 +00:00
LD9D5: lda event_modifiers
2018-11-23 00:53:50 +00:00
bne :+
2018-03-31 02:34:44 +00:00
lda event_key
and #CHAR_MASK
2018-03-31 23:50:58 +00:00
cmp #CHAR_ESCAPE
2018-11-23 00:53:50 +00:00
beq :+
2018-02-26 00:17:11 +00:00
jmp LDBFC
2018-11-23 00:53:50 +00:00
;; Keyboard-based menu selection
: lda #1
2018-02-26 00:17:11 +00:00
sta LD12F
2018-03-31 02:34:44 +00:00
lda event_key
sta menukey_params::which_key
lda event_modifiers
sta menukey_params::key_mods
MGTK_RELAY_CALL2 MGTK::MenuKey, menukey_params
2018-11-23 00:53:50 +00:00
handle_menu_selection:
ldx menuselect_params::menu_id
bne :+
2018-02-26 00:17:11 +00:00
rts
2018-11-23 00:53:50 +00:00
;; Compute offset into command table - menu offset + item offset
: dex
lda menu_offset_table,x
2018-02-26 00:17:11 +00:00
tax
2018-11-23 00:53:50 +00:00
ldy menuselect_params::menu_item
2018-02-26 00:17:11 +00:00
dey
tya
asl a
2018-03-31 23:50:58 +00:00
sta jump_addr
2018-02-26 00:17:11 +00:00
txa
clc
2018-03-31 23:50:58 +00:00
adc jump_addr
2018-02-26 00:17:11 +00:00
tax
2018-11-23 00:53:50 +00:00
copy16 menu_command_table,x, jump_addr
jsr do_jump
2018-03-31 02:34:44 +00:00
MGTK_RELAY_CALL2 MGTK::HiliteMenu, hilitemenu_params
2018-02-26 00:17:11 +00:00
jmp LD986
2018-11-23 00:53:50 +00:00
do_jump:
tsx
stx stack_stash
2018-03-31 23:50:58 +00:00
jump_addr := *+1
2018-11-21 05:45:07 +00:00
jmp dummy1234
2018-11-23 00:53:50 +00:00
cmd_quick_copy:
lda quick_copy_flag
2018-02-26 00:17:11 +00:00
bne LDA42
rts
2018-11-23 04:49:48 +00:00
LDA42: copy #0, checkitem_params::check
2018-03-31 02:34:44 +00:00
MGTK_RELAY_CALL2 MGTK::CheckItem, checkitem_params
2018-11-23 04:49:48 +00:00
copy quick_copy_flag, checkitem_params::menu_item
copy #1, checkitem_params::check
2018-03-31 02:34:44 +00:00
MGTK_RELAY_CALL2 MGTK::CheckItem, checkitem_params
2018-11-23 04:49:48 +00:00
copy #0, quick_copy_flag
2018-03-31 04:11:36 +00:00
lda winfo_dialog::window_id
2018-11-22 22:12:31 +00:00
jsr set_win_port
addr_call draw_title_text, str_quick_copy_padded
2018-02-26 00:17:11 +00:00
rts
2018-11-23 00:53:50 +00:00
cmd_disk_copy:
lda quick_copy_flag
2018-02-26 00:17:11 +00:00
beq LDA7D
rts
2018-11-23 04:49:48 +00:00
LDA7D: copy #0, checkitem_params::check
2018-03-31 02:34:44 +00:00
MGTK_RELAY_CALL2 MGTK::CheckItem, checkitem_params
2018-11-23 04:49:48 +00:00
copy #2, checkitem_params::menu_item
copy #1, checkitem_params::check
2018-03-31 02:34:44 +00:00
MGTK_RELAY_CALL2 MGTK::CheckItem, checkitem_params
2018-11-23 04:49:48 +00:00
copy #1, quick_copy_flag
2018-03-31 04:11:36 +00:00
lda winfo_dialog::window_id
2018-11-22 22:12:31 +00:00
jsr set_win_port
addr_call draw_title_text, str_disk_copy_padded
2018-02-26 00:17:11 +00:00
rts
2018-11-22 22:37:58 +00:00
handle_button_down:
MGTK_RELAY_CALL2 MGTK::FindWindow, event_xcoord
2018-03-31 02:34:44 +00:00
lda findwindow_which_area
2018-11-22 22:37:58 +00:00
bne :+
rts ; desktop - ignore
: cmp #MGTK::Area::menubar
bne :+
2018-03-31 02:34:44 +00:00
MGTK_RELAY_CALL2 MGTK::MenuSelect, menuselect_params
2018-11-22 22:37:58 +00:00
jmp handle_menu_selection
: cmp #MGTK::Area::content
bne :+
jmp handle_content_button_down
: return #$FF
2018-02-26 00:17:11 +00:00
2018-11-22 22:37:58 +00:00
handle_content_button_down:
lda LD133
2018-03-31 04:11:36 +00:00
cmp winfo_dialog::window_id
2018-11-22 22:37:58 +00:00
bne check_drive_select
jmp handle_dialog_button_down
2018-02-26 00:17:11 +00:00
2018-11-22 22:37:58 +00:00
check_drive_select:
cmp winfo_drive_select
bne :+
jmp handle_drive_select_button_down
: rts
2018-02-26 00:17:11 +00:00
2018-11-22 22:37:58 +00:00
handle_dialog_button_down:
lda winfo_dialog::window_id
2018-03-31 02:34:44 +00:00
sta screentowindow_window_id
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-03-31 02:34:44 +00:00
MGTK_RELAY_CALL2 MGTK::ScreenToWindow, screentowindow_params
MGTK_RELAY_CALL2 MGTK::MoveTo, screentowindow_windowx
2018-11-22 22:37:58 +00:00
check_ok_button:
2018-11-22 22:12:31 +00:00
MGTK_RELAY_CALL2 MGTK::InRect, rect_ok_button
2018-03-31 23:50:58 +00:00
cmp #MGTK::inrect_inside
2018-11-22 22:37:58 +00:00
beq :+
jmp check_read_drive_button
: MGTK_RELAY_CALL2 MGTK::SetPenMode, penXOR
2018-11-22 22:12:31 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, rect_ok_button
2018-11-22 22:27:03 +00:00
jsr handle_ok_button_down
2018-02-26 00:17:11 +00:00
rts
2018-11-22 22:37:58 +00:00
check_read_drive_button:
MGTK_RELAY_CALL2 MGTK::InRect, rect_read_drive
2018-03-31 23:50:58 +00:00
cmp #MGTK::inrect_inside
2018-11-22 22:37:58 +00:00
bne :+
2018-03-30 04:40:39 +00:00
MGTK_RELAY_CALL2 MGTK::SetPenMode, penXOR
2018-11-22 22:12:31 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, rect_read_drive
2018-11-22 22:27:03 +00:00
jsr handle_read_drive_button_down
2018-02-26 00:17:11 +00:00
rts
2018-11-22 22:37:58 +00:00
: return #$FF
2018-02-26 00:17:11 +00:00
2018-11-22 22:37:58 +00:00
handle_drive_select_button_down:
lda winfo_drive_select
2018-03-31 02:34:44 +00:00
sta screentowindow_window_id
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-03-31 02:34:44 +00:00
MGTK_RELAY_CALL2 MGTK::ScreenToWindow, screentowindow_params
MGTK_RELAY_CALL2 MGTK::MoveTo, screentowindow_windowx
2018-11-23 00:20:54 +00:00
lsr16 screentowindow_windowy ; / 8
2018-03-31 02:34:44 +00:00
lsr16 screentowindow_windowy
lsr16 screentowindow_windowy
lda screentowindow_windowy
2018-11-23 00:20:54 +00:00
cmp num_drives
2018-02-26 00:17:11 +00:00
bcc LDB98
2018-11-23 00:20:54 +00:00
lda current_drive_selection
2018-11-22 22:12:31 +00:00
jsr highlight_row
2018-02-26 00:17:11 +00:00
lda #$FF
2018-11-23 00:20:54 +00:00
sta current_drive_selection ; $FF if no selection?
2018-02-26 00:17:11 +00:00
jmp LDBCA
2018-11-23 00:20:54 +00:00
LDB98: cmp current_drive_selection
2018-02-26 00:17:11 +00:00
bne LDBCD
bit LD368
bpl LDBC0
2018-03-30 04:40:39 +00:00
MGTK_RELAY_CALL2 MGTK::SetPenMode, penXOR
2018-11-22 22:12:31 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, rect_ok_button
MGTK_RELAY_CALL2 MGTK::PaintRect, rect_ok_button
2018-03-29 04:05:12 +00:00
return #$00
2018-02-26 00:17:11 +00:00
LDBC0: lda #$FF
sta LD368
lda #$64
sta LD367
2018-03-29 04:05:12 +00:00
LDBCA: return #$FF
2018-02-26 00:17:11 +00:00
LDBCD: pha
2018-11-23 00:20:54 +00:00
lda current_drive_selection
2018-02-26 00:17:11 +00:00
bmi LDBD6
2018-11-22 22:12:31 +00:00
jsr highlight_row
2018-02-26 00:17:11 +00:00
LDBD6: pla
2018-11-23 00:20:54 +00:00
sta current_drive_selection
2018-11-22 22:12:31 +00:00
jsr highlight_row
2018-02-26 00:17:11 +00:00
jmp LDBC0
2018-03-30 04:17:18 +00:00
.proc MGTK_RELAY2
sty LDBF2
2018-03-29 04:05:12 +00:00
stax LDBF3
2018-02-26 00:17:11 +00:00
sta RAMRDON
sta RAMWRTON
2018-03-29 04:05:12 +00:00
jsr MGTK::MLI
LDBF2: .byte 0
2018-03-30 04:17:18 +00:00
LDBF3: .addr 0
2018-02-26 00:17:11 +00:00
sta RAMRDOFF
sta RAMWRTOFF
rts
2018-03-30 04:17:18 +00:00
.endproc
2018-02-26 00:17:11 +00:00
2018-03-31 02:34:44 +00:00
LDBFC: lda event_key
and #CHAR_MASK
2018-03-31 02:34:44 +00:00
cmp #'D'
2018-02-26 00:17:11 +00:00
beq LDC09
2018-03-31 02:34:44 +00:00
cmp #'d'
2018-02-26 00:17:11 +00:00
bne LDC2D
2018-03-31 04:11:36 +00:00
LDC09: lda winfo_dialog::window_id
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-03-30 04:40:39 +00:00
MGTK_RELAY_CALL2 MGTK::SetPenMode, penXOR
2018-11-22 22:12:31 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, rect_read_drive
MGTK_RELAY_CALL2 MGTK::PaintRect, rect_read_drive
2018-03-29 04:05:12 +00:00
return #$01
2018-02-26 00:17:11 +00:00
2018-03-31 23:50:58 +00:00
LDC2D: cmp #CHAR_RETURN
2018-02-26 00:17:11 +00:00
bne LDC55
2018-03-31 04:11:36 +00:00
lda winfo_dialog::window_id
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-03-30 04:40:39 +00:00
MGTK_RELAY_CALL2 MGTK::SetPenMode, penXOR
2018-11-22 22:12:31 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, rect_ok_button
MGTK_RELAY_CALL2 MGTK::PaintRect, rect_ok_button
2018-03-29 04:05:12 +00:00
return #$00
2018-02-26 00:17:11 +00:00
LDC55: bit LD44C
2018-11-22 22:12:31 +00:00
bmi check_down
2018-02-26 00:17:11 +00:00
jmp LDCA9
2018-11-22 22:12:31 +00:00
.proc check_down
cmp #CHAR_DOWN
bne check_up
2018-03-31 04:11:36 +00:00
lda winfo_drive_select
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-11-23 00:20:54 +00:00
lda current_drive_selection
2018-02-26 00:17:11 +00:00
bmi LDC6F
2018-11-22 22:12:31 +00:00
jsr highlight_row
2018-11-23 00:20:54 +00:00
LDC6F: inc current_drive_selection
lda current_drive_selection
cmp num_drives
2018-02-26 00:17:11 +00:00
bcc LDC7F
lda #$00
2018-11-23 00:20:54 +00:00
sta current_drive_selection
2018-11-22 22:12:31 +00:00
LDC7F: jsr highlight_row
2018-02-26 00:17:11 +00:00
jmp LDCA9
2018-11-22 22:12:31 +00:00
.endproc
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
.proc check_up
cmp #CHAR_UP
2018-02-26 00:17:11 +00:00
bne LDCA9
2018-03-31 04:11:36 +00:00
lda winfo_drive_select
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-11-23 00:20:54 +00:00
lda current_drive_selection
2018-02-26 00:17:11 +00:00
bmi LDC9C
2018-11-22 22:12:31 +00:00
jsr highlight_row
2018-11-23 00:20:54 +00:00
dec current_drive_selection
2018-02-26 00:17:11 +00:00
bpl LDCA3
2018-11-23 00:20:54 +00:00
LDC9C: ldx num_drives
2018-02-26 00:17:11 +00:00
dex
2018-11-23 00:20:54 +00:00
stx current_drive_selection
LDCA3: lda current_drive_selection
2018-11-22 22:12:31 +00:00
jsr highlight_row
;; fall through
.endproc
2018-03-29 04:05:12 +00:00
LDCA9: return #$FF
2018-02-26 00:17:11 +00:00
2018-11-22 22:27:03 +00:00
;;; ============================================================
.proc handle_read_drive_button_down
lda #$00
sta state
loop: MGTK_RELAY_CALL2 MGTK::GetEvent, event_params
2018-03-31 02:34:44 +00:00
lda event_kind
2018-11-18 04:34:17 +00:00
cmp #MGTK::EventKind::button_up
2018-02-26 00:17:11 +00:00
beq LDD14
2018-03-31 04:11:36 +00:00
lda winfo_dialog::window_id
2018-03-31 02:34:44 +00:00
sta screentowindow_window_id
MGTK_RELAY_CALL2 MGTK::ScreenToWindow, screentowindow_params
MGTK_RELAY_CALL2 MGTK::MoveTo, screentowindow_windowx
2018-11-22 22:12:31 +00:00
MGTK_RELAY_CALL2 MGTK::InRect, rect_read_drive
2018-03-31 23:50:58 +00:00
cmp #MGTK::inrect_inside
2018-02-26 00:17:11 +00:00
beq LDCEE
2018-11-22 22:27:03 +00:00
lda state
2018-02-26 00:17:11 +00:00
beq LDCF6
2018-11-22 22:27:03 +00:00
jmp loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:27:03 +00:00
LDCEE: lda state
2018-02-26 00:17:11 +00:00
bne LDCF6
2018-11-22 22:27:03 +00:00
jmp loop
2018-02-26 00:17:11 +00:00
2018-03-30 04:40:39 +00:00
LDCF6: MGTK_RELAY_CALL2 MGTK::SetPenMode, penXOR
2018-11-22 22:12:31 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, rect_read_drive
2018-11-22 22:27:03 +00:00
lda state
2018-02-26 00:17:11 +00:00
clc
adc #$80
2018-11-22 22:27:03 +00:00
sta state
jmp loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:27:03 +00:00
LDD14: lda state
2018-02-26 00:17:11 +00:00
beq LDD1C
2018-03-29 04:05:12 +00:00
return #$FF
2018-02-26 00:17:11 +00:00
2018-03-31 04:11:36 +00:00
LDD1C: lda winfo_dialog::window_id
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-03-30 04:40:39 +00:00
MGTK_RELAY_CALL2 MGTK::SetPenMode, penXOR
2018-11-22 22:12:31 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, rect_read_drive
2018-03-29 04:05:12 +00:00
return #$01
2018-02-26 00:17:11 +00:00
2018-11-22 22:27:03 +00:00
state: .byte 0
.endproc
;;; ============================================================
.proc handle_ok_button_down
lda #$00
sta state
loop: MGTK_RELAY_CALL2 MGTK::GetEvent, event_params
2018-03-31 02:34:44 +00:00
lda event_kind
2018-11-18 04:34:17 +00:00
cmp #MGTK::EventKind::button_up
2018-02-26 00:17:11 +00:00
beq LDDA0
2018-03-31 04:11:36 +00:00
lda winfo_dialog::window_id
2018-03-31 02:34:44 +00:00
sta screentowindow_window_id
MGTK_RELAY_CALL2 MGTK::ScreenToWindow, screentowindow_params
MGTK_RELAY_CALL2 MGTK::MoveTo, screentowindow_windowx
2018-11-22 22:12:31 +00:00
MGTK_RELAY_CALL2 MGTK::InRect, rect_ok_button
2018-03-31 23:50:58 +00:00
cmp #MGTK::inrect_inside
2018-02-26 00:17:11 +00:00
beq LDD7A
2018-11-22 22:27:03 +00:00
lda state
2018-02-26 00:17:11 +00:00
beq LDD82
2018-11-22 22:27:03 +00:00
jmp loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:27:03 +00:00
LDD7A: lda state
2018-02-26 00:17:11 +00:00
bne LDD82
2018-11-22 22:27:03 +00:00
jmp loop
2018-02-26 00:17:11 +00:00
2018-03-30 04:40:39 +00:00
LDD82: MGTK_RELAY_CALL2 MGTK::SetPenMode, penXOR
2018-11-22 22:12:31 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, rect_ok_button
2018-11-22 22:27:03 +00:00
lda state
2018-02-26 00:17:11 +00:00
clc
adc #$80
2018-11-22 22:27:03 +00:00
sta state
jmp loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:27:03 +00:00
LDDA0: lda state
2018-02-26 00:17:11 +00:00
beq LDDA8
2018-03-29 04:05:12 +00:00
return #$FF
2018-02-26 00:17:11 +00:00
2018-03-31 04:11:36 +00:00
LDDA8: lda winfo_dialog::window_id
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-03-30 04:40:39 +00:00
MGTK_RELAY_CALL2 MGTK::SetPenMode, penXOR
2018-11-22 22:12:31 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, rect_ok_button
2018-03-29 04:05:12 +00:00
return #$00
2018-02-26 00:17:11 +00:00
2018-11-22 22:27:03 +00:00
state: .byte 0
.endproc
2018-11-21 18:46:14 +00:00
;;; ============================================================
.proc set_cursor_watch
2018-03-30 04:40:39 +00:00
MGTK_RELAY_CALL2 MGTK::HideCursor
2018-11-21 18:46:14 +00:00
MGTK_RELAY_CALL2 MGTK::SetCursor, watch_cursor
2018-03-30 04:40:39 +00:00
MGTK_RELAY_CALL2 MGTK::ShowCursor
2018-02-26 00:17:11 +00:00
rts
2018-11-21 18:46:14 +00:00
.endproc
;;; ============================================================
2018-02-26 00:17:11 +00:00
2018-11-21 18:46:14 +00:00
.proc set_cursor_pointer
MGTK_RELAY_CALL2 MGTK::HideCursor
MGTK_RELAY_CALL2 MGTK::SetCursor, pointer_cursor
2018-03-30 04:40:39 +00:00
MGTK_RELAY_CALL2 MGTK::ShowCursor
2018-02-26 00:17:11 +00:00
rts
2018-11-21 18:46:14 +00:00
.endproc
;;; ============================================================
2018-02-26 00:17:11 +00:00
2018-11-22 05:00:49 +00:00
LDDFC: sta disk_copy_overlay4::block_params::unit_num
2018-02-26 00:17:11 +00:00
lda #$00
2018-11-22 05:00:49 +00:00
sta disk_copy_overlay4::block_params::block_num
sta disk_copy_overlay4::block_params::block_num+1
copy16 #$1C00, disk_copy_overlay4::block_params::data_buffer
2018-11-21 23:29:24 +00:00
jsr disk_copy_overlay4::L12AF
2018-02-26 00:17:11 +00:00
beq LDE19
2018-03-29 04:05:12 +00:00
return #$FF
2018-02-26 00:17:11 +00:00
LDE19: lda $1C01
cmp #$E0
beq LDE23
jmp LDE4D
LDE23: lda $1C02
cmp #$70
beq LDE31
cmp #$60
beq LDE31
2018-03-29 04:05:12 +00:00
LDE2E: return #$FF
2018-02-26 00:17:11 +00:00
2018-11-23 00:20:54 +00:00
LDE31: lda num_drives
2018-02-26 00:17:11 +00:00
asl a
asl a
asl a
asl a
clc
2018-11-21 18:46:14 +00:00
adc #<LD377
2018-02-26 00:17:11 +00:00
tay
2018-11-21 18:46:14 +00:00
lda #>LD377
adc #0
2018-02-26 00:17:11 +00:00
tax
tya
jsr LDE9F
lda #$80
sta LD44E
2018-03-29 04:05:12 +00:00
return #$00
2018-02-26 00:17:11 +00:00
LDE4D: cmp #$A5
bne LDE2E
lda $1C02
cmp #$27
bne LDE2E
2018-11-22 05:00:49 +00:00
lda disk_copy_overlay4::block_params::unit_num
2018-02-26 00:17:11 +00:00
and #$70
lsr a
lsr a
lsr a
lsr a
clc
2018-11-21 19:05:39 +00:00
adc #'0'
2018-11-21 16:49:09 +00:00
ldx slot_char
2018-03-29 15:38:20 +00:00
sta str_dos33_s_d,x
2018-11-22 05:00:49 +00:00
lda disk_copy_overlay4::block_params::unit_num
2018-02-26 00:17:11 +00:00
and #$80
asl a
rol a
adc #$31
2018-11-21 16:49:09 +00:00
ldx drive_char
2018-03-29 15:38:20 +00:00
sta str_dos33_s_d,x
2018-11-23 00:20:54 +00:00
lda num_drives
2018-02-26 00:17:11 +00:00
asl a
asl a
asl a
asl a
tay
ldx #$00
2018-03-29 15:38:20 +00:00
LDE83: lda str_dos33_s_d,x
2018-02-26 00:17:11 +00:00
sta LD377,y
iny
inx
2018-03-29 15:38:20 +00:00
cpx str_dos33_s_d
2018-02-26 00:17:11 +00:00
bne LDE83
2018-03-29 15:38:20 +00:00
lda str_dos33_s_d,x
2018-02-26 00:17:11 +00:00
sta LD377,y
lda #$43
sta $0300
2018-03-29 04:05:12 +00:00
return #$00
2018-02-26 00:17:11 +00:00
2018-03-29 04:05:12 +00:00
.byte 0
2018-03-31 02:34:44 +00:00
LDE9F: stax $06
2018-11-22 05:00:49 +00:00
copy16 #$0002, disk_copy_overlay4::block_params::block_num
2018-11-21 23:29:24 +00:00
jsr disk_copy_overlay4::L12AF
2018-02-26 00:17:11 +00:00
beq LDEBE
ldy #$00
lda #$01
2018-03-31 02:34:44 +00:00
sta ($06),y
2018-02-26 00:17:11 +00:00
iny
lda #$20
2018-03-31 02:34:44 +00:00
sta ($06),y
2018-02-26 00:17:11 +00:00
rts
LDEBE: ldy #$00
ldx #$00
LDEC2: lda $1C06,x
2018-03-31 02:34:44 +00:00
sta ($06),y
2018-02-26 00:17:11 +00:00
inx
iny
cpx $1C06
bne LDEC2
lda $1C06,x
2018-03-31 02:34:44 +00:00
sta ($06),y
2018-02-26 00:17:11 +00:00
lda $1C06
cmp #$0F
bcs LDEE6
ldy #$00
2018-03-31 02:34:44 +00:00
lda ($06),y
2018-02-26 00:17:11 +00:00
clc
adc #$01
2018-03-31 02:34:44 +00:00
sta ($06),y
lda ($06),y
2018-02-26 00:17:11 +00:00
tay
LDEE6: lda #$3A
2018-03-31 02:34:44 +00:00
sta ($06),y
2018-02-26 00:17:11 +00:00
rts
2018-11-22 22:12:31 +00:00
.proc number_to_string
stax number
ldx #7
lda #' '
2018-11-22 22:37:58 +00:00
: sta str_number,x
2018-02-26 00:17:11 +00:00
dex
2018-11-22 22:12:31 +00:00
bne :-
lda #0
2018-02-26 00:17:11 +00:00
sta LDF72
2018-11-22 22:12:31 +00:00
ldy #0
ldx #0
LDF04: lda #0
2018-02-26 00:17:11 +00:00
sta LDF71
2018-11-22 22:12:31 +00:00
LDF09: cmp16 number, tens_table,x
2018-02-26 00:17:11 +00:00
bpl LDF45
lda LDF71
bne LDF25
bit LDF72
bmi LDF25
lda #$20
bne LDF38
LDF25: cmp #$0A
bcc LDF2F
clc
adc #$37
jmp LDF31
2018-11-21 19:05:39 +00:00
LDF2F: adc #'0'
2018-02-26 00:17:11 +00:00
LDF31: pha
lda #$80
sta LDF72
pla
2018-11-22 22:37:58 +00:00
LDF38: sta str_number+2,y
2018-02-26 00:17:11 +00:00
iny
inx
inx
cpx #$08
beq LDF5E
jmp LDF04
LDF45: inc LDF71
2018-11-22 22:12:31 +00:00
sub16 number, tens_table,x, number
2018-02-26 00:17:11 +00:00
jmp LDF09
2018-11-22 22:12:31 +00:00
LDF5E: lda number
2018-11-21 19:05:39 +00:00
ora #'0'
2018-11-22 22:37:58 +00:00
sta str_number+2,y
2018-02-26 00:17:11 +00:00
rts
2018-11-22 22:12:31 +00:00
tens_table:
.word 10000, 1000, 100, 10
number: .word 0
2018-03-29 04:05:12 +00:00
LDF71: .byte 0
LDF72: .byte 0
2018-11-22 22:12:31 +00:00
.endproc
;;; ============================================================
RAM_DISK_UNITNUM = $BF
.proc remove_ram_disk
;; Find Slot 3 Drive 2 RAM disk (unit number $BF)
ldx DEVCNT
: lda DEVLST,x
cmp #RAM_DISK_UNITNUM
beq remove
2018-02-26 00:17:11 +00:00
dex
2018-11-22 22:12:31 +00:00
bpl :-
2018-02-26 00:17:11 +00:00
rts
2018-11-22 22:12:31 +00:00
;; Remove it, shuffle everything else down.
remove:
lda DEVLST+1,x
2018-11-21 05:45:07 +00:00
sta DEVLST,x
cpx DEVCNT
2018-11-22 22:12:31 +00:00
beq :+
2018-02-26 00:17:11 +00:00
inx
2018-11-22 22:12:31 +00:00
jmp remove
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
: dec DEVCNT
2018-02-26 00:17:11 +00:00
rts
2018-11-22 22:12:31 +00:00
.endproc
;;; ============================================================
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
.proc restore_ram_disk
inc DEVCNT
2018-11-21 05:45:07 +00:00
ldx DEVCNT
2018-11-22 22:12:31 +00:00
lda #RAM_DISK_UNITNUM
2018-11-21 05:45:07 +00:00
sta DEVLST,x
2018-02-26 00:17:11 +00:00
rts
2018-11-22 22:12:31 +00:00
.endproc
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
;;; ============================================================
.proc open_dialog
MGTK_RELAY_CALL2 MGTK::OpenWindow, winfo_dialog
2018-03-31 04:11:36 +00:00
lda winfo_dialog::window_id
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-03-30 04:40:39 +00:00
MGTK_RELAY_CALL2 MGTK::SetPenMode, penXOR
2018-11-21 20:11:35 +00:00
MGTK_RELAY_CALL2 MGTK::FrameRect, rect_outer_frame
MGTK_RELAY_CALL2 MGTK::FrameRect, rect_inner_frame
2018-03-31 02:34:44 +00:00
MGTK_RELAY_CALL2 MGTK::InitPort, grafport
MGTK_RELAY_CALL2 MGTK::SetPort, grafport
2018-02-26 00:17:11 +00:00
rts
2018-11-22 22:12:31 +00:00
.endproc
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
.proc draw_dialog
lda winfo_dialog::window_id
jsr set_win_port
2018-03-30 04:40:39 +00:00
MGTK_RELAY_CALL2 MGTK::SetPenMode, pencopy
2018-11-21 16:49:09 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, rect_D211
MGTK_RELAY_CALL2 MGTK::PaintRect, rect_D219
2018-11-22 22:12:31 +00:00
lda quick_copy_flag
bne :+
addr_call draw_title_text, str_quick_copy_padded
jmp draw_buttons
: addr_call draw_title_text, str_disk_copy_padded
draw_buttons:
MGTK_RELAY_CALL2 MGTK::SetPenMode, penXOR
MGTK_RELAY_CALL2 MGTK::FrameRect, rect_ok_button
MGTK_RELAY_CALL2 MGTK::FrameRect, rect_read_drive
jsr draw_ok_label
jsr draw_read_drive_label
2018-11-21 20:11:35 +00:00
MGTK_RELAY_CALL2 MGTK::MoveTo, point_slot_drive_name
2018-03-31 23:50:58 +00:00
addr_call draw_text, str_slot_drive_name
2018-11-21 20:11:35 +00:00
MGTK_RELAY_CALL2 MGTK::MoveTo, point_select_source
2018-03-31 23:50:58 +00:00
addr_call draw_text, str_select_source
2018-11-21 20:11:35 +00:00
MGTK_RELAY_CALL2 MGTK::MoveTo, point_select_quit
2018-03-31 23:50:58 +00:00
addr_call draw_text, str_select_quit
2018-03-31 02:34:44 +00:00
MGTK_RELAY_CALL2 MGTK::InitPort, grafport
MGTK_RELAY_CALL2 MGTK::SetPort, grafport
2018-02-26 00:17:11 +00:00
rts
2018-11-22 22:12:31 +00:00
draw_ok_label:
MGTK_RELAY_CALL2 MGTK::MoveTo, point_ok_label
2018-03-31 23:50:58 +00:00
addr_call draw_text, str_ok_label
2018-02-26 00:17:11 +00:00
rts
2018-11-22 22:12:31 +00:00
draw_read_drive_label:
MGTK_RELAY_CALL2 MGTK::MoveTo, point_read_drive
2018-03-31 23:50:58 +00:00
addr_call draw_text, str_read_drive
2018-02-26 00:17:11 +00:00
rts
2018-11-22 22:12:31 +00:00
.endproc
;;; ============================================================
2018-03-31 23:50:58 +00:00
.proc draw_text
ptr := $0A
stax ptr
2018-02-26 00:17:11 +00:00
ldy #$00
2018-03-31 23:50:58 +00:00
lda (ptr),y
sta ptr+2
inc16 ptr
MGTK_RELAY_CALL2 MGTK::DrawText, ptr
2018-02-26 00:17:11 +00:00
rts
2018-03-31 23:50:58 +00:00
.endproc
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
;;; ============================================================
.proc draw_title_text
text_params := $06
text_addr := text_params + 0
text_length := text_params + 2
text_width := text_params + 3
stax text_addr
2018-02-26 00:17:11 +00:00
ldy #$00
2018-11-22 22:12:31 +00:00
lda (text_addr),y
sta text_length
inc16 text_addr
MGTK_RELAY_CALL2 MGTK::TextWidth, text_params
lsr16 text_width
2018-11-21 16:49:09 +00:00
lda #>500
2018-11-22 22:12:31 +00:00
sta width_hi
2018-11-21 16:49:09 +00:00
lda #<500
2018-11-22 22:12:31 +00:00
lsr width_hi
2018-02-26 00:17:11 +00:00
ror a
sec
2018-11-22 22:12:31 +00:00
sbc text_width
sta point_title
lda width_hi
sbc text_width+1
sta point_title+1
MGTK_RELAY_CALL2 MGTK::MoveTo, point_title
MGTK_RELAY_CALL2 MGTK::DrawText, text_params
2018-02-26 00:17:11 +00:00
rts
2018-11-22 22:12:31 +00:00
width_hi:
.byte 0
.endproc
;;; ============================================================
.proc adjust_case
ptr := $A
stx ptr+1
sta ptr
ldy #0
lda (ptr),y
2018-02-26 00:17:11 +00:00
tay
bne next
2018-02-26 00:17:11 +00:00
rts
next: dey
beq done
bpl :+
done: rts
2018-02-26 00:17:11 +00:00
: lda (ptr),y
and #CHAR_MASK ; convert to ASCII
2018-03-31 23:50:58 +00:00
cmp #'/'
beq skip
2018-03-31 23:50:58 +00:00
cmp #'.'
bne check_alpha
skip: dey
jmp next
2018-02-26 00:17:11 +00:00
check_alpha:
iny
lda (ptr),y
and #CHAR_MASK
2018-03-31 23:50:58 +00:00
cmp #'A'
bcc :+
2018-03-31 23:50:58 +00:00
cmp #'Z'+1
bcs :+
2018-02-26 00:17:11 +00:00
clc
adc #('a' - 'A') ; convert to lower case
sta (ptr),y
: dey
jmp next
.endproc
;;; ============================================================
2018-02-26 00:17:11 +00:00
2018-03-29 04:05:12 +00:00
.byte 0
2018-11-22 22:12:31 +00:00
;;; ============================================================
.proc set_win_port
sta getwinport_params::window_id
2018-03-31 04:11:36 +00:00
MGTK_RELAY_CALL2 MGTK::GetWinPort, getwinport_params
MGTK_RELAY_CALL2 MGTK::SetPort, grafport_win
2018-02-26 00:17:11 +00:00
rts
2018-11-22 22:12:31 +00:00
.endproc
;;; ============================================================
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
.proc highlight_row
asl a ; * 8
2018-02-26 00:17:11 +00:00
asl a
asl a
2018-11-21 18:46:14 +00:00
sta rect_D35B::y1
2018-02-26 00:17:11 +00:00
clc
2018-11-21 18:46:14 +00:00
adc #7
sta rect_D35B::y2
2018-03-30 04:40:39 +00:00
MGTK_RELAY_CALL2 MGTK::SetPenMode, penXOR
2018-11-21 18:46:14 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, rect_D35B
2018-02-26 00:17:11 +00:00
rts
2018-11-22 22:12:31 +00:00
.endproc
;;; ============================================================
2018-02-26 00:17:11 +00:00
LE16C: lda #$00
sta LD44E
2018-11-22 05:00:49 +00:00
sta disk_copy_overlay4::on_line_params2::unit_num
2018-11-21 23:29:24 +00:00
jsr disk_copy_overlay4::L1291
2018-02-26 00:17:11 +00:00
beq LE17A
2018-03-29 04:05:12 +00:00
.byte 0
2018-02-26 00:17:11 +00:00
LE17A: lda #$00
sta LE263
2018-11-23 00:20:54 +00:00
sta num_drives
2018-02-26 00:17:11 +00:00
LE182: lda #$13
sta $07
lda #$00
2018-03-31 02:34:44 +00:00
sta $06
2018-02-26 00:17:11 +00:00
sta LE264
lda LE263
asl a
rol LE264
asl a
rol LE264
asl a
rol LE264
asl a
rol LE264
clc
2018-03-31 02:34:44 +00:00
adc $06
sta $06
2018-02-26 00:17:11 +00:00
lda LE264
adc $07
sta $07
ldy #$00
2018-03-31 02:34:44 +00:00
lda ($06),y
2018-02-26 00:17:11 +00:00
and #$0F
bne LE20D
2018-03-31 02:34:44 +00:00
lda ($06),y
2018-02-26 00:17:11 +00:00
beq LE1CC
iny
2018-03-31 02:34:44 +00:00
lda ($06),y
2018-02-26 00:17:11 +00:00
cmp #$28
bne LE1CD
dey
2018-03-31 02:34:44 +00:00
lda ($06),y
2018-02-26 00:17:11 +00:00
jsr LE265
lda #$28
bcc LE1CD
jmp LE255
LE1CC: rts
LE1CD: pha
ldy #$00
2018-03-31 02:34:44 +00:00
lda ($06),y
2018-02-26 00:17:11 +00:00
jsr LE285
2018-11-23 00:20:54 +00:00
ldx num_drives
sta drive_unitnum_table,x
2018-02-26 00:17:11 +00:00
pla
cmp #$52
bne LE1EA
2018-11-23 00:20:54 +00:00
lda drive_unitnum_table,x
2018-02-26 00:17:11 +00:00
and #$F0
jsr LDDFC
beq LE207
2018-11-23 00:20:54 +00:00
LE1EA: lda num_drives
2018-02-26 00:17:11 +00:00
asl a
asl a
asl a
asl a
tay
ldx #$00
2018-03-29 15:38:20 +00:00
LE1F4: lda str_unknown,x
2018-02-26 00:17:11 +00:00
sta LD377,y
iny
inx
2018-03-29 15:38:20 +00:00
cpx str_unknown
2018-02-26 00:17:11 +00:00
bne LE1F4
2018-03-29 15:38:20 +00:00
lda str_unknown,x
2018-02-26 00:17:11 +00:00
sta LD377,y
2018-11-23 00:20:54 +00:00
LE207: inc num_drives
2018-02-26 00:17:11 +00:00
jmp LE255
2018-11-23 00:20:54 +00:00
LE20D: ldx num_drives
2018-02-26 00:17:11 +00:00
ldy #$00
2018-03-31 02:34:44 +00:00
lda ($06),y
2018-02-26 00:17:11 +00:00
and #$70
cmp #$30
bne LE21D
jmp LE255
LE21D: ldy #$00
2018-03-31 02:34:44 +00:00
lda ($06),y
2018-02-26 00:17:11 +00:00
jsr LE285
2018-11-23 00:20:54 +00:00
ldx num_drives
sta drive_unitnum_table,x
lda num_drives
2018-02-26 00:17:11 +00:00
asl a
asl a
asl a
asl a
tax
ldy #$00
2018-03-31 02:34:44 +00:00
lda ($06),y
2018-02-26 00:17:11 +00:00
and #$0F
sta LD377,x
sta LE264
LE23E: inx
iny
cpy LE264
beq LE24D
2018-03-31 02:34:44 +00:00
lda ($06),y
2018-02-26 00:17:11 +00:00
sta LD377,x
jmp LE23E
2018-03-31 02:34:44 +00:00
LE24D: lda ($06),y
2018-02-26 00:17:11 +00:00
sta LD377,x
2018-11-23 00:20:54 +00:00
inc num_drives
2018-02-26 00:17:11 +00:00
LE255: inc LE263
lda LE263
cmp #$08
beq LE262
jmp LE182
LE262: rts
2018-03-29 04:05:12 +00:00
LE263: .byte 0
LE264: .byte 0
2018-02-26 00:17:11 +00:00
LE265: and #$F0
sta LE28C
2018-11-21 05:45:07 +00:00
ldx DEVCNT
LE26D: lda DEVLST,x
2018-02-26 00:17:11 +00:00
and #$F0
cmp LE28C
beq LE27C
dex
bpl LE26D
LE27A: sec
rts
2018-11-21 05:45:07 +00:00
LE27C: lda DEVLST,x
2018-02-26 00:17:11 +00:00
and #$0F
bne LE27A
clc
rts
LE285: jsr LE265
2018-11-21 05:45:07 +00:00
lda DEVLST,x
2018-02-26 00:17:11 +00:00
rts
2018-03-29 04:05:12 +00:00
LE28C: .byte 0
2018-03-31 04:11:36 +00:00
LE28D: lda winfo_drive_select
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-02-26 00:17:11 +00:00
lda #$00
sta LE2B0
LE298: lda LE2B0
jsr LE39A
lda LE2B0
jsr LE31B
inc LE2B0
lda LE2B0
2018-11-23 00:20:54 +00:00
cmp num_drives
2018-02-26 00:17:11 +00:00
bne LE298
rts
2018-03-29 04:05:12 +00:00
LE2B0: .byte 0
2018-03-31 04:11:36 +00:00
LE2B1: lda winfo_drive_select
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-11-23 00:20:54 +00:00
lda current_drive_selection
2018-02-26 00:17:11 +00:00
asl a
tax
lda LD407,x
sta LE318
2018-11-21 16:49:09 +00:00
lda LD407+1,x
2018-11-23 00:20:54 +00:00
sta LE318+1
lda num_drives
2018-02-26 00:17:11 +00:00
sta LD376
lda #$00
2018-11-23 00:20:54 +00:00
sta num_drives
2018-02-26 00:17:11 +00:00
sta LE317
LE2D6: lda LE317
asl a
tax
lda LD407,x
cmp LE318
bne LE303
2018-11-21 16:49:09 +00:00
lda LD407+1,x
2018-11-23 00:20:54 +00:00
cmp LE318+1
2018-02-26 00:17:11 +00:00
bne LE303
lda LE317
2018-11-23 00:20:54 +00:00
ldx num_drives
2018-02-26 00:17:11 +00:00
sta LD3FF,x
2018-11-23 00:20:54 +00:00
lda num_drives
2018-02-26 00:17:11 +00:00
jsr LE39A
lda LE317
jsr LE31B
2018-11-23 00:20:54 +00:00
inc num_drives
2018-02-26 00:17:11 +00:00
LE303: inc LE317
lda LE317
cmp LD376
beq LE311
jmp LE2D6
LE311: lda #$FF
2018-11-23 00:20:54 +00:00
sta current_drive_selection
2018-02-26 00:17:11 +00:00
rts
2018-03-29 04:05:12 +00:00
LE317: .byte 0
2018-11-23 00:20:54 +00:00
LE318: .addr 0
2018-03-29 04:05:12 +00:00
.byte 0
2018-02-26 00:17:11 +00:00
LE31B: sta LE399
2018-11-21 18:46:14 +00:00
lda #8
sta point_D36D::xcoord
MGTK_RELAY_CALL2 MGTK::MoveTo, point_D36D
2018-02-26 00:17:11 +00:00
ldx LE399
2018-11-23 00:20:54 +00:00
lda drive_unitnum_table,x
2018-02-26 00:17:11 +00:00
and #$70
lsr a
lsr a
lsr a
lsr a
clc
2018-03-29 15:38:20 +00:00
adc #'0'
sta str_s + 1
2018-03-31 23:50:58 +00:00
addr_call draw_text, str_s
2018-11-21 18:46:14 +00:00
lda #40
sta point_D36D::xcoord
MGTK_RELAY_CALL2 MGTK::MoveTo, point_D36D
2018-02-26 00:17:11 +00:00
ldx LE399
2018-11-23 00:20:54 +00:00
lda drive_unitnum_table,x
2018-02-26 00:17:11 +00:00
and #$80
asl a
rol a
clc
2018-03-29 15:38:20 +00:00
adc #'1'
sta str_d + 1
2018-03-31 23:50:58 +00:00
addr_call draw_text, str_d
2018-11-21 18:46:14 +00:00
lda #65
sta point_D36D::xcoord
MGTK_RELAY_CALL2 MGTK::MoveTo, point_D36D
2018-02-26 00:17:11 +00:00
lda LE399
asl a
asl a
asl a
asl a
clc
adc #$77
2018-03-31 02:34:44 +00:00
sta $06
2018-02-26 00:17:11 +00:00
lda #$D3
adc #$00
sta $07
2018-03-31 02:34:44 +00:00
lda $06
2018-02-26 00:17:11 +00:00
ldx $07
jsr adjust_case
2018-03-31 02:34:44 +00:00
lda $06
2018-02-26 00:17:11 +00:00
ldx $07
2018-03-31 23:50:58 +00:00
jsr draw_text
2018-02-26 00:17:11 +00:00
rts
2018-03-29 04:05:12 +00:00
LE399: .byte 0
2018-02-26 00:17:11 +00:00
LE39A: asl a
asl a
asl a
2018-11-21 18:46:14 +00:00
adc #8
sta point_D36D::ycoord
2018-02-26 00:17:11 +00:00
rts
LE3A3: lda #$00
sta LE3B7
LE3A8: jsr LE3B8
inc LE3B7
lda LE3B7
2018-11-23 00:20:54 +00:00
cmp num_drives
2018-02-26 00:17:11 +00:00
bne LE3A8
rts
2018-03-29 04:05:12 +00:00
LE3B7: .byte 0
2018-02-26 00:17:11 +00:00
LE3B8: pha
tax
2018-11-23 00:20:54 +00:00
lda drive_unitnum_table,x
2018-02-26 00:17:11 +00:00
and #$0F
beq LE3CC
2018-11-23 00:20:54 +00:00
lda drive_unitnum_table,x
2018-02-26 00:17:11 +00:00
and #$F0
2018-12-06 03:35:04 +00:00
jsr disk_copy_overlay4::unit_number_to_driver_address
2018-02-26 00:17:11 +00:00
jmp LE3DA
LE3CC: pla
asl a
tax
lda #$18
sta LD407,x
lda #$01
2018-11-21 16:49:09 +00:00
sta LD407+1,x
2018-02-26 00:17:11 +00:00
rts
LE3DA: ldy #$07
2018-03-31 02:34:44 +00:00
lda ($06),y
2018-02-26 00:17:11 +00:00
bne LE3E3
jmp LE44A
LE3E3: lda #$00
sta LE448
ldy #$FC
2018-03-31 02:34:44 +00:00
lda ($06),y
2018-02-26 00:17:11 +00:00
sta LE449
beq LE3F6
lda #$80
sta LE448
LE3F6: ldy #$FD
2018-03-31 02:34:44 +00:00
lda ($06),y
2018-02-26 00:17:11 +00:00
tax
bne LE402
bit LE448
bpl LE415
LE402: stx LE448
pla
asl a
tax
lda LE448
sta LD407,x
lda LE449
2018-11-21 16:49:09 +00:00
sta LD407+1,x
2018-02-26 00:17:11 +00:00
rts
2018-12-06 03:35:04 +00:00
LE415: ldy #$FF ; offset to low byte of driver address
2018-03-31 02:34:44 +00:00
lda ($06),y
sta $06
2018-12-06 03:35:04 +00:00
2018-02-26 00:17:11 +00:00
lda #$00
2018-12-06 03:35:04 +00:00
sta DRIVER_COMMAND
sta DRIVER_BUFFER
sta DRIVER_BUFFER+1
sta DRIVER_BLOCK_NUMBER
sta DRIVER_BLOCK_NUMBER+1
2018-02-26 00:17:11 +00:00
pla
pha
tax
2018-11-23 00:20:54 +00:00
lda drive_unitnum_table,x
2018-02-26 00:17:11 +00:00
and #$F0
2018-12-06 03:35:04 +00:00
sta DRIVER_UNIT_NUMBER
2018-02-26 00:17:11 +00:00
jsr LE445
stx LE448
pla
asl a
tax
lda LE448
sta LD407,x
tya
2018-11-21 16:49:09 +00:00
sta LD407+1,x
2018-02-26 00:17:11 +00:00
rts
2018-03-31 02:34:44 +00:00
LE445: jmp ($06)
2018-02-26 00:17:11 +00:00
2018-03-29 04:05:12 +00:00
LE448: .byte 0
LE449: .byte 0
2018-02-26 00:17:11 +00:00
LE44A: ldy #$FF
2018-03-31 02:34:44 +00:00
lda ($06),y
2018-02-26 00:17:11 +00:00
clc
adc #$03
2018-03-31 02:34:44 +00:00
sta $06
2018-02-26 00:17:11 +00:00
pla
pha
tax
2018-11-23 00:20:54 +00:00
lda drive_unitnum_table,x
2018-02-26 00:17:11 +00:00
and #$F0
2018-11-21 23:29:24 +00:00
jsr disk_copy_overlay4::L0D51
2018-02-26 00:17:11 +00:00
sta LE47D
2018-11-21 18:46:14 +00:00
jsr indirect_jump
2018-03-29 04:05:12 +00:00
.byte 0
2018-02-26 00:17:11 +00:00
.byte $7C
cpx $68
asl a
tax
lda LE482
sta LD407,x
lda LE483
2018-11-21 16:49:09 +00:00
sta LD407+1,x
2018-02-26 00:17:11 +00:00
rts
2018-11-21 18:46:14 +00:00
indirect_jump:
jmp ($06)
2018-02-26 00:17:11 +00:00
2018-11-21 18:46:14 +00:00
;; TODO: Identify data
2018-03-29 04:05:12 +00:00
.byte 0
.byte 0
2018-02-26 00:17:11 +00:00
.byte $03
2018-11-21 18:46:14 +00:00
LE47D: .byte 1, $81
.byte $E4, 0
2018-03-29 04:05:12 +00:00
.byte 0
LE482: .byte 0
LE483: .byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
2018-11-21 18:46:14 +00:00
2018-03-31 04:11:36 +00:00
LE491: lda winfo_dialog::window_id
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-11-21 20:11:35 +00:00
MGTK_RELAY_CALL2 MGTK::MoveTo, point_writing
2018-03-31 23:50:58 +00:00
addr_call draw_text, str_writing
2018-02-26 00:17:11 +00:00
rts
2018-03-31 04:11:36 +00:00
LE4A8: lda winfo_dialog::window_id
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-11-21 20:11:35 +00:00
MGTK_RELAY_CALL2 MGTK::MoveTo, point_reading
2018-03-31 23:50:58 +00:00
addr_call draw_text, str_reading
2018-02-26 00:17:11 +00:00
rts
2018-03-31 04:11:36 +00:00
LE4BF: lda winfo_dialog::window_id
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-11-23 00:20:54 +00:00
lda source_drive_index
2018-02-26 00:17:11 +00:00
asl a
tay
2018-11-21 16:49:09 +00:00
lda LD407+1,y
2018-02-26 00:17:11 +00:00
tax
lda LD407,y
2018-11-22 22:12:31 +00:00
jsr number_to_string
2018-11-21 20:11:35 +00:00
MGTK_RELAY_CALL2 MGTK::MoveTo, point_source
2018-03-31 23:50:58 +00:00
addr_call draw_text, str_blocks_to_transfer
2018-11-22 22:37:58 +00:00
addr_call draw_text, str_number
2018-02-26 00:17:11 +00:00
rts
LE4EC: jsr LE522
2018-11-21 20:11:35 +00:00
MGTK_RELAY_CALL2 MGTK::MoveTo, point_blocks_read
2018-03-31 23:50:58 +00:00
addr_call draw_text, str_blocks_read
2018-11-23 00:20:54 +00:00
addr_call draw_text, str_number
2018-02-26 00:17:11 +00:00
rts
LE507: jsr LE522
2018-11-21 20:11:35 +00:00
MGTK_RELAY_CALL2 MGTK::MoveTo, point_blocks_written
2018-03-31 23:50:58 +00:00
addr_call draw_text, str_blocks_written
2018-11-22 22:37:58 +00:00
addr_call draw_text, str_number
2018-02-26 00:17:11 +00:00
rts
2018-03-31 04:11:36 +00:00
LE522: lda winfo_dialog::window_id
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-11-22 05:00:49 +00:00
lda LD421+1
2018-02-26 00:17:11 +00:00
sta LE558
lda LD421
asl a
rol LE558
asl a
rol LE558
asl a
rol LE558
ldx LD423
clc
adc LE550,x
tay
lda LE558
adc #$00
tax
tya
2018-11-22 22:12:31 +00:00
jsr number_to_string
2018-02-26 00:17:11 +00:00
rts
LE550: .byte 7,6,5,4,3,2,1,0
2018-03-29 04:05:12 +00:00
LE558: .byte 0
2018-03-31 04:11:36 +00:00
LE559: lda winfo_dialog::window_id
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-11-21 20:11:35 +00:00
MGTK_RELAY_CALL2 MGTK::MoveTo, point_source2
2018-03-31 23:50:58 +00:00
addr_call draw_text, str_source
2018-11-23 00:20:54 +00:00
ldx source_drive_index
lda drive_unitnum_table,x
2018-02-26 00:17:11 +00:00
and #$70
lsr a
lsr a
lsr a
lsr a
clc
2018-03-29 15:38:20 +00:00
adc #'0'
sta str_s + 1
2018-11-23 00:20:54 +00:00
ldx source_drive_index
lda drive_unitnum_table,x
2018-02-26 00:17:11 +00:00
and #$80
clc
rol a
rol a
clc
2018-03-29 15:38:20 +00:00
adc #'1'
sta str_d + 1
2018-11-21 20:11:35 +00:00
MGTK_RELAY_CALL2 MGTK::MoveTo, point_slot_drive
2018-03-31 23:50:58 +00:00
addr_call draw_text, str_slot
addr_call draw_text, str_s
addr_call draw_text, str_drive
addr_call draw_text, str_d
2018-02-26 00:17:11 +00:00
bit LD44D
bpl LE5C6
bvc LE5C5
lda LD44D
and #$0F
beq LE5C6
LE5C5: rts
2018-03-31 23:50:58 +00:00
LE5C6: addr_call draw_text, str_2_spaces
2018-02-26 00:17:11 +00:00
ldx $1300
LE5D0: lda $1300,x
sta LD43A,x
dex
bpl LE5D0
2018-03-31 23:50:58 +00:00
addr_call draw_text, LD43A
2018-02-26 00:17:11 +00:00
rts
2018-03-31 04:11:36 +00:00
LE5E1: lda winfo_dialog::window_id
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-11-21 20:11:35 +00:00
MGTK_RELAY_CALL2 MGTK::MoveTo, point_destination
2018-03-31 23:50:58 +00:00
addr_call draw_text, str_destination
2018-11-23 00:20:54 +00:00
ldx dest_drive_index
lda drive_unitnum_table,x
2018-02-26 00:17:11 +00:00
and #$70
lsr a
lsr a
lsr a
lsr a
clc
2018-03-29 15:38:20 +00:00
adc #'0'
sta str_s + 1
2018-11-23 00:20:54 +00:00
ldx dest_drive_index
lda drive_unitnum_table,x
2018-02-26 00:17:11 +00:00
and #$80
asl a
rol a
clc
2018-03-29 15:38:20 +00:00
adc #'1'
sta str_d + 1
2018-11-21 20:11:35 +00:00
MGTK_RELAY_CALL2 MGTK::MoveTo, point_slot_drive2
2018-03-31 23:50:58 +00:00
addr_call draw_text, str_slot
addr_call draw_text, str_s
addr_call draw_text, str_drive
addr_call draw_text, str_d
2018-02-26 00:17:11 +00:00
rts
2018-03-31 04:11:36 +00:00
LE63F: lda winfo_dialog::window_id
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-11-21 20:11:35 +00:00
MGTK_RELAY_CALL2 MGTK::MoveTo, point_disk_copy
2018-02-26 00:17:11 +00:00
bit LD44D
bmi LE65B
2018-03-31 23:50:58 +00:00
addr_call draw_text, str_prodos_disk_copy
2018-02-26 00:17:11 +00:00
rts
LE65B: bvs LE665
2018-03-31 23:50:58 +00:00
addr_call draw_text, str_dos33_disk_copy
2018-02-26 00:17:11 +00:00
rts
LE665: lda LD44D
and #$0F
bne LE673
2018-03-31 23:50:58 +00:00
addr_call draw_text, str_pascal_disk_copy
2018-02-26 00:17:11 +00:00
LE673: rts
LE674: lda LD44D
cmp #$C0
beq LE693
2018-03-31 04:11:36 +00:00
lda winfo_dialog::window_id
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-03-30 04:40:39 +00:00
MGTK_RELAY_CALL2 MGTK::SetPenMode, pencopy
2018-11-21 18:46:14 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, rect_D483
2018-02-26 00:17:11 +00:00
LE693: rts
2018-03-31 04:11:36 +00:00
LE694: lda winfo_dialog::window_id
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-11-21 20:11:35 +00:00
MGTK_RELAY_CALL2 MGTK::MoveTo, point_escape_stop_copy
2018-03-31 23:50:58 +00:00
addr_call draw_text, str_escape_stop_copy
2018-02-26 00:17:11 +00:00
rts
2018-11-20 07:21:36 +00:00
LE6AB: lda winfo_dialog::window_id
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-03-29 04:05:12 +00:00
copy16 #$800A, LE6FB
2018-02-26 00:17:11 +00:00
LE6BB: dec LE6FB
beq LE6F1
lda LE6FC
eor #$80
sta LE6FC
beq LE6D5
2018-11-21 18:46:14 +00:00
MGTK_RELAY_CALL2 MGTK::SetTextBG, bg_white
2018-02-26 00:17:11 +00:00
beq LE6DE
2018-11-21 18:46:14 +00:00
LE6D5: MGTK_RELAY_CALL2 MGTK::SetTextBG, bg_black
2018-11-21 20:11:35 +00:00
LE6DE: MGTK_RELAY_CALL2 MGTK::MoveTo, point_escape_stop_copy
2018-03-31 23:50:58 +00:00
addr_call draw_text, str_escape_stop_copy
2018-02-26 00:17:11 +00:00
jmp LE6BB
2018-11-21 18:46:14 +00:00
LE6F1: MGTK_RELAY_CALL2 MGTK::SetTextBG, bg_white
2018-02-26 00:17:11 +00:00
rts
2018-03-29 04:05:12 +00:00
LE6FB: .byte 0
LE6FC: .byte 0
2018-02-26 00:17:11 +00:00
LE6FD: stx LE765
2018-11-20 07:21:36 +00:00
2018-11-21 05:44:33 +00:00
cmp #$2B
2018-02-26 00:17:11 +00:00
bne LE71A
2018-11-21 23:29:24 +00:00
jsr disk_copy_overlay4::L127E
2018-11-22 22:27:03 +00:00
lda #5 ; Destination protected
jsr show_alert_dialog
2018-02-26 00:17:11 +00:00
bne LE714
jsr LE491
2018-03-29 04:05:12 +00:00
return #$01
2018-02-26 00:17:11 +00:00
2018-11-21 23:29:24 +00:00
LE714: jsr disk_copy_overlay4::L10FB
2018-03-29 04:05:12 +00:00
return #$80
2018-02-26 00:17:11 +00:00
2018-11-21 23:29:24 +00:00
LE71A: jsr disk_copy_overlay4::L127E
2018-03-31 04:11:36 +00:00
lda winfo_dialog::window_id
2018-11-22 22:12:31 +00:00
jsr set_win_port
2018-11-22 05:00:49 +00:00
lda disk_copy_overlay4::block_params::block_num
ldx disk_copy_overlay4::block_params::block_num+1
2018-11-22 22:12:31 +00:00
jsr number_to_string
2018-02-26 00:17:11 +00:00
lda LE765
bne LE74B
2018-11-21 20:11:35 +00:00
MGTK_RELAY_CALL2 MGTK::MoveTo, point_error_reading
2018-03-31 23:50:58 +00:00
addr_call draw_text, str_error_reading
2018-11-22 22:37:58 +00:00
addr_call draw_text, str_number
2018-03-29 04:05:12 +00:00
return #$00
2018-02-26 00:17:11 +00:00
2018-11-21 20:11:35 +00:00
LE74B: MGTK_RELAY_CALL2 MGTK::MoveTo, point_error_writing
2018-03-31 23:50:58 +00:00
addr_call draw_text, str_error_writing
2018-11-22 22:37:58 +00:00
addr_call draw_text, str_number
2018-03-29 04:05:12 +00:00
return #$00
2018-02-26 00:17:11 +00:00
2018-03-29 04:05:12 +00:00
LE765: .byte 0
2018-11-21 05:44:33 +00:00
LE766: sta $06
2018-02-26 00:17:11 +00:00
sta $08
stx $07
stx $09
inc $09
2018-11-22 05:00:49 +00:00
copy16 #$1C00, disk_copy_overlay4::block_params::data_buffer
2018-11-21 23:29:24 +00:00
LE77A: jsr disk_copy_overlay4::L12AF
2018-02-26 00:17:11 +00:00
beq LE789
ldx #$00
jsr LE6FD
beq LE789
bpl LE77A
rts
LE789: sta RAMRDOFF
sta RAMWRTON
ldy #$FF
iny
LE792: lda $1C00,y
2018-03-31 02:34:44 +00:00
sta ($06),y
2018-02-26 00:17:11 +00:00
lda $1D00,y
sta ($08),y
iny
bne LE792
sta RAMRDOFF
sta RAMWRTOFF
lda #$00
2018-03-29 04:05:12 +00:00
rts
2018-02-26 00:17:11 +00:00
2018-11-20 07:21:36 +00:00
LE7A8: sta $06
2018-02-26 00:17:11 +00:00
sta $08
stx $07
stx $09
inc $09
2018-11-22 05:00:49 +00:00
copy16 #$1C00, disk_copy_overlay4::block_params::data_buffer
2018-02-26 00:17:11 +00:00
.byte $8D
.byte $03
2018-03-29 04:05:12 +00:00
cpy #$8D
2018-02-26 00:17:11 +00:00
.byte $04
cpy #$A0
.byte $FF
iny
2018-03-31 02:34:44 +00:00
LE7C5: lda ($06),y
2018-02-26 00:17:11 +00:00
sta $1C00,y
lda ($08),y
sta $1D00,y
iny
bne LE7C5
sta RAMRDOFF
sta RAMWRTOFF
2018-11-21 23:29:24 +00:00
LE7D8: jsr disk_copy_overlay4::L12A5
2018-02-26 00:17:11 +00:00
beq LE7E6
ldx #$80
jsr LE6FD
beq LE7E6
bpl LE7D8
LE7E6: rts
2018-11-22 22:37:58 +00:00
;;; ============================================================
2018-11-22 22:27:03 +00:00
.proc alert_dialog
2018-11-21 19:05:39 +00:00
alert_bitmap:
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000)
2018-11-21 08:13:30 +00:00
.byte px(%0111111),px(%1111100),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0111111),px(%1111100),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0111111),px(%1111100),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0111111),px(%1111100),px(%0000000),px(%1111111),px(%1111111),px(%0000000),px(%0000000)
.byte px(%0111100),px(%1111100),px(%0000001),px(%1110000),px(%0000111),px(%0000000),px(%0000000)
2018-11-21 19:05:39 +00:00
.byte px(%0111100),px(%1111100),px(%0000011),px(%1100000),px(%0000011),px(%0000000),px(%0000000)
2018-11-21 08:13:30 +00:00
.byte px(%0111111),px(%1111100),px(%0000111),px(%1100111),px(%1111001),px(%0000000),px(%0000000)
.byte px(%0111111),px(%1111100),px(%0001111),px(%1100111),px(%1111001),px(%0000000),px(%0000000)
.byte px(%0111111),px(%1111100),px(%0011111),px(%1111111),px(%1111001),px(%0000000),px(%0000000)
.byte px(%0111111),px(%1111100),px(%0011111),px(%1111111),px(%1110011),px(%0000000),px(%0000000)
.byte px(%0111111),px(%1111100),px(%0011111),px(%1111111),px(%1100111),px(%0000000),px(%0000000)
.byte px(%0111111),px(%1111100),px(%0011111),px(%1111111),px(%1001111),px(%0000000),px(%0000000)
.byte px(%0111111),px(%1111100),px(%0011111),px(%1111111),px(%0011111),px(%0000000),px(%0000000)
.byte px(%0111111),px(%1111100),px(%0011111),px(%1111110),px(%0111111),px(%0000000),px(%0000000)
.byte px(%0111111),px(%1111100),px(%0011111),px(%1111100),px(%1111111),px(%0000000),px(%0000000)
.byte px(%0111111),px(%1111100),px(%0011111),px(%1111100),px(%1111111),px(%0000000),px(%0000000)
.byte px(%0111110),px(%0000000),px(%0111111),px(%1111111),px(%1111111),px(%0000000),px(%0000000)
.byte px(%0111111),px(%1100000),px(%1111111),px(%1111100),px(%1111111),px(%0000000),px(%0000000)
.byte px(%0111111),px(%1100001),px(%1111111),px(%1111111),px(%1111111),px(%0000000),px(%0000000)
.byte px(%0111000),px(%0000011),px(%1111111),px(%1111111),px(%1111110),px(%0000000),px(%0000000)
.byte px(%0111111),px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0111111),px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000)
2018-11-21 19:05:39 +00:00
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.proc alert_bitmap_mapinfo
viewloc: DEFINE_POINT 20, 8
mapbits: .addr alert_bitmap
mapwidth: .byte 7
2018-11-21 18:46:14 +00:00
reserved: .byte 0
2018-11-21 19:05:39 +00:00
maprect: DEFINE_RECT 0, 0, 36, 23
2018-11-21 18:46:14 +00:00
.endproc
rect_E89F: DEFINE_RECT 65, 45, 485, 100
rect_E8A7: DEFINE_RECT 4, 2, 416, 53
rect_E8AF: DEFINE_RECT 5, 3, 415, 52
2018-03-31 04:50:29 +00:00
.proc portbits1
viewloc: DEFINE_POINT 65, 45, viewloc
mapbits: .addr MGTK::screen_mapbits
mapwidth: .byte MGTK::screen_mapwidth
reserved: .byte 0
maprect: DEFINE_RECT 0, 0, 420, 55
.endproc
.proc portbits2
viewloc: DEFINE_POINT 0, 0
mapbits: .addr MGTK::screen_mapbits
mapwidth: .byte MGTK::screen_mapwidth
reserved: .byte 0
2018-11-21 19:05:39 +00:00
maprect: DEFINE_RECT 0, 0, 559, 191
2018-03-31 04:50:29 +00:00
.endproc
2018-03-31 04:11:36 +00:00
str_ok_btn:
PASCAL_STRING {"OK ",GLYPH_RETURN}
str_cancel_btn:
PASCAL_STRING "Cancel Esc"
str_try_again_btn:
PASCAL_STRING "Try Again A"
str_yes_btn:
PASCAL_STRING "Yes"
str_no_btn:
PASCAL_STRING "No"
2018-03-31 23:50:58 +00:00
yes_rect: DEFINE_RECT 250, 37, 300, 48
yes_pos: DEFINE_POINT 255, 47
2018-03-31 04:11:36 +00:00
2018-03-31 23:50:58 +00:00
no_rect: DEFINE_RECT 350, 37, 400, 48
no_pos: DEFINE_POINT 355, 47
2018-03-31 04:11:36 +00:00
2018-03-31 23:50:58 +00:00
ok_try_again_rect: DEFINE_RECT 300, 37, 400, 48
ok_try_again_pos: DEFINE_POINT 305, 47
2018-03-31 04:11:36 +00:00
2018-03-31 23:50:58 +00:00
cancel_rect: DEFINE_RECT 20, 37, 120, 48
cancel_pos: DEFINE_POINT 25, 47
2018-03-31 04:11:36 +00:00
LE93D: DEFINE_POINT 100, 24
2018-11-22 22:12:31 +00:00
message_flags:
.byte 0
2018-11-21 20:11:35 +00:00
LE942: .addr 0
str_insert_source:
PASCAL_STRING "Insert source disk and click OK."
str_insert_dest:
PASCAL_STRING "Insert destination disk and click OK."
2018-11-22 22:12:31 +00:00
2018-11-21 20:11:35 +00:00
str_confirm_erase0:
PASCAL_STRING "Do you want to erase "
2018-11-22 22:12:31 +00:00
str_confirm_erase0_buf: .res 18, 0
2018-11-21 20:11:35 +00:00
str_dest_format_fail:
PASCAL_STRING "The destination disk cannot be formated !"
str_format_error:
PASCAL_STRING "Error during formating."
str_dest_protected:
PASCAL_STRING "The destination volume is write protected !"
2018-11-22 22:12:31 +00:00
2018-11-21 20:11:35 +00:00
str_confirm_erase1:
PASCAL_STRING "Do you want to erase "
2018-11-22 22:12:31 +00:00
str_confirm_erase1_buf: .res 18, 0
2018-11-21 20:11:35 +00:00
str_confirm_erase2:
PASCAL_STRING "Do you want to erase the disk in slot drive ?"
str_confirm_erase3:
PASCAL_STRING "Do you want to erase the disk in slot drive ?"
str_copy_success:
PASCAL_STRING "The copy was successful."
str_copy_fail:
PASCAL_STRING "The copy was not completed."
str_insert_source_or_cancel:
PASCAL_STRING "Insert source disk or press Escape to cancel."
str_insert_dest_or_cancel:
PASCAL_STRING "Insert destination disk or press Escape to cancel."
char_space:
.byte ' '
char_question_mark:
.byte '?'
slot_char_str_confirm_erase2: .byte 41
drive_char_str_confirm_erase2: .byte 49
slot_char_str_confirm_erase3: .byte 39
drive_char_str_confirm_erase3: .byte 47
len_confirm_erase0: .byte 23
len_confirm_erase1: .byte 21
2018-11-21 19:05:39 +00:00
2018-11-22 22:12:31 +00:00
message_index_table:
.byte 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
message_table:
.addr str_insert_source
.addr str_insert_dest
.addr str_confirm_erase0
.addr str_dest_format_fail
.addr str_format_error
.addr str_dest_protected
.addr str_confirm_erase1
.addr str_confirm_erase2
.addr str_confirm_erase3
.addr str_copy_success
.addr str_copy_fail
.addr str_insert_source_or_cancel
2018-11-21 20:11:35 +00:00
.addr str_insert_dest_or_cancel
2018-11-21 19:05:39 +00:00
2018-11-22 22:12:31 +00:00
;; $C0 (%11xxxxxx) = Cancel + Ok
;; $81 (%10xxxxx1) = Cancel + Yes + No
;; $80 (%10xx0000) = Cancel + Try Again
;; $00 (%0xxxxxxx) = Ok
.enum MessageFlags
OkCancel = $C0
YesNoCancel = $81
TryAgainCancel = $80
Ok = $00
.endenum
message_flags_table:
.byte MessageFlags::OkCancel
.byte MessageFlags::OkCancel
.byte MessageFlags::YesNoCancel
.byte MessageFlags::Ok
.byte MessageFlags::TryAgainCancel
.byte MessageFlags::TryAgainCancel
.byte MessageFlags::YesNoCancel
.byte MessageFlags::YesNoCancel
.byte MessageFlags::YesNoCancel
.byte MessageFlags::Ok
.byte MessageFlags::Ok
.byte MessageFlags::Ok
.byte MessageFlags::Ok
2018-11-21 19:05:39 +00:00
LEB81: .addr 0
2018-03-29 04:05:12 +00:00
LEB83: .byte 0
2018-11-21 19:05:39 +00:00
2018-11-22 22:27:03 +00:00
show_alert_dialog:
stax LEB81
2018-02-26 00:17:11 +00:00
sty LEB83
2018-03-31 02:34:44 +00:00
MGTK_RELAY_CALL2 MGTK::InitPort, grafport
MGTK_RELAY_CALL2 MGTK::SetPort, grafport
2018-03-30 04:40:39 +00:00
MGTK_RELAY_CALL2 MGTK::SetPenMode, pencopy
2018-11-21 18:46:14 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, rect_E89F
2018-11-22 22:12:31 +00:00
jsr set_pen_xor
2018-11-21 18:46:14 +00:00
MGTK_RELAY_CALL2 MGTK::FrameRect, rect_E89F
2018-03-31 04:50:29 +00:00
MGTK_RELAY_CALL2 MGTK::SetPortBits, portbits1
2018-11-21 18:46:14 +00:00
MGTK_RELAY_CALL2 MGTK::FrameRect, rect_E8A7
MGTK_RELAY_CALL2 MGTK::FrameRect, rect_E8AF
2018-03-30 04:40:39 +00:00
MGTK_RELAY_CALL2 MGTK::SetPenMode, pencopy
MGTK_RELAY_CALL2 MGTK::HideCursor
2018-11-21 19:05:39 +00:00
MGTK_RELAY_CALL2 MGTK::PaintBits, alert_bitmap_mapinfo
2018-03-30 04:40:39 +00:00
MGTK_RELAY_CALL2 MGTK::ShowCursor
2018-02-26 00:17:11 +00:00
lda #$00
sta LD41E
lda LEB81
jsr LF1CC
ldy LEB83
2018-11-21 19:05:39 +00:00
ldx LEB81+1
2018-02-26 00:17:11 +00:00
lda LEB81
bne LEC1F
cpx #$00
beq LEC5E
jsr LF185
beq LEC5E
lda #$0B
bne LEC5E
LEC1F: cmp #$01
bne LEC34
cpx #$00
beq LEC5E
jsr LF185
beq LEC30
lda #$0C
bne LEC5E
LEC30: lda #$01
bne LEC5E
LEC34: cmp #$02
bne LEC3F
2018-11-22 22:12:31 +00:00
jsr append_to_confirm_erase0
2018-02-26 00:17:11 +00:00
lda #$02
bne LEC5E
LEC3F: cmp #$06
2018-03-29 04:05:12 +00:00
bne :+
2018-11-22 22:12:31 +00:00
jsr append_to_confirm_erase1
2018-02-26 00:17:11 +00:00
lda #$06
bne LEC5E
2018-03-29 04:05:12 +00:00
: cmp #$07
2018-02-26 00:17:11 +00:00
bne LEC55
2018-11-22 22:12:31 +00:00
jsr set_confirm_erase2_slot_drive
2018-02-26 00:17:11 +00:00
lda #$07
bne LEC5E
LEC55: cmp #$08
bne LEC5E
2018-11-22 22:12:31 +00:00
jsr set_confirm_erase3_slot_drive
2018-02-26 00:17:11 +00:00
lda #$08
LEC5E: ldy #$00
2018-11-22 22:12:31 +00:00
LEC60: cmp message_index_table,y
2018-02-26 00:17:11 +00:00
beq LEC6C
iny
cpy #$1E
bne LEC60
ldy #$00
LEC6C: tya
asl a
tay
2018-11-22 22:12:31 +00:00
lda message_table,y
2018-02-26 00:17:11 +00:00
sta LE942
2018-11-22 22:12:31 +00:00
lda message_table+1,y
2018-11-21 20:11:35 +00:00
sta LE942+1
2018-02-26 00:17:11 +00:00
tya
lsr a
tay
2018-11-22 22:12:31 +00:00
lda message_flags_table,y
sta message_flags
2018-02-26 00:17:11 +00:00
bit LD41E
bpl LEC8C
jmp LED23
2018-11-22 22:12:31 +00:00
LEC8C: jsr set_pen_xor
bit message_flags
2018-03-31 23:50:58 +00:00
bpl draw_ok_btn
MGTK_RELAY_CALL2 MGTK::FrameRect, cancel_rect
MGTK_RELAY_CALL2 MGTK::MoveTo, cancel_pos
addr_call draw_text, str_cancel_btn
2018-11-22 22:12:31 +00:00
bit message_flags
2018-03-31 23:50:58 +00:00
bvs draw_ok_btn
2018-11-22 22:12:31 +00:00
lda message_flags
2018-02-26 00:17:11 +00:00
and #$0F
2018-03-31 23:50:58 +00:00
beq draw_try_again_btn
MGTK_RELAY_CALL2 MGTK::FrameRect, yes_rect
MGTK_RELAY_CALL2 MGTK::MoveTo, yes_pos
addr_call draw_text, str_yes_btn
MGTK_RELAY_CALL2 MGTK::FrameRect, no_rect
MGTK_RELAY_CALL2 MGTK::MoveTo, no_pos
addr_call draw_text, str_no_btn
2018-02-26 00:17:11 +00:00
jmp LED23
2018-03-31 23:50:58 +00:00
draw_try_again_btn:
MGTK_RELAY_CALL2 MGTK::FrameRect, ok_try_again_rect
MGTK_RELAY_CALL2 MGTK::MoveTo, ok_try_again_pos
addr_call draw_text, str_try_again_btn
2018-02-26 00:17:11 +00:00
jmp LED23
2018-03-31 23:50:58 +00:00
draw_ok_btn:
MGTK_RELAY_CALL2 MGTK::FrameRect, ok_try_again_rect
MGTK_RELAY_CALL2 MGTK::MoveTo, ok_try_again_pos
addr_call draw_text, str_ok_btn
2018-03-31 04:11:36 +00:00
LED23: MGTK_RELAY_CALL2 MGTK::MoveTo, LE93D
2018-03-31 23:50:58 +00:00
addr_call_indirect draw_text, LE942
2018-11-22 22:12:31 +00:00
;; fall through
;;; ============================================================
input_loop:
bit LD41E
2018-11-21 20:11:35 +00:00
bpl LED45
2018-02-26 00:17:11 +00:00
jsr LF192
bne LED42
jmp LEDF2
LED42: jmp LED79
2018-11-21 20:11:35 +00:00
LED45: MGTK_RELAY_CALL2 MGTK::GetEvent, event_params
2018-03-31 02:34:44 +00:00
lda event_kind
2018-11-18 04:34:17 +00:00
cmp #MGTK::EventKind::button_down
2018-02-26 00:17:11 +00:00
bne LED58
2018-11-22 22:12:31 +00:00
jmp handle_button_down
2018-02-26 00:17:11 +00:00
2018-11-18 04:34:17 +00:00
LED58: cmp #MGTK::EventKind::key_down
2018-11-22 22:12:31 +00:00
bne input_loop
2018-03-31 02:34:44 +00:00
lda event_key
and #CHAR_MASK
2018-11-22 22:12:31 +00:00
bit message_flags
bmi :+
2018-02-26 00:17:11 +00:00
jmp LEDE2
2018-11-22 22:12:31 +00:00
: cmp #CHAR_ESCAPE
bne :+
jsr set_pen_xor
2018-03-31 23:50:58 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, cancel_rect
2018-11-22 22:13:21 +00:00
LED79: lda #1
jmp clear_and_return_value
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
: bit message_flags
2018-02-26 00:17:11 +00:00
bvs LEDE2
pha
2018-11-22 22:12:31 +00:00
lda message_flags
2018-02-26 00:17:11 +00:00
and #$0F
beq LEDC1
pla
2018-03-31 23:50:58 +00:00
cmp #'N'
2018-11-22 22:12:31 +00:00
beq do_no
2018-03-31 23:50:58 +00:00
cmp #'n'
2018-11-22 22:12:31 +00:00
beq do_no
2018-03-31 23:50:58 +00:00
cmp #'Y'
2018-11-22 22:12:31 +00:00
beq do_yes
2018-03-31 23:50:58 +00:00
cmp #'y'
2018-11-22 22:12:31 +00:00
beq do_yes
jmp input_loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
do_no: jsr set_pen_xor
2018-03-31 23:50:58 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, no_rect
2018-11-22 22:13:21 +00:00
lda #3
jmp clear_and_return_value
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
do_yes: jsr set_pen_xor
2018-03-31 23:50:58 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, yes_rect
2018-11-22 22:13:21 +00:00
lda #2
jmp clear_and_return_value
2018-02-26 00:17:11 +00:00
LEDC1: pla
2018-11-22 22:12:31 +00:00
cmp #'a'
2018-02-26 00:17:11 +00:00
bne LEDD7
2018-11-22 22:12:31 +00:00
LEDC6: jsr set_pen_xor
2018-03-31 23:50:58 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, ok_try_again_rect
2018-11-22 22:13:21 +00:00
lda #0
jmp clear_and_return_value
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
LEDD7: cmp #'A'
2018-02-26 00:17:11 +00:00
beq LEDC6
2018-11-22 22:12:31 +00:00
cmp #CHAR_RETURN
2018-02-26 00:17:11 +00:00
beq LEDC6
2018-11-22 22:12:31 +00:00
jmp input_loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
LEDE2: cmp #CHAR_RETURN
2018-02-26 00:17:11 +00:00
bne LEDF7
2018-11-22 22:12:31 +00:00
jsr set_pen_xor
2018-03-31 23:50:58 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, ok_try_again_rect
2018-11-22 22:13:21 +00:00
LEDF2: lda #0
jmp clear_and_return_value
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
LEDF7: jmp input_loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
handle_button_down:
jsr map_event_coords
2018-03-31 02:34:44 +00:00
MGTK_RELAY_CALL2 MGTK::MoveTo, event_coords
2018-11-22 22:12:31 +00:00
bit message_flags
2018-02-26 00:17:11 +00:00
bpl LEE57
2018-03-31 23:50:58 +00:00
MGTK_RELAY_CALL2 MGTK::InRect, cancel_rect
cmp #MGTK::inrect_inside
2018-02-26 00:17:11 +00:00
bne LEE1B
2018-11-22 22:12:31 +00:00
jmp handle_cancel_button_down
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
LEE1B: bit message_flags
2018-02-26 00:17:11 +00:00
bvs LEE57
2018-11-22 22:12:31 +00:00
lda message_flags
2018-02-26 00:17:11 +00:00
and #$0F
beq LEE47
2018-03-31 23:50:58 +00:00
MGTK_RELAY_CALL2 MGTK::InRect, no_rect
cmp #MGTK::inrect_inside
2018-02-26 00:17:11 +00:00
bne LEE37
2018-11-22 22:12:31 +00:00
jmp handle_no_button_down
2018-02-26 00:17:11 +00:00
2018-03-31 23:50:58 +00:00
LEE37: MGTK_RELAY_CALL2 MGTK::InRect, yes_rect
cmp #MGTK::inrect_inside
2018-02-26 00:17:11 +00:00
bne LEE67
2018-11-22 22:12:31 +00:00
jmp handle_yes_button_down
2018-02-26 00:17:11 +00:00
2018-03-31 23:50:58 +00:00
LEE47: MGTK_RELAY_CALL2 MGTK::InRect, ok_try_again_rect
cmp #MGTK::inrect_inside
2018-02-26 00:17:11 +00:00
bne LEE67
2018-11-22 22:12:31 +00:00
jmp handle_ok_try_again_button_down1
2018-02-26 00:17:11 +00:00
2018-03-31 23:50:58 +00:00
LEE57: MGTK_RELAY_CALL2 MGTK::InRect, ok_try_again_rect
cmp #MGTK::inrect_inside
2018-02-26 00:17:11 +00:00
bne LEE67
2018-11-22 22:12:31 +00:00
jmp handle_ok_try_again_button_down2
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
LEE67: jmp input_loop
;;; ============================================================
2018-02-26 00:17:11 +00:00
2018-11-22 22:13:21 +00:00
clear_and_return_value:
pha
2018-03-31 04:50:29 +00:00
MGTK_RELAY_CALL2 MGTK::SetPortBits, portbits2
2018-03-30 04:40:39 +00:00
MGTK_RELAY_CALL2 MGTK::SetPenMode, pencopy
2018-11-22 22:12:31 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, rect_E89F
2018-02-26 00:17:11 +00:00
pla
rts
2018-11-22 22:12:31 +00:00
;;; ============================================================
.proc handle_ok_try_again_button_down1
jsr set_pen_xor
2018-03-31 23:50:58 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, ok_try_again_rect
2018-02-26 00:17:11 +00:00
lda #$00
2018-11-22 22:27:03 +00:00
sta state
2018-11-22 22:12:31 +00:00
loop: MGTK_RELAY_CALL2 MGTK::GetEvent, event_params
2018-03-31 02:34:44 +00:00
lda event_kind
2018-11-18 04:34:17 +00:00
cmp #MGTK::EventKind::button_up
2018-02-26 00:17:11 +00:00
beq LEEEA
2018-11-22 22:12:31 +00:00
jsr map_event_coords
2018-03-31 02:34:44 +00:00
MGTK_RELAY_CALL2 MGTK::MoveTo, event_coords
2018-03-31 23:50:58 +00:00
MGTK_RELAY_CALL2 MGTK::InRect, ok_try_again_rect
cmp #MGTK::inrect_inside
2018-02-26 00:17:11 +00:00
beq LEECA
2018-11-22 22:27:03 +00:00
lda state
2018-02-26 00:17:11 +00:00
beq LEED2
2018-11-22 22:12:31 +00:00
jmp loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:27:03 +00:00
LEECA: lda state
2018-02-26 00:17:11 +00:00
bne LEED2
2018-11-22 22:12:31 +00:00
jmp loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
LEED2: jsr set_pen_xor
2018-03-31 23:50:58 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, ok_try_again_rect
2018-11-22 22:27:03 +00:00
lda state
2018-02-26 00:17:11 +00:00
clc
adc #$80
2018-11-22 22:27:03 +00:00
sta state
2018-11-22 22:12:31 +00:00
jmp loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:27:03 +00:00
LEEEA: lda state
2018-02-26 00:17:11 +00:00
beq LEEF2
2018-11-22 22:12:31 +00:00
jmp input_loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:13:21 +00:00
LEEF2: lda #0
jmp clear_and_return_value
2018-02-26 00:17:11 +00:00
2018-11-22 22:27:03 +00:00
state:
2018-11-22 22:12:31 +00:00
.byte 0
.endproc
;;; ============================================================
.proc handle_cancel_button_down
jsr set_pen_xor
2018-03-31 23:50:58 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, cancel_rect
2018-02-26 00:17:11 +00:00
lda #$00
2018-11-22 22:27:03 +00:00
sta state
2018-11-22 22:12:31 +00:00
loop: MGTK_RELAY_CALL2 MGTK::GetEvent, event_params
2018-03-31 02:34:44 +00:00
lda event_kind
2018-11-18 04:34:17 +00:00
cmp #MGTK::EventKind::button_up
2018-02-26 00:17:11 +00:00
beq LEF5A
2018-11-22 22:12:31 +00:00
jsr map_event_coords
2018-03-31 02:34:44 +00:00
MGTK_RELAY_CALL2 MGTK::MoveTo, event_coords
2018-03-31 23:50:58 +00:00
MGTK_RELAY_CALL2 MGTK::InRect, cancel_rect
cmp #MGTK::inrect_inside
2018-02-26 00:17:11 +00:00
beq LEF3A
2018-11-22 22:27:03 +00:00
lda state
2018-02-26 00:17:11 +00:00
beq LEF42
2018-11-22 22:12:31 +00:00
jmp loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:27:03 +00:00
LEF3A: lda state
2018-02-26 00:17:11 +00:00
bne LEF42
2018-11-22 22:12:31 +00:00
jmp loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
LEF42: jsr set_pen_xor
2018-03-31 23:50:58 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, cancel_rect
2018-11-22 22:27:03 +00:00
lda state
2018-02-26 00:17:11 +00:00
clc
adc #$80
2018-11-22 22:27:03 +00:00
sta state
2018-11-22 22:12:31 +00:00
jmp loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:27:03 +00:00
LEF5A: lda state
2018-02-26 00:17:11 +00:00
beq LEF62
2018-11-22 22:12:31 +00:00
jmp input_loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:13:21 +00:00
LEF62: lda #1
jmp clear_and_return_value
2018-02-26 00:17:11 +00:00
2018-11-22 22:27:03 +00:00
state:
2018-11-22 22:12:31 +00:00
.byte 0
.endproc
;;; ============================================================
.proc handle_ok_try_again_button_down2
lda #$00
2018-11-22 22:27:03 +00:00
sta state
2018-11-22 22:12:31 +00:00
jsr set_pen_xor
2018-03-31 23:50:58 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, ok_try_again_rect
2018-11-22 22:12:31 +00:00
loop: MGTK_RELAY_CALL2 MGTK::GetEvent, event_params
2018-03-31 02:34:44 +00:00
lda event_kind
2018-11-18 04:34:17 +00:00
cmp #MGTK::EventKind::button_up
2018-02-26 00:17:11 +00:00
beq LEFCA
2018-11-22 22:12:31 +00:00
jsr map_event_coords
2018-03-31 02:34:44 +00:00
MGTK_RELAY_CALL2 MGTK::MoveTo, event_coords
2018-03-31 23:50:58 +00:00
MGTK_RELAY_CALL2 MGTK::InRect, ok_try_again_rect
cmp #MGTK::inrect_inside
2018-02-26 00:17:11 +00:00
beq LEFAA
2018-11-22 22:27:03 +00:00
lda state
2018-02-26 00:17:11 +00:00
beq LEFB2
2018-11-22 22:12:31 +00:00
jmp loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:27:03 +00:00
LEFAA: lda state
2018-02-26 00:17:11 +00:00
bne LEFB2
2018-11-22 22:12:31 +00:00
jmp loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
LEFB2: jsr set_pen_xor
2018-03-31 23:50:58 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, ok_try_again_rect
2018-11-22 22:27:03 +00:00
lda state
2018-02-26 00:17:11 +00:00
clc
adc #$80
2018-11-22 22:27:03 +00:00
sta state
2018-11-22 22:12:31 +00:00
jmp loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:27:03 +00:00
LEFCA: lda state
2018-02-26 00:17:11 +00:00
beq LEFD2
2018-11-22 22:12:31 +00:00
jmp input_loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:13:21 +00:00
LEFD2: lda #0
jmp clear_and_return_value
2018-02-26 00:17:11 +00:00
2018-11-22 22:27:03 +00:00
state:
2018-11-22 22:12:31 +00:00
.byte 0
.endproc
;;; ============================================================
.proc handle_no_button_down
lda #$00
2018-11-22 22:27:03 +00:00
sta state
2018-11-22 22:12:31 +00:00
jsr set_pen_xor
2018-03-31 23:50:58 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, no_rect
2018-11-22 22:12:31 +00:00
loop: MGTK_RELAY_CALL2 MGTK::GetEvent, event_params
2018-03-31 02:34:44 +00:00
lda event_kind
2018-11-18 04:34:17 +00:00
cmp #MGTK::EventKind::button_up
2018-02-26 00:17:11 +00:00
beq LF03A
2018-11-22 22:12:31 +00:00
jsr map_event_coords
2018-03-31 02:34:44 +00:00
MGTK_RELAY_CALL2 MGTK::MoveTo, event_coords
2018-03-31 23:50:58 +00:00
MGTK_RELAY_CALL2 MGTK::InRect, no_rect
cmp #MGTK::inrect_inside
2018-02-26 00:17:11 +00:00
beq LF01A
2018-11-22 22:27:03 +00:00
lda state
2018-02-26 00:17:11 +00:00
beq LF022
2018-11-22 22:12:31 +00:00
jmp loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:27:03 +00:00
LF01A: lda state
2018-02-26 00:17:11 +00:00
bne LF022
2018-11-22 22:27:03 +00:00
jmp loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
LF022: jsr set_pen_xor
2018-03-31 23:50:58 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, no_rect
2018-11-22 22:27:03 +00:00
lda state
2018-02-26 00:17:11 +00:00
clc
adc #$80
2018-11-22 22:27:03 +00:00
sta state
2018-11-22 22:12:31 +00:00
jmp loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:27:03 +00:00
LF03A: lda state
2018-02-26 00:17:11 +00:00
beq LF042
2018-11-22 22:12:31 +00:00
jmp input_loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:13:21 +00:00
LF042: lda #3
jmp clear_and_return_value
2018-02-26 00:17:11 +00:00
2018-11-22 22:27:03 +00:00
state:
2018-11-22 22:12:31 +00:00
.byte 0
.endproc
;;; ============================================================
.proc handle_yes_button_down
lda #$00
2018-11-22 22:27:03 +00:00
sta state
2018-11-22 22:12:31 +00:00
jsr set_pen_xor
2018-03-31 23:50:58 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, yes_rect
2018-11-22 22:12:31 +00:00
loop: MGTK_RELAY_CALL2 MGTK::GetEvent, event_params
2018-03-31 02:34:44 +00:00
lda event_kind
2018-11-18 04:34:17 +00:00
cmp #MGTK::EventKind::button_up
2018-02-26 00:17:11 +00:00
beq LF0AA
2018-11-22 22:12:31 +00:00
jsr map_event_coords
2018-03-31 02:34:44 +00:00
MGTK_RELAY_CALL2 MGTK::MoveTo, event_coords
2018-03-31 23:50:58 +00:00
MGTK_RELAY_CALL2 MGTK::InRect, yes_rect
cmp #MGTK::inrect_inside
2018-02-26 00:17:11 +00:00
beq LF08A
2018-11-22 22:27:03 +00:00
lda state
2018-02-26 00:17:11 +00:00
beq LF092
2018-11-22 22:12:31 +00:00
jmp loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:27:03 +00:00
LF08A: lda state
2018-02-26 00:17:11 +00:00
bne LF092
2018-11-22 22:12:31 +00:00
jmp loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
LF092: jsr set_pen_xor
2018-03-31 23:50:58 +00:00
MGTK_RELAY_CALL2 MGTK::PaintRect, yes_rect
2018-11-22 22:27:03 +00:00
lda state
2018-02-26 00:17:11 +00:00
clc
adc #$80
2018-11-22 22:27:03 +00:00
sta state
2018-11-22 22:12:31 +00:00
jmp loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:27:03 +00:00
LF0AA: lda state
2018-02-26 00:17:11 +00:00
beq LF0B2
2018-11-22 22:12:31 +00:00
jmp input_loop
2018-02-26 00:17:11 +00:00
2018-11-22 22:13:21 +00:00
LF0B2: lda #2
jmp clear_and_return_value
2018-02-26 00:17:11 +00:00
2018-11-22 22:27:03 +00:00
state:
2018-11-22 22:12:31 +00:00
.byte 0
.endproc
;;; ============================================================
.proc map_event_coords
sub16 event_xcoord, portbits1::viewloc::xcoord, event_xcoord
2018-03-31 04:50:29 +00:00
sub16 event_ycoord, portbits1::viewloc::ycoord, event_ycoord
2018-02-26 00:17:11 +00:00
rts
2018-11-22 22:12:31 +00:00
.endproc
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
;;; ============================================================
.proc set_pen_xor
MGTK_RELAY_CALL2 MGTK::SetPenMode, penXOR
2018-02-26 00:17:11 +00:00
rts
2018-11-22 22:12:31 +00:00
.endproc
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
;;; ============================================================
.proc append_to_confirm_erase0
ptr := $06
stxy ptr
2018-02-26 00:17:11 +00:00
ldy #$00
2018-11-22 22:12:31 +00:00
lda (ptr),y
2018-02-26 00:17:11 +00:00
pha
tay
2018-11-22 22:12:31 +00:00
: lda (ptr),y
sta str_confirm_erase0_buf-1,y
2018-02-26 00:17:11 +00:00
dey
2018-11-22 22:12:31 +00:00
bne :-
2018-02-26 00:17:11 +00:00
pla
clc
2018-11-21 20:11:35 +00:00
adc len_confirm_erase0
sta str_confirm_erase0
2018-02-26 00:17:11 +00:00
tay
2018-11-21 20:11:35 +00:00
inc str_confirm_erase0
inc str_confirm_erase0
lda char_space
2018-02-26 00:17:11 +00:00
iny
2018-11-21 20:11:35 +00:00
sta str_confirm_erase0,y
lda char_question_mark
2018-02-26 00:17:11 +00:00
iny
2018-11-21 20:11:35 +00:00
sta str_confirm_erase0,y
2018-02-26 00:17:11 +00:00
rts
2018-11-22 22:12:31 +00:00
.endproc
;;; ============================================================
.proc append_to_confirm_erase1
ptr := $06
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
stxy ptr
2018-02-26 00:17:11 +00:00
ldy #$00
2018-11-22 22:12:31 +00:00
lda (ptr),y
2018-02-26 00:17:11 +00:00
pha
tay
2018-11-22 22:12:31 +00:00
: lda (ptr),y
sta str_confirm_erase1_buf-1,y
2018-02-26 00:17:11 +00:00
dey
2018-11-22 22:12:31 +00:00
bne :-
2018-02-26 00:17:11 +00:00
pla
clc
2018-11-21 20:11:35 +00:00
adc len_confirm_erase1
sta str_confirm_erase1
2018-02-26 00:17:11 +00:00
tay
2018-11-21 20:11:35 +00:00
inc str_confirm_erase1
inc str_confirm_erase1
lda char_space
2018-02-26 00:17:11 +00:00
iny
2018-11-21 20:11:35 +00:00
sta str_confirm_erase1,y
lda char_question_mark
2018-02-26 00:17:11 +00:00
iny
2018-11-21 20:11:35 +00:00
sta str_confirm_erase1,y
2018-02-26 00:17:11 +00:00
rts
2018-11-22 22:12:31 +00:00
.endproc
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
;;; ============================================================
.proc set_confirm_erase2_slot_drive
txa
and #$70 ; Mask off slot
2018-02-26 00:17:11 +00:00
lsr a
lsr a
lsr a
lsr a
clc
2018-11-21 19:05:39 +00:00
adc #'0'
2018-11-21 20:11:35 +00:00
ldy slot_char_str_confirm_erase2
sta str_confirm_erase2,y
2018-02-26 00:17:11 +00:00
txa
2018-11-22 22:12:31 +00:00
and #$80 ; Mask off drive
asl a ; Shift to low bit
2018-02-26 00:17:11 +00:00
rol a
2018-11-22 22:12:31 +00:00
adc #'1' ; Drive 1 or 2
2018-11-21 20:11:35 +00:00
ldy drive_char_str_confirm_erase2
sta str_confirm_erase2,y
2018-02-26 00:17:11 +00:00
rts
2018-11-22 22:12:31 +00:00
.endproc
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
;;; ============================================================
.proc set_confirm_erase3_slot_drive
txa
and #$70 ; Mask off slot
2018-02-26 00:17:11 +00:00
lsr a
lsr a
lsr a
lsr a
clc
2018-11-21 19:05:39 +00:00
adc #'0'
2018-11-21 20:11:35 +00:00
ldy slot_char_str_confirm_erase3
sta str_confirm_erase3,y
2018-02-26 00:17:11 +00:00
txa
2018-11-22 22:12:31 +00:00
and #$80 ; Mask off drive
asl a ; Shift to low bit
2018-02-26 00:17:11 +00:00
rol a
2018-11-22 22:12:31 +00:00
adc #'1' ; Drive 1 or 2
2018-11-21 20:11:35 +00:00
ldy drive_char_str_confirm_erase3
sta str_confirm_erase3,y
2018-02-26 00:17:11 +00:00
rts
2018-11-22 22:12:31 +00:00
.endproc
;;; ============================================================
2018-02-26 00:17:11 +00:00
LF185: sty LD41D
tya
2018-11-21 23:29:24 +00:00
jsr disk_copy_overlay4::L0EB2
2018-11-22 22:12:31 +00:00
beq :+
2018-02-26 00:17:11 +00:00
sta LD41E
2018-11-22 22:12:31 +00:00
: rts
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
.proc LF192
lda LD41D
2018-11-22 05:00:49 +00:00
sta disk_copy_overlay4::on_line_params::unit_num
2018-11-21 23:29:24 +00:00
jsr disk_copy_overlay4::L129B
2018-11-22 22:12:31 +00:00
beq done
2018-02-26 00:17:11 +00:00
cmp #$52
2018-11-22 22:12:31 +00:00
beq done
2018-11-22 05:00:49 +00:00
lda disk_copy_overlay4::on_line_buffer
2018-02-26 00:17:11 +00:00
and #$0F
2018-11-22 22:12:31 +00:00
bne done
2018-11-22 05:00:49 +00:00
lda disk_copy_overlay4::on_line_buffer+1
2018-02-26 00:17:11 +00:00
cmp #$52
2018-11-22 22:12:31 +00:00
beq done
2018-03-31 02:34:44 +00:00
MGTK_RELAY_CALL2 MGTK::GetEvent, event_params
lda event_kind
2018-11-18 04:34:17 +00:00
cmp #MGTK::EventKind::key_down
2018-02-26 00:17:11 +00:00
bne LF192
2018-03-31 02:34:44 +00:00
lda event_key
cmp #CHAR_ESCAPE
2018-02-26 00:17:11 +00:00
bne LF192
2018-03-29 04:05:12 +00:00
return #$80
2018-02-26 00:17:11 +00:00
2018-11-22 22:12:31 +00:00
done: return #$00
.endproc
2018-02-26 00:17:11 +00:00
LF1CC: cmp #$03
bcc LF1D7
cmp #$06
bcs LF1D7
2018-11-21 23:29:24 +00:00
jsr disk_copy_overlay4::L127E
2018-02-26 00:17:11 +00:00
LF1D7: rts
2018-11-22 22:27:03 +00:00
.endproc
show_alert_dialog := alert_dialog::show_alert_dialog
;;; ============================================================
;;; Padding ???
.scope
2018-02-26 00:17:11 +00:00
tya
lsr a
bcs :+
2018-02-26 00:17:11 +00:00
bit $C055
: tay
2018-02-26 00:17:11 +00:00
lda ($28),y
pha
cmp #$E0
bcc :+
2018-02-26 00:17:11 +00:00
sbc #$20
: and #$3F
2018-02-26 00:17:11 +00:00
sta ($28),y
lda $C000
bmi :+
2018-11-22 05:00:49 +00:00
jmp $51ED
2018-02-26 00:17:11 +00:00
: pla
2018-02-26 00:17:11 +00:00
sta ($28),y
bit $C054
lda $C000
.byte $2C
.byte $10
.endscope
;;; ============================================================
PAD_TO $F200
.endproc