a2d/desktop/desktop.s

20456 lines
506 KiB
ArmAsm
Raw Normal View History

2018-01-18 03:19:01 +00:00
.setcpu "6502"
2017-10-12 15:04:27 +00:00
2017-12-31 03:21:34 +00:00
.include "apple2.inc"
.include "../inc/apple2.inc"
.include "../inc/prodos.inc"
2018-01-29 05:18:00 +00:00
.include "../mgtk.inc"
.include "../desktop.inc"
2018-02-07 05:59:25 +00:00
.include "../macros.inc"
2017-12-31 03:21:34 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
;;; DeskTop - the actual application
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-01 18:00:17 +00:00
INVOKER := $290 ; Invoke other programs
INVOKER_FILENAME := $280 ; File to invoke (PREFIX must be set)
2018-02-01 18:00:17 +00:00
dummy0000 := $0000 ; overwritten by self-modified code
dummy1234 := $1234 ; overwritten by self-modified code
2018-01-17 03:36:54 +00:00
2018-03-15 04:10:08 +00:00
screen_width := 560
screen_height := 192
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-29 05:18:00 +00:00
;;; Segment loaded into AUX $851F-$BFFF (follows MGTK)
2018-03-05 05:36:00 +00:00
;;; ============================================================
.proc desktop_aux
.org $851F
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-03-05 05:33:56 +00:00
;;; This chunk of code appears to be used by one of
;;; the dynamically loaded segments.
2018-03-05 05:33:56 +00:00
.include "ovl0.inc"
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-06 03:01:17 +00:00
.assert * = $8800, error, "Entry point mismatch"
2018-02-25 23:42:50 +00:00
.include "inc/font.inc"
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-03-22 16:13:26 +00:00
.assert * = $8D03, error, "Segment length mismatch"
2018-01-21 03:33:15 +00:00
PAD_TO $8E00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-06 03:01:17 +00:00
;;; Entry point for "DESKTOP"
2018-03-05 05:36:00 +00:00
;;; ============================================================
.assert * = DESKTOP, error, "DESKTOP entry point must be at $8E00"
jmp DESKTOP_DIRECT
2018-02-09 05:42:59 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-06 03:01:17 +00:00
2018-01-29 05:18:00 +00:00
.macro MGTK_RELAY2_CALL call, addr
2018-02-06 03:01:17 +00:00
.if .paramcount > 1
2018-01-29 05:18:00 +00:00
yax_call MGTK_RELAY2, (call), (addr)
2018-02-06 03:01:17 +00:00
.else
2018-01-29 05:18:00 +00:00
yax_call MGTK_RELAY2, (call), 0
2018-02-06 03:01:17 +00:00
.endif
.endmacro
2018-02-01 19:30:03 +00:00
.proc poly
num_vertices: .byte 8
lastpoly: .byte 0 ; 0 = last poly
vertices:
v0: DEFINE_POINT 0, 0, v0
v1: DEFINE_POINT 0, 0, v1
v2: DEFINE_POINT 0, 0, v2
v3: DEFINE_POINT 0, 0, v3
v4: DEFINE_POINT 0, 0, v4
v5: DEFINE_POINT 0, 0, v5
v6: DEFINE_POINT 0, 0, v6
v7: DEFINE_POINT 0, 0, v7
2018-02-01 19:30:03 +00:00
.endproc
2018-01-30 16:57:36 +00:00
.proc paintbits_params2
viewloc: DEFINE_POINT 0, 0, viewloc
2018-02-06 03:01:17 +00:00
mapbits: .addr 0
mapwidth: .byte 0
reserved: .byte 0
maprect: DEFINE_RECT 0,0,0,0,maprect
.endproc
2018-01-30 16:57:36 +00:00
.proc paintbits_params
viewloc: DEFINE_POINT 0, 0, viewloc
2018-02-06 03:01:17 +00:00
mapbits: .addr 0
mapwidth: .byte 0
reserved: .byte 0
maprect: DEFINE_RECT 0,0,0,0,maprect
.endproc
2018-02-07 05:59:25 +00:00
paintrect_params6: DEFINE_RECT 0,0,0,0, paintrect_params6
2018-01-30 16:57:36 +00:00
.proc textwidth_params
2018-02-06 03:01:17 +00:00
textptr: .addr text_buffer
textlen: .byte 0
result: .word 0
.endproc
2018-02-07 05:59:25 +00:00
settextbg_params := textwidth_params::result + 1 ; re-used
2018-01-30 16:57:36 +00:00
.proc drawtext_params
2018-02-06 03:01:17 +00:00
textptr: .addr text_buffer
textlen: .byte 0
.endproc
text_buffer:
.res 19, 0
2018-01-21 16:37:01 +00:00
white_pattern:
.byte %11111111
.byte %11111111
.byte %11111111
.byte %11111111
.byte %11111111
.byte %11111111
.byte %11111111
.byte %11111111
.byte $FF
black_pattern:
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte $FF
checkerboard_pattern2:
.byte %01010101
.byte %10101010
.byte %01010101
.byte %10101010
.byte %01010101
.byte %10101010
.byte %01010101
.byte %10101010
.byte $FF
dark_pattern:
.byte %00010001
.byte %01000100
.byte %00010001
.byte %01000100
.byte %00010001
.byte %01000100
.byte %00010001
.byte %01000100
.byte $FF
light_pattern:
.byte %11101110
.byte %10111011
.byte %11101110
.byte %10111011
.byte %11101110
.byte %10111011
.byte %11101110
.byte %10111011
.byte $FF
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-09 05:42:59 +00:00
;;; Icon (i.e. file, volume) details
2018-02-05 16:03:31 +00:00
num_icons: .byte 0
icon_table: .res 127, 0 ; index into icon_ptrs
2018-03-05 05:33:56 +00:00
icon_ptrs: .res 256, 0 ; addresses of icon details
2018-02-05 16:03:31 +00:00
has_highlight: ; 1 = has highlight, 0 = no highlight
.byte 0
highlight_count: ; number of highlighted icons
.byte $00
highlight_list: ; selected icons
.res 127, 0
;;; Polygon holding the composite outlines of all icons
;;; being dragged.
drag_outline_buffer:
.res 680, 0
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-05 16:03:31 +00:00
2018-02-01 19:30:03 +00:00
.proc peekevent_params
kind: .byte 0 ; spills into next block
.endproc
2018-01-30 16:57:36 +00:00
.proc findwindow_params2
2018-01-31 05:42:26 +00:00
mousex: .word 0
mousey: .word 0
2018-02-06 03:01:17 +00:00
which_area: .byte 0
window_id: .byte 0
.endproc
2018-01-30 16:57:36 +00:00
.proc grafport
2018-02-06 04:37:41 +00:00
viewloc: DEFINE_POINT 0, 0, viewloc
2018-02-06 03:01:17 +00:00
mapbits: .addr MGTK::screen_mapbits
mapwidth: .word MGTK::screen_mapwidth
2018-01-31 03:04:33 +00:00
cliprect: DEFINE_RECT 0, 0, screen_width-1, screen_height-1
2018-02-06 03:01:17 +00:00
penpattern: .res 8, $FF
2018-01-30 07:58:53 +00:00
colormasks: .byte MGTK::colormask_and, MGTK::colormask_or
2018-02-06 03:01:17 +00:00
penloc: DEFINE_POINT 0, 0
penwidth: .byte 1
penheight: .byte 1
penmode: .byte $96 ; ???
2018-02-07 05:59:25 +00:00
textbg: .byte MGTK::textbg_black
2018-02-06 03:01:17 +00:00
fontptr: .addr DEFAULT_FONT
.endproc
2018-01-30 16:57:36 +00:00
.proc getwinport_params
2018-02-06 03:01:17 +00:00
window_id: .byte 0
a_grafport: .addr grafport4
.endproc
2018-01-30 16:57:36 +00:00
.proc grafport4
2018-02-06 04:37:41 +00:00
viewloc: DEFINE_POINT 0, 0, viewloc
2018-02-06 03:01:17 +00:00
mapbits: .addr 0
mapwidth: .word 0
2018-02-06 04:37:41 +00:00
cliprect: DEFINE_RECT 0, 0, 0, 0, cliprect
2018-02-06 03:01:17 +00:00
penpattern: .res 8, 0
2018-01-30 07:58:53 +00:00
colormasks: .byte 0, 0
2018-02-06 03:01:17 +00:00
penloc: DEFINE_POINT 0, 0
penwidth: .byte 0
penheight: .byte 0
penmode: .byte 0
2018-02-07 05:59:25 +00:00
textbg: .byte MGTK::textbg_black
2018-02-06 03:01:17 +00:00
fontptr: .addr 0
.endproc
.byte $00,$00,$00
.byte $00,$FF,$80
;; Used for FILL_MODE params
2018-02-06 03:01:17 +00:00
pencopy_2: .byte 0
penOR_2: .byte 1
penXOR_2: .byte 2
penBIC_2: .byte 3
notpencopy_2: .byte 4
notpenOR_2: .byte 5
notpenXOR_2: .byte 6
notpenBIC_2: .byte 7
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-06 03:01:17 +00:00
;;; DESKTOP command jump table
2018-02-17 07:08:39 +00:00
desktop_jump_table:
.addr 0 ; $00
2018-02-07 05:59:25 +00:00
.addr ADD_ICON_IMPL
2018-02-05 03:13:21 +00:00
.addr HIGHLIGHT_ICON_IMPL
.addr UNHIGHLIGHT_ICON_IMPL
.addr L9508 ; $04
.addr L95A2 ; $05
.addr L9692 ; $06
2018-02-05 03:13:21 +00:00
.addr CLOSE_WINDOW_IMPL
.addr L975B ; $08
2018-02-05 03:13:21 +00:00
.addr FIND_ICON_IMPL
.addr L97F7 ; $0A
.addr L9EBE ; $0B
2018-02-05 03:13:21 +00:00
.addr REDRAW_ICONS_IMPL
.addr ICON_IN_RECT_IMPL
.addr L958F ; $0E
.macro DESKTOP_DIRECT_CALL op, addr, label
jsr DESKTOP_DIRECT
2018-01-21 22:35:37 +00:00
.byte op
.addr addr
.endmacro
2018-02-06 03:01:17 +00:00
;;; DESKTOP entry point (after jump)
2018-02-09 05:42:59 +00:00
.proc DESKTOP_DIRECT
;; Stash return value from stack, adjust by 3
;; (command byte, params addr)
pla
sta call_params
clc
adc #<3
tax
pla
sta call_params+1
adc #>3
pha
txa
pha
;; Save $06..$09 on the stack
ldx #0
: lda $06,x
pha
inx
cpx #4
bne :-
;; Point ($06) at call command
2018-02-10 07:33:54 +00:00
add16 call_params, #1, $06
ldy #0
lda ($06),y
asl a
tax
2018-02-17 07:08:39 +00:00
copy16 desktop_jump_table,x, dispatch + 1
iny
lda ($06),y
tax
iny
lda ($06),y
sta $07
stx $06
dispatch:
2018-01-17 03:36:54 +00:00
jsr dummy0000
tay
2018-03-17 04:19:01 +00:00
ldx #3
L9409: pla
sta $06,x
dex
cpx #$FF
bne L9409
tya
rts
call_params: .addr 0
2018-02-09 05:42:59 +00:00
.endproc
2018-01-30 16:57:36 +00:00
.proc moveto_params2
xcoord: .word 0
ycoord: .word 0
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-07 05:59:25 +00:00
;;; ADD_ICON IMPL
2018-02-07 05:59:25 +00:00
.proc ADD_ICON_IMPL
2018-02-09 05:42:59 +00:00
ptr := $6
ldy #0
lda (ptr),y
2018-02-05 16:03:31 +00:00
ldx num_icons
2018-02-09 05:42:59 +00:00
beq proceed
dex
2018-02-09 05:42:59 +00:00
: cmp icon_table,x
beq fail
dex
2018-02-09 05:42:59 +00:00
bpl :-
bmi proceed
2018-02-16 03:29:05 +00:00
fail: return #1
2018-02-09 05:42:59 +00:00
proceed:
jsr sub
jsr L9F98
2018-02-09 05:42:59 +00:00
lda #1
tay
2018-02-09 05:42:59 +00:00
sta (ptr),y
2018-02-16 03:29:05 +00:00
return #0
2018-02-09 05:42:59 +00:00
sub: ldx num_icons ; ???
2018-02-05 16:03:31 +00:00
sta icon_table,x
inc num_icons
asl a
tax
2018-02-09 05:42:59 +00:00
copy16 ptr, icon_ptrs,x
rts
2018-01-22 07:00:34 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-05 03:13:21 +00:00
;;; HIGHLIGHT_ICON IMPL
2018-02-05 03:13:21 +00:00
.proc HIGHLIGHT_ICON_IMPL
2018-02-05 16:03:31 +00:00
ldx num_icons
2018-02-05 03:13:21 +00:00
beq bail1
dex
2018-03-17 04:19:01 +00:00
ldy #0
lda ($06),y
2018-02-05 16:03:31 +00:00
L945E: cmp icon_table,x
beq L9469
dex
bpl L945E
2018-02-05 03:13:21 +00:00
2018-02-16 03:29:05 +00:00
bail1: return #1
L9469: asl a
tax
2018-02-06 17:31:58 +00:00
copy16 icon_ptrs,x, $06
2018-03-17 04:19:01 +00:00
ldy #1
lda ($06),y
bne L947E
2018-02-16 03:29:05 +00:00
return #2
2018-02-05 16:03:31 +00:00
L947E: lda has_highlight
beq L9498
dey
lda ($06),y
2018-02-05 16:03:31 +00:00
ldx highlight_count
dex
2018-02-05 16:03:31 +00:00
L948A: cmp highlight_list,x
2018-02-05 03:13:21 +00:00
beq bail3
dex
bpl L948A
jmp L949D
2018-02-16 03:29:05 +00:00
bail3: return #3
2018-03-17 04:19:01 +00:00
L9498: lda #1
2018-02-05 16:03:31 +00:00
sta has_highlight
L949D: ldx highlight_count
2018-02-05 03:13:21 +00:00
ldy #0
lda ($06),y
2018-02-05 16:03:31 +00:00
sta highlight_list,x
inc highlight_count
lda ($06),y
2018-02-05 03:13:21 +00:00
ldx #1
jsr LA324
2018-02-05 03:13:21 +00:00
ldy #0
lda ($06),y
2018-02-05 03:13:21 +00:00
ldx #1
jsr LA2E3
jsr L9F9F
2018-02-16 03:29:05 +00:00
return #0
2018-01-22 07:00:34 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-05 03:13:21 +00:00
;;; UNHILIGHT_ICON IMPL
2018-02-05 03:13:21 +00:00
.proc UNHIGHLIGHT_ICON_IMPL
ptr := $06
2018-02-04 18:53:53 +00:00
2018-02-05 16:03:31 +00:00
ldx num_icons
2018-02-05 03:13:21 +00:00
beq bail1
dex
2018-02-09 05:42:59 +00:00
ldy #0
2018-02-05 03:13:21 +00:00
lda (ptr),y
2018-02-05 16:03:31 +00:00
: cmp icon_table,x
2018-02-05 03:13:21 +00:00
beq found
dex
2018-02-05 03:13:21 +00:00
bpl :-
2018-02-16 03:29:05 +00:00
bail1: return #1
2018-02-05 03:13:21 +00:00
found: asl a
tax
2018-02-06 17:31:58 +00:00
copy16 icon_ptrs,x, ptr
2018-02-05 16:03:31 +00:00
lda has_highlight
bne L94E9
2018-02-05 03:13:21 +00:00
jmp done
2018-02-05 16:03:31 +00:00
L94E9: ldx highlight_count
dex
2018-02-09 05:42:59 +00:00
ldy #0
2018-02-05 03:13:21 +00:00
lda (ptr),y
2018-02-05 16:03:31 +00:00
L94F1: cmp highlight_list,x
beq L94FC
dex
bpl L94F1
2018-02-05 03:13:21 +00:00
jmp done
L94FC: jsr L9F9F
2018-02-16 03:29:05 +00:00
return #0
2018-02-05 03:13:21 +00:00
done: jsr L9F98
2018-02-16 03:29:05 +00:00
return #0
2018-01-22 07:00:34 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
;;; DESKTOP $04 IMPL
2018-01-22 07:00:34 +00:00
.proc L9508
2018-02-06 05:49:39 +00:00
ptr := $6
;; Search for passed icon
ldy #0
2018-02-05 16:03:31 +00:00
ldx num_icons
2018-02-06 05:49:39 +00:00
beq bail1
dex
2018-02-06 05:49:39 +00:00
lda (ptr),y
: cmp icon_table,x
beq found
dex
2018-02-06 05:49:39 +00:00
bpl :-
2018-02-16 03:29:05 +00:00
bail1: return #1
2018-02-06 05:49:39 +00:00
;; Pointer to icon details
found: asl a
tax
2018-02-06 17:31:58 +00:00
copy16 icon_ptrs,x, ptr
2018-02-06 05:49:39 +00:00
ldy #1 ; offset 1 is ... ???
lda (ptr),y
bne :+
2018-02-16 03:29:05 +00:00
return #2
2018-02-06 05:49:39 +00:00
: jsr calc_icon_poly
2018-01-30 16:57:36 +00:00
MGTK_CALL MGTK::SetPenMode, pencopy_2
jsr LA39D
2018-02-06 05:49:39 +00:00
ldy #0
lda (ptr),y
2018-02-05 16:03:31 +00:00
ldx num_icons
jsr LA2E3
2018-02-05 16:03:31 +00:00
dec num_icons
2018-02-06 05:49:39 +00:00
lda #0
2018-02-05 16:03:31 +00:00
ldx num_icons
sta icon_table,x
2018-02-06 05:49:39 +00:00
ldy #1
lda #0
sta (ptr),y
2018-02-05 16:03:31 +00:00
lda has_highlight
2018-02-06 05:49:39 +00:00
beq done
2018-02-05 16:03:31 +00:00
ldx highlight_count
dex
2018-02-06 05:49:39 +00:00
ldy #0
lda (ptr),y
2018-02-05 16:03:31 +00:00
L9566: cmp highlight_list,x
beq L9571
dex
bpl L9566
2018-02-06 05:49:39 +00:00
jmp done
2018-02-05 16:03:31 +00:00
L9571: ldx highlight_count
jsr LA324
2018-02-05 16:03:31 +00:00
dec highlight_count
lda highlight_count
bne L9584
2018-02-06 05:49:39 +00:00
lda #0
2018-02-05 16:03:31 +00:00
sta has_highlight
2018-02-06 05:49:39 +00:00
L9584: lda #0
2018-02-05 16:03:31 +00:00
ldx highlight_count
sta highlight_list,x
2018-02-06 05:49:39 +00:00
2018-02-16 03:29:05 +00:00
done: return #0
2018-01-22 07:00:34 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
;;; DESKTOP $0E IMPL
2018-01-22 07:00:34 +00:00
.proc L958F
2018-02-19 19:33:13 +00:00
ptr := $6
2018-02-09 05:42:59 +00:00
ldy #0
2018-02-19 19:33:13 +00:00
lda (ptr),y
asl a
tax
2018-02-19 19:33:13 +00:00
copy16 icon_ptrs,x, ptr
jmp LA39D
2018-01-22 07:00:34 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
;;; DESKTOP $05 IMPL
2018-01-22 07:00:34 +00:00
.proc L95A2
2018-02-05 16:03:31 +00:00
jmp start
2018-02-05 03:13:21 +00:00
;; DT_HIGHLIGHT_ICON params
2018-02-06 03:01:17 +00:00
icon: .byte 0
2018-02-05 16:03:31 +00:00
buffer: .res 127, 0
start: lda HIGHLIGHT_ICON_IMPL ; ???
beq start2
lda highlight_list
sta icon
DESKTOP_DIRECT_CALL $0B, icon
jmp start
start2:
;; zero out buffer
ldx #$7E
lda #0
: sta buffer,x
dex
2018-02-05 16:03:31 +00:00
bpl :-
ldx #0
stx icon
L9648: lda icon_table,x
asl a
tay
2018-02-06 17:31:58 +00:00
copy16 icon_ptrs,y, $08
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
lda ($08),y
2018-02-09 05:42:59 +00:00
and #icon_entry_winid_mask
2018-02-05 16:03:31 +00:00
ldy #0
cmp ($06),y
bne L9670
2018-02-05 16:03:31 +00:00
ldy #0
lda ($08),y
2018-02-05 16:03:31 +00:00
ldy icon
sta buffer,y
inc icon
L9670: inx
2018-02-05 16:03:31 +00:00
cpx num_icons
bne L9648
2018-03-17 04:19:01 +00:00
ldx #0
txa
pha
2018-02-05 16:03:31 +00:00
L967A: lda buffer,x
bne L9681
pla
rts
2018-02-05 16:03:31 +00:00
L9681: sta icon
DESKTOP_DIRECT_CALL DT_HIGHLIGHT_ICON, icon
pla
tax
inx
txa
pha
jmp L967A
2018-01-22 07:00:34 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
;;; DESKTOP $06 IMPL
2018-01-22 07:00:34 +00:00
.proc L9692
jmp L9697
L9695: .byte 0
L9696: .byte 0
2018-02-05 16:03:31 +00:00
L9697: lda num_icons
sta L9696
L969D: ldx L9696
2018-03-17 04:19:01 +00:00
cpx #0
beq L96CF
dec L9696
dex
2018-02-05 16:03:31 +00:00
lda icon_table,x
sta L9695
asl a
tax
2018-02-06 17:31:58 +00:00
copy16 icon_ptrs,x, $08
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
lda ($08),y
2018-02-09 05:42:59 +00:00
and #icon_entry_winid_mask
2018-02-07 05:59:25 +00:00
ldy #0
cmp ($06),y
bne L969D
2018-02-05 03:13:21 +00:00
DESKTOP_DIRECT_CALL $04, L9695
jmp L969D
2018-02-16 03:29:05 +00:00
L96CF: return #0
2018-01-22 07:00:34 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-05 03:13:21 +00:00
;;; CLOSE_WINDOW IMPL
2018-02-05 03:13:21 +00:00
.proc CLOSE_WINDOW_IMPL
jmp L96D7
L96D5: .byte 0
L96D6: .byte 0
2018-02-05 16:03:31 +00:00
L96D7: lda num_icons
sta L96D6
L96DD: ldx L96D6
bne L96E5
2018-02-16 03:29:05 +00:00
return #0
L96E5: dec L96D6
dex
2018-02-05 16:03:31 +00:00
lda icon_table,x
sta L96D5
asl a
tax
2018-02-06 17:31:58 +00:00
copy16 icon_ptrs,x, $08
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
lda ($08),y
2018-02-09 05:42:59 +00:00
and #icon_entry_winid_mask
ldy #0
cmp ($06),y
bne L96DD
2018-02-09 05:42:59 +00:00
ldy #0
lda ($08),y
2018-02-05 16:03:31 +00:00
ldx num_icons
jsr LA2E3
2018-02-05 16:03:31 +00:00
dec num_icons
2018-03-17 04:19:01 +00:00
lda #0
2018-02-05 16:03:31 +00:00
ldx num_icons
sta icon_table,x
2018-02-09 05:42:59 +00:00
ldy #1
lda #0
sta ($08),y
2018-02-05 16:03:31 +00:00
lda has_highlight
beq L9758
2018-03-17 04:19:01 +00:00
ldx #0
2018-02-09 05:42:59 +00:00
ldy #0
L972B: lda ($08),y
2018-02-05 16:03:31 +00:00
cmp highlight_list,x
beq L973B
inx
2018-02-05 16:03:31 +00:00
cpx highlight_count
bne L972B
jmp L9758
L973B: lda ($08),y
2018-02-05 16:03:31 +00:00
ldx highlight_count
jsr LA324
2018-02-05 16:03:31 +00:00
dec highlight_count
lda highlight_count
bne L9750
2018-03-17 04:19:01 +00:00
lda #0
2018-02-05 16:03:31 +00:00
sta has_highlight
2018-03-17 04:19:01 +00:00
L9750: lda #0
2018-02-05 16:03:31 +00:00
ldx highlight_count
sta highlight_list,x
L9758: jmp L96DD
2018-01-22 07:00:34 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
;;; DESKTOP $08 IMPL
2018-01-22 07:00:34 +00:00
.proc L975B
2018-03-17 04:19:01 +00:00
ldx #0
txa
tay
L975F: sta ($06),y
iny
inx
cpx #$14
bne L975F
2018-02-09 05:42:59 +00:00
ldx #0
ldy #0
2018-02-05 16:03:31 +00:00
L976B: lda highlight_list,x
sta ($06),y
2018-02-05 16:03:31 +00:00
cpx highlight_count
beq L977A
iny
inx
jmp L976B
2018-02-16 03:29:05 +00:00
L977A: return #0
2018-01-22 07:00:34 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-05 03:13:21 +00:00
;;; FIND_ICON IMPL
2018-02-05 03:13:21 +00:00
.proc FIND_ICON_IMPL
jmp start
2018-02-05 03:13:21 +00:00
.res 9, 0 ; ???
2018-02-05 03:13:21 +00:00
coords := $6
;; Copy coords at $6 to param block
start: ldy #3
: lda (coords),y
2018-01-30 16:57:36 +00:00
sta moveto_params2,y
dey
2018-02-05 03:13:21 +00:00
bpl :-
;; Overwrite y with x ???
2018-02-06 17:31:58 +00:00
copy16 $06, $08
2018-02-05 03:13:21 +00:00
;; ???
2018-03-17 04:19:01 +00:00
ldy #5
lda ($06),y
sta L97F5
2018-01-30 16:57:36 +00:00
MGTK_CALL MGTK::MoveTo, moveto_params2
2018-02-09 05:42:59 +00:00
ldx #0
2018-02-05 16:03:31 +00:00
L97AA: cpx num_icons
bne L97B9
2018-02-09 05:42:59 +00:00
ldy #4
lda #0
sta ($08),y
sta L97F6
rts
L97B9: txa
pha
2018-02-05 16:03:31 +00:00
lda icon_table,x
asl a
tax
2018-02-06 17:31:58 +00:00
copy16 icon_ptrs,x, $06
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
lda ($06),y
2018-02-09 05:42:59 +00:00
and #icon_entry_winid_mask
cmp L97F5
bne L97E0
2018-02-05 03:13:21 +00:00
jsr calc_icon_poly
2018-02-01 19:30:03 +00:00
MGTK_CALL MGTK::InPoly, poly
2018-02-05 03:13:21 +00:00
bne inside
L97E0: pla
tax
inx
jmp L97AA
2018-02-05 03:13:21 +00:00
inside: pla
tax
2018-02-05 16:03:31 +00:00
lda icon_table,x
2018-02-09 05:42:59 +00:00
ldy #4
sta ($08),y
sta L97F6
rts
2018-02-05 03:13:21 +00:00
rts ; ???
.byte 0
L97F5: .byte 0
L97F6: .byte 0
2018-01-22 07:00:34 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
;;; DESKTOP $0A IMPL
2018-02-07 05:59:25 +00:00
;; Desktop icon selection
2018-01-22 07:00:34 +00:00
.proc L97F7
2018-02-05 03:46:41 +00:00
ldy #0
lda ($06),y
sta L982A
tya
sta ($06),y
2018-02-05 03:46:41 +00:00
ldy #4
L9803: lda ($06),y
sta L9C8D,y
sta L9C91,y
dey
2018-02-05 03:46:41 +00:00
cpy #0
bne L9803
2018-02-06 05:49:39 +00:00
jsr push_zp_addrs
lda L982A
jsr L9EB4
2018-02-05 04:35:19 +00:00
stax $06
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
lda ($06),y
2018-02-09 05:42:59 +00:00
and #icon_entry_winid_mask
sta L9829
jmp L983D
L9829: .byte $00
L982A: .byte $00,$00
L982C: .byte $00
L982D: .byte $00
L982E: .byte $00
L982F: .byte $00
2018-02-05 03:13:21 +00:00
;; DT_HIGHLIGHT_ICON params
L9830: .byte $00
2018-02-05 03:46:41 +00:00
L9831: .byte $00
L9832: .byte $00
L9833: .byte $00
L9834: .byte $00
L9835: .byte $00,$00,$00,$00,$00,$00,$00,$00
2018-02-05 03:46:41 +00:00
L983D: lda #0
sta L9830
sta L9833
2018-02-01 19:30:03 +00:00
L9845: MGTK_CALL MGTK::PeekEvent, peekevent_params
lda peekevent_params::kind
2018-02-03 04:41:42 +00:00
cmp #MGTK::event_kind_drag
beq L9857
L9852: lda #$02
jmp L9C65
2018-02-05 03:46:41 +00:00
L9857: sub16 findwindow_params2::mousex, L9C8E, L982C
sub16 findwindow_params2::mousey, L9C90, L982E
lda L982D
bpl L988C
lda L982C
cmp #$FB
bcc L98AC
jmp L9893
L988C: lda L982C
cmp #$05
bcs L98AC
L9893: lda L982F
bpl L98A2
lda L982E
cmp #$FB
bcc L98AC
jmp L9845
L98A2: lda L982E
cmp #$05
bcs L98AC
jmp L9845
2018-02-05 16:03:31 +00:00
L98AC: lda highlight_count
2018-03-17 04:19:01 +00:00
cmp #$15 ; max number of draggable items?
bcc :+
jmp L9852
2018-03-17 04:19:01 +00:00
: copy16 #drag_outline_buffer, $08
2018-02-05 16:03:31 +00:00
lda has_highlight
2018-03-17 04:19:01 +00:00
bne :+
lda #$03
jmp L9C65
2018-03-17 04:19:01 +00:00
: lda highlight_list
jsr L9EB4
2018-02-05 04:35:19 +00:00
stax $06
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
lda ($06),y
2018-02-09 05:42:59 +00:00
and #icon_entry_winid_mask
sta L9832
2018-01-30 16:57:36 +00:00
MGTK_CALL MGTK::InitPort, grafport
2018-03-17 04:19:01 +00:00
ldx #7
2018-01-31 05:22:13 +00:00
L98E3: lda grafport::cliprect,x
sta L9835,x
dex
bpl L98E3
2018-02-05 16:03:31 +00:00
ldx highlight_count
stx L9C74
2018-02-05 16:03:31 +00:00
L98F2: lda highlight_count,x
jsr L9EB4
2018-02-05 04:35:19 +00:00
stax $06
2018-02-09 05:42:59 +00:00
ldy #0
lda ($06),y
2018-02-09 05:42:59 +00:00
cmp #1
bne L9909
ldx #$80
stx L9833
L9909: sta L9834
2018-02-05 03:13:21 +00:00
DESKTOP_DIRECT_CALL DT_ICON_IN_RECT, L9834
beq L9954
2018-02-05 03:13:21 +00:00
jsr calc_icon_poly
lda L9C74
2018-02-05 16:03:31 +00:00
cmp highlight_count
beq L9936
2018-02-06 05:49:39 +00:00
jsr push_zp_addrs
lda $08
sec
sbc #$22
sta $08
bcs L992D
2018-01-21 19:47:40 +00:00
dec $08+1
2018-02-09 05:42:59 +00:00
L992D: ldy #1
lda #$80
sta ($08),y
2018-02-06 05:49:39 +00:00
jsr pop_zp_addrs
L9936: ldx #$21
ldy #$21
2018-02-01 19:30:03 +00:00
L993A: lda poly,x
sta ($08),y
dey
dex
bpl L993A
2018-03-17 04:19:01 +00:00
lda #8
2018-02-09 05:42:59 +00:00
ldy #0
sta ($08),y
lda $08
clc
adc #$22
sta $08
bcc L9954
2018-01-21 19:47:40 +00:00
inc $08+1
L9954: dec L9C74
beq L995F
ldx L9C74
jmp L98F2
2018-03-17 04:19:01 +00:00
L995F: ldx #7
L9961: lda drag_outline_buffer+2,x
sta L9C76,x
dex
bpl L9961
2018-02-06 17:31:58 +00:00
copy16 #drag_outline_buffer, $08
2018-02-09 05:42:59 +00:00
L9972: ldy #icon_entry_offset_win_type
L9974: lda ($08),y
cmp L9C76
iny
lda ($08),y
sbc L9C77
bcs L9990
lda ($08),y
sta L9C77
dey
lda ($08),y
sta L9C76
iny
jmp L99AA
L9990: dey
lda ($08),y
cmp L9C7A
iny
lda ($08),y
sbc L9C7B
bcc L99AA
lda ($08),y
sta L9C7B
dey
lda ($08),y
sta L9C7A
iny
L99AA: iny
lda ($08),y
cmp L9C78
iny
lda ($08),y
sbc L9C79
bcs L99C7
lda ($08),y
sta L9C79
dey
lda ($08),y
sta L9C78
iny
jmp L99E1
L99C7: dey
lda ($08),y
cmp L9C7C
iny
lda ($08),y
sbc L9C7D
bcc L99E1
lda ($08),y
sta L9C7D
dey
lda ($08),y
sta L9C7C
iny
L99E1: iny
cpy #$22
bne L9974
2018-02-09 05:42:59 +00:00
ldy #1
lda ($08),y
beq L99FC
2018-03-15 03:53:20 +00:00
add16 $08, #34, $08
jmp L9972
2018-01-29 05:18:00 +00:00
L99FC: MGTK_CALL MGTK::SetPattern, checkerboard_pattern2
2018-01-30 16:57:36 +00:00
MGTK_CALL MGTK::SetPenMode, penXOR_2
2018-01-29 05:18:00 +00:00
MGTK_CALL MGTK::FramePoly, drag_outline_buffer
2018-02-01 19:30:03 +00:00
L9A0E: MGTK_CALL MGTK::PeekEvent, peekevent_params
lda peekevent_params::kind
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_drag
beq L9A1E
jmp L9BA5
2018-02-01 19:30:03 +00:00
L9A1E: ldx #3
2018-01-30 16:57:36 +00:00
L9A20: lda findwindow_params2,x
cmp L9C92,x
bne L9A31
dex
bpl L9A20
jsr L9E14
jmp L9A0E
2018-03-17 04:19:01 +00:00
L9A31: ldx #3
2018-01-30 16:57:36 +00:00
L9A33: lda findwindow_params2,x
sta L9C92,x
dex
bpl L9A33
lda L9830
beq L9A84
lda L9831
2018-01-31 05:42:26 +00:00
sta findwindow_params2::window_id
2018-02-05 03:13:21 +00:00
DESKTOP_DIRECT_CALL DT_FIND_ICON, findwindow_params2
2018-01-31 05:42:26 +00:00
lda findwindow_params2::which_area
cmp L9830
beq L9A84
2018-01-29 05:18:00 +00:00
MGTK_CALL MGTK::SetPattern, checkerboard_pattern2
2018-01-30 16:57:36 +00:00
MGTK_CALL MGTK::SetPenMode, penXOR_2
2018-01-29 05:18:00 +00:00
MGTK_CALL MGTK::FramePoly, drag_outline_buffer
2018-02-05 03:13:21 +00:00
DESKTOP_DIRECT_CALL $0B, L9830
2018-01-29 05:18:00 +00:00
MGTK_CALL MGTK::SetPattern, checkerboard_pattern2
2018-01-30 16:57:36 +00:00
MGTK_CALL MGTK::SetPenMode, penXOR_2
2018-01-29 05:18:00 +00:00
MGTK_CALL MGTK::FramePoly, drag_outline_buffer
2018-03-17 04:19:01 +00:00
lda #0
sta L9830
2018-02-06 18:06:44 +00:00
L9A84: sub16 findwindow_params2::mousex, L9C8E, L9C96
sub16 findwindow_params2::mousey, L9C90, L9C98
jsr L9C9E
2018-03-17 04:19:01 +00:00
ldx #0
2018-02-14 05:52:36 +00:00
L9AAF: add16 L9C7A,x, L9C96,x, L9C7A,x
add16 L9C76,x, L9C96,x, L9C76,x
inx
inx
2018-03-17 04:19:01 +00:00
cpx #4
bne L9AAF
2018-03-17 04:19:01 +00:00
lda #0
sta L9C75
lda L9C77
bmi L9AF7
2018-03-15 03:53:20 +00:00
cmp16 L9C7A, #screen_width
bcs L9AFE
jsr L9DFA
jmp L9B0E
L9AF7: jsr L9CAA
bmi L9B0E
bpl L9B03
L9AFE: jsr L9CD1
bmi L9B0E
L9B03: jsr L9DB8
lda L9C75
ora #$80
sta L9C75
L9B0E: lda L9C79
bmi L9B31
2018-03-15 03:53:20 +00:00
cmp16 L9C78, #13
bcc L9B31
2018-03-15 03:53:20 +00:00
cmp16 L9C7C, #screen_height
bcs L9B38
jsr L9E07
jmp L9B48
L9B31: jsr L9D31
bmi L9B48
bpl L9B3D
L9B38: jsr L9D58
bmi L9B48
L9B3D: jsr L9DD9
lda L9C75
ora #$40
sta L9C75
L9B48: bit L9C75
bpl L9B52
2018-01-13 04:58:02 +00:00
bvc L9B52
jmp L9A0E
2018-01-29 05:18:00 +00:00
L9B52: MGTK_CALL MGTK::FramePoly, drag_outline_buffer
2018-02-06 17:31:58 +00:00
copy16 #drag_outline_buffer, $08
2018-02-07 05:59:25 +00:00
L9B60: ldy #2
L9B62: lda ($08),y
clc
adc L9C96
sta ($08),y
iny
lda ($08),y
adc L9C97
sta ($08),y
iny
lda ($08),y
clc
adc L9C98
sta ($08),y
iny
lda ($08),y
adc L9C99
sta ($08),y
iny
cpy #$22
bne L9B62
2018-02-09 05:42:59 +00:00
ldy #1
lda ($08),y
beq L9B9C
lda $08
clc
adc #$22
sta $08
bcc L9B99
2018-01-21 19:47:40 +00:00
inc $08+1
L9B99: jmp L9B60
2018-01-29 05:18:00 +00:00
L9B9C: MGTK_CALL MGTK::FramePoly, drag_outline_buffer
jmp L9A0E
2018-01-29 05:18:00 +00:00
L9BA5: MGTK_CALL MGTK::FramePoly, drag_outline_buffer
lda L9830
beq L9BB9
2018-02-05 03:13:21 +00:00
DESKTOP_DIRECT_CALL $0B, L9830
jmp L9C63
2018-01-30 16:57:36 +00:00
L9BB9: MGTK_CALL MGTK::FindWindow, findwindow_params2
2018-01-31 05:42:26 +00:00
lda findwindow_params2::window_id
cmp L9832
beq L9BE1
bit L9833
bmi L9BDC
2018-01-31 05:42:26 +00:00
lda findwindow_params2::window_id
bne L9BD4
L9BD1: jmp L9852
L9BD4: ora #$80
sta L9830
jmp L9C63
L9BDC: lda L9832
beq L9BD1
2018-02-06 05:49:39 +00:00
L9BE1: jsr push_zp_addrs
2018-01-30 16:57:36 +00:00
MGTK_CALL MGTK::InitPort, grafport
MGTK_CALL MGTK::SetPort, grafport
2018-02-05 16:03:31 +00:00
ldx highlight_count
L9BF3: dex
bmi L9C18
txa
pha
2018-02-05 16:03:31 +00:00
lda highlight_list,x
asl a
tax
2018-02-06 17:31:58 +00:00
copy16 icon_ptrs,x, $06
2018-02-05 03:13:21 +00:00
jsr calc_icon_poly
2018-01-30 16:57:36 +00:00
MGTK_CALL MGTK::SetPenMode, pencopy_2
jsr LA39D
pla
tax
jmp L9BF3
2018-02-06 05:49:39 +00:00
L9C18: jsr pop_zp_addrs
2018-02-05 16:03:31 +00:00
ldx highlight_count
dex
txa
pha
2018-02-06 17:31:58 +00:00
copy16 #drag_outline_buffer, $08
2018-02-05 16:03:31 +00:00
L9C29: lda highlight_list,x
asl a
tax
2018-02-06 17:31:58 +00:00
copy16 icon_ptrs,x, $06
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
lda ($08),y
iny
sta ($06),y
lda ($08),y
iny
sta ($06),y
lda ($08),y
iny
sta ($06),y
lda ($08),y
iny
sta ($06),y
pla
tax
dex
bmi L9C63
txa
pha
lda $08
clc
adc #$22
sta $08
bcc L9C60
2018-01-21 19:47:40 +00:00
inc $08+1
L9C60: jmp L9C29
2018-03-17 04:19:01 +00:00
L9C63: lda #0
L9C65: tay
2018-02-06 05:49:39 +00:00
jsr pop_zp_addrs
tya
tax
2018-02-09 05:42:59 +00:00
ldy #0
lda L9830
sta ($06),y
txa
rts
L9C74: .byte $00
L9C75: .byte $00
L9C76: .byte $00
L9C77: .byte $00
L9C78: .byte $00
L9C79: .byte $00
L9C7A: .byte $00
L9C7B: .byte $00
L9C7C: .byte $00
L9C7D: .byte $00
L9C7E: .byte $00
L9C7F: .byte $00
L9C80: .byte $0D
L9C81: .byte $00
L9C82: .byte $30
L9C83: .byte $02
L9C84: .byte $C0
L9C85: .byte $00
L9C86: .word 0
L9C88: .word 0
L9C8A: .word 0
L9C8C: .byte $00
L9C8D: .byte $00
L9C8E: .byte $00
L9C8F: .byte $00
L9C90: .byte $00
L9C91: .byte $00
L9C92: .byte $00,$00,$00,$00
L9C96: .byte $00
L9C97: .byte $00
L9C98: .byte $00
L9C99: .byte $00,$00,$00,$00,$00
2018-03-17 04:19:01 +00:00
L9C9E: ldx #7
L9CA0: lda L9C76,x
sta L9C86,x
dex
bpl L9CA0
rts
L9CAA: lda L9C76
cmp L9C7E
bne L9CBD
lda L9C77
cmp L9C7F
bne L9CBD
2018-02-16 03:29:05 +00:00
return #0
2018-02-10 07:33:54 +00:00
L9CBD: sub16 #0, L9C86, L9C96
jmp L9CF5
L9CD1: lda L9C7A
cmp L9C82
bne L9CE4
lda L9C7B
cmp L9C83
bne L9CE4
2018-02-16 03:29:05 +00:00
return #0
2018-03-15 03:53:20 +00:00
L9CE4: sub16 #screen_width, L9C8A, L9C96
2018-02-06 18:06:44 +00:00
L9CF5: add16 L9C86, L9C96, L9C76
add16 L9C8A, L9C96, L9C7A
add16 L9C8E, L9C96, L9C8E
2018-02-16 03:29:05 +00:00
return #$FF
L9D31: lda L9C78
cmp L9C80
bne L9D44
lda L9C79
cmp L9C81
bne L9D44
2018-02-16 03:29:05 +00:00
return #0
2018-03-15 03:53:20 +00:00
L9D44: sub16 #13, L9C88, L9C98
jmp L9D7C
L9D58: lda L9C7C
cmp L9C84
bne L9D6B
lda L9C7D
cmp L9C85
bne L9D6B
2018-02-16 03:29:05 +00:00
return #0
2018-03-15 03:53:20 +00:00
L9D6B: sub16 #screen_height-1, L9C8C, L9C98
2018-02-06 18:06:44 +00:00
L9D7C: add16 L9C88, L9C98, L9C78
add16 L9C8C, L9C98, L9C7C
add16 L9C90, L9C98, L9C90
2018-02-16 03:29:05 +00:00
return #$FF
2018-02-10 07:33:54 +00:00
L9DB8: copy16 L9C86, L9C76
copy16 L9C8A, L9C7A
lda #0
sta L9C96
sta L9C97
rts
2018-02-10 07:33:54 +00:00
L9DD9: copy16 L9C88, L9C78
copy16 L9C8C, L9C7C
lda #0
sta L9C98
sta L9C99
rts
2018-01-31 05:42:26 +00:00
L9DFA: lda findwindow_params2::mousex+1
sta L9C8F
2018-01-31 05:42:26 +00:00
lda findwindow_params2::mousex
sta L9C8E
rts
2018-01-31 05:42:26 +00:00
L9E07: lda findwindow_params2::mousey+1
sta L9C91
2018-01-31 05:42:26 +00:00
lda findwindow_params2::mousey
sta L9C90
rts
L9E14: bit L9833
bpl L9E1A
rts
2018-02-06 05:49:39 +00:00
L9E1A: jsr push_zp_addrs
2018-02-05 04:46:26 +00:00
MGTK_CALL MGTK::FindWindow, findwindow_params2
2018-01-31 05:42:26 +00:00
lda findwindow_params2::which_area
bne L9E2B
2018-01-31 05:42:26 +00:00
sta findwindow_params2::window_id
2018-02-05 03:13:21 +00:00
L9E2B: DESKTOP_DIRECT_CALL DT_FIND_ICON, findwindow_params2
2018-01-31 05:42:26 +00:00
lda findwindow_params2::which_area
bne L9E39
jmp L9E97
2018-02-05 16:03:31 +00:00
L9E39: ldx highlight_count
dex
2018-02-05 16:03:31 +00:00
L9E3D: cmp highlight_list,x
beq L9E97
dex
bpl L9E3D
sta L9EB3
2018-03-17 04:19:01 +00:00
cmp #1
beq L9E6A
asl a
tax
2018-02-06 17:31:58 +00:00
copy16 icon_ptrs,x, $06
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
lda ($06),y
2018-02-09 05:42:59 +00:00
and #icon_entry_winid_mask
sta L9831
lda ($06),y
2018-02-09 05:42:59 +00:00
and #$70 ; type
bne L9E97
lda L9EB3
L9E6A: sta L9830
2018-01-29 05:18:00 +00:00
MGTK_CALL MGTK::SetPattern, checkerboard_pattern2
2018-01-30 16:57:36 +00:00
MGTK_CALL MGTK::SetPenMode, penXOR_2
2018-01-29 05:18:00 +00:00
MGTK_CALL MGTK::FramePoly, drag_outline_buffer
2018-02-05 03:13:21 +00:00
DESKTOP_DIRECT_CALL DT_HIGHLIGHT_ICON, L9830
2018-01-29 05:18:00 +00:00
MGTK_CALL MGTK::SetPattern, checkerboard_pattern2
2018-01-30 16:57:36 +00:00
MGTK_CALL MGTK::SetPenMode, penXOR_2
2018-01-29 05:18:00 +00:00
MGTK_CALL MGTK::FramePoly, drag_outline_buffer
2018-01-30 16:57:36 +00:00
L9E97: MGTK_CALL MGTK::InitPort, grafport
MGTK_CALL MGTK::SetPort, grafport
2018-01-29 05:18:00 +00:00
MGTK_CALL MGTK::SetPattern, checkerboard_pattern2
2018-01-30 16:57:36 +00:00
MGTK_CALL MGTK::SetPenMode, penXOR_2
2018-02-06 05:49:39 +00:00
jsr pop_zp_addrs
rts
L9EB3: .byte 0
L9EB4: asl a
tay
2018-02-05 16:03:31 +00:00
lda icon_ptrs+1,y
tax
2018-02-05 16:03:31 +00:00
lda icon_ptrs,y
rts
2018-01-22 07:00:34 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-05 03:13:21 +00:00
;;; DESKTOP $0B IMPL
2018-02-07 05:59:25 +00:00
;; Deselect icon ???
;; how is this different from UNHIGHLIGHT_ICON ???
2018-01-22 07:00:34 +00:00
.proc L9EBE
2018-02-05 03:13:21 +00:00
jmp start
2018-02-05 03:13:21 +00:00
.byte 0 ; ???
2018-02-04 18:53:53 +00:00
2018-02-05 03:13:21 +00:00
;; DT_UNHIGHLIGHT_ICON params
icon: .byte 0
ptr := $6
2018-02-05 16:03:31 +00:00
start: lda has_highlight
2018-02-04 18:53:53 +00:00
bne :+
2018-02-16 03:29:05 +00:00
return #1
2018-02-05 16:03:31 +00:00
: ldx highlight_count
2018-02-04 18:53:53 +00:00
ldy #0
2018-02-05 03:13:21 +00:00
lda (ptr),y
jsr LA324
2018-02-05 16:03:31 +00:00
ldx highlight_count
2018-02-05 03:13:21 +00:00
lda #0
2018-02-05 16:03:31 +00:00
sta highlight_count,x
dec highlight_count
lda highlight_count
bne L9EEA
2018-03-17 04:19:01 +00:00
lda #0
2018-02-05 16:03:31 +00:00
sta has_highlight
2018-02-04 18:53:53 +00:00
L9EEA: ldy #0
2018-02-05 03:13:21 +00:00
lda (ptr),y
sta icon
DESKTOP_DIRECT_CALL DT_UNHIGHLIGHT_ICON, icon
2018-02-16 03:29:05 +00:00
return #0
rts
2018-01-22 07:00:34 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-05 03:13:21 +00:00
;;; ICON_IN_RECT IMPL
2018-02-05 03:13:21 +00:00
.proc ICON_IN_RECT_IMPL
jmp start
2018-02-06 03:01:17 +00:00
icon: .byte 0
2018-02-05 03:13:21 +00:00
rect: DEFINE_RECT 0,0,0,0,rect
2018-02-05 03:13:21 +00:00
start: ldy #0
lda ($06),y
2018-02-05 03:13:21 +00:00
sta icon
ldy #8
: lda ($06),y
sta rect-1,y
dey
2018-02-05 03:13:21 +00:00
bne :-
lda icon
asl a
tax
2018-02-06 17:31:58 +00:00
copy16 icon_ptrs,x, $06
2018-02-05 03:13:21 +00:00
jsr calc_icon_poly
2018-02-06 18:06:44 +00:00
cmp16 poly::v0::ycoord, rect::y2
2018-02-05 03:13:21 +00:00
bpl done
2018-02-06 18:06:44 +00:00
cmp16 poly::v5::ycoord, rect::y1
2018-02-05 03:13:21 +00:00
bmi done
2018-02-06 18:06:44 +00:00
cmp16 poly::v5::xcoord, rect::x2
2018-02-05 03:13:21 +00:00
bpl done
2018-02-06 18:06:44 +00:00
cmp16 poly::v4::xcoord, rect::x1
2018-02-05 03:13:21 +00:00
bmi done
2018-02-06 18:06:44 +00:00
cmp16 poly::v7::ycoord, rect::y2
bmi L9F8F
2018-02-05 03:13:21 +00:00
2018-02-06 18:06:44 +00:00
cmp16 poly::v7::xcoord, rect::x2
2018-02-05 03:13:21 +00:00
bpl done
2018-02-06 18:06:44 +00:00
cmp16 poly::v2::xcoord, rect::x1
bpl L9F8F
2018-02-05 03:13:21 +00:00
2018-02-16 03:29:05 +00:00
done: return #0
2018-02-16 03:29:05 +00:00
L9F8F: return #1
2018-02-05 03:13:21 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-04 18:53:53 +00:00
L9F92: .byte 0
L9F93: .byte 0
L9F94: .byte 0
.byte 0
.byte 0
.byte 0
2018-02-04 18:53:53 +00:00
2018-03-17 04:19:01 +00:00
L9F98: lda #0
sta L9F92
beq L9FA4
2018-02-07 05:59:25 +00:00
L9F9F: lda #$80
sta L9F92
2018-02-07 05:59:25 +00:00
.proc L9FA4
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
lda ($06),y
2018-02-09 05:42:59 +00:00
and #icon_entry_winid_mask
2018-02-07 05:59:25 +00:00
bne :+
lda L9F92
ora #$40
sta L9F92
2018-02-07 05:59:25 +00:00
;; copy icon coords and bits
: ldy #icon_entry_offset_iconx
: lda ($06),y
sta paintbits_params2::viewloc-icon_entry_offset_iconx,y
iny
2018-02-07 05:59:25 +00:00
cpy #icon_entry_offset_iconx + 6 ; x/y/bits
bne :-
2018-02-06 05:49:39 +00:00
jsr push_zp_addrs
2018-02-06 17:31:58 +00:00
copy16 paintbits_params2::mapbits, $08
2018-03-17 04:19:01 +00:00
ldy #11
2018-02-07 05:59:25 +00:00
: lda ($08),y
2018-01-30 16:57:36 +00:00
sta paintbits_params2::mapbits,y
dey
2018-02-07 05:59:25 +00:00
bpl :-
bit L9F92
2018-02-07 05:59:25 +00:00
bpl :+
jsr LA12C
2018-02-07 05:59:25 +00:00
: jsr pop_zp_addrs
ldy #9
: lda ($06),y
sta paintrect_params6::y2,y
iny
cpy #$1D
2018-02-07 05:59:25 +00:00
bne :-
2018-02-04 18:53:53 +00:00
: lda drawtext_params::textlen
2018-01-31 05:42:26 +00:00
sta textwidth_params::textlen
2018-01-30 16:57:36 +00:00
MGTK_CALL MGTK::TextWidth, textwidth_params
2018-01-31 05:42:26 +00:00
lda textwidth_params::result
2018-01-31 05:22:13 +00:00
cmp paintbits_params2::maprect::x2
2018-02-04 18:53:53 +00:00
bcs :+
2018-01-31 05:42:26 +00:00
inc drawtext_params::textlen
ldx drawtext_params::textlen
2018-01-24 04:11:38 +00:00
lda #' '
sta text_buffer-1,x
2018-02-04 18:53:53 +00:00
jmp :-
2018-02-04 18:53:53 +00:00
: lsr a
2018-01-30 16:57:36 +00:00
sta moveto_params2::xcoord+1
2018-01-31 05:22:13 +00:00
lda paintbits_params2::maprect::x2
lsr a
2018-02-07 05:59:25 +00:00
sta moveto_params2::xcoord
2018-01-30 16:57:36 +00:00
lda moveto_params2::xcoord+1
sec
2018-01-30 16:57:36 +00:00
sbc moveto_params2::xcoord
sta moveto_params2::xcoord
2018-02-06 23:36:39 +00:00
sub16_8 paintbits_params2::viewloc::xcoord, moveto_params2::xcoord, moveto_params2::xcoord
2018-02-05 04:04:14 +00:00
add16_8 paintbits_params2::viewloc::ycoord, paintbits_params2::maprect::y2, moveto_params2::ycoord
2018-02-06 18:06:44 +00:00
add16 moveto_params2::ycoord, #1, moveto_params2::ycoord
2018-02-05 04:04:14 +00:00
add16_8 moveto_params2::ycoord, font_height, moveto_params2::ycoord
2018-02-07 05:59:25 +00:00
ldx #3
: lda moveto_params2,x
sta L9F94,x
dex
2018-02-07 05:59:25 +00:00
bpl :-
bit L9F92
bvc LA097
2018-01-30 16:57:36 +00:00
MGTK_CALL MGTK::InitPort, grafport
jsr LA63F
2018-02-07 05:59:25 +00:00
: jsr LA6A3
jsr LA097
lda L9F93
2018-02-07 05:59:25 +00:00
bne :-
2018-01-30 16:57:36 +00:00
MGTK_CALL MGTK::SetPortBits, grafport
rts
2018-01-29 05:18:00 +00:00
LA097: MGTK_CALL MGTK::HideCursor, DESKTOP_DIRECT ; These params should be ignored - bogus?
2018-01-30 16:57:36 +00:00
MGTK_CALL MGTK::SetPenMode, notpencopy_2
bit L9F92
bpl LA0C2
bit L9F92
bvc LA0B6
2018-01-30 16:57:36 +00:00
MGTK_CALL MGTK::SetPenMode, pencopy_2
jmp LA0C2
2018-01-30 16:57:36 +00:00
LA0B6: MGTK_CALL MGTK::PaintBits, paintbits_params
MGTK_CALL MGTK::SetPenMode, penXOR_2
LA0C2: MGTK_CALL MGTK::PaintBits, paintbits_params2
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
lda ($06),y
2018-02-09 05:42:59 +00:00
and #icon_entry_open_mask
beq LA0F2
jsr LA14D
2018-02-07 05:59:25 +00:00
MGTK_CALL MGTK::SetPattern, dark_pattern ; shade for open volume
bit L9F92
bmi LA0E6
2018-01-30 16:57:36 +00:00
MGTK_CALL MGTK::SetPenMode, penBIC_2
beq LA0EC
2018-01-30 16:57:36 +00:00
LA0E6: MGTK_CALL MGTK::SetPenMode, penOR_2
LA0EC: MGTK_CALL MGTK::PaintRect, paintrect_params6
2018-02-07 05:59:25 +00:00
LA0F2: ldx #3
: lda L9F94,x
2018-01-30 16:57:36 +00:00
sta moveto_params2,x
dex
2018-02-07 05:59:25 +00:00
bpl :-
2018-01-30 16:57:36 +00:00
MGTK_CALL MGTK::MoveTo, moveto_params2
bit L9F92
2018-02-07 05:59:25 +00:00
bmi :+
lda #MGTK::textbg_white
bne setbg
: lda #MGTK::textbg_black
setbg: sta settextbg_params
MGTK_CALL MGTK::SetTextBG, settextbg_params
lda text_buffer+1
and #$DF
sta text_buffer+1
2018-01-30 16:57:36 +00:00
MGTK_CALL MGTK::DrawText, drawtext_params
2018-01-29 05:18:00 +00:00
MGTK_CALL MGTK::ShowCursor
rts
2018-02-07 05:59:25 +00:00
LA12C: ldx #.sizeof(paintbits_params)-1
: lda paintbits_params2,x
2018-01-30 16:57:36 +00:00
sta paintbits_params,x
dex
2018-02-07 05:59:25 +00:00
bpl :-
2018-01-31 05:42:26 +00:00
ldy paintbits_params::maprect::y2
2018-01-30 16:57:36 +00:00
LA13A: lda paintbits_params::mapwidth
clc
2018-01-30 16:57:36 +00:00
adc paintbits_params::mapbits
sta paintbits_params::mapbits
bcc LA149
2018-01-30 16:57:36 +00:00
inc paintbits_params::mapbits+1
LA149: dey
bpl LA13A
rts
2018-03-17 04:19:01 +00:00
LA14D: ldx #0
2018-02-14 05:52:36 +00:00
LA14F: add16 paintbits_params2::viewloc::xcoord,x, paintbits_params2::maprect::x1,x, paintrect_params6::x1,x
add16 paintbits_params2::viewloc::xcoord,x, paintbits_params2::maprect::x2,x, paintrect_params6::x2,x
inx
inx
2018-03-17 04:19:01 +00:00
cpx #4
bne LA14F
2018-02-07 05:59:25 +00:00
lda paintrect_params6::y2
sec
2018-03-17 04:19:01 +00:00
sbc #1
2018-02-07 05:59:25 +00:00
sta paintrect_params6::y2
bcs LA189
2018-02-07 05:59:25 +00:00
dec paintrect_params6::y2+1
LA189: rts
2018-02-07 05:59:25 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-05 03:13:21 +00:00
2018-02-13 04:41:17 +00:00
;;; v0 v1
;;; +----------+
;;; | |
;;; | |
;;; | |
;;; v7 | | v2
;;; v6 +-----+ +-----+ v3
;;; | |
;;; v5 +----------------------+ v4
;;;
;;; (Label is always at least as wide as the icon)
2018-02-05 03:13:21 +00:00
.proc calc_icon_poly
2018-02-13 04:41:17 +00:00
entry_ptr := $6
bitmap_ptr := $8
2018-02-06 05:49:39 +00:00
jsr push_zp_addrs
2018-02-13 04:41:17 +00:00
;; v0 - copy from icon entry
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_iconx+3
ldx #3
2018-02-13 04:41:17 +00:00
: lda (entry_ptr),y
sta poly::v0,x
dey
dex
2018-02-13 04:41:17 +00:00
bpl :-
;; Top edge (v0, v1)
2018-02-06 17:31:58 +00:00
copy16 poly::v0::ycoord, poly::v1::ycoord
2018-02-13 04:41:17 +00:00
;; Left edge of icon (v0, v7)
2018-02-06 17:31:58 +00:00
copy16 poly::v0::xcoord, poly::v7::xcoord
2018-02-13 04:41:17 +00:00
ldy #icon_entry_offset_iconbits
lda (entry_ptr),y
sta bitmap_ptr
iny
2018-02-13 04:41:17 +00:00
lda (entry_ptr),y
sta bitmap_ptr+1
;; Right edge of icon (v1, v2)
ldy #8 ; bitmap x2
lda (bitmap_ptr),y
clc
2018-02-04 18:53:53 +00:00
adc poly::v0::xcoord
2018-02-01 19:30:03 +00:00
sta poly::v1::xcoord
sta poly::v2::xcoord
iny
2018-02-13 04:41:17 +00:00
lda (bitmap_ptr),y
2018-02-01 19:30:03 +00:00
adc poly::v0::xcoord+1
sta poly::v1::xcoord+1
sta poly::v2::xcoord+1
2018-02-13 04:41:17 +00:00
;; Bottom edge of icon (v2, v7)
ldy #10 ; bitmap y2
lda (bitmap_ptr),y
clc
2018-02-04 18:53:53 +00:00
adc poly::v0::ycoord
2018-02-01 19:30:03 +00:00
sta poly::v2::ycoord
iny
lda ($08),y
2018-02-04 18:53:53 +00:00
adc poly::v0::ycoord+1
2018-02-01 19:30:03 +00:00
sta poly::v2::ycoord+1
2018-02-13 04:41:17 +00:00
lda poly::v2::ycoord ; 2px down
clc
2018-02-13 04:41:17 +00:00
adc #2
2018-02-01 19:30:03 +00:00
sta poly::v2::ycoord
sta poly::v3::ycoord
sta poly::v6::ycoord
sta poly::v7::ycoord
lda poly::v2::ycoord+1
2018-02-13 04:41:17 +00:00
adc #0
2018-02-01 19:30:03 +00:00
sta poly::v2::ycoord+1
sta poly::v3::ycoord+1
sta poly::v6::ycoord+1
sta poly::v7::ycoord+1
2018-02-13 04:41:17 +00:00
;; Bottom edge of label (v4, v5)
lda font_height
clc
2018-02-01 19:30:03 +00:00
adc poly::v2::ycoord
sta poly::v4::ycoord
sta poly::v5::ycoord
lda poly::v2::ycoord+1
2018-02-13 04:41:17 +00:00
adc #0
2018-02-01 19:30:03 +00:00
sta poly::v4::ycoord+1
sta poly::v5::ycoord+1
2018-02-13 04:41:17 +00:00
;; Compute text width
ldy #icon_entry_size+1
ldx #19 ; len byte + 15 chars + 2 spaces
: lda (entry_ptr),y
sta text_buffer-1,x
dey
dex
2018-02-13 04:41:17 +00:00
bpl :-
;; Pad with spaces until it's at least as wide as the icon
: lda drawtext_params::textlen
2018-01-31 05:42:26 +00:00
sta textwidth_params::textlen
2018-01-30 16:57:36 +00:00
MGTK_CALL MGTK::TextWidth, textwidth_params
2018-02-13 04:41:17 +00:00
ldy #8 ; bitmap x2 offset
2018-01-31 05:42:26 +00:00
lda textwidth_params::result
2018-02-13 04:41:17 +00:00
cmp (bitmap_ptr),y
bcs got_width
2018-01-31 05:42:26 +00:00
inc drawtext_params::textlen
ldx drawtext_params::textlen
2018-01-24 04:11:38 +00:00
lda #' '
sta text_buffer-1,x
2018-02-13 04:41:17 +00:00
jmp :-
2018-02-13 04:41:17 +00:00
got_width:
lsr a ; width / 2
sta text_width
lda ($08),y ; still has bitmap x2 offset
lsr a ; / 2
sta icon_width
;; Left edge of label (v5, v6)
lda text_width
sec
2018-02-13 04:41:17 +00:00
sbc icon_width
sta icon_width
2018-02-05 03:46:41 +00:00
lda poly::v0::xcoord
sec
2018-02-13 04:41:17 +00:00
sbc icon_width
2018-02-01 19:30:03 +00:00
sta poly::v6::xcoord
sta poly::v5::xcoord
lda poly::v0::xcoord+1
2018-02-13 04:41:17 +00:00
sbc #0
2018-02-01 19:30:03 +00:00
sta poly::v6::xcoord+1
sta poly::v5::xcoord+1
2018-02-13 04:41:17 +00:00
;; Right edge of label (v3, v4)
2018-01-31 05:42:26 +00:00
inc textwidth_params::result
inc textwidth_params::result
2018-02-01 19:30:03 +00:00
lda poly::v5::xcoord
clc
2018-01-31 05:42:26 +00:00
adc textwidth_params::result
2018-02-01 19:30:03 +00:00
sta poly::v3::xcoord
sta poly::v4::xcoord
lda poly::v5::xcoord+1
2018-02-07 05:59:25 +00:00
adc #0
2018-02-01 19:30:03 +00:00
sta poly::v3::xcoord+1
sta poly::v4::xcoord+1
2018-02-06 05:49:39 +00:00
jsr pop_zp_addrs
rts
2018-02-13 04:41:17 +00:00
icon_width: .byte 0
text_width: .byte 0
2018-02-05 03:13:21 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-06 03:01:17 +00:00
;;; REDRAW_ICONS IMPL
2018-02-17 07:08:39 +00:00
.proc REDRAW_ICONS_IMPL
jmp LA2AE
2018-02-05 03:13:21 +00:00
;; DT_UNHIGHLIGHT_ICON params
LA2A9: .byte 0
2018-02-05 03:13:21 +00:00
2018-02-06 05:49:39 +00:00
LA2AA: jsr pop_zp_addrs
rts
2018-02-06 05:49:39 +00:00
LA2AE: jsr push_zp_addrs
2018-02-05 16:03:31 +00:00
ldx num_icons
dex
LA2B5: bmi LA2AA
txa
pha
2018-02-05 16:03:31 +00:00
lda icon_table,x
asl a
tax
2018-02-06 17:31:58 +00:00
copy16 icon_ptrs,x, $06
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
lda ($06),y
2018-02-09 05:42:59 +00:00
and #icon_entry_winid_mask
bne LA2DD
2018-02-07 05:59:25 +00:00
ldy #0
lda ($06),y
sta LA2A9
2018-02-05 03:13:21 +00:00
DESKTOP_DIRECT_CALL DT_UNHIGHLIGHT_ICON, LA2A9
LA2DD: pla
tax
dex
jmp LA2B5
2018-02-17 07:08:39 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-17 07:08:39 +00:00
.proc LA2E3
stx LA322
sta LA323
2018-02-07 05:59:25 +00:00
ldx #0
2018-02-05 16:03:31 +00:00
LA2EB: lda icon_table,x
cmp LA323
beq LA2FA
inx
2018-02-05 16:03:31 +00:00
cpx num_icons
bne LA2EB
rts
2018-02-05 16:03:31 +00:00
LA2FA: lda icon_table+1,x
sta icon_table,x
inx
2018-02-05 16:03:31 +00:00
cpx num_icons
bne LA2FA
2018-02-05 16:03:31 +00:00
ldx num_icons
LA309: cpx LA322
beq LA318
lda icon_table-2,x
sta icon_table-1,x
dex
jmp LA309
LA318: ldx LA322
lda LA323
sta icon_table-1,x
rts
LA322: .byte 0
LA323: .byte 0
2018-02-17 07:08:39 +00:00
.endproc
2018-01-28 16:08:39 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-05 05:05:31 +00:00
2018-02-17 07:08:39 +00:00
.proc LA324
stx LA363
sta LA364
2018-02-07 05:59:25 +00:00
ldx #0
2018-02-17 07:08:39 +00:00
: lda highlight_list,x
cmp LA364
beq LA33B
inx
2018-02-05 16:03:31 +00:00
cpx highlight_count
2018-02-17 07:08:39 +00:00
bne :-
rts
2018-02-17 07:08:39 +00:00
.endproc
2018-02-17 07:08:39 +00:00
.proc LA33B
lda highlight_list+1,x
2018-02-05 16:03:31 +00:00
sta highlight_list,x
inx
2018-02-05 16:03:31 +00:00
cpx highlight_count
bne LA33B
2018-02-05 16:03:31 +00:00
ldx highlight_count
2018-02-06 05:49:39 +00:00
: cpx LA363
beq LA359
2018-02-05 16:03:31 +00:00
lda has_highlight,x
sta highlight_count,x
dex
2018-02-06 05:49:39 +00:00
jmp :-
LA359: ldx LA363
lda LA364
2018-02-05 16:03:31 +00:00
sta highlight_count,x
rts
2018-02-17 07:08:39 +00:00
.endproc
LA363: .byte 0
LA364: .byte 0
2018-01-28 16:08:39 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-05 05:05:31 +00:00
2018-02-06 05:49:39 +00:00
.proc push_zp_addrs
;; save return addr
pla
2018-02-06 05:49:39 +00:00
sta stash
pla
sta stash+1
;; push $06...$09 to stack
ldx #0
: lda $06,x
pha
inx
2018-02-06 05:49:39 +00:00
cpx #4
bne :-
;; restore return addr
lda stash+1
pha
2018-02-06 05:49:39 +00:00
lda stash
pha
rts
2018-02-06 05:49:39 +00:00
stash: .word 0
.endproc
2018-01-28 16:08:39 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-05 05:05:31 +00:00
2018-02-06 05:49:39 +00:00
.proc pop_zp_addrs
;; save return addr
pla
2018-02-06 05:49:39 +00:00
sta stash
pla
sta stash+1
;; pull $06...$09 to stack
ldx #3
: pla
sta $06,x
dex
2018-02-06 05:49:39 +00:00
bpl :-
;; restore return addr
lda stash+1
pha
2018-02-06 05:49:39 +00:00
lda stash
pha
rts
2018-02-06 05:49:39 +00:00
stash: .word 0
.endproc
2018-01-28 16:08:39 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-05 05:05:31 +00:00
2018-01-30 16:57:36 +00:00
LA39D: MGTK_CALL MGTK::InitPort, grafport
MGTK_CALL MGTK::SetPort, grafport
jmp LA3B9
LA3AC: .byte 0
LA3AD: .byte 0
2018-02-05 03:13:21 +00:00
;; DT_UNHIGHLIGHT_ICON params
LA3AE: .byte 0
2018-02-05 03:13:21 +00:00
2018-02-06 18:10:34 +00:00
LA3AF: .word 0
LA3B1: .word 0
LA3B3: .byte 0
.byte 0
.byte 0
.byte 0
LA3B7: .byte 0
2018-02-02 06:04:23 +00:00
.proc frontwindow_params
window_id: .byte 0
.endproc
2018-02-06 03:01:17 +00:00
.proc LA3B9
ldy #0
lda ($06),y
sta LA3AC
iny
iny
lda ($06),y
2018-02-06 03:01:17 +00:00
and #$0F ; type - is volume?
sta LA3AD
2018-02-06 03:01:17 +00:00
beq volume
;; File (i.e. icon in window)
lda #$80
sta LA3B7
2018-01-29 05:18:00 +00:00
MGTK_CALL MGTK::SetPattern, white_pattern
2018-02-02 06:04:23 +00:00
MGTK_CALL MGTK::FrontWindow, frontwindow_params
lda frontwindow_params::window_id
sta getwinport_params::window_id
2018-01-30 16:57:36 +00:00
MGTK_CALL MGTK::GetWinPort, getwinport_params
jsr LA4CC
jsr LA938
2018-02-05 05:05:31 +00:00
jsr erase_icon
jmp LA446
2018-02-06 03:01:17 +00:00
;; Volume (i.e. icon on desktop)
volume:
MGTK_CALL MGTK::InitPort, grafport
jsr LA63F
2018-02-06 03:01:17 +00:00
: jsr LA6A3
2018-02-05 05:05:31 +00:00
jsr erase_desktop_icon
lda L9F93
2018-02-06 03:01:17 +00:00
bne :-
2018-01-30 16:57:36 +00:00
MGTK_CALL MGTK::SetPortBits, grafport
jmp LA446
2018-02-06 03:01:17 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-05 05:05:31 +00:00
.proc erase_desktop_icon
lda #0
sta LA3B7
2018-01-29 05:18:00 +00:00
MGTK_CALL MGTK::SetPattern, checkerboard_pattern2
2018-02-05 05:05:31 +00:00
;; fall through
.endproc
.proc erase_icon
2018-02-06 17:31:58 +00:00
copy16 poly::v0::ycoord, LA3B1
copy16 poly::v6::xcoord, LA3AF
2018-02-05 05:05:31 +00:00
ldx #3
: lda poly::v4::xcoord,x
sta LA3B3,x
dex
2018-02-05 05:05:31 +00:00
bpl :-
2018-02-01 19:30:03 +00:00
MGTK_CALL MGTK::PaintPoly, poly
rts
2018-02-05 05:05:31 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-06 05:49:39 +00:00
LA446: jsr push_zp_addrs
2018-02-05 16:03:31 +00:00
ldx num_icons
2018-02-06 17:31:58 +00:00
dex ; any icons to draw?
2018-02-17 07:08:39 +00:00
2018-02-06 17:31:58 +00:00
LA44D: cpx #$FF ; =-1
bne LA466
2018-02-06 17:31:58 +00:00
bit LA3B7 ; no, almost done
bpl :+
2018-01-30 16:57:36 +00:00
MGTK_CALL MGTK::InitPort, grafport
MGTK_CALL MGTK::SetPort, grafport4
2018-02-06 17:31:58 +00:00
: jsr pop_zp_addrs
rts
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-05 05:05:31 +00:00
2018-02-06 17:31:58 +00:00
.proc LA466
ptr := $8
txa
pha
2018-02-05 16:03:31 +00:00
lda icon_table,x
cmp LA3AC
beq LA4C5
asl a
tax
2018-02-06 17:31:58 +00:00
copy16 icon_ptrs,x, ptr
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
2018-02-06 17:31:58 +00:00
lda (ptr),y
2018-02-09 05:42:59 +00:00
and #$07 ; window_id
cmp LA3AD
bne LA4C5
2018-02-06 17:31:58 +00:00
;; Is icon highlighted?
2018-02-05 16:03:31 +00:00
lda has_highlight
beq LA49D
2018-02-06 17:31:58 +00:00
ldy #0 ; icon num
lda (ptr),y
ldx #0
: cmp highlight_list,x
beq LA4C5
inx
2018-02-05 16:03:31 +00:00
cpx highlight_count
2018-02-06 17:31:58 +00:00
bne :-
LA49D: ldy #0 ; icon num
lda (ptr),y
sta LA3AE
bit LA3B7
bpl LA4AC
jsr LA4D3
2018-02-05 03:13:21 +00:00
LA4AC: DESKTOP_DIRECT_CALL DT_ICON_IN_RECT, LA3AE
beq LA4BA
2018-02-05 03:13:21 +00:00
DESKTOP_DIRECT_CALL DT_UNHIGHLIGHT_ICON, LA3AE
LA4BA: bit LA3B7
bpl LA4C5
lda LA3AE
jsr LA4DC
LA4C5: pla
tax
dex
jmp LA44D
2018-02-06 17:31:58 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
LA4CB: .byte 0
LA4CC: lda #$80
sta LA4CB
bmi LA4E2
LA4D3: pha
lda #$40
sta LA4CB
jmp LA4E2
LA4DC: pha
2018-03-17 04:19:01 +00:00
lda #0
sta LA4CB
2018-03-17 04:19:01 +00:00
LA4E2: ldy #0
2018-01-30 16:57:36 +00:00
LA4E4: lda grafport4,y
sta LA567,y
iny
2018-03-17 04:19:01 +00:00
cpy #4
bne LA4E4
2018-03-17 04:19:01 +00:00
ldy #8
2018-01-30 16:57:36 +00:00
LA4F1: lda grafport4,y
sta LA567-4,y
iny
2018-03-17 04:19:01 +00:00
cpy #12
bne LA4F1
bit LA4CB
bmi LA506
bvc LA56F
jmp LA5CB
2018-03-17 04:19:01 +00:00
LA506: ldx #0
2018-02-14 05:52:36 +00:00
LA508: sub16 poly::vertices,x, LA567, poly::vertices,x
sub16 poly::vertices+2,x, LA569, poly::vertices+2,x
inx
inx
inx
inx
2018-03-17 04:19:01 +00:00
cpx #32
bne LA508
2018-03-17 04:19:01 +00:00
ldx #0
2018-02-14 05:52:36 +00:00
LA538: add16 poly::vertices,x, LA56B, poly::vertices,x
add16 poly::vertices+2,x, LA56D, poly::vertices+2,x
inx
inx
inx
inx
2018-03-17 04:19:01 +00:00
cpx #32
bne LA538
rts
LA567: .byte 0
LA568: .byte 0
LA569: .byte 0
LA56A: .byte 0
LA56B: .byte 0
LA56C: .byte 0
LA56D: .byte 0
LA56E: .byte 0
LA56F: pla
tay
2018-02-06 05:49:39 +00:00
jsr push_zp_addrs
tya
asl a
tax
2018-02-06 17:31:58 +00:00
copy16 icon_ptrs,x, $06
2018-03-17 04:19:01 +00:00
ldy #3
lda ($06),y
clc
adc LA567
sta ($06),y
iny
lda ($06),y
adc LA568
sta ($06),y
iny
lda ($06),y
clc
adc LA569
sta ($06),y
iny
lda ($06),y
adc LA56A
sta ($06),y
2018-03-17 04:19:01 +00:00
ldy #3
lda ($06),y
sec
sbc LA56B
sta ($06),y
iny
lda ($06),y
sbc LA56C
sta ($06),y
iny
lda ($06),y
sec
sbc LA56D
sta ($06),y
iny
lda ($06),y
sbc LA56E
sta ($06),y
2018-02-06 05:49:39 +00:00
jsr pop_zp_addrs
rts
LA5CB: pla
tay
2018-02-06 05:49:39 +00:00
jsr push_zp_addrs
tya
asl a
tax
2018-02-06 17:31:58 +00:00
copy16 icon_ptrs,x, $06
2018-03-17 04:19:01 +00:00
ldy #3
lda ($06),y
sec
sbc LA567
sta ($06),y
iny
lda ($06),y
sbc LA568
sta ($06),y
iny
lda ($06),y
sec
sbc LA569
sta ($06),y
iny
lda ($06),y
sbc LA56A
sta ($06),y
2018-03-17 04:19:01 +00:00
ldy #3
lda ($06),y
clc
adc LA56B
sta ($06),y
iny
lda ($06),y
adc LA56C
sta ($06),y
iny
lda ($06),y
clc
adc LA56D
sta ($06),y
iny
lda ($06),y
adc LA56E
sta ($06),y
2018-02-06 05:49:39 +00:00
jsr pop_zp_addrs
rts
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-05 05:05:31 +00:00
2018-02-13 04:41:17 +00:00
LA627: .word 0
LA629: .word 0
2018-02-16 19:25:00 +00:00
LA62B: DEFINE_POINT 0,0
2018-01-30 16:57:36 +00:00
.proc setportbits_params2
2018-02-06 04:37:41 +00:00
viewloc: DEFINE_POINT 0, 0, viewloc
mapbits: .addr MGTK::screen_mapbits
mapwidth: .word MGTK::screen_mapwidth
cliprect: DEFINE_RECT 0, 0, 0, 0, cliprect
.endproc
2018-02-13 04:41:17 +00:00
.proc LA63F
jsr calc_icon_poly
2018-02-05 05:05:31 +00:00
lda poly::v0::ycoord
sta LA629
2018-02-06 04:37:41 +00:00
sta setportbits_params2::cliprect::y1
sta setportbits_params2::viewloc::ycoord
2018-02-04 18:53:53 +00:00
lda poly::v0::ycoord+1
2018-02-13 04:41:17 +00:00
sta LA629+1
2018-02-06 04:37:41 +00:00
sta setportbits_params2::cliprect::y1+1
sta setportbits_params2::viewloc::ycoord+1
2018-02-13 04:41:17 +00:00
2018-02-01 19:30:03 +00:00
lda poly::v5::xcoord
sta LA627
2018-02-06 04:37:41 +00:00
sta setportbits_params2::cliprect::x1
sta setportbits_params2::viewloc::xcoord
2018-02-01 19:30:03 +00:00
lda poly::v5::xcoord+1
2018-02-13 04:41:17 +00:00
sta LA627+1
2018-02-06 04:37:41 +00:00
sta setportbits_params2::cliprect::x1+1
sta setportbits_params2::viewloc::xcoord+1
2018-02-13 04:41:17 +00:00
ldx #3
2018-02-16 19:25:00 +00:00
: lda poly::v4,x
sta LA62B,x
2018-02-06 04:37:41 +00:00
sta setportbits_params2::cliprect::x2,x
dex
2018-02-13 04:41:17 +00:00
bpl :-
cmp16 LA62B, #screen_width - 1
bmi done
lda #<(screen_width - 2)
sta LA62B
2018-02-06 04:37:41 +00:00
sta setportbits_params2::cliprect::x2
2018-02-13 04:41:17 +00:00
lda #>(screen_width - 2)
sta LA62B+1
2018-02-06 04:37:41 +00:00
sta setportbits_params2::cliprect::x2+1
2018-02-13 04:41:17 +00:00
done: MGTK_CALL MGTK::SetPortBits, setportbits_params2
rts
2018-02-13 04:41:17 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-17 07:08:39 +00:00
.proc LA6A3
lda #$00
jmp LA6C7
2018-01-30 16:57:36 +00:00
.proc findwindow_params
2018-01-31 05:42:26 +00:00
mousex: .word 0
mousey: .word 0
2018-02-06 05:49:39 +00:00
which_area: .byte 0
window_id: .byte 0
.endproc
LA6AE: .word 0
LA6B0: .byte $00
LA6B1: .byte $00
LA6B2: .byte $00
LA6B3: .byte $00
LA6B4: .byte $00
LA6B5: .byte $00
LA6B6: .byte $00
LA6B7: .byte $00
LA6B8: .byte $00
LA6B9: .byte $00
LA6BA: .byte $00
LA6BB: .byte $00
LA6BC: .byte $00
LA6BD: .byte $00
LA6BE: .byte $00
LA6BF: .byte $00
LA6C0: .byte $00
LA6C1: .byte $00
LA6C2: .byte $00
LA6C3: .word 0
LA6C5: .word 0
LA6C7: lda L9F93
beq LA6FA
2018-02-06 04:37:41 +00:00
lda setportbits_params2::cliprect::x2
clc
2018-03-17 04:19:01 +00:00
adc #1
2018-02-06 04:37:41 +00:00
sta setportbits_params2::cliprect::x1
sta setportbits_params2::viewloc::xcoord
lda setportbits_params2::cliprect::x2+1
2018-03-17 04:19:01 +00:00
adc #0
2018-02-06 04:37:41 +00:00
sta setportbits_params2::cliprect::x1+1
sta setportbits_params2::viewloc::xcoord+1
2018-03-17 04:19:01 +00:00
ldx #5
LA6E5: lda LA629,x
2018-02-06 04:37:41 +00:00
sta setportbits_params2::cliprect::y1,x
dex
bpl LA6E5
2018-02-06 04:37:41 +00:00
lda setportbits_params2::cliprect::y1
sta setportbits_params2::viewloc::ycoord
lda setportbits_params2::cliprect::y1+1
sta setportbits_params2::viewloc::ycoord+1
LA6FA: lda setportbits_params2::cliprect::x1
sta LA6B3
sta LA6BF
2018-02-06 04:37:41 +00:00
lda setportbits_params2::cliprect::x1+1
sta LA6B4
sta LA6C0
2018-02-06 04:37:41 +00:00
lda setportbits_params2::cliprect::y1
sta LA6B5
sta LA6B9
2018-02-06 04:37:41 +00:00
lda setportbits_params2::cliprect::y1+1
sta LA6B6
sta LA6BA
2018-02-06 04:37:41 +00:00
lda setportbits_params2::cliprect::x2
sta LA6B7
sta LA6BB
2018-02-06 04:37:41 +00:00
lda setportbits_params2::cliprect::x2+1
sta LA6B8
sta LA6BC
2018-02-06 04:37:41 +00:00
lda setportbits_params2::cliprect::y2
sta LA6BD
sta LA6C1
2018-02-06 04:37:41 +00:00
lda setportbits_params2::cliprect::y2+1
sta LA6BE
sta LA6C2
2018-03-17 04:19:01 +00:00
lda #0
sta LA6B0
LA747: lda LA6B0
2018-03-17 04:19:01 +00:00
cmp #4
bne LA775
2018-03-17 04:19:01 +00:00
lda #0
sta LA6B0
2018-01-30 16:57:36 +00:00
LA753: MGTK_CALL MGTK::SetPortBits, setportbits_params2
2018-02-06 04:37:41 +00:00
lda setportbits_params2::cliprect::x2+1
2018-02-13 04:41:17 +00:00
cmp LA62B+1
bne LA76F
2018-02-06 04:37:41 +00:00
lda setportbits_params2::cliprect::x2
cmp LA62B
bcc LA76F
lda #$00
sta L9F93
rts
2018-03-17 04:19:01 +00:00
LA76F: lda #1
sta L9F93
rts
LA775: lda LA6B0
asl a
asl a
tax
ldy #$00
LA77D: lda LA6B3,x
2018-01-30 16:57:36 +00:00
sta findwindow_params,y
iny
inx
2018-03-17 04:19:01 +00:00
cpy #4
bne LA77D
inc LA6B0
2018-01-30 16:57:36 +00:00
MGTK_CALL MGTK::FindWindow, findwindow_params
2018-01-31 05:42:26 +00:00
lda findwindow_params::which_area
beq LA747
2018-01-31 05:42:26 +00:00
lda findwindow_params::window_id
2018-01-30 16:57:36 +00:00
sta getwinport_params
MGTK_CALL MGTK::GetWinPort, getwinport_params
2018-02-06 05:49:39 +00:00
jsr push_zp_addrs
2018-01-31 05:42:26 +00:00
MGTK_CALL MGTK::GetWinPtr, findwindow_params::window_id
copy16 LA6AE, $06
ldy #1
lda ($06),y
and #$01
bne LA7C3
sta LA6B2
beq LA7C8
LA7C3: lda #$80
sta LA6B2
LA7C8: ldy #4
lda ($06),y
and #$80
sta LA6B1
iny
lda ($06),y
and #$80
lsr a
ora LA6B1
sta LA6B1
2018-02-06 18:06:44 +00:00
sub16 grafport4::viewloc::xcoord, #2, grafport4::viewloc::xcoord
2018-02-06 04:37:41 +00:00
sub16 grafport4::cliprect::x1, #2, grafport4::cliprect::x1
bit LA6B2
bmi LA820
2018-02-06 04:37:41 +00:00
lda grafport4::viewloc::ycoord
sec
sbc #14
2018-02-06 04:37:41 +00:00
sta grafport4::viewloc::ycoord
bcs LA812
2018-02-06 04:37:41 +00:00
dec grafport4::viewloc::ycoord+1
LA812: lda grafport4::cliprect::y1
sec
sbc #14
2018-02-06 04:37:41 +00:00
sta grafport4::cliprect::y1
bcs LA820
2018-02-06 04:37:41 +00:00
dec grafport4::cliprect::y1+1
LA820: bit LA6B1
bpl LA833
2018-02-06 04:37:41 +00:00
lda grafport4::cliprect::y2
clc
2018-01-24 23:39:12 +00:00
adc #12
2018-02-06 04:37:41 +00:00
sta grafport4::cliprect::y2
bcc LA833
2018-02-06 04:37:41 +00:00
inc grafport4::cliprect::y2+1
LA833: bit LA6B1
bvc LA846
2018-02-06 04:37:41 +00:00
lda grafport4::cliprect::x2
clc
2018-01-24 23:39:12 +00:00
adc #20
2018-02-06 04:37:41 +00:00
sta grafport4::cliprect::x2
bcc LA846
2018-02-06 04:37:41 +00:00
inc grafport4::cliprect::x2+1
2018-02-06 05:49:39 +00:00
LA846: jsr pop_zp_addrs
2018-02-06 18:06:44 +00:00
sub16 grafport4::cliprect::x2, grafport4::cliprect::x1, LA6C3
sub16 grafport4::cliprect::y2, grafport4::cliprect::y1, LA6C5
lda LA6C3
clc
2018-02-06 04:37:41 +00:00
adc grafport4::viewloc::xcoord
sta LA6C3
2018-02-06 04:37:41 +00:00
lda grafport4::viewloc::xcoord+1
2018-02-10 07:33:54 +00:00
adc LA6C3+1
sta LA6C3+1
2018-02-06 18:06:44 +00:00
add16 LA6C5, grafport4::viewloc::ycoord, LA6C5
cmp16 setportbits_params2::cliprect::x2, LA6C3
bmi LA8B7
2018-02-06 18:06:44 +00:00
add16 LA6C3, #1, setportbits_params2::cliprect::x2
jmp LA8D4
2018-02-06 18:06:44 +00:00
LA8B7: cmp16 grafport4::viewloc::xcoord, setportbits_params2::cliprect::x1
bmi LA8D4
2018-02-06 18:06:44 +00:00
copy16 grafport4::viewloc::xcoord, setportbits_params2::cliprect::x2
jmp LA6FA
2018-02-06 18:06:44 +00:00
LA8D4: cmp16 grafport4::viewloc::ycoord, setportbits_params2::cliprect::y1
bmi LA8F6
2018-02-06 18:06:44 +00:00
copy16 grafport4::viewloc::ycoord, setportbits_params2::cliprect::y2
2018-01-24 23:39:12 +00:00
lda #1
sta L9F93
jmp LA6FA
2018-02-06 18:06:44 +00:00
LA8F6: cmp16 LA6C5, setportbits_params2::cliprect::y2
bpl LA923
lda LA6C5
clc
2018-01-24 23:39:12 +00:00
adc #2
2018-02-06 04:37:41 +00:00
sta setportbits_params2::cliprect::y1
sta setportbits_params2::viewloc::ycoord
2018-02-10 07:33:54 +00:00
lda LA6C5+1
2018-01-24 23:39:12 +00:00
adc #0
2018-02-06 04:37:41 +00:00
sta setportbits_params2::cliprect::y1+1
sta setportbits_params2::viewloc::ycoord+1
2018-01-24 23:39:12 +00:00
lda #1
sta L9F93
jmp LA6FA
2018-02-06 04:37:41 +00:00
LA923: lda setportbits_params2::cliprect::x2
sta setportbits_params2::cliprect::x1
sta setportbits_params2::viewloc::xcoord
lda setportbits_params2::cliprect::x2+1
sta setportbits_params2::cliprect::x1+1
sta setportbits_params2::viewloc::xcoord+1
jmp LA753
2018-02-17 07:08:39 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-17 07:08:39 +00:00
.proc LA938
add16 grafport4::viewloc::ycoord, #15, grafport4::viewloc::ycoord
2018-02-10 07:33:54 +00:00
add16 grafport4::cliprect::y1, #15, grafport4::cliprect::y1
2018-01-30 16:57:36 +00:00
MGTK_CALL MGTK::SetPort, grafport4
rts
2018-02-17 07:08:39 +00:00
.endproc
2018-02-05 05:05:31 +00:00
PAD_TO $A980
2018-03-05 05:36:00 +00:00
;;; ============================================================
;; 5.25" Floppy Disk
floppy140_icon:
2018-01-31 05:42:26 +00:00
.addr floppy140_pixels; mapbits
.byte 4 ; mapwidth
.byte 0 ; reserved
DEFINE_RECT 0, 1, 26, 15 ; maprect
2018-01-07 19:45:52 +00:00
floppy140_pixels:
.byte px(%1010101),px(%0101010),px(%1010101),px(%0101010)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111)
.byte px(%1100000),px(%0000011),px(%1000000),px(%0000110)
.byte px(%1100000),px(%0000011),px(%1000000),px(%0000111)
.byte px(%1100000),px(%0000011),px(%1000000),px(%0000110)
.byte px(%1100000),px(%0000011),px(%1000000),px(%0000111)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000110)
.byte px(%1100000),px(%0000011),px(%1000000),px(%0000111)
.byte px(%1100000),px(%0000111),px(%1100000),px(%0000110)
.byte px(%1100000),px(%0000011),px(%1000000),px(%0000111)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000110)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000111)
.byte px(%1011000),px(%0000000),px(%0000000),px(%0000110)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000111)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000110)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111)
;; RAM Disk
2018-01-13 04:58:02 +00:00
ramdisk_icon:
2018-01-31 05:42:26 +00:00
.addr ramdisk_pixels ; mapbits
.byte 6 ; mapwidth
.byte 0 ; reserved
DEFINE_RECT 1, 0, 38, 11 ; maprect
2018-01-07 19:45:52 +00:00
ramdisk_pixels:
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111101)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0001110)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0001101)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0001110)
.byte px(%1100000),px(%0001111),px(%1000111),px(%1100110),px(%0000110),px(%0001101)
.byte px(%1100000),px(%0001100),px(%1100110),px(%0110111),px(%1011110),px(%0001110)
.byte px(%1100000),px(%0001111),px(%1000111),px(%1110110),px(%1110110),px(%0001101)
.byte px(%1100000),px(%0001100),px(%1100110),px(%0110110),px(%0000110),px(%0001110)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0001101)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1001100),px(%1100110),px(%0001110)
.byte px(%0101010),px(%1010101),px(%0101010),px(%1001100),px(%1100110),px(%0001101)
.byte px(%1010101),px(%0101010),px(%1010101),px(%1111111),px(%1111111),px(%1111110)
;; 3.5" Floppy Disk
floppy800_icon:
2018-01-31 05:42:26 +00:00
.addr floppy800_pixels; mapbits
.byte 3 ; mapwidth
.byte 0 ; reserved
DEFINE_RECT 0, 0, 20, 11 ; maprect
2018-01-07 19:45:52 +00:00
floppy800_pixels:
.byte px(%1111111),px(%1111111),px(%1111110)
.byte px(%1100011),px(%0000000),px(%1100111)
.byte px(%1100011),px(%0000000),px(%1100111)
.byte px(%1100011),px(%1111111),px(%1100011)
.byte px(%1100000),px(%0000000),px(%0000011)
.byte px(%1100000),px(%0000000),px(%0000011)
.byte px(%1100111),px(%1111111),px(%1110011)
.byte px(%1100110),px(%0000000),px(%0110011)
.byte px(%1100110),px(%0000000),px(%0110011)
.byte px(%1100110),px(%0000000),px(%0110011)
.byte px(%1100110),px(%0000000),px(%0110011)
.byte px(%1111111),px(%1111111),px(%1111111)
;; Hard Disk
2018-01-13 04:58:02 +00:00
profile_icon:
2018-01-31 05:42:26 +00:00
.addr profile_pixels ; mapbits
.byte 8 ; mapwidth
.byte 0 ; reserved
DEFINE_RECT 1, 0, 51, 9 ; maprect
2018-01-07 19:45:52 +00:00
profile_pixels:
.byte px(%0111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1110101)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0011010)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0011101)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0011010)
.byte px(%1100011),px(%1000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0011101)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0011101)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0011010)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0011101)
.byte px(%0111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1110101)
.byte px(%1010111),px(%0101010),px(%1010101),px(%0101010),px(%1010101),px(%0101010),px(%1010111),px(%0101010)
;; Trash Can
2018-01-13 04:58:02 +00:00
trash_icon:
2018-01-31 05:42:26 +00:00
.addr trash_pixels ; mapbits
.byte 5 ; mapwidth
.byte 0 ; reserved
DEFINE_RECT 7, 1, 27, 18 ; maprect
2018-01-13 04:58:02 +00:00
trash_pixels:
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%1010101),PX(%1111111),px(%1010101),px(%0000000)
.byte px(%0000000),px(%0101010),PX(%1100011),px(%0101010),px(%0000000)
.byte px(%0000000),PX(%1111111),PX(%1111111),PX(%1111111),px(%0000000)
.byte px(%0000000),px(%1100000),px(%0000000),PX(%0000011),px(%0000000)
.byte px(%0000000),PX(%1111111),PX(%1111111),PX(%1111111),px(%0000000)
.byte px(%0000000),px(%1100000),px(%0000000),px(%0000011),px(%0000000)
.byte px(%0000000),px(%1100001),px(%0000100),px(%0010011),px(%0000000)
.byte px(%0000000),px(%1100010),px(%0001000),px(%0100011),px(%0000000)
.byte px(%0000000),px(%1100010),px(%0001000),px(%0100011),px(%0000000)
.byte px(%0000000),px(%1100010),px(%0001000),px(%0100011),px(%0000000)
.byte px(%0000000),px(%1100010),px(%0001000),px(%0100011),px(%0000000)
.byte px(%0000000),px(%1100010),px(%0001000),px(%0100011),px(%0000000)
.byte px(%0000000),px(%1100010),px(%0001000),px(%0100011),px(%0000000)
.byte px(%0000000),px(%1100010),px(%0001000),px(%0100011),px(%0000000)
.byte px(%0000000),px(%1100010),px(%0001000),px(%0100011),px(%0000000)
.byte px(%0000000),px(%1100001),px(%0000100),px(%0010011),px(%0000000)
.byte px(%0000000),px(%1100000),px(%0000000),px(%0000011),px(%0000000)
.byte px(%0000000),PX(%1111111),PX(%1111111),PX(%1111111),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000)
label_apple:
2018-02-05 05:05:31 +00:00
PASCAL_STRING GLYPH_SAPPLE
label_file:
PASCAL_STRING "File"
label_view:
PASCAL_STRING "View"
label_special:
PASCAL_STRING "Special"
label_startup:
PASCAL_STRING "Startup"
label_selector:
PASCAL_STRING "Selector"
label_new_folder:
PASCAL_STRING "New Folder ..."
label_open:
PASCAL_STRING "Open"
label_close:
PASCAL_STRING "Close"
label_close_all:
PASCAL_STRING "Close All"
label_select_all:
PASCAL_STRING "Select All"
label_copy_file:
PASCAL_STRING "Copy a File ..."
label_delete_file:
PASCAL_STRING "Delete a File ..."
label_eject:
PASCAL_STRING "Eject"
label_quit:
PASCAL_STRING "Quit"
label_by_icon:
PASCAL_STRING "By Icon"
label_by_name:
PASCAL_STRING "By Name"
label_by_date:
PASCAL_STRING "By Date"
label_by_size:
PASCAL_STRING "By Size"
label_by_type:
PASCAL_STRING "By Type"
label_check_drives:
PASCAL_STRING "Check Drives"
label_format_disk:
PASCAL_STRING "Format a Disk ..."
label_erase_disk:
PASCAL_STRING "Erase a Disk ..."
label_disk_copy:
PASCAL_STRING "Disk Copy ..."
label_lock:
PASCAL_STRING "Lock ..."
label_unlock:
PASCAL_STRING "Unlock ..."
label_get_info:
PASCAL_STRING "Get Info ..."
label_get_size:
PASCAL_STRING "Get Size ..."
label_rename_icon:
PASCAL_STRING "Rename an Icon ..."
2018-01-13 05:24:07 +00:00
desktop_menu:
2018-01-30 07:34:12 +00:00
DEFINE_MENU_BAR 6
2018-02-07 05:59:25 +00:00
DEFINE_MENU_BAR_ITEM menu_id_apple, label_apple, apple_menu
DEFINE_MENU_BAR_ITEM menu_id_file, label_file, file_menu
DEFINE_MENU_BAR_ITEM menu_id_view, label_view, view_menu
DEFINE_MENU_BAR_ITEM menu_id_special, label_special, special_menu
DEFINE_MENU_BAR_ITEM menu_id_startup, label_startup, startup_menu
DEFINE_MENU_BAR_ITEM menu_id_selector, label_selector, selector_menu
2018-01-13 05:24:07 +00:00
file_menu:
DEFINE_MENU 12
DEFINE_MENU_ITEM label_new_folder, 'F', 'f'
DEFINE_MENU_SEPARATOR
DEFINE_MENU_ITEM label_open, 'O', 'o'
DEFINE_MENU_ITEM label_close, 'C', 'c'
DEFINE_MENU_ITEM label_close_all, 'B', 'b'
DEFINE_MENU_ITEM label_select_all, 'A', 'a'
DEFINE_MENU_SEPARATOR
DEFINE_MENU_ITEM label_copy_file, 'Y', 'y'
DEFINE_MENU_ITEM label_delete_file, 'D', 'd'
DEFINE_MENU_SEPARATOR
DEFINE_MENU_ITEM label_eject, 'E', 'e'
DEFINE_MENU_ITEM label_quit, 'Q', 'q'
2018-02-19 07:44:08 +00:00
menu_item_id_new_folder := 1
menu_item_id_open := 3
menu_item_id_close := 4
menu_item_id_close_all := 5
menu_item_id_select_all := 6
menu_item_id_copy_file := 8
menu_item_id_delete_file := 9
menu_item_id_eject := 11
menu_item_id_quit := 12
view_menu:
DEFINE_MENU 5
DEFINE_MENU_ITEM label_by_icon, 'J', 'j'
DEFINE_MENU_ITEM label_by_name, 'N', 'n'
DEFINE_MENU_ITEM label_by_date, 'T', 't'
DEFINE_MENU_ITEM label_by_size, 'K', 'k'
DEFINE_MENU_ITEM label_by_type, 'L', 'l'
2018-02-19 07:44:08 +00:00
menu_item_id_view_by_icon := 1
menu_item_id_view_by_name := 2
menu_item_id_view_by_date := 3
menu_item_id_view_by_size := 4
menu_item_id_view_by_type := 5
special_menu:
DEFINE_MENU 13
DEFINE_MENU_ITEM label_check_drives
DEFINE_MENU_SEPARATOR
DEFINE_MENU_ITEM label_format_disk, 'S', 's'
DEFINE_MENU_ITEM label_erase_disk, 'Z', 'z'
DEFINE_MENU_ITEM label_disk_copy
DEFINE_MENU_SEPARATOR
DEFINE_MENU_ITEM label_lock
DEFINE_MENU_ITEM label_unlock
DEFINE_MENU_SEPARATOR
DEFINE_MENU_ITEM label_get_info, 'I', 'i'
DEFINE_MENU_ITEM label_get_size
DEFINE_MENU_SEPARATOR
DEFINE_MENU_ITEM label_rename_icon
2018-02-19 07:44:08 +00:00
menu_item_id_check_drives := 1
menu_item_id_format_disk := 3
menu_item_id_erase_disk := 4
menu_item_id_disk_copy := 5
menu_item_id_lock := 7
menu_item_id_unlock := 8
menu_item_id_get_info := 10
menu_item_id_get_size := 11
menu_item_id_rename_icon := 13
.addr $0000,$0000
2018-01-21 03:33:15 +00:00
.assert * = $AD58, error, "Segment length mismatch"
PAD_TO $AE00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-21 18:44:26 +00:00
2018-01-13 03:23:08 +00:00
;; Rects
2018-01-21 23:37:55 +00:00
confirm_dialog_outer_rect: DEFINE_RECT 4,2,396,98
confirm_dialog_inner_rect: DEFINE_RECT 5,3,395,97
2018-01-21 22:35:37 +00:00
cancel_button_rect: DEFINE_RECT 40,81,140,92
LAE18: DEFINE_RECT 193,30,293,41
2018-01-21 22:35:37 +00:00
ok_button_rect: DEFINE_RECT 260,81,360,92
yes_button_rect: DEFINE_RECT 200,81,240,92
no_button_rect: DEFINE_RECT 260,81,300,92
all_button_rect: DEFINE_RECT 320,81,360,92
2018-01-11 05:36:09 +00:00
str_ok_label:
PASCAL_STRING {"OK ",GLYPH_RETURN}
2018-01-21 23:37:55 +00:00
ok_label_pos: DEFINE_POINT 265,91
cancel_label_pos: DEFINE_POINT 45,91
yes_label_pos: DEFINE_POINT 205,91
no_label_pos: DEFINE_POINT 265,91
all_label_pos: DEFINE_POINT 325,91
2018-01-14 17:18:22 +00:00
.byte $1C,$00,$70,$00
.byte $1C,$00,$87,$00
LAE6C: .byte $00 ; text mask
LAE6D: .byte $7F ; text mask
2018-01-22 07:00:34 +00:00
press_ok_to_rect: DEFINE_RECT 39,25,360,80
2018-01-21 23:37:55 +00:00
prompt_rect: DEFINE_RECT 40,60,360,80
LAE7E: DEFINE_POINT 65,43
LAE82: DEFINE_POINT 65,51
LAE86: DEFINE_RECT 65,35,394,42
LAE8E: DEFINE_RECT 65,43,394,50
2018-01-11 05:36:09 +00:00
str_cancel_label:
PASCAL_STRING "Cancel Esc"
str_yes_label:
PASCAL_STRING " Yes"
str_no_label:
PASCAL_STRING " No"
str_all_label:
PASCAL_STRING " All"
2018-01-21 23:37:55 +00:00
LAEB6: PASCAL_STRING "Source filename:"
LAEC7: PASCAL_STRING "Destination filename:"
2018-01-21 23:37:55 +00:00
;; "About" dialog resources
about_dialog_outer_rect: DEFINE_RECT 4, 2, 396, 108
about_dialog_inner_rect: DEFINE_RECT 5, 3, 395, 107
2018-01-11 07:04:47 +00:00
str_about1: PASCAL_STRING "Apple II DeskTop"
str_about2: PASCAL_STRING "Copyright Apple Computer Inc., 1986"
str_about3: PASCAL_STRING "Copyright Version Soft, 1985 - 1986"
str_about4: PASCAL_STRING "All Rights Reserved"
str_about5: PASCAL_STRING "Authors: Stephane Cavril, Bernard Gallet, Henri Lamiraux"
str_about6: PASCAL_STRING "Richard Danais and Luc Barthelet"
str_about7: PASCAL_STRING "With thanks to: A. Gerard, J. Gerber, P. Pahl, J. Bernard"
str_about8: PASCAL_STRING "November 26, 1986"
str_about9: PASCAL_STRING "Version 1.1"
2018-01-11 07:21:36 +00:00
;; "Copy File" dialog strings
str_copy_title:
PASCAL_STRING "Copy ..."
str_copy_copying:
PASCAL_STRING "Now Copying "
str_copy_from:
PASCAL_STRING "from:"
str_copy_to:
PASCAL_STRING "to :"
str_copy_remaining:
PASCAL_STRING "Files remaining to copy: "
2018-01-11 07:04:47 +00:00
str_exists_prompt:
PASCAL_STRING "That file already exists. Do you want to write over it ?"
str_large_prompt:
PASCAL_STRING "This file is too large to copy, click OK to continue."
LB0B6: DEFINE_POINT 110, 35
LB0BA: DEFINE_POINT 170, 59
2018-01-11 07:21:36 +00:00
;; "Delete" dialog strings
str_delete_title:
2018-01-11 07:04:47 +00:00
PASCAL_STRING "Delete ..."
2018-01-11 07:21:36 +00:00
str_delete_ok:
2018-01-11 07:04:47 +00:00
PASCAL_STRING "Click OK to delete:"
str_ok_empty:
PASCAL_STRING "Clicking OK will immediately empty the trash of:"
2018-01-15 01:06:27 +00:00
str_file_colon:
2018-01-11 07:04:47 +00:00
PASCAL_STRING "File:"
2018-01-11 07:21:36 +00:00
str_delete_remaining:
2018-01-11 07:04:47 +00:00
PASCAL_STRING "Files remaining to be deleted:"
str_delete_locked_file:
PASCAL_STRING "This file is locked, do you want to delete it anyway ?"
LB16A: DEFINE_POINT 145, 59
LB16E: DEFINE_POINT 200, 59
LB172: DEFINE_POINT 300, 59
2018-01-11 07:04:47 +00:00
;; "New Folder" dialog strings
str_new_folder_title:
PASCAL_STRING "New Folder ..."
str_in_colon:
PASCAL_STRING "in:"
str_enter_folder_name:
PASCAL_STRING "Enter the folder name:"
;; "Rename Icon" dialog strings
str_rename_title:
PASCAL_STRING "Rename an Icon ..."
str_rename_old:
PASCAL_STRING "Rename: "
str_rename_new:
PASCAL_STRING "New name:"
;; "Get Info" dialog strings
str_info_title:
PASCAL_STRING "Get Info ..."
str_info_name:
PASCAL_STRING "Name"
str_info_locked:
PASCAL_STRING "Locked"
str_info_size:
PASCAL_STRING "Size"
str_info_create:
PASCAL_STRING "Creation date"
str_info_mod:
PASCAL_STRING "Last modification"
str_info_type:
PASCAL_STRING "Type"
str_info_protected:
PASCAL_STRING "Write protected"
str_info_blocks:
PASCAL_STRING "Blocks free/size"
2018-01-12 06:38:03 +00:00
str_colon:
PASCAL_STRING ": "
LB22D: DEFINE_POINT 160,59
LB231: DEFINE_POINT 145,59
LB235: DEFINE_POINT 200,59
LB239: DEFINE_POINT 185,59
LB23D: DEFINE_POINT 205,59
LB241: DEFINE_POINT 195,59
LB245: PASCAL_STRING "Format a Disk ..."
LB257: PASCAL_STRING "Select the location where the disk is to be formatted"
LB28D: PASCAL_STRING "Enter the name of the new volume:"
LB2AF: PASCAL_STRING "Do you want to format "
LB2C6: PASCAL_STRING "Formatting the disk...."
LB2DE: PASCAL_STRING "Formatting error. Check drive, then click OK to try again."
2018-01-11 07:13:02 +00:00
LB319: PASCAL_STRING "Erase a Disk ..."
LB32A: PASCAL_STRING "Select the location where the disk is to be erased"
LB35D: PASCAL_STRING "Do you want to erase "
LB373: PASCAL_STRING "Erasing the disk...."
LB388: PASCAL_STRING "Erasing error. Check drive, then click OK to try again."
2018-01-11 07:13:02 +00:00
;; "Unlock File" dialog strings
str_unlock_title:
PASCAL_STRING "Unlock ..."
str_unlock_ok:
PASCAL_STRING "Click OK to unlock "
str_unlock_remaining:
PASCAL_STRING "Files remaining to be unlocked: "
;; "Lock File" dialog strings
str_lock_title:
PASCAL_STRING "Lock ..."
str_lock_ok:
PASCAL_STRING "Click OK to lock "
str_lock_remaining:
PASCAL_STRING "Files remaining to be locked: "
;; "Get Size" dialog strings
str_size_title:
PASCAL_STRING "Get Size ..."
str_size_number:
PASCAL_STRING "Number of files"
str_size_blocks:
PASCAL_STRING "Blocks used on disk"
.byte $6E,$00,$23,$00,$6E,$00,$2B,$00
2018-01-11 07:13:02 +00:00
str_download:
PASCAL_STRING "DownLoad ..."
2018-01-14 17:18:22 +00:00
str_ramcard_full:
PASCAL_STRING "The RAMCard is full. The copy was not completed."
2018-01-12 06:38:03 +00:00
str_1_space:
PASCAL_STRING " "
2018-01-11 07:13:02 +00:00
str_warning:
PASCAL_STRING "Warning !"
2018-01-12 06:38:03 +00:00
str_insert_system_disk:
PASCAL_STRING "Please insert the system disk."
str_selector_list_full:
PASCAL_STRING "The Selector list is full. You must delete an entry"
str_before_new_entries:
PASCAL_STRING "before you can add new entries."
str_window_must_be_closed:
PASCAL_STRING "A window must be closed before opening this new catalog."
str_too_many_windows:
PASCAL_STRING "There are too many windows open on the desktop !"
str_save_selector_list:
PASCAL_STRING "Do you want to save the new Selector list"
str_on_system_disk:
PASCAL_STRING "on the system disk ?"
2018-01-21 23:49:54 +00:00
.assert * = $B5D9, error, "Segment length mismatch"
PAD_TO $B600
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-21 00:44:49 +00:00
show_alert_indirection:
jmp show_alert_dialog
alert_bitmap:
.byte px(%0000000),px(%0000000),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(%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)
.byte px(%0111100),px(%1111100),px(%0000011),px(%1100000),px(%0000011),px(%0000000),px(%0000000)
.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)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.proc alert_bitmap_params
2018-01-31 05:42:26 +00:00
DEFINE_POINT 20, 8 ; viewloc
.addr alert_bitmap ; mapbits
.byte 7 ; mapwidth
.byte 0 ; reserved
2018-03-15 03:53:20 +00:00
DEFINE_RECT 0, 0, 36, 23 ; maprect
.endproc
alert_rect:
DEFINE_RECT 65, 87, 485, 142
alert_inner_frame_rect1:
DEFINE_RECT 4, 2, 416, 53
alert_inner_frame_rect2:
DEFINE_RECT 5, 3, 415, 52
2018-02-06 04:37:41 +00:00
.proc portmap
2018-03-15 03:53:20 +00:00
viewloc: DEFINE_POINT 65, 87, viewloc
2018-02-02 06:04:23 +00:00
mapbits: .addr MGTK::screen_mapbits
mapwidth: .byte MGTK::screen_mapwidth
reserved: .byte 0
2018-03-15 03:53:20 +00:00
maprect: DEFINE_RECT 0, 0, 420, 55, maprect
2018-02-02 06:04:23 +00:00
.endproc
2018-01-21 00:44:49 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-21 00:44:49 +00:00
;;; Show Alert Dialog
;;; Call show_alert_dialog with prompt number in X (???), A = ???
.proc show_alert_dialog_impl
ok_label:
PASCAL_STRING {"OK ",GLYPH_RETURN}
try_again_rect:
DEFINE_RECT 20,37,120,48
try_again_pos:
DEFINE_POINT 25,47
cancel_rect:
DEFINE_RECT 300,37,400,48
2018-01-21 00:44:49 +00:00
cancel_pos:
DEFINE_POINT 305,47
2018-01-21 00:44:49 +00:00
.word $BE,$10 ; ???
2018-02-10 06:59:05 +00:00
pos_prompt: DEFINE_POINT 75,29, pos_prompt
alert_action: .byte $00
2018-02-02 06:04:23 +00:00
prompt_addr: .addr 0
try_again_label:
PASCAL_STRING "Try Again A"
cancel_label:
PASCAL_STRING "Cancel Esc"
err_00: PASCAL_STRING "System Error"
err_27: PASCAL_STRING "I/O error"
err_28: PASCAL_STRING "No device connected"
err_2B: PASCAL_STRING "The disk is write protected."
err_40: PASCAL_STRING "The syntax of the pathname is invalid."
err_44: PASCAL_STRING "Part of the pathname doesn't exist."
err_45: PASCAL_STRING "The volume cannot be found."
err_46: PASCAL_STRING "The file cannot be found."
err_47: PASCAL_STRING "That name already exists. Please use another name."
err_48: PASCAL_STRING "The disk is full."
err_49: PASCAL_STRING "The volume directory cannot hold more than 51 files."
err_4E: PASCAL_STRING "The file is locked."
err_52: PASCAL_STRING "This is not a ProDOS disk."
err_57: PASCAL_STRING "There is another volume with that name on the desktop."
2018-01-21 00:44:49 +00:00
;; Below are internal (not ProDOS MLI) error codes.
err_F9: PASCAL_STRING "There are 2 volumes with the same name."
err_FA: PASCAL_STRING "This file cannot be run."
err_FB: PASCAL_STRING "That name is too long."
err_FC: PASCAL_STRING "Please insert source disk"
err_FD: PASCAL_STRING "Please insert destination disk"
err_FE: PASCAL_STRING "BASIC.SYSTEM not found"
;; number of alert messages
alert_count:
.byte 20
;; message number-to-index table
;; (look up by scan to determine index)
alert_table:
2018-01-21 22:35:37 +00:00
;; ProDOS MLI error codes:
.byte $00,$27,$28,$2B,$40,$44,$45,$46
2018-01-21 22:35:37 +00:00
.byte $47,$48,$49,$4E,$52,$57
;; Internal error codes:
.byte $F9,$FA,$FB,$FC,$FD,$FE
;; alert index to string address
prompt_table:
.addr err_00,err_27,err_28,err_2B,err_40,err_44,err_45,err_46
.addr err_47,err_48,err_49,err_4E,err_52,err_57,err_F9,err_FA
.addr err_FB,err_FC,err_FD,err_FE
;; alert index to action (0 = Cancel, $80 = Try Again)
alert_action_table:
.byte $00,$00,$00,$80,$00,$80,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$80,$80,$00
2018-01-21 00:44:49 +00:00
;; Actual entry point
start: pha
txa
pha
2018-01-29 05:18:00 +00:00
MGTK_RELAY2_CALL MGTK::HideCursor
MGTK_RELAY2_CALL MGTK::SetCursor, pointer_cursor
MGTK_RELAY2_CALL MGTK::ShowCursor
2018-01-24 23:39:12 +00:00
;; play bell
sta ALTZPOFF
sta ROMIN2
2018-01-11 05:10:24 +00:00
jsr BELL1
sta ALTZPON
lda LCBANK1
lda LCBANK1
2018-01-24 23:39:12 +00:00
ldx #$03
lda #$00
2018-02-06 04:37:41 +00:00
LBA0B: sta grafport3_viewloc_xcoord,x
2018-01-30 16:57:36 +00:00
sta grafport3_cliprect_x1,x
dex
bpl LBA0B
2018-02-06 17:31:58 +00:00
copy16 #$226, grafport3_cliprect_x2
copy16 #$B9, grafport3_cliprect_y2
2018-01-30 16:57:36 +00:00
MGTK_RELAY2_CALL MGTK::SetPort, grafport3
2018-02-09 05:42:59 +00:00
addr_call_indirect LBF8B, portmap::viewloc::xcoord
sty LBFCA
sta LBFCD
2018-02-06 04:37:41 +00:00
lda portmap::viewloc::xcoord
clc
2018-02-06 04:37:41 +00:00
adc portmap::maprect::x2
pha
2018-02-06 04:37:41 +00:00
lda portmap::viewloc::xcoord+1
adc portmap::maprect::x2+1
tax
pla
jsr LBF8B
sty LBFCC
sta LBFCE
2018-02-06 04:37:41 +00:00
lda portmap::viewloc::ycoord
sta LBFC9
clc
2018-02-06 04:37:41 +00:00
adc portmap::maprect::y2
sta LBFCB
2018-01-29 05:18:00 +00:00
MGTK_RELAY2_CALL MGTK::HideCursor
jsr LBE08
2018-01-29 05:18:00 +00:00
MGTK_RELAY2_CALL MGTK::ShowCursor
2018-01-30 16:57:36 +00:00
MGTK_RELAY2_CALL MGTK::SetPenMode, pencopy
2018-01-29 05:18:00 +00:00
MGTK_RELAY2_CALL MGTK::PaintRect, alert_rect ; alert background
2018-01-30 16:57:36 +00:00
MGTK_RELAY2_CALL MGTK::SetPenMode, penXOR ; ensures corners are inverted
2018-01-29 05:18:00 +00:00
MGTK_RELAY2_CALL MGTK::FrameRect, alert_rect ; alert outline
2018-02-06 04:37:41 +00:00
MGTK_RELAY2_CALL MGTK::SetPortBits, portmap::viewloc::xcoord
2018-01-29 05:18:00 +00:00
MGTK_RELAY2_CALL MGTK::FrameRect, alert_inner_frame_rect1 ; inner 2x border
MGTK_RELAY2_CALL MGTK::FrameRect, alert_inner_frame_rect2
2018-01-30 16:57:36 +00:00
MGTK_RELAY2_CALL MGTK::SetPenMode, pencopy
2018-01-29 05:18:00 +00:00
MGTK_RELAY2_CALL MGTK::HideCursor
MGTK_RELAY2_CALL MGTK::PaintBits, alert_bitmap_params
MGTK_RELAY2_CALL MGTK::ShowCursor
pla
tax
pla
ldy alert_count
dey
LBAE5: cmp alert_table,y
beq LBAEF
dey
bpl LBAE5
ldy #$00
LBAEF: tya
asl a
tay
2018-02-06 17:31:58 +00:00
copy16 prompt_table,y, prompt_addr
cpx #$00
beq LBB0B
txa
and #$FE
sta alert_action
jmp LBB14
LBB0B: tya
lsr a
tay
lda alert_action_table,y
sta alert_action
2018-01-30 16:57:36 +00:00
LBB14: MGTK_RELAY2_CALL MGTK::SetPenMode, penXOR
bit alert_action
bpl LBB5C
2018-01-29 05:18:00 +00:00
MGTK_RELAY2_CALL MGTK::FrameRect, cancel_rect
MGTK_RELAY2_CALL MGTK::MoveTo, cancel_pos
2018-02-06 05:49:39 +00:00
addr_call draw_pascal_string, cancel_label
bit alert_action
bvs LBB5C
2018-01-29 05:18:00 +00:00
MGTK_RELAY2_CALL MGTK::FrameRect, try_again_rect
MGTK_RELAY2_CALL MGTK::MoveTo, try_again_pos
2018-02-06 05:49:39 +00:00
addr_call draw_pascal_string, try_again_label
jmp LBB75
2018-01-29 05:18:00 +00:00
LBB5C: MGTK_RELAY2_CALL MGTK::FrameRect, try_again_rect
MGTK_RELAY2_CALL MGTK::MoveTo, try_again_pos
2018-02-06 05:49:39 +00:00
addr_call draw_pascal_string, ok_label
2018-02-10 06:59:05 +00:00
LBB75: MGTK_RELAY2_CALL MGTK::MoveTo, pos_prompt
2018-02-09 05:42:59 +00:00
addr_call_indirect draw_pascal_string, prompt_addr
2018-01-30 16:57:36 +00:00
LBB87: MGTK_RELAY2_CALL MGTK::GetEvent, event_params
2018-02-28 02:38:18 +00:00
lda event_kind
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_button_down
bne LBB9A
jmp LBC0C
2018-02-03 04:10:19 +00:00
LBB9A: cmp #MGTK::event_kind_key_down
bne LBB87
2018-02-28 02:38:18 +00:00
lda event_key
and #$7F
bit alert_action
bpl LBBEE
2018-02-27 04:13:18 +00:00
cmp #CHAR_ESCAPE
bne LBBC3
2018-01-30 16:57:36 +00:00
MGTK_RELAY2_CALL MGTK::SetPenMode, penXOR
2018-01-29 05:18:00 +00:00
MGTK_RELAY2_CALL MGTK::PaintRect, cancel_rect
lda #$01
jmp LBC55
LBBC3: bit alert_action
bvs LBBEE
2018-01-12 07:03:53 +00:00
cmp #'a'
bne LBBE3
2018-01-30 16:57:36 +00:00
LBBCC: MGTK_RELAY2_CALL MGTK::SetPenMode, penXOR
2018-01-29 05:18:00 +00:00
MGTK_RELAY2_CALL MGTK::PaintRect, try_again_rect
lda #$00
jmp LBC55
2018-01-12 07:03:53 +00:00
LBBE3: cmp #'A'
beq LBBCC
2018-03-17 04:19:01 +00:00
cmp #CHAR_RETURN
beq LBBCC
jmp LBB87
2018-02-27 04:13:18 +00:00
LBBEE: cmp #CHAR_RETURN
bne LBC09
2018-01-30 16:57:36 +00:00
MGTK_RELAY2_CALL MGTK::SetPenMode, penXOR
2018-01-29 05:18:00 +00:00
MGTK_RELAY2_CALL MGTK::PaintRect, try_again_rect
lda #$02
jmp LBC55
LBC09: jmp LBB87
LBC0C: jsr LBDE1
2018-02-28 02:38:18 +00:00
MGTK_RELAY2_CALL MGTK::MoveTo, event_coords
bit alert_action
bpl LBC42
2018-01-29 05:18:00 +00:00
MGTK_RELAY2_CALL MGTK::InRect, cancel_rect
2018-02-04 04:06:16 +00:00
cmp #MGTK::inrect_inside
2018-02-04 07:22:56 +00:00
bne :+
jmp LBCE9
2018-02-04 07:22:56 +00:00
: bit alert_action
bvs LBC42
2018-01-29 05:18:00 +00:00
MGTK_RELAY2_CALL MGTK::InRect, try_again_rect
2018-02-04 04:06:16 +00:00
cmp #MGTK::inrect_inside
bne LBC52
jmp LBC6D
2018-01-29 05:18:00 +00:00
LBC42: MGTK_RELAY2_CALL MGTK::InRect, try_again_rect
2018-02-04 04:06:16 +00:00
cmp #MGTK::inrect_inside
bne LBC52
jmp LBD65
LBC52: jmp LBB87
LBC55: pha
2018-01-29 05:18:00 +00:00
MGTK_RELAY2_CALL MGTK::HideCursor
jsr LBE5D
2018-01-29 05:18:00 +00:00
MGTK_RELAY2_CALL MGTK::ShowCursor
pla
rts
2018-01-30 16:57:36 +00:00
LBC6D: MGTK_RELAY2_CALL MGTK::SetPenMode, penXOR
2018-01-29 05:18:00 +00:00
MGTK_RELAY2_CALL MGTK::PaintRect, try_again_rect
lda #$00
sta LBCE8
2018-01-30 16:57:36 +00:00
LBC84: MGTK_RELAY2_CALL MGTK::GetEvent, event_params
2018-02-28 02:38:18 +00:00
lda event_kind
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_button_up
beq LBCDB
jsr LBDE1
2018-02-28 02:38:18 +00:00
MGTK_RELAY2_CALL MGTK::MoveTo, event_coords
2018-01-29 05:18:00 +00:00
MGTK_RELAY2_CALL MGTK::InRect, try_again_rect
2018-02-04 04:06:16 +00:00
cmp #MGTK::inrect_inside
beq LBCB5
lda LBCE8
beq LBCBD
jmp LBC84
LBCB5: lda LBCE8
bne LBCBD
jmp LBC84
2018-01-30 16:57:36 +00:00
LBCBD: MGTK_RELAY2_CALL MGTK::SetPenMode, penXOR
2018-01-29 05:18:00 +00:00
MGTK_RELAY2_CALL MGTK::PaintRect, try_again_rect
lda LBCE8
clc
adc #$80
sta LBCE8
jmp LBC84
LBCDB: lda LBCE8
beq LBCE3
jmp LBB87
LBCE3: lda #$00
jmp LBC55
LBCE8: .byte 0
2018-01-30 16:57:36 +00:00
LBCE9: MGTK_RELAY2_CALL MGTK::SetPenMode, penXOR
2018-01-29 05:18:00 +00:00
MGTK_RELAY2_CALL MGTK::PaintRect, cancel_rect
lda #$00
sta LBD64
2018-01-30 16:57:36 +00:00
LBD00: MGTK_RELAY2_CALL MGTK::GetEvent, event_params
2018-02-28 02:38:18 +00:00
lda event_kind
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_button_up
beq LBD57
jsr LBDE1
2018-02-28 02:38:18 +00:00
MGTK_RELAY2_CALL MGTK::MoveTo, event_coords
2018-01-29 05:18:00 +00:00
MGTK_RELAY2_CALL MGTK::InRect, cancel_rect
2018-02-04 04:06:16 +00:00
cmp #MGTK::inrect_inside
beq LBD31
lda LBD64
beq LBD39
jmp LBD00
LBD31: lda LBD64
bne LBD39
jmp LBD00
2018-01-30 16:57:36 +00:00
LBD39: MGTK_RELAY2_CALL MGTK::SetPenMode, penXOR
2018-01-29 05:18:00 +00:00
MGTK_RELAY2_CALL MGTK::PaintRect, cancel_rect
lda LBD64
clc
adc #$80
sta LBD64
jmp LBD00
LBD57: lda LBD64
beq LBD5F
jmp LBB87
LBD5F: lda #$01
jmp LBC55
LBD64: .byte 0
LBD65: lda #$00
sta LBDE0
2018-01-30 16:57:36 +00:00
MGTK_RELAY2_CALL MGTK::SetPenMode, penXOR
2018-01-29 05:18:00 +00:00
MGTK_RELAY2_CALL MGTK::PaintRect, try_again_rect
2018-01-30 16:57:36 +00:00
LBD7C: MGTK_RELAY2_CALL MGTK::GetEvent, event_params
2018-02-28 02:38:18 +00:00
lda event_kind
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_button_up
beq LBDD3
jsr LBDE1
2018-02-28 02:38:18 +00:00
MGTK_RELAY2_CALL MGTK::MoveTo, event_coords
2018-01-29 05:18:00 +00:00
MGTK_RELAY2_CALL MGTK::InRect, try_again_rect
2018-02-04 04:06:16 +00:00
cmp #MGTK::inrect_inside
beq LBDAD
lda LBDE0
beq LBDB5
jmp LBD7C
LBDAD: lda LBDE0
bne LBDB5
jmp LBD7C
2018-01-30 16:57:36 +00:00
LBDB5: MGTK_RELAY2_CALL MGTK::SetPenMode, penXOR
2018-01-29 05:18:00 +00:00
MGTK_RELAY2_CALL MGTK::PaintRect, try_again_rect
lda LBDE0
clc
adc #$80
sta LBDE0
jmp LBD7C
LBDD3: lda LBDE0
beq LBDDB
jmp LBB87
LBDDB: lda #$02
jmp LBC55
2018-01-21 00:44:49 +00:00
.endproc
show_alert_dialog := show_alert_dialog_impl::start
2018-03-05 05:36:00 +00:00
;;; ============================================================
LBDE0: .byte 0
2018-02-28 02:38:18 +00:00
LBDE1: sub16 event_xcoord, portmap::viewloc::xcoord, event_xcoord
sub16 event_ycoord, portmap::viewloc::ycoord, event_ycoord
rts
2018-02-17 07:08:39 +00:00
.proc LBE08
2018-02-24 05:12:41 +00:00
copy16 #$0800, LBE37
lda LBFC9
jsr LBF10
lda LBFCB
sec
sbc LBFC9
tax
inx
LBE21: lda LBFCA
sta LBE5C
LBE27: lda LBE5C
lsr a
tay
sta PAGE2OFF ; main $2000-$3FFF
bcs LBE34
sta PAGE2ON ; aux $2000-$3FFF
LBE34: lda ($06),y
LBE37 := * + 1
LBE38 := * + 2
2018-01-17 03:36:54 +00:00
sta dummy1234
2018-02-26 00:06:17 +00:00
inc16 LBE37
lda LBE5C
cmp LBFCC
bcs LBE4E
inc LBE5C
bne LBE27
LBE4E: jsr LBF52
dex
bne LBE21
2018-02-05 04:21:34 +00:00
ldax LBE37
rts
.byte 0
LBE5C: .byte 0
2018-02-17 07:08:39 +00:00
.endproc
.proc LBE5D
copy16 #$800, LBEBC
ldx LBFCD
ldy LBFCE
lda #$FF
cpx #$00
beq LBE78
LBE73: clc
rol a
dex
bne LBE73
LBE78: sta LBF0C
eor #$FF
sta LBF0D
lda #$01
cpy #$00
beq LBE8B
LBE86: sec
rol a
dey
bne LBE86
LBE8B: sta LBF0E
eor #$FF
sta LBF0F
lda LBFC9
jsr LBF10
lda LBFCB
sec
sbc LBFC9
tax
inx
lda LBFCA
sta LBF0B
LBEA8: lda LBFCA
sta LBF0B
LBEAE: lda LBF0B
lsr a
tay
sta PAGE2OFF ; main $2000-$3FFF
2018-01-21 22:35:37 +00:00
bcs :+
sta PAGE2ON ; aux $2000-$3FFF
2018-01-21 22:35:37 +00:00
LBEBC := *+1
: lda $0800 ; self-modified
pha
lda LBF0B
cmp LBFCA
beq LBEDD
cmp LBFCC
bne LBEEB
lda ($06),y
and LBF0F
sta ($06),y
pla
and LBF0E
ora ($06),y
pha
jmp LBEEB
LBEDD: lda ($06),y
and LBF0D
sta ($06),y
pla
and LBF0C
ora ($06),y
pha
LBEEB: pla
sta ($06),y
2018-02-26 00:06:17 +00:00
inc16 LBEBC
lda LBF0B
cmp LBFCC
bcs LBF03
inc LBF0B
bne LBEAE
LBF03: jsr LBF52
dex
bne LBEA8
rts
.byte $00
LBF0B: .byte $00
LBF0C: .byte $00
LBF0D: .byte $00
LBF0E: .byte $00
LBF0F: .byte $00
2018-02-17 07:08:39 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-17 07:08:39 +00:00
.proc LBF10
sta LBFCF
and #$07
sta LBFB0
lda LBFCF
and #$38
sta LBFAF
lda LBFCF
and #$C0
sta LBFAE
jsr LBF2C
rts
2018-02-17 07:08:39 +00:00
.endproc
2018-02-17 07:08:39 +00:00
.proc LBF2C
lda LBFAE
lsr a
lsr a
ora LBFAE
pha
lda LBFAF
lsr a
lsr a
lsr a
lsr a
sta LBF51
pla
ror a
sta $06
lda LBFB0
asl a
asl a
ora LBF51
ora #$20
sta $07
clc
rts
LBF51: .byte 0
2018-02-17 07:08:39 +00:00
.endproc
.proc LBF52
lda LBFB0
cmp #$07
beq LBF5F
inc LBFB0
jmp LBF2C
LBF5F: lda #$00
sta LBFB0
lda LBFAF
cmp #$38
beq LBF74
clc
adc #$08
sta LBFAF
jmp LBF2C
LBF74: lda #$00
sta LBFAF
lda LBFAE
clc
adc #$40
sta LBFAE
cmp #$C0
beq LBF89
jmp LBF2C
LBF89: sec
rts
2018-02-17 07:08:39 +00:00
.endproc
2018-02-17 07:08:39 +00:00
.proc LBF8B
ldy #$00
cpx #$02
bne LBF96
ldy #$49
clc
adc #$01
LBF96: cpx #$01
bne LBFA4
ldy #$24
clc
adc #$04
bcc LBFA4
iny
sbc #$07
LBFA4: cmp #$07
bcc LBFAD
sbc #$07
iny
bne LBFA4
LBFAD: rts
2018-02-17 07:08:39 +00:00
.endproc
LBFAE: .byte $00
LBFAF: .byte $00
LBFB0: .byte $00,$FF,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00
LBFC9: .byte $00
LBFCA: .byte $00
LBFCB: .byte $00
LBFCC: .byte $00
LBFCD: .byte $00
LBFCE: .byte $00
LBFCF: .byte $00
;; Draw pascal string; address in (X,A)
.proc draw_pascal_string
ptr := $06
2018-02-05 04:35:19 +00:00
stax ptr
ldy #$00
lda (ptr),y ; Check length
beq end
sta ptr+2
inc ptr
bne call
inc ptr+1
2018-01-29 05:18:00 +00:00
call: MGTK_RELAY2_CALL MGTK::DrawText, ptr
end: rts
.endproc
2018-01-29 05:18:00 +00:00
;; MGTK call in Y, params addr (X,A)
.proc MGTK_RELAY2
sty call
2018-02-05 04:35:19 +00:00
stax addr
2018-01-29 05:18:00 +00:00
jsr MGTK::MLI
call: .byte 0
addr: .addr 0
rts
.endproc
2018-01-21 03:33:15 +00:00
.assert * = $BFFC, error, "Segment length mismatch"
PAD_TO $C000
.endproc ; desktop_aux
2018-03-05 05:36:00 +00:00
;;; ============================================================
;;;
;;; $C000 - $CFFF is I/O Space
;;;
2018-03-05 05:36:00 +00:00
;;; ============================================================
.org $D000
2018-02-07 05:59:25 +00:00
;;; Constants needed in both main and aux
menu_id_apple := 1
menu_id_file := 2
menu_id_view := 4
menu_id_special := 5
menu_id_startup := 8
menu_id_selector := 3
;;; Various routines callable from MAIN
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-29 05:18:00 +00:00
;;; MGTK call from main>aux, call in Y, params at (X,A)
2018-02-21 04:36:46 +00:00
.proc MGTK_RELAY_IMPL
.assert * = MGTK_RELAY, error, "Entry point mismatch"
sty addr-1
2018-02-05 04:35:19 +00:00
stax addr
sta RAMRDON
sta RAMWRTON
2018-01-29 05:18:00 +00:00
MGTK_CALL 0, 0, addr
sta RAMRDOFF
sta RAMWRTOFF
rts
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-05 05:05:54 +00:00
;;; SET_POS with params at (X,A) followed by DRAW_TEXT call
2018-02-10 06:59:05 +00:00
.proc SETPOS_DRAWTEXT_RELAY
2018-02-05 04:35:19 +00:00
stax addr
sta RAMRDON
sta RAMWRTON
2018-01-29 05:18:00 +00:00
MGTK_CALL MGTK::MoveTo, 0, addr
MGTK_RELAY_CALL MGTK::DrawText, text_buffer2
tay
sta RAMRDOFF
sta RAMWRTOFF
tya
rts
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-05 05:05:54 +00:00
;;; DESKTOP call from main>aux, call in Y params at (X,A)
2018-02-21 04:36:46 +00:00
.proc DESKTOP_RELAY_IMPL
.assert * = DESKTOP_RELAY, error, "Entry point mismatch"
sty addr-1
2018-02-05 04:35:19 +00:00
stax addr
sta RAMRDON
sta RAMWRTON
DESKTOP_CALL 0, 0, addr
tay
sta RAMRDOFF
sta RAMWRTOFF
tya
rts
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-09 05:42:59 +00:00
;;; Used/Free icon map (Aux $1F80 - $1FFF)
free_icon_map := $1F80
;;; Find first available free icon in the map; if
;;; available, mark it and return index+1.
2018-01-05 05:05:54 +00:00
2018-02-08 05:36:53 +00:00
.proc DESKTOP_ALLOC_ICON
sta RAMRDON
sta RAMWRTON
ldx #0
2018-02-09 05:42:59 +00:00
loop: lda free_icon_map,x
beq :+
inx
cpx #$7F
bne loop
rts
: inx
txa
dex
tay
lda #1
2018-02-09 05:42:59 +00:00
sta free_icon_map,x
sta RAMRDOFF
sta RAMWRTOFF
tya
rts
.endproc
2018-02-09 05:42:59 +00:00
;;; Mark the specified icon as free
2018-01-05 05:05:54 +00:00
2018-02-08 05:36:53 +00:00
.proc DESKTOP_FREE_ICON
tay
sta RAMRDON
sta RAMWRTON
dey
lda #0
2018-02-09 05:42:59 +00:00
sta free_icon_map,y
sta RAMRDOFF
sta RAMWRTOFF
rts
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-08 05:48:19 +00:00
;;; Copy data to/from buffers (see cached_window_id / cached_window_icon_list / window_icon_count_table/2) ???
2018-01-05 05:05:54 +00:00
.proc DESKTOP_COPY_BUF_IMPL
ptr := $6
2018-01-05 05:05:54 +00:00
from:
lda #$80
bne :+ ; always
2018-01-05 05:05:54 +00:00
to:
lda #$00
: sta flag
2018-01-11 06:31:02 +00:00
jsr desktop_main_push_zp_addrs
2018-02-08 05:48:19 +00:00
lda cached_window_id
asl a ; * 2
tax
2018-02-08 05:48:19 +00:00
copy16 window_icon_count_table,x, ptr
sta RAMRDON
sta RAMWRTON
bit flag
bpl set_length
2018-02-08 05:48:19 +00:00
;; assign length from cached_window_icon_list
lda cached_window_icon_count
ldy #0
sta (ptr),y
jmp set_copy_ptr
2018-02-08 05:48:19 +00:00
;; assign length to cached_window_icon_list
set_length:
ldy #0
lda (ptr),y
2018-02-08 05:48:19 +00:00
sta cached_window_icon_count
set_copy_ptr:
2018-02-08 05:48:19 +00:00
copy16 window_icon_list_table,x, ptr
bit flag
bmi copy_from
2018-02-08 05:48:19 +00:00
;; copy into cached_window_icon_list
ldy #0 ; flag clear...
2018-02-08 05:48:19 +00:00
: cpy cached_window_icon_count
beq done
lda (ptr),y
2018-02-08 05:48:19 +00:00
sta cached_window_icon_list,y
iny
jmp :-
2018-02-08 05:48:19 +00:00
;; copy from cached_window_icon_list
copy_from:
ldy #0
2018-02-08 05:48:19 +00:00
: cpy cached_window_icon_count
beq done
2018-02-08 05:48:19 +00:00
lda cached_window_icon_list,y
sta (ptr),y
iny
jmp :-
done: sta RAMRDOFF
sta RAMWRTOFF
2018-01-11 06:31:02 +00:00
jsr desktop_main_pop_zp_addrs
rts
flag: .byte 0
rts ; ???
.endproc
2018-01-05 05:05:54 +00:00
DESKTOP_COPY_FROM_BUF := DESKTOP_COPY_BUF_IMPL::from
DESKTOP_COPY_TO_BUF := DESKTOP_COPY_BUF_IMPL::to
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-03 04:41:42 +00:00
;;; Assign active state to active_window_id window
2018-01-05 05:05:54 +00:00
.proc DESKTOP_ASSIGN_STATE
src := $6
dst := $8
sta RAMRDON
sta RAMWRTON
2018-01-29 05:18:00 +00:00
MGTK_CALL MGTK::GetPort, src ; grab window state
2018-02-03 04:41:42 +00:00
lda active_window_id ; which desktop window?
asl a
tax
2018-02-06 17:31:58 +00:00
copy16 win_table,x, dst
lda dst
clc
adc #20 ; add offset
sta dst
bcc :+
inc dst+1
: ldy #35 ; copy 35 bytes into window state
loop: lda (src),y
sta (dst),y
dey
bpl loop
sta RAMRDOFF
sta RAMWRTOFF
rts
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-05 05:05:54 +00:00
;;; From MAIN, load AUX (X,A) into A
.proc DESKTOP_AUXLOAD
stx op+2
sta op+1
sta RAMRDON
sta RAMWRTON
2018-01-17 03:36:54 +00:00
op: lda dummy1234
sta RAMRDOFF
sta RAMWRTOFF
rts
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-05 05:05:54 +00:00
;;; From MAIN, show alert
;;; ...with prompt #0
.proc DESKTOP_SHOW_ALERT0
ldx #$00
;; fall through
.endproc
2018-01-05 05:05:54 +00:00
;;; ... with prompt # in X
.proc DESKTOP_SHOW_ALERT
sta RAMRDON
sta RAMWRTON
jsr desktop_aux::show_alert_indirection
sta RAMRDOFF
sta RAMWRTOFF
rts
.endproc
;;; ============================================================
2018-01-21 03:33:15 +00:00
.assert * = $D166, error, "Segment length mismatch"
PAD_TO $D200
2018-02-07 05:59:25 +00:00
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-01-30 16:57:36 +00:00
2018-02-05 04:46:26 +00:00
;;; ============================================================
2018-02-16 19:25:00 +00:00
;;; Re-used param space for events/queries (10 bytes)
2018-02-16 19:25:00 +00:00
event_params := *
2018-02-28 02:38:18 +00:00
event_kind := event_params + 0
2018-02-16 20:14:39 +00:00
;; if kind is key_down
2018-02-28 02:38:18 +00:00
event_key := event_params + 1
event_modifiers := event_params + 2
2018-02-16 20:14:39 +00:00
;; if kind is no_event, button_down/up, drag, or apple_key:
2018-02-28 02:38:18 +00:00
event_coords := event_params + 1
event_xcoord := event_params + 1
event_ycoord := event_params + 3
2018-02-16 20:14:39 +00:00
;; if kind is update:
2018-02-28 02:38:18 +00:00
event_window_id := event_params + 1
2018-01-12 07:15:04 +00:00
2018-02-16 19:25:00 +00:00
activatectl_params := *
2018-02-28 02:38:18 +00:00
activatectl_which_ctl := activatectl_params
activatectl_activate := activatectl_params + 1
2018-02-14 03:15:45 +00:00
2018-02-16 19:25:00 +00:00
trackthumb_params := *
2018-02-03 03:38:35 +00:00
trackthumb_which_ctl := trackthumb_params
trackthumb_mousex := trackthumb_params + 1
trackthumb_mousey := trackthumb_params + 3
trackthumb_thumbpos := trackthumb_params + 5
trackthumb_thumbmoved := trackthumb_params + 6
2018-02-28 02:38:18 +00:00
.assert trackthumb_mousex = event_xcoord, error, "param mismatch"
.assert trackthumb_mousey = event_ycoord, error, "param mismatch"
2018-02-03 03:38:35 +00:00
2018-02-16 19:25:00 +00:00
updatethumb_params := *
2018-02-28 02:38:18 +00:00
updatethumb_which_ctl := updatethumb_params
updatethumb_thumbpos := updatethumb_params + 1
2018-02-16 19:25:00 +00:00
updatethumb_stash := updatethumb_params + 5 ; not part of struct
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
2018-02-28 02:38:18 +00:00
.assert screentowindow_screenx = event_xcoord, error, "param mismatch"
.assert screentowindow_screeny = event_ycoord, error, "param mismatch"
2018-02-16 19:25:00 +00:00
findwindow_params := * + 1 ; offset to x/y overlap event_params x/y
2018-02-28 02:38:18 +00:00
findwindow_mousex := findwindow_params + 0
findwindow_mousey := findwindow_params + 2
findwindow_which_area := findwindow_params + 4
findwindow_window_id := findwindow_params + 5
.assert findwindow_mousex = event_xcoord, error, "param mismatch"
.assert findwindow_mousey = event_ycoord, error, "param mismatch"
2018-02-16 19:25:00 +00:00
findcontrol_params := * + 1 ; offset to x/y overlap event_params x/y
2018-02-28 02:38:18 +00:00
findcontrol_mousex := findcontrol_params + 0
findcontrol_mousey := findcontrol_params + 2
2018-02-16 19:25:00 +00:00
findcontrol_which_ctl := findcontrol_params + 4
findcontrol_which_part := findcontrol_params + 5
2018-02-28 02:38:18 +00:00
.assert findcontrol_mousex = event_xcoord, error, "param mismatch"
.assert findcontrol_mousey = event_ycoord, error, "param mismatch"
2018-02-16 19:25:00 +00:00
findicon_params := * + 1 ; offset to x/y overlap event_params x/y
2018-02-28 02:38:18 +00:00
findicon_mousex := findicon_params + 0
findicon_mousey := findicon_params + 2
2018-02-16 19:25:00 +00:00
findicon_which_icon := findicon_params + 4
2018-03-05 05:33:56 +00:00
findicon_window_id := findicon_params + 5
2018-02-28 02:38:18 +00:00
.assert findicon_mousex = event_xcoord, error, "param mismatch"
.assert findicon_mousey = event_ycoord, error, "param mismatch"
2018-02-16 19:25:00 +00:00
;; Enough space for all the param types, and then some
.res 10, 0
2018-01-16 04:33:32 +00:00
2018-02-07 05:59:25 +00:00
;;; ============================================================
2018-01-16 04:33:32 +00:00
2018-01-30 16:57:36 +00:00
.proc getwinport_params2
2018-01-31 05:42:26 +00:00
window_id: .byte 0
a_grafport: .addr grafport2
2018-01-16 04:57:02 +00:00
.endproc
2018-01-30 16:57:36 +00:00
.proc grafport2
2018-02-06 04:37:41 +00:00
viewloc: DEFINE_POINT 0, 0, viewloc
mapbits: .addr 0
mapwidth: .word 0
cliprect: DEFINE_RECT 0, 0, 0, 0, cliprect
penpattern: .res 8, 0
2018-01-30 07:58:53 +00:00
colormasks: .byte 0, 0
2018-02-06 04:37:41 +00:00
penloc: DEFINE_POINT 0, 0
penwidth: .byte 0
penheight: .byte 0
penmode: .byte 0
2018-02-07 05:59:25 +00:00
textbg: .byte MGTK::textbg_black
2018-02-06 04:37:41 +00:00
fontptr: .addr 0
2018-01-16 04:33:32 +00:00
.endproc
2018-01-05 05:05:54 +00:00
2018-01-30 16:57:36 +00:00
.proc grafport3
2018-02-06 04:37:41 +00:00
viewloc: DEFINE_POINT 0, 0, viewloc
mapbits: .addr 0
mapwidth: .word 0
cliprect: DEFINE_RECT 0, 0, 0, 0, cliprect
penpattern: .res 8, 0
2018-01-30 07:58:53 +00:00
colormasks: .byte 0, 0
2018-02-06 04:37:41 +00:00
penloc: DEFINE_POINT 0, 0
penwidth: .byte 0
penheight: .byte 0
penmode: .byte 0
2018-02-07 05:59:25 +00:00
textbg: .byte MGTK::textbg_black
2018-02-06 04:37:41 +00:00
fontptr: .addr 0
2018-01-16 05:10:43 +00:00
.endproc
2018-02-06 04:37:41 +00:00
grafport3_viewloc_xcoord := grafport3::viewloc::xcoord
grafport3_cliprect_x1 := grafport3::cliprect::x1
grafport3_cliprect_x2 := grafport3::cliprect::x2
grafport3_cliprect_y2 := grafport3::cliprect::y2
2018-01-30 16:57:36 +00:00
.proc grafport5
2018-02-06 04:37:41 +00:00
viewloc: DEFINE_POINT 0, 0, viewloc
mapbits: .addr MGTK::screen_mapbits
mapwidth: .word MGTK::screen_mapwidth
cliprect: DEFINE_RECT 0, 0, 10, 10, cliprect
penpattern: .res 8, $FF
2018-01-30 07:58:53 +00:00
colormasks: .byte MGTK::colormask_and, MGTK::colormask_or
2018-02-06 04:37:41 +00:00
penloc: DEFINE_POINT 0, 0
penwidth: .byte 1
penheight: .byte 1
penmode: .byte 0
2018-02-07 05:59:25 +00:00
textbg: .byte MGTK::textbg_black
2018-02-06 04:37:41 +00:00
fontptr: .addr DEFAULT_FONT
2018-01-16 05:10:43 +00:00
.endproc
2018-02-07 05:59:25 +00:00
;;; ============================================================
2018-01-21 22:35:37 +00:00
white_pattern3: ; unused?
.byte %11111111
.byte %11111111
.byte %11111111
.byte %11111111
.byte %11111111
.byte %11111111
.byte %11111111
.byte %11111111
.byte $FF
black_pattern3: ; unused?
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte $FF
2018-01-11 05:10:24 +00:00
checkerboard_pattern3:
2018-02-07 05:59:25 +00:00
.byte %01010101
.byte %10101010
.byte %01010101
.byte %10101010
.byte %01010101
.byte %10101010
.byte %01010101
.byte %10101010
2018-01-06 05:03:10 +00:00
.byte $FF
;; Copies of ROM bytes used for machine identification
2018-02-18 19:33:21 +00:00
.proc startdesktop_params
machine: .byte $06 ; ROM FBB3 ($06 = IIe or later)
subid: .byte $EA ; ROM FBC0 ($EA = IIe, $E0 = IIe enh/IIgs, $00 = IIc/IIc+)
op_sys: .byte 0 ; 0=ProDOS
slot_num: .byte 0 ; Mouse slot, 0 = search
use_interrupts: .byte 0 ; 0=passive
sysfontptr: .addr desktop_aux::font_definition
savearea: .addr $0800 ; $0800 - $1AFF
savesize: .word $1300
.endproc
2018-01-28 16:08:39 +00:00
zp_use_flag0:
.byte 0
2018-01-30 16:57:36 +00:00
.proc trackgoaway_params ; next 3 bytes???
goaway:.byte 0
2018-01-28 16:08:39 +00:00
.endproc
LD2A9: .byte 0
double_click_flag:
.byte 0 ; high bit clear if double-clicked, set otherwise
2018-01-06 05:03:10 +00:00
2018-01-21 22:35:37 +00:00
;; Set to specific machine type; used for double-click timing.
2018-01-11 05:10:24 +00:00
machine_type:
.byte $00 ; Set to: $96 = IIe, $FA = IIc, $FD = IIgs
2018-01-06 05:03:10 +00:00
2018-01-23 16:33:12 +00:00
warning_dialog_num:
.byte $00
;;; Cursors (bitmap - 2x12 bytes, mask - 2x12 bytes, hotspot - 2 bytes)
;;; Pointer
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
;;; Insertion Point
2018-01-11 05:10:24 +00:00
insertion_point_cursor:
.byte px(%0000000),px(%0000000)
.byte px(%0110001),px(%1000000)
.byte px(%0001010),px(%0000000)
.byte px(%0000100),px(%0000000)
.byte px(%0000100),px(%0000000)
.byte px(%0000100),px(%0000000)
.byte px(%0000100),px(%0000000)
.byte px(%0000100),px(%0000000)
.byte px(%0001010),px(%0000000)
.byte px(%0110001),px(%1000000)
.byte px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000)
.byte px(%0110001),px(%1000000)
.byte px(%1111011),px(%1100000)
.byte px(%0111111),px(%1000000)
.byte px(%0001110),px(%0000000)
.byte px(%0001110),px(%0000000)
.byte px(%0001110),px(%0000000)
.byte px(%0001110),px(%0000000)
.byte px(%0001110),px(%0000000)
.byte px(%0111111),px(%1000000)
.byte px(%1111011),px(%1100000)
.byte px(%0110001),px(%1000000)
.byte px(%0000000),px(%0000000)
.byte 4, 5
;;; Watch
2018-01-11 05:10:24 +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-03-05 05:33:56 +00:00
LD343: .word 0
buf_filename2: .res 16, 0
2018-02-13 04:41:17 +00:00
LD355: .res 88, 0
2018-02-19 22:06:12 +00:00
LD3AD: .res 19, 0
LD3C0: .res 46, 0
2018-02-13 04:41:17 +00:00
LD3EE: .res 17, 0
LD3FF: .byte 0
LD400: .byte 0
LD401: .byte 0
2018-01-24 05:37:41 +00:00
2018-01-24 05:52:53 +00:00
path_buf0: .res 65, 0
2018-01-24 05:37:41 +00:00
path_buf1: .res 65, 0
path_buf2: .res 65, 0
alert_bitmap2:
.byte px(%0000000),px(%0000000),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(%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)
.byte px(%0111100),px(%1111100),px(%0000011),px(%1100000),px(%0000011),px(%0000000),px(%0000000)
.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)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000)
2018-01-11 05:10:24 +00:00
alert_bitmap2_params:
2018-01-31 05:22:13 +00:00
DEFINE_POINT 40, 8 ; viewloc
.addr alert_bitmap2 ; mapbits
.byte 7 ; mapwidth
.byte 0 ; reserved
2018-03-15 03:53:20 +00:00
DEFINE_RECT 0, 0, 36, 23 ; maprect
;; Looks like window param blocks starting here
2018-03-15 07:00:36 +00:00
.proc winfo_alert_dialog
2018-02-06 03:01:17 +00:00
window_id: .byte $0F
options: .byte MGTK::option_dialog_box
2018-03-15 03:53:20 +00:00
title: .addr 0
2018-02-06 03:01:17 +00:00
hscroll: .byte MGTK::scroll_option_none
vscroll: .byte MGTK::scroll_option_none
hthumbmax: .byte 0
hthumbpos: .byte 0
vthumbmax: .byte 0
vthumbpos: .byte 0
2018-03-15 03:53:20 +00:00
status: .byte 0
2018-02-06 03:01:17 +00:00
reserved: .byte 0
2018-03-15 03:53:20 +00:00
mincontwidth: .word 150
maxcontwidth: .word 50
mincontlength: .word 500
maxcontlength: .word 140
2018-01-31 03:04:33 +00:00
port:
2018-03-15 03:53:20 +00:00
viewloc: DEFINE_POINT 75, 35
2018-02-06 03:01:17 +00:00
mapbits: .addr MGTK::screen_mapbits
mapwidth: .word MGTK::screen_mapwidth
2018-03-15 03:53:20 +00:00
cliprect: DEFINE_RECT 0, 0, 400, 100
2018-02-06 03:01:17 +00:00
penpattern: .res 8, $FF
2018-01-30 07:58:53 +00:00
colormasks: .byte MGTK::colormask_and, MGTK::colormask_or
2018-03-15 03:53:20 +00:00
penloc: DEFINE_POINT 0, 0
2018-02-06 03:01:17 +00:00
penwidth: .byte 1
penheight: .byte 1
penmode: .byte 0
2018-03-15 03:53:20 +00:00
textbg: .byte MGTK::textbg_white
2018-02-06 03:01:17 +00:00
fontptr: .addr DEFAULT_FONT
nextwinfo: .addr 0
.endproc
2018-03-15 04:10:08 +00:00
;;; Dialog used for Selector > Add/Edit an Entry...
.proc winfo_entrydlg
2018-02-06 03:01:17 +00:00
window_id: .byte $12
options: .byte MGTK::option_dialog_box
2018-03-15 03:53:20 +00:00
title: .addr 0
2018-02-06 03:01:17 +00:00
hscroll: .byte MGTK::scroll_option_none
vscroll: .byte MGTK::scroll_option_none
hthumbmax: .byte 0
hthumbpos: .byte 0
vthumbmax: .byte 0
vthumbpos: .byte 0
2018-03-15 03:53:20 +00:00
status: .byte 0
2018-02-06 03:01:17 +00:00
reserved: .byte 0
2018-03-15 03:53:20 +00:00
mincontwidth: .word 150
maxcontwidth: .word 50
mincontlength: .word 500
maxcontlength: .word 140
2018-01-31 03:04:33 +00:00
port:
2018-03-15 03:53:20 +00:00
viewloc: DEFINE_POINT 25, 20
2018-02-06 03:01:17 +00:00
mapbits: .addr MGTK::screen_mapbits
mapwidth: .word MGTK::screen_mapwidth
2018-03-15 03:53:20 +00:00
cliprect: DEFINE_RECT 0, 0, 500, 153
2018-02-06 03:01:17 +00:00
penpattern: .res 8, $FF
2018-01-30 07:58:53 +00:00
colormasks: .byte MGTK::colormask_and, MGTK::colormask_or
2018-03-15 03:53:20 +00:00
penloc: DEFINE_POINT 0, 0
2018-02-06 03:01:17 +00:00
penwidth: .byte 1
penheight: .byte 1
penmode: .byte 0
2018-03-15 03:53:20 +00:00
textbg: .byte MGTK::textbg_white
2018-02-06 03:01:17 +00:00
fontptr: .addr DEFAULT_FONT
nextwinfo: .addr 0
.endproc
2018-03-15 04:10:08 +00:00
;;; File picker within Add/Edit an Entry dialog
2018-03-15 03:38:47 +00:00
.proc winfo_entrydlg_file_picker
2018-02-06 03:01:17 +00:00
window_id: .byte $15
options: .byte MGTK::option_dialog_box
2018-03-15 03:53:20 +00:00
title: .addr 0
2018-02-06 03:01:17 +00:00
hscroll: .byte MGTK::scroll_option_none
vscroll: .byte MGTK::scroll_option_normal
hthumbmax: .byte 0
hthumbpos: .byte 0
vthumbmax: .byte 3
vthumbpos: .byte 0
2018-03-15 03:53:20 +00:00
status: .byte 0
2018-02-06 03:01:17 +00:00
reserved: .byte 0
2018-03-15 03:38:47 +00:00
mincontwidth: .word 100
maxcontwidth: .word 70
mincontlength: .word 100
maxcontlength: .word 70
2018-01-31 03:04:33 +00:00
port:
2018-03-15 03:38:47 +00:00
viewloc: DEFINE_POINT 53, 50
2018-02-06 03:01:17 +00:00
mapbits: .addr MGTK::screen_mapbits
mapwidth: .word MGTK::screen_mapwidth
2018-03-15 03:38:47 +00:00
cliprect: DEFINE_RECT 0, 0, 125, 70
2018-02-06 03:01:17 +00:00
penpattern: .res 8, $FF
2018-01-30 07:58:53 +00:00
colormasks: .byte MGTK::colormask_and, MGTK::colormask_or
2018-03-15 03:53:20 +00:00
penloc: DEFINE_POINT 0, 0
2018-02-06 03:01:17 +00:00
penwidth: .byte 1
penheight: .byte 1
penmode: .byte 0
2018-03-15 03:53:20 +00:00
textbg: .byte MGTK::textbg_white
2018-02-06 03:01:17 +00:00
fontptr: .addr DEFAULT_FONT
nextwinfo: .addr 0
.endproc
2018-03-15 04:10:08 +00:00
;;; "About Apple II Desktop" Dialog
.proc winfo_about_dialog
width := 400
2018-02-06 03:01:17 +00:00
window_id: .byte $18
options: .byte MGTK::option_dialog_box
2018-03-15 03:53:20 +00:00
title: .addr 0
2018-02-06 03:01:17 +00:00
hscroll: .byte MGTK::scroll_option_none
vscroll: .byte MGTK::scroll_option_none
hthumbmax: .byte 0
hthumbpos: .byte 0
vthumbmax: .byte 0
vthumbpos: .byte 0
2018-03-15 03:53:20 +00:00
status: .byte 0
2018-02-06 03:01:17 +00:00
reserved: .byte 0
2018-03-15 03:38:47 +00:00
mincontwidth: .word 150
maxcontwidth: .word 50
mincontlength: .word 500
maxcontlength: .word 140
2018-01-31 03:04:33 +00:00
port:
2018-03-15 04:10:08 +00:00
viewloc: DEFINE_POINT (screen_width - width) / 2, 40
2018-02-06 03:01:17 +00:00
mapbits: .addr MGTK::screen_mapbits
mapwidth: .word MGTK::screen_mapwidth
2018-03-15 04:10:08 +00:00
cliprect: DEFINE_RECT 0, 0, width, 110
2018-02-06 03:01:17 +00:00
penpattern: .res 8, $FF
2018-01-30 07:58:53 +00:00
colormasks: .byte MGTK::colormask_and, MGTK::colormask_or
2018-03-15 03:53:20 +00:00
penloc: DEFINE_POINT 0, 0
2018-02-06 03:01:17 +00:00
penwidth: .byte 1
penheight: .byte 1
penmode: .byte 0
2018-03-15 03:53:20 +00:00
textbg: .byte MGTK::textbg_white
2018-02-06 03:01:17 +00:00
fontptr: .addr DEFAULT_FONT
nextwinfo: .addr 0
.endproc
2018-03-15 04:10:08 +00:00
winfo_about_dialog_port := winfo_about_dialog::port
;;; Dialog used for Edit/Delete/Run an Entry ...
.proc winfo_entry_picker
width := 350
2018-02-06 03:01:17 +00:00
window_id: .byte $1B
options: .byte MGTK::option_dialog_box
2018-03-15 03:53:20 +00:00
title: .addr 0
2018-02-06 03:01:17 +00:00
hscroll: .byte MGTK::scroll_option_none
vscroll: .byte MGTK::scroll_option_none
hthumbmax: .byte 0
hthumbpos: .byte 0
vthumbmax: .byte 0
vthumbpos: .byte 0
2018-03-15 03:53:20 +00:00
status: .byte 0
2018-02-06 03:01:17 +00:00
reserved: .byte 0
2018-03-15 03:38:47 +00:00
mincontwidth: .word 150
maxcontwidth: .word 50
mincontlength: .word 500
maxcontlength: .word 140
2018-01-31 03:04:33 +00:00
port:
2018-03-15 04:10:08 +00:00
viewloc: DEFINE_POINT (screen_width - width) / 2, 25
2018-02-06 03:01:17 +00:00
mapbits: .addr MGTK::screen_mapbits
mapwidth: .word MGTK::screen_mapwidth
2018-03-15 04:10:08 +00:00
cliprect: DEFINE_RECT 0, 0, width, 110
2018-02-06 03:01:17 +00:00
penpattern: .res 8, $FF
2018-01-30 07:58:53 +00:00
colormasks: .byte MGTK::colormask_and, MGTK::colormask_or
2018-03-15 03:53:20 +00:00
penloc: DEFINE_POINT 0, 0
2018-02-06 03:01:17 +00:00
penwidth: .byte 1
penheight: .byte 1
penmode: .byte 0
2018-03-15 03:53:20 +00:00
textbg: .byte MGTK::textbg_white
2018-02-06 03:01:17 +00:00
fontptr: .addr DEFAULT_FONT
nextwinfo: .addr 0
.endproc
;; Coordinates for labels?
2018-01-15 05:16:36 +00:00
.byte $28,$00,$25,$00,$68,$01,$2F,$00,$2D,$00,$2E,$00
rect1: DEFINE_RECT 40,61,360,71, rect1
point6: DEFINE_POINT 45,70, point6
2018-02-10 06:59:05 +00:00
pos_dialog_title: DEFINE_POINT 0, 18, pos_dialog_title
point7: DEFINE_POINT 40,18, point7
2018-03-15 03:38:47 +00:00
pointD: DEFINE_POINT 40, 35, pointD
2018-02-03 03:38:35 +00:00
2018-02-19 01:08:11 +00:00
dialog_label_default_x := 40
2018-01-21 18:56:50 +00:00
dialog_label_pos:
2018-02-19 01:08:11 +00:00
DEFINE_POINT dialog_label_default_x,0, dialog_label_pos
2018-01-15 05:16:36 +00:00
2018-01-31 05:22:13 +00:00
.proc setportbits_params3
DEFINE_POINT 75, 35
2018-01-29 05:18:00 +00:00
.addr MGTK::screen_mapbits
2018-01-31 05:22:13 +00:00
.byte MGTK::screen_mapwidth
.byte 0
2018-03-15 03:38:47 +00:00
DEFINE_RECT 0, 0, 358, 100
2018-01-31 05:22:13 +00:00
.endproc
2018-01-21 22:35:37 +00:00
;; ???
2018-01-15 05:16:36 +00:00
.byte $00,$04,$00,$02,$00,$5A,$01,$6C,$00,$05,$00,$03,$00,$59,$01,$6B,$00,$06,$00,$16,$00,$58,$01,$16,$00,$06,$00,$59,$00,$58,$01,$59,$00,$D2,$00,$5C,$00,$36,$01,$67,$00,$28,$00,$5C,$00,$8C,$00,$67,$00,$D7,$00,$66,$00,$2D,$00,$66,$00,$82,$00,$07,$00,$DC,$00,$13,$00
LD718: PASCAL_STRING "Add an Entry ..."
LD729: PASCAL_STRING "Edit an Entry ..."
LD73B: PASCAL_STRING "Delete an Entry ..."
LD74F: PASCAL_STRING "Run an Entry ..."
LD760: PASCAL_STRING "Run list"
PASCAL_STRING "Enter the full pathname of the run list file:"
PASCAL_STRING "Enter the name (14 characters max) you wish to appear in the run list"
PASCAL_STRING "Add a new entry to the:"
PASCAL_STRING {GLYPH_OAPPLE,"1 Run list"}
PASCAL_STRING {GLYPH_OAPPLE,"2 Other Run list"}
PASCAL_STRING "Down load:"
PASCAL_STRING {GLYPH_OAPPLE,"3 at first boot"}
PASCAL_STRING {GLYPH_OAPPLE,"4 at first use"}
PASCAL_STRING {GLYPH_OAPPLE,"5 never"}
PASCAL_STRING "Enter the full pathname of the run list file:"
.byte $00,$00,$00,$00,$00,$00,$00
.byte $00,$06,$00,$17,$00,$58,$01,$57
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00
PASCAL_STRING "the DOS 3.3 disk in slot drive ?"
.byte $1A,$22
PASCAL_STRING "the disk in slot drive ?"
.byte $12
2018-01-16 04:33:32 +00:00
.byte $1A
buf_filename:
.res 16, 0
2018-01-15 18:08:50 +00:00
LD8E7: .byte 0
LD8E8: .byte 0
LD8E9: .byte $14
.byte $00
LD8EB: .byte 0
LD8EC: .byte 0
LD8ED: .byte 0
LD8EE: .byte 1
LD8EF: .byte 6
LD8F0: .byte 0
LD8F1: .byte 0
LD8F2: .byte 0
LD8F3: .byte 0
LD8F4: .byte 0
LD8F5: .byte 0
str_1_char:
2018-01-11 05:36:09 +00:00
PASCAL_STRING {0}
str_2_spaces:
PASCAL_STRING " "
2018-01-11 05:36:09 +00:00
str_files:
PASCAL_STRING "Files"
2018-02-13 16:18:11 +00:00
str_file_count: ; populated with number of files
PASCAL_STRING " "
2018-02-13 16:18:11 +00:00
file_count:
.word 0
2018-01-15 05:23:48 +00:00
.byte $00,$00,$0D
.byte $00,$00,$00,$00,$00,$7D,$00,$00
.byte $00,$02,$00,$00,$00,$00,$00,$02
.byte $01,$02,$00,$00,$57,$01,$28,$00
.byte $6B,$01,$30,$00,$6B,$01,$38,$00
.byte $57,$01,$4B,$00,$6B,$01,$53,$00
.byte $6B,$01,$5B,$00,$6B,$01,$63,$00
.byte $5A,$01,$29,$00,$64,$01,$2F,$00
.byte $5A,$01,$31,$00,$64,$01,$37,$00
.byte $5A,$01,$4C,$00,$64,$01,$52,$00
.byte $5A,$01,$54,$00,$64,$01,$5A,$00
.byte $5A,$01,$5C,$00,$64,$01,$62,$00
.byte $5A,$01,$29,$00,$E0,$01,$30,$00
.byte $5A,$01,$31,$00,$E0,$01,$37,$00
.byte $5A,$01,$4C,$00,$E0,$01,$53,$00
.byte $5A,$01,$54,$00,$E0,$01,$5B,$00
.byte $5A,$01,$5C,$00,$E0,$01,$63,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$04,$00,$02,$00,$F0,$01
.byte $97,$00,$1B,$00,$10,$00,$AE,$00
.byte $1A,$00,$C1,$00,$3A,$00,$25,$01
.byte $45,$00,$C1,$00,$59,$00,$25,$01
.byte $64,$00,$C1,$00,$2C,$00,$25,$01
.byte $37,$00,$C1,$00,$49,$00,$25,$01
.byte $54,$00,$C1,$00,$1E,$00,$25,$01
.byte $29,$00,$43,$01,$1E,$00,$43,$01
.byte $64,$00,$81,$D3,$00
.word $C6,$63
PASCAL_STRING {"OK ",GLYPH_RETURN}
.word $C6,$44
PASCAL_STRING "Close"
.word $C6,$36
PASCAL_STRING "Open"
.word $C6,$53
PASCAL_STRING "Cancel Esc"
.word $C6,$28
PASCAL_STRING "Change Drive"
.byte $1C,$00,$19,$00,$1C
.byte $00,$70,$00,$1C,$00,$87,$00,$00
.byte $7F
PASCAL_STRING " Disk: "
PASCAL_STRING "Copy a File ..."
PASCAL_STRING "Source filename:"
PASCAL_STRING "Destination filename:"
2018-03-15 03:53:20 +00:00
dialog_rect1: DEFINE_RECT 28, 113, 463, 124
2018-02-22 05:28:13 +00:00
.byte $1E,$00,$7B,$00
2018-03-15 03:53:20 +00:00
dialog_rect2: DEFINE_RECT 28, 136, 463, 147
2018-02-22 05:28:13 +00:00
.byte $1E,$00,$92,$00
PASCAL_STRING "Delete a File ..."
PASCAL_STRING "File to delete:"
2018-01-21 03:33:15 +00:00
.assert * = $DAD8, error, "Segment length mismatch"
PAD_TO $DB00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-21 18:44:26 +00:00
.addr sd0s, sd1s, sd2s, sd3s, sd4s, sd5s, sd6s
.addr sd7s, sd8s, sd9s, sd10s, sd11s, sd12s, sd13s
.addr selector_menu
;; Buffer for Run List entries
run_list_entries:
.res 640, 0
2018-01-15 05:23:48 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-09 05:42:59 +00:00
;;; Window & Icon State
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-09 05:42:59 +00:00
2018-01-15 05:23:48 +00:00
LDD9E: .byte 0
2018-02-18 01:15:27 +00:00
;; Pointers into icon_entries buffer
2018-02-09 05:42:59 +00:00
icon_entry_address_table:
.assert * = file_table, error, "Entry point mismatch"
.res 256, 0
2018-02-08 05:36:53 +00:00
;;; Copy from aux memory of icon list for active window (0=desktop)
2018-02-08 05:48:19 +00:00
;; which window buffer (see window_icon_count_table, window_icon_list_table) is copied
cached_window_id: .byte 0
2018-02-08 05:36:53 +00:00
;; number of icons in copied window
2018-02-08 05:48:19 +00:00
cached_window_icon_count:.byte 0
2018-02-08 05:36:53 +00:00
;; list of icons in copied window
2018-02-08 05:48:19 +00:00
cached_window_icon_list: .res 127, 0
2018-02-08 05:36:53 +00:00
selected_window_index: ; index of selected window (used to get prefix)
.assert * = path_index, error, "Entry point mismatch"
.byte 0
2018-02-19 19:33:13 +00:00
selected_icon_count: ; number of selected icons
.assert * = selected_file_count, error, "Entry point mismatch"
.byte 0
2018-02-19 19:33:13 +00:00
selected_icon_list: ; index of selected icon (global, not w/in window)
.assert * = selected_file_list, error, "Entry point mismatch"
.res 127, 0
;; Buffer for desktop windows
win_table:
2018-01-31 03:04:33 +00:00
.addr 0,winfo1,winfo2,winfo3,winfo4,winfo5,winfo6,winfo7,winfo8
;; Window to Path mapping table
window_address_table:
.assert * = path_table, error, "Entry point mismatch"
.addr $0000
.repeat 8,i
.addr window_path_table+i*65
.endrepeat
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-09 05:42:59 +00:00
2018-01-16 04:33:32 +00:00
LDFC5: .byte 0
LDFC6: .byte 0
LDFC7: .byte 0
LDFC8: .byte 0
2018-02-15 16:08:59 +00:00
path_buf4:
.res 65, 0
path_buf3:
.res 65, 0
2018-02-06 23:36:39 +00:00
LE04B: .res 16, 0
LE05B: .byte $00
LE05C: .byte $00
LE05D: .byte $00
LE05E: .byte $0D
LE05F: .byte $00
LE060: .byte $00
LE061: .byte $00
LE062: .res 170, 0
2018-03-05 05:33:56 +00:00
LE10C: .byte 0
LE10D: .res 137, 0
2018-02-15 16:08:59 +00:00
2018-02-16 20:14:39 +00:00
DESKTOP_DEVICELIST:
.res 10, 0
2018-02-15 16:08:59 +00:00
devlst_copy:
.res 16, 0
2018-02-16 20:14:39 +00:00
2018-02-15 16:08:59 +00:00
LE1B0: .res 65, 0 ; path buffer?
LE1F1: .res 15, 0 ; length-prefixed string
LE200: .word 0
LE202: .res 24, 0 ; addr table
.byte $00,$00,$00,$00,$7F,$64,$00,$1C
.byte $00,$1E,$00,$32,$00,$1E,$00,$40
2018-02-05 03:13:21 +00:00
.byte $00
;; DT_HIGHLIGHT_ICON params
2018-02-06 23:36:39 +00:00
LE22B: .byte 0
2018-02-05 03:13:21 +00:00
2018-02-06 23:36:39 +00:00
LE22C: .byte 0
;; DT_HIGHLIGHT_ICON params
LE22D: .byte 0
2018-02-05 03:13:21 +00:00
;; DT_UNHIGHLIGHT_ICON params
LE22E:
.byte $00
2018-01-15 04:55:54 +00:00
2018-02-05 03:13:21 +00:00
;; DT_HIGHLIGHT_ICON params
;; DT_UNHIGHLIGHT_ICON params
2018-02-15 16:08:59 +00:00
icon_param: .byte 0
2018-02-05 03:13:21 +00:00
2018-02-06 23:36:39 +00:00
rect_E230: DEFINE_RECT 0,0,0,0, rect_E230
2018-01-15 04:55:54 +00:00
.byte $00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
2018-02-15 16:08:59 +00:00
.byte $00,$00,$00,$00
LE256:
.byte $00,$00,$00,$00
2018-01-15 04:55:54 +00:00
.proc menu_click_params
menu_id:.byte 0
item_num:.byte 0
.endproc
2018-02-19 22:06:12 +00:00
LE25C: .byte 0
LE25D: .byte 0
.byte $00,$00,$00,$00
2018-01-15 05:16:36 +00:00
.byte $00,$04,$00,$00,$00
2018-02-01 19:30:03 +00:00
.proc checkitem_params
menu_id: .byte 4
menu_item: .byte 0
check: .byte 0
.endproc
.proc disablemenu_params
menu_id: .byte 4
disable: .byte 0
.endproc
.proc disableitem_params
menu_id: .byte 0
menu_item: .byte 0
disable: .byte 0
.endproc
2018-01-24 23:39:12 +00:00
2018-03-05 05:33:56 +00:00
LE26F: .byte $00
2018-02-19 22:06:12 +00:00
LE270: .byte $04 ; number of items in startup menu?
.byte $00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.addr str_all
LE27C: DEFINE_MENU_SEPARATOR
DEFINE_MENU_ITEM sd0s
DEFINE_MENU_ITEM sd1s
DEFINE_MENU_ITEM sd2s
DEFINE_MENU_ITEM sd3s
DEFINE_MENU_ITEM sd4s
DEFINE_MENU_ITEM sd5s
DEFINE_MENU_ITEM sd6s
DEFINE_MENU_ITEM sd7s
DEFINE_MENU_ITEM sd8s
DEFINE_MENU_ITEM sd9s
DEFINE_MENU_ITEM sd10s
DEFINE_MENU_ITEM sd11s
DEFINE_MENU_ITEM sd12s
DEFINE_MENU_ITEM sd13s
startup_menu:
DEFINE_MENU 7
2018-02-12 07:54:09 +00:00
DEFINE_MENU_ITEM startup_menu_item_1
DEFINE_MENU_ITEM startup_menu_item_2
DEFINE_MENU_ITEM startup_menu_item_3
DEFINE_MENU_ITEM startup_menu_item_4
DEFINE_MENU_ITEM startup_menu_item_5
DEFINE_MENU_ITEM startup_menu_item_6
DEFINE_MENU_ITEM startup_menu_item_7
str_all:PASCAL_STRING "All"
2018-01-29 05:18:00 +00:00
sd0: DEFINE_STRING "Slot drive ", sd0s
sd1: DEFINE_STRING "Slot drive ", sd1s
sd2: DEFINE_STRING "Slot drive ", sd2s
sd3: DEFINE_STRING "Slot drive ", sd3s
sd4: DEFINE_STRING "Slot drive ", sd4s
sd5: DEFINE_STRING "Slot drive ", sd5s
sd6: DEFINE_STRING "Slot drive ", sd6s
sd7: DEFINE_STRING "Slot drive ", sd7s
sd8: DEFINE_STRING "Slot drive ", sd8s
sd9: DEFINE_STRING "Slot drive ", sd9s
sd10: DEFINE_STRING "Slot drive ", sd10s
sd11: DEFINE_STRING "Slot drive ", sd11s
sd12: DEFINE_STRING "Slot drive ", sd12s
sd13: DEFINE_STRING "Slot drive ", sd13s
2018-02-12 07:54:09 +00:00
startup_menu_item_1: PASCAL_STRING "Slot 0 "
startup_menu_item_2: PASCAL_STRING "Slot 0 "
startup_menu_item_3: PASCAL_STRING "Slot 0 "
startup_menu_item_4: PASCAL_STRING "Slot 0 "
startup_menu_item_5: PASCAL_STRING "Slot 0 "
startup_menu_item_6: PASCAL_STRING "Slot 0 "
startup_menu_item_7: PASCAL_STRING "Slot 0 "
.addr sd0, sd1, sd2, sd3, sd4, sd5, sd6, sd7
.addr sd8, sd9, sd10, sd11, sd12, sd13
2018-01-12 09:16:37 +00:00
str_profile_slot_x:
PASCAL_STRING "ProFile Slot x "
2018-01-12 09:16:37 +00:00
str_unidisk_xy:
PASCAL_STRING "UniDisk 3.5 Sx,y "
2018-01-12 09:16:37 +00:00
str_ramcard_slot_x:
PASCAL_STRING "RAMCard Slot x "
2018-01-12 09:16:37 +00:00
str_slot_drive:
PASCAL_STRING "Slot drive "
selector_menu:
DEFINE_MENU 5
DEFINE_MENU_ITEM label_add
DEFINE_MENU_ITEM label_edit
DEFINE_MENU_ITEM label_del
DEFINE_MENU_ITEM label_run, '0', '0'
DEFINE_MENU_SEPARATOR
DEFINE_MENU_ITEM run_list_entries + 0 * $10, '1', '1'
DEFINE_MENU_ITEM run_list_entries + 1 * $10, '2', '2'
DEFINE_MENU_ITEM run_list_entries + 2 * $10, '3', '3'
DEFINE_MENU_ITEM run_list_entries + 3 * $10, '4', '4'
DEFINE_MENU_ITEM run_list_entries + 4 * $10, '5', '5'
DEFINE_MENU_ITEM run_list_entries + 5 * $10, '6', '6'
DEFINE_MENU_ITEM run_list_entries + 6 * $10, '7', '7'
DEFINE_MENU_ITEM run_list_entries + 7 * $10, '8', '8'
label_add:
PASCAL_STRING "Add an Entry ..."
label_edit:
PASCAL_STRING "Edit an Entry ..."
label_del:
PASCAL_STRING "Delete an Entry ... "
label_run:
PASCAL_STRING "Run an Entry ..."
;; Apple Menu
apple_menu:
DEFINE_MENU 1
DEFINE_MENU_ITEM label_about
DEFINE_MENU_SEPARATOR
DEFINE_MENU_ITEM buf + 0 * $10
DEFINE_MENU_ITEM buf + 1 * $10
DEFINE_MENU_ITEM buf + 2 * $10
DEFINE_MENU_ITEM buf + 3 * $10
DEFINE_MENU_ITEM buf + 4 * $10
DEFINE_MENU_ITEM buf + 5 * $10
DEFINE_MENU_ITEM buf + 6 * $10
DEFINE_MENU_ITEM buf + 7 * $10
label_about:
PASCAL_STRING "About Apple II DeskTop ... "
buf: .res $80, 0
2018-01-13 05:24:07 +00:00
splash_menu:
2018-01-30 07:34:12 +00:00
DEFINE_MENU_BAR 1
DEFINE_MENU_BAR_ITEM 1, splash_menu_label, dummy_dd_menu
2018-01-12 18:01:28 +00:00
2018-01-13 05:24:07 +00:00
blank_menu:
2018-01-30 07:34:12 +00:00
DEFINE_MENU_BAR 1
DEFINE_MENU_BAR_ITEM 1, blank_dd_label, dummy_dd_menu
2018-01-13 05:24:07 +00:00
dummy_dd_menu:
DEFINE_MENU 1
DEFINE_MENU_ITEM dummy_dd_item
splash_menu_label:
PASCAL_STRING "Apple II DeskTop Version 1.1"
2018-01-13 05:24:07 +00:00
blank_dd_label:
PASCAL_STRING " "
dummy_dd_item:
PASCAL_STRING "Rien" ; ???
2018-01-12 18:01:28 +00:00
2018-02-05 03:13:21 +00:00
;; DT_UNHIGHLIGHT_ICON params
2018-02-15 16:08:59 +00:00
icon_params2:
.byte 0
2018-02-05 03:13:21 +00:00
2018-03-05 05:33:56 +00:00
LE6BF: .word 0
2018-01-13 05:32:59 +00:00
LE6C1:
2018-01-31 03:04:33 +00:00
.addr winfo1title_ptr
.addr winfo2title_ptr
.addr winfo3title_ptr
.addr winfo4title_ptr
.addr winfo5title_ptr
.addr winfo6title_ptr
.addr winfo7title_ptr
.addr winfo8title_ptr
2018-01-12 18:01:28 +00:00
2018-02-03 03:38:35 +00:00
win_buf_table: ; ???
.res 8, 0
2018-02-10 06:59:05 +00:00
pos_col_name: DEFINE_POINT 0, 0, pos_col_name
pos_col_type: DEFINE_POINT 112, 0, pos_col_type
pos_col_size: DEFINE_POINT 140, 0, pos_col_size
pos_col_date: DEFINE_POINT 231, 0, pos_col_date
.proc text_buffer2
.addr data
2018-01-12 18:01:28 +00:00
length: .byte 0
2018-02-19 22:06:12 +00:00
data: .res 49, 0
.endproc
2018-02-19 22:06:12 +00:00
LE71D: .word 0
LE71F: .byte 0
.byte 0,0,0
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-10 06:10:11 +00:00
2018-01-30 07:58:53 +00:00
.macro WINFO_DEFN id, label, buflabel
.proc label
2018-02-06 03:01:17 +00:00
window_id: .byte id
options: .byte MGTK::option_go_away_box | MGTK::option_grow_box
title: .addr buflabel
2018-02-06 03:01:17 +00:00
hscroll: .byte MGTK::scroll_option_normal
vscroll: .byte MGTK::scroll_option_normal
hthumbmax: .byte 3
hthumbpos: .byte 0
vthumbmax: .byte 3
vthumbpos: .byte 0
2018-01-30 07:58:53 +00:00
status: .byte 0
2018-02-06 03:01:17 +00:00
reserved: .byte 0
mincontwidth: .word 170
maxcontwidth: .word 50
mincontlength: .word 545
maxcontlength: .word 175
2018-01-31 03:04:33 +00:00
port:
viewloc: DEFINE_POINT 20, 27
2018-02-06 03:01:17 +00:00
mapbits: .addr MGTK::screen_mapbits
mapwidth: .word MGTK::screen_mapwidth
2018-01-31 03:04:33 +00:00
cliprect: DEFINE_RECT 0, 0, 440, 120
2018-02-06 03:01:17 +00:00
penpattern: .res 8, $FF
2018-01-30 07:58:53 +00:00
colormasks: .byte MGTK::colormask_and, MGTK::colormask_or
2018-02-06 03:01:17 +00:00
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-01-31 03:04:33 +00:00
2018-02-06 03:01:17 +00:00
buflabel: .res 18, 0
.endmacro
2018-01-31 03:04:33 +00:00
WINFO_DEFN 1, winfo1, winfo1title_ptr
WINFO_DEFN 2, winfo2, winfo2title_ptr
WINFO_DEFN 3, winfo3, winfo3title_ptr
WINFO_DEFN 4, winfo4, winfo4title_ptr
WINFO_DEFN 5, winfo5, winfo5title_ptr
WINFO_DEFN 6, winfo6, winfo6title_ptr
WINFO_DEFN 7, winfo7, winfo7title_ptr
WINFO_DEFN 8, winfo8, winfo8title_ptr
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-10 06:10:11 +00:00
;;; Window paths
;;; 8 entries; each entry is 65 bytes long
;;; * length-prefixed path string (no trailing /)
;;; Windows 1...8 (since 0 is desktop)
window_path_table:
.res (8*65), 0
2018-02-10 06:10:11 +00:00
;;; Window used/free (in kilobytes)
;;; Two tables, 8 entries each
;;; Windows 1...8 (since 0 is desktop)
window_k_used_table: .res 16, 0
window_k_free_table: .res 16, 0
.res 8, 0 ; ???
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-10 06:10:11 +00:00
;;; Resources for window header (Items/k in disk/available)
2018-01-11 06:31:02 +00:00
str_items:
PASCAL_STRING " Items"
2018-01-11 06:31:02 +00:00
items_label_pos:
2018-02-06 23:36:39 +00:00
DEFINE_POINT 8, 10, items_label_pos
2018-01-15 04:55:54 +00:00
2018-02-10 06:10:11 +00:00
header_line_left: DEFINE_POINT 0, 0, header_line_left
header_line_right: DEFINE_POINT 0, 0, header_line_right
2018-01-11 06:31:02 +00:00
str_k_in_disk:
PASCAL_STRING "K in disk"
2018-01-11 06:31:02 +00:00
str_k_available:
PASCAL_STRING "K available"
2018-01-11 06:31:02 +00:00
2018-02-10 05:24:35 +00:00
str_from_int: ; populated by int_to_string
PASCAL_STRING " "
2018-02-10 06:10:11 +00:00
;;; Computed during startup
width_items_label_padded: .word 0
.word 0 ; ???
width_left_labels: .word 0
.word 0 ; ???
2018-01-24 23:39:12 +00:00
2018-02-10 06:10:11 +00:00
;;; Computed when painted
pos_k_in_disk: DEFINE_POINT 0, 0, pos_k_in_disk
pos_k_available: DEFINE_POINT 0, 0, pos_k_available
;;; Computed during startup
2018-02-10 05:24:35 +00:00
width_items_label: .word 0
width_k_in_disk_label: .word 0
width_k_available_label: .word 0
2018-02-10 06:10:11 +00:00
width_right_labels: .word 0
2018-02-06 23:36:39 +00:00
2018-02-10 06:10:11 +00:00
;;; Assigned during startup
2018-02-09 05:42:59 +00:00
trash_icon_num: .byte 0
2018-01-24 23:39:12 +00:00
LEBFC: .byte 0 ; flag of some sort ???
2018-02-10 06:59:05 +00:00
saved_event_coords: DEFINE_POINT 0, 0
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-08 05:36:53 +00:00
2018-02-10 06:10:11 +00:00
;;; Each buffer is a list of icons in each window (0=desktop)
;;; window_icon_count_table = start of buffer = icon count
;;; window_icon_list_table = first entry in buffer (length = 127)
2018-02-08 05:36:53 +00:00
2018-02-08 05:48:19 +00:00
window_icon_count_table:
.repeat 9,i
.addr $1B00 + $80 * i
.endrepeat
window_icon_list_table:
.repeat 9,i
.addr $1B00 + $80 * i + 1
.endrepeat
2018-02-03 04:41:42 +00:00
active_window_id:
.byte $00
2018-01-05 05:05:54 +00:00
2018-02-15 16:08:59 +00:00
LEC26: .res 8, 0 ; ???
2018-03-05 05:33:56 +00:00
LEC2E: .res 21, 0 ; ???
LEC43: .res 16, 0 ; ???
2018-02-10 06:10:11 +00:00
LEC53: .byte 0
LEC54: .word 0
.res 4, 0
2018-01-21 19:47:40 +00:00
date: .word 0
2018-02-10 06:10:11 +00:00
.res 7, 0 ; ???
2018-01-21 19:47:40 +00:00
2018-02-09 05:42:59 +00:00
.assert * = $EC63, error, "Segment length mismatch"
2018-02-10 06:10:11 +00:00
;;; --------------------------------------------------
2018-02-09 05:42:59 +00:00
icon_entries:
2018-02-10 06:10:11 +00:00
.byte 0, 0, 0, $F4, 1, $A0 ; overwritten ???
2018-01-21 03:33:15 +00:00
PAD_TO $ED00
2018-01-12 06:38:03 +00:00
;;; (there's enough room here for 127 files at 27 bytes each)
2018-02-09 05:42:59 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
.org $FB00
2018-01-11 05:10:24 +00:00
type_table_addr: .addr type_table
type_icons_addr: .addr type_icons
2018-02-09 05:42:59 +00:00
icon_type_table_addr: .addr icon_type_table
2018-01-11 05:10:24 +00:00
type_names_addr: .addr type_names
type_table:
2018-02-09 05:42:59 +00:00
.byte 8 ; size of table; first entry is default
.byte FT_TYPELESS, FT_SRC, FT_TEXT, FT_BINARY
.byte FT_DIRECTORY, FT_SYSTEM, FT_BASIC, FT_BAD
2018-02-09 05:42:59 +00:00
icon_type_table:
.byte $60 ; unused?
.byte $50,$50,$50,$20,$00,$10,$30,$10
type_names:
.byte " ???"
;; Same order as icon list below
.byte " ???", " SRC", " TXT", " BIN"
.byte " DIR", " SYS", " BAS", " SYS"
.byte " BAD"
type_icons:
.addr gen, src, txt, bin, dir, sys, bas, app
2018-02-09 05:42:59 +00:00
.macro DEFICON mapbits, mapwidth, x1, y1, x2, y2
.addr mapbits
.byte mapwidth
.byte 0 ; reserved
.word x1, y1, x2, y2
.endmacro
gen: DEFICON generic_icon, 4, 0, 0, 27, 17
src:
txt: DEFICON text_icon, 4, 0, 0, 27, 17
bin: DEFICON binary_icon, 4, 0, 0, 27, 17
dir: DEFICON folder_icon, 4, 0, 0, 27, 17
sys: DEFICON sys_icon, 4, 0, 0, 27, 17
bas: DEFICON basic_icon, 4, 0, 0, 27, 17
app: DEFICON app_icon, 5, 0, 0, 34, 17
;;; Generic
generic_icon:
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte PX(%1111111),PX(%1111111),PX(%1111111),px(%1000000)
.byte px(%1000000),px(%0000000),PX(%0000001),px(%1100000)
.byte px(%1000000),px(%0000000),PX(%0000001),px(%0110000)
.byte px(%1000000),px(%0000000),PX(%0000001),px(%0011000)
.byte px(%1000000),px(%0000000),PX(%0000001),PX(%0001100)
.byte px(%1000000),px(%0000000),PX(%0000001),PX(%0000110)
.byte px(%1000000),px(%0000000),PX(%0000001),PX(%0000011)
.byte px(%1000000),px(%0000000),PX(%0000001),PX(%1111111)
.byte px(%1000000),px(%0000000),px(%0000000),PX(%0000001)
.byte px(%1000000),px(%0000000),px(%0000000),PX(%0000001)
.byte px(%1000000),px(%0000000),px(%0000000),PX(%0000001)
.byte px(%1000000),px(%0000000),px(%0000000),PX(%0000001)
.byte px(%1000000),px(%0000000),px(%0000000),PX(%0000001)
.byte px(%1000000),px(%0000000),px(%0000000),PX(%0000001)
.byte px(%1000000),px(%0000000),px(%0000000),PX(%0000001)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
generic_mask:
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte PX(%1111111),PX(%1111111),PX(%1111111),px(%1000000)
.byte PX(%1111111),PX(%1111111),PX(%1111111),px(%1100000)
.byte PX(%1111111),PX(%1111111),PX(%1111111),px(%1110000)
.byte PX(%1111111),PX(%1111111),PX(%1111111),px(%1111000)
.byte PX(%1111111),PX(%1111111),PX(%1111111),px(%1111100)
.byte PX(%1111111),PX(%1111111),PX(%1111111),px(%1111110)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
;;; Text File
text_icon:
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte PX(%1111111),PX(%1111111),PX(%1111111),px(%1000000)
.byte px(%1000000),px(%0000000),PX(%0000001),px(%1100000)
.byte px(%1001100),px(%0111110),PX(%0111111),px(%0110000)
.byte px(%1000000),px(%0000000),PX(%0000001),px(%0011000)
.byte px(%1001111),px(%1100111),px(%1000001),PX(%0001100)
.byte px(%1000000),px(%0000000),px(%0000001),px(%0000110)
.byte px(%1001111),px(%0011110),px(%0110001),PX(%0000011)
.byte px(%1000000),px(%0000000),PX(%0000001),PX(%1111111)
.byte px(%1000000),px(%0000000),px(%0000000),px(%0000001)
.byte px(%1001111),px(%1100110),px(%0111100),px(%1111001)
.byte px(%1000000),px(%0000000),px(%0000000),px(%0000001)
.byte px(%1001111),px(%0011110),px(%1111111),px(%0000001)
.byte px(%1000000),px(%0000000),px(%0000000),PX(%0000001)
.byte px(%1001111),px(%0011111),px(%1001111),px(%1100001)
.byte px(%1000000),px(%0000000),px(%0000000),PX(%0000001)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
text_mask:
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte PX(%1111111),PX(%1111111),PX(%1111111),px(%1000000)
.byte PX(%1111111),PX(%1111111),PX(%1111111),px(%1100000)
.byte PX(%1111111),PX(%1111111),PX(%1111111),px(%1110000)
.byte PX(%1111111),PX(%1111111),PX(%1111111),px(%1111000)
.byte PX(%1111111),PX(%1111111),PX(%1111111),px(%1111100)
.byte PX(%1111111),PX(%1111111),PX(%1111111),px(%1111110)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
;;; Binary
binary_icon:
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),PX(%0000001),px(%1000000),px(%0000000)
.byte px(%0000000),px(%0000110),px(%0110000),px(%0000000)
.byte px(%0000000),px(%0011000),px(%0001100),px(%0000000)
.byte px(%0000000),px(%1100000),px(%0000011),px(%0000000)
.byte px(%0000011),px(%0000000),px(%0000000),px(%1100000)
.byte px(%0001100),px(%0011000),px(%0011000),px(%0011000)
.byte px(%0110000),px(%0100100),px(%0101000),px(%0000110)
.byte px(%1000000),px(%0100100),px(%0001000),px(%0000001)
.byte px(%0110000),px(%0100100),px(%0001000),px(%0000110)
.byte px(%0001100),px(%0011000),px(%0001000),px(%0011000)
.byte px(%0000011),px(%0000000),px(%0000000),px(%1100000)
.byte px(%0000000),px(%1100000),px(%0000011),px(%0000000)
.byte px(%0000000),px(%0011000),px(%0001100),px(%0000000)
.byte px(%0000000),px(%0000110),px(%0110000),px(%0000000)
.byte px(%0000000),PX(%0000001),px(%1000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
binary_mask:
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),PX(%0000001),px(%1000000),px(%0000000)
.byte px(%0000000),px(%0000111),px(%1110000),px(%0000000)
.byte px(%0000000),PX(%0011111),px(%1111100),px(%0000000)
.byte px(%0000000),PX(%1111111),PX(%1111111),px(%0000000)
.byte px(%0000011),PX(%1111111),PX(%1111111),px(%1100000)
.byte PX(%0001111),PX(%1111111),PX(%1111111),px(%1111000)
.byte PX(%0111111),PX(%1111111),PX(%1111111),px(%1111110)
.byte PX(%0001111),PX(%1111111),PX(%1111111),px(%1111000)
.byte px(%0000011),PX(%1111111),PX(%1111111),px(%1100000)
.byte px(%0000000),PX(%1111111),PX(%1111111),px(%0000000)
.byte px(%0000000),PX(%0011111),px(%1111100),px(%0000000)
.byte px(%0000000),px(%0000111),px(%1110000),px(%0000000)
.byte px(%0000000),PX(%0000001),px(%1000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
;;; Folder
folder_icon:
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte PX(%0011111),px(%1111110),px(%0000000),px(%0000000)
.byte px(%0100000),px(%0000001),px(%0000000),px(%0000000)
.byte PX(%0111111),PX(%1111111),PX(%1111111),px(%1111110)
.byte px(%1000000),px(%0000000),px(%0000000),PX(%0000001)
.byte px(%1000000),px(%0000000),px(%0000000),PX(%0000001)
.byte px(%1000000),px(%0000000),px(%0000000),PX(%0000001)
.byte px(%1000000),px(%0000000),px(%0000000),PX(%0000001)
.byte px(%1000000),px(%0000000),px(%0000000),PX(%0000001)
.byte px(%1000000),px(%0000000),px(%0000000),PX(%0000001)
.byte px(%1000000),px(%0000000),px(%0000000),PX(%0000001)
.byte px(%1000000),px(%0000000),px(%0000000),PX(%0000001)
.byte PX(%0111111),PX(%1111111),PX(%1111111),px(%1111110)
folder_mask:
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte PX(%0011111),px(%1111110),px(%0000000),px(%0000000)
.byte PX(%0111111),PX(%1111111),px(%0000000),px(%0000000)
.byte PX(%0111111),PX(%1111111),PX(%1111111),px(%1111110)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%0111111),PX(%1111111),PX(%1111111),px(%1111110)
;;; System (no .SYSTEM suffix)
sys_icon:
.byte px(%0001111),px(%1111111),px(%1111111),px(%1111000)
.byte px(%0110000),px(%0000000),px(%0000000),px(%0000110)
.byte px(%0110011),px(%1111111),px(%1111111),px(%1100110)
.byte px(%0110011),px(%0000000),px(%0010000),px(%1100110)
.byte px(%0110011),px(%0000000),px(%0100000),px(%1100110)
.byte px(%0110011),px(%0010000),px(%1000100),px(%1100110)
.byte px(%0110011),px(%0100000),px(%0001000),px(%1100110)
.byte px(%0110011),px(%1111111),px(%1111111),px(%1100110)
.byte px(%0110000),px(%0000000),px(%0000000),px(%0000110)
.byte px(%0001111),px(%1111111),px(%1111111),px(%1111000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000011)
.byte px(%1100110),px(%0000000),px(%0000000),px(%0000011)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000011)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111)
.byte px(%1100000),px(%0000000),px(%0000000),px(%0000011)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111)
sys_mask:
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0001111),px(%1111111),px(%1111111),px(%1111000)
.byte px(%0001111),px(%1111111),px(%1111111),px(%1111000)
.byte px(%0001111),px(%1111111),px(%1111111),px(%1111000)
.byte px(%0001111),px(%1111111),px(%1111111),px(%1111000)
.byte px(%0001111),px(%1111111),px(%1111111),px(%1111000)
.byte px(%0001111),px(%1111111),px(%1111111),px(%1111000)
.byte px(%0001111),px(%1111111),px(%1111111),px(%1111000)
.byte px(%0001111),px(%1111111),px(%1111111),px(%1111000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0011111),px(%1111111),px(%1111111),px(%1111100)
.byte px(%0011111),px(%1111111),px(%1111111),px(%1111100)
.byte px(%0011111),px(%1111111),px(%1111111),px(%1111100)
.byte px(%0011111),px(%1111111),px(%1111111),px(%1111100)
.byte px(%0011111),px(%1111111),px(%1111111),px(%1111100)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
;;; Basic
basic_icon:
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),PX(%0000001),px(%1000000),px(%0000000)
.byte px(%0000000),px(%0000110),px(%0110000),px(%0000000)
.byte px(%0000000),px(%0011000),px(%0001100),px(%0000000)
.byte px(%0000000),px(%1100000),px(%0000011),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0111110),px(%0111000),px(%1111010),px(%0111100)
.byte px(%0100010),px(%1000100),px(%1000010),px(%1000110)
.byte px(%0111100),px(%1111100),px(%1111010),px(%1000000)
.byte px(%0100010),px(%1000100),px(%0001010),px(%1000110)
.byte px(%0111110),px(%1000100),px(%1111010),px(%0111100)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%1100000),px(%0000011),px(%0000000)
.byte px(%0000000),px(%0011000),px(%0001100),px(%0000000)
.byte px(%0000000),px(%0000110),px(%0110000),px(%0000000)
.byte px(%0000000),PX(%0000001),px(%1000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
basic_mask:
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),PX(%0000001),px(%1000000),px(%0000000)
.byte px(%0000000),px(%0000111),px(%1110000),px(%0000000)
.byte px(%0000000),PX(%0011111),px(%1111100),px(%0000000)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte PX(%1111111),PX(%1111111),PX(%1111111),PX(%1111111)
.byte px(%0000000),PX(%0011111),px(%1111100),px(%0000000)
.byte px(%0000000),px(%0000111),px(%1110000),px(%0000000)
.byte px(%0000000),PX(%0000001),px(%1000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000)
;;; System (with .SYSTEM suffix)
app_icon:
.byte px(%0000000),px(%0000000),px(%0011000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%1100110),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000011),px(%0000001),px(%1000000),px(%0000000)
.byte px(%0000000),px(%0001100),px(%0000000),px(%0110000),px(%0000000)
.byte px(%0000000),px(%0110000),px(%0000000),px(%0001100),px(%0000000)
.byte px(%0000001),px(%1000000),px(%0000000),px(%0000011),px(%0000000)
.byte px(%0000110),px(%0000000),px(%0000000),px(%0000000),px(%1100000)
.byte px(%0011000),px(%0000000),px(%0000001),px(%1111100),px(%0011000)
.byte px(%1100000),px(%0000000),px(%0000110),px(%0000011),px(%0000110)
.byte px(%0011000),px(%0000000),px(%0011000),px(%1110000),px(%1111000)
.byte px(%0000110),px(%0000111),px(%1111111),px(%1111100),px(%0011110)
.byte px(%0000001),px(%1000000),px(%0110000),px(%1100000),px(%0011110)
.byte px(%0000000),px(%0110000),px(%0001110),px(%0000000),px(%0011110)
.byte px(%0000000),px(%0001100),px(%0000001),PX(%1111111),px(%1111110)
.byte px(%0000000),px(%0000011),px(%0000001),px(%1000000),px(%0011110)
.byte px(%0000000),px(%0000000),px(%1100110),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0011000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000)
app_mask:
.byte px(%0000000),px(%0000000),px(%0011000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%1111110),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000011),px(%1111111),px(%1000000),px(%0000000)
.byte px(%0000000),px(%0001111),px(%1111111),px(%1110000),px(%0000000)
.byte px(%0000000),px(%0111111),px(%1111111),px(%1111100),px(%0000000)
.byte px(%0000001),px(%1111111),px(%1111111),px(%1111111),px(%0000000)
.byte px(%0000111),px(%1111111),px(%1111111),px(%1111111),px(%1100000)
.byte px(%0011111),px(%1111111),px(%1111111),px(%1111111),px(%1111000)
.byte px(%1111111),px(%1111111),px(%1111111),px(%1111111),px(%1111110)
.byte px(%0011111),px(%1111111),px(%1111111),px(%1111111),px(%1111100)
.byte px(%0000111),px(%1111111),px(%1111111),px(%1111111),px(%1111000)
.byte px(%0000001),px(%1111111),px(%1111111),px(%1111111),px(%1111000)
.byte px(%0000000),px(%0111111),px(%1111111),px(%1111100),px(%1111000)
.byte px(%0000000),px(%0001111),px(%1111111),px(%1111000),px(%0000000)
.byte px(%0000000),px(%0000011),px(%1111111),px(%1000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%1111110),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0011000),px(%0000000),px(%0000000)
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000)
2018-01-21 03:33:15 +00:00
.assert * = $FFBA, error, "Segment length mismatch"
PAD_TO $10000
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-06 05:17:13 +00:00
;;; Segment loaded into MAIN $4000-$BEFF
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-06 05:17:13 +00:00
.proc desktop_main
2017-10-12 15:04:27 +00:00
L0020 := $0020
L0800 := $0800
L0CB8 := $0CB8
L0CD7 := $0CD7
L0CF9 := $0CF9
L0D14 := $0D14
2017-12-31 03:21:34 +00:00
dynamic_routine_800 := $0800
dynamic_routine_5000 := $5000
dynamic_routine_7000 := $7000
dynamic_routine_9000 := $9000
2018-01-20 02:55:15 +00:00
dynamic_routine_disk_copy := 0
dynamic_routine_format_erase := 1
dynamic_routine_selector1 := 2
dynamic_routine_common := 3
dynamic_routine_file_copy := 4
dynamic_routine_file_delete := 5
dynamic_routine_selector2 := 6
dynamic_routine_restore5000 := 7
dynamic_routine_restore9000 := 8
2017-12-31 03:21:34 +00:00
.org $4000
2018-01-05 04:27:15 +00:00
;; Jump table
2018-01-20 22:31:48 +00:00
;; Entries marked with * are used by DAs
;; "Exported" by desktop.inc
2018-02-16 20:14:39 +00:00
JT_MAIN_LOOP: jmp enter_main_loop
2018-02-03 05:11:49 +00:00
JT_MGTK_RELAY: jmp MGTK_RELAY
2018-02-10 06:59:05 +00:00
JT_SIZE_STRING: jmp compose_blocks_string
JT_DATE_STRING: jmp compose_date_string
2018-01-20 22:31:48 +00:00
L400C: jmp L5E78 ; ???
2018-03-22 02:23:24 +00:00
JT_AUXLOAD: jmp DESKTOP_AUXLOAD
2018-01-20 22:31:48 +00:00
JT_EJECT: jmp cmd_eject
JT_REDRAW_ALL: jmp redraw_windows ; *
JT_DESKTOP_RELAY: jmp DESKTOP_RELAY
JT_LOAD_SEG: jmp load_dynamic_routine
JT_CLEAR_SELECTION: jmp clear_selection ; *
JT_MLI_RELAY: jmp MLI_RELAY ; *
JT_COPY_TO_BUF: jmp DESKTOP_COPY_TO_BUF
JT_COPY_FROM_BUF: jmp DESKTOP_COPY_FROM_BUF
JT_NOOP: jmp cmd_noop
L402D: jmp L8707 ; ???
JT_SHOW_ALERT0: jmp DESKTOP_SHOW_ALERT0
JT_SHOW_ALERT: jmp DESKTOP_SHOW_ALERT
JT_LAUNCH_FILE: jmp launch_file
JT_CUR_POINTER: jmp set_pointer_cursor ; *
JT_CUR_WATCH: jmp set_watch_cursor
JT_RESTORE_SEF: jmp restore_dynamic_routine
2017-10-12 15:04:27 +00:00
2018-02-16 20:14:39 +00:00
;; Main Loop
.proc enter_main_loop
cli
2018-02-16 21:27:31 +00:00
2017-10-12 15:04:27 +00:00
sta ALTZPON
lda LCBANK1
lda LCBANK1
2018-02-16 21:27:31 +00:00
jsr L4530 ; something with DEVLST ???
;; Add icons (presumably desktop ones?)
2018-02-16 20:14:39 +00:00
ldx #0
2018-02-16 21:27:31 +00:00
iloop: cpx cached_window_icon_count
beq skip
2017-10-12 15:04:27 +00:00
txa
pha
2018-02-08 05:48:19 +00:00
lda cached_window_icon_list,x
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-02-16 21:27:31 +00:00
ldy #DT_ADD_ICON
jsr DESKTOP_RELAY ; icon entry addr in A,X
2017-10-12 15:04:27 +00:00
pla
tax
inx
2018-02-16 21:27:31 +00:00
jmp iloop
2017-10-12 15:04:27 +00:00
2018-02-16 21:27:31 +00:00
skip: lda #0
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_FROM_BUF
2018-02-16 21:27:31 +00:00
;; Clear various flags
2018-02-16 20:14:39 +00:00
lda #0
2018-01-28 16:08:39 +00:00
sta LD2A9
sta double_click_flag
2018-02-16 21:27:31 +00:00
sta loop_counter
2018-03-05 05:33:56 +00:00
sta LE26F
2018-02-16 21:27:31 +00:00
;; Pending error message?
lda pending_alert
2018-02-16 20:14:39 +00:00
beq main_loop
2017-10-12 15:04:27 +00:00
tay
jsr DESKTOP_SHOW_ALERT0
2018-02-16 20:14:39 +00:00
;; Main loop
main_loop:
jsr reset_grafport3
2018-02-16 21:27:31 +00:00
inc loop_counter
inc loop_counter
lda loop_counter
cmp machine_type ; for per-machine timing
bcc :+
2018-02-16 20:14:39 +00:00
lda #0
2018-02-16 21:27:31 +00:00
sta loop_counter
jsr L4563 ; called every few ticks ???
beq :+
jsr L40E0 ; conditionally ???
: jsr L464E
2018-02-16 20:14:39 +00:00
;; Get an event
2018-02-03 04:41:42 +00:00
jsr get_event
2018-02-28 02:38:18 +00:00
lda event_kind
2018-02-16 20:14:39 +00:00
;; Is it a button-down event? (including w/ modifiers)
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_button_down
2018-02-16 20:14:39 +00:00
beq click
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_apple_key
2018-02-16 20:14:39 +00:00
bne :+
click: jsr handle_click
jmp main_loop
2017-10-12 15:04:27 +00:00
2018-02-16 20:14:39 +00:00
;; Is it a key down event?
: cmp #MGTK::event_kind_key_down
bne :+
jsr handle_keydown
jmp main_loop
2017-10-12 15:04:27 +00:00
2018-02-16 20:14:39 +00:00
;; Is it an update event?
: cmp #MGTK::event_kind_update
bne :+
2018-01-30 16:57:36 +00:00
jsr reset_grafport3
2018-02-03 04:41:42 +00:00
lda active_window_id
2017-10-12 15:04:27 +00:00
sta L40F0
lda #$80
sta L40F1
jsr L410D
2018-02-16 20:14:39 +00:00
: jmp main_loop
2017-10-12 15:04:27 +00:00
2018-02-16 21:27:31 +00:00
loop_counter:
.byte 0
;;; --------------------------------------------------
2017-10-12 15:04:27 +00:00
L40E0: tsx
2018-02-15 16:08:59 +00:00
stx LE256
2018-02-06 23:36:39 +00:00
sta menu_click_params::item_num
2017-10-12 15:04:27 +00:00
jsr L59A0
2018-02-16 21:27:31 +00:00
lda #0
2018-02-06 23:36:39 +00:00
sta menu_click_params::item_num
2017-10-12 15:04:27 +00:00
rts
2017-12-31 02:02:15 +00:00
L40F0: .byte $00
L40F1: .byte $00
2018-01-20 18:57:25 +00:00
redraw_windows:
2018-01-30 16:57:36 +00:00
jsr reset_grafport3
2018-02-03 04:41:42 +00:00
lda active_window_id
2017-10-12 15:04:27 +00:00
sta L40F0
lda #$00
sta L40F1
2018-02-03 04:41:42 +00:00
L4100: jsr peek_event
2018-02-28 02:38:18 +00:00
lda event_kind
2018-02-16 20:14:39 +00:00
cmp #MGTK::event_kind_update
2017-10-12 15:04:27 +00:00
bne L412B
2018-02-03 04:41:42 +00:00
jsr get_event
2017-10-12 15:04:27 +00:00
L410D: jsr L4113
jmp L4100
2018-02-28 02:38:18 +00:00
L4113: MGTK_RELAY_CALL MGTK::BeginUpdate, event_window_id
2018-02-16 20:14:39 +00:00
bne L4151 ; did not really need updating
jsr update_window
2018-01-29 16:38:23 +00:00
MGTK_RELAY_CALL MGTK::EndUpdate
2017-10-12 15:04:27 +00:00
rts
2018-02-08 05:36:53 +00:00
L412B: lda #0
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_TO_BUF
2017-10-12 15:04:27 +00:00
lda L40F0
2018-02-03 04:41:42 +00:00
sta active_window_id
2017-10-12 15:04:27 +00:00
beq L4143
2018-01-23 16:33:12 +00:00
bit running_da_flag
2017-10-12 15:04:27 +00:00
bmi L4143
jsr L4244
L4143: bit L40F1
bpl L4151
2018-02-05 03:13:21 +00:00
DESKTOP_RELAY_CALL DT_REDRAW_ICONS
2017-10-12 15:04:27 +00:00
L4151: rts
2018-02-16 20:14:39 +00:00
.endproc
main_loop := enter_main_loop::main_loop
redraw_windows := enter_main_loop::redraw_windows
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-16 20:14:39 +00:00
2017-12-31 20:32:47 +00:00
L4152: .byte 0
2018-02-16 20:14:39 +00:00
2018-02-17 07:08:39 +00:00
.proc update_window
2018-02-28 02:38:18 +00:00
lda event_window_id
2018-03-22 02:23:24 +00:00
cmp #9 ; only handle windows 1...8
2017-10-12 15:04:27 +00:00
bcc L415B
rts
2018-02-03 04:41:42 +00:00
L415B: sta active_window_id
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_TO_BUF
2017-10-12 15:04:27 +00:00
lda #$80
sta L4152
2018-02-08 05:48:19 +00:00
lda cached_window_id
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2018-02-12 01:21:37 +00:00
jsr get_port2
2018-02-10 06:10:11 +00:00
jsr draw_window_header
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-02-18 01:15:27 +00:00
jsr copy_window_portbits
jsr DESKTOP_ASSIGN_STATE
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-01-21 03:02:34 +00:00
jsr window_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$16
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
sec
2018-02-06 04:37:41 +00:00
sbc grafport2::viewloc::ycoord
2017-10-12 15:04:27 +00:00
sta L4242
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-06 04:37:41 +00:00
sbc grafport2::viewloc::ycoord+1
2017-10-12 15:04:27 +00:00
sta L4243
2018-03-15 03:53:20 +00:00
cmp16 L4242, #15
2017-10-12 15:04:27 +00:00
bpl L41CB
2018-02-14 02:53:02 +00:00
jsr offset_grafport2
2017-10-12 15:04:27 +00:00
ldx #$0B
ldy #$1F
2018-01-30 16:57:36 +00:00
lda grafport2,x
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
dey
dex
2018-01-30 16:57:36 +00:00
lda grafport2,x
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
ldx #$03
ldy #$17
2018-01-30 16:57:36 +00:00
lda grafport2,x
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
dey
dex
2018-01-30 16:57:36 +00:00
lda grafport2,x
2018-01-17 15:41:23 +00:00
sta ($06),y
2018-02-08 05:48:19 +00:00
L41CB: ldx cached_window_id
2017-10-12 15:04:27 +00:00
dex
2018-02-03 03:38:35 +00:00
lda win_buf_table,x
2017-10-12 15:04:27 +00:00
bpl L41E2
jsr L6C19
lda #$00
sta L4152
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-02-18 01:15:27 +00:00
jmp assign_window_portbits
2017-10-12 15:04:27 +00:00
2018-02-08 05:48:19 +00:00
L41E2: lda cached_window_id
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2018-02-12 01:21:37 +00:00
jsr get_set_port2
2018-02-14 03:15:45 +00:00
jsr cached_icons_window_to_screen
2018-02-17 07:08:39 +00:00
2018-01-16 04:57:02 +00:00
ldx #7
2018-02-17 07:08:39 +00:00
: lda grafport2::cliprect,x
2018-01-21 03:33:15 +00:00
sta rect_E230,x
2017-10-12 15:04:27 +00:00
dex
2018-02-17 07:08:39 +00:00
bpl :-
lda #0
2017-10-12 15:04:27 +00:00
sta L4241
L41FE: lda L4241
2018-02-08 05:48:19 +00:00
cmp cached_window_icon_count
2017-10-12 15:04:27 +00:00
beq L4227
tax
2018-02-08 05:48:19 +00:00
lda cached_window_icon_list,x
2018-02-15 16:08:59 +00:00
sta icon_param
DESKTOP_RELAY_CALL DT_ICON_IN_RECT, icon_param
2018-02-17 07:08:39 +00:00
beq :+
2018-02-15 16:08:59 +00:00
DESKTOP_RELAY_CALL DT_UNHIGHLIGHT_ICON, icon_param
2018-02-17 07:08:39 +00:00
: inc L4241
2017-10-12 15:04:27 +00:00
jmp L41FE
L4227: lda #$00
sta L4152
2018-02-08 05:48:19 +00:00
lda cached_window_id
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2018-02-12 01:21:37 +00:00
jsr get_set_port2
2018-02-14 03:15:45 +00:00
jsr cached_icons_screen_to_window
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-02-18 01:15:27 +00:00
jsr assign_window_portbits
2018-01-30 16:57:36 +00:00
jmp reset_grafport3
2017-10-12 15:04:27 +00:00
2017-12-31 20:32:47 +00:00
L4241: .byte 0
L4242: .byte 0
L4243: .byte 0
2018-02-17 07:08:39 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-17 07:08:39 +00:00
.proc L4244
2018-02-19 19:33:13 +00:00
lda selected_icon_count
2018-02-17 07:08:39 +00:00
bne :+
bail: rts
2017-10-12 15:04:27 +00:00
2018-02-17 07:08:39 +00:00
: lda #0
2017-10-12 15:04:27 +00:00
sta L42C3
2018-02-17 07:08:39 +00:00
lda selected_window_index
2017-10-12 15:04:27 +00:00
beq L42A5
2018-02-03 04:41:42 +00:00
cmp active_window_id
2018-02-17 07:08:39 +00:00
bne bail
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2018-02-12 01:21:37 +00:00
jsr get_port2
2018-02-14 02:53:02 +00:00
jsr offset_grafport2_and_set
2018-02-17 07:08:39 +00:00
2018-01-16 04:57:02 +00:00
ldx #7
2018-02-17 07:08:39 +00:00
: lda grafport2::cliprect,x
2018-01-21 03:33:15 +00:00
sta rect_E230,x
2017-10-12 15:04:27 +00:00
dex
2018-02-17 07:08:39 +00:00
bpl :-
2017-10-12 15:04:27 +00:00
L4270: lda L42C3
2018-02-19 19:33:13 +00:00
cmp selected_icon_count
2018-02-17 07:08:39 +00:00
beq done
2017-10-12 15:04:27 +00:00
tax
2018-02-19 19:33:13 +00:00
lda selected_icon_list,x
2018-02-15 16:08:59 +00:00
sta icon_param
2018-02-13 16:18:11 +00:00
jsr icon_window_to_screen
2018-02-15 16:08:59 +00:00
DESKTOP_RELAY_CALL DT_ICON_IN_RECT, icon_param
2018-02-17 07:08:39 +00:00
beq :+
2018-02-15 16:08:59 +00:00
DESKTOP_RELAY_CALL DT_UNHIGHLIGHT_ICON, icon_param
2018-02-17 07:08:39 +00:00
: lda icon_param
2018-02-13 16:18:11 +00:00
jsr icon_screen_to_window
2017-10-12 15:04:27 +00:00
inc L42C3
jmp L4270
2018-02-17 07:08:39 +00:00
done: jmp reset_grafport3
2017-10-12 15:04:27 +00:00
L42A5: lda L42C3
2018-02-19 19:33:13 +00:00
cmp selected_icon_count
2018-02-17 07:08:39 +00:00
beq done
2017-10-12 15:04:27 +00:00
tax
2018-02-19 19:33:13 +00:00
lda selected_icon_list,x
2018-02-15 16:08:59 +00:00
sta icon_param
DESKTOP_RELAY_CALL DT_UNHIGHLIGHT_ICON, icon_param
2017-10-12 15:04:27 +00:00
inc L42C3
jmp L42A5
2018-02-17 07:08:39 +00:00
L42C3: .byte 0
.endproc
2018-01-19 05:34:55 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 05:34:55 +00:00
;;; Menu Dispatch
2018-02-16 20:14:39 +00:00
.proc handle_keydown_impl
2018-01-21 00:44:49 +00:00
2018-02-19 07:44:08 +00:00
;; Keep in sync with desktop_aux::menu_item_id_*
2018-01-19 05:34:55 +00:00
;; jump table for menu item handlers
2018-01-21 00:44:49 +00:00
dispatch_table:
2018-01-19 05:34:55 +00:00
;; Apple menu (1)
2018-01-19 05:57:25 +00:00
.addr cmd_about
.addr cmd_noop ; --------
.addr cmd_deskacc
.addr cmd_deskacc
.addr cmd_deskacc
.addr cmd_deskacc
.addr cmd_deskacc
.addr cmd_deskacc
.addr cmd_deskacc
.addr cmd_deskacc
2018-01-19 05:34:55 +00:00
;; File menu (2)
2018-01-19 05:57:25 +00:00
.addr cmd_new_folder
.addr cmd_noop ; --------
.addr cmd_open
.addr cmd_close
.addr cmd_close_all
.addr cmd_select_all
.addr cmd_noop ; --------
.addr cmd_copy_file
.addr cmd_delete_file
.addr cmd_noop ; --------
.addr cmd_eject
.addr cmd_quit
2018-01-19 05:34:55 +00:00
;; Selector menu (3)
2018-01-19 05:57:25 +00:00
.addr cmd_selector_action
.addr cmd_selector_action
.addr cmd_selector_action
.addr cmd_selector_action
.addr cmd_noop ; --------
.addr cmd_selector_item
.addr cmd_selector_item
.addr cmd_selector_item
.addr cmd_selector_item
.addr cmd_selector_item
.addr cmd_selector_item
.addr cmd_selector_item
.addr cmd_selector_item
2018-01-19 05:34:55 +00:00
;; View menu (4)
2018-01-19 05:57:25 +00:00
.addr cmd_view_by_icon
.addr cmd_view_by_name
.addr cmd_view_by_date
.addr cmd_view_by_size
.addr cmd_view_by_type
2018-01-19 05:34:55 +00:00
;; Special menu (5)
2018-01-19 05:57:25 +00:00
.addr cmd_check_drives
.addr cmd_noop ; --------
.addr cmd_format_disk
.addr cmd_erase_disk
.addr cmd_disk_copy
.addr cmd_noop ; --------
.addr cmd_lock
.addr cmd_unlock
.addr cmd_noop ; --------
.addr cmd_get_info
.addr cmd_get_size
.addr cmd_noop ; --------
.addr cmd_rename_icon
2018-01-19 05:34:55 +00:00
;; (6 is duplicated to 5)
2018-01-19 05:57:25 +00:00
;; no menu 7 ??
.addr cmd_check_drives ; duplicate???
2018-02-19 07:44:08 +00:00
.addr cmd_noop ; --------
.addr L59A0 ; ???
2018-01-19 05:57:25 +00:00
.addr L59A0
.addr L59A0
.addr L59A0
.addr L59A0
.addr L59A0
.addr L59A0
.addr L59A0
2018-01-19 05:34:55 +00:00
;; Startup menu (8)
2018-01-19 05:57:25 +00:00
.addr cmd_startup_item
.addr cmd_startup_item
.addr cmd_startup_item
.addr cmd_startup_item
.addr cmd_startup_item
.addr cmd_startup_item
.addr cmd_startup_item
2018-01-19 05:34:55 +00:00
;; indexed by menu id-1
2018-01-21 00:44:49 +00:00
offset_table:
2018-03-22 02:23:24 +00:00
.byte 0,20,44,70,80,80,106,126,140
2018-01-21 00:44:49 +00:00
flag: .byte $00
2018-01-19 05:34:55 +00:00
2018-01-26 02:22:33 +00:00
;; Handle accelerator keys
2018-02-16 20:14:39 +00:00
handle_keydown:
2018-02-28 02:38:18 +00:00
lda event_modifiers
2018-01-26 02:22:33 +00:00
bne :+ ; either OA or CA ?
jmp menu_accelerators ; nope
: cmp #3 ; both OA + CA ?
bne :+ ; nope
2017-10-12 15:04:27 +00:00
rts
2018-01-26 02:22:33 +00:00
;; Non-menu keys
2018-02-28 02:38:18 +00:00
: lda event_key
2018-01-26 02:22:33 +00:00
ora #$20 ; force to lower-case
cmp #'h' ; OA-H (Highlight Icon)
bne :+
jmp cmd_higlight
: bit flag
bpl menu_accelerators
cmp #'w' ; OA-W (Activate Window)
bne :+
jmp cmd_activate
: cmp #'g' ; OA-G (Resize)
bne :+
jmp cmd_resize
: cmp #'m' ; OA-M (Move)
bne :+
jmp cmd_move
: cmp #'x' ; OA-X (Scroll)
bne menu_accelerators
jmp cmd_scroll
2017-10-12 15:04:27 +00:00
2018-01-26 02:22:33 +00:00
menu_accelerators:
2018-01-30 16:57:36 +00:00
lda event_params+1
2018-02-19 22:06:12 +00:00
sta LE25C
2018-01-30 16:57:36 +00:00
lda event_params+2
2017-10-12 15:04:27 +00:00
beq L43A1
2018-02-19 22:06:12 +00:00
lda #1
L43A1: sta LE25D
2018-01-29 16:38:23 +00:00
MGTK_RELAY_CALL MGTK::MenuKey, menu_click_params
2018-01-21 00:44:49 +00:00
menu_dispatch2:
ldx menu_click_params::menu_id
2018-02-19 07:44:08 +00:00
bne :+
2017-10-12 15:04:27 +00:00
rts
2018-02-19 07:44:08 +00:00
: dex ; x has top level menu id
2018-01-21 00:44:49 +00:00
lda offset_table,x
2017-10-12 15:04:27 +00:00
tax
2018-02-06 23:36:39 +00:00
ldy menu_click_params::item_num
2017-10-12 15:04:27 +00:00
dey
tya
asl a
sta L43E5
2017-12-31 02:02:15 +00:00
txa
2017-10-12 15:04:27 +00:00
clc
adc L43E5
tax
2018-02-06 17:31:58 +00:00
copy16 dispatch_table,x, L43E5
2017-10-12 15:04:27 +00:00
jsr L43E0
2018-01-29 16:38:23 +00:00
MGTK_RELAY_CALL MGTK::HiliteMenu, menu_click_params
2017-10-12 15:04:27 +00:00
rts
L43E0: tsx
2018-02-15 16:08:59 +00:00
stx LE256
2018-01-05 04:27:15 +00:00
L43E5 := *+1
2018-01-17 03:36:54 +00:00
jmp dummy1234 ; self-modified
2018-01-21 00:44:49 +00:00
.endproc
2018-02-16 20:14:39 +00:00
handle_keydown := handle_keydown_impl::handle_keydown
menu_dispatch2 := handle_keydown_impl::menu_dispatch2
menu_dispatch_flag := handle_keydown_impl::flag
2018-01-19 05:34:55 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-28 16:08:39 +00:00
;;; Handle click
2018-01-19 05:34:55 +00:00
2018-01-28 16:08:39 +00:00
.proc handle_click
tsx
2018-02-15 16:08:59 +00:00
stx LE256
2018-02-28 02:38:18 +00:00
MGTK_RELAY_CALL MGTK::FindWindow, event_coords
lda findwindow_which_area
2018-01-28 16:08:39 +00:00
bne not_desktop
;; Click on desktop
2018-01-21 01:16:31 +00:00
jsr detect_double_click
2018-01-28 16:08:39 +00:00
sta double_click_flag
lda #0
2018-02-28 02:38:18 +00:00
sta findwindow_window_id
DESKTOP_RELAY_CALL DT_FIND_ICON, event_coords
2018-02-05 03:13:21 +00:00
lda findicon_which_icon
2017-10-12 15:04:27 +00:00
beq L4415
jmp L67D7
L4415: jmp L68AA
2018-01-28 16:08:39 +00:00
not_desktop:
2018-01-29 05:18:00 +00:00
cmp #MGTK::area_menubar ; menu?
2018-01-28 16:08:39 +00:00
bne not_menu
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::MenuSelect, menu_click_params
2018-01-21 00:44:49 +00:00
jmp menu_dispatch2
2017-10-12 15:04:27 +00:00
2018-01-28 16:08:39 +00:00
not_menu:
pha ; which window - active or not?
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-02-28 02:38:18 +00:00
cmp findwindow_window_id
2018-01-28 16:08:39 +00:00
beq handle_active_window_click
2017-10-12 15:04:27 +00:00
pla
2018-01-28 16:08:39 +00:00
jmp handle_inactive_window_click
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-01-28 16:08:39 +00:00
.proc handle_active_window_click
pla
2018-01-29 05:18:00 +00:00
cmp #MGTK::area_content
2018-01-26 02:22:33 +00:00
bne :+
2018-01-21 01:16:31 +00:00
jsr detect_double_click
2018-01-28 16:08:39 +00:00
sta double_click_flag
2018-01-26 02:22:33 +00:00
jmp handle_client_click
2018-01-29 05:18:00 +00:00
: cmp #MGTK::area_dragbar
2018-01-26 02:22:33 +00:00
bne :+
jmp handle_title_click
2018-01-29 05:18:00 +00:00
: cmp #MGTK::area_grow_box
2018-01-26 02:22:33 +00:00
bne :+
jmp handle_resize_click
2018-01-29 05:18:00 +00:00
: cmp #MGTK::area_close_box
2018-01-28 16:08:39 +00:00
bne :+
2018-01-26 02:22:33 +00:00
jmp handle_close_click
2018-01-28 16:08:39 +00:00
: rts
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-01-28 16:08:39 +00:00
.proc handle_inactive_window_click
jmp L445D
2017-10-12 15:04:27 +00:00
2017-12-31 20:32:47 +00:00
L445C: .byte 0
2018-01-20 18:57:25 +00:00
L445D: jsr clear_selection
2018-03-05 05:52:38 +00:00
ldx findwindow_window_id
2017-10-12 15:04:27 +00:00
dex
2018-01-13 03:06:55 +00:00
lda LEC26,x
2018-02-15 16:08:59 +00:00
sta icon_param
lda icon_param
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$01
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
beq L44A6
ora #$80
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
and #$0F
sta L445C
2018-02-18 01:15:27 +00:00
jsr zero_grafport5_coords
2018-02-15 16:08:59 +00:00
DESKTOP_RELAY_CALL DT_HIGHLIGHT_ICON, icon_param
2018-01-30 16:57:36 +00:00
jsr reset_grafport3
2017-10-12 15:04:27 +00:00
lda L445C
sta selected_window_index
2017-10-12 15:04:27 +00:00
lda #$01
2018-02-19 19:33:13 +00:00
sta selected_icon_count
2018-02-15 16:08:59 +00:00
lda icon_param
2018-02-19 19:33:13 +00:00
sta selected_icon_list
2018-02-28 02:38:18 +00:00
L44A6: MGTK_RELAY_CALL MGTK::SelectWindow, findwindow_window_id
lda findwindow_window_id
2018-02-03 04:41:42 +00:00
sta active_window_id
2018-02-08 05:48:19 +00:00
sta cached_window_id
2018-02-05 04:46:26 +00:00
jsr DESKTOP_COPY_TO_BUF
2017-10-12 15:04:27 +00:00
jsr L6C19
lda #$00
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_TO_BUF
2018-02-14 02:53:02 +00:00
lda #MGTK::checkitem_uncheck
2018-02-01 19:30:03 +00:00
sta checkitem_params::check
MGTK_RELAY_CALL MGTK::CheckItem, checkitem_params
2018-02-03 04:41:42 +00:00
ldx active_window_id
2017-10-12 15:04:27 +00:00
dex
2018-02-03 03:38:35 +00:00
lda win_buf_table,x
2017-10-12 15:04:27 +00:00
and #$0F
2018-02-01 19:30:03 +00:00
sta checkitem_params::menu_item
inc checkitem_params::menu_item
2018-02-14 02:53:02 +00:00
lda #MGTK::checkitem_check
2018-02-01 19:30:03 +00:00
sta checkitem_params::check
MGTK_RELAY_CALL MGTK::CheckItem, checkitem_params
2017-10-12 15:04:27 +00:00
rts
2018-01-28 16:08:39 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-12 01:21:37 +00:00
.proc get_set_port2
MGTK_RELAY_CALL MGTK::GetWinPort, getwinport_params2
2018-01-30 16:57:36 +00:00
MGTK_RELAY_CALL MGTK::SetPort, grafport2
2017-10-12 15:04:27 +00:00
rts
2018-02-12 01:21:37 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-02-12 01:21:37 +00:00
.proc get_port2
MGTK_RELAY_CALL MGTK::GetWinPort, getwinport_params2
2017-10-12 15:04:27 +00:00
rts
2018-02-12 01:21:37 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-02-12 01:21:37 +00:00
rts ; ???
2017-10-12 15:04:27 +00:00
2018-02-12 01:21:37 +00:00
.proc reset_grafport3
2018-01-30 16:57:36 +00:00
MGTK_RELAY_CALL MGTK::InitPort, grafport3
MGTK_RELAY_CALL MGTK::SetPort, grafport3
2017-10-12 15:04:27 +00:00
rts
2018-02-12 01:21:37 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-21 16:37:01 +00:00
.proc redraw_windows_and_desktop
jsr redraw_windows
2018-02-05 03:13:21 +00:00
DESKTOP_RELAY_CALL DT_REDRAW_ICONS
2017-10-12 15:04:27 +00:00
rts
2018-01-21 16:37:01 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-16 21:27:31 +00:00
.proc L4530
ldx #0
2018-01-15 04:55:54 +00:00
ldy DEVCNT
2018-02-16 21:27:31 +00:00
loop: lda DEVLST,y
2017-10-12 15:04:27 +00:00
and #$0F
2018-02-16 21:27:31 +00:00
cmp #$0B ; RAM Disk???
2017-10-12 15:04:27 +00:00
beq L4559
2018-02-16 21:27:31 +00:00
next: dey
bpl loop
2017-10-12 15:04:27 +00:00
stx L4597
stx L45A0
jsr L45B2
ldx L45A0
2018-02-16 21:27:31 +00:00
beq done
: lda L45A0,x
2017-10-12 15:04:27 +00:00
sta L45A9,x
dex
2018-02-16 21:27:31 +00:00
bpl :-
done: rts
2017-10-12 15:04:27 +00:00
2018-01-15 04:55:54 +00:00
L4559: lda DEVLST,y
2017-10-12 15:04:27 +00:00
inx
sta L4597,x
2018-02-16 21:27:31 +00:00
bne next
2017-10-12 15:04:27 +00:00
rts
2018-02-16 21:27:31 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-16 21:27:31 +00:00
.proc L4563
lda L45A0
2017-10-12 15:04:27 +00:00
beq L4579
jsr L45B2
ldx L45A0
L456E: lda L45A0,x
cmp L45A9,x
bne L457C
dex
bne L456E
2018-02-16 03:29:05 +00:00
L4579: return #0
2017-10-12 15:04:27 +00:00
L457C: lda L45A0,x
sta L45A9,x
lda L4597,x
2018-01-15 04:55:54 +00:00
ldy DEVCNT
L4588: cmp DEVLST,y
2017-10-12 15:04:27 +00:00
beq L4591
dey
bpl L4588
rts
L4591: tya
clc
adc #$03
rts
2018-02-16 21:27:31 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2017-12-31 02:02:15 +00:00
.byte $00
L4597: .byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00
L45A0: .byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00
L45A9: .byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00
2018-02-16 21:27:31 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-16 21:27:31 +00:00
;; Possibly SmartPort STATUS call to determine ejectability ???
.proc L45B2
2018-02-17 01:17:54 +00:00
ptr := $6
2018-02-16 21:27:31 +00:00
ldx L4597
2018-02-17 01:17:54 +00:00
beq done
2017-10-12 15:04:27 +00:00
stx L45A0
2018-02-17 01:17:54 +00:00
: lda L4597,x
2017-10-12 15:04:27 +00:00
jsr L45C7
sta L45A0,x
dex
2018-02-17 01:17:54 +00:00
bne :-
done: rts
2017-10-12 15:04:27 +00:00
2018-02-17 01:17:54 +00:00
L45C7: sta unit_num
2017-10-12 15:04:27 +00:00
txa
pha
tya
pha
2018-02-17 01:17:54 +00:00
;; Compute driver address ($BFds for Slot s Drive d)
2017-10-12 15:04:27 +00:00
ldx #$11
2018-02-17 01:17:54 +00:00
lda unit_num
and #$80 ; high bit is drive (0=D1, 1=D2)
2018-02-18 01:15:27 +00:00
beq :+
2017-10-12 15:04:27 +00:00
ldx #$21
2018-02-18 01:15:27 +00:00
: stx bf_lo ; D1=$11, D2=$21
2018-02-17 01:17:54 +00:00
lda unit_num
2017-10-12 15:04:27 +00:00
and #$70
lsr a
lsr a
lsr a
clc
2018-02-17 01:17:54 +00:00
adc bf_lo
sta bf_lo
bf_lo := *+1
lda $BF00 ; self-modified to $BFds
sta ptr+1
lda #0 ; Bug: assumes driver is at $XX00 ???
sta ptr ; Bug: Should check driver is $Cn before continuing
2018-02-12 01:21:37 +00:00
ldy #7
2018-02-17 01:17:54 +00:00
lda (ptr),y ; $Cn07 == 0 for SmartPort
bne notsp
;; Locate SmartPort entry point: $Cn00 + ($CnFF) + 3
2018-01-01 05:16:41 +00:00
ldy #$FF
2018-02-17 01:17:54 +00:00
lda (ptr),y
2017-10-12 15:04:27 +00:00
clc
2018-02-17 01:17:54 +00:00
adc #3
sta ptr
lda unit_num
2017-10-12 15:04:27 +00:00
pha
rol a
pla
php
and #$20
lsr a
lsr a
lsr a
lsr a
plp
2018-01-01 05:16:41 +00:00
adc #1
2018-02-28 02:38:18 +00:00
sta status_unit_num
2018-01-01 05:16:41 +00:00
2018-02-17 01:17:54 +00:00
;; Execute SmartPort call
jsr call
2018-02-18 01:15:27 +00:00
.byte 0 ; $00 = STATUS
2018-02-17 01:17:54 +00:00
.addr status_params
2018-01-01 05:16:41 +00:00
2018-02-17 01:17:54 +00:00
lda status_buffer
and #$10 ; general status byte, $10 = disk in drive
beq notsp
2018-01-01 05:16:41 +00:00
lda #$FF
2018-02-17 01:17:54 +00:00
bne finish
notsp: lda #0 ; not SmartPort
finish: sta result
2017-10-12 15:04:27 +00:00
pla
tay
pla
tax
2018-02-17 01:17:54 +00:00
return result
2017-10-12 15:04:27 +00:00
2018-02-17 01:17:54 +00:00
call: jmp (ptr)
2017-10-12 15:04:27 +00:00
2018-02-17 01:17:54 +00:00
unit_num:
.byte 0
result: .byte 0
2018-02-16 21:27:31 +00:00
;; params for call
2018-02-17 01:17:54 +00:00
.proc status_params
param_count: .byte 3
unit_num: .byte 1
list_ptr: .addr status_buffer
status_code: .byte 0
.endproc
2018-02-28 02:38:18 +00:00
status_unit_num := status_params::unit_num
2018-02-17 01:17:54 +00:00
status_buffer: .res 16, 0
2018-02-16 21:27:31 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-17 03:36:54 +00:00
2018-02-17 07:08:39 +00:00
.proc L464E
lda LD343
2018-02-16 20:14:39 +00:00
beq :+
2018-01-24 05:52:53 +00:00
bit LD343+1
2017-10-12 15:04:27 +00:00
bmi L4666
2018-02-12 01:21:37 +00:00
jsr enable_selector_menu_items
2017-10-12 15:04:27 +00:00
jmp L4666
2018-02-16 20:14:39 +00:00
: bit LD343+1
2017-10-12 15:04:27 +00:00
bmi L4666
2018-02-12 01:21:37 +00:00
jsr disable_selector_menu_items
2018-02-19 19:33:13 +00:00
L4666: lda selected_icon_count
2017-10-12 15:04:27 +00:00
beq L46A8
lda selected_window_index
2017-10-12 15:04:27 +00:00
bne L4691
2018-02-19 19:33:13 +00:00
lda selected_icon_count
2018-02-16 20:14:39 +00:00
cmp #2
2017-10-12 15:04:27 +00:00
bcs L4697
2018-02-19 19:33:13 +00:00
lda selected_icon_list
2018-02-09 05:42:59 +00:00
cmp trash_icon_num
2017-10-12 15:04:27 +00:00
bne L468B
2018-02-12 01:21:37 +00:00
jsr disable_eject_menu_item
jsr disable_file_menu_items
2018-02-16 20:14:39 +00:00
lda #0
2018-03-05 05:33:56 +00:00
sta LE26F
2017-10-12 15:04:27 +00:00
rts
2018-02-12 01:21:37 +00:00
L468B: jsr enable_eject_menu_item
2017-10-12 15:04:27 +00:00
jmp L469A
2018-02-12 01:21:37 +00:00
L4691: jsr disable_eject_menu_item
2017-10-12 15:04:27 +00:00
jmp L469A
2018-02-12 01:21:37 +00:00
L4697: jsr enable_eject_menu_item
2018-03-05 05:33:56 +00:00
L469A: bit LE26F
2017-10-12 15:04:27 +00:00
bmi L46A7
2018-02-12 01:21:37 +00:00
jsr enable_file_menu_items
2017-10-12 15:04:27 +00:00
lda #$80
2018-03-05 05:33:56 +00:00
sta LE26F
2017-10-12 15:04:27 +00:00
L46A7: rts
2018-03-05 05:33:56 +00:00
L46A8: bit LE26F
2017-10-12 15:04:27 +00:00
bmi L46AE
rts
2018-02-12 01:21:37 +00:00
L46AE: jsr disable_eject_menu_item
jsr disable_file_menu_items
2017-10-12 15:04:27 +00:00
lda #$00
2018-03-05 05:33:56 +00:00
sta LE26F
2017-10-12 15:04:27 +00:00
rts
2018-02-17 07:08:39 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-02-17 07:08:39 +00:00
.proc MLI_RELAY
2018-02-25 21:52:16 +00:00
sty call
stax params
2017-10-12 15:04:27 +00:00
php
sei
sta ALTZPOFF
2017-12-31 20:04:22 +00:00
sta ROMIN2
2017-10-12 15:04:27 +00:00
jsr MLI
2018-02-25 21:52:16 +00:00
call: .byte $00
params: .addr dummy0000
2017-10-12 15:04:27 +00:00
sta ALTZPON
tax
lda LCBANK1
lda LCBANK1
plp
txa
rts
2018-02-17 07:08:39 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-01-05 18:24:27 +00:00
.macro MLI_RELAY_CALL call, addr
2018-02-09 05:42:59 +00:00
yax_call desktop_main::MLI_RELAY, call, addr
2018-01-05 18:24:27 +00:00
.endmacro
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-18 05:23:58 +00:00
;;; Launch file (double-click) ???
.proc launch_file
jmp begin
2017-10-12 15:04:27 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_GET_FILE_INFO_PARAMS get_file_info_params, $220
2018-01-14 08:17:32 +00:00
2018-01-18 05:23:58 +00:00
begin:
2018-01-19 05:34:55 +00:00
jsr set_watch_cursor
2017-10-12 15:04:27 +00:00
ldx #$FF
L46F8: inx
2018-02-03 03:38:35 +00:00
lda LD355,x
2018-01-17 15:41:23 +00:00
sta $220,x
2018-02-03 03:38:35 +00:00
cpx LD355
2017-10-12 15:04:27 +00:00
bne L46F8
inx
2018-01-24 04:11:38 +00:00
lda #'/'
2018-01-17 15:41:23 +00:00
sta $220,x
2017-10-12 15:04:27 +00:00
ldy #$00
L470C: iny
inx
2018-03-05 05:33:56 +00:00
lda buf_filename2,y
2018-01-17 15:41:23 +00:00
sta $220,x
2018-03-05 05:33:56 +00:00
cpy buf_filename2
2017-10-12 15:04:27 +00:00
bne L470C
2018-01-17 15:41:23 +00:00
stx $220
2018-01-14 08:17:32 +00:00
MLI_RELAY_CALL GET_FILE_INFO, get_file_info_params
2017-10-12 15:04:27 +00:00
beq L472B
jsr DESKTOP_SHOW_ALERT0
2017-10-12 15:04:27 +00:00
rts
2018-02-06 04:37:41 +00:00
L472B: lda get_file_info_params::file_type
2018-01-18 05:23:58 +00:00
cmp #FT_BASIC
2017-10-12 15:04:27 +00:00
bne L4738
jsr L47B8
jmp L4755
2018-01-18 05:23:58 +00:00
L4738: cmp #FT_BINARY
2017-10-12 15:04:27 +00:00
bne L4748
2018-01-23 02:09:15 +00:00
lda BUTN0 ; only launch if a button is down
2017-12-31 20:04:22 +00:00
ora BUTN1
2017-10-12 15:04:27 +00:00
bmi L4755
2018-01-19 05:34:55 +00:00
jsr set_pointer_cursor
2017-10-12 15:04:27 +00:00
rts
2018-01-18 05:23:58 +00:00
L4748: cmp #FT_SYSTEM
2017-10-12 15:04:27 +00:00
beq L4755
2018-01-22 07:00:34 +00:00
2018-01-18 05:23:58 +00:00
cmp #FT_S16
2017-10-12 15:04:27 +00:00
beq L4755
2018-01-22 07:00:34 +00:00
2017-10-12 15:04:27 +00:00
lda #$FA
jsr L4802
2018-01-22 07:00:34 +00:00
2018-01-17 03:36:54 +00:00
L4755: DESKTOP_RELAY_CALL $06
2018-01-29 16:38:23 +00:00
MGTK_RELAY_CALL MGTK::CloseAll
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::SetMenu, blank_menu
2018-02-03 03:38:35 +00:00
ldx LD355
L4773: lda LD355,x
2018-01-17 15:41:23 +00:00
sta $220,x
2017-10-12 15:04:27 +00:00
dex
bpl L4773
2018-03-05 05:33:56 +00:00
ldx buf_filename2
L477F: lda buf_filename2,x
2018-01-07 19:45:52 +00:00
sta INVOKER_FILENAME,x
2017-10-12 15:04:27 +00:00
dex
bpl L477F
2018-01-24 05:52:53 +00:00
addr_call L4842, $280
2018-01-17 15:41:23 +00:00
addr_call L4842, $220
2017-10-12 15:04:27 +00:00
jsr L48BE
2018-02-06 17:31:58 +00:00
copy16 #INVOKER, reset_and_invoke_target
2018-01-20 05:57:58 +00:00
jmp reset_and_invoke
2018-01-18 05:23:58 +00:00
2018-02-17 07:08:39 +00:00
;;; --------------------------------------------------
2017-10-12 15:04:27 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_GET_FILE_INFO_PARAMS get_file_info_params2, $1800
2018-01-14 08:17:32 +00:00
2018-02-03 03:38:35 +00:00
L47B8: ldx LD355
2017-10-12 15:04:27 +00:00
stx L4816
2018-02-03 03:38:35 +00:00
L47BE: lda LD355,x
2017-10-12 15:04:27 +00:00
sta $1800,x
dex
bpl L47BE
inc $1800
ldx $1800
2018-01-24 04:11:38 +00:00
lda #'/'
2017-10-12 15:04:27 +00:00
sta $1800,x
L47D2: ldx $1800
ldy #$00
L47D7: inx
iny
lda L4817,y
sta $1800,x
cpy L4817
bne L47D7
stx $1800
2018-01-14 08:17:32 +00:00
MLI_RELAY_CALL GET_FILE_INFO, get_file_info_params2
2017-10-12 15:04:27 +00:00
bne L47F3
rts
L47F3: ldx L4816
L47F6: lda $1800,x
cmp #$2F
beq L4808
dex
bne L47F6
L4800: lda #$FE
L4802: jsr DESKTOP_SHOW_ALERT0
2017-10-12 15:04:27 +00:00
pla
pla
rts
L4808: cpx #$01
beq L4800
stx $1800
dex
stx L4816
jmp L47D2
2017-12-31 02:02:15 +00:00
L4816: .byte $00
L4817: PASCAL_STRING "Basic.system"
2018-03-05 05:33:56 +00:00
L4824: .res 30, 0
2018-02-05 04:35:19 +00:00
L4842: stax $06
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tay
2018-01-17 15:41:23 +00:00
L484B: lda ($06),y
2017-10-12 15:04:27 +00:00
cmp #$61
bcc L4859
cmp #$7B
bcs L4859
and #$DF
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
L4859: dey
bne L484B
rts
2018-02-17 07:08:39 +00:00
.endproc
2018-03-05 05:33:56 +00:00
L4824 := launch_file::L4824
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-15 16:08:59 +00:00
L485D: .word $E000
2018-02-06 23:36:39 +00:00
L485F: .word $D000
2018-02-05 04:46:26 +00:00
2018-02-13 04:41:17 +00:00
sys_start_flag: .byte $00
sys_start_path: .res 40, 0
2018-01-19 05:34:55 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 05:34:55 +00:00
set_watch_cursor:
jsr hide_cursor
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::SetCursor, watch_cursor
2018-01-19 05:34:55 +00:00
jsr show_cursor
2017-10-12 15:04:27 +00:00
rts
2018-01-19 05:34:55 +00:00
set_pointer_cursor:
jsr hide_cursor
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::SetCursor, pointer_cursor
2018-01-19 05:34:55 +00:00
jsr show_cursor
2017-10-12 15:04:27 +00:00
rts
2018-01-19 05:34:55 +00:00
hide_cursor:
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::HideCursor
2017-10-12 15:04:27 +00:00
rts
2018-01-19 05:34:55 +00:00
show_cursor:
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::ShowCursor
2017-10-12 15:04:27 +00:00
rts
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 05:34:55 +00:00
2018-02-12 01:21:37 +00:00
.proc L48BE
2018-02-16 20:14:39 +00:00
ldx DESKTOP_DEVICELIST
2017-10-12 15:04:27 +00:00
inx
2018-02-16 20:14:39 +00:00
: lda DESKTOP_DEVICELIST,x
2018-02-26 00:17:11 +00:00
sta DEVLST-1,x
2017-10-12 15:04:27 +00:00
dex
2018-02-12 01:21:37 +00:00
bpl :-
2017-10-12 15:04:27 +00:00
rts
2018-02-12 01:21:37 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-01-23 16:33:12 +00:00
.proc show_warning_dialog_num
sta warning_dialog_num
yax_call launch_dialog, index_warning_dialog, warning_dialog_num
2017-10-12 15:04:27 +00:00
rts
2018-01-23 16:33:12 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-02-16 20:14:39 +00:00
copy16 #main_loop, L48E4
2018-01-05 04:27:15 +00:00
L48E4 := *+1
2018-01-17 03:36:54 +00:00
jmp dummy1234 ; self-modified
2018-01-05 04:27:15 +00:00
2018-02-03 04:41:42 +00:00
get_event:
2018-01-30 16:57:36 +00:00
MGTK_RELAY_CALL MGTK::GetEvent, event_params
2017-10-12 15:04:27 +00:00
rts
2018-02-03 04:41:42 +00:00
peek_event:
MGTK_RELAY_CALL MGTK::PeekEvent, event_params
2017-10-12 15:04:27 +00:00
rts
2018-02-03 04:41:42 +00:00
set_penmode_xor:
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2017-10-12 15:04:27 +00:00
rts
2018-02-03 04:41:42 +00:00
set_penmode_copy:
MGTK_RELAY_CALL MGTK::SetPenMode, pencopy
2017-10-12 15:04:27 +00:00
rts
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 07:10:37 +00:00
2018-01-20 05:57:58 +00:00
.proc cmd_noop
rts
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 07:10:37 +00:00
2018-01-20 03:41:20 +00:00
.proc cmd_selector_action
2018-01-19 05:57:25 +00:00
jsr set_watch_cursor
2018-01-20 02:55:15 +00:00
lda #dynamic_routine_selector1
jsr load_dynamic_routine
2018-01-20 03:41:20 +00:00
bmi done
2018-02-06 23:36:39 +00:00
lda menu_click_params::item_num
2017-10-12 15:04:27 +00:00
cmp #$03
bcs L492E
2018-01-20 02:55:15 +00:00
lda #dynamic_routine_selector2
jsr load_dynamic_routine
2018-01-20 03:41:20 +00:00
bmi done
2018-01-20 02:55:15 +00:00
lda #dynamic_routine_common
jsr load_dynamic_routine
2018-01-20 03:41:20 +00:00
bmi done
2018-01-19 05:34:55 +00:00
L492E: jsr set_pointer_cursor
2018-02-06 23:36:39 +00:00
lda menu_click_params::item_num
jsr dynamic_routine_9000
2017-10-12 15:04:27 +00:00
sta L498F
2018-01-19 05:34:55 +00:00
jsr set_watch_cursor
2018-01-20 02:55:15 +00:00
lda #dynamic_routine_restore9000
jsr restore_dynamic_routine
2018-02-06 23:36:39 +00:00
lda menu_click_params::item_num
2017-10-12 15:04:27 +00:00
cmp #$04
2018-01-20 03:41:20 +00:00
bne done
2017-10-12 15:04:27 +00:00
lda L498F
2018-01-20 03:41:20 +00:00
bpl done
2017-10-12 15:04:27 +00:00
jsr L4AAD
jsr L4A77
2018-02-13 04:41:17 +00:00
jsr get_LD3FF
2017-10-12 15:04:27 +00:00
bpl L497A
jsr L8F24
2018-01-20 03:41:20 +00:00
bmi done
2017-10-12 15:04:27 +00:00
jsr L4968
2018-01-20 03:41:20 +00:00
done: jsr set_pointer_cursor
2018-01-21 16:37:01 +00:00
jsr redraw_windows_and_desktop
2017-10-12 15:04:27 +00:00
rts
L4968: jsr L4AAD
2018-01-24 05:52:53 +00:00
ldx $840
L496E: lda $840,x
2018-02-03 03:38:35 +00:00
sta LD355,x
2017-10-12 15:04:27 +00:00
dex
bpl L496E
jmp L4A17
L497A: jsr L4AAD
ldx L0800
L4980: lda L0800,x
2018-02-03 03:38:35 +00:00
sta LD355,x
2017-10-12 15:04:27 +00:00
dex
bpl L4980
jsr L4A17
2018-01-20 03:41:20 +00:00
jmp done
2017-10-12 15:04:27 +00:00
2018-01-14 07:09:51 +00:00
L498F: .byte $00
2018-01-20 03:41:20 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-14 08:17:32 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_GET_FILE_INFO_PARAMS get_file_info_params3, $220
2018-01-14 08:17:32 +00:00
2018-02-17 07:08:39 +00:00
.proc cmd_selector_item
2018-01-19 05:57:25 +00:00
jmp L49A6
2017-10-12 15:04:27 +00:00
2017-12-31 20:32:47 +00:00
L49A5: .byte 0
2018-01-20 03:41:20 +00:00
2018-02-06 23:36:39 +00:00
L49A6: lda menu_click_params::item_num
2017-10-12 15:04:27 +00:00
sec
sbc #$06
sta L49A5
2018-02-16 20:14:39 +00:00
jsr a_times_16
2018-03-05 05:52:38 +00:00
addax #run_list_entries, $06
2017-10-12 15:04:27 +00:00
ldy #$0F
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
asl a
bmi L49FA
bcc L49E0
2018-02-13 04:41:17 +00:00
jsr get_LD3FF
2017-10-12 15:04:27 +00:00
beq L49FA
lda L49A5
jsr L4AEA
beq L49ED
lda L49A5
jsr L4A47
jsr L8F24
bpl L49ED
2018-01-21 16:37:01 +00:00
jmp redraw_windows_and_desktop
2017-10-12 15:04:27 +00:00
2018-02-13 04:41:17 +00:00
L49E0: jsr get_LD3FF
2017-10-12 15:04:27 +00:00
beq L49FA
lda L49A5
jsr L4AEA
bne L49FA
L49ED: lda L49A5
jsr L4B5F
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
jmp L4A0A
L49FA: lda L49A5
2018-02-16 20:14:39 +00:00
jsr a_times_64
2018-03-05 05:52:38 +00:00
addax #$DB9E, $06
2017-10-12 15:04:27 +00:00
L4A0A: ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tay
2018-01-17 15:41:23 +00:00
L4A0F: lda ($06),y
2018-02-03 03:38:35 +00:00
sta LD355,y
2017-10-12 15:04:27 +00:00
dey
bpl L4A0F
2018-02-03 03:38:35 +00:00
L4A17: ldy LD355
L4A1A: lda LD355,y
2017-10-12 15:04:27 +00:00
cmp #$2F
beq L4A24
dey
bpl L4A1A
L4A24: dey
sty L4A46
ldx #$00
iny
L4A2B: iny
inx
2018-02-03 03:38:35 +00:00
lda LD355,y
2018-03-05 05:33:56 +00:00
sta buf_filename2,x
2018-02-03 03:38:35 +00:00
cpy LD355
2017-10-12 15:04:27 +00:00
bne L4A2B
2018-03-05 05:33:56 +00:00
stx buf_filename2
2017-10-12 15:04:27 +00:00
lda L4A46
2018-02-03 03:38:35 +00:00
sta LD355
2017-10-12 15:04:27 +00:00
lda #$00
2018-01-18 05:23:58 +00:00
jmp launch_file
2017-10-12 15:04:27 +00:00
2017-12-31 20:32:47 +00:00
L4A46: .byte 0
2017-10-12 15:04:27 +00:00
L4A47: pha
2018-02-16 20:14:39 +00:00
jsr a_times_64
2018-03-05 05:52:38 +00:00
addax #$DB9E, $06
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tay
2018-01-17 15:41:23 +00:00
L4A5A: lda ($06),y
2017-10-12 15:04:27 +00:00
sta L0800,y
dey
bpl L4A5A
pla
jsr L4B5F
2018-02-05 04:35:19 +00:00
stax $08
2017-10-12 15:04:27 +00:00
ldy #$00
lda ($08),y
tay
L4A6F: lda ($08),y
2018-01-24 05:52:53 +00:00
sta $840,y
2017-10-12 15:04:27 +00:00
dey
bpl L4A6F
L4A77: ldy L0800
L4A7A: lda L0800,y
cmp #$2F
beq L4A84
dey
bne L4A7A
L4A84: dey
sty L0800
2018-01-24 05:52:53 +00:00
ldy $840
L4A8B: lda $840,y
2017-10-12 15:04:27 +00:00
cmp #$2F
beq L4A95
dey
bne L4A8B
L4A95: dey
2018-01-24 05:52:53 +00:00
sty $840
2018-02-06 17:31:58 +00:00
copy16 #$800, $06
copy16 #$840, $08
2017-10-12 15:04:27 +00:00
jsr L4D19
rts
2018-02-03 03:38:35 +00:00
L4AAD: ldy LD355
L4AB0: lda LD355,y
2017-10-12 15:04:27 +00:00
sta L0800,y
dey
bpl L4AB0
2018-02-13 04:41:17 +00:00
addr_call copy_LD3EE_str, $840
2017-10-12 15:04:27 +00:00
ldy L0800
L4AC3: lda L0800,y
cmp #$2F
beq L4ACD
dey
bne L4AC3
L4ACD: dey
L4ACE: lda L0800,y
cmp #$2F
beq L4AD8
dey
bne L4ACE
L4AD8: dey
2018-01-24 05:52:53 +00:00
ldx $840
2017-10-12 15:04:27 +00:00
L4ADC: iny
inx
lda L0800,y
2018-01-24 05:52:53 +00:00
sta $840,x
2017-10-12 15:04:27 +00:00
cpy L0800
bne L4ADC
rts
L4AEA: jsr L4B5F
2018-02-06 04:37:41 +00:00
stax get_file_info_params3::pathname
2018-01-14 08:17:32 +00:00
MLI_RELAY_CALL GET_FILE_INFO, get_file_info_params3
2017-10-12 15:04:27 +00:00
rts
2018-02-17 07:08:39 +00:00
.endproc
L4A17 := cmd_selector_item::L4A17
L4A77 := cmd_selector_item::L4A77
L4AAD := cmd_selector_item::L4AAD
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-13 04:41:17 +00:00
.proc get_LD3FF
sta ALTZPOFF
2017-12-31 20:04:22 +00:00
lda LCBANK2
lda LCBANK2
2018-02-13 04:41:17 +00:00
lda LD3FF
2017-10-12 15:04:27 +00:00
tax
sta ALTZPON
lda LCBANK1
lda LCBANK1
txa
rts
2018-02-13 04:41:17 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-02-13 04:41:17 +00:00
.proc copy_LD3EE_str
stax destptr
2017-10-12 15:04:27 +00:00
sta ALTZPOFF
2017-12-31 20:04:22 +00:00
lda LCBANK2
lda LCBANK2
2018-01-01 05:16:41 +00:00
2018-02-13 04:41:17 +00:00
ldx LD3EE
: lda LD3EE,x
destptr := *+1
2018-01-17 03:36:54 +00:00
sta dummy1234,x
2018-01-01 05:16:41 +00:00
dex
2018-02-13 04:41:17 +00:00
bpl :-
2017-10-12 15:04:27 +00:00
sta ALTZPON
lda LCBANK1
lda LCBANK1
rts
2018-02-13 04:41:17 +00:00
.endproc
2018-01-06 07:33:21 +00:00
2018-02-13 04:41:17 +00:00
.proc copy_LD3AD_str
stax destptr
2017-10-12 15:04:27 +00:00
sta ALTZPOFF
2017-12-31 20:04:22 +00:00
lda LCBANK2
lda LCBANK2
2018-02-13 04:41:17 +00:00
ldx LD3AD
: lda LD3AD,x
destptr := *+1
2018-01-17 03:36:54 +00:00
sta dummy1234,x
2018-01-01 05:16:41 +00:00
dex
2018-02-13 04:41:17 +00:00
bpl :-
2017-10-12 15:04:27 +00:00
sta ALTZPON
lda LCBANK1
lda LCBANK1
rts
2018-02-13 04:41:17 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-02-13 04:41:17 +00:00
.proc L4B5F
sta L4BB0
addr_call copy_LD3EE_str, path_buffer
2017-10-12 15:04:27 +00:00
lda L4BB0
2018-02-16 20:14:39 +00:00
jsr a_times_64
2018-03-05 05:52:38 +00:00
addax #$DB9E, $06
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
sta L4BB1
tay
2018-01-17 15:41:23 +00:00
L4B81: lda ($06),y
2017-10-12 15:04:27 +00:00
and #$7F
2018-02-13 04:41:17 +00:00
cmp #'/'
2017-10-12 15:04:27 +00:00
beq L4B8C
dey
bne L4B81
L4B8C: dey
2018-01-17 15:41:23 +00:00
L4B8D: lda ($06),y
2017-10-12 15:04:27 +00:00
and #$7F
cmp #$2F
beq L4B98
dey
bne L4B8D
L4B98: dey
2018-01-24 05:37:41 +00:00
ldx path_buffer
2017-10-12 15:04:27 +00:00
L4B9C: inx
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-01-24 05:37:41 +00:00
sta path_buffer,x
2017-10-12 15:04:27 +00:00
cpy L4BB1
bne L4B9C
2018-01-24 05:37:41 +00:00
stx path_buffer
2018-02-06 23:36:39 +00:00
ldax #path_buffer
2017-10-12 15:04:27 +00:00
rts
2017-12-31 20:32:47 +00:00
L4BB0: .byte 0
L4BB1: .byte 0
2018-02-13 04:41:17 +00:00
.endproc
2018-01-20 03:41:20 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-20 03:41:20 +00:00
2018-01-20 05:57:58 +00:00
.proc cmd_about
2018-01-23 02:09:15 +00:00
yax_call launch_dialog, index_about_dialog, $0000
2018-01-21 16:37:01 +00:00
jmp redraw_windows_and_desktop
2018-01-20 05:57:58 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 07:10:37 +00:00
2018-01-20 03:41:20 +00:00
.proc cmd_deskacc_impl
2018-01-23 16:33:12 +00:00
ptr := $6
2018-01-20 03:41:20 +00:00
2018-01-28 16:08:39 +00:00
zp_use_flag1:
.byte $80
2018-01-20 03:41:20 +00:00
2018-01-30 16:57:36 +00:00
start: jsr reset_grafport3
2018-01-19 05:34:55 +00:00
jsr set_watch_cursor
2018-01-23 16:33:12 +00:00
;; Find DA name
2018-02-06 23:36:39 +00:00
lda menu_click_params::item_num ; menu item index (1-based)
2017-10-12 15:04:27 +00:00
sec
2018-01-23 16:33:12 +00:00
sbc #3 ; About and separator before first item
2018-02-16 20:14:39 +00:00
jsr a_times_16
2018-03-05 16:41:22 +00:00
addax #buf, ptr
2018-01-23 16:33:12 +00:00
;; Compute total length
ldy #0
lda (ptr),y
2017-10-12 15:04:27 +00:00
tay
clc
2018-01-23 16:33:12 +00:00
adc prefix_length
2018-01-01 05:16:41 +00:00
pha
tax
2018-01-23 16:33:12 +00:00
;; Append name to path
: lda ($06),y
2018-01-23 15:48:49 +00:00
sta str_desk_acc,x
2017-10-12 15:04:27 +00:00
dex
dey
2018-01-23 16:33:12 +00:00
bne :-
2017-10-12 15:04:27 +00:00
pla
2018-01-23 16:33:12 +00:00
sta str_desk_acc ; update length
;; Convert spaces to periods
2018-01-23 15:48:49 +00:00
ldx str_desk_acc
2018-01-23 16:33:12 +00:00
: lda str_desk_acc,x
cmp #' '
bne nope
lda #'.'
2018-01-23 15:48:49 +00:00
sta str_desk_acc,x
2018-01-23 16:33:12 +00:00
nope: dex
bne :-
;; Load the DA
jsr open
bmi done
2018-02-28 02:38:18 +00:00
lda open_ref_num
sta read_ref_num
sta close_ref_num
2018-01-23 16:33:12 +00:00
jsr read
jsr close
2017-10-12 15:04:27 +00:00
lda #$80
2018-01-23 16:33:12 +00:00
sta running_da_flag
;; Invoke it
2018-01-19 05:34:55 +00:00
jsr set_pointer_cursor
2018-01-30 16:57:36 +00:00
jsr reset_grafport3
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::SetZP1, zp_use_flag0
MGTK_RELAY_CALL MGTK::SetZP1, zp_use_flag1
2018-01-23 16:33:12 +00:00
jsr DA_LOAD_ADDRESS
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::SetZP1, zp_use_flag0
2018-01-23 16:33:12 +00:00
lda #0
sta running_da_flag
;; Restore state
2018-01-30 16:57:36 +00:00
jsr reset_grafport3
2018-01-21 16:37:01 +00:00
jsr redraw_windows_and_desktop
2018-01-23 16:33:12 +00:00
done: jsr set_pointer_cursor
2017-10-12 15:04:27 +00:00
rts
2018-01-23 16:33:12 +00:00
open: yxa_call MLI_RELAY, OPEN, open_params
bne :+
2017-10-12 15:04:27 +00:00
rts
2018-01-23 16:33:12 +00:00
: lda #warning_msg_insert_system_disk
jsr show_warning_dialog_num
beq open ; ok, so try again
2018-02-16 03:29:05 +00:00
return #$FF ; cancel, so fail
2017-10-12 15:04:27 +00:00
2018-01-23 16:33:12 +00:00
read: yxa_jump MLI_RELAY, READ, read_params
2017-10-12 15:04:27 +00:00
2018-01-23 16:33:12 +00:00
close: yxa_jump MLI_RELAY, CLOSE, close_params
2017-10-12 15:04:27 +00:00
2018-01-23 16:33:12 +00:00
unused: .byte 0 ; ???
2018-01-23 15:48:49 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_OPEN_PARAMS open_params, str_desk_acc, $1C00
2018-02-28 02:38:18 +00:00
open_ref_num := open_params::ref_num
2018-01-23 15:48:49 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_READ_PARAMS read_params, DA_LOAD_ADDRESS, DA_MAX_SIZE
2018-02-28 02:38:18 +00:00
read_ref_num := read_params::ref_num
2018-01-23 15:48:49 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_CLOSE_PARAMS close_params
2018-02-28 02:38:18 +00:00
close_ref_num := close_params::ref_num
2018-01-23 15:48:49 +00:00
2018-01-23 16:33:12 +00:00
.define prefix "Desk.acc/"
prefix_length:
.byte .strlen(prefix)
2018-01-23 15:48:49 +00:00
str_desk_acc:
2018-01-23 16:33:12 +00:00
PASCAL_STRING prefix, .strlen(prefix) + 15
2018-01-23 15:48:49 +00:00
2018-01-20 03:41:20 +00:00
.endproc
cmd_deskacc := cmd_deskacc_impl::start
2018-01-19 05:34:55 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 07:10:37 +00:00
2018-01-23 16:33:12 +00:00
;; high bit set while a DA is running
running_da_flag:
.byte 0
2018-01-20 03:41:20 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-20 03:41:20 +00:00
.proc cmd_copy_file
2018-01-19 05:57:25 +00:00
jsr set_watch_cursor
2018-01-20 02:55:15 +00:00
lda #dynamic_routine_common
jsr load_dynamic_routine
2017-10-12 15:04:27 +00:00
bmi L4CD6
2018-01-20 02:55:15 +00:00
lda #dynamic_routine_file_copy
jsr load_dynamic_routine
2017-10-12 15:04:27 +00:00
bmi L4CD6
2018-01-19 05:34:55 +00:00
jsr set_pointer_cursor
2017-10-12 15:04:27 +00:00
lda #$00
jsr dynamic_routine_5000
2017-10-12 15:04:27 +00:00
pha
2018-01-19 05:34:55 +00:00
jsr set_watch_cursor
2018-01-20 02:55:15 +00:00
lda #dynamic_routine_restore5000
jsr restore_dynamic_routine
2018-01-19 05:34:55 +00:00
jsr set_pointer_cursor
2017-10-12 15:04:27 +00:00
pla
bpl L4CCD
jmp L4CD6
L4CCD: jsr L4D19
2018-01-21 16:37:01 +00:00
jsr redraw_windows_and_desktop
2017-10-12 15:04:27 +00:00
jsr L8F18
L4CD6: pha
2018-01-19 05:34:55 +00:00
jsr set_pointer_cursor
2017-10-12 15:04:27 +00:00
pla
2018-01-24 04:11:38 +00:00
bpl :+
2018-01-21 16:37:01 +00:00
jmp redraw_windows_and_desktop
2017-10-12 15:04:27 +00:00
2018-02-15 16:08:59 +00:00
: addr_call L6FAF, path_buf4
2018-01-24 04:11:38 +00:00
beq :+
2017-10-12 15:04:27 +00:00
pha
jsr L6F0D
pla
jmp L5E78
2018-01-24 04:11:38 +00:00
: ldy #1
2017-10-12 15:04:27 +00:00
L4CF3: iny
2018-02-15 16:08:59 +00:00
lda path_buf4,y
2018-01-24 04:11:38 +00:00
cmp #'/'
beq :+
2018-02-15 16:08:59 +00:00
cpy path_buf4
2017-10-12 15:04:27 +00:00
bne L4CF3
iny
2018-01-24 04:11:38 +00:00
: dey
2018-02-15 16:08:59 +00:00
sty path_buf4
addr_call L6FB7, path_buf4
ldax #path_buf4
ldy path_buf4
2017-10-12 15:04:27 +00:00
jsr L6F4B
2018-01-21 16:37:01 +00:00
jmp redraw_windows_and_desktop
2018-01-20 03:41:20 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-12 01:21:37 +00:00
.proc L4D19
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tay
2018-01-17 15:41:23 +00:00
L4D1E: lda ($06),y
2018-02-15 16:08:59 +00:00
sta path_buf3,y
2017-10-12 15:04:27 +00:00
dey
bpl L4D1E
ldy #$00
lda ($08),y
tay
L4D2B: lda ($08),y
2018-02-15 16:08:59 +00:00
sta path_buf4,y
2017-10-12 15:04:27 +00:00
dey
bpl L4D2B
2018-02-15 16:08:59 +00:00
addr_call L6F90, path_buf4
2017-10-12 15:04:27 +00:00
ldx #$01
iny
iny
2018-02-15 16:08:59 +00:00
L4D3E: lda path_buf4,y
2018-02-06 23:36:39 +00:00
sta LE04B,x
2018-02-15 16:08:59 +00:00
cpy path_buf4
2017-10-12 15:04:27 +00:00
beq L4D4E
iny
inx
jmp L4D3E
2018-02-06 23:36:39 +00:00
L4D4E: stx LE04B
2018-02-15 16:08:59 +00:00
lda path_buf4
2017-10-12 15:04:27 +00:00
sec
2018-02-06 23:36:39 +00:00
sbc LE04B
2018-02-15 16:08:59 +00:00
sta path_buf4
dec path_buf4
2017-10-12 15:04:27 +00:00
rts
2018-02-12 01:21:37 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 07:10:37 +00:00
2018-01-20 03:41:20 +00:00
.proc cmd_delete_file
2018-01-19 05:57:25 +00:00
jsr set_watch_cursor
2018-01-20 02:55:15 +00:00
lda #dynamic_routine_common
jsr load_dynamic_routine
2017-10-12 15:04:27 +00:00
bmi L4D9D
2018-01-20 05:57:58 +00:00
2018-01-20 02:55:15 +00:00
lda #dynamic_routine_file_delete
jsr load_dynamic_routine
2017-10-12 15:04:27 +00:00
bmi L4D9D
2018-01-20 05:57:58 +00:00
2018-01-19 05:34:55 +00:00
jsr set_pointer_cursor
2017-10-12 15:04:27 +00:00
lda #$01
jsr dynamic_routine_5000
2017-10-12 15:04:27 +00:00
pha
2018-01-19 05:34:55 +00:00
jsr set_watch_cursor
2018-01-20 02:55:15 +00:00
lda #dynamic_routine_restore5000
jsr restore_dynamic_routine
2018-01-19 05:34:55 +00:00
jsr set_pointer_cursor
2017-10-12 15:04:27 +00:00
pla
bpl L4D8A
jmp L4D9D
L4D8A: ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tay
2018-01-17 15:41:23 +00:00
L4D8F: lda ($06),y
2018-02-15 16:08:59 +00:00
sta path_buf3,y
2017-10-12 15:04:27 +00:00
dey
bpl L4D8F
2018-01-21 16:37:01 +00:00
jsr redraw_windows_and_desktop
2017-10-12 15:04:27 +00:00
jsr L8F1B
L4D9D: pha
2018-01-19 05:34:55 +00:00
jsr set_pointer_cursor
2017-10-12 15:04:27 +00:00
pla
bpl L4DA7
2018-01-21 16:37:01 +00:00
jmp redraw_windows_and_desktop
2017-10-12 15:04:27 +00:00
2018-02-15 16:08:59 +00:00
L4DA7: addr_call L6F90, path_buf3
sty path_buf3
addr_call L6FAF, path_buf3
2017-10-12 15:04:27 +00:00
beq L4DC2
pha
jsr L6F0D
pla
jmp L5E78
L4DC2: ldy #$01
L4DC4: iny
2018-02-15 16:08:59 +00:00
lda path_buf3,y
2017-10-12 15:04:27 +00:00
cmp #$2F
beq L4DD2
2018-02-15 16:08:59 +00:00
cpy path_buf3
2017-10-12 15:04:27 +00:00
bne L4DC4
iny
L4DD2: dey
2018-02-15 16:08:59 +00:00
sty path_buf3
addr_call L6FB7, path_buf3
ldax #path_buf3
ldy path_buf3
2017-10-12 15:04:27 +00:00
jsr L6F4B
2018-01-21 16:37:01 +00:00
jmp redraw_windows_and_desktop
2018-01-20 03:41:20 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 07:10:37 +00:00
2018-01-20 03:41:20 +00:00
.proc cmd_open
2018-01-19 07:10:37 +00:00
ldx #$00
2018-02-19 19:33:13 +00:00
L4DEC: cpx selected_icon_count
2017-10-12 15:04:27 +00:00
bne L4DF2
rts
L4DF2: txa
pha
2018-02-19 19:33:13 +00:00
lda selected_icon_list,x
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-02-05 04:35:19 +00:00
stax $06
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-09 05:42:59 +00:00
and #icon_entry_type_mask
2017-10-12 15:04:27 +00:00
bne L4E10
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
jsr L6A8A
jmp L4E14
L4E10: cmp #$40
bcc L4E1A
L4E14: pla
tax
inx
jmp L4DEC
L4E1A: sta L4E71
2018-02-19 19:33:13 +00:00
lda selected_icon_count
2017-10-12 15:04:27 +00:00
cmp #$02
bcs L4E14
pla
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-01-21 03:02:34 +00:00
jsr window_address_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tay
2018-01-17 15:41:23 +00:00
L4E34: lda ($06),y
2018-02-03 03:38:35 +00:00
sta LD355,y
2017-10-12 15:04:27 +00:00
dey
bpl L4E34
2018-02-19 19:33:13 +00:00
lda selected_icon_list
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$09
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tax
clc
adc #$09
tay
dex
dey
2018-01-17 15:41:23 +00:00
L4E51: lda ($06),y
2018-01-24 05:52:53 +00:00
sta LD343+1,x
2017-10-12 15:04:27 +00:00
dey
dex
bne L4E51
ldy #$09
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tax
dex
dex
2018-03-05 05:33:56 +00:00
stx buf_filename2
2017-10-12 15:04:27 +00:00
lda L4E71
cmp #$20
bcc L4E6E
lda L4E71
2018-01-18 05:23:58 +00:00
L4E6E: jmp launch_file
2017-10-12 15:04:27 +00:00
2017-12-31 20:32:47 +00:00
L4E71: .byte 0
2018-01-20 03:41:20 +00:00
.endproc
2018-01-19 07:10:37 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-20 03:41:20 +00:00
.proc cmd_close
2018-02-03 04:41:42 +00:00
lda active_window_id
2017-10-12 15:04:27 +00:00
bne L4E78
rts
2018-01-20 18:57:25 +00:00
L4E78: jsr clear_selection
2018-02-15 16:08:59 +00:00
dec LEC2E
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_TO_BUF
2018-02-03 04:41:42 +00:00
ldx active_window_id
2017-10-12 15:04:27 +00:00
dex
2018-02-03 03:38:35 +00:00
lda win_buf_table,x
2017-10-12 15:04:27 +00:00
bmi L4EB4
2018-02-05 03:13:21 +00:00
DESKTOP_RELAY_CALL DT_CLOSE_WINDOW, active_window_id
2018-01-15 05:23:48 +00:00
lda LDD9E
2017-10-12 15:04:27 +00:00
sec
2018-02-08 05:48:19 +00:00
sbc cached_window_icon_count
2018-01-15 05:23:48 +00:00
sta LDD9E
2017-10-12 15:04:27 +00:00
ldx #$00
2018-02-08 05:48:19 +00:00
L4EA5: cpx cached_window_icon_count
2017-10-12 15:04:27 +00:00
beq L4EB4
2018-02-08 05:48:19 +00:00
lda cached_window_icon_list,x
2018-02-08 05:36:53 +00:00
jsr DESKTOP_FREE_ICON
2017-10-12 15:04:27 +00:00
inx
jmp L4EA5
L4EB4: ldx #$00
txa
2018-02-08 05:48:19 +00:00
L4EB7: sta cached_window_icon_list,x
cpx cached_window_icon_count
2017-10-12 15:04:27 +00:00
beq L4EC3
inx
jmp L4EB7
2018-02-08 05:48:19 +00:00
L4EC3: sta cached_window_icon_count
jsr DESKTOP_COPY_FROM_BUF
2017-10-12 15:04:27 +00:00
lda #$00
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_TO_BUF
2018-02-03 04:41:42 +00:00
MGTK_RELAY_CALL MGTK::CloseWindow, active_window_id
ldx active_window_id
2017-10-12 15:04:27 +00:00
dex
2018-01-13 03:06:55 +00:00
lda LEC26,x
2018-02-15 16:08:59 +00:00
sta icon_param
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-02-05 04:35:19 +00:00
stax $06
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-09 05:42:59 +00:00
and #(~icon_entry_open_mask)&$FF ; clear open_flag
2018-01-17 15:41:23 +00:00
sta ($06),y
2018-02-09 05:42:59 +00:00
and #icon_entry_winid_mask
sta selected_window_index
2018-02-18 01:15:27 +00:00
jsr zero_grafport5_coords
2018-02-15 16:08:59 +00:00
DESKTOP_RELAY_CALL DT_HIGHLIGHT_ICON, icon_param
2018-01-30 16:57:36 +00:00
jsr reset_grafport3
2017-10-12 15:04:27 +00:00
lda #$01
2018-02-19 19:33:13 +00:00
sta selected_icon_count
2018-02-15 16:08:59 +00:00
lda icon_param
2018-02-19 19:33:13 +00:00
sta selected_icon_list
2018-02-03 04:41:42 +00:00
ldx active_window_id
2017-10-12 15:04:27 +00:00
dex
2018-01-13 03:06:55 +00:00
lda LEC26,x
2017-10-12 15:04:27 +00:00
jsr L7345
2018-02-03 04:41:42 +00:00
ldx active_window_id
2017-10-12 15:04:27 +00:00
dex
lda #$00
2018-01-13 03:06:55 +00:00
sta LEC26,x
2018-02-03 04:41:42 +00:00
MGTK_RELAY_CALL MGTK::FrontWindow, active_window_id
lda active_window_id
2017-10-12 15:04:27 +00:00
bne L4F3C
2018-02-05 03:13:21 +00:00
DESKTOP_RELAY_CALL DT_REDRAW_ICONS
2018-02-14 02:53:02 +00:00
L4F3C: lda #MGTK::checkitem_uncheck
2018-02-01 19:30:03 +00:00
sta checkitem_params::check
MGTK_RELAY_CALL MGTK::CheckItem, checkitem_params
2017-10-12 15:04:27 +00:00
jsr L66A2
2018-01-30 16:57:36 +00:00
jmp reset_grafport3
2018-01-20 03:41:20 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 07:10:37 +00:00
2018-01-20 03:41:20 +00:00
.proc cmd_close_all
2018-02-03 04:41:42 +00:00
lda active_window_id ; current window
2018-01-20 05:57:58 +00:00
beq done ; nope, done!
jsr cmd_close ; close it...
jmp cmd_close_all ; and try again
done: rts
2018-01-20 03:41:20 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 07:10:37 +00:00
2018-01-20 03:41:20 +00:00
.proc cmd_disk_copy
2018-01-20 02:55:15 +00:00
lda #dynamic_routine_disk_copy
jsr load_dynamic_routine
2018-01-20 05:57:58 +00:00
bmi fail
jmp dynamic_routine_800
2017-10-12 15:04:27 +00:00
2018-01-20 05:57:58 +00:00
fail: rts
2018-01-20 03:41:20 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 07:10:37 +00:00
2018-01-20 03:41:20 +00:00
.proc cmd_new_folder_impl
2017-10-12 15:04:27 +00:00
2017-12-31 02:02:15 +00:00
L4F67: .byte $00
L4F68: .byte $00
2018-01-14 07:09:51 +00:00
L4F69: .byte $00
2018-01-14 07:58:16 +00:00
2018-02-26 05:03:58 +00:00
;; access = destroy/rename/write/read
2018-03-06 05:27:41 +00:00
DEFINE_CREATE_PARAMS create_params, path_buffer, ACCESS_DEFAULT, FT_DIRECTORY,, ST_LINKED_DIRECTORY
2018-01-14 07:58:16 +00:00
2018-01-24 05:37:41 +00:00
path_buffer:
.res 65, 0 ; buffer is used elsewhere too
2018-01-14 07:58:16 +00:00
2018-02-03 04:41:42 +00:00
start: lda active_window_id
2017-10-12 15:04:27 +00:00
sta L4F67
2018-01-23 02:09:15 +00:00
yax_call launch_dialog, index_new_folder_dialog, L4F67
2018-02-03 04:41:42 +00:00
L4FC6: lda active_window_id
2017-10-12 15:04:27 +00:00
beq L4FD4
2018-01-21 03:02:34 +00:00
jsr window_address_lookup
2018-02-05 04:35:19 +00:00
stax L4F68
2017-10-12 15:04:27 +00:00
L4FD4: lda #$80
sta L4F67
2018-01-23 02:09:15 +00:00
yax_call launch_dialog, index_new_folder_dialog, L4F67
2017-10-12 15:04:27 +00:00
beq L4FE7
jmp L504B
2018-01-17 15:41:23 +00:00
L4FE7: stx $06+1
2017-10-12 15:04:27 +00:00
stx L504F
2018-01-17 15:41:23 +00:00
sty $06
2017-10-12 15:04:27 +00:00
sty L504E
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tay
2018-01-17 15:41:23 +00:00
L4FF6: lda ($06),y
2018-01-24 05:37:41 +00:00
sta path_buffer,y
2017-10-12 15:04:27 +00:00
dey
bpl L4FF6
ldx #$03
: lda DATELO,x
2018-02-06 04:37:41 +00:00
sta create_params::create_date,x
2017-10-12 15:04:27 +00:00
dex
bpl :-
2018-01-14 07:58:16 +00:00
MLI_RELAY_CALL CREATE, create_params
2017-10-12 15:04:27 +00:00
beq L5027
jsr DESKTOP_SHOW_ALERT0
2018-02-26 03:05:59 +00:00
copy16 L504E, L4F68
2017-10-12 15:04:27 +00:00
jmp L4FC6
rts
L5027: lda #$40
sta L4F67
2018-01-23 02:09:15 +00:00
yax_call launch_dialog, index_new_folder_dialog, L4F67
2018-01-24 05:37:41 +00:00
addr_call L6F90, path_buffer
sty path_buffer
addr_call L6FAF, path_buffer
2017-10-12 15:04:27 +00:00
beq L504B
2017-12-31 02:02:15 +00:00
jsr L5E78
2018-01-21 16:37:01 +00:00
L504B: jmp redraw_windows_and_desktop
2017-10-12 15:04:27 +00:00
2017-12-31 20:32:47 +00:00
L504E: .byte 0
L504F: .byte 0
2018-01-20 03:41:20 +00:00
.endproc
cmd_new_folder := cmd_new_folder_impl::start
2018-01-24 05:37:41 +00:00
path_buffer := cmd_new_folder_impl::path_buffer ; ???
2018-01-20 03:41:20 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 07:10:37 +00:00
2018-01-20 03:41:20 +00:00
.proc cmd_eject
2018-01-19 05:57:25 +00:00
lda selected_window_index
2017-10-12 15:04:27 +00:00
beq L5056
L5055: rts
2018-02-19 19:33:13 +00:00
L5056: lda selected_icon_count
2017-10-12 15:04:27 +00:00
beq L5055
cmp #$01
bne L5067
2018-02-19 19:33:13 +00:00
lda selected_icon_list
2018-02-09 05:42:59 +00:00
cmp trash_icon_num
2017-10-12 15:04:27 +00:00
beq L5055
L5067: lda #$00
tax
tay
2018-02-19 19:33:13 +00:00
L506B: lda selected_icon_list,y
2018-02-09 05:42:59 +00:00
cmp trash_icon_num
2017-10-12 15:04:27 +00:00
beq L5077
sta $1800,x
inx
L5077: iny
2018-02-19 19:33:13 +00:00
cpy selected_icon_count
2017-10-12 15:04:27 +00:00
bne L506B
dex
stx L5098
jsr L8F15
L5084: ldx L5098
lda $1800,x
sta L533F
jsr L59A8
dec L5098
bpl L5084
2018-01-21 16:37:01 +00:00
jmp redraw_windows_and_desktop
2018-01-20 03:41:20 +00:00
L5098: .byte $00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 07:10:37 +00:00
2018-01-20 03:41:20 +00:00
.proc cmd_quit_impl
2018-01-19 07:10:37 +00:00
2018-01-20 03:41:20 +00:00
stack_data:
.addr $DEAF,$DEAD ; ???
quit_code:
.byte $18,$FB,$5C,$04,$D0,$E0
2018-01-20 05:57:58 +00:00
;; 65816 code:
;; 18 clc ; clear carry
;; FB xce ; exchange carry/emulation (i.e. turn on 16 bit)
;; 5C 04 D0 E0 jmp $E0D004 ; long jump
2018-01-20 03:41:20 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_QUIT_PARAMS quit_params
2018-01-20 03:41:20 +00:00
start:
ldx #3
: lda stack_data,x
sta $0102,x ; Populate stack ???
2017-10-12 15:04:27 +00:00
dex
2018-01-20 03:41:20 +00:00
bpl :-
;; Install new quit routine
2017-10-12 15:04:27 +00:00
sta ALTZPOFF
2017-12-31 20:04:22 +00:00
lda LCBANK2
lda LCBANK2
2018-01-20 03:41:20 +00:00
ldx #5
: lda quit_code,x
sta SELECTOR,x
2017-10-12 15:04:27 +00:00
dex
2018-01-20 03:41:20 +00:00
bpl :-
;; Restore machine to text state
2017-10-12 15:04:27 +00:00
sta ALTZPOFF
2017-12-31 20:04:22 +00:00
lda ROMIN2
2017-12-31 02:02:15 +00:00
jsr SETVID
jsr SETKBD
jsr INIT
jsr HOME
2017-12-31 20:04:22 +00:00
sta TXTSET
sta LOWSCR
sta LORES
sta MIXCLR
sta DHIRESOFF
sta CLRALTCHAR
sta CLR80VID
sta CLR80COL
2018-01-20 03:41:20 +00:00
MLI_CALL QUIT, quit_params
.endproc
cmd_quit := cmd_quit_impl::start
2018-01-19 07:10:37 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 07:10:37 +00:00
2018-01-20 03:41:20 +00:00
.proc cmd_view_by_icon
2018-02-03 04:41:42 +00:00
ldx active_window_id
2017-10-12 15:04:27 +00:00
bne L50FF
rts
L50FF: dex
2018-02-03 03:38:35 +00:00
lda win_buf_table,x
2017-10-12 15:04:27 +00:00
bne L5106
rts
2018-02-03 04:41:42 +00:00
L5106: lda active_window_id
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_TO_BUF
2017-10-12 15:04:27 +00:00
ldx #$00
txa
2018-02-08 05:48:19 +00:00
L5112: cpx cached_window_icon_count
2017-10-12 15:04:27 +00:00
beq L511E
2018-02-08 05:48:19 +00:00
sta cached_window_icon_list,x
2017-10-12 15:04:27 +00:00
inx
jmp L5112
2018-02-08 05:48:19 +00:00
L511E: sta cached_window_icon_count
2017-10-12 15:04:27 +00:00
lda #$00
2018-02-03 04:41:42 +00:00
ldx active_window_id
2017-10-12 15:04:27 +00:00
dex
2018-02-03 03:38:35 +00:00
sta win_buf_table,x
2018-02-03 04:41:42 +00:00
jsr update_view_menu_check
lda active_window_id
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2018-02-12 01:21:37 +00:00
jsr get_port2
2018-02-14 02:53:02 +00:00
jsr offset_grafport2_and_set
2018-02-03 04:41:42 +00:00
jsr set_penmode_copy
2018-03-02 02:25:42 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, grafport2::cliprect
2018-02-03 04:41:42 +00:00
lda active_window_id
2017-10-12 15:04:27 +00:00
jsr L7D5D
2018-02-05 04:35:19 +00:00
stax L51EB
2017-10-12 15:04:27 +00:00
sty L51ED
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-01-21 03:02:34 +00:00
jsr window_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$1F
lda #$00
2018-01-17 15:41:23 +00:00
L5162: sta ($06),y
2017-10-12 15:04:27 +00:00
dey
cpy #$1B
bne L5162
ldy #$23
ldx #$03
L516D: lda L51EB,x
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
dey
dex
bpl L516D
2018-02-03 04:41:42 +00:00
lda active_window_id
2017-10-12 15:04:27 +00:00
jsr L763A
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2018-02-12 01:21:37 +00:00
jsr get_set_port2
2018-02-14 03:15:45 +00:00
jsr cached_icons_window_to_screen
2017-10-12 15:04:27 +00:00
lda #$00
sta L51EF
L518D: lda L51EF
2018-02-08 05:48:19 +00:00
cmp cached_window_icon_count
2017-10-12 15:04:27 +00:00
beq L51A7
tax
2018-02-08 05:48:19 +00:00
lda cached_window_icon_list,x
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2017-10-12 15:04:27 +00:00
ldy #$01
2017-12-31 02:02:15 +00:00
jsr DESKTOP_RELAY
2017-10-12 15:04:27 +00:00
inc L51EF
jmp L518D
2018-01-30 16:57:36 +00:00
L51A7: jsr reset_grafport3
2018-02-14 03:15:45 +00:00
jsr cached_icons_screen_to_window
jsr DESKTOP_COPY_FROM_BUF
2018-02-14 03:15:45 +00:00
jsr update_scrollbars
lda selected_window_index
2017-10-12 15:04:27 +00:00
beq L51E3
2018-02-19 19:33:13 +00:00
lda selected_icon_count
2017-10-12 15:04:27 +00:00
beq L51E3
sta L51EF
L51C0: ldx L51EF
2018-02-19 19:33:13 +00:00
lda selected_icon_count,x
2018-02-15 16:08:59 +00:00
sta icon_param
2018-02-13 16:18:11 +00:00
jsr icon_window_to_screen
2018-02-14 02:53:02 +00:00
jsr offset_grafport2_and_set
2018-02-15 16:08:59 +00:00
DESKTOP_RELAY_CALL DT_HIGHLIGHT_ICON, icon_param
lda icon_param
2018-02-13 16:18:11 +00:00
jsr icon_screen_to_window
2017-10-12 15:04:27 +00:00
dec L51EF
bne L51C0
L51E3: lda #$00
2018-02-08 05:48:19 +00:00
sta cached_window_id
jmp DESKTOP_COPY_TO_BUF
2017-10-12 15:04:27 +00:00
2018-02-05 04:46:26 +00:00
L51EB: .word 0
2017-12-31 20:32:47 +00:00
L51ED: .byte 0
.byte 0
L51EF: .byte 0
2018-01-20 03:41:20 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-20 03:41:20 +00:00
2018-02-12 01:21:37 +00:00
.proc L51F0
ldx active_window_id
2017-10-12 15:04:27 +00:00
dex
2018-02-03 03:38:35 +00:00
sta win_buf_table,x
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_TO_BUF
2017-10-12 15:04:27 +00:00
jsr L7D9C
jsr DESKTOP_COPY_FROM_BUF
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2018-02-12 01:21:37 +00:00
jsr get_port2
2018-02-14 02:53:02 +00:00
jsr offset_grafport2_and_set
2018-02-03 04:41:42 +00:00
jsr set_penmode_copy
2018-03-02 02:25:42 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, grafport2::cliprect
2018-02-03 04:41:42 +00:00
lda active_window_id
2017-10-12 15:04:27 +00:00
jsr L7D5D
2018-02-05 04:35:19 +00:00
stax L5263
2017-10-12 15:04:27 +00:00
sty L5265
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-01-21 03:02:34 +00:00
jsr window_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$1F
lda #$00
2018-01-17 15:41:23 +00:00
L523B: sta ($06),y
2017-10-12 15:04:27 +00:00
dey
cpy #$1B
bne L523B
ldy #$23
ldx #$03
L5246: lda L5263,x
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
dey
dex
bpl L5246
lda #$80
sta L4152
2018-01-30 16:57:36 +00:00
jsr reset_grafport3
2017-10-12 15:04:27 +00:00
jsr L6C19
2018-02-14 03:15:45 +00:00
jsr update_scrollbars
2017-10-12 15:04:27 +00:00
lda #$00
sta L4152
rts
2018-02-05 04:46:26 +00:00
L5263: .word 0
2017-12-31 20:32:47 +00:00
L5265: .byte 0
.byte 0
2018-02-12 01:21:37 +00:00
.endproc
2018-01-19 07:10:37 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-20 03:41:20 +00:00
.proc cmd_view_by_name
2018-02-03 04:41:42 +00:00
ldx active_window_id
2017-10-12 15:04:27 +00:00
bne L526D
rts
L526D: dex
2018-02-03 03:38:35 +00:00
lda win_buf_table,x
2017-10-12 15:04:27 +00:00
cmp #$81
bne L5276
rts
L5276: cmp #$00
2018-02-12 01:21:37 +00:00
bne :+
jsr close_active_window
: jsr update_view_menu_check
2017-10-12 15:04:27 +00:00
lda #$81
jmp L51F0
2018-01-20 03:41:20 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 07:10:37 +00:00
2018-01-20 03:41:20 +00:00
.proc cmd_view_by_date
2018-02-03 04:41:42 +00:00
ldx active_window_id
2017-10-12 15:04:27 +00:00
bne L528B
rts
L528B: dex
2018-02-03 03:38:35 +00:00
lda win_buf_table,x
2017-10-12 15:04:27 +00:00
cmp #$82
bne L5294
rts
L5294: cmp #$00
2018-02-12 01:21:37 +00:00
bne :+
jsr close_active_window
: jsr update_view_menu_check
2017-10-12 15:04:27 +00:00
lda #$82
jmp L51F0
2018-01-20 03:41:20 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 07:10:37 +00:00
2018-01-20 03:41:20 +00:00
.proc cmd_view_by_size
2018-02-03 04:41:42 +00:00
ldx active_window_id
2017-10-12 15:04:27 +00:00
bne L52A9
rts
L52A9: dex
2018-02-03 03:38:35 +00:00
lda win_buf_table,x
2017-10-12 15:04:27 +00:00
cmp #$83
bne L52B2
rts
L52B2: cmp #$00
2018-02-12 01:21:37 +00:00
bne :+
jsr close_active_window
: jsr update_view_menu_check
2017-10-12 15:04:27 +00:00
lda #$83
jmp L51F0
2018-01-20 03:41:20 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 07:10:37 +00:00
2018-01-20 03:41:20 +00:00
.proc cmd_view_by_type
2018-02-03 04:41:42 +00:00
ldx active_window_id
2017-10-12 15:04:27 +00:00
bne L52C7
rts
L52C7: dex
2018-02-03 03:38:35 +00:00
lda win_buf_table,x
2017-10-12 15:04:27 +00:00
cmp #$84
bne L52D0
rts
L52D0: cmp #$00
2018-02-12 01:21:37 +00:00
bne :+
jsr close_active_window
: jsr update_view_menu_check
2017-10-12 15:04:27 +00:00
lda #$84
jmp L51F0
2018-01-20 03:41:20 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-03 04:41:42 +00:00
.proc update_view_menu_check
;; Uncheck last checked
2018-02-14 02:53:02 +00:00
lda #MGTK::checkitem_uncheck
2018-02-01 19:30:03 +00:00
sta checkitem_params::check
MGTK_RELAY_CALL MGTK::CheckItem, checkitem_params
2018-02-03 04:41:42 +00:00
;; Check the new one
2018-02-06 23:36:39 +00:00
lda menu_click_params::item_num ; index of View menu item to check
2018-02-01 19:30:03 +00:00
sta checkitem_params::menu_item
2018-02-14 02:53:02 +00:00
lda #MGTK::checkitem_check
2018-02-01 19:30:03 +00:00
sta checkitem_params::check
MGTK_RELAY_CALL MGTK::CheckItem, checkitem_params
2017-10-12 15:04:27 +00:00
rts
2018-02-03 04:41:42 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-12 01:21:37 +00:00
.proc close_active_window
DESKTOP_RELAY_CALL DT_CLOSE_WINDOW, active_window_id
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_TO_BUF
2018-01-15 05:23:48 +00:00
lda LDD9E
2017-10-12 15:04:27 +00:00
sec
2018-02-08 05:48:19 +00:00
sbc cached_window_icon_count
2018-01-15 05:23:48 +00:00
sta LDD9E
2018-02-12 01:21:37 +00:00
ldx #0
loop: cpx cached_window_icon_count
beq done
2018-02-08 05:48:19 +00:00
lda cached_window_icon_list,x
2018-02-08 05:36:53 +00:00
jsr DESKTOP_FREE_ICON
2017-10-12 15:04:27 +00:00
lda #$00
2018-02-08 05:48:19 +00:00
sta cached_window_icon_list,x
2017-10-12 15:04:27 +00:00
inx
2018-02-12 01:21:37 +00:00
jmp loop
2017-10-12 15:04:27 +00:00
2018-02-12 01:21:37 +00:00
done: jsr DESKTOP_COPY_FROM_BUF
2017-10-12 15:04:27 +00:00
lda #$00
2018-02-08 05:48:19 +00:00
sta cached_window_id
jmp DESKTOP_COPY_TO_BUF
2018-02-12 01:21:37 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 07:10:37 +00:00
2017-12-31 20:32:47 +00:00
L533F: .byte 0
2018-01-19 07:10:37 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-20 03:41:20 +00:00
.proc cmd_format_disk
2018-01-20 02:55:15 +00:00
lda #dynamic_routine_format_erase
jsr load_dynamic_routine
2018-01-20 05:57:58 +00:00
bmi fail
2017-10-12 15:04:27 +00:00
lda #$04
jsr dynamic_routine_800
2018-01-20 05:57:58 +00:00
bne :+
2017-10-12 15:04:27 +00:00
stx L533F
2018-01-21 16:37:01 +00:00
jsr redraw_windows_and_desktop
2017-10-12 15:04:27 +00:00
jsr L59A4
2018-01-21 16:37:01 +00:00
: jmp redraw_windows_and_desktop
2017-10-12 15:04:27 +00:00
2018-01-20 05:57:58 +00:00
fail: rts
2018-01-20 03:41:20 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 07:10:37 +00:00
2018-01-20 03:41:20 +00:00
.proc cmd_erase_disk
2018-01-20 02:55:15 +00:00
lda #dynamic_routine_format_erase
jsr load_dynamic_routine
2018-01-20 05:57:58 +00:00
bmi done
2017-10-12 15:04:27 +00:00
lda #$05
jsr dynamic_routine_800
2018-01-20 05:57:58 +00:00
bne done
2017-10-12 15:04:27 +00:00
stx L533F
2018-01-21 16:37:01 +00:00
jsr redraw_windows_and_desktop
2017-10-12 15:04:27 +00:00
jsr L59A4
2018-01-21 16:37:01 +00:00
done: jmp redraw_windows_and_desktop
2018-01-20 03:41:20 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 07:10:37 +00:00
2018-01-20 03:41:20 +00:00
.proc cmd_get_info
2018-01-19 05:57:25 +00:00
jsr L8F09
2018-01-21 16:37:01 +00:00
jmp redraw_windows_and_desktop
2018-01-20 03:41:20 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 07:10:37 +00:00
2018-01-20 03:41:20 +00:00
.proc cmd_get_size
2018-01-19 05:57:25 +00:00
jsr L8F27
2018-01-21 16:37:01 +00:00
jmp redraw_windows_and_desktop
2018-01-20 03:41:20 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 07:10:37 +00:00
2018-01-20 03:41:20 +00:00
.proc cmd_unlock
2018-01-19 05:57:25 +00:00
jsr L8F0F
2018-01-21 16:37:01 +00:00
jmp redraw_windows_and_desktop
2018-01-20 03:41:20 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 07:10:37 +00:00
2018-01-20 03:41:20 +00:00
.proc cmd_lock
2018-01-19 05:57:25 +00:00
jsr L8F0C
2018-01-21 16:37:01 +00:00
jmp redraw_windows_and_desktop
2018-01-20 03:41:20 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 07:10:37 +00:00
2018-01-20 03:41:20 +00:00
.proc cmd_rename_icon
2018-01-19 05:57:25 +00:00
jsr L8F12
2017-10-12 15:04:27 +00:00
pha
2018-01-21 16:37:01 +00:00
jsr redraw_windows_and_desktop
2017-10-12 15:04:27 +00:00
pla
beq L5398
rts
L5398: lda selected_window_index
2017-10-12 15:04:27 +00:00
bne L53B5
ldx #$00
ldy #$00
2018-02-19 19:33:13 +00:00
L53A1: lda selected_icon_list,x
2017-10-12 15:04:27 +00:00
cmp #$01
beq L53AC
sta L5428,y
iny
L53AC: inx
2018-02-19 19:33:13 +00:00
cpx selected_icon_list
2017-10-12 15:04:27 +00:00
bne L53A1
sty L5427
L53B5: lda #$FF
sta L5426
L53BA: inc L5426
lda L5426
2018-02-19 19:33:13 +00:00
cmp selected_icon_count
2017-10-12 15:04:27 +00:00
bne L53D0
lda selected_window_index
2017-10-12 15:04:27 +00:00
bne L53CD
jmp L540E
L53CD: jmp L5E78
L53D0: tax
2018-02-19 19:33:13 +00:00
lda selected_icon_list,x
2017-10-12 15:04:27 +00:00
jsr L5431
bmi L53BA
2018-01-21 03:02:34 +00:00
jsr window_address_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tay
2018-01-17 15:41:23 +00:00
lda $06
2017-10-12 15:04:27 +00:00
jsr L6FB7
lda L704B
beq L53BA
L53EF: dec L704B
ldx L704B
lda L704C,x
2018-02-03 04:41:42 +00:00
cmp active_window_id
2017-10-12 15:04:27 +00:00
beq L5403
2018-02-28 02:38:18 +00:00
sta findwindow_window_id
2018-01-28 16:08:39 +00:00
jsr handle_inactive_window_click
2018-02-12 01:21:37 +00:00
L5403: jsr close_window
2017-10-12 15:04:27 +00:00
lda L704B
bne L53EF
jmp L53BA
L540E: ldx L5427
L5411: lda L5428,x
sta L533F
jsr L59A8
ldx L5427
dec L5427
dex
bpl L5411
2018-01-21 16:37:01 +00:00
jmp redraw_windows_and_desktop
2017-10-12 15:04:27 +00:00
2017-12-31 20:32:47 +00:00
L5426: .byte 0
L5427: .byte 0
L5428: .res 9, 0
2018-01-20 03:41:20 +00:00
L5431: ldx #7
2018-01-13 03:06:55 +00:00
L5433: cmp LEC26,x
2017-10-12 15:04:27 +00:00
beq L543E
dex
bpl L5433
2018-02-16 03:29:05 +00:00
return #$FF
2017-10-12 15:04:27 +00:00
L543E: inx
txa
rts
2018-01-26 02:22:33 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-26 02:22:33 +00:00
;;; Handle keyboard-based icon selection ("highlighting")
.proc cmd_higlight
jmp L544D
2017-10-12 15:04:27 +00:00
2017-12-31 20:32:47 +00:00
L5444: .byte 0
L5445: .byte 0
L5446: .byte 0
L5447: .byte 0
L5448: .byte 0
L5449: .byte 0
L544A: .byte 0
.byte 0
.byte 0
2018-01-21 22:35:37 +00:00
2018-01-26 02:22:33 +00:00
L544D:
lda #$00
2017-10-12 15:04:27 +00:00
sta $1800
2018-03-05 05:33:56 +00:00
lda active_window_id
2017-10-12 15:04:27 +00:00
bne L545A
jmp L54C5
L545A: tax
dex
2018-02-03 03:38:35 +00:00
lda win_buf_table,x
2017-10-12 15:04:27 +00:00
bpl L5464
jmp L54C5
2018-02-03 04:41:42 +00:00
L5464: lda active_window_id
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_TO_BUF
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-01-21 03:02:34 +00:00
jsr window_lookup
2018-02-05 04:35:19 +00:00
stax $06
2018-02-19 22:06:12 +00:00
ldy #MGTK::winfo_offset_port+MGTK::grafport_offset_maprect
2018-01-17 15:41:23 +00:00
L5479: lda ($06),y
2018-02-19 22:06:12 +00:00
sta rect_E230-(MGTK::winfo_offset_port+MGTK::grafport_offset_maprect),y
2017-10-12 15:04:27 +00:00
iny
2018-02-19 22:06:12 +00:00
cpy #MGTK::winfo_offset_port+MGTK::grafport_offset_maprect+8
2017-10-12 15:04:27 +00:00
bne L5479
ldx #$00
2018-02-08 05:48:19 +00:00
L5485: cpx cached_window_icon_count
2017-10-12 15:04:27 +00:00
beq L54BD
txa
pha
2018-02-08 05:48:19 +00:00
lda cached_window_icon_list,x
2018-02-15 16:08:59 +00:00
sta icon_param
2018-02-13 16:18:11 +00:00
jsr icon_window_to_screen
2018-02-15 16:08:59 +00:00
DESKTOP_RELAY_CALL DT_ICON_IN_RECT, icon_param
2017-10-12 15:04:27 +00:00
pha
2018-02-15 16:08:59 +00:00
lda icon_param
2018-02-13 16:18:11 +00:00
jsr icon_screen_to_window
2017-10-12 15:04:27 +00:00
pla
beq L54B7
pla
pha
tax
2018-02-08 05:48:19 +00:00
lda cached_window_icon_list,x
2017-10-12 15:04:27 +00:00
ldx $1800
sta $1801,x
inc $1800
L54B7: pla
tax
inx
jmp L5485
L54BD: lda #$00
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_TO_BUF
2017-10-12 15:04:27 +00:00
L54C5: ldx $1800
ldy #$00
2018-02-08 05:48:19 +00:00
L54CA: lda cached_window_icon_list,y
2017-10-12 15:04:27 +00:00
sta $1801,x
iny
inx
2018-02-08 05:48:19 +00:00
cpy cached_window_icon_count
2017-10-12 15:04:27 +00:00
bne L54CA
lda $1800
clc
2018-02-08 05:48:19 +00:00
adc cached_window_icon_count
2017-10-12 15:04:27 +00:00
sta $1800
lda #$00
sta L544A
2018-02-24 05:12:41 +00:00
ldax #$03FF
2017-10-12 15:04:27 +00:00
L54EA: sta L5444,x
dex
bpl L54EA
L54F0: ldx L544A
L54F3: lda $1801,x
asl a
tay
2018-02-09 05:42:59 +00:00
copy16 icon_entry_address_table,y, $06
2017-10-12 15:04:27 +00:00
ldy #$06
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
cmp L5447
beq L5510
bcc L5532
jmp L5547
L5510: dey
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
cmp L5446
beq L551D
bcc L5532
jmp L5547
L551D: dey
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
cmp L5445
beq L552A
bcc L5532
jmp L5547
L552A: dey
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
cmp L5444
bcs L5547
L5532: lda $1801,x
stx L5449
sta L5448
ldy #$03
2018-01-17 15:41:23 +00:00
L553D: lda ($06),y
2018-01-26 02:22:33 +00:00
sta L5444-3,y
2017-10-12 15:04:27 +00:00
iny
cpy #$07
bne L553D
L5547: inx
cpx $1800
bne L54F3
ldx L544A
lda $1801,x
tay
lda L5448
sta $1801,x
ldx L5449
tya
sta $1801,x
2018-02-24 05:12:41 +00:00
ldax #$03FF
2017-10-12 15:04:27 +00:00
L5565: sta L5444,x
dex
bpl L5565
inc L544A
ldx L544A
cpx $1800
beq L5579
jmp L54F0
L5579: lda #$00
sta L544A
2018-01-20 18:57:25 +00:00
jsr clear_selection
2017-10-12 15:04:27 +00:00
L5581: jsr L55F0
2018-02-03 04:41:42 +00:00
L5584: jsr get_event
2018-02-28 02:38:18 +00:00
lda event_kind
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_key_down
2017-10-12 15:04:27 +00:00
beq L5595
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_button_down
2017-10-12 15:04:27 +00:00
bne L5584
jmp L55D1
2018-01-30 16:57:36 +00:00
L5595: lda event_params+1
2017-10-12 15:04:27 +00:00
and #$7F
2018-02-27 04:13:18 +00:00
cmp #CHAR_RETURN
2017-10-12 15:04:27 +00:00
beq L55D1
2018-02-27 04:13:18 +00:00
cmp #CHAR_ESCAPE
2017-10-12 15:04:27 +00:00
beq L55D1
2018-02-27 04:13:18 +00:00
cmp #CHAR_LEFT
2017-10-12 15:04:27 +00:00
beq L55BE
2018-02-27 04:13:18 +00:00
cmp #CHAR_RIGHT
2017-10-12 15:04:27 +00:00
bne L5584
ldx L544A
inx
cpx $1800
bne L55B5
ldx #$00
L55B5: stx L544A
jsr L562C
jmp L5581
L55BE: ldx L544A
dex
bpl L55C8
ldx $1800
dex
L55C8: stx L544A
jsr L562C
jmp L5581
L55D1: ldx L544A
lda $1801,x
2018-02-19 19:33:13 +00:00
sta selected_icon_list
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-02-05 04:35:19 +00:00
stax $06
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-09 05:42:59 +00:00
and #icon_entry_winid_mask
sta selected_window_index
2018-02-09 05:42:59 +00:00
lda #1
2018-02-19 19:33:13 +00:00
sta selected_icon_count
2017-10-12 15:04:27 +00:00
rts
L55F0: ldx L544A
lda $1801,x
2018-02-15 16:08:59 +00:00
sta icon_param
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-02-05 04:35:19 +00:00
stax $06
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-09 05:42:59 +00:00
and #icon_entry_winid_mask
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2017-10-12 15:04:27 +00:00
beq L5614
jsr L56F9
2018-02-15 16:08:59 +00:00
lda icon_param
2018-02-13 16:18:11 +00:00
jsr icon_window_to_screen
2018-02-15 16:08:59 +00:00
L5614: DESKTOP_RELAY_CALL DT_HIGHLIGHT_ICON, icon_param
2018-01-31 05:42:26 +00:00
lda getwinport_params2::window_id
2017-10-12 15:04:27 +00:00
beq L562B
2018-02-15 16:08:59 +00:00
lda icon_param
2018-02-13 16:18:11 +00:00
jsr icon_screen_to_window
2018-01-30 16:57:36 +00:00
jsr reset_grafport3
2017-10-12 15:04:27 +00:00
L562B: rts
2018-02-15 16:08:59 +00:00
L562C: lda icon_param
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-02-05 04:35:19 +00:00
stax $06
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-09 05:42:59 +00:00
and #icon_entry_winid_mask
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2017-10-12 15:04:27 +00:00
beq L564A
jsr L56F9
2018-02-15 16:08:59 +00:00
lda icon_param
2018-02-13 16:18:11 +00:00
jsr icon_window_to_screen
2018-02-15 16:08:59 +00:00
L564A: DESKTOP_RELAY_CALL $0B, icon_param
2018-01-31 05:42:26 +00:00
lda getwinport_params2::window_id
2017-10-12 15:04:27 +00:00
beq L5661
2018-02-15 16:08:59 +00:00
lda icon_param
2018-02-13 16:18:11 +00:00
jsr icon_screen_to_window
2018-01-30 16:57:36 +00:00
jsr reset_grafport3
2017-10-12 15:04:27 +00:00
L5661: rts
2018-01-26 02:22:33 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 07:10:37 +00:00
2018-01-20 05:57:58 +00:00
.proc cmd_select_all
2018-02-19 19:33:13 +00:00
lda selected_icon_count
2017-10-12 15:04:27 +00:00
beq L566A
2018-01-20 18:57:25 +00:00
jsr clear_selection
2018-02-03 04:41:42 +00:00
L566A: ldx active_window_id
2017-10-12 15:04:27 +00:00
beq L5676
dex
2018-02-03 03:38:35 +00:00
lda win_buf_table,x
2017-10-12 15:04:27 +00:00
bpl L5676
rts
2018-02-03 04:41:42 +00:00
L5676: lda active_window_id
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_TO_BUF
2018-02-08 05:48:19 +00:00
lda cached_window_icon_count
2017-10-12 15:04:27 +00:00
bne L5687
jmp L56F0
2018-02-08 05:48:19 +00:00
L5687: ldx cached_window_icon_count
2017-10-12 15:04:27 +00:00
dex
2018-02-08 05:48:19 +00:00
L568B: lda cached_window_icon_list,x
2018-02-19 19:33:13 +00:00
sta selected_icon_list,x
2017-10-12 15:04:27 +00:00
dex
bpl L568B
2018-02-08 05:48:19 +00:00
lda cached_window_icon_count
2018-02-19 19:33:13 +00:00
sta selected_icon_count
2018-02-03 04:41:42 +00:00
lda active_window_id
sta selected_window_index
lda selected_window_index
2018-02-06 23:36:39 +00:00
sta LE22C
2017-10-12 15:04:27 +00:00
beq L56AB
jsr L56F9
2018-02-19 19:33:13 +00:00
L56AB: lda selected_icon_count
2017-10-12 15:04:27 +00:00
sta L56F8
dec L56F8
L56B4: ldx L56F8
2018-02-19 19:33:13 +00:00
lda selected_icon_list,x
2018-02-05 03:13:21 +00:00
sta LE22B
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-02-05 04:35:19 +00:00
stax $06
2018-02-06 23:36:39 +00:00
lda LE22C
2017-10-12 15:04:27 +00:00
beq L56CF
2018-02-05 03:13:21 +00:00
lda LE22B
2018-02-13 16:18:11 +00:00
jsr icon_window_to_screen
2018-02-05 03:13:21 +00:00
L56CF: DESKTOP_RELAY_CALL DT_HIGHLIGHT_ICON, LE22B
2018-02-06 23:36:39 +00:00
lda LE22C
2017-10-12 15:04:27 +00:00
beq L56E3
2018-02-05 03:13:21 +00:00
lda LE22B
2018-02-13 16:18:11 +00:00
jsr icon_screen_to_window
2017-10-12 15:04:27 +00:00
L56E3: dec L56F8
bpl L56B4
lda selected_window_index
2017-10-12 15:04:27 +00:00
beq L56F0
2018-01-30 16:57:36 +00:00
jsr reset_grafport3
2017-10-12 15:04:27 +00:00
L56F0: lda #$00
2018-02-08 05:48:19 +00:00
sta cached_window_id
jmp DESKTOP_COPY_TO_BUF
2017-10-12 15:04:27 +00:00
2017-12-31 20:32:47 +00:00
L56F8: .byte 0
2018-01-20 05:57:58 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-20 05:57:58 +00:00
2018-03-18 18:59:01 +00:00
.proc L56F9
sta getwinport_params2::window_id
2018-02-12 01:21:37 +00:00
jsr get_port2
2018-02-14 02:53:02 +00:00
jmp offset_grafport2_and_set
2018-03-18 18:59:01 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-26 02:22:33 +00:00
;;; Handle keyboard-based window activation
.proc cmd_activate
2018-02-03 04:41:42 +00:00
lda active_window_id
2017-10-12 15:04:27 +00:00
bne L5708
rts
L5708: sta L0800
ldy #$01
ldx #$00
2018-01-13 03:06:55 +00:00
L570F: lda LEC26,x
2017-10-12 15:04:27 +00:00
beq L5720
inx
2018-02-03 04:41:42 +00:00
cpx active_window_id
2017-10-12 15:04:27 +00:00
beq L5721
txa
dex
sta L0800,y
iny
L5720: inx
L5721: cpx #$08
bne L570F
sty L578D
cpy #$01
bne L572D
rts
L572D: lda #$00
sta L578C
2018-02-03 04:41:42 +00:00
L5732: jsr get_event
2018-02-28 02:38:18 +00:00
lda event_kind
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_key_down
2017-10-12 15:04:27 +00:00
beq L5743
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_button_down
2017-10-12 15:04:27 +00:00
bne L5732
jmp L578B
2018-02-28 02:38:18 +00:00
L5743: lda event_key
2017-10-12 15:04:27 +00:00
and #$7F
2018-02-27 04:13:18 +00:00
cmp #CHAR_RETURN
2017-10-12 15:04:27 +00:00
beq L578B
2018-02-27 04:13:18 +00:00
cmp #CHAR_ESCAPE
2017-10-12 15:04:27 +00:00
beq L578B
2018-02-27 04:13:18 +00:00
cmp #CHAR_LEFT
2017-10-12 15:04:27 +00:00
beq L5772
2018-02-27 04:13:18 +00:00
cmp #CHAR_RIGHT
2017-10-12 15:04:27 +00:00
bne L5732
ldx L578C
inx
cpx L578D
bne L5763
ldx #$00
L5763: stx L578C
lda L0800,x
2018-02-28 02:38:18 +00:00
sta findwindow_window_id
2018-01-28 16:08:39 +00:00
jsr handle_inactive_window_click
2017-10-12 15:04:27 +00:00
jmp L5732
L5772: ldx L578C
dex
bpl L577C
ldx L578D
dex
L577C: stx L578C
lda L0800,x
2018-02-28 02:38:18 +00:00
sta findwindow_window_id
2018-01-28 16:08:39 +00:00
jsr handle_inactive_window_click
2017-10-12 15:04:27 +00:00
jmp L5732
L578B: rts
2017-12-31 20:32:47 +00:00
L578C: .byte 0
L578D: .byte 0
2017-10-12 15:04:27 +00:00
2018-01-26 02:22:33 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-03 04:41:42 +00:00
;;; Initiate keyboard-based resizing
2018-01-26 02:22:33 +00:00
.proc cmd_resize
2018-01-29 16:38:23 +00:00
MGTK_RELAY_CALL MGTK::KeyboardMouse
2018-01-26 02:22:33 +00:00
jmp handle_resize_click
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-26 02:22:33 +00:00
;;; Initiate keyboard-based window moving
.proc cmd_move
2018-01-29 16:38:23 +00:00
MGTK_RELAY_CALL MGTK::KeyboardMouse
2018-01-26 02:22:33 +00:00
jmp handle_title_click
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-26 02:22:33 +00:00
;;; Keyboard-based scrolling of window contents
2017-10-12 15:04:27 +00:00
2018-01-26 02:22:33 +00:00
.proc cmd_scroll
jsr L5803
2018-02-03 04:41:42 +00:00
loop: jsr get_event
2018-02-28 02:38:18 +00:00
lda event_kind
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_button_down
2018-01-26 02:22:33 +00:00
beq done
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_key_down
2018-01-26 02:22:33 +00:00
bne loop
2018-02-28 02:38:18 +00:00
lda event_key
2018-02-27 04:13:18 +00:00
cmp #CHAR_RETURN
2018-01-26 02:22:33 +00:00
beq done
2018-02-27 04:13:18 +00:00
cmp #CHAR_ESCAPE
2018-01-26 02:22:33 +00:00
bne :+
done: lda #$00
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_TO_BUF
2017-10-12 15:04:27 +00:00
rts
2018-01-26 02:22:33 +00:00
;; Horizontal ok?
: bit L585D
bmi :+
jmp vertical
2017-10-12 15:04:27 +00:00
2018-02-27 04:13:18 +00:00
: cmp #CHAR_RIGHT
2018-01-26 02:22:33 +00:00
bne :+
2018-01-26 02:28:08 +00:00
jsr scroll_right
2018-01-26 02:22:33 +00:00
jmp loop
2017-10-12 15:04:27 +00:00
2018-02-27 04:13:18 +00:00
: cmp #CHAR_LEFT
2018-01-26 02:22:33 +00:00
bne vertical
2018-01-26 02:28:08 +00:00
jsr scroll_left
2018-01-26 02:22:33 +00:00
jmp loop
2017-10-12 15:04:27 +00:00
2018-01-26 02:22:33 +00:00
;; Vertical ok?
vertical:
bit L585E
bmi :+
jmp loop
2017-10-12 15:04:27 +00:00
2018-02-27 04:13:18 +00:00
: cmp #CHAR_DOWN
2018-01-26 02:22:33 +00:00
bne :+
2018-01-26 02:28:08 +00:00
jsr scroll_down
2018-01-26 02:22:33 +00:00
jmp loop
2017-10-12 15:04:27 +00:00
2018-02-27 04:13:18 +00:00
: cmp #CHAR_UP
2018-01-26 02:22:33 +00:00
bne loop
2018-01-26 02:28:08 +00:00
jsr scroll_up
2018-01-26 02:22:33 +00:00
jmp loop
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-12 01:21:37 +00:00
.proc L5803
lda active_window_id
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_TO_BUF
2018-02-03 04:41:42 +00:00
ldx active_window_id
2017-10-12 15:04:27 +00:00
dex
2018-02-03 03:38:35 +00:00
lda win_buf_table,x
2017-10-12 15:04:27 +00:00
sta L5B1B
jsr L58C3
2018-02-05 04:35:19 +00:00
stax L585F
2017-10-12 15:04:27 +00:00
sty L585D
jsr L58E2
2018-02-05 04:35:19 +00:00
stax L5861
2017-10-12 15:04:27 +00:00
sty L585E
rts
2018-02-12 01:21:37 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-01-26 02:28:08 +00:00
scroll_right: ; elevator right / contents left
2018-02-05 04:21:34 +00:00
ldax L585F
2017-10-12 15:04:27 +00:00
jsr L5863
sta L585F
rts
2018-01-26 02:28:08 +00:00
scroll_left: ; elevator left / contents right
lda L585F
2017-10-12 15:04:27 +00:00
jsr L587E
sta L585F
rts
2018-01-26 02:28:08 +00:00
scroll_down: ; elevator down / contents up
2018-02-05 04:21:34 +00:00
ldax L5861
2017-10-12 15:04:27 +00:00
jsr L5893
sta L5861
rts
2018-01-26 02:28:08 +00:00
scroll_up: ; elevator up / contents down
lda L5861
2017-10-12 15:04:27 +00:00
jsr L58AE
sta L5861
rts
2018-01-26 02:28:08 +00:00
L585D: .byte 0 ; can scroll horiz?
L585E: .byte 0 ; can scroll vert?
2018-02-06 18:10:34 +00:00
L585F: .word 0
2018-02-05 04:46:26 +00:00
L5861: .word 0
2018-01-26 02:22:33 +00:00
2018-02-17 07:08:39 +00:00
.proc L5863
stx L587D
2017-10-12 15:04:27 +00:00
cmp L587D
2018-02-16 03:12:59 +00:00
beq :+
sta updatethumb_stash
inc updatethumb_stash
lda #MGTK::ctl_horizontal_scroll_bar
2018-02-28 02:38:18 +00:00
sta updatethumb_which_ctl
2017-10-12 15:04:27 +00:00
jsr L5C54
2018-02-16 03:12:59 +00:00
lda updatethumb_stash
: rts
2017-10-12 15:04:27 +00:00
2017-12-31 20:32:47 +00:00
L587D: .byte 0
2018-02-17 07:08:39 +00:00
.endproc
.proc L587E
beq :+
2018-02-16 03:12:59 +00:00
sta updatethumb_stash
dec updatethumb_stash
lda #MGTK::ctl_horizontal_scroll_bar
2018-02-28 02:38:18 +00:00
sta updatethumb_which_ctl
2017-10-12 15:04:27 +00:00
jsr L5C54
2018-02-16 03:12:59 +00:00
lda updatethumb_stash
: rts
2017-12-31 20:32:47 +00:00
.byte 0
2018-02-17 07:08:39 +00:00
.endproc
.proc L5893
stx L58AD
2017-10-12 15:04:27 +00:00
cmp L58AD
2018-02-16 03:12:59 +00:00
beq :+
sta updatethumb_stash
inc updatethumb_stash
lda #MGTK::ctl_vertical_scroll_bar
2018-02-28 02:38:18 +00:00
sta updatethumb_which_ctl
2017-10-12 15:04:27 +00:00
jsr L5C54
2018-02-16 03:12:59 +00:00
lda updatethumb_stash
: rts
2017-10-12 15:04:27 +00:00
2017-12-31 20:32:47 +00:00
L58AD: .byte 0
2018-02-17 07:08:39 +00:00
.endproc
.proc L58AE
beq :+
2018-02-16 03:12:59 +00:00
sta updatethumb_stash
dec updatethumb_stash
lda #MGTK::ctl_vertical_scroll_bar
2018-02-28 02:38:18 +00:00
sta updatethumb_which_ctl
2017-10-12 15:04:27 +00:00
jsr L5C54
2018-02-16 03:12:59 +00:00
lda updatethumb_stash
: rts
2017-10-12 15:04:27 +00:00
2017-12-31 20:32:47 +00:00
.byte 0
2018-02-17 07:08:39 +00:00
.endproc
.proc L58C3
lda active_window_id
2018-01-21 03:02:34 +00:00
jsr window_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$06
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tax
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
pha
ldy #$04
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
and #$01
clc
ror a
ror a
tay
pla
rts
2018-02-17 07:08:39 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-02-17 07:08:39 +00:00
.proc L58E2
lda active_window_id
2018-01-21 03:02:34 +00:00
jsr window_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$08
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tax
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
pha
ldy #$05
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
and #$01
clc
ror a
ror a
tay
pla
rts
2018-02-17 07:08:39 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 07:10:37 +00:00
2018-01-20 05:57:58 +00:00
.proc cmd_check_drives
2018-02-16 21:27:31 +00:00
lda #0
sta pending_alert
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_TO_BUF
2018-01-19 05:57:25 +00:00
jsr cmd_close_all
2018-01-20 18:57:25 +00:00
jsr clear_selection
2018-02-08 05:48:19 +00:00
ldx cached_window_icon_count
2017-10-12 15:04:27 +00:00
dex
2018-02-08 05:48:19 +00:00
L5916: lda cached_window_icon_list,x
2018-02-09 05:42:59 +00:00
cmp trash_icon_num
2017-10-12 15:04:27 +00:00
beq L5942
txa
pha
2018-02-08 05:48:19 +00:00
lda cached_window_icon_list,x
2018-02-15 16:08:59 +00:00
sta icon_param
2017-10-12 15:04:27 +00:00
lda #$00
2018-02-08 05:48:19 +00:00
sta cached_window_icon_list,x
2018-02-15 16:08:59 +00:00
DESKTOP_RELAY_CALL $04, icon_param
lda icon_param
2018-02-08 05:36:53 +00:00
jsr DESKTOP_FREE_ICON
2018-02-08 05:48:19 +00:00
dec cached_window_icon_count
2018-01-15 05:23:48 +00:00
dec LDD9E
2017-10-12 15:04:27 +00:00
pla
tax
L5942: dex
bpl L5916
ldy #$00
sty L599E
L594A: ldy L599E
2018-02-08 05:48:19 +00:00
inc cached_window_icon_count
2018-01-15 05:23:48 +00:00
inc LDD9E
2017-10-12 15:04:27 +00:00
lda #$00
2018-02-15 16:08:59 +00:00
sta devlst_copy,y
2018-01-15 04:55:54 +00:00
lda DEVLST,y
jsr get_device_info
2017-10-12 15:04:27 +00:00
cmp #$57
bne L5967
2018-02-16 21:27:31 +00:00
lda #$F9 ; "... 2 volumes with the same name..."
sta pending_alert
2017-10-12 15:04:27 +00:00
L5967: inc L599E
lda L599E
2018-01-15 04:55:54 +00:00
cmp DEVCNT
2017-10-12 15:04:27 +00:00
beq L594A
bcc L594A
ldx #$00
2018-02-08 05:48:19 +00:00
L5976: cpx cached_window_icon_count
2017-10-12 15:04:27 +00:00
bne L5986
2018-02-16 21:27:31 +00:00
lda pending_alert
2017-10-12 15:04:27 +00:00
beq L5983
jsr DESKTOP_SHOW_ALERT0
L5983: jmp DESKTOP_COPY_FROM_BUF
2017-10-12 15:04:27 +00:00
L5986: txa
pha
2018-02-08 05:48:19 +00:00
lda cached_window_icon_list,x
2018-02-09 05:42:59 +00:00
cmp trash_icon_num
2017-10-12 15:04:27 +00:00
beq L5998
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2017-10-12 15:04:27 +00:00
ldy #$01
2017-12-31 02:02:15 +00:00
jsr DESKTOP_RELAY
2017-10-12 15:04:27 +00:00
L5998: pla
tax
inx
jmp L5976
2018-01-20 05:57:58 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2017-12-31 20:32:47 +00:00
L599E: .byte 0
2018-02-16 21:27:31 +00:00
pending_alert:
.byte 0
2017-10-12 15:04:27 +00:00
L59A0: lda #$00
beq L59AA
2018-02-17 07:08:39 +00:00
2017-10-12 15:04:27 +00:00
L59A4: lda #$80
bne L59AA
2018-02-17 07:08:39 +00:00
2017-10-12 15:04:27 +00:00
L59A8: lda #$C0
2018-02-17 07:08:39 +00:00
.proc L59AA
sta L5AD0
2017-10-12 15:04:27 +00:00
lda #$00
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_TO_BUF
2017-10-12 15:04:27 +00:00
bit L5AD0
bpl L59EA
bvc L59D2
lda L533F
ldy #$0F
2018-02-15 16:08:59 +00:00
L59C1: cmp devlst_copy,y
2017-10-12 15:04:27 +00:00
beq L59C9
dey
bpl L59C1
L59C9: sty L5AC6
2018-02-06 23:36:39 +00:00
sty menu_click_params::item_num
2017-10-12 15:04:27 +00:00
jmp L59F3
2018-01-15 04:55:54 +00:00
L59D2: ldy DEVCNT
2017-10-12 15:04:27 +00:00
lda L533F
2018-01-15 04:55:54 +00:00
L59D8: cmp DEVLST,y
2017-10-12 15:04:27 +00:00
beq L59E1
dey
bpl L59D8
iny
L59E1: sty L5AC6
2018-02-06 23:36:39 +00:00
sty menu_click_params::item_num
2017-10-12 15:04:27 +00:00
jmp L59F3
2018-02-06 23:36:39 +00:00
L59EA: lda menu_click_params::item_num
2017-10-12 15:04:27 +00:00
sec
sbc #$03
2018-02-06 23:36:39 +00:00
sta menu_click_params::item_num
L59F3: ldy menu_click_params::item_num
2018-02-15 16:08:59 +00:00
lda devlst_copy,y
2017-10-12 15:04:27 +00:00
bne L59FE
jmp L5A4C
2018-02-09 05:42:59 +00:00
L59FE: jsr icon_entry_lookup
2018-03-05 05:52:38 +00:00
addax #9, $06
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tay
2018-01-17 15:41:23 +00:00
L5A10: lda ($06),y
2017-10-12 15:04:27 +00:00
sta $1F00,y
dey
bpl L5A10
dec $1F00
lda #$2F
sta $1F01
2018-02-05 04:21:34 +00:00
ldax #$1F00
2017-10-12 15:04:27 +00:00
ldy $1F00
jsr L6FB7
lda L704B
beq L5A4C
L5A2F: ldx L704B
beq L5A4C
dex
lda L704C,x
2018-02-03 04:41:42 +00:00
cmp active_window_id
2017-10-12 15:04:27 +00:00
beq L5A43
2018-02-28 02:38:18 +00:00
sta findwindow_window_id
2018-01-28 16:08:39 +00:00
jsr handle_inactive_window_click
2018-02-12 01:21:37 +00:00
L5A43: jsr close_window
2017-10-12 15:04:27 +00:00
dec L704B
jmp L5A2F
2018-01-21 16:37:01 +00:00
L5A4C: jsr redraw_windows_and_desktop
2018-01-20 18:57:25 +00:00
jsr clear_selection
2017-10-12 15:04:27 +00:00
lda #$00
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_TO_BUF
2018-02-06 23:36:39 +00:00
lda menu_click_params::item_num
2017-10-12 15:04:27 +00:00
tay
pha
2018-02-15 16:08:59 +00:00
lda devlst_copy,y
sta icon_param
2017-10-12 15:04:27 +00:00
beq L5A7F
2018-02-18 01:15:27 +00:00
jsr remove_icon_from_window
2018-01-15 05:23:48 +00:00
dec LDD9E
2018-02-15 16:08:59 +00:00
lda icon_param
2018-02-08 05:36:53 +00:00
jsr DESKTOP_FREE_ICON
2018-01-30 16:57:36 +00:00
jsr reset_grafport3
2018-02-15 16:08:59 +00:00
DESKTOP_RELAY_CALL $04, icon_param
2018-02-08 05:48:19 +00:00
L5A7F: lda cached_window_icon_count
2017-10-12 15:04:27 +00:00
sta L5AC6
2018-02-08 05:48:19 +00:00
inc cached_window_icon_count
2018-01-15 05:23:48 +00:00
inc LDD9E
2017-10-12 15:04:27 +00:00
pla
tay
2018-01-15 04:55:54 +00:00
lda DEVLST,y
jsr get_device_info
2017-10-12 15:04:27 +00:00
bit L5AD0
bmi L5AA9
and #$FF
beq L5AA9
cmp #$2F
beq L5AA9
pha
jsr DESKTOP_COPY_FROM_BUF
2017-10-12 15:04:27 +00:00
pla
jsr DESKTOP_SHOW_ALERT0
2017-10-12 15:04:27 +00:00
rts
2018-02-08 05:48:19 +00:00
L5AA9: lda cached_window_icon_count
2017-10-12 15:04:27 +00:00
cmp L5AC6
beq L5AC0
2018-02-08 05:48:19 +00:00
ldx cached_window_icon_count
2017-10-12 15:04:27 +00:00
dex
2018-02-08 05:48:19 +00:00
lda cached_window_icon_list,x
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2017-10-12 15:04:27 +00:00
ldy #$01
2017-12-31 02:02:15 +00:00
jsr DESKTOP_RELAY
L5AC0: jsr DESKTOP_COPY_FROM_BUF
2018-01-21 16:37:01 +00:00
jmp redraw_windows_and_desktop
2017-10-12 15:04:27 +00:00
2017-12-31 20:32:47 +00:00
L5AC6: .res 10, 0
L5AD0: .byte 0
2018-02-17 07:08:39 +00:00
.endproc
2018-01-19 07:10:37 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-20 05:57:58 +00:00
.proc cmd_startup_item
2018-02-06 23:36:39 +00:00
ldx menu_click_params::item_num
2017-10-12 15:04:27 +00:00
dex
txa
asl a
asl a
asl a
clc
2018-01-13 03:06:55 +00:00
adc #6
2017-10-12 15:04:27 +00:00
tax
2018-02-12 07:54:09 +00:00
lda startup_menu_item_1,x
2017-10-12 15:04:27 +00:00
sec
sbc #$30
clc
2018-01-20 05:57:58 +00:00
adc #>$C000 ; compute $Cn00
sta reset_and_invoke_target+1
lda #<$0000
sta reset_and_invoke_target
;; fall through
.endproc
2018-01-19 07:10:37 +00:00
;; also invoked by launcher code
2018-01-20 05:57:58 +00:00
.proc reset_and_invoke
sta ALTZPOFF
2017-12-31 20:04:22 +00:00
lda ROMIN2
2017-12-31 02:02:15 +00:00
jsr SETVID
jsr SETKBD
jsr INIT
jsr HOME
2017-12-31 20:04:22 +00:00
sta TXTSET
sta LOWSCR
sta LORES
sta MIXCLR
sta DHIRESOFF
sta CLRALTCHAR
sta CLR80VID
sta CLR80COL
2018-01-05 04:27:15 +00:00
2018-01-19 07:10:37 +00:00
;; also used by launcher code
2018-01-20 05:57:58 +00:00
target := *+1
2018-01-17 03:36:54 +00:00
jmp dummy0000 ; self-modified
2018-01-20 05:57:58 +00:00
.endproc
reset_and_invoke_target := reset_and_invoke::target
2018-01-05 04:27:15 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 07:10:37 +00:00
2017-12-31 20:32:47 +00:00
L5B1B: .byte 0
2018-02-03 04:41:42 +00:00
.proc handle_client_click
lda active_window_id
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_TO_BUF
2018-02-03 04:41:42 +00:00
ldx active_window_id
2017-10-12 15:04:27 +00:00
dex
2018-02-03 03:38:35 +00:00
lda win_buf_table,x
2017-10-12 15:04:27 +00:00
sta L5B1B
2018-02-10 06:59:05 +00:00
;; Restore event coords (following detect_double_click)
ldx #3
: lda saved_event_coords,x
2018-02-28 02:38:18 +00:00
sta event_coords,x
2017-10-12 15:04:27 +00:00
dex
2018-02-10 06:59:05 +00:00
bpl :-
2018-02-28 02:38:18 +00:00
MGTK_RELAY_CALL MGTK::FindControl, event_coords
2018-02-02 06:04:23 +00:00
lda findcontrol_which_ctl
2018-02-03 05:11:49 +00:00
bne :+
jmp handle_content_click ; 0 = ctl_not_a_control
: bit double_click_flag
2018-02-03 04:41:42 +00:00
bmi :+
jmp done_client_click ; ignore double click
: cmp #MGTK::ctl_dead_zone
bne :+
2017-10-12 15:04:27 +00:00
rts
2018-02-03 04:41:42 +00:00
: cmp #MGTK::ctl_vertical_scroll_bar
bne horiz
2017-10-12 15:04:27 +00:00
2018-02-03 04:41:42 +00:00
;; Vertical scrollbar
lda active_window_id
2018-01-21 03:02:34 +00:00
jsr window_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$05
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
and #$01
2018-02-03 04:41:42 +00:00
bne :+
jmp done_client_click
: jsr L5803
2018-03-05 05:33:56 +00:00
lda findcontrol_which_part
2018-02-03 04:41:42 +00:00
cmp #MGTK::part_thumb
bne :+
jsr do_track_thumb
jmp done_client_click
2017-10-12 15:04:27 +00:00
2018-02-03 04:41:42 +00:00
: cmp #MGTK::part_up_arrow
bne :+
up: jsr scroll_up
2018-02-03 05:11:49 +00:00
lda #MGTK::part_up_arrow
jsr check_control_repeat
2018-02-03 04:41:42 +00:00
bpl up
jmp done_client_click
2017-10-12 15:04:27 +00:00
2018-02-03 04:41:42 +00:00
: cmp #MGTK::part_down_arrow
bne :+
down: jsr scroll_down
2018-02-03 05:11:49 +00:00
lda #MGTK::part_down_arrow
jsr check_control_repeat
2018-02-03 04:41:42 +00:00
bpl down
jmp done_client_click
2017-10-12 15:04:27 +00:00
2018-02-03 04:41:42 +00:00
: cmp #MGTK::part_page_down
beq pgdn
pgup: jsr L638C
2018-02-03 05:11:49 +00:00
lda #MGTK::part_page_up
jsr check_control_repeat
2018-02-03 04:41:42 +00:00
bpl pgup
jmp done_client_click
2017-10-12 15:04:27 +00:00
2018-02-03 04:41:42 +00:00
pgdn: jsr L63EC
2018-02-03 05:11:49 +00:00
lda #MGTK::part_page_down
jsr check_control_repeat
2018-02-03 04:41:42 +00:00
bpl pgdn
jmp done_client_click
2017-10-12 15:04:27 +00:00
2018-02-03 04:41:42 +00:00
;; Horizontal scrollbar
horiz: lda active_window_id
2018-01-21 03:02:34 +00:00
jsr window_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$04
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
and #$01
2018-02-03 04:41:42 +00:00
bne :+
jmp done_client_click
: jsr L5803
2018-03-05 05:33:56 +00:00
lda findcontrol_which_part
2018-02-03 04:41:42 +00:00
cmp #MGTK::part_thumb
bne :+
jsr do_track_thumb
jmp done_client_click
2017-10-12 15:04:27 +00:00
2018-02-03 04:41:42 +00:00
: cmp #MGTK::part_left_arrow
bne :+
left: jsr scroll_left
2018-02-03 05:11:49 +00:00
lda #MGTK::part_left_arrow
jsr check_control_repeat
2018-02-03 04:41:42 +00:00
bpl left
jmp done_client_click
2017-10-12 15:04:27 +00:00
2018-02-03 04:41:42 +00:00
: cmp #MGTK::part_right_arrow
bne :+
rght: jsr scroll_right
2018-02-03 05:11:49 +00:00
lda #MGTK::part_right_arrow
jsr check_control_repeat
2018-02-03 04:41:42 +00:00
bpl rght
jmp done_client_click
2017-10-12 15:04:27 +00:00
2018-02-03 04:41:42 +00:00
: cmp #MGTK::part_page_right
beq pgrt
pglt: jsr L6451
2018-02-03 05:11:49 +00:00
lda #MGTK::part_page_left
jsr check_control_repeat
2018-02-03 04:41:42 +00:00
bpl pglt
jmp done_client_click
2017-10-12 15:04:27 +00:00
2018-02-03 04:41:42 +00:00
pgrt: jsr L64B0
2018-02-03 05:11:49 +00:00
lda #MGTK::part_page_right
jsr check_control_repeat
2018-02-03 04:41:42 +00:00
bpl pgrt
jmp done_client_click
done_client_click:
jsr DESKTOP_COPY_FROM_BUF
2017-10-12 15:04:27 +00:00
lda #$00
2018-02-08 05:48:19 +00:00
sta cached_window_id
jmp DESKTOP_COPY_TO_BUF
2018-02-03 04:41:42 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-03 04:41:42 +00:00
.proc do_track_thumb
2018-02-15 16:08:59 +00:00
lda findcontrol_which_ctl
2018-02-03 03:38:35 +00:00
sta trackthumb_which_ctl
MGTK_RELAY_CALL MGTK::TrackThumb, trackthumb_params
lda trackthumb_thumbmoved
2018-02-03 04:41:42 +00:00
bne :+
2017-10-12 15:04:27 +00:00
rts
2018-02-03 04:41:42 +00:00
: jsr L5C54
jsr DESKTOP_COPY_FROM_BUF
2017-10-12 15:04:27 +00:00
lda #$00
2018-02-08 05:48:19 +00:00
sta cached_window_id
jmp DESKTOP_COPY_TO_BUF
2018-02-03 04:41:42 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-12 01:21:37 +00:00
.proc L5C54
2018-02-16 03:12:59 +00:00
lda updatethumb_stash
2018-02-28 02:38:18 +00:00
sta updatethumb_thumbpos
2018-02-03 03:38:35 +00:00
MGTK_RELAY_CALL MGTK::UpdateThumb, updatethumb_params
2017-10-12 15:04:27 +00:00
jsr L6523
jsr L84D1
bit L5B1B
2018-02-12 01:21:37 +00:00
bmi :+
2018-02-14 03:15:45 +00:00
jsr cached_icons_screen_to_window
2018-02-12 01:21:37 +00:00
: lda active_window_id
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2018-02-12 01:21:37 +00:00
jsr get_set_port2
MGTK_RELAY_CALL MGTK::PaintRect, grafport2::cliprect
2018-01-30 16:57:36 +00:00
jsr reset_grafport3
2017-10-12 15:04:27 +00:00
jmp L6C19
2018-02-12 01:21:37 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-03 05:11:49 +00:00
;;; Handle mouse held down on scroll arrow/pager
.proc check_control_repeat
sta ctl
2018-02-03 04:41:42 +00:00
jsr peek_event
2018-02-28 02:38:18 +00:00
lda event_kind
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_drag
2018-02-03 05:11:49 +00:00
beq :+
2018-02-16 03:29:05 +00:00
bail: return #$FF ; high bit set = not repeating
2017-10-12 15:04:27 +00:00
2018-02-28 02:38:18 +00:00
: MGTK_RELAY_CALL MGTK::FindControl, event_coords
2018-02-02 06:04:23 +00:00
lda findcontrol_which_ctl
2018-02-03 05:11:49 +00:00
beq bail
cmp #MGTK::ctl_dead_zone
beq bail
lda findcontrol_which_part
cmp ctl
bne bail
2018-02-16 03:29:05 +00:00
return #0 ; high bit set = repeating
2017-10-12 15:04:27 +00:00
2018-02-03 05:11:49 +00:00
ctl: .byte 0
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-03 05:11:49 +00:00
.proc handle_content_click
bit L5B1B
bpl :+
2018-01-20 18:57:25 +00:00
jmp clear_selection
2017-10-12 15:04:27 +00:00
2018-02-03 05:11:49 +00:00
: lda active_window_id
2018-03-05 05:33:56 +00:00
sta findicon_window_id
DESKTOP_RELAY_CALL DT_FIND_ICON, findicon_params
2018-02-05 03:13:21 +00:00
lda findicon_which_icon
2017-10-12 15:04:27 +00:00
bne L5CDA
jsr L5F13
jmp L5DEC
2018-02-03 05:11:49 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-03 05:11:49 +00:00
2017-10-12 15:04:27 +00:00
2017-12-31 20:32:47 +00:00
L5CD9: .byte 0
2018-02-17 07:08:39 +00:00
.proc L5CDA
sta L5CD9
2018-02-19 19:33:13 +00:00
ldx selected_icon_count
2017-10-12 15:04:27 +00:00
beq L5CFB
dex
lda L5CD9
2018-02-19 19:33:13 +00:00
L5CE6: cmp selected_icon_list,x
2017-10-12 15:04:27 +00:00
beq L5CF0
dex
bpl L5CE6
bmi L5CFB
2018-01-28 16:08:39 +00:00
L5CF0: bit double_click_flag
2017-10-12 15:04:27 +00:00
bmi L5CF8
2018-01-21 01:16:31 +00:00
jmp L5DFC
2017-10-12 15:04:27 +00:00
L5CF8: jmp L5D55
2017-12-31 20:04:22 +00:00
L5CFB: bit BUTN0
2017-10-12 15:04:27 +00:00
bpl L5D08
lda selected_window_index
2018-02-03 04:41:42 +00:00
cmp active_window_id
2017-10-12 15:04:27 +00:00
beq L5D0B
2018-01-20 18:57:25 +00:00
L5D08: jsr clear_selection
2018-02-19 19:33:13 +00:00
L5D0B: ldx selected_icon_count
2017-10-12 15:04:27 +00:00
lda L5CD9
2018-02-19 19:33:13 +00:00
sta selected_icon_list,x
inc selected_icon_count
2018-02-03 04:41:42 +00:00
lda active_window_id
sta selected_window_index
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2018-02-12 01:21:37 +00:00
jsr get_set_port2
2017-10-12 15:04:27 +00:00
lda L5CD9
2018-02-15 16:08:59 +00:00
sta icon_param
2018-02-13 16:18:11 +00:00
jsr icon_window_to_screen
2018-02-14 02:53:02 +00:00
jsr offset_grafport2_and_set
2018-02-15 16:08:59 +00:00
DESKTOP_RELAY_CALL DT_HIGHLIGHT_ICON, icon_param
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2018-02-12 01:21:37 +00:00
jsr get_set_port2
2017-10-12 15:04:27 +00:00
lda L5CD9
2018-02-13 16:18:11 +00:00
jsr icon_screen_to_window
2018-01-30 16:57:36 +00:00
jsr reset_grafport3
2018-01-28 16:08:39 +00:00
bit double_click_flag
2017-10-12 15:04:27 +00:00
bmi L5D55
2018-01-21 01:16:31 +00:00
jmp L5DFC
2017-10-12 15:04:27 +00:00
L5D55: lda L5CD9
2018-01-24 23:39:12 +00:00
sta LEBFC
DESKTOP_RELAY_CALL $0A, LEBFC
2017-10-12 15:04:27 +00:00
tax
2018-01-24 23:39:12 +00:00
lda LEBFC
2017-10-12 15:04:27 +00:00
beq L5DA6
jsr L8F00
cmp #$FF
bne L5D77
jsr L5DEC
2018-01-21 16:37:01 +00:00
jmp redraw_windows_and_desktop
2017-10-12 15:04:27 +00:00
2018-01-24 23:39:12 +00:00
L5D77: lda LEBFC
2018-02-09 05:42:59 +00:00
cmp trash_icon_num
2017-10-12 15:04:27 +00:00
bne L5D8E
2018-02-03 04:41:42 +00:00
lda active_window_id
2017-10-12 15:04:27 +00:00
jsr L6F0D
2018-02-03 04:41:42 +00:00
lda active_window_id
2017-10-12 15:04:27 +00:00
jsr L5E78
2018-01-21 16:37:01 +00:00
jmp redraw_windows_and_desktop
2017-10-12 15:04:27 +00:00
2018-01-24 23:39:12 +00:00
L5D8E: lda LEBFC
2017-10-12 15:04:27 +00:00
bmi L5D99
jsr L6A3F
2018-01-21 16:37:01 +00:00
jmp redraw_windows_and_desktop
2017-10-12 15:04:27 +00:00
L5D99: and #$7F
pha
jsr L6F0D
pla
jsr L5E78
2018-01-21 16:37:01 +00:00
jmp redraw_windows_and_desktop
2017-10-12 15:04:27 +00:00
L5DA6: cpx #$02
bne L5DAD
jmp L5DEC
L5DAD: cpx #$FF
beq L5DF7
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2018-02-12 01:21:37 +00:00
jsr get_set_port2
2018-02-14 03:15:45 +00:00
jsr cached_icons_window_to_screen
2018-02-14 02:53:02 +00:00
jsr offset_grafport2_and_set
2018-02-19 19:33:13 +00:00
ldx selected_icon_count
2017-10-12 15:04:27 +00:00
dex
L5DC4: txa
pha
2018-02-19 19:33:13 +00:00
lda selected_icon_list,x
2018-02-05 03:13:21 +00:00
sta LE22E
DESKTOP_RELAY_CALL DT_UNHIGHLIGHT_ICON, LE22E
2017-10-12 15:04:27 +00:00
pla
tax
dex
bpl L5DC4
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2018-02-12 01:21:37 +00:00
jsr get_set_port2
2018-02-14 03:15:45 +00:00
jsr update_scrollbars
jsr cached_icons_screen_to_window
2018-01-30 16:57:36 +00:00
jsr reset_grafport3
L5DEC: jsr DESKTOP_COPY_FROM_BUF
2017-10-12 15:04:27 +00:00
lda #$00
2018-02-08 05:48:19 +00:00
sta cached_window_id
jmp DESKTOP_COPY_TO_BUF
2017-10-12 15:04:27 +00:00
2018-02-15 16:08:59 +00:00
L5DF7: ldx LE256
2017-10-12 15:04:27 +00:00
txs
rts
2018-01-21 00:44:49 +00:00
L5DFC: lda L5CD9 ; after a double-click (on file or folder)
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-02-05 04:35:19 +00:00
stax $06
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-09 05:42:59 +00:00
and #icon_entry_type_mask
cmp #icon_entry_type_sys
2017-10-12 15:04:27 +00:00
beq L5E28
2018-02-09 05:42:59 +00:00
cmp #icon_entry_type_bin
2017-10-12 15:04:27 +00:00
beq L5E28
2018-02-09 05:42:59 +00:00
cmp #icon_entry_type_bas
2017-10-12 15:04:27 +00:00
beq L5E28
2018-02-09 05:42:59 +00:00
cmp #icon_entry_type_dir
2017-10-12 15:04:27 +00:00
bne L5E27
2018-01-26 02:22:33 +00:00
lda L5CD9 ; handle directory
2017-10-12 15:04:27 +00:00
jsr L6A8A
bmi L5E27
jmp L5DEC
L5E27: rts
L5E28: sta L5E77
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-01-21 03:02:34 +00:00
jsr window_address_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tay
2018-01-17 15:41:23 +00:00
L5E3A: lda ($06),y
2018-02-03 03:38:35 +00:00
sta LD355,y
2017-10-12 15:04:27 +00:00
dey
bpl L5E3A
lda L5CD9
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$09
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tax
clc
adc #$09
tay
dex
dey
2018-01-17 15:41:23 +00:00
L5E57: lda ($06),y
2018-01-24 05:52:53 +00:00
sta LD343+1,x
2017-10-12 15:04:27 +00:00
dey
dex
bne L5E57
ldy #$09
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tax
dex
dex
2018-03-05 05:33:56 +00:00
stx buf_filename2
2017-10-12 15:04:27 +00:00
lda L5E77
cmp #$20
bcc L5E74
lda L5E77
2018-01-21 00:44:49 +00:00
L5E74: jmp launch_file ; when double-clicked
2018-02-17 07:08:39 +00:00
.endproc
L5DEC := L5CDA::L5DEC
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2017-12-31 20:32:47 +00:00
L5E77: .byte 0
2018-02-17 07:08:39 +00:00
.proc L5E78
sta L5F0A
2018-01-21 16:37:01 +00:00
jsr redraw_windows_and_desktop
2018-01-20 18:57:25 +00:00
jsr clear_selection
2017-10-12 15:04:27 +00:00
lda L5F0A
2018-02-03 04:41:42 +00:00
cmp active_window_id
2017-10-12 15:04:27 +00:00
beq L5E8F
2018-02-28 02:38:18 +00:00
sta findwindow_window_id
2018-01-28 16:08:39 +00:00
jsr handle_inactive_window_click
2018-02-03 04:41:42 +00:00
L5E8F: lda active_window_id
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2018-02-12 01:21:37 +00:00
jsr get_set_port2
2018-02-03 04:41:42 +00:00
jsr set_penmode_copy
2018-03-02 02:25:42 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, grafport2::cliprect
2018-02-03 04:41:42 +00:00
ldx active_window_id
2017-10-12 15:04:27 +00:00
dex
2018-01-13 03:06:55 +00:00
lda LEC26,x
2017-10-12 15:04:27 +00:00
pha
jsr L7345
lda L5F0A
tax
dex
2018-02-03 03:38:35 +00:00
lda win_buf_table,x
2018-02-12 01:21:37 +00:00
bmi :+
jsr close_active_window
: lda active_window_id
2018-01-21 03:02:34 +00:00
jsr window_address_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tay
2018-01-17 15:41:23 +00:00
L5ECB: lda ($06),y
2018-02-15 16:08:59 +00:00
sta LE1B0,y
2017-10-12 15:04:27 +00:00
dey
bpl L5ECB
pla
jsr L7054
2018-01-20 03:41:20 +00:00
jsr cmd_view_by_icon::L5106
jsr DESKTOP_COPY_FROM_BUF
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_TO_BUF
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2018-02-12 01:21:37 +00:00
jsr get_port2
2018-02-10 06:10:11 +00:00
jsr draw_window_header
2017-10-12 15:04:27 +00:00
lda #$00
2018-02-03 04:41:42 +00:00
ldx active_window_id
2018-02-03 03:38:35 +00:00
sta win_buf_table-1,x
2017-10-12 15:04:27 +00:00
lda #$01
2018-02-06 23:36:39 +00:00
sta menu_click_params::item_num
2018-02-03 04:41:42 +00:00
jsr update_view_menu_check
2017-10-12 15:04:27 +00:00
lda #$00
2018-02-08 05:48:19 +00:00
sta cached_window_id
jmp DESKTOP_COPY_TO_BUF
2017-10-12 15:04:27 +00:00
2017-12-31 20:32:47 +00:00
L5F0A: .byte 0
2018-02-17 07:08:39 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-17 07:08:39 +00:00
.proc L5F13_impl
2017-12-31 20:32:47 +00:00
L5F0B: .byte 0
.byte 0
.byte 0
.byte 0
L5F0F: .byte 0
.byte 0
.byte 0
.byte 0
2018-02-17 07:08:39 +00:00
start: copy16 #notpenXOR, $06
2017-10-12 15:04:27 +00:00
jsr L60D5
ldx #$03
2018-02-28 02:38:18 +00:00
L5F20: lda event_coords,x
2017-10-12 15:04:27 +00:00
sta L5F0B,x
sta L5F0F,x
dex
bpl L5F20
2018-02-03 04:41:42 +00:00
jsr peek_event
2018-02-28 02:38:18 +00:00
lda event_kind
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_drag
2017-10-12 15:04:27 +00:00
beq L5F3F
2017-12-31 20:04:22 +00:00
bit BUTN0
2017-10-12 15:04:27 +00:00
bmi L5F3E
2018-01-20 18:57:25 +00:00
jsr clear_selection
2017-10-12 15:04:27 +00:00
L5F3E: rts
2018-01-20 18:57:25 +00:00
L5F3F: jsr clear_selection
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2018-02-12 01:21:37 +00:00
jsr get_port2
2018-02-14 02:53:02 +00:00
jsr offset_grafport2_and_set
2017-10-12 15:04:27 +00:00
ldx #$03
L5F50: lda L5F0B,x
2018-02-06 23:36:39 +00:00
sta rect_E230::x1,x
2017-10-12 15:04:27 +00:00
lda L5F0F,x
2018-02-06 23:36:39 +00:00
sta rect_E230::x2,x
2017-10-12 15:04:27 +00:00
dex
bpl L5F50
2018-02-03 04:41:42 +00:00
jsr set_penmode_xor
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::FrameRect, rect_E230
2018-02-03 04:41:42 +00:00
L5F6B: jsr peek_event
2018-02-28 02:38:18 +00:00
lda event_kind
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_drag
2017-10-12 15:04:27 +00:00
beq L5FC5
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::FrameRect, rect_E230
2017-10-12 15:04:27 +00:00
ldx #$00
2018-02-08 05:48:19 +00:00
L5F80: cpx cached_window_icon_count
2017-10-12 15:04:27 +00:00
bne L5F88
2018-01-30 16:57:36 +00:00
jmp reset_grafport3
2017-10-12 15:04:27 +00:00
L5F88: txa
pha
2018-02-08 05:48:19 +00:00
lda cached_window_icon_list,x
2018-02-15 16:08:59 +00:00
sta icon_param
2018-02-13 16:18:11 +00:00
jsr icon_window_to_screen
2018-02-15 16:08:59 +00:00
DESKTOP_RELAY_CALL DT_ICON_IN_RECT, icon_param
2017-10-12 15:04:27 +00:00
beq L5FB9
2018-02-15 16:08:59 +00:00
DESKTOP_RELAY_CALL DT_HIGHLIGHT_ICON, icon_param
2018-02-19 19:33:13 +00:00
ldx selected_icon_count
inc selected_icon_count
2018-02-15 16:08:59 +00:00
lda icon_param
2018-02-19 19:33:13 +00:00
sta selected_icon_list,x
2018-02-03 04:41:42 +00:00
lda active_window_id
sta selected_window_index
2018-02-15 16:08:59 +00:00
L5FB9: lda icon_param
2018-02-13 16:18:11 +00:00
jsr icon_screen_to_window
2017-10-12 15:04:27 +00:00
pla
tax
inx
jmp L5F80
L5FC5: jsr L60D5
2018-02-28 02:38:18 +00:00
sub16 event_xcoord, L60CF, L60CB
sub16 event_ycoord, L60D1, L60CD
2017-10-12 15:04:27 +00:00
lda L60CC
bpl L5FFE
lda L60CB
eor #$FF
sta L60CB
inc L60CB
L5FFE: lda L60CE
bpl L600E
lda L60CD
eor #$FF
sta L60CD
inc L60CD
L600E: lda L60CB
cmp #$05
bcs L601F
lda L60CD
cmp #$05
bcs L601F
jmp L5F6B
2018-01-29 05:18:00 +00:00
L601F: MGTK_RELAY_CALL MGTK::FrameRect, rect_E230
2017-10-12 15:04:27 +00:00
ldx #$03
2018-02-28 02:38:18 +00:00
L602A: lda event_coords,x
2017-10-12 15:04:27 +00:00
sta L60CF,x
dex
bpl L602A
2018-02-28 02:38:18 +00:00
cmp16 event_xcoord, rect_E230::x2
2017-10-12 15:04:27 +00:00
bpl L6068
2018-02-28 02:38:18 +00:00
cmp16 event_xcoord, rect_E230::x1
2017-10-12 15:04:27 +00:00
bmi L6054
bit L60D3
bpl L6068
2018-02-28 02:38:18 +00:00
L6054: copy16 event_xcoord, rect_E230::x1
2017-10-12 15:04:27 +00:00
lda #$80
sta L60D3
jmp L6079
2018-02-28 02:38:18 +00:00
L6068: copy16 event_xcoord, rect_E230::x2
2017-10-12 15:04:27 +00:00
lda #$00
sta L60D3
2018-02-28 02:38:18 +00:00
L6079: cmp16 event_ycoord, rect_E230::y2
2017-10-12 15:04:27 +00:00
bpl L60AE
2018-02-28 02:38:18 +00:00
cmp16 event_ycoord, rect_E230::y1
2017-10-12 15:04:27 +00:00
bmi L609A
bit L60D4
bpl L60AE
2018-02-28 02:38:18 +00:00
L609A: copy16 event_ycoord, rect_E230::y1
2017-10-12 15:04:27 +00:00
lda #$80
sta L60D4
jmp L60BF
2018-02-28 02:38:18 +00:00
L60AE: copy16 event_ycoord, rect_E230::y2
2017-10-12 15:04:27 +00:00
lda #$00
sta L60D4
2018-01-29 05:18:00 +00:00
L60BF: MGTK_RELAY_CALL MGTK::FrameRect, rect_E230
2017-10-12 15:04:27 +00:00
jmp L5F6B
2017-12-31 20:32:47 +00:00
L60CB: .byte 0
L60CC: .byte 0
L60CD: .byte 0
L60CE: .byte 0
2018-02-05 04:46:26 +00:00
L60CF: .word 0
L60D1: .word 0
2017-12-31 20:32:47 +00:00
L60D3: .byte 0
L60D4: .byte 0
2018-02-17 07:08:39 +00:00
2018-01-11 06:31:02 +00:00
L60D5: jsr push_zp_addrs
2018-02-13 16:18:11 +00:00
jmp icon_ptr_window_to_screen
2018-02-17 07:08:39 +00:00
.endproc
L5F13 := L5F13_impl::start
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-12 01:21:37 +00:00
.proc handle_title_click
2018-01-26 02:22:33 +00:00
jmp L60DE
2017-10-12 15:04:27 +00:00
2018-02-03 04:41:42 +00:00
L60DE: lda active_window_id
2018-01-30 16:57:36 +00:00
sta event_params
2018-02-03 04:41:42 +00:00
MGTK_RELAY_CALL MGTK::FrontWindow, active_window_id
lda active_window_id
2018-02-18 01:15:27 +00:00
jsr copy_window_portbits
2018-01-30 16:57:36 +00:00
MGTK_RELAY_CALL MGTK::DragWindow, event_params
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-01-21 03:02:34 +00:00
jsr window_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$16
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
cmp #$19
bcs L6112
lda #$19
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
L6112: ldy #$14
2018-02-18 01:15:27 +00:00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
sec
2018-02-18 01:15:27 +00:00
sbc port_copy+MGTK::grafport_offset_viewloc_xcoord
2017-10-12 15:04:27 +00:00
sta L6197
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-18 01:15:27 +00:00
sbc port_copy+MGTK::grafport_offset_viewloc_xcoord+1
sta L6197+1
2017-10-12 15:04:27 +00:00
iny
2018-02-18 01:15:27 +00:00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
sec
2018-02-18 01:15:27 +00:00
sbc port_copy+MGTK::grafport_offset_viewloc_ycoord
2017-10-12 15:04:27 +00:00
sta L6199
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-18 01:15:27 +00:00
sbc port_copy+MGTK::grafport_offset_viewloc_ycoord+1
sta L6199+1
2018-02-03 04:41:42 +00:00
ldx active_window_id
2017-10-12 15:04:27 +00:00
dex
2018-02-03 03:38:35 +00:00
lda win_buf_table,x
2017-10-12 15:04:27 +00:00
beq L6143
2017-12-31 02:02:15 +00:00
rts
2017-10-12 15:04:27 +00:00
2018-02-03 04:41:42 +00:00
L6143: lda active_window_id
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_TO_BUF
2017-10-12 15:04:27 +00:00
ldx #$00
2018-02-08 05:48:19 +00:00
L614E: cpx cached_window_icon_count
2017-10-12 15:04:27 +00:00
bne L6161
jsr DESKTOP_COPY_FROM_BUF
2017-10-12 15:04:27 +00:00
lda #$00
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_TO_BUF
2017-10-12 15:04:27 +00:00
jmp L6196
L6161: txa
pha
2018-02-08 05:48:19 +00:00
lda cached_window_icon_list,x
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$03
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
clc
adc L6197
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
adc L6198
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
clc
adc L6199
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
adc L619A
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
pla
tax
inx
jmp L614E
L6196: rts
2017-12-31 20:32:47 +00:00
L6197: .byte 0
L6198: .byte 0
L6199: .byte 0
L619A: .byte 0
2018-01-26 02:22:33 +00:00
2018-02-12 01:21:37 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-12 01:21:37 +00:00
.proc handle_resize_click
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-01-30 16:57:36 +00:00
sta event_params
MGTK_RELAY_CALL MGTK::GrowWindow, event_params
2018-01-21 16:37:01 +00:00
jsr redraw_windows_and_desktop
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_TO_BUF
2018-02-14 03:15:45 +00:00
jsr cached_icons_window_to_screen
jsr update_scrollbars
jsr cached_icons_screen_to_window
2017-10-12 15:04:27 +00:00
lda #$00
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_TO_BUF
2018-01-30 16:57:36 +00:00
jmp reset_grafport3
2018-02-12 01:21:37 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-01-26 02:22:33 +00:00
handle_close_click:
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-01-30 16:57:36 +00:00
MGTK_RELAY_CALL MGTK::TrackGoAway, trackgoaway_params
lda trackgoaway_params::goaway
2018-02-12 01:21:37 +00:00
bne close_window
2017-10-12 15:04:27 +00:00
rts
2018-02-12 01:21:37 +00:00
.proc close_window
lda active_window_id
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_TO_BUF
2018-01-20 18:57:25 +00:00
jsr clear_selection
2018-02-03 04:41:42 +00:00
ldx active_window_id
2017-10-12 15:04:27 +00:00
dex
2018-02-03 03:38:35 +00:00
lda win_buf_table,x
2017-10-12 15:04:27 +00:00
bmi L6215
2018-01-15 05:23:48 +00:00
lda LDD9E
2017-10-12 15:04:27 +00:00
sec
2018-02-08 05:48:19 +00:00
sbc cached_window_icon_count
2018-01-15 05:23:48 +00:00
sta LDD9E
2018-02-05 03:13:21 +00:00
DESKTOP_RELAY_CALL DT_CLOSE_WINDOW, active_window_id
2017-10-12 15:04:27 +00:00
ldx #$00
2018-02-08 05:48:19 +00:00
L6206: cpx cached_window_icon_count
2017-10-12 15:04:27 +00:00
beq L6215
2018-02-08 05:48:19 +00:00
lda cached_window_icon_list,x
2018-02-08 05:36:53 +00:00
jsr DESKTOP_FREE_ICON
2017-10-12 15:04:27 +00:00
inx
jmp L6206
2018-02-15 16:08:59 +00:00
L6215: dec LEC2E
2017-10-12 15:04:27 +00:00
ldx #$00
txa
2018-02-08 05:48:19 +00:00
L621B: sta cached_window_icon_list,x
cpx cached_window_icon_count
2017-10-12 15:04:27 +00:00
beq L6227
inx
jmp L621B
2018-02-08 05:48:19 +00:00
L6227: sta cached_window_icon_count
jsr DESKTOP_COPY_FROM_BUF
2018-02-03 04:41:42 +00:00
MGTK_RELAY_CALL MGTK::CloseWindow, active_window_id
ldx active_window_id
2017-10-12 15:04:27 +00:00
dex
2018-01-13 03:06:55 +00:00
lda LEC26,x
2018-02-15 16:08:59 +00:00
sta icon_param
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$01
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
and #$0F
beq L6276
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-09 05:42:59 +00:00
and #(~icon_entry_open_mask)&$FF ; clear open_flag
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
and #$0F
sta selected_window_index
2018-02-18 01:15:27 +00:00
jsr zero_grafport5_coords
2018-02-15 16:08:59 +00:00
DESKTOP_RELAY_CALL DT_HIGHLIGHT_ICON, icon_param
2018-01-30 16:57:36 +00:00
jsr reset_grafport3
2017-10-12 15:04:27 +00:00
lda #$01
2018-02-19 19:33:13 +00:00
sta selected_icon_count
2018-02-15 16:08:59 +00:00
lda icon_param
2018-02-19 19:33:13 +00:00
sta selected_icon_list
2018-02-03 04:41:42 +00:00
L6276: ldx active_window_id
2017-10-12 15:04:27 +00:00
dex
2018-01-13 03:06:55 +00:00
lda LEC26,x
2017-10-12 15:04:27 +00:00
jsr L7345
2018-02-03 04:41:42 +00:00
ldx active_window_id
2017-10-12 15:04:27 +00:00
dex
2018-01-13 03:06:55 +00:00
lda LEC26,x
2017-10-12 15:04:27 +00:00
inx
jsr L8B5C
2018-02-03 04:41:42 +00:00
ldx active_window_id
2017-10-12 15:04:27 +00:00
dex
lda #$00
2018-01-13 03:06:55 +00:00
sta LEC26,x
2018-02-03 03:38:35 +00:00
sta win_buf_table,x
2018-02-03 04:41:42 +00:00
MGTK_RELAY_CALL MGTK::FrontWindow, active_window_id
2017-10-12 15:04:27 +00:00
lda #$00
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_TO_BUF
2018-02-14 02:53:02 +00:00
lda #MGTK::checkitem_uncheck
2018-02-01 19:30:03 +00:00
sta checkitem_params::check
MGTK_RELAY_CALL MGTK::CheckItem, checkitem_params
2017-10-12 15:04:27 +00:00
jsr L66A2
2018-01-21 16:37:01 +00:00
jmp redraw_windows_and_desktop
2018-02-12 01:21:37 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-12 01:21:37 +00:00
.proc L62BC
cmp #$01
2017-10-12 15:04:27 +00:00
bcc L62C2
bne L62C5
2018-02-16 03:29:05 +00:00
L62C2: return #0
2017-10-12 15:04:27 +00:00
L62C5: sta L638B
stx L6386
sty L638A
cmp L6386
bcc L62D5
tya
rts
L62D5: lda #$00
sta L6385
sta L6389
clc
ror L6386
ror L6385
clc
ror L638A
ror L6389
lda #$00
sta L6383
sta L6387
sta L6384
sta L6388
L62F9: lda L6384
cmp L638B
beq L630F
bcc L6309
jsr L6319
jmp L62F9
L6309: jsr L634E
jmp L62F9
L630F: lda L6388
cmp #$01
bcs L6318
lda #$01
L6318: rts
2018-02-06 18:06:44 +00:00
L6319: sub16 L6383, L6385, L6383
sub16 L6387, L6389, L6387
2017-10-12 15:04:27 +00:00
clc
ror L6386
ror L6385
clc
ror L638A
ror L6389
rts
2018-02-06 18:06:44 +00:00
L634E: add16 L6383, L6385, L6383
add16 L6387, L6389, L6387
2017-10-12 15:04:27 +00:00
clc
ror L6386
ror L6385
clc
ror L638A
ror L6389
rts
2017-12-31 20:32:47 +00:00
L6383: .byte 0
L6384: .byte 0
L6385: .byte 0
L6386: .byte 0
L6387: .byte 0
L6388: .byte 0
L6389: .byte 0
L638A: .byte 0
L638B: .byte 0
2018-02-12 01:21:37 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-12 01:21:37 +00:00
2018-02-17 07:08:39 +00:00
.proc L638C
jsr L650F
2017-10-12 15:04:27 +00:00
sty L63E9
jsr L644C
sta L63E8
2018-02-06 23:36:39 +00:00
sub16_8 grafport2::cliprect::y1, L63E8, L63EA
2018-02-06 18:06:44 +00:00
cmp16 L63EA, L7B61
2017-10-12 15:04:27 +00:00
bmi L63C1
2018-02-05 04:21:34 +00:00
ldax L63EA
2017-10-12 15:04:27 +00:00
jmp L63C7
2018-02-05 04:21:34 +00:00
L63C1: ldax L7B61
2018-02-06 04:37:41 +00:00
L63C7: stax grafport2::cliprect::y1
add16_8 grafport2::cliprect::y1, L63E9, grafport2::cliprect::y2
2018-02-17 16:12:19 +00:00
jsr assign_active_window_cliprect
2018-02-14 03:15:45 +00:00
jsr update_scrollbars
2017-10-12 15:04:27 +00:00
jmp L6556
2017-12-31 20:32:47 +00:00
L63E8: .byte 0
L63E9: .byte 0
2018-02-06 23:36:39 +00:00
L63EA: .word 0
2018-02-17 07:08:39 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-17 07:08:39 +00:00
.proc L63EC
jsr L650F
2017-10-12 15:04:27 +00:00
sty L6449
jsr L644C
sta L6448
2018-02-06 04:37:41 +00:00
add16_8 grafport2::cliprect::y2, L6448, L644A
2018-02-06 18:06:44 +00:00
cmp16 L644A, L7B65
2017-10-12 15:04:27 +00:00
bpl L6421
2018-02-05 04:21:34 +00:00
ldax L644A
2017-10-12 15:04:27 +00:00
jmp L6427
2018-02-05 04:21:34 +00:00
L6421: ldax L7B65
2018-02-06 04:37:41 +00:00
L6427: stax grafport2::cliprect::y2
2018-02-06 23:36:39 +00:00
sub16_8 grafport2::cliprect::y2, L6449, grafport2::cliprect::y1
2018-02-17 16:12:19 +00:00
jsr assign_active_window_cliprect
2018-02-14 03:15:45 +00:00
jsr update_scrollbars
2017-10-12 15:04:27 +00:00
jmp L6556
2017-12-31 20:32:47 +00:00
L6448: .byte 0
L6449: .byte 0
2018-02-06 18:10:34 +00:00
L644A: .word 0
2018-02-17 07:08:39 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-06 18:10:34 +00:00
2018-02-17 07:08:39 +00:00
.proc L644C
tya
2017-10-12 15:04:27 +00:00
sec
sbc #$0E
rts
2018-02-17 07:08:39 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-17 07:08:39 +00:00
.proc L6451
jsr L650F
2018-02-05 04:35:19 +00:00
stax L64AC
2018-02-06 18:06:44 +00:00
sub16 grafport2::cliprect::x1, L64AC, L64AE
cmp16 L64AE, L7B5F
2017-10-12 15:04:27 +00:00
bmi L6484
2018-02-05 04:21:34 +00:00
ldax L64AE
2017-10-12 15:04:27 +00:00
jmp L648A
2018-02-05 04:21:34 +00:00
L6484: ldax L7B5F
2018-02-06 04:37:41 +00:00
L648A: stax grafport2::cliprect::x1
2018-02-06 18:06:44 +00:00
add16 grafport2::cliprect::x1, L64AC, grafport2::cliprect::x2
2018-02-17 16:12:19 +00:00
jsr assign_active_window_cliprect
2018-02-14 03:15:45 +00:00
jsr update_scrollbars
2017-10-12 15:04:27 +00:00
jmp L6556
2018-02-06 23:36:39 +00:00
L64AC: .word 0
2018-02-06 18:10:34 +00:00
L64AE: .word 0
2018-02-17 07:08:39 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-06 18:10:34 +00:00
2018-02-17 16:12:19 +00:00
.proc L64B0
jsr L650F
2018-02-05 04:35:19 +00:00
stax L650B
2018-02-06 18:06:44 +00:00
add16 grafport2::cliprect::x2, L650B, L650D
cmp16 L650D, L7B63
2017-10-12 15:04:27 +00:00
bpl L64E3
2018-02-05 04:21:34 +00:00
ldax L650D
2017-10-12 15:04:27 +00:00
jmp L64E9
2018-02-05 04:21:34 +00:00
L64E3: ldax L7B63
2018-02-06 04:37:41 +00:00
L64E9: stax grafport2::cliprect::x2
2018-02-06 18:06:44 +00:00
sub16 grafport2::cliprect::x2, L650B, grafport2::cliprect::x1
2018-02-17 16:12:19 +00:00
jsr assign_active_window_cliprect
2018-02-14 03:15:45 +00:00
jsr update_scrollbars
2017-10-12 15:04:27 +00:00
jmp L6556
2018-02-06 18:10:34 +00:00
L650B: .word 0
L650D: .word 0
2018-02-17 16:12:19 +00:00
.endproc
2018-02-06 18:10:34 +00:00
2018-02-17 16:12:19 +00:00
.proc L650F
bit L5B1B
bmi :+
2018-02-14 03:15:45 +00:00
jsr cached_icons_window_to_screen
2018-02-17 16:12:19 +00:00
: jsr L6523
2017-10-12 15:04:27 +00:00
jsr L7B6B
2018-02-03 04:41:42 +00:00
lda active_window_id
2017-10-12 15:04:27 +00:00
jmp L7D5D
2018-02-17 16:12:19 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-02-17 16:12:19 +00:00
.proc L6523
lda active_window_id
2018-01-21 03:02:34 +00:00
jsr window_lookup
2018-03-05 05:52:38 +00:00
addax #$14, $06
2017-10-12 15:04:27 +00:00
ldy #$25
2018-02-17 16:12:19 +00:00
: lda ($06),y
2018-01-30 16:57:36 +00:00
sta grafport2,y
2017-10-12 15:04:27 +00:00
dey
2018-02-17 16:12:19 +00:00
bpl :-
2017-10-12 15:04:27 +00:00
rts
2018-02-17 16:12:19 +00:00
.endproc
.proc assign_active_window_cliprect
ptr := $6
2017-10-12 15:04:27 +00:00
2018-02-17 16:12:19 +00:00
lda active_window_id
2018-01-21 03:02:34 +00:00
jsr window_lookup
2018-02-17 16:12:19 +00:00
stax ptr
ldy #MGTK::winfo_offset_port + MGTK::grafport_offset_maprect + 7
ldx #7
: lda grafport2::cliprect,x
sta (ptr),y
2017-10-12 15:04:27 +00:00
dey
dex
2018-02-17 16:12:19 +00:00
bpl :-
2017-10-12 15:04:27 +00:00
rts
2018-02-17 16:12:19 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-02-17 16:12:19 +00:00
.proc L6556
bit L5B1B
bmi :+
2018-02-14 03:15:45 +00:00
jsr cached_icons_screen_to_window
2018-03-02 02:25:42 +00:00
: MGTK_RELAY_CALL MGTK::PaintRect, grafport2::cliprect
2018-01-30 16:57:36 +00:00
jsr reset_grafport3
2017-10-12 15:04:27 +00:00
jmp L6C19
2018-02-17 16:12:19 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-14 03:15:45 +00:00
.proc update_hthumb
lda active_window_id
2017-10-12 15:04:27 +00:00
jsr L7D5D
2018-02-05 04:35:19 +00:00
stax L6600
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-01-21 03:02:34 +00:00
jsr window_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$06
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tay
2018-02-06 18:06:44 +00:00
sub16 L7B63, L7B5F, L6602
sub16 L6602, L6600, L6602
2018-02-24 05:12:41 +00:00
lsr16 L6602
2017-10-12 15:04:27 +00:00
ldx L6602
2018-02-06 18:06:44 +00:00
sub16 grafport2::cliprect::x1, L7B5F, L6602
2017-10-12 15:04:27 +00:00
bpl L65D0
lda #$00
beq L65EB
2018-02-06 18:06:44 +00:00
L65D0: cmp16 grafport2::cliprect::x2, L7B63
2017-10-12 15:04:27 +00:00
bmi L65E2
tya
jmp L65EE
2018-02-24 05:12:41 +00:00
L65E2: lsr16 L6602
2017-10-12 15:04:27 +00:00
lda L6602
L65EB: jsr L62BC
2018-01-30 16:57:36 +00:00
L65EE: sta event_params+1
2017-10-12 15:04:27 +00:00
lda #$02
2018-01-30 16:57:36 +00:00
sta event_params
MGTK_RELAY_CALL MGTK::UpdateThumb, event_params
2017-10-12 15:04:27 +00:00
rts
2018-02-05 04:46:26 +00:00
L6600: .word 0
2017-12-31 20:32:47 +00:00
L6602: .byte 0
L6603: .byte 0
2018-02-14 03:15:45 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-14 03:15:45 +00:00
.proc update_vthumb
lda active_window_id
2017-10-12 15:04:27 +00:00
jsr L7D5D
sty L669F
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-01-21 03:02:34 +00:00
jsr window_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$08
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tay
2018-02-06 18:06:44 +00:00
sub16 L7B65, L7B61, L66A0
2018-02-06 23:36:39 +00:00
sub16_8 L66A0, L669F, L66A0
2018-02-24 05:12:41 +00:00
lsr16 L66A0
lsr16 L66A0
2017-10-12 15:04:27 +00:00
ldx L66A0
2018-02-06 18:06:44 +00:00
sub16 grafport2::cliprect::y1, L7B61, L66A0
2017-10-12 15:04:27 +00:00
bpl L6669
lda #$00
beq L668A
2018-02-06 18:06:44 +00:00
L6669: cmp16 grafport2::cliprect::y2, L7B65
2017-10-12 15:04:27 +00:00
bmi L667B
tya
jmp L668D
2018-02-10 06:10:11 +00:00
L667B: lsr16 L66A0
lsr16 L66A0
2017-10-12 15:04:27 +00:00
lda L66A0
L668A: jsr L62BC
2018-01-30 16:57:36 +00:00
L668D: sta event_params+1
2017-10-12 15:04:27 +00:00
lda #$01
2018-01-30 16:57:36 +00:00
sta event_params
MGTK_RELAY_CALL MGTK::UpdateThumb, event_params
2017-10-12 15:04:27 +00:00
rts
2017-12-31 20:32:47 +00:00
L669F: .byte 0
L66A0: .byte 0
L66A1: .byte 0
2018-02-14 03:15:45 +00:00
.endproc
2018-02-12 01:21:37 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-12 01:21:37 +00:00
.proc L66A2
ldx active_window_id
2018-02-14 02:53:02 +00:00
beq disable_menu_items
jmp check_menu_items
2017-10-12 15:04:27 +00:00
2018-02-14 02:53:02 +00:00
disable_menu_items:
lda #MGTK::disablemenu_disable
2018-02-01 19:30:03 +00:00
sta disablemenu_params::disable
MGTK_RELAY_CALL MGTK::DisableMenu, disablemenu_params
2018-02-14 02:53:02 +00:00
lda #MGTK::disableitem_disable
2018-02-01 19:30:03 +00:00
sta disableitem_params::disable
2018-02-14 02:53:02 +00:00
lda #menu_id_file
2018-02-01 19:30:03 +00:00
sta disableitem_params::menu_id
2018-02-19 07:44:08 +00:00
lda #desktop_aux::menu_item_id_new_folder
2018-02-01 19:30:03 +00:00
sta disableitem_params::menu_item
MGTK_RELAY_CALL MGTK::DisableItem, disableitem_params
2018-02-19 07:44:08 +00:00
lda #desktop_aux::menu_item_id_close
2018-02-01 19:30:03 +00:00
sta disableitem_params::menu_item
MGTK_RELAY_CALL MGTK::DisableItem, disableitem_params
2018-02-19 07:44:08 +00:00
lda #desktop_aux::menu_item_id_close_all
2018-02-01 19:30:03 +00:00
sta disableitem_params::menu_item
MGTK_RELAY_CALL MGTK::DisableItem, disableitem_params
2018-02-14 02:53:02 +00:00
lda #0
2018-01-21 00:44:49 +00:00
sta menu_dispatch_flag
2017-10-12 15:04:27 +00:00
rts
2018-02-14 02:53:02 +00:00
;; Is this residue of a Windows menu???
check_menu_items:
dex
2018-02-03 03:38:35 +00:00
lda win_buf_table,x
2017-10-12 15:04:27 +00:00
and #$0F
tax
inx
2018-02-01 19:30:03 +00:00
stx checkitem_params::menu_item
2018-02-14 02:53:02 +00:00
lda #MGTK::checkitem_check
2018-02-01 19:30:03 +00:00
sta checkitem_params::check
MGTK_RELAY_CALL MGTK::CheckItem, checkitem_params
2017-10-12 15:04:27 +00:00
rts
2018-02-12 01:21:37 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-12 01:21:37 +00:00
;;; Disable menu items for operating on a selected file
.proc disable_file_menu_items
lda #MGTK::disableitem_disable
2018-02-01 19:30:03 +00:00
sta disableitem_params::disable
2018-02-07 05:59:25 +00:00
lda #menu_id_file
2018-02-01 19:30:03 +00:00
sta disableitem_params::menu_id
2018-02-19 07:44:08 +00:00
lda #desktop_aux::menu_item_id_open
2018-02-07 05:59:25 +00:00
jsr disable_menu_item
lda #menu_id_special
2018-02-01 19:30:03 +00:00
sta disableitem_params::menu_id
2018-02-19 07:44:08 +00:00
lda #desktop_aux::menu_item_id_lock
2018-02-07 05:59:25 +00:00
jsr disable_menu_item
2018-02-19 07:44:08 +00:00
lda #desktop_aux::menu_item_id_unlock
2018-02-07 05:59:25 +00:00
jsr disable_menu_item
2018-02-19 07:44:08 +00:00
lda #desktop_aux::menu_item_id_get_info
2018-02-07 05:59:25 +00:00
jsr disable_menu_item
2018-02-19 07:44:08 +00:00
lda #desktop_aux::menu_item_id_get_size
2018-02-07 05:59:25 +00:00
jsr disable_menu_item
2018-02-19 07:44:08 +00:00
lda #desktop_aux::menu_item_id_rename_icon
2018-02-07 05:59:25 +00:00
jsr disable_menu_item
rts
disable_menu_item:
sta disableitem_params::menu_item
2018-02-01 19:30:03 +00:00
MGTK_RELAY_CALL MGTK::DisableItem, disableitem_params
2017-10-12 15:04:27 +00:00
rts
2018-02-12 01:21:37 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-12 01:21:37 +00:00
.proc enable_file_menu_items
lda #MGTK::disableitem_enable
2018-02-01 19:30:03 +00:00
sta disableitem_params::disable
2018-02-12 01:21:37 +00:00
lda #menu_id_file
2018-02-01 19:30:03 +00:00
sta disableitem_params::menu_id
2018-02-19 07:44:08 +00:00
lda #desktop_aux::menu_item_id_open
2018-02-12 01:21:37 +00:00
jsr enable_menu_item
lda #menu_id_special
2018-02-01 19:30:03 +00:00
sta disableitem_params::menu_id
2018-02-19 07:44:08 +00:00
lda #desktop_aux::menu_item_id_lock
2018-02-12 01:21:37 +00:00
jsr enable_menu_item
2018-02-19 07:44:08 +00:00
lda #desktop_aux::menu_item_id_unlock
2018-02-12 01:21:37 +00:00
jsr enable_menu_item
2018-02-19 07:44:08 +00:00
lda #desktop_aux::menu_item_id_get_info
2018-02-12 01:21:37 +00:00
jsr enable_menu_item
2018-02-19 07:44:08 +00:00
lda #desktop_aux::menu_item_id_get_size
2018-02-12 01:21:37 +00:00
jsr enable_menu_item
2018-02-19 07:44:08 +00:00
lda #desktop_aux::menu_item_id_rename_icon
2018-02-12 01:21:37 +00:00
jsr enable_menu_item
2017-10-12 15:04:27 +00:00
rts
2018-02-12 01:21:37 +00:00
enable_menu_item:
sta disableitem_params::menu_item
2018-02-01 19:30:03 +00:00
MGTK_RELAY_CALL MGTK::DisableItem, disableitem_params
2017-10-12 15:04:27 +00:00
rts
2018-02-12 01:21:37 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-12 01:21:37 +00:00
.proc toggle_eject_menu_item
enable:
lda #MGTK::disableitem_enable
2018-02-01 19:30:03 +00:00
sta disableitem_params::disable
2018-02-12 01:21:37 +00:00
jmp :+
2017-10-12 15:04:27 +00:00
2018-02-12 01:21:37 +00:00
disable:
lda #MGTK::disableitem_disable
2018-02-01 19:30:03 +00:00
sta disableitem_params::disable
2018-02-12 01:21:37 +00:00
: lda #menu_id_file
2018-02-01 19:30:03 +00:00
sta disableitem_params::menu_id
2018-02-12 01:21:37 +00:00
lda #11 ; > Eject
2018-02-01 19:30:03 +00:00
sta disableitem_params::menu_item
MGTK_RELAY_CALL MGTK::DisableItem, disableitem_params
2017-10-12 15:04:27 +00:00
rts
2018-02-12 01:21:37 +00:00
.endproc
enable_eject_menu_item := toggle_eject_menu_item::enable
disable_eject_menu_item := toggle_eject_menu_item::disable
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-12 01:21:37 +00:00
.proc toggle_selector_menu_items
disable:
lda #MGTK::disableitem_disable
2018-02-01 19:30:03 +00:00
sta disableitem_params::disable
2018-02-12 01:21:37 +00:00
jmp :+
2017-10-12 15:04:27 +00:00
2018-02-12 01:21:37 +00:00
enable:
lda #MGTK::disableitem_enable
2018-02-01 19:30:03 +00:00
sta disableitem_params::disable
2018-02-12 01:21:37 +00:00
: lda #menu_id_selector
2018-02-01 19:30:03 +00:00
sta disableitem_params::menu_id
2018-02-12 01:21:37 +00:00
lda #2 ; > Edit
jsr configure_menu_item
lda #3 ; > Delete
jsr configure_menu_item
lda #4 ; > Run
jsr configure_menu_item
2017-10-12 15:04:27 +00:00
lda #$80
2018-01-24 05:52:53 +00:00
sta LD343+1
2017-10-12 15:04:27 +00:00
rts
2018-02-12 01:21:37 +00:00
configure_menu_item:
sta disableitem_params::menu_item
2018-02-01 19:30:03 +00:00
MGTK_RELAY_CALL MGTK::DisableItem, disableitem_params
2017-10-12 15:04:27 +00:00
rts
2018-02-12 01:21:37 +00:00
.endproc
enable_selector_menu_items := toggle_selector_menu_items::enable
disable_selector_menu_items := toggle_selector_menu_items::disable
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-12 01:21:37 +00:00
.proc L67D7
2018-02-19 19:33:13 +00:00
lda selected_icon_count
2017-10-12 15:04:27 +00:00
bne L67DF
jmp L681B
L67DF: tax
dex
2018-03-05 05:33:56 +00:00
lda findicon_which_icon
2018-02-19 19:33:13 +00:00
L67E4: cmp selected_icon_list,x
2017-10-12 15:04:27 +00:00
beq L67EE
dex
bpl L67E4
bmi L67F6
2018-01-28 16:08:39 +00:00
L67EE: bit double_click_flag
2017-10-12 15:04:27 +00:00
bmi L6834
jmp L6880
2017-12-31 20:04:22 +00:00
L67F6: bit BUTN0
2017-10-12 15:04:27 +00:00
bpl L6818
lda selected_window_index
2017-10-12 15:04:27 +00:00
bne L6818
2018-03-05 05:33:56 +00:00
DESKTOP_RELAY_CALL DT_HIGHLIGHT_ICON, findicon_which_icon
2018-02-19 19:33:13 +00:00
ldx selected_icon_count
2018-03-05 05:52:38 +00:00
lda findicon_which_icon
2018-02-19 19:33:13 +00:00
sta selected_icon_list,x
inc selected_icon_count
2017-10-12 15:04:27 +00:00
jmp L6834
2018-01-20 18:57:25 +00:00
L6818: jsr clear_selection
2018-03-05 05:33:56 +00:00
L681B: DESKTOP_RELAY_CALL DT_HIGHLIGHT_ICON, findicon_which_icon
2018-02-16 19:25:00 +00:00
lda #1
2018-02-19 19:33:13 +00:00
sta selected_icon_count
2018-03-05 05:33:56 +00:00
lda findicon_which_icon
2018-02-19 19:33:13 +00:00
sta selected_icon_list
2018-02-16 19:25:00 +00:00
lda #0
sta selected_window_index
2018-01-28 16:08:39 +00:00
L6834: bit double_click_flag
2017-10-12 15:04:27 +00:00
bpl L6880
2018-03-05 05:33:56 +00:00
lda findicon_which_icon
2018-01-24 23:39:12 +00:00
sta LEBFC
DESKTOP_RELAY_CALL $0A, LEBFC
2017-10-12 15:04:27 +00:00
tax
2018-01-24 23:39:12 +00:00
lda LEBFC
2017-10-12 15:04:27 +00:00
beq L6878
jsr L8F00
cmp #$FF
bne L6858
2018-01-21 16:37:01 +00:00
jmp redraw_windows_and_desktop
2017-10-12 15:04:27 +00:00
2018-01-24 23:39:12 +00:00
L6858: lda LEBFC
2018-02-09 05:42:59 +00:00
cmp trash_icon_num
2017-10-12 15:04:27 +00:00
bne L6863
2018-01-21 16:37:01 +00:00
jmp redraw_windows_and_desktop
2017-10-12 15:04:27 +00:00
2018-01-24 23:39:12 +00:00
L6863: lda LEBFC
2017-10-12 15:04:27 +00:00
bpl L6872
and #$7F
pha
jsr L6F0D
pla
jmp L5E78
L6872: jsr L6A3F
2018-01-21 16:37:01 +00:00
jmp redraw_windows_and_desktop
2017-10-12 15:04:27 +00:00
L6878: txa
2018-02-16 19:25:00 +00:00
cmp #2
2017-10-12 15:04:27 +00:00
bne L688F
2018-01-21 16:37:01 +00:00
jmp redraw_windows_and_desktop
2017-10-12 15:04:27 +00:00
2018-03-05 05:33:56 +00:00
L6880: lda findicon_which_icon
2018-02-09 05:42:59 +00:00
cmp trash_icon_num
2017-10-12 15:04:27 +00:00
beq L688E
jsr L6A8A
jsr DESKTOP_COPY_FROM_BUF
2017-10-12 15:04:27 +00:00
L688E: rts
2018-02-19 19:33:13 +00:00
L688F: ldx selected_icon_count
2017-10-12 15:04:27 +00:00
dex
L6893: txa
pha
2018-02-19 19:33:13 +00:00
lda selected_icon_list,x
2018-02-06 23:36:39 +00:00
sta LE22D
DESKTOP_RELAY_CALL DT_UNHIGHLIGHT_ICON, LE22D
2017-10-12 15:04:27 +00:00
pla
tax
dex
bpl L6893
rts
2018-02-12 01:21:37 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-12 01:21:37 +00:00
.proc L68AA
jsr reset_grafport3
2017-12-31 20:04:22 +00:00
bit BUTN0
2017-10-12 15:04:27 +00:00
bpl L68B3
rts
2018-01-20 18:57:25 +00:00
L68B3: jsr clear_selection
2018-02-16 19:25:00 +00:00
ldx #3
2018-02-28 02:38:18 +00:00
L68B8: lda event_coords,x
2018-02-06 23:36:39 +00:00
sta rect_E230::x1,x
sta rect_E230::x2,x
2017-10-12 15:04:27 +00:00
dex
bpl L68B8
2018-02-03 04:41:42 +00:00
jsr peek_event
2018-02-28 02:38:18 +00:00
lda event_kind
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_drag
2017-12-31 02:02:15 +00:00
beq L68CF
rts
2018-01-29 05:18:00 +00:00
L68CF: MGTK_RELAY_CALL MGTK::SetPattern, checkerboard_pattern3
2018-02-03 04:41:42 +00:00
jsr set_penmode_xor
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::FrameRect, rect_E230
2018-02-03 04:41:42 +00:00
L68E4: jsr peek_event
2018-02-28 02:38:18 +00:00
lda event_kind
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_drag
2017-10-12 15:04:27 +00:00
beq L6932
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::FrameRect, rect_E230
2018-02-16 19:25:00 +00:00
ldx #0
2018-02-08 05:48:19 +00:00
L68F9: cpx cached_window_icon_count
2018-02-16 19:25:00 +00:00
bne :+
lda #0
sta selected_window_index
2017-10-12 15:04:27 +00:00
rts
2018-02-16 19:25:00 +00:00
: txa
2017-10-12 15:04:27 +00:00
pha
2018-02-08 05:48:19 +00:00
lda cached_window_icon_list,x
2018-02-15 16:08:59 +00:00
sta icon_param
DESKTOP_RELAY_CALL DT_ICON_IN_RECT, icon_param
2017-10-12 15:04:27 +00:00
beq L692C
2018-02-15 16:08:59 +00:00
DESKTOP_RELAY_CALL DT_HIGHLIGHT_ICON, icon_param
2018-02-19 19:33:13 +00:00
ldx selected_icon_count
inc selected_icon_count
2018-02-15 16:08:59 +00:00
lda icon_param
2018-02-19 19:33:13 +00:00
sta selected_icon_list,x
2017-10-12 15:04:27 +00:00
L692C: pla
tax
inx
jmp L68F9
2018-02-28 02:38:18 +00:00
L6932: sub16 event_xcoord, L6A39, L6A35
sub16 event_ycoord, L6A3B, L6A37
2017-10-12 15:04:27 +00:00
lda L6A36
bpl L6968
lda L6A35
eor #$FF
sta L6A35
inc L6A35
L6968: lda L6A38
bpl L6978
lda L6A37
eor #$FF
sta L6A37
inc L6A37
L6978: lda L6A35
cmp #$05
bcs L6989
lda L6A37
cmp #$05
bcs L6989
jmp L68E4
2018-01-29 05:18:00 +00:00
L6989: MGTK_RELAY_CALL MGTK::FrameRect, rect_E230
2017-10-12 15:04:27 +00:00
ldx #$03
2018-02-28 02:38:18 +00:00
L6994: lda event_coords,x
2017-10-12 15:04:27 +00:00
sta L6A39,x
dex
bpl L6994
2018-02-28 02:38:18 +00:00
cmp16 event_xcoord, rect_E230::x2
2017-10-12 15:04:27 +00:00
bpl L69D2
2018-02-28 02:38:18 +00:00
cmp16 event_xcoord, rect_E230::x1
2017-10-12 15:04:27 +00:00
bmi L69BE
bit L6A3D
bpl L69D2
2018-02-28 02:38:18 +00:00
L69BE: copy16 event_xcoord, rect_E230::x1
2017-10-12 15:04:27 +00:00
lda #$80
sta L6A3D
jmp L69E3
2018-02-28 02:38:18 +00:00
L69D2: copy16 event_xcoord, rect_E230::x2
2017-10-12 15:04:27 +00:00
lda #$00
sta L6A3D
2018-02-28 02:38:18 +00:00
L69E3: cmp16 event_ycoord, rect_E230::y2
2017-10-12 15:04:27 +00:00
bpl L6A18
2018-02-28 02:38:18 +00:00
cmp16 event_ycoord, rect_E230::y1
2017-10-12 15:04:27 +00:00
bmi L6A04
bit L6A3E
bpl L6A18
2018-02-28 02:38:18 +00:00
L6A04: copy16 event_ycoord, rect_E230::y1
2017-10-12 15:04:27 +00:00
lda #$80
sta L6A3E
jmp L6A29
2018-02-28 02:38:18 +00:00
L6A18: copy16 event_ycoord, rect_E230::y2
2017-10-12 15:04:27 +00:00
lda #$00
sta L6A3E
2018-01-29 05:18:00 +00:00
L6A29: MGTK_RELAY_CALL MGTK::FrameRect, rect_E230
2017-10-12 15:04:27 +00:00
jmp L68E4
2017-12-31 20:32:47 +00:00
L6A35: .byte 0
L6A36: .byte 0
L6A37: .byte 0
L6A38: .byte 0
2018-02-05 04:46:26 +00:00
L6A39: .word 0
L6A3B: .word 0
2017-12-31 20:32:47 +00:00
L6A3D: .byte 0
L6A3E: .byte 0
2018-02-12 01:21:37 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-12 01:21:37 +00:00
.proc L6A3F
2018-03-05 05:52:38 +00:00
ptr := $6
ldx #7
: cmp LEC26,x
2017-10-12 15:04:27 +00:00
beq L6A80
dex
2018-03-05 05:52:38 +00:00
bpl :-
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-03-05 05:52:38 +00:00
addax #icon_entry_offset_len, ptr
ldy #0
lda (ptr),y
2017-10-12 15:04:27 +00:00
tay
dey
2018-03-05 05:52:38 +00:00
L6A5C: lda (ptr),y
2018-01-17 15:41:23 +00:00
sta $220,y
2017-10-12 15:04:27 +00:00
dey
bpl L6A5C
2018-01-17 15:41:23 +00:00
dec $220
2018-02-16 03:29:05 +00:00
lda #'/'
2017-10-12 15:04:27 +00:00
sta $0221
2018-01-25 04:20:39 +00:00
2018-02-05 04:21:34 +00:00
ldax #$220
2018-01-17 15:41:23 +00:00
ldy $220
2017-10-12 15:04:27 +00:00
jsr L6FB7
2018-02-05 04:21:34 +00:00
ldax #$220
2018-01-17 15:41:23 +00:00
ldy $220
2017-10-12 15:04:27 +00:00
jmp L6F4B
L6A80: inx
txa
pha
jsr L6F0D
pla
jmp L5E78
2018-02-12 01:21:37 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-12 01:21:37 +00:00
.proc L6A8A
2018-02-15 16:08:59 +00:00
sta icon_params2
jsr DESKTOP_COPY_FROM_BUF
2018-02-15 16:08:59 +00:00
lda icon_params2
2017-10-12 15:04:27 +00:00
ldx #$07
2018-01-13 03:06:55 +00:00
L6A95: cmp LEC26,x
2017-10-12 15:04:27 +00:00
beq L6AA0
dex
bpl L6A95
jmp L6B1E
L6AA0: inx
2018-02-03 04:41:42 +00:00
cpx active_window_id
2017-10-12 15:04:27 +00:00
bne L6AA7
rts
2018-02-08 05:48:19 +00:00
L6AA7: stx cached_window_id
jsr DESKTOP_COPY_TO_BUF
2018-02-15 16:08:59 +00:00
lda icon_params2
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-02-05 04:35:19 +00:00
stax $06
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-09 05:42:59 +00:00
ora #icon_entry_open_mask ; set open_flag
2018-01-17 15:41:23 +00:00
sta ($06),y
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-09 05:42:59 +00:00
and #icon_entry_winid_mask
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2017-10-12 15:04:27 +00:00
beq L6AD8
2018-02-03 04:41:42 +00:00
cmp active_window_id
2017-10-12 15:04:27 +00:00
bne L6AEF
2018-02-12 01:21:37 +00:00
jsr get_set_port2
2018-02-15 16:08:59 +00:00
lda icon_params2
2018-02-13 16:18:11 +00:00
jsr icon_window_to_screen
2018-02-15 16:08:59 +00:00
L6AD8: DESKTOP_RELAY_CALL DT_UNHIGHLIGHT_ICON, icon_params2
2018-01-31 05:42:26 +00:00
lda getwinport_params2::window_id
2017-10-12 15:04:27 +00:00
beq L6AEF
2018-02-15 16:08:59 +00:00
lda icon_params2
2018-02-13 16:18:11 +00:00
jsr icon_screen_to_window
2018-01-30 16:57:36 +00:00
jsr reset_grafport3
2018-02-15 16:08:59 +00:00
L6AEF: lda icon_params2
ldx LE1F1
2017-10-12 15:04:27 +00:00
dex
2018-02-15 16:08:59 +00:00
L6AF6: cmp LE1F1+1,x
2017-10-12 15:04:27 +00:00
beq L6B01
dex
bpl L6AF6
jsr L7054
2018-02-08 05:48:19 +00:00
L6B01: MGTK_RELAY_CALL MGTK::SelectWindow, cached_window_id
lda cached_window_id
2018-02-03 04:41:42 +00:00
sta active_window_id
2017-10-12 15:04:27 +00:00
jsr L6C19
2018-01-20 18:57:25 +00:00
jsr redraw_windows
2017-10-12 15:04:27 +00:00
lda #$00
2018-02-08 05:48:19 +00:00
sta cached_window_id
jmp DESKTOP_COPY_TO_BUF
2017-10-12 15:04:27 +00:00
2018-02-15 16:08:59 +00:00
L6B1E: lda LEC2E
2017-10-12 15:04:27 +00:00
cmp #$08
bcc L6B2F
2018-01-23 16:33:12 +00:00
lda #warning_msg_too_many_windows
jsr show_warning_dialog_num
2018-02-15 16:08:59 +00:00
ldx LE256
2017-10-12 15:04:27 +00:00
txs
rts
L6B2F: ldx #$00
2018-01-13 03:06:55 +00:00
L6B31: lda LEC26,x
2017-10-12 15:04:27 +00:00
beq L6B3A
inx
jmp L6B31
2018-02-15 16:08:59 +00:00
L6B3A: lda icon_params2
2018-01-13 03:06:55 +00:00
sta LEC26,x
2017-10-12 15:04:27 +00:00
inx
2018-02-08 05:48:19 +00:00
stx cached_window_id
jsr DESKTOP_COPY_TO_BUF
2018-02-15 16:08:59 +00:00
inc LEC2E
2018-02-08 05:48:19 +00:00
ldx cached_window_id
2017-10-12 15:04:27 +00:00
dex
lda #$00
2018-02-03 03:38:35 +00:00
sta win_buf_table,x
2018-02-15 16:08:59 +00:00
lda LEC2E
2017-10-12 15:04:27 +00:00
cmp #$02
bcs L6B60
2018-02-14 02:53:02 +00:00
jsr enable_various_file_menu_items
2017-10-12 15:04:27 +00:00
jmp L6B68
L6B60: lda #$00
2018-02-01 19:30:03 +00:00
sta checkitem_params::check
2018-03-18 18:59:01 +00:00
jsr check_item
2017-10-12 15:04:27 +00:00
L6B68: lda #$01
2018-02-01 19:30:03 +00:00
sta checkitem_params::menu_item
sta checkitem_params::check
2018-03-18 18:59:01 +00:00
jsr check_item
2018-02-15 16:08:59 +00:00
lda icon_params2
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-02-05 04:35:19 +00:00
stax $06
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-09 05:42:59 +00:00
ora #icon_entry_open_mask ; set open_flag
2018-01-17 15:41:23 +00:00
sta ($06),y
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-09 05:42:59 +00:00
and #icon_entry_winid_mask
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2017-10-12 15:04:27 +00:00
beq L6BA1
2018-02-03 04:41:42 +00:00
cmp active_window_id
2017-10-12 15:04:27 +00:00
bne L6BB8
2018-02-12 01:21:37 +00:00
jsr get_set_port2
2018-02-14 02:53:02 +00:00
jsr offset_grafport2_and_set
2018-02-15 16:08:59 +00:00
lda icon_params2
2018-02-13 16:18:11 +00:00
jsr icon_window_to_screen
2018-02-15 16:08:59 +00:00
L6BA1: DESKTOP_RELAY_CALL DT_UNHIGHLIGHT_ICON, icon_params2
2018-01-31 05:42:26 +00:00
lda getwinport_params2::window_id
2017-10-12 15:04:27 +00:00
beq L6BB8
2018-02-15 16:08:59 +00:00
lda icon_params2
2018-02-13 16:18:11 +00:00
jsr icon_screen_to_window
2018-01-30 16:57:36 +00:00
jsr reset_grafport3
2017-10-12 15:04:27 +00:00
L6BB8: jsr L744B
2018-02-08 05:48:19 +00:00
lda cached_window_id
2018-01-21 03:02:34 +00:00
jsr window_lookup
2017-10-12 15:04:27 +00:00
ldy #$38
2018-01-29 05:18:00 +00:00
jsr MGTK_RELAY
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2018-02-12 01:21:37 +00:00
jsr get_set_port2
2018-02-10 06:10:11 +00:00
jsr draw_window_header
2018-02-14 03:15:45 +00:00
jsr cached_icons_window_to_screen
2017-10-12 15:04:27 +00:00
lda #$00
sta L6C0E
L6BDA: lda L6C0E
2018-02-08 05:48:19 +00:00
cmp cached_window_icon_count
2017-10-12 15:04:27 +00:00
beq L6BF4
tax
2018-02-08 05:48:19 +00:00
lda cached_window_icon_list,x
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2017-10-12 15:04:27 +00:00
ldy #$01
2017-12-31 02:02:15 +00:00
jsr DESKTOP_RELAY
2017-10-12 15:04:27 +00:00
inc L6C0E
jmp L6BDA
2018-02-08 05:48:19 +00:00
L6BF4: lda cached_window_id
2018-02-03 04:41:42 +00:00
sta active_window_id
2018-02-14 03:15:45 +00:00
jsr update_scrollbars
jsr cached_icons_screen_to_window
jsr DESKTOP_COPY_FROM_BUF
2017-10-12 15:04:27 +00:00
lda #$00
2018-02-08 05:48:19 +00:00
sta cached_window_id
jsr DESKTOP_COPY_TO_BUF
2018-01-30 16:57:36 +00:00
jmp reset_grafport3
2017-10-12 15:04:27 +00:00
2017-12-31 20:32:47 +00:00
L6C0E: .byte 0
2018-02-12 01:21:37 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-12 01:21:37 +00:00
2018-03-18 18:59:01 +00:00
.proc check_item
MGTK_RELAY_CALL MGTK::CheckItem, checkitem_params
2017-10-12 15:04:27 +00:00
rts
2018-03-18 18:59:01 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-12 01:21:37 +00:00
.proc L6C19
ldx cached_window_id
2017-10-12 15:04:27 +00:00
dex
2018-02-03 03:38:35 +00:00
lda win_buf_table,x
2017-10-12 15:04:27 +00:00
bmi L6C25
jmp L6CCD
2018-01-11 06:31:02 +00:00
L6C25: jsr push_zp_addrs
2018-02-08 05:48:19 +00:00
lda cached_window_id
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2018-02-12 01:21:37 +00:00
jsr get_set_port2
2017-10-12 15:04:27 +00:00
bit L4152
bmi L6C39
2018-02-10 06:10:11 +00:00
jsr draw_window_header
2018-02-08 05:48:19 +00:00
L6C39: lda cached_window_id
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2018-02-12 01:21:37 +00:00
jsr get_port2
2018-02-03 05:11:49 +00:00
bit L4152
2017-10-12 15:04:27 +00:00
bmi L6C4A
2018-02-14 02:53:02 +00:00
jsr offset_grafport2_and_set
2018-02-08 05:48:19 +00:00
L6C4A: ldx cached_window_id
2017-10-12 15:04:27 +00:00
dex
2018-01-13 03:06:55 +00:00
lda LEC26,x
2017-10-12 15:04:27 +00:00
ldx #$00
2018-02-15 16:08:59 +00:00
L6C53: cmp LE1F1+1,x
2017-10-12 15:04:27 +00:00
beq L6C5F
inx
2018-02-15 16:08:59 +00:00
cpx LE1F1
2017-10-12 15:04:27 +00:00
bne L6C53
rts
L6C5F: txa
asl a
tax
2018-02-15 16:08:59 +00:00
lda LE202,x
2018-02-19 22:06:12 +00:00
sta LE71D
2018-01-17 15:41:23 +00:00
sta $06
2018-02-15 16:08:59 +00:00
lda LE202+1,x
2018-02-19 22:06:12 +00:00
sta LE71D+1
2018-01-17 15:41:23 +00:00
sta $06+1
2017-12-31 20:04:22 +00:00
lda LCBANK2
lda LCBANK2
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tay
lda LCBANK1
lda LCBANK1
tya
2018-02-19 22:06:12 +00:00
sta LE71F
inc LE71D
2017-10-12 15:04:27 +00:00
bne L6C8F
2018-02-19 22:06:12 +00:00
inc LE71D+1
2018-02-10 06:59:05 +00:00
;; First row
.proc L6C8F
lda #16
sta pos_col_name::ycoord
sta pos_col_type::ycoord
sta pos_col_size::ycoord
sta pos_col_date::ycoord
lda #0
sta pos_col_name::ycoord+1
sta pos_col_type::ycoord+1
sta pos_col_size::ycoord+1
sta pos_col_date::ycoord+1
lda #0
sta rows_done
rloop: lda rows_done
2018-02-08 05:48:19 +00:00
cmp cached_window_icon_count
2018-02-10 06:59:05 +00:00
beq done
2017-10-12 15:04:27 +00:00
tax
2018-02-08 05:48:19 +00:00
lda cached_window_icon_list,x
2017-10-12 15:04:27 +00:00
jsr L813F
2018-02-10 06:59:05 +00:00
inc rows_done
jmp rloop
2017-10-12 15:04:27 +00:00
2018-02-10 06:59:05 +00:00
done: jsr reset_grafport3
2018-01-11 06:31:02 +00:00
jsr pop_zp_addrs
2017-10-12 15:04:27 +00:00
rts
2018-02-10 06:59:05 +00:00
rows_done:
.byte 0
.endproc
2018-02-08 05:48:19 +00:00
L6CCD: lda cached_window_id
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2018-02-12 01:21:37 +00:00
jsr get_set_port2
2017-10-12 15:04:27 +00:00
bit L4152
bmi L6CDE
2018-02-10 06:10:11 +00:00
jsr draw_window_header
2018-02-14 03:15:45 +00:00
L6CDE: jsr cached_icons_window_to_screen
2018-02-14 02:53:02 +00:00
jsr offset_grafport2_and_set
2017-10-12 15:04:27 +00:00
ldx #$07
2018-02-06 23:36:39 +00:00
L6CE6: lda grafport2::cliprect,x
2018-01-21 03:33:15 +00:00
sta rect_E230,x
2017-10-12 15:04:27 +00:00
dex
bpl L6CE6
ldx #$00
txa
pha
2018-02-08 05:48:19 +00:00
L6CF3: cpx cached_window_icon_count
2017-10-12 15:04:27 +00:00
bne L6D09
pla
2018-01-30 16:57:36 +00:00
jsr reset_grafport3
2018-02-08 05:48:19 +00:00
lda cached_window_id
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2018-02-12 01:21:37 +00:00
jsr get_set_port2
2018-02-14 03:15:45 +00:00
jsr cached_icons_screen_to_window
2017-10-12 15:04:27 +00:00
rts
L6D09: txa
pha
2018-02-08 05:48:19 +00:00
lda cached_window_icon_list,x
2018-02-15 16:08:59 +00:00
sta icon_param
DESKTOP_RELAY_CALL DT_ICON_IN_RECT, icon_param
2017-10-12 15:04:27 +00:00
beq L6D25
2018-02-15 16:08:59 +00:00
DESKTOP_RELAY_CALL DT_UNHIGHLIGHT_ICON, icon_param
2017-10-12 15:04:27 +00:00
L6D25: pla
tax
inx
jmp L6CF3
2018-02-12 01:21:37 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-12 01:21:37 +00:00
.proc clear_selection
2018-02-19 19:33:13 +00:00
lda selected_icon_count
2017-10-12 15:04:27 +00:00
bne L6D31
rts
L6D31: lda #$00
sta L6DB0
lda selected_window_index
2018-01-21 03:33:15 +00:00
sta rect_E230
2017-10-12 15:04:27 +00:00
beq L6D7D
2018-02-03 04:41:42 +00:00
cmp active_window_id
2017-10-12 15:04:27 +00:00
beq L6D4D
2018-02-18 01:15:27 +00:00
jsr zero_grafport5_coords
2017-10-12 15:04:27 +00:00
lda #$00
2018-01-21 03:33:15 +00:00
sta rect_E230
2017-10-12 15:04:27 +00:00
beq L6D56
2018-01-31 05:42:26 +00:00
L6D4D: sta getwinport_params2::window_id
2018-02-12 01:21:37 +00:00
jsr get_set_port2
2018-02-14 02:53:02 +00:00
jsr offset_grafport2_and_set
2017-10-12 15:04:27 +00:00
L6D56: lda L6DB0
2018-02-19 19:33:13 +00:00
cmp selected_icon_count
2017-10-12 15:04:27 +00:00
beq L6D9B
tax
2018-02-19 19:33:13 +00:00
lda selected_icon_list,x
2018-02-15 16:08:59 +00:00
sta icon_param
2018-02-13 16:18:11 +00:00
jsr icon_window_to_screen
2018-02-15 16:08:59 +00:00
DESKTOP_RELAY_CALL $0B, icon_param
lda icon_param
2018-02-13 16:18:11 +00:00
jsr icon_screen_to_window
2017-10-12 15:04:27 +00:00
inc L6DB0
jmp L6D56
L6D7D: lda L6DB0
2018-02-19 19:33:13 +00:00
cmp selected_icon_count
2017-10-12 15:04:27 +00:00
beq L6D9B
tax
2018-02-19 19:33:13 +00:00
lda selected_icon_list,x
2018-02-15 16:08:59 +00:00
sta icon_param
DESKTOP_RELAY_CALL $0B, icon_param
2017-10-12 15:04:27 +00:00
inc L6DB0
jmp L6D7D
L6D9B: lda #$00
2018-02-19 19:33:13 +00:00
ldx selected_icon_count
2017-10-12 15:04:27 +00:00
dex
2018-02-19 19:33:13 +00:00
L6DA1: sta selected_icon_list,x
2017-10-12 15:04:27 +00:00
dex
bpl L6DA1
2018-02-19 19:33:13 +00:00
sta selected_icon_count
sta selected_window_index
2018-01-30 16:57:36 +00:00
jmp reset_grafport3
2017-10-12 15:04:27 +00:00
2017-12-31 20:32:47 +00:00
L6DB0: .byte 0
2018-02-12 01:21:37 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-12 01:21:37 +00:00
2018-02-14 03:15:45 +00:00
.proc update_scrollbars
2018-02-12 01:21:37 +00:00
ldx active_window_id
2017-10-12 15:04:27 +00:00
dex
2018-02-03 03:38:35 +00:00
lda win_buf_table,x
2018-02-14 05:52:36 +00:00
bmi :+
2017-10-12 15:04:27 +00:00
jsr L7B6B
2018-02-14 05:52:36 +00:00
jmp config_port
2017-10-12 15:04:27 +00:00
2018-02-14 05:52:36 +00:00
: jsr cached_icons_window_to_screen
2017-10-12 15:04:27 +00:00
jsr L7B6B
2018-02-14 03:15:45 +00:00
jsr cached_icons_screen_to_window
2018-02-14 05:52:36 +00:00
config_port:
lda active_window_id
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2018-02-12 01:21:37 +00:00
jsr get_set_port2
2018-02-14 03:15:45 +00:00
;; check horizontal bounds
2018-02-06 18:06:44 +00:00
cmp16 L7B5F, grafport2::cliprect::x1
2018-02-14 03:15:45 +00:00
bmi activate_hscroll
2018-02-06 18:06:44 +00:00
cmp16 grafport2::cliprect::x2, L7B63
2018-02-14 03:15:45 +00:00
bmi activate_hscroll
;; deactivate horizontal scrollbar
lda #MGTK::ctl_horizontal_scroll_bar
2018-02-28 02:38:18 +00:00
sta activatectl_which_ctl
2018-02-14 03:15:45 +00:00
lda #MGTK::activatectl_deactivate
2018-02-28 02:38:18 +00:00
sta activatectl_activate
2018-02-14 03:15:45 +00:00
jsr activate_ctl
jmp check_vscroll
activate_hscroll:
;; activate horizontal scrollbar
lda #MGTK::ctl_horizontal_scroll_bar
2018-02-28 02:38:18 +00:00
sta activatectl_which_ctl
2018-02-14 03:15:45 +00:00
lda #MGTK::activatectl_activate
2018-02-28 02:38:18 +00:00
sta activatectl_activate
2018-02-14 03:15:45 +00:00
jsr activate_ctl
jsr update_hthumb
check_vscroll:
;; check vertical bounds
cmp16 L7B61, grafport2::cliprect::y1
bmi activate_vscroll
2018-02-06 18:06:44 +00:00
cmp16 grafport2::cliprect::y2, L7B65
2018-02-14 03:15:45 +00:00
bmi activate_vscroll
;; deactivate vertical scrollbar
lda #MGTK::ctl_vertical_scroll_bar
2018-02-28 02:38:18 +00:00
sta activatectl_which_ctl
2018-02-14 03:15:45 +00:00
lda #MGTK::activatectl_deactivate
2018-02-28 02:38:18 +00:00
sta activatectl_activate
2018-02-14 03:15:45 +00:00
jsr activate_ctl
2017-10-12 15:04:27 +00:00
rts
2018-02-14 03:15:45 +00:00
activate_vscroll:
;; activate vertical scrollbar
lda #MGTK::ctl_vertical_scroll_bar
2018-02-28 02:38:18 +00:00
sta activatectl_which_ctl
2018-02-14 03:15:45 +00:00
lda #MGTK::activatectl_activate
2018-02-28 02:38:18 +00:00
sta activatectl_activate
2018-02-14 03:15:45 +00:00
jsr activate_ctl
jmp update_vthumb
2017-10-12 15:04:27 +00:00
2018-02-14 03:15:45 +00:00
activate_ctl:
MGTK_RELAY_CALL MGTK::ActivateCtl, activatectl_params
2017-10-12 15:04:27 +00:00
rts
2018-02-12 01:21:37 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-14 03:15:45 +00:00
.proc cached_icons_window_to_screen
lda #0
sta count
loop: lda count
2018-02-08 05:48:19 +00:00
cmp cached_window_icon_count
2018-02-14 03:15:45 +00:00
beq done
2017-10-12 15:04:27 +00:00
tax
2018-02-08 05:48:19 +00:00
lda cached_window_icon_list,x
2018-02-13 16:18:11 +00:00
jsr icon_window_to_screen
2018-02-14 03:15:45 +00:00
inc count
jmp loop
2017-10-12 15:04:27 +00:00
2018-02-14 03:15:45 +00:00
done: rts
2017-10-12 15:04:27 +00:00
2018-02-14 03:15:45 +00:00
count: .byte 0
2018-02-12 01:21:37 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-12 01:21:37 +00:00
2018-02-14 03:15:45 +00:00
.proc cached_icons_screen_to_window
lda #0
sta index
loop: lda index
2018-02-08 05:48:19 +00:00
cmp cached_window_icon_count
2018-02-14 03:15:45 +00:00
beq done
2017-10-12 15:04:27 +00:00
tax
2018-02-08 05:48:19 +00:00
lda cached_window_icon_list,x
2018-02-13 16:18:11 +00:00
jsr icon_screen_to_window
2018-02-14 03:15:45 +00:00
inc index
jmp loop
2017-10-12 15:04:27 +00:00
2018-02-14 03:15:45 +00:00
done: rts
2017-10-12 15:04:27 +00:00
2018-02-14 03:15:45 +00:00
index: .byte 0
2018-02-12 01:21:37 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-12 01:21:37 +00:00
2018-02-14 02:53:02 +00:00
.proc offset_grafport2_impl
flag_clear:
lda #$80
beq :+
flag_set:
lda #0
: sta flag
add16 grafport2::viewloc::ycoord, #15, grafport2::viewloc::ycoord
add16 grafport2::cliprect::y1, #15, grafport2::cliprect::y1
bit flag
bmi done
2018-01-30 16:57:36 +00:00
MGTK_RELAY_CALL MGTK::SetPort, grafport2
2018-02-14 02:53:02 +00:00
done: rts
flag: .byte 0
.endproc
offset_grafport2 := offset_grafport2_impl::flag_clear
offset_grafport2_and_set := offset_grafport2_impl::flag_set
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-14 02:53:02 +00:00
.proc enable_various_file_menu_items
lda #MGTK::disablemenu_enable
2018-02-01 19:30:03 +00:00
sta disablemenu_params::disable
MGTK_RELAY_CALL MGTK::DisableMenu, disablemenu_params
2018-02-14 02:53:02 +00:00
lda #MGTK::disableitem_enable
2018-02-01 19:30:03 +00:00
sta disableitem_params::disable
2018-02-14 02:53:02 +00:00
lda #menu_id_file
2018-02-01 19:30:03 +00:00
sta disableitem_params::menu_id
2018-02-14 02:53:02 +00:00
lda #1 ; > New Folder
2018-02-01 19:30:03 +00:00
sta disableitem_params::menu_item
MGTK_RELAY_CALL MGTK::DisableItem, disableitem_params
2018-02-14 02:53:02 +00:00
lda #4 ; > Close
2018-02-01 19:30:03 +00:00
sta disableitem_params::menu_item
MGTK_RELAY_CALL MGTK::DisableItem, disableitem_params
2018-02-14 02:53:02 +00:00
lda #5 ; > Close All
2018-02-01 19:30:03 +00:00
sta disableitem_params::menu_item
MGTK_RELAY_CALL MGTK::DisableItem, disableitem_params
2018-02-14 02:53:02 +00:00
2017-10-12 15:04:27 +00:00
lda #$80
2018-01-21 00:44:49 +00:00
sta menu_dispatch_flag
2017-10-12 15:04:27 +00:00
rts
2018-02-14 02:53:02 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-12 01:21:37 +00:00
2018-02-15 05:07:31 +00:00
.proc L6F0D
ptr := $6
jsr window_address_lookup
sta ptr
sta pathptr
stx ptr+1
stx pathptr+1
ldy #0 ; length offset
lda (ptr),y
sta pathlen
2017-10-12 15:04:27 +00:00
iny
2018-02-15 05:07:31 +00:00
loop: iny ; start at 2nd character
lda (ptr),y
cmp #'/'
beq found
cpy pathlen
beq finish
jmp loop
found: dey
finish: sty pathlen
addr_call_indirect L6FB7, ptr ; ???
ldax pathptr
ldy pathlen
2017-10-12 15:04:27 +00:00
jmp L6F4B
2018-02-15 05:07:31 +00:00
pathptr: .addr 0
pathlen: .byte 0
.endproc
2018-02-12 01:21:37 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-12 01:21:37 +00:00
2018-02-19 01:08:11 +00:00
.proc L6F4B
ptr := $6
stax ptr
2017-10-12 15:04:27 +00:00
sty L705D
2018-02-19 01:08:11 +00:00
L6F52: lda (ptr),y
2017-10-12 15:04:27 +00:00
sta L705D,y
dey
bne L6F52
jsr L72EC
bne L6F8F
lda L704B
beq L6F8F
L6F64: dec L704B
bmi L6F8F
ldx L704B
lda L704C,x
sec
2018-02-19 01:08:11 +00:00
sbc #1
2017-10-12 15:04:27 +00:00
asl a
tax
2018-02-10 06:10:11 +00:00
copy16 L70BD, window_k_used_table,x
copy16 L70BB, window_k_free_table,x
2017-10-12 15:04:27 +00:00
jmp L6F64
L6F8F: rts
2018-02-19 01:08:11 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-19 01:08:11 +00:00
.proc L6F90
ptr := $A
stax ptr
ldy #0
lda (ptr),y
2017-10-12 15:04:27 +00:00
tay
2018-02-19 01:08:11 +00:00
L6F99: lda (ptr),y
cmp #'/'
2017-10-12 15:04:27 +00:00
beq L6FA9
dey
bpl L6F99
2018-02-19 01:08:11 +00:00
ldy #1
2017-10-12 15:04:27 +00:00
L6FA4: dey
2018-02-19 01:08:11 +00:00
lda (ptr),y
2017-10-12 15:04:27 +00:00
tay
rts
2018-02-19 01:08:11 +00:00
L6FA9: cpy #1
2017-10-12 15:04:27 +00:00
beq L6FA4
dey
rts
2018-02-19 01:08:11 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-15 05:07:31 +00:00
2018-02-19 01:08:11 +00:00
;; If 'set' version called, length in Y; otherwise use str len
.proc L6FBD
ptr := $6
set: stax ptr
2017-10-12 15:04:27 +00:00
lda #$80
2018-02-19 01:08:11 +00:00
bne start
2018-02-15 05:07:31 +00:00
2018-02-19 01:08:11 +00:00
unset: stax ptr
lda #0
2018-02-15 05:07:31 +00:00
2018-02-19 01:08:11 +00:00
start: sta flag
bit flag
bpl :+
ldy #0 ; Use full length
lda (ptr),y
2017-10-12 15:04:27 +00:00
tay
2018-02-19 01:08:11 +00:00
: sty path_buffer
;; Copy ptr to path_buffer
: lda (ptr),y
2018-01-24 05:37:41 +00:00
sta path_buffer,y
2017-10-12 15:04:27 +00:00
dey
2018-02-19 01:08:11 +00:00
bne :-
;; And capitalize
2018-02-09 05:42:59 +00:00
addr_call capitalize_string, path_buffer
2018-02-19 01:08:11 +00:00
lda #0
2017-10-12 15:04:27 +00:00
sta L704B
sta L7049
2018-02-19 01:08:11 +00:00
loop: inc L7049
2017-10-12 15:04:27 +00:00
lda L7049
cmp #$09
bcc L6FF6
2018-02-19 01:08:11 +00:00
bit flag
2017-10-12 15:04:27 +00:00
bpl L6FF5
2018-02-19 01:08:11 +00:00
lda #0
2017-10-12 15:04:27 +00:00
L6FF5: rts
2018-01-21 03:02:34 +00:00
L6FF6: jsr window_lookup
2018-02-19 01:08:11 +00:00
stax ptr
ldy #10
lda (ptr),y
beq loop
2017-10-12 15:04:27 +00:00
lda L7049
2018-01-21 03:02:34 +00:00
jsr window_address_lookup
2018-02-19 01:08:11 +00:00
stax ptr
ldy #0
lda (ptr),y
2017-10-12 15:04:27 +00:00
tay
2018-01-24 05:37:41 +00:00
cmp path_buffer
2017-10-12 15:04:27 +00:00
beq L7027
2018-02-19 01:08:11 +00:00
bit flag
bmi loop
2018-01-24 05:37:41 +00:00
ldy path_buffer
2017-10-12 15:04:27 +00:00
iny
2018-02-19 01:08:11 +00:00
lda (ptr),y
cmp #'/'
bne loop
2017-10-12 15:04:27 +00:00
dey
2018-02-19 01:08:11 +00:00
L7027: lda (ptr),y
2018-01-24 05:37:41 +00:00
cmp path_buffer,y
2018-02-19 01:08:11 +00:00
bne loop
2017-10-12 15:04:27 +00:00
dey
bne L7027
2018-02-19 01:08:11 +00:00
bit flag
bmi done
2017-10-12 15:04:27 +00:00
ldx L704B
lda L7049
sta L704C,x
inc L704B
2018-02-19 01:08:11 +00:00
jmp loop
2017-10-12 15:04:27 +00:00
2018-02-19 01:08:11 +00:00
done: return L7049
2017-10-12 15:04:27 +00:00
2017-12-31 20:32:47 +00:00
L7049: .byte 0
2018-02-19 01:08:11 +00:00
flag: .byte 0
.endproc
L6FAF := L6FBD::set
L6FB7 := L6FBD::unset
2017-12-31 20:32:47 +00:00
L704B: .byte 0
2018-02-19 01:08:11 +00:00
L704C: .res 8
2018-02-12 01:21:37 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-12 01:21:37 +00:00
2018-02-16 19:25:00 +00:00
.proc L7054
jmp L70C5
2017-10-12 15:04:27 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_OPEN_PARAMS open_params, L705D, $800
2018-01-14 07:24:19 +00:00
2018-02-16 19:25:00 +00:00
L705D: .res 65, 0
2018-01-14 07:52:03 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_READ_PARAMS read_params, $0C00, $200
DEFINE_CLOSE_PARAMS close_params
2018-01-14 07:24:19 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_GET_FILE_INFO_PARAMS get_file_info_params4, L705D
2018-01-14 07:24:19 +00:00
2018-01-14 08:17:32 +00:00
.byte 0
L70BB: .word 0
2018-02-16 19:25:00 +00:00
L70BD: .word 0
2017-12-31 02:02:15 +00:00
L70BF: .byte $00
L70C0: .byte $00
L70C1: .byte $00
L70C2: .byte $00
L70C3: .byte $00
L70C4: .byte $00
2018-02-12 01:21:37 +00:00
2018-02-19 01:08:11 +00:00
.proc L70C5
sta L72A7
2018-01-11 06:31:02 +00:00
jsr push_zp_addrs
2017-10-12 15:04:27 +00:00
ldx #$40
2018-02-15 16:08:59 +00:00
L70CD: lda LE1B0,x
2017-10-12 15:04:27 +00:00
sta L705D,x
dex
bpl L70CD
jsr L72AA
2018-01-14 07:24:19 +00:00
lda open_params::ref_num
2018-01-14 07:52:03 +00:00
sta read_params::ref_num
2018-01-14 07:24:19 +00:00
sta close_params::ref_num
2017-10-12 15:04:27 +00:00
jsr L72CE
jsr L72E2
ldx #$00
L70EA: lda $0C23,x
sta L70BF,x
inx
cpx #$04
bne L70EA
2018-02-06 18:06:44 +00:00
sub16 L485D, L485F, L72A8
2017-10-12 15:04:27 +00:00
ldx #$05
2018-02-10 06:10:11 +00:00
L710A: lsr16 L72A8
2017-10-12 15:04:27 +00:00
dex
cpx #$00
bne L710A
lda L70C2
bne L7147
2018-01-15 05:23:48 +00:00
lda LDD9E
2017-10-12 15:04:27 +00:00
clc
adc L70C1
bcs L7147
cmp #$7C
bcs L7147
2018-02-06 23:36:39 +00:00
sub16_8 L72A8, DEVCNT, L72A8
2018-02-06 18:06:44 +00:00
cmp16 L72A8, L70C1
2017-10-12 15:04:27 +00:00
bcs L7169
2018-02-15 16:08:59 +00:00
L7147: lda LEC2E
2017-10-12 15:04:27 +00:00
jsr L8B19
2018-02-15 16:08:59 +00:00
dec LEC2E
2018-01-21 16:37:01 +00:00
jsr redraw_windows_and_desktop
2017-10-12 15:04:27 +00:00
jsr L72D8
2018-02-03 04:41:42 +00:00
lda active_window_id
2017-10-12 15:04:27 +00:00
beq L715F
lda #$03
bne L7161
2018-01-23 16:33:12 +00:00
L715F: lda #warning_msg_window_must_be_closed2
L7161: jsr show_warning_dialog_num
2018-02-15 16:08:59 +00:00
ldx LE256
2017-10-12 15:04:27 +00:00
txs
rts
2018-02-06 17:31:58 +00:00
L7169: copy16 L485F, $06
2018-02-15 16:08:59 +00:00
lda LE1F1
2017-10-12 15:04:27 +00:00
asl a
tax
2018-02-15 16:08:59 +00:00
copy16 $06, LE202,x
ldx LE1F1
2017-10-12 15:04:27 +00:00
lda L72A7
2018-02-15 16:08:59 +00:00
sta LE1F1+1,x
inc LE1F1
2017-10-12 15:04:27 +00:00
lda L70C1
pha
2017-12-31 20:04:22 +00:00
lda LCBANK2
lda LCBANK2
2017-10-12 15:04:27 +00:00
ldy #$00
pla
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
lda LCBANK1
lda LCBANK1
lda #$FF
sta L70C4
lda #$00
sta L70C3
2018-02-06 17:31:58 +00:00
copy16 #$0C04, $08
2018-01-17 15:41:23 +00:00
inc $06
lda $06
2017-10-12 15:04:27 +00:00
bne L71BD
2018-01-17 15:41:23 +00:00
inc $06+1
2017-10-12 15:04:27 +00:00
L71BD: inc L70C4
lda L70C4
cmp L70C1
bne L71CB
jmp L7296
L71CB: inc L70C3
lda L70C3
cmp L70C0
beq L71E7
2018-02-05 04:04:14 +00:00
add16_8 $08, L70BF, $08
2017-10-12 15:04:27 +00:00
jmp L71F7
L71E7: lda #$00
sta L70C3
2018-02-06 17:31:58 +00:00
copy16 #$0C04, $08
2017-10-12 15:04:27 +00:00
jsr L72CE
L71F7: ldx #$00
ldy #$00
lda ($08),y
and #$0F
sta $1F00,x
bne L7223
inc L70C3
lda L70C3
cmp L70C0
bne L7212
jmp L71E7
2018-02-05 04:04:14 +00:00
L7212: add16_8 $08, L70BF, $08
2017-10-12 15:04:27 +00:00
jmp L71F7
L7223: iny
inx
L7225: lda ($08),y
sta $1F00,x
iny
inx
cpx #$11
bne L7225
ldy #$13
lda ($08),y
sta $1F00,x
inx
iny
lda ($08),y
sta $1F00,x
ldy #$18
inx
L7241: lda ($08),y
sta $1F00,x
inx
iny
cpy #$1C
bne L7241
ldy #$21
L724E: lda ($08),y
sta $1F00,x
inx
iny
cpy #$25
bne L724E
ldy #$1E
lda ($08),y
sta $1F00,x
inx
ldy #$25
lda ($08),y
sta $1F00,x
inx
iny
lda ($08),y
sta $1F00,x
2017-12-31 20:04:22 +00:00
lda LCBANK2
lda LCBANK2
2017-10-12 15:04:27 +00:00
ldx #$1F
ldy #$1F
L7279: lda $1F00,x
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
dex
dey
bpl L7279
lda LCBANK1
lda LCBANK1
lda #$20
clc
2018-01-17 15:41:23 +00:00
adc $06
sta $06
2017-10-12 15:04:27 +00:00
bcc L7293
2018-01-17 15:41:23 +00:00
inc $06+1
2017-10-12 15:04:27 +00:00
L7293: jmp L71BD
2018-02-06 17:31:58 +00:00
L7296: copy16 $06, L485F
2017-10-12 15:04:27 +00:00
jsr L72D8
2018-01-11 06:31:02 +00:00
jsr pop_zp_addrs
2017-10-12 15:04:27 +00:00
rts
2017-12-31 20:32:47 +00:00
L72A7: .byte 0
L72A8: .word 0
2018-02-19 01:08:11 +00:00
.endproc
2018-01-28 16:08:39 +00:00
2018-02-16 19:25:00 +00:00
;;; --------------------------------------------------
2018-01-14 07:24:19 +00:00
L72AA: MLI_RELAY_CALL OPEN, open_params
2017-10-12 15:04:27 +00:00
beq L72CD
jsr DESKTOP_SHOW_ALERT0
2017-10-12 15:04:27 +00:00
jsr L8B1F
lda selected_window_index
2018-02-16 19:25:00 +00:00
bne :+
2018-02-15 16:08:59 +00:00
lda icon_params2
2017-10-12 15:04:27 +00:00
sta L533F
jsr L59A8
2018-02-16 19:25:00 +00:00
: ldx LE256
2017-10-12 15:04:27 +00:00
txs
L72CD: rts
2018-02-16 19:25:00 +00:00
;;; --------------------------------------------------
2018-01-14 07:52:03 +00:00
L72CE: MLI_RELAY_CALL READ, read_params
2017-10-12 15:04:27 +00:00
rts
2018-01-14 07:24:19 +00:00
L72D8: MLI_RELAY_CALL CLOSE, close_params
2017-10-12 15:04:27 +00:00
rts
2018-02-16 19:25:00 +00:00
;;; --------------------------------------------------
2018-02-12 01:21:37 +00:00
2017-10-12 15:04:27 +00:00
L72E2: lda $0C04
and #$F0
cmp #$F0
beq L72EC
rts
2018-02-12 01:21:37 +00:00
2018-01-14 08:17:32 +00:00
L72EC: MLI_RELAY_CALL GET_FILE_INFO, get_file_info_params4
2017-10-12 15:04:27 +00:00
beq L72F8
rts
2018-02-16 19:25:00 +00:00
;;; --------------------------------------------------
2018-02-12 01:21:37 +00:00
2018-02-06 17:31:58 +00:00
L72F8: copy16 get_file_info_params4::aux_type, L70BD
2018-02-06 18:06:44 +00:00
sub16 get_file_info_params4::aux_type, get_file_info_params4::blocks_used, L70BB
sub16 L70BD, L70BB, L70BD
2018-02-10 06:10:11 +00:00
lsr16 L70BB
2017-10-12 15:04:27 +00:00
php
2018-02-10 06:10:11 +00:00
lsr16 L70BD
2017-10-12 15:04:27 +00:00
plp
bcc L7342
2018-02-26 00:06:17 +00:00
inc16 L70BD
2018-02-16 03:29:05 +00:00
L7342: return #0
2018-02-16 19:25:00 +00:00
.endproc
L70BB := L7054::L70BB
L70BD := L7054::L70BD
L705D := L7054::L705D
L72EC := L7054::L72EC
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-12 01:21:37 +00:00
.proc L7345
sta L7445
2017-10-12 15:04:27 +00:00
ldx #$00
2018-02-15 16:08:59 +00:00
L734A: lda LE1F1+1,x
2017-10-12 15:04:27 +00:00
cmp L7445
2018-02-16 19:25:00 +00:00
beq :+
2017-10-12 15:04:27 +00:00
inx
cpx #$08
bne L734A
rts
2018-02-16 19:25:00 +00:00
: stx L7446
2017-10-12 15:04:27 +00:00
dex
2018-02-16 19:25:00 +00:00
: inx
2018-02-19 22:06:12 +00:00
lda LE1F1+2,x
2018-02-15 16:08:59 +00:00
sta LE1F1+1,x
cpx LE1F1
2018-02-16 19:25:00 +00:00
bne :-
2018-02-15 16:08:59 +00:00
dec LE1F1
2017-10-12 15:04:27 +00:00
lda L7446
2018-02-15 16:08:59 +00:00
cmp LE1F1
2018-02-16 19:25:00 +00:00
bne :+
2017-10-12 15:04:27 +00:00
ldx L7446
asl a
tax
2018-02-15 16:08:59 +00:00
copy16 LE202,x, L485F
2017-10-12 15:04:27 +00:00
rts
2018-02-16 19:25:00 +00:00
: lda L7446
2017-10-12 15:04:27 +00:00
asl a
tax
2018-02-15 16:08:59 +00:00
copy16 LE202,x, $06
2017-10-12 15:04:27 +00:00
inx
inx
2018-02-15 16:08:59 +00:00
copy16 LE202,x, $08
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-11 06:31:02 +00:00
jsr push_zp_addrs
2017-12-31 20:04:22 +00:00
L73A5: lda LCBANK2
lda LCBANK2
2017-10-12 15:04:27 +00:00
lda ($08),y
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
lda LCBANK1
lda LCBANK1
2018-02-26 00:06:17 +00:00
inc16 $06
inc16 $08
lda $08+1
2018-02-06 23:36:39 +00:00
cmp L485F+1
2017-10-12 15:04:27 +00:00
bne L73A5
lda $08
cmp L485F
bne L73A5
2018-01-11 06:31:02 +00:00
jsr pop_zp_addrs
2018-02-15 16:08:59 +00:00
lda LE1F1
2017-10-12 15:04:27 +00:00
asl a
tax
2018-02-15 16:08:59 +00:00
sub16 L485F, LE202,x, L7447
2017-10-12 15:04:27 +00:00
inc L7446
L73ED: lda L7446
2018-02-15 16:08:59 +00:00
cmp LE1F1
2018-02-16 19:25:00 +00:00
bne :+
2017-10-12 15:04:27 +00:00
jmp L7429
2018-02-16 19:25:00 +00:00
: lda L7446
2017-10-12 15:04:27 +00:00
asl a
tax
2018-02-15 16:08:59 +00:00
sub16 LE202+2,x, LE202,x, L7449
add16 LE200,x, L7449, LE202,x
2017-10-12 15:04:27 +00:00
inc L7446
jmp L73ED
2018-02-15 16:08:59 +00:00
L7429: lda LE1F1
2017-10-12 15:04:27 +00:00
sec
sbc #$01
asl a
tax
2018-02-15 16:08:59 +00:00
add16 LE202,x, L7447, L485F
2017-10-12 15:04:27 +00:00
rts
2018-02-16 19:25:00 +00:00
2017-12-31 20:32:47 +00:00
L7445: .byte 0
L7446: .byte 0
L7447: .word 0
2017-12-31 20:32:47 +00:00
L7449: .byte 0
L744A: .byte 0
2018-02-12 01:21:37 +00:00
.endproc
2018-01-28 16:08:39 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-12 01:21:37 +00:00
.proc L744B
lda cached_window_id
2017-10-12 15:04:27 +00:00
asl a
tax
2018-03-05 05:33:56 +00:00
copy16 LE6BF,x, $08
2017-10-12 15:04:27 +00:00
ldy #$09
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tay
2018-01-11 06:31:02 +00:00
jsr push_zp_addrs
2018-01-17 15:41:23 +00:00
lda $06
2017-10-12 15:04:27 +00:00
clc
adc #$09
2018-01-17 15:41:23 +00:00
sta $06
2017-10-12 15:04:27 +00:00
bcc L746D
2018-01-17 15:41:23 +00:00
inc $06+1
2017-10-12 15:04:27 +00:00
L746D: tya
tax
ldy #$00
2018-01-17 15:41:23 +00:00
L7471: lda ($06),y
2017-10-12 15:04:27 +00:00
sta ($08),y
iny
dex
bne L7471
lda #$20
sta ($08),y
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
2017-10-12 15:04:27 +00:00
lda ($08),y
2018-02-09 05:42:59 +00:00
and #%11011111 ; ???
2017-10-12 15:04:27 +00:00
sta ($08),y
2018-01-11 06:31:02 +00:00
jsr pop_zp_addrs
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-09 05:42:59 +00:00
and #icon_entry_winid_mask
2017-10-12 15:04:27 +00:00
bne L74D3
2018-01-11 06:31:02 +00:00
jsr push_zp_addrs
2018-02-08 05:48:19 +00:00
lda cached_window_id
2018-01-21 03:02:34 +00:00
jsr window_address_lookup
2018-02-05 04:35:19 +00:00
stax $08
2018-01-17 15:41:23 +00:00
lda $06
2017-10-12 15:04:27 +00:00
clc
adc #$09
2018-01-17 15:41:23 +00:00
sta $06
2017-10-12 15:04:27 +00:00
bcc L74A8
2018-01-17 15:41:23 +00:00
inc $06+1
2017-10-12 15:04:27 +00:00
L74A8: ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tay
2018-01-17 15:41:23 +00:00
L74AD: lda ($06),y
2017-10-12 15:04:27 +00:00
sta ($08),y
dey
bpl L74AD
ldy #$00
lda ($08),y
sec
sbc #$01
sta ($08),y
ldy #$01
lda #$2F
sta ($08),y
ldy #$00
lda ($08),y
tay
L74C8: lda ($08),y
2018-02-15 16:08:59 +00:00
sta LE1B0,y
2017-10-12 15:04:27 +00:00
dey
bpl L74C8
jmp L7569
L74D3: tay
lda #$00
sta L7620
2018-01-11 06:31:02 +00:00
jsr push_zp_addrs
2017-10-12 15:04:27 +00:00
tya
pha
2018-01-21 03:02:34 +00:00
jsr window_address_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
pla
asl a
tax
2018-03-05 05:33:56 +00:00
copy16 LE6BF,x, $08
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
clc
adc ($08),y
cmp #$43
bcc L750D
lda #$40
jsr DESKTOP_SHOW_ALERT0
2017-10-12 15:04:27 +00:00
jsr L8B1F
2018-02-15 16:08:59 +00:00
dec LEC2E
ldx LE256
2017-10-12 15:04:27 +00:00
txs
rts
L750D: ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tay
2018-01-17 15:41:23 +00:00
L7512: lda ($06),y
2018-02-15 16:08:59 +00:00
sta LE1B0,y
2017-10-12 15:04:27 +00:00
dey
bpl L7512
2018-02-19 22:06:12 +00:00
lda #'/'
sta LE1B0+1
2018-02-15 16:08:59 +00:00
inc LE1B0
ldx LE1B0
sta LE1B0,x
lda icon_params2
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-02-05 04:35:19 +00:00
stax $08
2018-02-15 16:08:59 +00:00
ldx LE1B0
2017-10-12 15:04:27 +00:00
ldy #$09
lda ($08),y
clc
2018-02-15 16:08:59 +00:00
adc LE1B0
sta LE1B0
dec LE1B0
dec LE1B0
2017-10-12 15:04:27 +00:00
ldy #$0A
L7548: iny
inx
lda ($08),y
2018-02-15 16:08:59 +00:00
sta LE1B0,x
cpx LE1B0
2017-10-12 15:04:27 +00:00
bne L7548
2018-02-08 05:48:19 +00:00
lda cached_window_id
2018-01-21 03:02:34 +00:00
jsr window_address_lookup
2018-02-05 04:35:19 +00:00
stax $08
2018-02-15 16:08:59 +00:00
ldy LE1B0
L7561: lda LE1B0,y
2017-10-12 15:04:27 +00:00
sta ($08),y
dey
bpl L7561
2018-02-09 05:42:59 +00:00
L7569: addr_call_indirect capitalize_string, $08
2018-02-08 05:48:19 +00:00
lda cached_window_id
2018-01-21 03:02:34 +00:00
jsr window_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$14
2018-02-08 05:48:19 +00:00
lda cached_window_id
2017-10-12 15:04:27 +00:00
sec
sbc #$01
asl a
asl a
asl a
asl a
pha
adc #$05
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
iny
lda #$00
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
iny
pla
lsr a
clc
2018-02-08 05:36:53 +00:00
adc #icon_entry_size
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
iny
lda #$00
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
lda #$00
ldy #$1F
ldx #$03
2018-01-17 15:41:23 +00:00
L75A3: sta ($06),y
2017-10-12 15:04:27 +00:00
dey
dex
bpl L75A3
ldy #$04
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
and #$FE
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
and #$FE
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
lda #$00
ldy #$07
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
ldy #$09
2018-01-17 15:41:23 +00:00
sta ($06),y
2018-01-11 06:31:02 +00:00
jsr pop_zp_addrs
2018-02-15 16:08:59 +00:00
lda icon_params2
2017-10-12 15:04:27 +00:00
jsr L7054
2018-02-15 16:08:59 +00:00
lda icon_params2
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-02-05 04:35:19 +00:00
stax $06
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-09 05:42:59 +00:00
and #icon_entry_winid_mask
2017-10-12 15:04:27 +00:00
beq L75FA
tax
dex
txa
asl a
tax
2018-02-10 06:10:11 +00:00
copy16 window_k_used_table,x, L70BD
copy16 window_k_free_table,x, L70BB
2018-02-08 05:48:19 +00:00
L75FA: ldx cached_window_id
2017-10-12 15:04:27 +00:00
dex
txa
asl a
tax
2018-02-10 06:10:11 +00:00
copy16 L70BD, window_k_used_table,x
copy16 L70BB, window_k_free_table,x
2018-02-08 05:48:19 +00:00
lda cached_window_id
2017-10-12 15:04:27 +00:00
jsr L7635
rts
2018-02-09 05:42:59 +00:00
2017-12-31 02:02:15 +00:00
L7620: .byte $00
2018-02-12 01:21:37 +00:00
.endproc
2018-01-28 16:08:39 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-09 05:42:59 +00:00
;;; Icon entry construction
L7621: .byte $00 ; window_id ?
L7622: .addr 0 ; iconbits
L7624: .byte $00 ; icon type
2017-12-31 02:02:15 +00:00
L7625: .byte $00
2018-02-09 05:42:59 +00:00
L7626: .word $34,$10
L762A: .word 0
L762C: .word 0
2017-10-12 15:04:27 +00:00
L762E: .byte $05
2017-12-31 02:02:15 +00:00
L762F: .byte $00
L7630: .word 0
2017-12-31 02:02:15 +00:00
L7632: .byte $00
L7633: .byte $00
L7634: .byte $00
2018-02-09 05:42:59 +00:00
2018-02-16 19:25:00 +00:00
.proc L7635
pha
2017-10-12 15:04:27 +00:00
lda #$00
beq L7647
L763A: pha
2018-02-08 05:48:19 +00:00
ldx cached_window_id
2017-10-12 15:04:27 +00:00
dex
2018-01-13 03:06:55 +00:00
lda LEC26,x
2018-02-15 16:08:59 +00:00
sta icon_params2
2017-10-12 15:04:27 +00:00
lda #$80
L7647: sta L7634
pla
sta L7621
2018-01-11 06:31:02 +00:00
jsr push_zp_addrs
2017-10-12 15:04:27 +00:00
ldx #$03
L7653: lda L7626,x
sta L762A,x
dex
bpl L7653
lda #$00
sta L762F
sta L7625
ldx #$03
L7666: sta L7630,x
dex
bpl L7666
2018-02-15 16:08:59 +00:00
lda icon_params2
ldx LE1F1
2017-10-12 15:04:27 +00:00
dex
2018-02-16 19:25:00 +00:00
: cmp LE1F1+1,x
beq :+
2017-10-12 15:04:27 +00:00
dex
2018-02-16 19:25:00 +00:00
bpl :-
2017-10-12 15:04:27 +00:00
rts
2018-02-16 19:25:00 +00:00
: txa
2017-10-12 15:04:27 +00:00
asl a
tax
2018-02-15 16:08:59 +00:00
copy16 LE202,x, $06
2017-12-31 20:04:22 +00:00
lda LCBANK2
lda LCBANK2
2018-02-08 05:36:53 +00:00
ldy #0
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
sta L7764
lda LCBANK1
lda LCBANK1
2018-01-17 15:41:23 +00:00
inc $06
lda $06
2017-10-12 15:04:27 +00:00
bne L76A4
2018-01-17 15:41:23 +00:00
inc $06+1
2018-02-08 05:48:19 +00:00
L76A4: lda cached_window_id
2018-02-03 04:41:42 +00:00
sta active_window_id
2017-10-12 15:04:27 +00:00
L76AA: lda L7625
cmp L7764
beq L76BB
jsr L7768
inc L7625
jmp L76AA
L76BB: bit L7634
2018-02-16 19:25:00 +00:00
bpl :+
2018-01-11 06:31:02 +00:00
jsr pop_zp_addrs
2017-10-12 15:04:27 +00:00
rts
2018-02-16 19:25:00 +00:00
: jsr L7B6B
2017-10-12 15:04:27 +00:00
lda L7621
2018-01-21 03:02:34 +00:00
jsr window_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$16
lda L7B65
sec
2018-01-17 15:41:23 +00:00
sbc ($06),y
2017-10-12 15:04:27 +00:00
sta L7B65
lda L7B66
sbc #$00
sta L7B66
2018-03-15 03:53:20 +00:00
cmp16 L7B63, #170
2017-10-12 15:04:27 +00:00
bmi L7705
2018-03-15 03:53:20 +00:00
cmp16 L7B63, #450
2017-10-12 15:04:27 +00:00
bpl L770C
2018-02-05 04:21:34 +00:00
ldax L7B63
2017-10-12 15:04:27 +00:00
jmp L7710
2018-02-24 05:12:41 +00:00
L7705: addr_jump L7710, $00AA
2017-10-12 15:04:27 +00:00
2018-02-24 05:12:41 +00:00
L770C: ldax #$01C2
2017-10-12 15:04:27 +00:00
L7710: ldy #$20
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
txa
iny
2018-01-17 15:41:23 +00:00
sta ($06),y
2018-03-15 03:53:20 +00:00
cmp16 L7B65, #50
2017-10-12 15:04:27 +00:00
bmi L7739
2018-03-15 03:53:20 +00:00
cmp16 L7B65, #108
2017-10-12 15:04:27 +00:00
bpl L7740
2018-02-05 04:21:34 +00:00
ldax L7B65
2017-10-12 15:04:27 +00:00
jmp L7744
2018-02-24 05:12:41 +00:00
L7739: addr_jump L7744, $0032
2017-10-12 15:04:27 +00:00
2018-02-16 19:25:00 +00:00
L7740: ldax #$6C
2017-10-12 15:04:27 +00:00
L7744: ldy #$22
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
txa
iny
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
lda L7767
ldy #$06
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
ldy #$08
2018-01-17 15:41:23 +00:00
sta ($06),y
2018-02-15 16:08:59 +00:00
lda icon_params2
2017-10-12 15:04:27 +00:00
ldx L7621
jsr L8B60
2018-01-11 06:31:02 +00:00
jsr pop_zp_addrs
2017-10-12 15:04:27 +00:00
rts
2018-02-16 19:25:00 +00:00
2017-12-31 02:02:15 +00:00
L7764: .byte $00,$00,$00
2017-10-12 15:04:27 +00:00
L7767: .byte $14
2018-01-28 16:08:39 +00:00
2018-02-16 19:25:00 +00:00
.endproc
L763A := L7635::L763A
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-09 05:42:59 +00:00
;;; Create icon
.proc L7768
inc LDD9E
2018-02-08 05:36:53 +00:00
jsr DESKTOP_ALLOC_ICON
2018-02-08 05:48:19 +00:00
ldx cached_window_icon_count
inc cached_window_icon_count
sta cached_window_icon_list,x
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-02-05 04:35:19 +00:00
stax $08
2017-12-31 20:04:22 +00:00
lda LCBANK2
lda LCBANK2
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
sta $1800
iny
ldx #$00
2018-01-17 15:41:23 +00:00
L778E: lda ($06),y
2017-10-12 15:04:27 +00:00
sta $1802,x
inx
iny
cpx $1800
bne L778E
inc $1800
inc $1800
lda #$20
sta $1801
ldx $1800
sta $1800,x
ldy #$10
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
cmp #$B3
beq L77CC
cmp #$FF
bne L77DA
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tay
ldx L77D0
2018-01-17 15:41:23 +00:00
L77BF: lda ($06),y
2017-10-12 15:04:27 +00:00
cmp L77D0,x
bne L77D8
dey
beq L77D8
dex
bne L77BF
L77CC: lda #$01
bne L77DA
2018-01-01 05:16:41 +00:00
L77D0: PASCAL_STRING ".SYSTEM"
2018-01-28 16:08:39 +00:00
2017-10-12 15:04:27 +00:00
L77D8: lda #$FF
L77DA: tay
lda LCBANK1
lda LCBANK1
tya
2018-02-09 05:42:59 +00:00
;; L7622/3 = icon bits addr
;; L7624 = icon type
jsr find_icon_details_for_file_type
addr_call capitalize_string, $1800
ldy #icon_entry_offset_len
ldx #0
2017-10-12 15:04:27 +00:00
L77F0: lda $1800,x
sta ($08),y
iny
inx
cpx $1800
bne L77F0
lda $1800,x
sta ($08),y
ldx #$00
ldy #$03
L7805: lda L762A,x
sta ($08),y
inx
iny
cpx #$04
bne L7805
2018-02-08 05:48:19 +00:00
lda cached_window_icon_count
2017-10-12 15:04:27 +00:00
cmp L762E
beq L781A
bcs L7826
2018-02-09 05:42:59 +00:00
L781A: copy16 L762A, L7630
L7826: copy16 L762C, L7632
2017-10-12 15:04:27 +00:00
inc L762F
lda L762F
cmp L762E
bne L7862
2018-03-15 03:53:20 +00:00
add16 L762C, #32, L762C
2018-02-09 05:42:59 +00:00
copy16 L7626, L762A
2017-10-12 15:04:27 +00:00
lda #$00
sta L762F
jmp L7870
L7862: lda L762A
clc
adc #$50
sta L762A
bcc L7870
2018-02-09 05:42:59 +00:00
inc L762A+1
2018-02-08 05:48:19 +00:00
L7870: lda cached_window_id
2017-10-12 15:04:27 +00:00
ora L7624
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
2017-10-12 15:04:27 +00:00
sta ($08),y
2018-02-07 05:59:25 +00:00
ldy #icon_entry_offset_iconbits
2017-10-12 15:04:27 +00:00
lda L7622
sta ($08),y
iny
2018-02-09 05:42:59 +00:00
lda L7622+1
2017-10-12 15:04:27 +00:00
sta ($08),y
2018-02-08 05:48:19 +00:00
ldx cached_window_icon_count
2017-10-12 15:04:27 +00:00
dex
2018-02-08 05:48:19 +00:00
lda cached_window_icon_list,x
2018-02-13 16:18:11 +00:00
jsr icon_screen_to_window
2018-03-15 03:53:20 +00:00
add16 $06, #32, $06
2017-10-12 15:04:27 +00:00
rts
2017-12-31 20:32:47 +00:00
.byte 0
.byte 0
2018-02-09 05:42:59 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-28 16:08:39 +00:00
2018-02-09 05:42:59 +00:00
.proc find_icon_details_for_file_type
ptr := $6
sta file_type
2018-01-11 06:31:02 +00:00
jsr push_zp_addrs
2018-02-09 05:42:59 +00:00
;; Find index of file type
copy16 type_table_addr, ptr
ldy #0
lda (ptr),y ; first entry is size of table
2017-10-12 15:04:27 +00:00
tay
2018-02-09 05:42:59 +00:00
: lda (ptr),y
cmp file_type
beq found
2017-10-12 15:04:27 +00:00
dey
2018-02-09 05:42:59 +00:00
bpl :-
ldy #1 ; default is first entry (FT_TYPELESS)
found:
;; Look up icon type
copy16 icon_type_table_addr, ptr
lda (ptr),y
2017-10-12 15:04:27 +00:00
sta L7624
dey
tya
asl a
tay
2018-02-09 05:42:59 +00:00
;; Look up icon definition
copy16 type_icons_addr, ptr
lda (ptr),y
2017-10-12 15:04:27 +00:00
sta L7622
iny
2018-02-09 05:42:59 +00:00
lda (ptr),y
sta L7622+1
2018-01-11 06:31:02 +00:00
jsr pop_zp_addrs
2017-10-12 15:04:27 +00:00
rts
2018-02-09 05:42:59 +00:00
file_type:
.byte 0
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-10 06:10:11 +00:00
;;; Draw header (items/k in disk/k available/lines)
.proc draw_window_header
2018-02-09 05:42:59 +00:00
2018-02-10 05:24:35 +00:00
;; Compute header coords
;; x coords
lda grafport2::cliprect::x1
2018-02-10 06:10:11 +00:00
sta header_line_left::xcoord
2017-10-12 15:04:27 +00:00
clc
2018-02-10 05:24:35 +00:00
adc #5
2018-02-06 23:36:39 +00:00
sta items_label_pos::xcoord
2018-02-06 04:37:41 +00:00
lda grafport2::cliprect::x1+1
2018-02-10 06:10:11 +00:00
sta header_line_left::xcoord+1
2018-02-10 05:24:35 +00:00
adc #0
2018-02-06 23:36:39 +00:00
sta items_label_pos::xcoord+1
2018-02-10 05:24:35 +00:00
;; y coords
2018-02-06 04:37:41 +00:00
lda grafport2::cliprect::y1
2017-10-12 15:04:27 +00:00
clc
2018-02-10 05:24:35 +00:00
adc #12
2018-02-10 06:10:11 +00:00
sta header_line_left::ycoord
sta header_line_right::ycoord
2018-02-06 04:37:41 +00:00
lda grafport2::cliprect::y1+1
2018-02-10 05:24:35 +00:00
adc #0
2018-02-10 06:10:11 +00:00
sta header_line_left::ycoord+1
sta header_line_right::ycoord+1
2018-02-10 05:24:35 +00:00
2018-02-10 06:10:11 +00:00
;; Draw top line
MGTK_RELAY_CALL MGTK::MoveTo, header_line_left
copy16 grafport2::cliprect::x2, header_line_right::xcoord
2018-02-03 04:41:42 +00:00
jsr set_penmode_xor
2018-02-10 06:10:11 +00:00
MGTK_RELAY_CALL MGTK::LineTo, header_line_right
2018-02-10 05:24:35 +00:00
2018-02-10 06:10:11 +00:00
;; Offset down by 2px
lda header_line_left::ycoord
2017-10-12 15:04:27 +00:00
clc
2018-02-02 06:04:23 +00:00
adc #2
2018-02-10 06:10:11 +00:00
sta header_line_left::ycoord
sta header_line_right::ycoord
lda header_line_left::ycoord+1
2018-02-02 06:04:23 +00:00
adc #0
2018-02-10 06:10:11 +00:00
sta header_line_left::ycoord+1
sta header_line_right::ycoord+1
2018-02-10 05:24:35 +00:00
2018-02-10 06:10:11 +00:00
;; Draw bottom line
MGTK_RELAY_CALL MGTK::MoveTo, header_line_left
MGTK_RELAY_CALL MGTK::LineTo, header_line_right
2018-02-10 05:24:35 +00:00
2018-02-10 06:10:11 +00:00
;; Baseline for header text
2018-02-10 05:24:35 +00:00
add16 grafport2::cliprect::y1, #10, items_label_pos::ycoord
2018-02-10 06:10:11 +00:00
;; Draw "XXX Items"
2018-02-08 05:48:19 +00:00
lda cached_window_icon_count
2018-02-10 06:10:11 +00:00
ldx #0
2018-02-10 05:24:35 +00:00
jsr int_to_string
2018-02-08 05:48:19 +00:00
lda cached_window_icon_count
2018-02-10 06:10:11 +00:00
cmp #2 ; plural?
bcs :+
2018-01-11 06:31:02 +00:00
dec str_items ; remove trailing s
2018-02-10 06:10:11 +00:00
: MGTK_RELAY_CALL MGTK::MoveTo, items_label_pos
jsr draw_int_string
addr_call draw_pascal_string, str_items
2018-02-08 05:48:19 +00:00
lda cached_window_icon_count
2018-02-10 05:24:35 +00:00
cmp #2
2018-02-10 06:10:11 +00:00
bcs :+
2018-01-11 06:31:02 +00:00
inc str_items ; restore trailing s
2018-02-10 06:10:11 +00:00
;; Draw "XXXK in disk"
: jsr calc_header_coords
2018-02-03 04:41:42 +00:00
ldx active_window_id
2018-02-10 06:10:11 +00:00
dex ; index 0 is window 1
2017-10-12 15:04:27 +00:00
txa
asl a
tax
2018-02-10 06:10:11 +00:00
lda window_k_used_table,x
2017-10-12 15:04:27 +00:00
tay
2018-02-10 06:10:11 +00:00
lda window_k_used_table+1,x
2017-10-12 15:04:27 +00:00
tax
tya
2018-02-10 05:24:35 +00:00
jsr int_to_string
2018-02-10 06:10:11 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, pos_k_in_disk
jsr draw_int_string
addr_call draw_pascal_string, str_k_in_disk
;; Draw "XXXK available"
2018-02-03 04:41:42 +00:00
ldx active_window_id
2018-02-10 06:10:11 +00:00
dex ; index 0 is window 1
2017-10-12 15:04:27 +00:00
txa
asl a
tax
2018-02-10 06:10:11 +00:00
lda window_k_free_table,x
2017-10-12 15:04:27 +00:00
tay
2018-02-10 06:10:11 +00:00
lda window_k_free_table+1,x
2017-10-12 15:04:27 +00:00
tax
tya
2018-02-10 05:24:35 +00:00
jsr int_to_string
2018-02-10 06:10:11 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, pos_k_available
jsr draw_int_string
addr_call draw_pascal_string, str_k_available
2017-10-12 15:04:27 +00:00
rts
2018-02-10 06:10:11 +00:00
;;; --------------------------------------------------
2018-02-10 05:24:35 +00:00
.proc calc_header_coords
2018-02-10 06:10:11 +00:00
;; Width of window
2018-02-10 05:24:35 +00:00
sub16 grafport2::cliprect::x2, grafport2::cliprect::x1, xcoord
2018-02-10 06:10:11 +00:00
;; Is there room to spread things out?
2018-02-10 05:24:35 +00:00
sub16 xcoord, width_items_label, xcoord
bpl :+
2018-02-10 06:10:11 +00:00
jmp skipcenter
2018-02-10 05:24:35 +00:00
: sub16 xcoord, width_right_labels, xcoord
bpl :+
2018-02-10 06:10:11 +00:00
jmp skipcenter
2017-10-12 15:04:27 +00:00
2018-02-10 06:10:11 +00:00
;; Yes - center "k in disk"
: add16 width_left_labels, xcoord, pos_k_available::xcoord
2018-02-10 05:24:35 +00:00
lda xcoord+1
2018-02-10 06:10:11 +00:00
beq :+
2018-02-10 05:24:35 +00:00
lda xcoord
2018-02-10 06:10:11 +00:00
cmp #24 ; threshold
bcc nosub
: sub16 pos_k_available::xcoord, #12, pos_k_available::xcoord
nosub: lsr16 xcoord ; divide by 2 to center
add16 width_items_label_padded, xcoord, pos_k_in_disk::xcoord
jmp finish
;; No - just squish things together
skipcenter:
copy16 width_items_label_padded, pos_k_in_disk::xcoord
copy16 width_left_labels, pos_k_available::xcoord
finish:
add16 pos_k_in_disk::xcoord, grafport2::cliprect::x1, pos_k_in_disk::xcoord
add16 pos_k_available::xcoord, grafport2::cliprect::x1, pos_k_available::xcoord
;; Update y coords
2018-02-10 05:24:35 +00:00
lda items_label_pos::ycoord
2018-02-10 06:10:11 +00:00
sta pos_k_in_disk::ycoord
sta pos_k_available::ycoord
2018-02-10 05:24:35 +00:00
lda items_label_pos::ycoord+1
2018-02-10 06:10:11 +00:00
sta pos_k_in_disk::ycoord+1
sta pos_k_available::ycoord+1
2017-10-12 15:04:27 +00:00
rts
2018-02-10 06:59:05 +00:00
.endproc ; calc_header_coords
2017-10-12 15:04:27 +00:00
2018-02-10 06:10:11 +00:00
draw_int_string:
addr_jump draw_pascal_string, str_from_int
2018-02-10 05:24:35 +00:00
xcoord:
.word 0
2018-02-10 06:10:11 +00:00
;;; --------------------------------------------------
2017-10-12 15:04:27 +00:00
2018-02-10 05:24:35 +00:00
.proc int_to_string
stax value
2018-02-06 23:42:18 +00:00
2018-02-10 05:24:35 +00:00
;; Fill buffer with spaces
2018-02-06 23:42:18 +00:00
ldx #6
lda #' '
2018-02-10 05:24:35 +00:00
: sta str_from_int,x
2017-10-12 15:04:27 +00:00
dex
2018-02-06 23:42:18 +00:00
bne :-
lda #0
2018-02-10 06:59:05 +00:00
sta nonzero_flag
2018-02-10 05:24:35 +00:00
ldy #0 ; y = position in string
ldx #0 ; x = which power index is subtracted (*2)
;; For each power of ten
loop: lda #0
sta digit
;; Keep subtracting/incrementing until zero is hit
sloop: cmp16 value, powers,x
bpl subtract
lda digit
bne not_pad
2018-02-10 06:59:05 +00:00
bit nonzero_flag
2018-02-10 05:24:35 +00:00
bmi not_pad
;; Pad with space
lda #' '
bne :+
;; Convert to ASCII
not_pad:
clc
adc #'0' ; why not ORA $30 ???
2017-10-12 15:04:27 +00:00
pha
lda #$80
2018-02-10 06:59:05 +00:00
sta nonzero_flag
2017-10-12 15:04:27 +00:00
pla
2018-02-10 05:24:35 +00:00
2018-02-10 06:59:05 +00:00
;; Place the character, move to next
2018-02-10 05:24:35 +00:00
: sta str_from_int+2,y
2017-10-12 15:04:27 +00:00
iny
inx
inx
2018-02-13 16:18:11 +00:00
cpx #8 ; up to 4 digits (*2) via subtraction
2018-02-10 05:24:35 +00:00
beq done
jmp loop
2017-10-12 15:04:27 +00:00
2018-02-10 05:24:35 +00:00
subtract:
inc digit
sub16 value, powers,x, value
jmp sloop
done: lda value ; handle last digit
2018-01-12 18:01:28 +00:00
ora #'0'
2018-02-10 05:24:35 +00:00
sta str_from_int+2,y
2017-10-12 15:04:27 +00:00
rts
2018-02-10 05:24:35 +00:00
powers: .word 10000, 1000, 100, 10
value: .word 0 ; remaining value as subtraction proceeds
digit: .byte 0 ; current digit being accumulated
2018-02-10 06:59:05 +00:00
nonzero_flag: ; high bit set once a non-zero digit seen
2018-02-10 05:24:35 +00:00
.byte 0
2018-02-10 06:10:11 +00:00
.endproc ; int_to_string
2018-02-10 06:59:05 +00:00
.endproc ; draw_window_header
2018-02-10 05:24:35 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-10 05:24:35 +00:00
2017-12-31 20:32:47 +00:00
L7B5F: .byte 0
L7B60: .byte 0
L7B61: .byte 0
L7B62: .byte 0
2018-02-14 05:52:36 +00:00
2017-12-31 20:32:47 +00:00
L7B63: .byte 0
L7B64: .byte 0
L7B65: .byte 0
L7B66: .byte 0
2018-02-14 05:52:36 +00:00
2017-12-31 20:32:47 +00:00
L7B67: .byte 0
L7B68: .byte 0
L7B69: .byte 0
L7B6A: .byte 0
2018-02-14 05:52:36 +00:00
.proc L7B6B
ldx #3
lda #0
2017-10-12 15:04:27 +00:00
L7B6F: sta L7B63,x
dex
bpl L7B6F
2018-02-14 05:52:36 +00:00
2017-10-12 15:04:27 +00:00
sta L7D5B
lda #$FF
sta L7B5F
sta L7B61
lda #$7F
sta L7B60
sta L7B62
2018-02-08 05:48:19 +00:00
ldx cached_window_id
2017-10-12 15:04:27 +00:00
dex
2018-02-03 03:38:35 +00:00
lda win_buf_table,x
2017-10-12 15:04:27 +00:00
bpl L7BCB
2018-02-08 05:48:19 +00:00
lda cached_window_icon_count
2017-10-12 15:04:27 +00:00
bne L7BA1
2018-02-24 05:12:41 +00:00
L7B96: ldax #$0300
2017-10-12 15:04:27 +00:00
L7B9A: sta L7B5F,x
dex
bpl L7B9A
rts
L7BA1: clc
adc #$02
ldx #$00
stx L7D5C
asl a
rol L7D5C
asl a
rol L7D5C
asl a
rol L7D5C
sta L7B65
lda L7D5C
sta L7B66
2018-02-06 17:31:58 +00:00
copy16 #$168, L7B63
2017-10-12 15:04:27 +00:00
jmp L7B96
2018-02-08 05:48:19 +00:00
L7BCB: lda cached_window_icon_count
2017-10-12 15:04:27 +00:00
cmp #$01
bne L7BEF
2018-02-08 05:48:19 +00:00
lda cached_window_icon_list
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$06
ldx #$03
2018-01-17 15:41:23 +00:00
L7BE0: lda ($06),y
2017-10-12 15:04:27 +00:00
sta L7B5F,x
sta L7B63,x
dey
dex
bpl L7BE0
jmp L7BF7
L7BEF: lda L7D5B
2018-02-08 05:48:19 +00:00
cmp cached_window_icon_count
2017-10-12 15:04:27 +00:00
bne L7C36
L7BF7: lda L7B63
clc
adc #$32
sta L7B63
bcc L7C05
inc L7B64
L7C05: lda L7B65
clc
adc #$20
sta L7B65
bcc L7C13
inc L7B66
2018-03-15 03:53:20 +00:00
L7C13: sub16 L7B5F, #50, L7B5F
sub16 L7B61, #15, L7B61
2017-10-12 15:04:27 +00:00
rts
L7C36: tax
2018-02-08 05:48:19 +00:00
lda cached_window_icon_list,x
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-02-05 04:35:19 +00:00
stax $06
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-09 05:42:59 +00:00
and #icon_entry_winid_mask
2017-10-12 15:04:27 +00:00
cmp L7D5C
bne L7C52
inc L7D5B
jmp L7BEF
L7C52: ldy #$06
ldx #$03
2018-01-17 15:41:23 +00:00
L7C56: lda ($06),y
2017-10-12 15:04:27 +00:00
sta L7B67,x
dey
dex
bpl L7C56
bit L7B60
bmi L7C88
bit L7B68
bmi L7CCE
2018-02-06 18:06:44 +00:00
cmp16 L7B67, L7B5F
2017-10-12 15:04:27 +00:00
bmi L7CCE
2018-02-06 18:06:44 +00:00
cmp16 L7B67, L7B63
2017-10-12 15:04:27 +00:00
bpl L7CBF
jmp L7CDA
L7C88: bit L7B68
bmi L7CA3
bit L7B64
bmi L7CDA
2018-02-06 18:06:44 +00:00
cmp16 L7B67, L7B63
2017-10-12 15:04:27 +00:00
bmi L7CDA
jmp L7CBF
2018-02-06 18:06:44 +00:00
L7CA3: cmp16 L7B67, L7B5F
2017-10-12 15:04:27 +00:00
bmi L7CCE
2018-02-06 18:06:44 +00:00
cmp16 L7B67, L7B63
2017-10-12 15:04:27 +00:00
bmi L7CDA
2018-02-06 18:06:44 +00:00
L7CBF: copy16 L7B67, L7B63
2017-10-12 15:04:27 +00:00
jmp L7CDA
2018-02-06 18:06:44 +00:00
L7CCE: copy16 L7B67, L7B5F
2017-10-12 15:04:27 +00:00
L7CDA: bit L7B62
bmi L7D03
bit L7B6A
bmi L7D49
2018-02-06 18:06:44 +00:00
cmp16 L7B69, L7B61
2017-10-12 15:04:27 +00:00
bmi L7D49
2018-02-06 18:06:44 +00:00
cmp16 L7B69, L7B65
2017-10-12 15:04:27 +00:00
bpl L7D3A
jmp L7D55
L7D03: bit L7B6A
bmi L7D1E
bit L7B66
bmi L7D55
2018-02-06 18:06:44 +00:00
cmp16 L7B69, L7B65
2017-10-12 15:04:27 +00:00
bmi L7D55
jmp L7D3A
2018-02-06 18:06:44 +00:00
L7D1E: cmp16 L7B69, L7B61
2017-10-12 15:04:27 +00:00
bmi L7D49
2018-02-06 18:06:44 +00:00
cmp16 L7B69, L7B65
2017-10-12 15:04:27 +00:00
bmi L7D55
2018-02-06 18:06:44 +00:00
L7D3A: copy16 L7B69, L7B65
2017-10-12 15:04:27 +00:00
jmp L7D55
2018-02-06 18:06:44 +00:00
L7D49: copy16 L7B69, L7B61
2017-10-12 15:04:27 +00:00
L7D55: inc L7D5B
jmp L7BEF
2017-12-31 20:32:47 +00:00
L7D5B: .byte 0
L7D5C: .byte 0
2018-02-14 05:52:36 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-14 05:52:36 +00:00
2018-02-16 19:25:00 +00:00
.proc L7D5D
jsr window_lookup
2018-02-05 04:35:19 +00:00
stax $06
2018-02-16 19:25:00 +00:00
ldy #35
ldx #7
: lda ($06),y
2017-10-12 15:04:27 +00:00
sta L7D94,x
dey
dex
2018-02-16 19:25:00 +00:00
bpl :-
2017-10-12 15:04:27 +00:00
lda L7D98
sec
sbc L7D94
pha
2018-02-16 19:25:00 +00:00
lda L7D98+1
sbc L7D94+1
2017-10-12 15:04:27 +00:00
pha
2018-02-16 19:25:00 +00:00
2017-10-12 15:04:27 +00:00
lda L7D9A
sec
sbc L7D96
pha
2018-02-16 19:25:00 +00:00
lda L7D9A+1
sbc L7D96+1 ; wierd - this is discarded???
2017-10-12 15:04:27 +00:00
pla
tay
pla
tax
pla
rts
2018-02-16 19:25:00 +00:00
L7D94: .word 0
L7D96: .word 0
L7D98: .word 0
L7D9A: .word 0
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-16 19:25:00 +00:00
.proc L7D9C
jmp L7D9F
2017-10-12 15:04:27 +00:00
2018-02-08 05:48:19 +00:00
L7D9F: ldx cached_window_id
2017-10-12 15:04:27 +00:00
dex
2018-01-13 03:06:55 +00:00
lda LEC26,x
2017-10-12 15:04:27 +00:00
ldx #$00
2018-02-15 16:08:59 +00:00
L7DA8: cmp LE1F1+1,x
2017-10-12 15:04:27 +00:00
beq L7DB4
inx
2018-02-15 16:08:59 +00:00
cpx LE1F1
2017-10-12 15:04:27 +00:00
bne L7DA8
rts
L7DB4: txa
asl a
tax
2018-02-15 16:08:59 +00:00
lda LE202,x
2018-01-17 15:41:23 +00:00
sta $06
2017-10-12 15:04:27 +00:00
sta $0801
2018-02-15 16:08:59 +00:00
lda LE202+1,x
2018-01-17 15:41:23 +00:00
sta $06+1
2017-10-12 15:04:27 +00:00
sta $0802
2017-12-31 20:04:22 +00:00
lda LCBANK2
lda LCBANK2
2017-10-12 15:04:27 +00:00
lda #$00
sta L0800
tay
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
sta $0803
2018-01-17 15:41:23 +00:00
inc $06
2017-10-12 15:04:27 +00:00
inc $0801
bne L7DE4
2018-01-17 15:41:23 +00:00
inc $06+1
2017-10-12 15:04:27 +00:00
inc $0802
L7DE4: lda L0800
cmp $0803
beq L7E0C
jsr L80CA
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
and #$7F
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
ldy #$17
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
bne L7E06
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
bne L7E06
lda #$01
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
L7E06: inc L0800
jmp L7DE4
L7E0C: lda LCBANK1
lda LCBANK1
2018-02-08 05:48:19 +00:00
ldx cached_window_id
2017-10-12 15:04:27 +00:00
dex
2018-02-03 03:38:35 +00:00
lda win_buf_table,x
2017-10-12 15:04:27 +00:00
cmp #$81
beq L7E20
jmp L7EC1
2017-12-31 20:04:22 +00:00
L7E20: lda LCBANK2
lda LCBANK2
2018-02-24 05:12:41 +00:00
ldax #$0F5A
2017-10-12 15:04:27 +00:00
L7E2A: sta $0808,x
dex
bpl L7E2A
lda #$00
sta $0805
sta L0800
L7E38: lda $0805
cmp $0803
bne L7E43
jmp L80F5
L7E43: jsr L80CA
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
bmi L7E82
and #$0F
sta $0804
ldy #$01
2018-01-17 15:41:23 +00:00
L7E53: lda ($06),y
2017-10-12 15:04:27 +00:00
cmp $0807,y
beq L7E5F
bcs L7E82
jmp L7E67
L7E5F: iny
cpy #$10
bne L7E53
jmp L7E82
L7E67: lda L0800
sta $0806
ldx #$0F
lda #$20
L7E71: sta $0808,x
dex
bpl L7E71
ldy $0804
2018-01-17 15:41:23 +00:00
L7E7A: lda ($06),y
2017-10-12 15:04:27 +00:00
sta $0807,y
dey
bne L7E7A
L7E82: inc L0800
lda L0800
cmp $0803
beq L7E90
jmp L7E43
L7E90: inc $0805
lda $0806
sta L0800
jsr L80CA
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
ora #$80
2018-01-17 15:41:23 +00:00
sta ($06),y
2018-02-24 05:12:41 +00:00
ldax #$0F5A
2017-10-12 15:04:27 +00:00
L7EA8: sta $0808,x
dex
bpl L7EA8
ldx $0805
dex
ldy $0806
iny
jsr L812B
lda #$00
sta L0800
jmp L7E38
L7EC1: cmp #$82
beq L7EC8
jmp L7F58
2017-12-31 20:04:22 +00:00
L7EC8: lda LCBANK2
lda LCBANK2
2017-10-12 15:04:27 +00:00
lda #$00
sta $0808
sta $0809
sta $0805
sta L0800
L7EDC: lda $0805
cmp $0803
bne L7EE7
jmp L80F5
L7EE7: jsr L80CA
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
bmi L7F1B
ldy #$18
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
cmp $0809
beq L7EFE
bcs L7F08
jmp L7F1B
L7EFE: dey
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
cmp $0808
beq L7F1B
bcc L7F1B
L7F08: ldy #$18
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
sta $0809
dey
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
sta $0808
lda L0800
sta $0806
L7F1B: inc L0800
lda L0800
cmp $0803
beq L7F29
jmp L7EE7
L7F29: inc $0805
lda $0806
sta L0800
jsr L80CA
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
ora #$80
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
lda #$00
sta $0808
sta $0809
ldx $0805
dex
ldy $0806
iny
jsr L812B
lda #$00
sta L0800
jmp L7EDC
L7F58: cmp #$83
beq L7F5F
jmp L801F
2017-12-31 20:04:22 +00:00
L7F5F: lda LCBANK2
lda LCBANK2
2017-10-12 15:04:27 +00:00
lda #$00
sta $0808
sta $0809
sta $0805
sta L0800
L7F73: lda $0805
cmp $0803
bne L7F7E
jmp L80F5
L7F7E: jsr L80CA
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
bmi L7FAD
ldy #$12
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
cmp $0809
beq L7F92
bcs L7F9C
L7F92: dey
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
cmp $0808
beq L7F9C
bcc L7FAD
2018-01-17 15:41:23 +00:00
L7F9C: lda ($06),y
2017-10-12 15:04:27 +00:00
sta $0808
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
sta $0809
lda L0800
sta $0806
L7FAD: inc L0800
lda L0800
cmp $0803
beq L7FBB
jmp L7F7E
L7FBB: inc $0805
lda $0806
sta L0800
jsr L80CA
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
ora #$80
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
lda #$00
sta $0808
sta $0809
ldx $0805
dex
ldy $0806
iny
jsr L812B
lda #$00
sta L0800
jmp L7F73
lda LCBANK1
lda LCBANK1
2018-02-10 06:59:05 +00:00
copy16 #84, pos_col_name::xcoord
copy16 #203, pos_col_type::xcoord
2017-10-12 15:04:27 +00:00
lda #$00
2018-02-10 06:59:05 +00:00
sta pos_col_size::xcoord
sta pos_col_size::xcoord+1
copy16 #231, pos_col_date::xcoord
2017-12-31 20:04:22 +00:00
lda LCBANK2
lda LCBANK2
2017-10-12 15:04:27 +00:00
jmp L80F5
L801F: cmp #$84
beq L8024
rts
2018-02-06 17:31:58 +00:00
L8024: copy16 type_table_addr, $08
2017-10-12 15:04:27 +00:00
ldy #$00
lda ($08),y
sta $0807
tay
L8036: lda ($08),y
sta $0807,y
dey
bne L8036
2017-12-31 20:04:22 +00:00
lda LCBANK2
lda LCBANK2
2017-10-12 15:04:27 +00:00
lda #$00
sta $0805
sta L0800
lda #$FF
sta $0806
L8051: lda $0805
cmp $0803
bne L805C
jmp L80F5
L805C: jsr L80CA
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
bmi L807E
ldy #$10
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
ldx $0807
cpx #$00
beq L8075
cmp $0808,x
bne L807E
L8075: lda L0800
sta $0806
jmp L809E
L807E: inc L0800
lda L0800
cmp $0803
beq L808C
jmp L805C
L808C: lda $0806
cmp #$FF
bne L809E
dec $0807
lda #$00
sta L0800
jmp L805C
L809E: inc $0805
lda $0806
sta L0800
jsr L80CA
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
ora #$80
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
ldx $0805
dex
ldy $0806
iny
jsr L812B
lda #$00
sta L0800
lda #$FF
sta $0806
jmp L8051
2018-02-19 01:08:11 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-15 05:07:31 +00:00
2018-02-13 16:18:11 +00:00
.proc L80CA
2018-02-15 05:07:31 +00:00
;; ptr = $801/$802 + ($800 * 32)
ptr := $6
2018-02-14 03:15:45 +00:00
lda #0
2017-10-12 15:04:27 +00:00
sta $0804
lda L0800
asl a
rol $0804
asl a
rol $0804
asl a
rol $0804
asl a
rol $0804
asl a
rol $0804
clc
adc $0801
2018-02-15 05:07:31 +00:00
sta ptr
lda $0801+1
2017-10-12 15:04:27 +00:00
adc $0804
2018-02-15 05:07:31 +00:00
sta ptr+1
2017-10-12 15:04:27 +00:00
rts
2018-02-13 16:18:11 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-15 05:07:31 +00:00
2018-02-17 07:08:39 +00:00
.proc L80F5
lda #$00
2017-10-12 15:04:27 +00:00
sta L0800
L80FA: lda L0800
cmp $0803
beq L8124
jsr L80CA
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
and #$7F
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
ldy #$17
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
bne L811E
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
cmp #$01
bne L811E
lda #$00
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
L811E: inc L0800
jmp L80FA
L8124: lda LCBANK1
lda LCBANK1
rts
2018-02-17 07:08:39 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-17 07:08:39 +00:00
.proc L812B
lda LCBANK1
2017-10-12 15:04:27 +00:00
lda LCBANK1
tya
2018-02-08 05:48:19 +00:00
sta cached_window_icon_list,x
2017-12-31 20:04:22 +00:00
lda LCBANK2
lda LCBANK2
2017-10-12 15:04:27 +00:00
rts
2018-02-17 07:08:39 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-19 01:08:11 +00:00
.proc L813F_impl
2017-12-31 20:32:47 +00:00
L813C: .byte 0
.byte 0
2018-02-17 07:08:39 +00:00
L813E: .byte 8
2018-02-19 01:08:11 +00:00
start: ldy #$00
2017-10-12 15:04:27 +00:00
tax
dex
txa
sty L813C
asl a
rol L813C
asl a
rol L813C
asl a
rol L813C
asl a
rol L813C
asl a
rol L813C
clc
2018-02-19 22:06:12 +00:00
adc LE71D
2018-01-17 15:41:23 +00:00
sta $06
2018-02-19 22:06:12 +00:00
lda LE71D+1
2017-10-12 15:04:27 +00:00
adc L813C
2018-01-17 15:41:23 +00:00
sta $06+1
2017-12-31 20:04:22 +00:00
lda LCBANK2
lda LCBANK2
2017-10-12 15:04:27 +00:00
ldy #$1F
2018-01-17 15:41:23 +00:00
L8171: lda ($06),y
2018-03-05 05:33:56 +00:00
sta LEC43,y
2017-10-12 15:04:27 +00:00
dey
bpl L8171
lda LCBANK1
lda LCBANK1
ldx #$31
lda #$20
2018-01-12 18:01:28 +00:00
L8183: sta text_buffer2::data-1,x
2017-10-12 15:04:27 +00:00
dex
bpl L8183
lda #$00
2018-01-12 18:01:28 +00:00
sta text_buffer2::length
2018-02-10 06:59:05 +00:00
lda pos_col_type::ycoord
2017-10-12 15:04:27 +00:00
clc
adc L813E
2018-02-10 06:59:05 +00:00
sta pos_col_type::ycoord
2017-10-12 15:04:27 +00:00
bcc L819D
2018-02-10 06:59:05 +00:00
inc pos_col_type::ycoord+1
L819D: lda pos_col_size::ycoord
2017-10-12 15:04:27 +00:00
clc
adc L813E
2018-02-10 06:59:05 +00:00
sta pos_col_size::ycoord
2017-10-12 15:04:27 +00:00
bcc L81AC
2018-02-10 06:59:05 +00:00
inc pos_col_size::ycoord+1
L81AC: lda pos_col_date::ycoord
2017-10-12 15:04:27 +00:00
clc
adc L813E
2018-02-10 06:59:05 +00:00
sta pos_col_date::ycoord
2017-10-12 15:04:27 +00:00
bcc L81BB
2018-02-10 06:59:05 +00:00
inc pos_col_date::ycoord+1
L81BB: cmp16 pos_col_name::ycoord, grafport2::cliprect::y2
2017-10-12 15:04:27 +00:00
bmi L81D9
2018-02-10 06:59:05 +00:00
lda pos_col_name::ycoord
2017-10-12 15:04:27 +00:00
clc
adc L813E
2018-02-10 06:59:05 +00:00
sta pos_col_name::ycoord
2017-10-12 15:04:27 +00:00
bcc L81D8
2018-02-10 06:59:05 +00:00
inc pos_col_name::ycoord+1
2017-10-12 15:04:27 +00:00
L81D8: rts
2018-02-10 06:59:05 +00:00
L81D9: lda pos_col_name::ycoord
2017-10-12 15:04:27 +00:00
clc
adc L813E
2018-02-10 06:59:05 +00:00
sta pos_col_name::ycoord
2017-10-12 15:04:27 +00:00
bcc L81E8
2018-02-10 06:59:05 +00:00
inc pos_col_name::ycoord+1
L81E8: cmp16 pos_col_name::ycoord, grafport2::cliprect::y1
2017-10-12 15:04:27 +00:00
bpl L81F7
rts
2018-02-10 06:59:05 +00:00
L81F7: jsr prepare_col_name
addr_call SETPOS_DRAWTEXT_RELAY, pos_col_name
jsr prepare_col_type
addr_call SETPOS_DRAWTEXT_RELAY, pos_col_type
jsr prepare_col_size
addr_call SETPOS_DRAWTEXT_RELAY, pos_col_size
2018-02-03 05:11:49 +00:00
jsr compose_date_string
2018-02-10 06:59:05 +00:00
addr_jump SETPOS_DRAWTEXT_RELAY, pos_col_date
2018-02-17 07:08:39 +00:00
.endproc
2018-02-19 01:08:11 +00:00
L813F := L813F_impl::start
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-10 06:59:05 +00:00
.proc prepare_col_name
2018-03-05 05:33:56 +00:00
lda LEC43
2017-10-12 15:04:27 +00:00
and #$0F
2018-01-12 18:01:28 +00:00
sta text_buffer2::length
2017-10-12 15:04:27 +00:00
tax
2018-03-05 05:33:56 +00:00
loop: lda LEC43,x
sta text_buffer2::data,x
2017-10-12 15:04:27 +00:00
dex
2018-02-19 01:08:11 +00:00
bne loop
lda #' '
2018-03-05 05:33:56 +00:00
sta text_buffer2::data
2018-01-12 18:01:28 +00:00
inc text_buffer2::length
2018-02-09 05:42:59 +00:00
addr_call capitalize_string, text_buffer2::length
2017-10-12 15:04:27 +00:00
rts
2018-02-10 06:59:05 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-02-10 06:59:05 +00:00
.proc prepare_col_type
lda LEC53
2017-10-12 15:04:27 +00:00
jsr L8707
2018-02-19 01:08:11 +00:00
ldx #4
loop: lda LDFC5,x
2018-01-12 18:01:28 +00:00
sta text_buffer2::data-1,x
2017-10-12 15:04:27 +00:00
dex
2018-02-19 01:08:11 +00:00
bpl loop
2017-10-12 15:04:27 +00:00
rts
2018-02-10 06:59:05 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-02-10 06:59:05 +00:00
.proc prepare_col_size
ldax LEC54
;; fall through
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-10 06:59:05 +00:00
;;; Populate text_buffer2 with " 12345 Blocks"
2018-02-03 05:11:49 +00:00
2018-02-10 06:59:05 +00:00
.proc compose_blocks_string
stax value
jmp start
suffix: .byte " Blocks "
powers: .word 10000, 1000, 100, 10
value: .word 0
digit: .byte 0
2018-02-13 16:18:11 +00:00
nonzero_flag:
.byte 0
2018-02-10 06:59:05 +00:00
start:
;; Fill buffer with spaces
ldx #17
2018-01-24 04:11:38 +00:00
lda #' '
2018-02-10 06:59:05 +00:00
: sta text_buffer2::data-1,x
2017-10-12 15:04:27 +00:00
dex
2018-02-10 06:59:05 +00:00
bpl :-
lda #0
2018-01-12 18:01:28 +00:00
sta text_buffer2::length
2018-02-10 06:59:05 +00:00
sta nonzero_flag
ldy #0 ; y is pos in string
ldx #0 ; x is power of 10 index (*2)
loop: lda #0
sta digit
;; Compute the digit by repeated subtraction/increments
sloop: cmp16 value, powers,x
bpl subtract
lda digit
bne not_pad
bit nonzero_flag
bmi not_pad
;; Pad with space
lda #' '
bne :+
not_pad:
ora #'0'
2017-10-12 15:04:27 +00:00
pha
lda #$80
2018-02-10 06:59:05 +00:00
sta nonzero_flag
2017-10-12 15:04:27 +00:00
pla
2018-02-10 06:59:05 +00:00
;; Place the character, move to next
: sta text_buffer2::data+1,y
2017-10-12 15:04:27 +00:00
iny
inx
inx
2018-02-10 06:59:05 +00:00
cpx #8 ; last power of 10? (*2)
beq done
jmp loop
2017-10-12 15:04:27 +00:00
2018-02-10 06:59:05 +00:00
subtract:
inc digit
sub16 value, powers,x, value
jmp sloop
done: lda value ; handle last digit
ora #'0'
2018-02-06 23:36:39 +00:00
sta text_buffer2::data+1,y
2017-10-12 15:04:27 +00:00
iny
2018-02-10 06:59:05 +00:00
;; Append suffix
2018-02-06 23:36:39 +00:00
ldx #0
2018-02-10 06:59:05 +00:00
: lda suffix,x
2018-02-06 23:36:39 +00:00
sta text_buffer2::data+1,y
2017-10-12 15:04:27 +00:00
iny
inx
2018-02-10 06:59:05 +00:00
cpx suffix
bne :-
;; Singular or plural?
lda digit ; zero?
bne plural
bit nonzero_flag
bmi plural ; "blocks"
lda value
cmp #2 ; plural?
bcc single
plural: lda #.strlen(" 12345 Blocks") ; seems off by one ???
2017-10-12 15:04:27 +00:00
bne L830B
2018-02-10 06:59:05 +00:00
single: lda #.strlen(" 1 Block")
2018-01-12 18:01:28 +00:00
L830B: sta text_buffer2::length
2017-10-12 15:04:27 +00:00
rts
2018-02-10 06:59:05 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-03 05:11:49 +00:00
compose_date_string:
ldx #21
2018-01-24 04:11:38 +00:00
lda #' '
2018-01-21 19:47:40 +00:00
: sta text_buffer2::data-1,x
2017-10-12 15:04:27 +00:00
dex
2018-01-21 19:47:40 +00:00
bpl :-
2018-02-03 05:11:49 +00:00
lda #1
2018-01-12 18:01:28 +00:00
sta text_buffer2::length
2018-02-06 17:31:58 +00:00
copy16 #text_buffer2::length, $8
2018-01-21 19:47:40 +00:00
lda date ; any bits set?
ora date+1
bne prep_date_strings
sta month ; 0 is "no date" string
jmp prep_month_string
prep_date_strings:
lda date+1
and #$FE ; extract year
2017-10-12 15:04:27 +00:00
lsr a
2018-01-21 19:47:40 +00:00
sta year
lda date+1 ; extract month
2017-10-12 15:04:27 +00:00
ror a
2018-01-21 19:47:40 +00:00
lda date
2017-10-12 15:04:27 +00:00
ror a
lsr a
lsr a
lsr a
lsr a
2018-01-21 19:47:40 +00:00
sta month
lda date ; extract day
2017-10-12 15:04:27 +00:00
and #$1F
2018-01-21 19:47:40 +00:00
sta day
jsr prep_month_string
jsr prep_day_string
jmp prep_year_string
.proc prep_day_string
;; String will have trailing space.
lda #' '
2018-02-03 05:11:49 +00:00
sta str_day+1
sta str_day+2
sta str_day+3
2018-01-21 19:47:40 +00:00
;; Assume 1 digit (plus trailing space)
ldx #2
;; Determine first digit.
lda day
ora #'0' ; if < 10, will just be value itself
2017-10-12 15:04:27 +00:00
tay
2018-01-21 19:47:40 +00:00
lda day
cmp #10
bcc :+
inx ; will be 2 digits
ldy #'1'
cmp #20
bcc :+
ldy #'2'
cmp #30
bcc :+
ldy #'3'
2018-02-03 05:11:49 +00:00
: stx str_day ; length (including trailing space)
sty str_day+1 ; first digit
2018-01-21 19:47:40 +00:00
;; Determine second digit.
cpx #2 ; only 1 digit (plus trailing space?)
beq done
2017-10-12 15:04:27 +00:00
tya
2018-01-21 19:47:40 +00:00
and #$03 ; ascii -> tens digit
2017-10-12 15:04:27 +00:00
tay
2018-01-21 19:47:40 +00:00
lda day ; subtract 10 as needed
: sec
sbc #10
2017-10-12 15:04:27 +00:00
dey
2018-01-21 19:47:40 +00:00
bne :-
ora #'0'
2018-02-03 05:11:49 +00:00
sta str_day+2
done: addr_jump concatenate_date_part, str_day
2018-01-21 19:47:40 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-01-21 19:47:40 +00:00
.proc prep_month_string
lda month
2017-10-12 15:04:27 +00:00
asl a
tay
2018-01-21 19:47:40 +00:00
lda month_table+1,y
2017-10-12 15:04:27 +00:00
tax
2018-01-21 19:47:40 +00:00
lda month_table,y
2018-02-03 05:11:49 +00:00
jmp concatenate_date_part
2018-01-21 19:47:40 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-01-21 19:47:40 +00:00
.proc prep_year_string
ldx tens_table_length
: lda year
2017-10-12 15:04:27 +00:00
sec
2018-01-21 19:47:40 +00:00
sbc tens_table-1,x
bpl :+
2017-10-12 15:04:27 +00:00
dex
2018-01-21 19:47:40 +00:00
bne :-
: tay
2017-12-31 20:32:47 +00:00
lda ascii_digits,x
sta year_string_10s
lda ascii_digits,y
sta year_string_1s
2018-02-03 05:11:49 +00:00
addr_jump concatenate_date_part, str_year
2018-01-21 19:47:40 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-01-24 05:37:41 +00:00
year: .byte 0
month: .byte 0
day: .byte 0
2018-01-21 19:47:40 +00:00
2018-02-03 05:11:49 +00:00
str_day: ; Filled in with day of the month plus space (e.g. "10 ")
2018-01-21 19:47:40 +00:00
PASCAL_STRING " "
month_table:
.addr str_no_date
.addr str_jan,str_feb,str_mar,str_apr,str_may,str_jun
.addr str_jul,str_aug,str_sep,str_oct,str_nov,str_dec
str_no_date:
2017-12-31 03:21:34 +00:00
PASCAL_STRING "no date "
2018-01-21 19:47:40 +00:00
str_jan:PASCAL_STRING "January "
str_feb:PASCAL_STRING "February "
str_mar:PASCAL_STRING "March "
str_apr:PASCAL_STRING "April "
str_may:PASCAL_STRING "May "
str_jun:PASCAL_STRING "June "
str_jul:PASCAL_STRING "July "
str_aug:PASCAL_STRING "August "
str_sep:PASCAL_STRING "September "
str_oct:PASCAL_STRING "October "
str_nov:PASCAL_STRING "November "
str_dec:PASCAL_STRING "December "
str_year:
2017-12-31 03:21:34 +00:00
PASCAL_STRING " 1985"
2017-12-31 20:32:47 +00:00
year_string_10s := *-2 ; 10s digit
year_string_1s := *-1 ; 1s digit
2017-12-31 03:21:34 +00:00
2018-01-21 19:47:40 +00:00
tens_table_length:
.byte 9
tens_table:
.byte 10,20,30,40,50,60,70,80,90
2017-12-31 20:32:47 +00:00
ascii_digits:
.byte "0123456789"
2018-02-03 05:11:49 +00:00
.proc concatenate_date_part
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$00
lda ($08),y
sta L84D0
clc
2018-01-17 15:41:23 +00:00
adc ($06),y
2017-10-12 15:04:27 +00:00
sta ($08),y
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-01-21 19:47:40 +00:00
sta compare_y
: inc L84D0
2017-10-12 15:04:27 +00:00
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
sty L84CF
ldy L84D0
sta ($08),y
ldy L84CF
2018-01-21 19:47:40 +00:00
compare_y := *+1
cpy #0 ; self-modified
bcc :-
2017-10-12 15:04:27 +00:00
rts
2017-12-31 20:32:47 +00:00
L84CF: .byte 0
L84D0: .byte 0
2018-02-03 05:11:49 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-21 19:47:40 +00:00
2018-02-17 07:08:39 +00:00
.proc L84D1
jsr push_zp_addrs
2017-10-12 15:04:27 +00:00
bit L5B1B
bmi L84DC
2018-02-14 03:15:45 +00:00
jsr cached_icons_window_to_screen
2018-02-06 18:06:44 +00:00
L84DC: sub16 grafport2::cliprect::x2, grafport2::cliprect::x1, L85F8
sub16 grafport2::cliprect::y2, grafport2::cliprect::y1, L85FA
2018-02-28 02:38:18 +00:00
lda event_kind
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_button_down
2017-10-12 15:04:27 +00:00
bne L850C
asl a
bne L850E
L850C: lda #$00
L850E: sta L85F1
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-01-21 03:02:34 +00:00
jsr window_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
lda #$06
clc
adc L85F1
tay
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
pha
jsr L7B6B
ldx L85F1
2018-02-14 05:52:36 +00:00
sub16 L7B63,x, L7B5F,x, L85F2
2017-10-12 15:04:27 +00:00
ldx L85F1
2018-02-14 05:52:36 +00:00
sub16 L85F2, L85F8,x, L85F2
2017-10-12 15:04:27 +00:00
bpl L8562
lda L85F8,x
sta L85F2
lda L85F9,x
sta L85F3
2018-02-10 06:10:11 +00:00
L8562: lsr16 L85F2
lsr16 L85F2
2017-10-12 15:04:27 +00:00
lda L85F2
tay
pla
tax
2018-01-30 16:57:36 +00:00
lda event_params+1
2017-10-12 15:04:27 +00:00
jsr L62BC
ldx #$00
stx L85F2
asl a
rol L85F2
asl a
rol L85F2
2018-02-14 05:52:36 +00:00
2017-10-12 15:04:27 +00:00
ldx L85F1
clc
adc L7B5F,x
2018-02-06 04:37:41 +00:00
sta grafport2::cliprect::x1,x
2017-10-12 15:04:27 +00:00
lda L85F2
adc L7B60,x
2018-02-06 04:37:41 +00:00
sta grafport2::cliprect::x1+1,x
2018-02-14 05:52:36 +00:00
2018-02-03 04:41:42 +00:00
lda active_window_id
2017-10-12 15:04:27 +00:00
jsr L7D5D
2018-02-05 04:35:19 +00:00
stax L85F4
2018-01-21 22:35:37 +00:00
sty L85F6
2017-10-12 15:04:27 +00:00
lda L85F1
beq L85C3
2018-02-06 04:37:41 +00:00
add16_8 grafport2::cliprect::y1, L85F6, grafport2::cliprect::y2
2017-10-12 15:04:27 +00:00
jmp L85D6
2018-02-06 04:37:41 +00:00
L85C3: add16 grafport2::cliprect::x1, L85F4, grafport2::cliprect::x2
2018-02-03 04:41:42 +00:00
L85D6: lda active_window_id
2018-01-21 03:02:34 +00:00
jsr window_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$23
ldx #$07
2018-02-06 04:37:41 +00:00
L85E4: lda grafport2::cliprect::x1,x
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
dey
dex
bpl L85E4
2018-01-11 06:31:02 +00:00
jsr pop_zp_addrs
2017-10-12 15:04:27 +00:00
rts
2017-12-31 20:32:47 +00:00
L85F1: .byte 0
L85F2: .byte 0
L85F3: .byte 0
2018-02-05 04:46:26 +00:00
L85F4: .word 0
2017-12-31 20:32:47 +00:00
L85F6: .byte 0
.byte 0
L85F8: .byte 0
L85F9: .byte 0
2018-02-05 04:46:26 +00:00
L85FA: .word 0
2018-02-17 07:08:39 +00:00
.endproc
2018-01-21 00:44:49 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-21 00:44:49 +00:00
;;; Double Click Detection
2018-01-21 01:16:31 +00:00
;;; Returns with A=0 if double click, A=$FF otherwise.
2018-01-21 00:44:49 +00:00
2018-01-21 01:16:31 +00:00
.proc detect_double_click
2018-01-21 00:44:49 +00:00
double_click_deltax := 8
double_click_deltay := 7
2018-01-21 01:16:31 +00:00
;; Stash initial coords
2018-01-21 00:44:49 +00:00
ldx #3
2018-02-28 02:38:18 +00:00
: lda event_coords,x
2018-01-21 00:44:49 +00:00
sta coords,x
2018-02-10 06:59:05 +00:00
sta saved_event_coords,x
2017-10-12 15:04:27 +00:00
dex
2018-01-21 00:44:49 +00:00
bpl :-
lda #0
2018-01-21 01:16:31 +00:00
sta counter+1
2018-01-21 22:35:37 +00:00
lda machine_type ; Speed of mouse driver? ($96=IIe,$FA=IIc,$FD=IIgs)
2018-01-21 01:16:31 +00:00
asl a ; * 2
rol counter+1 ; So IIe = $12C, IIc = $1F4, IIgs = $1FA
sta counter
;; Decrement counter, bail if time delta exceeded
loop: dec counter
2018-01-21 00:44:49 +00:00
bne :+
2018-01-21 01:16:31 +00:00
dec counter+1
lda counter+1
2018-01-21 00:44:49 +00:00
bne exit
2018-02-03 04:41:42 +00:00
: jsr peek_event
2018-01-21 01:16:31 +00:00
;; Check coords, bail if pixel delta exceeded
2018-01-21 00:44:49 +00:00
jsr check_delta
bmi exit ; moved past delta; no double-click
lda #$FF ; ???
sta unused
2018-02-28 02:38:18 +00:00
lda event_kind
2018-01-21 00:44:49 +00:00
sta state ; unused ???
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_no_event
2018-01-21 00:44:49 +00:00
beq loop
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_drag
2018-01-21 00:44:49 +00:00
beq loop
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_button_up
2018-01-21 00:44:49 +00:00
bne :+
2018-02-03 04:41:42 +00:00
jsr get_event
2018-01-21 00:44:49 +00:00
jmp loop
2018-02-03 04:10:19 +00:00
: cmp #MGTK::event_kind_button_down
2018-01-21 00:44:49 +00:00
bne exit
2017-10-12 15:04:27 +00:00
2018-02-03 04:41:42 +00:00
jsr get_event
2018-02-16 03:29:05 +00:00
return #0 ; double-click
2017-10-12 15:04:27 +00:00
2018-02-16 03:29:05 +00:00
exit: return #$FF ; not double-click
2017-10-12 15:04:27 +00:00
2018-01-21 00:44:49 +00:00
;; Is the new coord within range of the old coord?
.proc check_delta
;; compute x delta
2018-02-28 02:38:18 +00:00
lda event_xcoord
2017-10-12 15:04:27 +00:00
sec
2018-01-21 00:44:49 +00:00
sbc xcoord
sta delta
2018-02-28 02:38:18 +00:00
lda event_xcoord+1
2018-01-21 00:44:49 +00:00
sbc xcoord+1
bpl :+
;; is -delta < x < 0 ?
lda delta
cmp #($100 - double_click_deltax)
bcs check_y
2018-02-16 03:29:05 +00:00
fail: return #$FF
2017-10-12 15:04:27 +00:00
2018-01-21 00:44:49 +00:00
;; is 0 < x < delta ?
: lda delta
cmp #double_click_deltax
bcs fail
;; compute y delta
2018-02-28 02:38:18 +00:00
check_y:lda event_ycoord
2017-10-12 15:04:27 +00:00
sec
2018-01-21 00:44:49 +00:00
sbc ycoord
sta delta
2018-02-28 02:38:18 +00:00
lda event_ycoord+1
2018-01-21 00:44:49 +00:00
sbc ycoord+1
bpl :+
;; is -delta < y < 0 ?
lda delta
cmp #($100 - double_click_deltay)
bcs ok
;; is 0 < y < delta ?
: lda delta
cmp #double_click_deltay
bcs fail
2018-02-16 03:29:05 +00:00
ok: return #0
2018-01-21 00:44:49 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-01-21 01:16:31 +00:00
counter:.word 0
2018-01-21 00:44:49 +00:00
coords:
xcoord: .word 0
ycoord: .word 0
delta: .byte 0
2018-01-21 01:16:31 +00:00
state: .byte 0 ; unused?
2018-01-21 00:44:49 +00:00
unused: .byte 0 ; ???
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-16 20:14:39 +00:00
;;; A = A * 16, high bits into X
2018-01-21 00:44:49 +00:00
2018-02-16 20:14:39 +00:00
.proc a_times_16
2018-01-21 03:02:34 +00:00
ldx #0
stx tmp
2017-10-12 15:04:27 +00:00
asl a
2018-01-21 03:02:34 +00:00
rol tmp
2017-10-12 15:04:27 +00:00
asl a
2018-01-21 03:02:34 +00:00
rol tmp
2017-10-12 15:04:27 +00:00
asl a
2018-01-21 03:02:34 +00:00
rol tmp
2017-10-12 15:04:27 +00:00
asl a
2018-01-21 03:02:34 +00:00
rol tmp
ldx tmp
2017-10-12 15:04:27 +00:00
rts
2018-01-21 03:02:34 +00:00
tmp: .byte 0
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-16 20:14:39 +00:00
;;; A = A * 64, high bits into X
2018-01-21 03:02:34 +00:00
2018-02-16 20:14:39 +00:00
.proc a_times_64
2018-01-21 03:02:34 +00:00
ldx #$00
stx tmp
2017-10-12 15:04:27 +00:00
asl a
2018-01-21 03:02:34 +00:00
rol tmp
2017-10-12 15:04:27 +00:00
asl a
2018-01-21 03:02:34 +00:00
rol tmp
2017-10-12 15:04:27 +00:00
asl a
2018-01-21 03:02:34 +00:00
rol tmp
2017-10-12 15:04:27 +00:00
asl a
2018-01-21 03:02:34 +00:00
rol tmp
2017-10-12 15:04:27 +00:00
asl a
2018-01-21 03:02:34 +00:00
rol tmp
2017-10-12 15:04:27 +00:00
asl a
2018-01-21 03:02:34 +00:00
rol tmp
ldx tmp
2017-10-12 15:04:27 +00:00
rts
2018-01-21 03:02:34 +00:00
tmp: .byte 0
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-21 03:02:34 +00:00
;;; Look up file address. Index in A, address in A,X.
2018-02-09 05:42:59 +00:00
.proc icon_entry_lookup
2018-01-21 03:02:34 +00:00
asl a
2017-10-12 15:04:27 +00:00
tax
2018-02-09 05:42:59 +00:00
lda icon_entry_address_table,x
2017-10-12 15:04:27 +00:00
pha
2018-02-09 05:42:59 +00:00
lda icon_entry_address_table+1,x
2017-10-12 15:04:27 +00:00
tax
pla
rts
2018-02-09 05:42:59 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-21 03:02:34 +00:00
;;; Look up window. Index in A, address in A,X.
2018-02-09 05:42:59 +00:00
.proc window_lookup
2018-01-21 03:02:34 +00:00
asl a
2017-10-12 15:04:27 +00:00
tax
2018-01-21 03:02:34 +00:00
lda win_table,x
2017-10-12 15:04:27 +00:00
pha
2018-01-21 03:02:34 +00:00
lda win_table+1,x
2017-10-12 15:04:27 +00:00
tax
pla
rts
2018-02-09 05:42:59 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-21 03:02:34 +00:00
;;; Look up window address. Index in A, address in A,X.
2018-02-09 05:42:59 +00:00
.proc window_address_lookup
2018-01-21 03:02:34 +00:00
asl a
2017-10-12 15:04:27 +00:00
tax
lda window_address_table,x
2017-10-12 15:04:27 +00:00
pha
lda window_address_table+1,x
2017-10-12 15:04:27 +00:00
tax
pla
rts
2018-02-09 05:42:59 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-21 03:02:34 +00:00
2018-02-17 07:08:39 +00:00
.proc L8707
sta L877F
2018-02-06 17:31:58 +00:00
copy16 type_table_addr, $06
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tay
2018-01-17 15:41:23 +00:00
L8719: lda ($06),y
2017-10-12 15:04:27 +00:00
cmp L877F
beq L8726
dey
bne L8719
jmp L8745
L8726: tya
asl a
asl a
tay
2018-02-06 17:31:58 +00:00
copy16 type_names_addr, $06
2017-10-12 15:04:27 +00:00
ldx #$00
2018-01-17 15:41:23 +00:00
L8736: lda ($06),y
2018-01-16 04:33:32 +00:00
sta LDFC6,x
2017-10-12 15:04:27 +00:00
iny
inx
cpx #$04
bne L8736
2018-01-16 04:33:32 +00:00
stx LDFC5
2017-10-12 15:04:27 +00:00
rts
2018-02-24 05:12:41 +00:00
L8745: copy16 #$2004, LDFC5
2017-10-12 15:04:27 +00:00
lda #$24
2018-01-16 04:33:32 +00:00
sta LDFC7
2017-10-12 15:04:27 +00:00
lda L877F
lsr a
lsr a
lsr a
lsr a
cmp #$0A
bcs L8764
clc
adc #$30
bne L8767
L8764: clc
adc #$37
2018-01-16 04:33:32 +00:00
L8767: sta LDFC8
2017-10-12 15:04:27 +00:00
lda L877F
and #$0F
cmp #$0A
bcs L8778
clc
adc #$30
bne L877B
L8778: clc
adc #$37
2018-02-15 16:08:59 +00:00
L877B: sta path_buf4
2017-10-12 15:04:27 +00:00
rts
2018-02-17 07:08:39 +00:00
2017-12-31 20:32:47 +00:00
L877F: .byte 0
2017-10-12 15:04:27 +00:00
2018-02-17 07:08:39 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-21 03:33:15 +00:00
;;; Draw text, pascal string address in A,X
2018-02-10 06:10:11 +00:00
.proc draw_pascal_string
2018-02-02 06:04:23 +00:00
params := $6
textptr := $6
textlen := $8
2018-01-21 03:33:15 +00:00
2018-02-05 04:35:19 +00:00
stax textptr
2018-01-21 03:33:15 +00:00
ldy #0
2018-02-02 06:04:23 +00:00
lda (textptr),y
2018-01-21 03:33:15 +00:00
beq exit
2018-02-02 06:04:23 +00:00
sta textlen
2018-02-26 00:06:17 +00:00
inc16 textptr
MGTK_RELAY_CALL MGTK::DrawText, params
2018-01-21 03:33:15 +00:00
exit: rts
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-21 03:33:15 +00:00
;;; Measure text, pascal string address in A,X; result in A,X
.proc measure_text1
ptr := $6
len := $8
result := $9
2018-02-05 04:35:19 +00:00
stax ptr
2018-01-21 03:33:15 +00:00
ldy #0
lda (ptr),y
sta len
2018-02-26 00:06:17 +00:00
inc16 ptr
MGTK_RELAY_CALL MGTK::TextWidth, ptr
2018-02-05 04:21:34 +00:00
ldax result
2017-10-12 15:04:27 +00:00
rts
2018-01-21 03:33:15 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-09 05:42:59 +00:00
.proc capitalize_string
ptr := $A
stx ptr+1
sta ptr
ldy #0
lda (ptr),y
2017-10-12 15:04:27 +00:00
tay
2018-02-09 05:42:59 +00:00
bne next
2017-10-12 15:04:27 +00:00
rts
2018-02-09 05:42:59 +00:00
next: dey
beq done
bpl :+
done: rts
2017-10-12 15:04:27 +00:00
2018-02-09 05:42:59 +00:00
;; Ignore punctuation
: lda (ptr),y
2017-10-12 15:04:27 +00:00
and #$7F
2018-02-09 05:42:59 +00:00
cmp #'/'
beq skip
cmp #' '
beq skip
cmp #'.'
bne check
skip: dey
jmp next
2017-10-12 15:04:27 +00:00
2018-02-09 05:42:59 +00:00
;; Look at previous character - is it a letter?
check: iny
lda (ptr),y
2017-10-12 15:04:27 +00:00
and #$7F
2018-02-09 05:42:59 +00:00
cmp #'A'
bcc :+
cmp #'Z' + 1
bcs :+
;; Yes - uppercase it.
2017-10-12 15:04:27 +00:00
clc
adc #$20
2018-02-09 05:42:59 +00:00
sta (ptr),y
: dey
jmp next
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-21 03:33:15 +00:00
;;; Pushes two words from $6/$8 to stack
2018-01-11 06:31:02 +00:00
.proc push_zp_addrs
2018-01-21 03:33:15 +00:00
ptr := $6
pla ; stash return address
sta addr
2017-10-12 15:04:27 +00:00
pla
sta addr+1
ldx #0 ; copy 4 bytes from $8 to stack
2018-01-21 03:33:15 +00:00
loop: lda ptr,x
2017-10-12 15:04:27 +00:00
pha
inx
cpx #4
bne loop
lda addr+1 ; restore return address
2017-10-12 15:04:27 +00:00
pha
lda addr
2017-10-12 15:04:27 +00:00
pha
rts
addr: .addr 0
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
;;; Pops two words from stack to $6/$8
2018-01-21 03:33:15 +00:00
2018-01-11 06:31:02 +00:00
.proc pop_zp_addrs
2018-01-21 03:33:15 +00:00
ptr := $6
pla ; stash return address
sta addr
2017-10-12 15:04:27 +00:00
pla
sta addr+1
ldx #3 ; copy 4 bytes from stack to $6
loop: pla
2018-01-21 03:33:15 +00:00
sta ptr,x
2017-10-12 15:04:27 +00:00
dex
cpx #$FF ; why not bpl ???
bne loop
lda addr+1 ; restore return address to stack
2017-10-12 15:04:27 +00:00
pha
lda addr
2017-10-12 15:04:27 +00:00
pha
rts
addr: .addr 0
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-18 01:15:27 +00:00
port_copy:
.res MGTK::grafport_size+1
2017-12-31 20:32:47 +00:00
2018-02-18 01:15:27 +00:00
.proc copy_window_portbits
ptr := $6
tay
2018-01-11 06:31:02 +00:00
jsr push_zp_addrs
2017-10-12 15:04:27 +00:00
tya
2018-01-21 03:02:34 +00:00
jsr window_lookup
2018-02-18 01:15:27 +00:00
stax ptr
ldx #0
ldy #MGTK::winfo_offset_port
: lda (ptr),y
sta port_copy,x
2017-10-12 15:04:27 +00:00
iny
inx
2018-02-18 01:15:27 +00:00
cpx #MGTK::grafport_size
bne :-
2018-01-11 06:31:02 +00:00
jsr pop_zp_addrs
2017-10-12 15:04:27 +00:00
rts
2018-02-18 01:15:27 +00:00
.endproc
.proc assign_window_portbits
ptr := $6
2017-10-12 15:04:27 +00:00
2018-02-18 01:15:27 +00:00
tay
2018-01-11 06:31:02 +00:00
jsr push_zp_addrs
2017-10-12 15:04:27 +00:00
tya
2018-01-21 03:02:34 +00:00
jsr window_lookup
2018-02-18 01:15:27 +00:00
stax ptr
ldx #0
ldy #MGTK::winfo_offset_port
: lda port_copy,x
sta (ptr),y
2017-10-12 15:04:27 +00:00
iny
inx
2018-02-18 01:15:27 +00:00
cpx #MGTK::grafport_size
bne :-
2018-01-11 06:31:02 +00:00
jsr pop_zp_addrs
2017-10-12 15:04:27 +00:00
rts
2018-02-18 01:15:27 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-13 16:18:11 +00:00
;;; Convert icon's coordinates from screen to window (direction???)
;;; (icon index in A, active window)
2018-02-13 05:14:23 +00:00
2018-02-13 16:18:11 +00:00
.proc icon_screen_to_window
2018-02-13 05:14:23 +00:00
entry_ptr := $6
winfo_ptr := $8
tay
2018-01-11 06:31:02 +00:00
jsr push_zp_addrs
2017-10-12 15:04:27 +00:00
tya
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-02-13 05:14:23 +00:00
stax entry_ptr
2018-02-03 04:41:42 +00:00
lda active_window_id
2018-01-21 03:02:34 +00:00
jsr window_lookup
2018-02-13 05:14:23 +00:00
stax winfo_ptr
2018-02-13 16:18:11 +00:00
;; Screen space
2018-02-13 05:36:41 +00:00
ldy #MGTK::winfo_offset_port + MGTK::grafport_offset_viewloc + 3
2018-02-13 05:14:23 +00:00
ldx #3
: lda (winfo_ptr),y
2018-02-13 16:18:11 +00:00
sta pos_screen,x
2017-10-12 15:04:27 +00:00
dey
dex
2018-02-13 05:14:23 +00:00
bpl :-
2018-02-13 16:18:11 +00:00
;; Window space
2018-02-13 05:36:41 +00:00
ldy #MGTK::winfo_offset_port + MGTK::grafport_offset_maprect + 3
2018-02-13 05:14:23 +00:00
ldx #3
: lda (winfo_ptr),y
2018-02-13 16:18:11 +00:00
sta pos_win,x
2017-10-12 15:04:27 +00:00
dey
dex
2018-02-13 05:14:23 +00:00
bpl :-
2018-02-13 16:18:11 +00:00
;; iconx
ldy #icon_entry_offset_iconx
2018-02-13 05:14:23 +00:00
lda (entry_ptr),y
2017-10-12 15:04:27 +00:00
clc
2018-02-13 16:18:11 +00:00
adc pos_screen
2018-02-13 05:14:23 +00:00
sta (entry_ptr),y
2017-10-12 15:04:27 +00:00
iny
2018-02-13 05:14:23 +00:00
lda (entry_ptr),y
2018-02-13 16:18:11 +00:00
adc pos_screen+1
2018-02-13 05:14:23 +00:00
sta (entry_ptr),y
2017-10-12 15:04:27 +00:00
iny
2018-02-13 05:14:23 +00:00
2018-02-13 16:18:11 +00:00
;; icony
2018-02-13 05:14:23 +00:00
lda (entry_ptr),y
2017-10-12 15:04:27 +00:00
clc
2018-02-13 16:18:11 +00:00
adc pos_screen+2
2018-02-13 05:14:23 +00:00
sta (entry_ptr),y
2017-10-12 15:04:27 +00:00
iny
2018-02-13 05:14:23 +00:00
lda (entry_ptr),y
2018-02-13 16:18:11 +00:00
adc pos_screen+3
2018-02-13 05:14:23 +00:00
sta (entry_ptr),y
2018-02-13 16:18:11 +00:00
;; iconx
ldy #icon_entry_offset_iconx
2018-02-13 05:14:23 +00:00
lda (entry_ptr),y
2017-10-12 15:04:27 +00:00
sec
2018-02-13 16:18:11 +00:00
sbc pos_win
2018-02-13 05:14:23 +00:00
sta (entry_ptr),y
2017-10-12 15:04:27 +00:00
iny
2018-02-13 05:14:23 +00:00
lda (entry_ptr),y
2018-02-13 16:18:11 +00:00
sbc pos_win+1
2018-02-13 05:14:23 +00:00
sta (entry_ptr),y
2017-10-12 15:04:27 +00:00
iny
2018-02-13 05:14:23 +00:00
2018-02-13 16:18:11 +00:00
;; icony
2018-02-13 05:14:23 +00:00
lda (entry_ptr),y
2017-10-12 15:04:27 +00:00
sec
2018-02-13 16:18:11 +00:00
sbc pos_win+2
2018-02-13 05:14:23 +00:00
sta (entry_ptr),y
2017-10-12 15:04:27 +00:00
iny
2018-02-13 05:14:23 +00:00
lda (entry_ptr),y
2018-02-13 16:18:11 +00:00
sbc pos_win+3
2018-02-13 05:14:23 +00:00
sta (entry_ptr),y
2018-01-11 06:31:02 +00:00
jsr pop_zp_addrs
2017-10-12 15:04:27 +00:00
rts
2018-02-13 16:18:11 +00:00
pos_screen: .word 0, 0
pos_win: .word 0, 0
2018-01-21 03:33:15 +00:00
2018-02-13 05:14:23 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-13 16:18:11 +00:00
;;; Convert icon's coordinates from window to screen (direction???)
;;; (icon index in A, active window)
2018-01-21 03:33:15 +00:00
2018-02-13 16:18:11 +00:00
.proc icon_window_to_screen
2018-02-13 05:14:23 +00:00
tay
2018-01-11 06:31:02 +00:00
jsr push_zp_addrs
2017-10-12 15:04:27 +00:00
tya
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-02-05 04:35:19 +00:00
stax $06
2018-02-13 05:14:23 +00:00
;; fall through
.endproc
2018-02-13 16:18:11 +00:00
;;; Convert icon's coordinates from window to screen (direction???)
;;; (icon entry pointer in $6, active window)
.proc icon_ptr_window_to_screen
2018-02-13 05:14:23 +00:00
entry_ptr := $6
winfo_ptr := $8
lda active_window_id
2018-01-21 03:02:34 +00:00
jsr window_lookup
2018-02-13 05:14:23 +00:00
stax winfo_ptr
2018-02-13 05:36:41 +00:00
ldy #MGTK::winfo_offset_port + MGTK::grafport_offset_viewloc + 3
2018-02-13 16:18:11 +00:00
ldx #3
2018-02-13 05:36:41 +00:00
: lda (winfo_ptr),y
2018-02-13 16:18:11 +00:00
sta pos_screen,x
2017-10-12 15:04:27 +00:00
dey
dex
2018-02-13 05:36:41 +00:00
bpl :-
ldy #MGTK::winfo_offset_port + MGTK::grafport_offset_maprect + 3
2018-02-13 16:18:11 +00:00
ldx #3
2018-02-13 05:36:41 +00:00
: lda (winfo_ptr),y
2018-02-13 16:18:11 +00:00
sta pos_win,x
2017-10-12 15:04:27 +00:00
dey
dex
2018-02-13 05:36:41 +00:00
bpl :-
2018-02-13 16:18:11 +00:00
;; iconx
ldy #icon_entry_offset_iconx
2018-02-13 05:14:23 +00:00
lda (entry_ptr),y
2017-10-12 15:04:27 +00:00
sec
2018-02-13 16:18:11 +00:00
sbc pos_screen
2018-02-13 05:14:23 +00:00
sta (entry_ptr),y
2017-10-12 15:04:27 +00:00
iny
2018-02-13 05:14:23 +00:00
lda (entry_ptr),y
2018-02-13 16:18:11 +00:00
sbc pos_screen+1
2018-02-13 05:14:23 +00:00
sta (entry_ptr),y
2017-10-12 15:04:27 +00:00
iny
2018-02-13 16:18:11 +00:00
;; icony
2018-02-13 05:14:23 +00:00
lda (entry_ptr),y
2017-10-12 15:04:27 +00:00
sec
2018-02-13 16:18:11 +00:00
sbc pos_screen+2
2018-02-13 05:14:23 +00:00
sta (entry_ptr),y
2017-10-12 15:04:27 +00:00
iny
2018-02-13 05:14:23 +00:00
lda (entry_ptr),y
2018-02-13 16:18:11 +00:00
sbc pos_screen+3
2018-02-13 05:14:23 +00:00
sta (entry_ptr),y
2018-02-13 16:18:11 +00:00
;; iconx
ldy #icon_entry_offset_iconx
2018-02-13 05:14:23 +00:00
lda (entry_ptr),y
2017-10-12 15:04:27 +00:00
clc
2018-02-13 16:18:11 +00:00
adc pos_win
2018-02-13 05:14:23 +00:00
sta (entry_ptr),y
2017-10-12 15:04:27 +00:00
iny
2018-02-13 05:14:23 +00:00
lda (entry_ptr),y
2018-02-13 16:18:11 +00:00
adc pos_win+1
2018-02-13 05:14:23 +00:00
sta (entry_ptr),y
2017-10-12 15:04:27 +00:00
iny
2018-02-13 16:18:11 +00:00
;; icony
2018-02-13 05:14:23 +00:00
lda (entry_ptr),y
2017-10-12 15:04:27 +00:00
clc
2018-02-13 16:18:11 +00:00
adc pos_win+2
2018-02-13 05:14:23 +00:00
sta (entry_ptr),y
2017-10-12 15:04:27 +00:00
iny
2018-02-13 05:14:23 +00:00
lda (entry_ptr),y
2018-02-13 16:18:11 +00:00
adc pos_win+3
2018-02-13 05:14:23 +00:00
sta (entry_ptr),y
2018-01-11 06:31:02 +00:00
jsr pop_zp_addrs
2017-10-12 15:04:27 +00:00
rts
2018-02-13 16:18:11 +00:00
pos_screen: .word 0, 0
pos_win: .word 0, 0
2018-02-13 05:14:23 +00:00
.endproc
2018-01-21 03:33:15 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-21 03:33:15 +00:00
2018-02-18 01:15:27 +00:00
.proc zero_grafport5_coords
lda #0
2017-10-12 15:04:27 +00:00
tax
2018-02-18 01:15:27 +00:00
: sta grafport5::cliprect::x1,x
2018-02-06 04:37:41 +00:00
sta grafport5::viewloc::xcoord,x
sta grafport5::cliprect::x2,x
2017-10-12 15:04:27 +00:00
inx
2018-02-18 01:15:27 +00:00
cpx #4
bne :-
2018-01-30 16:57:36 +00:00
MGTK_RELAY_CALL MGTK::SetPort, grafport5
2017-10-12 15:04:27 +00:00
rts
2018-02-18 01:15:27 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-21 03:33:15 +00:00
2018-02-08 05:36:53 +00:00
gdi_data_buffer := $800
2018-02-26 05:03:58 +00:00
DEFINE_ON_LINE_PARAMS on_line_params,, gdi_data_buffer
2018-01-14 05:36:18 +00:00
.proc get_device_info
2018-01-18 17:32:25 +00:00
sta unit_number
sty device_num
2017-10-12 15:04:27 +00:00
and #$F0
2018-02-06 04:37:41 +00:00
sta on_line_params::unit_num
2018-01-14 05:36:18 +00:00
MLI_RELAY_CALL ON_LINE, on_line_params
2018-02-08 05:36:53 +00:00
beq success
retry: pha
ldy device_num
2018-02-08 05:36:53 +00:00
lda #0
2018-02-15 16:08:59 +00:00
sta devlst_copy,y
2018-02-08 05:48:19 +00:00
dec cached_window_icon_count
2018-01-15 05:23:48 +00:00
dec LDD9E
2017-10-12 15:04:27 +00:00
pla
rts
2018-02-08 05:36:53 +00:00
success:
lda gdi_data_buffer ; dr/slot/name_len
and #$0F ; mask off name len
bne create_icon
lda gdi_data_buffer+1 ; if name len is zero, second byte is error
jmp retry
2017-10-12 15:04:27 +00:00
2018-02-08 05:36:53 +00:00
create_icon:
icon_ptr := $6
jsr push_zp_addrs
jsr DESKTOP_ALLOC_ICON
ldy device_num
2018-02-15 16:08:59 +00:00
sta devlst_copy,y
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-02-08 05:36:53 +00:00
stax icon_ptr
;; Fill name with spaces
ldx #0
ldy #icon_entry_offset_len
lda #$20 ; ??? space? shouldn't this be at +1 ?
: sta (icon_ptr),y
2017-10-12 15:04:27 +00:00
iny
inx
2018-02-08 05:36:53 +00:00
cpx #icon_entry_name_bufsize+1
bne :-
;; Copy name, with leading/trailing space
ldy #icon_entry_offset_len
lda gdi_data_buffer
2017-10-12 15:04:27 +00:00
and #$0F
2018-02-08 05:36:53 +00:00
sta gdi_data_buffer
sta (icon_ptr),y
2018-02-09 05:42:59 +00:00
addr_call capitalize_string, gdi_data_buffer ; ???
2018-02-08 05:36:53 +00:00
ldx #0
ldy #icon_entry_offset_name+1 ; past leading space
: lda gdi_data_buffer+1,x
sta (icon_ptr),y
2017-10-12 15:04:27 +00:00
iny
inx
2018-02-08 05:36:53 +00:00
cpx gdi_data_buffer
bne :-
ldy #icon_entry_offset_len
lda (icon_ptr),y
2017-10-12 15:04:27 +00:00
clc
2018-02-08 05:36:53 +00:00
adc #2 ; leading/trailing space
sta (icon_ptr),y
2018-02-08 05:36:53 +00:00
;; Figure out icon
2018-01-18 17:32:25 +00:00
lda unit_number
cmp #$3E ; ??? Special case? Maybe RamWorks?
beq use_ramdisk_icon
and #$0F ; lower nibble
2018-01-18 17:32:25 +00:00
cmp #DT_PROFILE ; ProFile or Slinky-style RAM ?
bne use_floppy_icon
;; BUG: This defaults SmartPort hard drives to use floppy icons.
2018-01-18 17:32:25 +00:00
;; See https://github.com/inexorabletash/a2d/issues/6 for more
;; context; this code is basically unsalvageable per ProDOS
;; Tech Note #21.
;; Either ProFile or a "Slinky"/RamFactor-style Disk
2018-01-18 17:32:25 +00:00
lda unit_number ; bit 7 = drive (0=1, 1=2); 5-7 = slot
and #%01110000 ; mask off slot
2017-10-12 15:04:27 +00:00
lsr a
lsr a
lsr a
lsr a
ora #$C0
sta load_CxFB
load_CxFB := *+2
2018-01-15 04:55:54 +00:00
lda $C7FB ; self-modified $Cx7B
and #$01 ; $Cx7B bit 1 = ProFile, apparently???
beq use_profile_icon
;; fall through...
2018-01-13 04:58:02 +00:00
use_ramdisk_icon:
2018-02-08 05:36:53 +00:00
ldy #icon_entry_offset_iconbits
lda #<desktop_aux::ramdisk_icon
2018-02-08 05:36:53 +00:00
sta (icon_ptr),y
2017-10-12 15:04:27 +00:00
iny
lda #>desktop_aux::ramdisk_icon
2018-02-08 05:36:53 +00:00
sta (icon_ptr),y
jmp selected_device_icon
2017-10-12 15:04:27 +00:00
use_profile_icon:
2018-02-08 05:36:53 +00:00
ldy #icon_entry_offset_iconbits
lda #<desktop_aux::profile_icon
2018-02-08 05:36:53 +00:00
sta (icon_ptr),y
2017-10-12 15:04:27 +00:00
iny
lda #>desktop_aux::profile_icon
2018-02-08 05:36:53 +00:00
sta (icon_ptr),y
jmp selected_device_icon
2017-10-12 15:04:27 +00:00
use_floppy_icon:
2018-01-18 17:32:25 +00:00
cmp #$B ; removable / 4 volumes
bne use_floppy140_icon
2018-02-08 05:36:53 +00:00
ldy #icon_entry_offset_iconbits
lda #<desktop_aux::floppy800_icon
2018-02-08 05:36:53 +00:00
sta (icon_ptr),y
2017-10-12 15:04:27 +00:00
iny
lda #>desktop_aux::floppy800_icon
2018-02-08 05:36:53 +00:00
sta (icon_ptr),y
jmp selected_device_icon
2017-10-12 15:04:27 +00:00
use_floppy140_icon:
2018-01-18 17:32:25 +00:00
cmp #DT_DISKII ; 0 = Disk II
bne use_profile_icon ; last chance
2018-02-08 05:36:53 +00:00
ldy #icon_entry_offset_iconbits
lda #<desktop_aux::floppy140_icon
2018-02-08 05:36:53 +00:00
sta (icon_ptr),y
2017-10-12 15:04:27 +00:00
iny
lda #>desktop_aux::floppy140_icon
2018-02-08 05:36:53 +00:00
sta (icon_ptr),y
selected_device_icon:
2018-02-08 05:36:53 +00:00
;; Assign icon type
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
2018-02-07 05:59:25 +00:00
lda #0
2018-02-08 05:36:53 +00:00
sta (icon_ptr),y
inc device_num
2018-02-08 05:36:53 +00:00
;; Assign icon coordinates
lda device_num
2018-02-08 05:36:53 +00:00
asl a ; device num * 4 is coordinates index
2017-10-12 15:04:27 +00:00
asl a
tax
2018-02-08 05:36:53 +00:00
ldy #icon_entry_offset_iconx
: lda desktop_icon_coords_table,x
sta (icon_ptr),y
2017-10-12 15:04:27 +00:00
inx
iny
2018-02-08 05:36:53 +00:00
cpy #icon_entry_offset_iconbits
bne :-
;; Assign icon number
2018-02-08 05:48:19 +00:00
ldx cached_window_icon_count
2017-10-12 15:04:27 +00:00
dex
2018-02-08 05:36:53 +00:00
ldy #icon_entry_offset_index
lda (icon_ptr),y
2018-02-08 05:48:19 +00:00
sta cached_window_icon_list,x
2018-01-11 06:31:02 +00:00
jsr pop_zp_addrs
2018-02-16 03:29:05 +00:00
return #0
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-21 03:33:15 +00:00
2018-01-18 17:32:25 +00:00
unit_number: .byte 0
device_num: .byte 0
2017-10-12 15:04:27 +00:00
2018-02-08 05:36:53 +00:00
desktop_icon_coords_table:
DEFINE_POINT 0,0
2018-03-15 03:53:20 +00:00
DEFINE_POINT 490,16
DEFINE_POINT 490,45
DEFINE_POINT 490,75
DEFINE_POINT 490,103
DEFINE_POINT 490,131
DEFINE_POINT 400,160
DEFINE_POINT 310,160
DEFINE_POINT 220,160
DEFINE_POINT 130,160
DEFINE_POINT 40,160
2018-01-14 05:36:18 +00:00
2018-03-05 05:33:56 +00:00
DEFINE_GET_PREFIX_PARAMS get_prefix_params, L4824
2018-01-14 05:36:18 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-18 01:15:27 +00:00
.proc remove_icon_from_window
ldx cached_window_icon_count
2017-10-12 15:04:27 +00:00
dex
2018-02-18 01:15:27 +00:00
: cmp cached_window_icon_list,x
beq remove
2017-10-12 15:04:27 +00:00
dex
2018-02-18 01:15:27 +00:00
bpl :-
2017-10-12 15:04:27 +00:00
rts
2018-02-18 01:15:27 +00:00
remove: lda cached_window_icon_list+1,x
2018-02-08 05:48:19 +00:00
sta cached_window_icon_list,x
2017-10-12 15:04:27 +00:00
inx
2018-02-08 05:48:19 +00:00
cpx cached_window_icon_count
2018-02-18 01:15:27 +00:00
bne remove
2018-02-08 05:48:19 +00:00
dec cached_window_icon_count
ldx cached_window_icon_count
2018-02-18 01:15:27 +00:00
lda #0
2018-02-08 05:48:19 +00:00
sta cached_window_icon_list,x
2017-10-12 15:04:27 +00:00
rts
2018-02-18 01:15:27 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-01-11 06:31:02 +00:00
L8B19: jsr push_zp_addrs
2017-10-12 15:04:27 +00:00
jmp L8B2E
2018-02-15 16:08:59 +00:00
L8B1F: lda icon_params2
2017-10-12 15:04:27 +00:00
bne L8B25
rts
2018-01-11 06:31:02 +00:00
L8B25: jsr push_zp_addrs
2018-02-15 16:08:59 +00:00
lda icon_params2
2017-10-12 15:04:27 +00:00
jsr L7345
2018-02-18 01:15:27 +00:00
;; fall through
.proc L8B2E
ptr := $6
lda icon_params2
ldx #7 ; ???
: cmp LEC26,x
beq :+
2017-10-12 15:04:27 +00:00
dex
2018-02-18 01:15:27 +00:00
bpl :-
jmp skip
2017-10-12 15:04:27 +00:00
2018-02-18 01:15:27 +00:00
: lda #0
2018-01-13 03:06:55 +00:00
sta LEC26,x
2018-02-18 01:15:27 +00:00
skip: lda icon_params2
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-02-18 01:15:27 +00:00
stax ptr
2018-02-09 05:42:59 +00:00
ldy #icon_entry_offset_win_type
2018-02-18 01:15:27 +00:00
lda (ptr),y
2018-02-09 05:42:59 +00:00
and #(~icon_entry_open_mask)&$FF ; clear open_flag
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
jsr L4244
2018-01-11 06:31:02 +00:00
jsr pop_zp_addrs
2017-10-12 15:04:27 +00:00
rts
2018-02-18 01:15:27 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-18 01:15:27 +00:00
.proc L8B5C
ldy #$80
2018-03-18 18:59:01 +00:00
bne :+
2017-10-12 15:04:27 +00:00
L8B60: ldy #$00
2018-03-18 18:59:01 +00:00
: sty L8D4A
2018-02-05 04:35:19 +00:00
stax L8D4B
2017-10-12 15:04:27 +00:00
txa
2018-01-21 03:02:34 +00:00
jsr window_lookup
2018-02-05 04:35:19 +00:00
stax $06
2018-03-18 18:59:01 +00:00
2017-10-12 15:04:27 +00:00
lda #$14
clc
adc #$23
tay
ldx #$23
2018-03-18 18:59:01 +00:00
: lda ($06),y
2018-01-30 16:57:36 +00:00
sta grafport2,x
2017-10-12 15:04:27 +00:00
dey
dex
2018-03-18 18:59:01 +00:00
bpl :-
2017-10-12 15:04:27 +00:00
lda L8D4B
2018-02-09 05:42:59 +00:00
jsr icon_entry_lookup
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$03
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
clc
adc #$07
sta L0800
sta $0804
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
adc #$00
sta $0801
sta $0805
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
clc
adc #$07
sta $0802
sta $0806
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
adc #$00
sta $0803
sta $0807
ldy #$5B
ldx #$03
2018-01-30 16:57:36 +00:00
L8BC1: lda grafport2,x
2017-10-12 15:04:27 +00:00
sta L0800,y
dey
dex
bpl L8BC1
2018-02-06 18:06:44 +00:00
sub16 grafport2::cliprect::x2, grafport2::cliprect::x1, L8D54
sub16 grafport2::cliprect::y2, grafport2::cliprect::y1, L8D56
add16 $0858, L8D54, $085C
add16 $085A, L8D56, $085E
2017-10-12 15:04:27 +00:00
lda #$00
sta L8D4E
sta L8D4F
sta L8D4D
2018-02-06 18:06:44 +00:00
sub16 $0858, L0800, L8D50
sub16 $085A, $0802, L8D52
2017-10-12 15:04:27 +00:00
bit L8D51
bpl L8C6A
lda #$80
sta L8D4E
lda L8D50
eor #$FF
sta L8D50
lda L8D51
eor #$FF
sta L8D51
2018-02-26 00:06:17 +00:00
inc16 L8D50
2017-10-12 15:04:27 +00:00
L8C6A: bit L8D53
bpl L8C8C
lda #$80
sta L8D4F
lda L8D52
eor #$FF
sta L8D52
lda L8D53
eor #$FF
sta L8D53
2018-02-26 00:06:17 +00:00
inc16 L8D52
2018-02-10 06:10:11 +00:00
L8C8C: lsr16 L8D50
lsr16 L8D52
lsr16 L8D54
lsr16 L8D56
2017-10-12 15:04:27 +00:00
lda #$0A
sec
sbc L8D4D
asl a
asl a
asl a
tax
bit L8D4E
2018-03-18 18:59:01 +00:00
bpl :+
2018-02-10 07:33:54 +00:00
sub16 L0800, L8D50, L0800,x
2017-10-12 15:04:27 +00:00
jmp L8CDC
2018-03-18 18:59:01 +00:00
: add16 L0800, L8D50, L0800,x
2017-10-12 15:04:27 +00:00
L8CDC: bit L8D4F
bpl L8CF7
2018-02-10 07:33:54 +00:00
sub16 $0802, L8D52, $0802,x
2017-10-12 15:04:27 +00:00
jmp L8D0A
2018-02-10 07:33:54 +00:00
L8CF7: add16 $0802, L8D52, $0802,x
2018-02-14 05:52:36 +00:00
L8D0A: add16 L0800,x, L8D54, $0804,x
2018-02-10 07:33:54 +00:00
2018-02-14 05:52:36 +00:00
add16 $0802,x, L8D56, $0806,x
2018-02-10 07:33:54 +00:00
2017-10-12 15:04:27 +00:00
inc L8D4D
lda L8D4D
cmp #$0A
beq L8D3D
jmp L8C8C
L8D3D: bit L8D4A
bmi L8D46
jsr L8D58
rts
L8D46: jsr L8DB3
2017-12-31 02:02:15 +00:00
rts
2017-10-12 15:04:27 +00:00
2017-12-31 20:32:47 +00:00
L8D4A: .byte 0
2018-02-05 04:46:26 +00:00
L8D4B: .word 0
2017-12-31 20:32:47 +00:00
L8D4D: .byte 0
L8D4E: .byte 0
L8D4F: .byte 0
L8D50: .byte 0
L8D51: .byte 0
L8D52: .byte 0
L8D53: .byte 0
2018-02-16 19:25:00 +00:00
L8D54: .word 0
L8D56: .word 0
2018-02-18 01:15:27 +00:00
.endproc
L8B60 := L8B5C::L8B60
2018-01-21 03:33:15 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-21 03:33:15 +00:00
2018-02-18 01:15:27 +00:00
.proc L8D58
lda #$00
2017-10-12 15:04:27 +00:00
sta L8DB2
2018-01-30 16:57:36 +00:00
jsr reset_grafport3
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::SetPattern, checkerboard_pattern3
2018-02-03 04:41:42 +00:00
jsr set_penmode_xor
2017-10-12 15:04:27 +00:00
L8D6C: lda L8DB2
cmp #$0C
bcs L8D89
asl a
asl a
asl a
2018-03-18 18:59:01 +00:00
2017-10-12 15:04:27 +00:00
clc
2018-03-18 18:59:01 +00:00
adc #7
2017-10-12 15:04:27 +00:00
tax
2018-02-06 23:36:39 +00:00
ldy #7
2018-03-18 18:59:01 +00:00
: lda L0800,x
2018-01-21 03:33:15 +00:00
sta rect_E230,y
2017-10-12 15:04:27 +00:00
dex
dey
2018-03-18 18:59:01 +00:00
bpl :-
2018-01-21 03:33:15 +00:00
jsr draw_rect_E230
2017-10-12 15:04:27 +00:00
L8D89: lda L8DB2
sec
sbc #$02
bmi L8DA7
asl a
2018-02-05 04:46:26 +00:00
asl a
2017-10-12 15:04:27 +00:00
asl a
clc
adc #$07
tax
2018-02-06 23:36:39 +00:00
ldy #7
2017-10-12 15:04:27 +00:00
L8D9A: lda L0800,x
2018-01-21 03:33:15 +00:00
sta rect_E230,y
2017-10-12 15:04:27 +00:00
dex
dey
bpl L8D9A
2018-01-21 03:33:15 +00:00
jsr draw_rect_E230
2017-10-12 15:04:27 +00:00
L8DA7: inc L8DB2
lda L8DB2
cmp #$0E
bne L8D6C
rts
2017-12-31 20:32:47 +00:00
L8DB2: .byte 0
2018-02-18 01:15:27 +00:00
.endproc
2018-01-21 03:33:15 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-21 03:33:15 +00:00
2018-02-18 01:15:27 +00:00
.proc L8DB3
lda #$0B
2017-10-12 15:04:27 +00:00
sta L8E0F
2018-01-30 16:57:36 +00:00
jsr reset_grafport3
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::SetPattern, checkerboard_pattern3
2018-02-03 04:41:42 +00:00
jsr set_penmode_xor
2018-03-18 18:59:01 +00:00
loop: lda L8E0F
2017-10-12 15:04:27 +00:00
bmi L8DE4
beq L8DE4
asl a
asl a
asl a
clc
adc #$07
tax
2018-03-18 18:59:01 +00:00
2018-02-06 23:36:39 +00:00
ldy #7
2018-03-18 18:59:01 +00:00
: lda L0800,x
2018-01-21 03:33:15 +00:00
sta rect_E230,y
2017-10-12 15:04:27 +00:00
dex
dey
2018-03-18 18:59:01 +00:00
bpl :-
2018-01-21 03:33:15 +00:00
jsr draw_rect_E230
2017-10-12 15:04:27 +00:00
L8DE4: lda L8E0F
clc
adc #$02
cmp #$0E
bcs L8E04
asl a
2017-12-31 02:02:15 +00:00
asl a
2017-10-12 15:04:27 +00:00
asl a
clc
adc #$07
tax
2018-02-06 23:36:39 +00:00
ldy #7
2018-01-21 03:33:15 +00:00
L8DF7: lda L0800,x
sta rect_E230,y
2017-10-12 15:04:27 +00:00
dex
dey
2018-01-21 03:33:15 +00:00
bpl L8DF7
jsr draw_rect_E230
2017-12-31 02:02:15 +00:00
L8E04: dec L8E0F
lda L8E0F
cmp #$FD
2018-03-18 18:59:01 +00:00
bne loop
2017-12-31 02:02:15 +00:00
rts
2017-12-31 20:32:47 +00:00
L8E0F: .byte 0
2018-02-18 01:15:27 +00:00
.endproc
2018-01-21 03:33:15 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-21 03:33:15 +00:00
.proc draw_rect_E230
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::FrameRect, rect_E230
2017-12-31 02:02:15 +00:00
rts
2018-01-21 03:33:15 +00:00
.endproc
2017-12-31 02:02:15 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 17:00:24 +00:00
;;; Dynamically load parts of Desktop2
;;; Call load_dynamic_routine or restore_dynamic_routine
2018-01-19 17:00:24 +00:00
;;; with A set to routine number (0-8); routine is loaded
;;; from DeskTop2 file to target address. Returns with
;;; minus flag set on failure.
;;; Routines are:
2018-01-20 02:55:15 +00:00
;;; 0 = disk copy - A$ 800,L$ 200
;;; 1 = format/erase disk - A$ 800,L$1400 call w/ A = 4 = format, A = 5 = erase
2018-01-19 17:00:24 +00:00
;;; 2 = part of selector actions - A$9000,L$1000
2018-01-20 02:55:15 +00:00
;;; 3 = common routines - A$5000,L$2000
;;; 4 = part of copy file - A$7000,L$ 800
;;; 5 = part of delete file - A$7000,L$ 800
;;; 6 = part of selector actions - L$7000,L$ 800
;;; 7 = restore 1 - A$5000,L$2800 (restore $5000...$77FF)
;;; 8 = restore 2 - A$9000,L$1000 (restore $9000...$9FFF)
;;;
;;; Routines 2-6 need appropriate "restore routines" applied when complete.
2018-01-19 17:00:24 +00:00
.proc load_dynamic_routine_impl
2018-01-19 17:00:24 +00:00
pos_table:
.dword $00012FE0,$000160E0,$000174E0,$000184E0,$0001A4E0
.dword $0001ACE0,$0001B4E0,$0000B780,$0000F780
len_table:
.word $0200,$1400,$1000,$2000,$0800,$0800,$0800,$2800,$1000
addr_table:
.addr $0800,$0800,$9000,$5000,$7000,$7000,$7000,$5000,$9000
2018-01-14 07:24:19 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_OPEN_PARAMS open_params, str_desktop2, $1C00
2018-01-14 07:24:19 +00:00
str_desktop2:
PASCAL_STRING "DeskTop2"
2018-02-26 05:03:58 +00:00
DEFINE_SET_MARK_PARAMS set_mark_params, 0
2018-01-14 07:24:19 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_READ_PARAMS read_params, 0, 0
DEFINE_CLOSE_PARAMS close_params
2018-01-14 07:24:19 +00:00
2018-01-20 03:41:20 +00:00
restore_flag:
.byte 0
2018-01-19 17:00:24 +00:00
;; Called with routine # in A
load: pha ; entry point with bit clear
2017-10-12 15:04:27 +00:00
lda #$00
2018-01-20 03:41:20 +00:00
sta restore_flag
2018-01-19 17:00:24 +00:00
beq :+
restore:
pha
2018-01-19 17:00:24 +00:00
lda #$80 ; entry point with bit set
2018-01-20 03:41:20 +00:00
sta restore_flag
2018-01-19 17:00:24 +00:00
: pla
asl a ; y = A * 2 (to index into word table)
2017-10-12 15:04:27 +00:00
tay
2018-01-19 17:00:24 +00:00
asl a ; x = A * 4 (to index into dword table)
2017-10-12 15:04:27 +00:00
tax
2018-01-19 17:00:24 +00:00
lda pos_table,x
2018-02-06 04:37:41 +00:00
sta set_mark_params::position
2018-01-19 17:00:24 +00:00
lda pos_table+1,x
2018-02-06 04:37:41 +00:00
sta set_mark_params::position+1
2018-01-19 17:00:24 +00:00
lda pos_table+2,x
2018-02-06 04:37:41 +00:00
sta set_mark_params::position+2
2018-01-19 17:00:24 +00:00
2018-02-06 17:31:58 +00:00
copy16 len_table,y, read_params::request_count
copy16 addr_table,y, read_params::data_buffer
2018-01-19 17:00:24 +00:00
open: MLI_RELAY_CALL OPEN, open_params
beq :+
2018-01-23 16:33:12 +00:00
lda #warning_msg_insert_system_disk
ora restore_flag ; high bit set = no cancel
jsr show_warning_dialog_num
2018-01-19 17:00:24 +00:00
beq open
2018-02-16 03:29:05 +00:00
return #$FF ; failed
2017-10-12 15:04:27 +00:00
2018-01-19 17:00:24 +00:00
: lda open_params::ref_num
sta read_params::ref_num
2018-01-14 07:58:16 +00:00
sta set_mark_params::ref_num
MLI_RELAY_CALL SET_MARK, set_mark_params
2018-01-19 17:00:24 +00:00
MLI_RELAY_CALL READ, read_params
MLI_RELAY_CALL CLOSE, close_params
2017-10-12 15:04:27 +00:00
rts
2018-01-21 18:44:26 +00:00
.assert * = $8EFB, error, "Segment length mismatch"
PAD_TO $8F00
2018-01-19 17:00:24 +00:00
.endproc
load_dynamic_routine := load_dynamic_routine_impl::load
restore_dynamic_routine := load_dynamic_routine_impl::restore
2018-01-19 17:00:24 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-19 17:00:24 +00:00
2017-10-12 15:04:27 +00:00
L8F00: jmp L8FC5
2018-01-21 22:35:37 +00:00
jmp rts2 ; rts
jmp rts2 ; rts
2018-02-18 01:15:27 +00:00
L8F09: jmp L92E7 ; cmd_get_info
L8F0C: jmp L8F9B ; cmd_lock
L8F0F: jmp L8FA1 ; cmd_unlock
L8F12: jmp L9571 ; cmd_rename_icon
L8F15: jmp L9213 ; cmd_eject ???
L8F18: jmp L8F2A ; cmd_copy_file ???
L8F1B: jmp L8F5B ; cmd_delete_file ???
2018-01-21 22:35:37 +00:00
jmp rts2 ; rts
jmp rts2 ; rts
2018-02-18 01:15:27 +00:00
L8F24: jmp L8F7E ; cmd_selector_action ???
L8F27: jmp L8FB8 ; cmd_get_size
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-18 01:15:27 +00:00
;; TODO: Break this down more?
.proc L8F2A
lda #0
2017-10-12 15:04:27 +00:00
sta L9189
tsx
2018-02-16 03:12:59 +00:00
stx stack_stash
2017-10-12 15:04:27 +00:00
jsr LA248
jsr L993E
jsr LA271
jsr L9968
2018-02-24 05:12:41 +00:00
L8F3F: copy16 #$00FF, LE05B
2017-10-12 15:04:27 +00:00
jsr L9A0D
jsr L917F
L8F4F: jsr L91E8
2018-02-16 03:29:05 +00:00
return #0
2017-10-12 15:04:27 +00:00
jsr L91D5
jmp L8F4F
2018-02-16 03:12:59 +00:00
L8F5B: lda #0
2017-10-12 15:04:27 +00:00
sta L9189
tsx
2018-02-16 03:12:59 +00:00
stx stack_stash
2017-10-12 15:04:27 +00:00
jsr LA248
lda #$00
jsr L9E7E
jsr LA271
jsr L9182
jsr L9EBF
jsr L9EDB
jsr L917F
jmp L8F4F
L8F7E: lda #$80
sta L918C
lda #$C0
sta L9189
tsx
2018-02-16 03:12:59 +00:00
stx stack_stash
2017-10-12 15:04:27 +00:00
jsr LA248
jsr L9984
jsr LA271
jsr L99BC
jmp L8F3F
L8F9B: jsr L8FDD
jmp L8F4F
L8FA1: jsr L8FE1
jmp L8F4F
L8FA7: asl a
tay
2018-02-09 05:42:59 +00:00
copy16 icon_entry_address_table,y, $06
ldy #icon_entry_offset_win_type
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
rts
L8FB8: lda #$00
sta L918C
lda #$C0
sta L9189
jmp L8FEB
2018-01-24 23:39:12 +00:00
L8FC5: lda LEBFC
2017-10-12 15:04:27 +00:00
cmp #$01
bne L8FD0
lda #$80
bne L8FD2
L8FD0: lda #$00
L8FD2: sta L918A
2018-02-16 03:12:59 +00:00
lda #0
2017-10-12 15:04:27 +00:00
sta L9189
jmp L8FEB
L8FDD: lda #$00
beq L8FE3
L8FE1: lda #$80
L8FE3: sta L918B
lda #$80
sta L9189
L8FEB: tsx
2018-02-16 03:12:59 +00:00
stx stack_stash
2017-10-12 15:04:27 +00:00
lda #$00
2018-02-06 23:36:39 +00:00
sta LE05C
2017-10-12 15:04:27 +00:00
jsr L91D5
lda L9189
2018-02-18 01:15:27 +00:00
beq :+
2017-10-12 15:04:27 +00:00
jmp L908C
2018-02-18 01:15:27 +00:00
: bit L918A
bpl L9011
2018-02-03 03:38:35 +00:00
lda selected_window_index
2018-02-18 01:15:27 +00:00
beq :+
2017-10-12 15:04:27 +00:00
jmp L908C
2018-02-18 01:15:27 +00:00
: pla
2017-10-12 15:04:27 +00:00
pla
2018-01-20 22:31:48 +00:00
jmp JT_EJECT
2017-10-12 15:04:27 +00:00
2018-01-24 23:39:12 +00:00
L9011: lda LEBFC
2017-10-12 15:04:27 +00:00
bpl L9032
and #$7F
asl a
tax
2018-02-06 17:31:58 +00:00
copy16 window_address_table,x, $08
copy16 #L917B, $06
2018-02-13 16:18:11 +00:00
jsr join_paths
2017-10-12 15:04:27 +00:00
jmp L9076
L9032: jsr L8FA7
and #$0F
beq L9051
asl a
tax
2018-02-06 17:31:58 +00:00
copy16 window_address_table,x, $08
2018-01-24 23:39:12 +00:00
lda LEBFC
2018-02-13 16:18:11 +00:00
jsr icon_entry_name_lookup
jsr join_paths
2017-10-12 15:04:27 +00:00
jmp L9076
2018-01-24 23:39:12 +00:00
L9051: lda LEBFC
2018-02-13 16:18:11 +00:00
jsr icon_entry_name_lookup
2017-10-12 15:04:27 +00:00
ldy #$01
lda #$2F
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
dey
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
sta L906D
2018-02-15 16:08:59 +00:00
sta path_buf3,y
2017-10-12 15:04:27 +00:00
L9066: iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-15 16:08:59 +00:00
sta path_buf3,y
2018-01-21 22:35:37 +00:00
L906D := *+1
cpy #$00 ; self-modified
2017-10-12 15:04:27 +00:00
bne L9066
ldy #$01
lda #$20
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
L9076: ldy #$FF
L9078: iny
2018-02-15 16:08:59 +00:00
lda path_buf3,y
sta path_buf4,y
cpy path_buf3
2017-10-12 15:04:27 +00:00
bne L9078
2018-02-15 16:08:59 +00:00
lda path_buf4
2017-10-12 15:04:27 +00:00
beq L908C
2018-02-15 16:08:59 +00:00
dec path_buf4
2017-10-12 15:04:27 +00:00
L908C: lda #$00
sta L97E4
jsr LA248
bit L9189
bvs L90B4
bmi L90AE
bit L918A
bmi L90A6
jsr L993E
jmp L90DE
L90A6: lda #$06
jsr L9E7E
jmp L90DE
L90AE: jsr LA059
jmp L90DE
L90B4: jsr LA1E4
jmp L90DE
L90BA: bit L9189
bvs L90D8
bmi L90D2
bit L918A
bmi L90CC
jsr L9968
jmp L90DE
L90CC: jsr L9EBF
jmp L90DE
L90D2: jsr LA0DF
jmp L90DE
L90D8: jsr LA241
jmp L90DE
L90DE: jsr L91F5
2018-02-19 19:33:13 +00:00
lda selected_icon_count
2017-10-12 15:04:27 +00:00
bne L90E9
jmp L9168
L90E9: ldx #$00
stx L917A
L90EE: jsr L91F5
ldx L917A
2018-02-19 19:33:13 +00:00
lda selected_icon_list,x
2017-10-12 15:04:27 +00:00
cmp #$01
beq L9140
2018-02-13 16:18:11 +00:00
jsr icon_entry_name_lookup
jsr join_paths
2018-02-15 16:08:59 +00:00
copy16 #path_buf3, $06
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
beq L9114
sec
sbc #$01
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
L9114: lda L97E4
beq L913D
bit L9189
bmi L912F
bit L918A
bmi L9129
jsr L9A01
jmp L9140
L9129: jsr L9EDB
jmp L9140
L912F: bvs L9137
jsr LA114
jmp L9140
L9137: jsr LA271
jmp L9140
L913D: jsr LA271
L9140: inc L917A
ldx L917A
2018-02-19 19:33:13 +00:00
cpx selected_icon_count
2017-10-12 15:04:27 +00:00
bne L90EE
lda L97E4
bne L9168
inc L97E4
bit L9189
bmi L915D
bit L918A
bpl L9165
L915D: jsr L9182
bit L9189
bvs L9168
L9165: jmp L90BA
L9168: jsr L917F
2018-01-24 23:39:12 +00:00
lda LEBFC
2018-02-13 16:18:11 +00:00
jsr icon_entry_name_lookup
2017-10-12 15:04:27 +00:00
ldy #$01
lda #$20
2018-01-17 15:41:23 +00:00
sta ($06),y
2018-02-16 03:29:05 +00:00
return #0
2017-10-12 15:04:27 +00:00
2017-12-31 20:32:47 +00:00
L917A: .byte 0
2018-01-21 22:35:37 +00:00
L917B: .byte 0
2018-02-18 01:15:27 +00:00
.endproc
L8F5B := L8F2A::L8F5B
L8F7E := L8F2A::L8F7E
L8F9B := L8F2A::L8F9B
L8FA1 := L8F2A::L8FA1
L8FB8 := L8F2A::L8FB8
L8FC5 := L8F2A::L8FC5
2018-01-05 04:27:15 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-13 16:18:11 +00:00
2018-01-05 04:27:15 +00:00
;; Dynamically constructed jump table???
L917D := *+1
2018-01-17 03:36:54 +00:00
L917C: jmp dummy0000
2018-01-05 04:27:15 +00:00
L9180 := *+1
2018-01-17 03:36:54 +00:00
L917F: jmp dummy0000
2018-01-05 04:27:15 +00:00
L9183 := *+1
2018-01-17 03:36:54 +00:00
L9182: jmp dummy0000
2018-01-05 04:27:15 +00:00
L9186 := *+1
2018-01-17 03:36:54 +00:00
L9185: jmp dummy0000
2018-01-05 04:27:15 +00:00
2018-02-16 03:12:59 +00:00
stack_stash:
.byte 0
2017-12-31 20:32:47 +00:00
L9189: .byte 0
L918A: .byte 0
L918B: .byte 0
L918C: .byte 0
L918D: .byte 0
2018-02-13 16:18:11 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-13 16:18:11 +00:00
;;; For icon index in A, put pointer to name in $6
.proc icon_entry_name_lookup
asl a
2017-10-12 15:04:27 +00:00
tay
2018-03-05 16:41:22 +00:00
add16 icon_entry_address_table,y, #icon_entry_offset_len, $06
2017-10-12 15:04:27 +00:00
rts
2018-02-13 16:18:11 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-13 16:18:11 +00:00
.proc join_paths
str1 := $8
str2 := $6
2018-02-15 16:08:59 +00:00
buf := path_buf3
2018-02-13 16:18:11 +00:00
ldx #0
ldy #0
lda (str1),y
beq do_str2
;; Copy $8 (str1)
sta len1
: iny
2017-10-12 15:04:27 +00:00
inx
2018-02-13 16:18:11 +00:00
lda (str1),y
sta buf,x
len1 := *+1
2018-01-21 22:35:37 +00:00
cpy #0 ; self-modified
2018-02-13 16:18:11 +00:00
bne :-
do_str2:
;; Add path separator
inx
2018-01-24 04:11:38 +00:00
lda #'/'
2018-02-13 16:18:11 +00:00
sta buf,x
;; Append $6 (str2)
ldy #0
lda (str2),y
beq done
sta len2
2017-10-12 15:04:27 +00:00
iny
2018-02-13 16:18:11 +00:00
: iny
2017-10-12 15:04:27 +00:00
inx
2018-02-13 16:18:11 +00:00
lda (str2),y
sta buf,x
len2 := *+1
cpy #0 ; self-modified
bne :-
done: stx buf
2017-10-12 15:04:27 +00:00
rts
2018-02-13 16:18:11 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-01-30 16:57:36 +00:00
L91D5: yax_call JT_MGTK_RELAY, MGTK::InitPort, grafport3
yax_call JT_MGTK_RELAY, MGTK::SetPort, grafport3
2017-10-12 15:04:27 +00:00
rts
2018-01-20 22:31:48 +00:00
L91E8: jsr JT_REDRAW_ALL
2018-01-25 04:20:39 +00:00
yax_call JT_DESKTOP_RELAY, $C, 0
2017-10-12 15:04:27 +00:00
rts
2018-02-18 01:15:27 +00:00
.proc L91F5
copy16 #L9211, $08
lda selected_window_index
2017-10-12 15:04:27 +00:00
beq L9210
asl a
tax
2018-02-06 17:31:58 +00:00
copy16 window_address_table,x, $08
2017-10-12 15:04:27 +00:00
lda #$00
L9210: rts
2018-01-21 19:47:40 +00:00
L9211: .addr 0
2018-02-18 01:15:27 +00:00
.endproc
2018-01-21 19:47:40 +00:00
2018-02-18 01:15:27 +00:00
.proc L9213
2018-02-19 19:33:13 +00:00
lda selected_icon_count
2018-02-18 01:15:27 +00:00
bne :+
2017-10-12 15:04:27 +00:00
rts
2018-02-19 19:33:13 +00:00
: ldx selected_icon_count
2017-10-12 15:04:27 +00:00
stx L0800
dex
2018-02-19 19:33:13 +00:00
: lda selected_icon_list,x
2017-10-12 15:04:27 +00:00
sta $0801,x
dex
2018-02-18 01:15:27 +00:00
bpl :-
2018-01-20 18:57:25 +00:00
jsr JT_CLEAR_SELECTION
2018-02-18 01:15:27 +00:00
ldx #0
stx index
loop: ldx index
2017-10-12 15:04:27 +00:00
lda $0801,x
cmp #$01
2018-02-18 01:15:27 +00:00
beq :+
2018-02-18 07:04:52 +00:00
jsr smartport_eject
2018-02-18 01:15:27 +00:00
: inc index
ldx index
2017-10-12 15:04:27 +00:00
cpx L0800
2018-02-18 01:15:27 +00:00
bne loop
2017-10-12 15:04:27 +00:00
rts
2018-02-18 01:15:27 +00:00
index: .byte 0
.endproc
2018-02-18 07:04:52 +00:00
.proc smartport_eject
2018-02-18 01:15:27 +00:00
ptr := $6
sta compare
ldy #0
loop: lda devlst_copy,y
compare := *+1
cmp #0
beq found
2018-01-15 04:55:54 +00:00
cpy DEVCNT
2018-02-18 01:15:27 +00:00
beq exit
2017-10-12 15:04:27 +00:00
iny
2018-02-18 01:15:27 +00:00
bne loop
exit: rts
found: lda DEVLST,y ;
sta unit_num
2017-10-12 15:04:27 +00:00
2018-02-18 01:15:27 +00:00
;; Compute driver address ($BFds for Slot s Drive d)
2017-10-12 15:04:27 +00:00
ldx #$11
2018-02-18 01:15:27 +00:00
lda unit_num
and #$80 ; high bit is drive (0=D1, 1=D2)
beq :+
2017-10-12 15:04:27 +00:00
ldx #$21
2018-02-18 01:15:27 +00:00
: stx bf_lo ; D1=$11, D2=$21
lda unit_num
2017-10-12 15:04:27 +00:00
and #$70
lsr a
lsr a
lsr a
clc
2018-02-18 01:15:27 +00:00
adc bf_lo
sta bf_lo
bf_lo := *+1
lda $BF00 ; self-modified to $BFds
sta ptr+1
lda #0 ; Bug: assumes driver is at $XX00 ???
sta ptr ; Bug: Should check driver is $Cn before continuing
ldy #7
lda (ptr),y ; $Cn07 == 0 for SmartPort
bne exit
ldy #$FB ; $CnFB low bits???
lda (ptr),y
2017-10-12 15:04:27 +00:00
and #$7F
2018-02-18 01:15:27 +00:00
bne exit
;; Locate SmartPort entry point: $Cn00 + ($CnFF) + 3
2017-10-12 15:04:27 +00:00
ldy #$FF
2018-02-18 01:15:27 +00:00
lda (ptr),y
2017-10-12 15:04:27 +00:00
clc
2018-02-18 01:15:27 +00:00
adc #3
sta ptr
lda unit_num
2017-10-12 15:04:27 +00:00
pha
rol a
pla
php
and #$20
lsr a
lsr a
lsr a
lsr a
plp
2018-02-18 01:15:27 +00:00
adc #1
2018-02-28 02:38:18 +00:00
sta control_unit_number
2018-02-18 01:15:27 +00:00
jsr call
.byte $04 ; $04 = CONTROL
.addr control_params
2018-01-01 05:16:41 +00:00
rts
2018-02-18 01:15:27 +00:00
call: jmp ($06)
.proc control_params
param_count: .byte 3
unit_number: .byte $0
control_list: .addr list
control_code: .byte 4 ; Eject disk
.endproc
2018-02-28 02:38:18 +00:00
control_unit_number := control_params::unit_number
2018-02-18 01:15:27 +00:00
list: .word 0 ; 0 items in list
unit_num:
.byte 0
2017-10-12 15:04:27 +00:00
2018-02-18 01:15:27 +00:00
.byte 0 ; unused???
.endproc
2018-01-17 20:41:21 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_GET_FILE_INFO_PARAMS get_file_info_params5, $220
2018-01-17 20:41:21 +00:00
L92DB: .byte 0,0
2018-01-18 01:35:35 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_READ_BLOCK_PARAMS block_params, $0800, $A
2018-01-18 01:35:35 +00:00
2017-12-31 02:02:15 +00:00
L92E3: .byte $00
2018-02-06 18:10:34 +00:00
L92E4: .word 0
2017-12-31 02:02:15 +00:00
L92E6: .byte $00
2018-02-18 07:04:52 +00:00
.proc L92E7
2018-02-19 19:33:13 +00:00
lda selected_icon_count
2017-10-12 15:04:27 +00:00
bne L92ED
rts
L92ED: lda #$00
sta L92E6
jsr L91D5
L92F5: ldx L92E6
2018-02-19 19:33:13 +00:00
cpx selected_icon_count
2017-10-12 15:04:27 +00:00
bne L9300
jmp L9534
L9300: lda selected_window_index
2017-10-12 15:04:27 +00:00
beq L9331
asl a
tax
2018-02-06 17:31:58 +00:00
copy16 window_address_table,x, $08
2017-10-12 15:04:27 +00:00
ldx L92E6
2018-02-19 19:33:13 +00:00
lda selected_icon_list,x
2018-02-13 16:18:11 +00:00
jsr icon_entry_name_lookup
jsr join_paths
2017-10-12 15:04:27 +00:00
ldy #$00
2018-02-15 16:08:59 +00:00
L931F: lda path_buf3,y
2018-01-17 15:41:23 +00:00
sta $220,y
2017-10-12 15:04:27 +00:00
iny
2018-01-17 15:41:23 +00:00
cpy $220
2017-10-12 15:04:27 +00:00
bne L931F
2018-01-17 15:41:23 +00:00
dec $220
2017-10-12 15:04:27 +00:00
jmp L9356
L9331: ldx L92E6
2018-02-19 19:33:13 +00:00
lda selected_icon_list,x
2017-10-12 15:04:27 +00:00
cmp #$01
bne L933E
jmp L952E
2018-02-13 16:18:11 +00:00
L933E: jsr icon_entry_name_lookup
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-17 15:41:23 +00:00
L9343: lda ($06),y
sta $220,y
2017-10-12 15:04:27 +00:00
iny
2018-01-17 15:41:23 +00:00
cpy $220
2017-10-12 15:04:27 +00:00
bne L9343
2018-01-17 15:41:23 +00:00
dec $220
2018-01-24 04:11:38 +00:00
lda #'/'
2017-10-12 15:04:27 +00:00
sta $0221
2018-01-23 02:09:15 +00:00
L9356: yax_call JT_MLI_RELAY, GET_FILE_INFO, get_file_info_params5
2017-10-12 15:04:27 +00:00
beq L9366
2018-02-13 05:14:23 +00:00
jsr show_error_alert
2017-10-12 15:04:27 +00:00
beq L9356
L9366: lda selected_window_index
2017-10-12 15:04:27 +00:00
beq L9387
lda #$80
sta L92E3
lda L92E6
clc
adc #$01
2018-02-19 19:33:13 +00:00
cmp selected_icon_count
2017-10-12 15:04:27 +00:00
beq L9381
inc L92E3
inc L92E3
2018-02-15 05:07:31 +00:00
L9381: jsr launch_get_info_dialog
2017-10-12 15:04:27 +00:00
jmp L93DB
L9387: lda #$81
sta L92E3
lda L92E6
clc
adc #$01
2018-02-19 19:33:13 +00:00
cmp selected_icon_count
2017-10-12 15:04:27 +00:00
beq L939D
inc L92E3
inc L92E3
2018-02-15 05:07:31 +00:00
L939D: jsr launch_get_info_dialog
2017-10-12 15:04:27 +00:00
lda #$00
sta L942E
ldx L92E6
2018-02-19 19:33:13 +00:00
lda selected_icon_list,x
2017-10-12 15:04:27 +00:00
ldy #$0F
2018-02-15 16:08:59 +00:00
L93AD: cmp devlst_copy,y
2017-10-12 15:04:27 +00:00
beq L93B8
dey
bpl L93AD
jmp L93DB
2018-01-15 04:55:54 +00:00
L93B8: lda DEVLST,y
2018-01-18 01:35:35 +00:00
sta block_params::unit_num
2018-01-23 02:09:15 +00:00
yax_call JT_MLI_RELAY, READ_BLOCK, block_params
2017-10-12 15:04:27 +00:00
bne L93DB
2018-01-23 02:09:15 +00:00
yax_call JT_MLI_RELAY, WRITE_BLOCK, block_params
2017-10-12 15:04:27 +00:00
cmp #$2B
bne L93DB
lda #$80
sta L942E
L93DB: ldx L92E6
2018-02-19 19:33:13 +00:00
lda selected_icon_list,x
2018-02-13 16:18:11 +00:00
jsr icon_entry_name_lookup
2017-10-12 15:04:27 +00:00
lda #$01
sta L92E3
2018-02-06 17:31:58 +00:00
copy16 $06, L92E4
2018-02-15 05:07:31 +00:00
jsr launch_get_info_dialog
2017-10-12 15:04:27 +00:00
lda #$02
sta L92E3
lda selected_window_index
2017-10-12 15:04:27 +00:00
bne L9413
bit L942E
bmi L940C
lda #$00
sta L92E4
beq L9428
L940C: lda #$01
sta L92E4
bne L9428
2018-01-17 20:41:21 +00:00
L9413: lda get_file_info_params5::access
2017-10-12 15:04:27 +00:00
and #$C3
cmp #$C3
beq L9423
lda #$01
sta L92E4
bne L9428
L9423: lda #$00
sta L92E4
2018-02-15 05:07:31 +00:00
L9428: jsr launch_get_info_dialog
2017-10-12 15:04:27 +00:00
jmp L942F
2017-12-31 20:32:47 +00:00
L942E: .byte 0
2018-02-18 07:04:52 +00:00
2017-10-12 15:04:27 +00:00
L942F: lda #$03
sta L92E3
lda #$00
2018-01-17 15:41:23 +00:00
sta $220
lda selected_window_index
2018-02-06 17:31:58 +00:00
bne L9472 ; ProDOS TRM 4.4.5:
2018-02-06 04:37:41 +00:00
lda get_file_info_params5::aux_type ; "When file information about a volume
2018-01-18 01:35:35 +00:00
sec ; directory is requested, the total
2018-02-06 04:37:41 +00:00
sbc get_file_info_params5::blocks_used ; number of blocks on the volume is
2018-01-18 01:35:35 +00:00
pha ; returned in the aux_type field and
2018-02-06 04:37:41 +00:00
lda get_file_info_params5::aux_type+1 ; the total blocks for all files is
sbc get_file_info_params5::blocks_used+1 ; returned in blocks_used."
2017-10-12 15:04:27 +00:00
tax
pla
2018-02-10 06:59:05 +00:00
jsr JT_SIZE_STRING
2017-10-12 15:04:27 +00:00
jsr L9549
ldx #$00
2018-01-12 18:01:28 +00:00
L9456: lda text_buffer2::data-1,x
2017-10-12 15:04:27 +00:00
cmp #$42
beq L9460
inx
bne L9456
2018-01-17 15:41:23 +00:00
L9460: stx $220
2018-01-24 04:11:38 +00:00
lda #'/'
2018-01-17 15:41:23 +00:00
sta $220,x
2017-10-12 15:04:27 +00:00
dex
2018-01-12 18:01:28 +00:00
L9469: lda text_buffer2::data-1,x
2018-01-17 15:41:23 +00:00
sta $220,x
2017-10-12 15:04:27 +00:00
dex
bne L9469
L9472: lda selected_window_index
2017-10-12 15:04:27 +00:00
bne L9480
2018-02-06 04:37:41 +00:00
ldax get_file_info_params5::aux_type
2017-10-12 15:04:27 +00:00
jmp L9486
2018-02-06 04:37:41 +00:00
L9480: ldax get_file_info_params5::blocks_used
2018-02-10 06:59:05 +00:00
L9486: jsr JT_SIZE_STRING
2017-10-12 15:04:27 +00:00
jsr L9549
2018-01-17 15:41:23 +00:00
ldx $220
2017-10-12 15:04:27 +00:00
ldy #$00
2018-03-05 05:33:56 +00:00
L9491: lda text_buffer2::data,y
2017-10-12 15:04:27 +00:00
sta $0221,x
inx
iny
2018-01-12 18:01:28 +00:00
cpy text_buffer2::length
2017-10-12 15:04:27 +00:00
bne L9491
tya
clc
2018-01-17 15:41:23 +00:00
adc $220
sta $220
ldx $220
L94A9: lda $220,x
2018-02-15 16:08:59 +00:00
sta path_buf4,x
2017-10-12 15:04:27 +00:00
dex
bpl L94A9
2018-02-15 16:08:59 +00:00
lda #<path_buf4
2017-10-12 15:04:27 +00:00
sta L92E4
2018-02-15 16:08:59 +00:00
lda #>path_buf4
2018-01-24 04:11:38 +00:00
sta L92E4+1
2018-02-15 05:07:31 +00:00
jsr launch_get_info_dialog
2017-10-12 15:04:27 +00:00
lda #$04
sta L92E3
2018-02-06 17:31:58 +00:00
copy16 get_file_info_params5::create_date, date
2018-02-10 06:59:05 +00:00
jsr JT_DATE_STRING
2018-02-06 23:36:39 +00:00
copy16 #text_buffer2::length, L92E4
2018-02-15 05:07:31 +00:00
jsr launch_get_info_dialog
2017-10-12 15:04:27 +00:00
lda #$05
sta L92E3
2018-02-06 17:31:58 +00:00
copy16 get_file_info_params5::mod_date, date
2018-02-10 06:59:05 +00:00
jsr JT_DATE_STRING
2018-02-06 23:36:39 +00:00
copy16 #text_buffer2::length, L92E4
2018-02-15 05:07:31 +00:00
jsr launch_get_info_dialog
2017-10-12 15:04:27 +00:00
lda #$06
sta L92E3
lda selected_window_index
2017-10-12 15:04:27 +00:00
bne L9519
ldx L953A
L950E: lda L953A,x
2018-01-16 04:33:32 +00:00
sta LDFC5,x
2017-10-12 15:04:27 +00:00
dex
bpl L950E
bmi L951F
2018-02-06 04:37:41 +00:00
L9519: lda get_file_info_params5::file_type
2017-10-12 15:04:27 +00:00
jsr L402D
2018-02-06 17:31:58 +00:00
L951F: copy16 #LDFC5, L92E4
2018-02-15 05:07:31 +00:00
jsr launch_get_info_dialog
2017-10-12 15:04:27 +00:00
bne L9534
L952E: inc L92E6
jmp L92F5
L9534: lda #$00
2018-02-15 16:08:59 +00:00
sta path_buf4
2017-10-12 15:04:27 +00:00
rts
2017-12-31 03:21:34 +00:00
L953A: PASCAL_STRING " VOL"
2018-01-21 22:35:37 +00:00
2018-02-15 05:07:31 +00:00
.proc launch_get_info_dialog
yax_call launch_dialog, index_get_info_dialog, L92E3
2017-10-12 15:04:27 +00:00
rts
2018-02-15 05:07:31 +00:00
.endproc
2017-10-12 15:04:27 +00:00
L9549: ldx #$00
2018-03-05 05:33:56 +00:00
L954B: lda text_buffer2::data,x
2017-10-12 15:04:27 +00:00
cmp #$20
bne L9555
inx
bne L954B
L9555: ldy #$00
dex
2018-03-05 05:33:56 +00:00
L9558: lda text_buffer2::data,x
sta text_buffer2::data,y
2017-10-12 15:04:27 +00:00
iny
inx
2018-01-12 18:01:28 +00:00
cpx text_buffer2::length
2017-10-12 15:04:27 +00:00
bne L9558
2018-01-12 18:01:28 +00:00
sty text_buffer2::length
2017-10-12 15:04:27 +00:00
rts
2018-02-18 07:04:52 +00:00
.endproc
L92F5 := L92E7::L92F5
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-18 08:01:08 +00:00
.proc L9571_impl
2018-02-26 05:03:58 +00:00
DEFINE_RENAME_PARAMS rename_params, $220, $1FC0
2018-01-18 01:49:27 +00:00
rename_dialog_params:
2017-12-31 20:32:47 +00:00
.byte 0
.addr $1F00
2018-02-03 05:11:49 +00:00
2018-02-18 08:01:08 +00:00
start:
lda #$00
2017-10-12 15:04:27 +00:00
sta L9706
L9576: lda L9706
2018-02-19 19:33:13 +00:00
cmp selected_icon_count
2017-10-12 15:04:27 +00:00
bne L9581
2018-02-16 03:29:05 +00:00
return #0
2017-10-12 15:04:27 +00:00
L9581: ldx L9706
2018-02-19 19:33:13 +00:00
lda selected_icon_list,x
2017-10-12 15:04:27 +00:00
cmp #$01
bne L9591
inc L9706
jmp L9576
L9591: lda selected_window_index
2017-10-12 15:04:27 +00:00
beq L95C2
asl a
tax
2018-02-06 17:31:58 +00:00
copy16 window_address_table,x, $08
2017-10-12 15:04:27 +00:00
ldx L9706
2018-02-19 19:33:13 +00:00
lda selected_icon_list,x
2018-02-13 16:18:11 +00:00
jsr icon_entry_name_lookup
jsr join_paths
2017-10-12 15:04:27 +00:00
ldy #$00
2018-02-15 16:08:59 +00:00
L95B0: lda path_buf3,y
2018-01-17 15:41:23 +00:00
sta $220,y
2017-10-12 15:04:27 +00:00
iny
2018-01-17 15:41:23 +00:00
cpy $220
2017-10-12 15:04:27 +00:00
bne L95B0
2018-01-17 15:41:23 +00:00
dec $220
2017-10-12 15:04:27 +00:00
jmp L95E0
L95C2: ldx L9706
2018-02-19 19:33:13 +00:00
lda selected_icon_list,x
2018-02-13 16:18:11 +00:00
jsr icon_entry_name_lookup
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-17 15:41:23 +00:00
L95CD: lda ($06),y
sta $220,y
2017-10-12 15:04:27 +00:00
iny
2018-01-17 15:41:23 +00:00
cpy $220
2017-10-12 15:04:27 +00:00
bne L95CD
2018-01-17 15:41:23 +00:00
dec $220
2018-01-24 04:11:38 +00:00
lda #'/'
2017-10-12 15:04:27 +00:00
sta $0221
L95E0: ldx L9706
2018-02-19 19:33:13 +00:00
lda selected_icon_list,x
2018-02-13 16:18:11 +00:00
jsr icon_entry_name_lookup
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tay
2018-01-17 15:41:23 +00:00
L95EE: lda ($06),y
2017-10-12 15:04:27 +00:00
sta $1F12,y
dey
bpl L95EE
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tay
dey
sec
sbc #$02
sta $1F00
2018-01-17 15:41:23 +00:00
L9602: lda ($06),y
2017-10-12 15:04:27 +00:00
sta $1EFF,y
dey
cpy #$01
bne L9602
lda #$00
jsr L96F8
L9611: lda #$80
jsr L96F8
beq L962F
L9618: ldx L9706
2018-02-19 19:33:13 +00:00
lda selected_icon_list,x
2018-02-13 16:18:11 +00:00
jsr icon_entry_name_lookup
2017-10-12 15:04:27 +00:00
ldy $1F12
L9624: lda $1F12,y
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
dey
bpl L9624
2018-02-16 03:29:05 +00:00
return #$FF
2017-10-12 15:04:27 +00:00
L962F: sty $08
sty L9707
2018-01-21 19:47:40 +00:00
stx $08+1
2017-10-12 15:04:27 +00:00
stx L9708
lda selected_window_index
2017-10-12 15:04:27 +00:00
beq L964D
asl a
tax
2018-02-06 17:31:58 +00:00
copy16 window_address_table,x, $06
2017-10-12 15:04:27 +00:00
jmp L9655
2018-02-06 23:36:39 +00:00
L964D: copy16 #L9705, $06
2017-10-12 15:04:27 +00:00
L9655: ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tay
2018-01-17 15:41:23 +00:00
L965A: lda ($06),y
2017-10-12 15:04:27 +00:00
sta $1FC0,y
dey
bpl L965A
inc $1FC0
ldx $1FC0
2018-01-24 04:11:38 +00:00
lda #'/'
2017-10-12 15:04:27 +00:00
sta $1FC0,x
ldy #$00
lda ($08),y
sta L9709
L9674: inx
iny
lda ($08),y
sta $1FC0,x
cpy L9709
bne L9674
stx $1FC0
2018-01-23 02:09:15 +00:00
yax_call JT_MLI_RELAY, RENAME, rename_params
2017-10-12 15:04:27 +00:00
beq L969E
2018-01-20 22:31:48 +00:00
jsr JT_SHOW_ALERT0
2017-10-12 15:04:27 +00:00
bne L9696
jmp L9611
L9696: lda #$40
jsr L96F8
jmp L9618
L969E: lda #$40
jsr L96F8
ldx L9706
2018-02-19 19:33:13 +00:00
lda selected_icon_list,x
2018-02-05 03:13:21 +00:00
sta LE22B
yax_call JT_DESKTOP_RELAY, $E, LE22B
2018-02-06 17:31:58 +00:00
copy16 L9707, $08
2017-10-12 15:04:27 +00:00
ldx L9706
2018-02-19 19:33:13 +00:00
lda selected_icon_list,x
2018-02-13 16:18:11 +00:00
jsr icon_entry_name_lookup
2017-10-12 15:04:27 +00:00
ldy #$00
lda ($08),y
clc
adc #$02
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
lda ($08),y
tay
2018-02-26 00:06:17 +00:00
inc16 $06
2017-10-12 15:04:27 +00:00
L96DA: lda ($08),y
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
dey
bne L96DA
2018-01-17 15:41:23 +00:00
dec $06
lda $06
2017-10-12 15:04:27 +00:00
cmp #$FF
bne L96EB
2018-01-17 15:41:23 +00:00
dec $06+1
L96EB: lda ($06),y
2017-10-12 15:04:27 +00:00
tay
2018-01-24 04:11:38 +00:00
lda #' '
2018-01-17 15:41:23 +00:00
sta ($06),y
2017-10-12 15:04:27 +00:00
inc L9706
jmp L9576
L96F8: sta rename_dialog_params
yax_call launch_dialog, index_rename_dialog, rename_dialog_params
2017-10-12 15:04:27 +00:00
rts
2018-02-06 23:36:39 +00:00
L9705: .byte $00
2017-12-31 02:02:15 +00:00
L9706: .byte $00
L9707: .byte $00
L9708: .byte $00
2018-01-17 14:59:34 +00:00
L9709: .byte $00
2018-02-18 08:01:08 +00:00
.endproc
L9571 := L9571_impl::start
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-18 01:35:35 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_OPEN_PARAMS open_params3, $220, $800
DEFINE_READ_PARAMS read_params3, L9718, 4
2018-02-06 04:37:41 +00:00
2018-01-18 01:49:27 +00:00
L9718: .res 4, 0
2018-01-18 01:35:35 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_CLOSE_PARAMS close_params6
DEFINE_READ_PARAMS read_params4, L97AD, $27
DEFINE_READ_PARAMS read_params5, L972E, 5
2018-02-06 04:37:41 +00:00
2018-01-18 01:49:27 +00:00
L972E: .res 5, 0
.res 4, 0
2018-01-17 14:59:34 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_CLOSE_PARAMS close_params5
DEFINE_CLOSE_PARAMS close_params3
DEFINE_DESTROY_PARAMS destroy_params, $220
DEFINE_OPEN_PARAMS open_params4, $220, $0D00
DEFINE_OPEN_PARAMS open_params5, $1FC0, $1100
DEFINE_READ_PARAMS read_params6, $1500, $AC0
DEFINE_WRITE_PARAMS write_params, $1500, $AC0
2018-03-06 05:27:41 +00:00
DEFINE_CREATE_PARAMS create_params3, $1FC0, ACCESS_DEFAULT
2018-02-26 05:03:58 +00:00
DEFINE_CREATE_PARAMS create_params2, $1FC0
2018-01-18 01:49:27 +00:00
.byte $00,$00
2018-02-26 05:03:58 +00:00
DEFINE_GET_FILE_INFO_PARAMS file_info_params2, $220
2018-01-18 01:54:54 +00:00
.byte 0
2018-01-17 14:59:34 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_GET_FILE_INFO_PARAMS file_info_params3, $1FC0
2018-01-18 01:35:35 +00:00
.byte 0
2018-01-17 14:59:34 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_SET_EOF_PARAMS set_eof_params, 0
DEFINE_SET_MARK_PARAMS mark_params, 0
DEFINE_SET_MARK_PARAMS mark_params2, 0
DEFINE_ON_LINE_PARAMS on_line_params2,, $800
2018-01-18 02:07:22 +00:00
2018-02-18 08:01:08 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-18 08:01:08 +00:00
L97AD: .res 16, 0
L97BD: .res 32, 0
2018-01-21 22:35:37 +00:00
L97DD: .addr L9B36
L97DF: .addr L9B33
L97E1: .addr rts2
rts2: rts
2017-12-31 02:02:15 +00:00
L97E4: .byte $00
2018-02-18 08:01:08 +00:00
2018-03-05 05:33:56 +00:00
L97E5: ldx LE10C
2018-02-06 23:36:39 +00:00
lda LE061
sta LE062,x
2017-10-12 15:04:27 +00:00
inx
2018-03-05 05:33:56 +00:00
stx LE10C
2017-10-12 15:04:27 +00:00
rts
2018-03-05 05:33:56 +00:00
L97F3: ldx LE10C
2017-10-12 15:04:27 +00:00
dex
2018-02-06 23:36:39 +00:00
lda LE062,x
sta LE061
2018-03-05 05:33:56 +00:00
stx LE10C
2017-10-12 15:04:27 +00:00
rts
2018-02-18 08:01:08 +00:00
.proc L9801
lda #$00
2018-02-06 23:36:39 +00:00
sta LE05F
2018-03-05 05:33:56 +00:00
sta LE10D
2018-01-23 02:09:15 +00:00
L9809: yax_call JT_MLI_RELAY, OPEN, open_params3
2017-10-12 15:04:27 +00:00
beq L981E
ldx #$80
2018-01-20 22:31:48 +00:00
jsr JT_SHOW_ALERT
2017-10-12 15:04:27 +00:00
beq L9809
jmp LA39F
2018-01-18 01:35:35 +00:00
L981E: lda open_params3::ref_num
2018-02-06 23:36:39 +00:00
sta LE060
2018-01-18 01:49:27 +00:00
sta read_params3::ref_num
2018-01-23 02:09:15 +00:00
L9827: yax_call JT_MLI_RELAY, READ, read_params3
2017-10-12 15:04:27 +00:00
beq L983C
ldx #$80
2018-01-20 22:31:48 +00:00
jsr JT_SHOW_ALERT
2017-10-12 15:04:27 +00:00
beq L9827
jmp LA39F
L983C: jmp L985B
2018-02-18 08:01:08 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-02-18 08:01:08 +00:00
.proc L983F
lda LE060
2018-01-18 01:35:35 +00:00
sta close_params6::ref_num
2018-01-23 02:09:15 +00:00
L9845: yax_call JT_MLI_RELAY, CLOSE, close_params6
2017-10-12 15:04:27 +00:00
beq L985A
ldx #$80
2018-01-20 22:31:48 +00:00
jsr JT_SHOW_ALERT
2017-10-12 15:04:27 +00:00
beq L9845
jmp LA39F
L985A: rts
2018-02-18 08:01:08 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-02-18 08:01:08 +00:00
.proc L985B
inc LE05F
2018-02-06 23:36:39 +00:00
lda LE060
2018-01-18 01:49:27 +00:00
sta read_params4::ref_num
2018-01-23 02:09:15 +00:00
L9864: yax_call JT_MLI_RELAY, READ, read_params4
2017-10-12 15:04:27 +00:00
beq L987D
cmp #$4C
beq L989F
ldx #$80
2018-01-20 22:31:48 +00:00
jsr JT_SHOW_ALERT
2017-10-12 15:04:27 +00:00
beq L9864
jmp LA39F
2018-03-05 05:33:56 +00:00
L987D: inc LE10D
lda LE10D
2018-02-06 23:36:39 +00:00
cmp LE05E
2017-10-12 15:04:27 +00:00
bcc L989C
lda #$00
2018-03-05 05:33:56 +00:00
sta LE10D
2018-02-06 23:36:39 +00:00
lda LE060
2018-01-18 01:49:27 +00:00
sta read_params5::ref_num
2018-01-23 02:09:15 +00:00
yax_call JT_MLI_RELAY, READ, read_params5
2018-02-16 03:29:05 +00:00
L989C: return #0
2017-10-12 15:04:27 +00:00
2018-02-16 03:29:05 +00:00
L989F: return #$FF
2018-02-18 08:01:08 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-06 23:36:39 +00:00
L98A2: lda LE05F
sta LE061
2017-10-12 15:04:27 +00:00
jsr L983F
jsr L97E5
2018-02-15 05:07:31 +00:00
jsr append_to_path_220
2017-10-12 15:04:27 +00:00
jmp L9801
2018-02-19 01:08:11 +00:00
.proc L98B4
jsr L983F
2017-10-12 15:04:27 +00:00
jsr L992A
2018-02-15 05:07:31 +00:00
jsr remove_path_segment_220
2017-10-12 15:04:27 +00:00
jsr L97F3
jsr L9801
2018-02-19 01:08:11 +00:00
jsr sub
2017-10-12 15:04:27 +00:00
jmp L9927
2018-02-19 01:08:11 +00:00
sub: lda LE05F
2018-02-06 23:36:39 +00:00
cmp LE061
2018-02-19 01:08:11 +00:00
beq done
2017-10-12 15:04:27 +00:00
jsr L985B
2018-02-19 01:08:11 +00:00
jmp sub
done: rts
.endproc
2017-10-12 15:04:27 +00:00
2018-02-19 01:08:11 +00:00
.proc L98D8
lda #$00
2018-02-06 23:36:39 +00:00
sta LE05D
2017-10-12 15:04:27 +00:00
jsr L9801
L98E0: jsr L985B
bne L9912
lda L97AD
beq L98E0
lda L97AD
sta L992D
and #$0F
sta L97AD
lda #$00
sta L9923
jsr L9924
lda L9923
bne L98E0
lda L97BD
cmp #$0F
bne L98E0
jsr L98A2
2018-02-06 23:36:39 +00:00
inc LE05D
2017-10-12 15:04:27 +00:00
jmp L98E0
2018-02-06 23:36:39 +00:00
L9912: lda LE05D
2017-10-12 15:04:27 +00:00
beq L9920
jsr L98B4
2018-02-06 23:36:39 +00:00
dec LE05D
2017-10-12 15:04:27 +00:00
jmp L98E0
L9920: jmp L983F
2018-02-19 01:08:11 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2017-12-31 20:32:47 +00:00
L9923: .byte 0
2017-10-12 15:04:27 +00:00
L9924: jmp (L97DD)
L9927: jmp (L97DF)
L992A: jmp (L97E1)
2017-12-31 02:02:15 +00:00
L992D: .byte $00,$00,$00,$00
2018-02-19 05:37:15 +00:00
L9931: .addr L9B36 ; Overlay for L97DD
2018-01-21 22:35:37 +00:00
.addr L9B33
.addr rts2
2018-01-24 05:52:53 +00:00
L9937: .byte 0
2018-01-21 22:35:37 +00:00
L9938: .addr 0
.addr $220
.addr $1FC0
2018-02-19 01:08:11 +00:00
.proc L993E
2018-02-19 05:37:15 +00:00
lda #0
2017-10-12 15:04:27 +00:00
sta L9937
2018-02-06 17:31:58 +00:00
copy16 #L995A, L917D
copy16 #L997C, L9180
2017-10-12 15:04:27 +00:00
jmp L9BBF
2018-02-05 04:35:19 +00:00
L995A: stax L9938
2018-02-19 05:37:15 +00:00
lda #1
2017-10-12 15:04:27 +00:00
sta L9937
jmp L9BBF
2018-02-19 01:08:11 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-02-19 05:37:15 +00:00
L9968: ldy #5
2017-10-12 15:04:27 +00:00
L996A: lda L9931,y
sta L97DD,y
dey
bpl L996A
lda #$00
sta LA425
sta L918D
rts
2018-02-19 05:37:15 +00:00
L997C: lda #5
2017-10-12 15:04:27 +00:00
sta L9937
jmp L9BBF
2018-02-19 05:37:15 +00:00
L9984: lda #0
2017-10-12 15:04:27 +00:00
sta L9937
2018-02-06 23:36:39 +00:00
copy16 #L99A7, L917D
copy16 #L99DC, L9180
2018-01-24 23:39:12 +00:00
yax_call launch_dialog, index_download_dialog, L9937
2017-10-12 15:04:27 +00:00
rts
2018-02-06 23:36:39 +00:00
L99A7: stax L9938
2018-02-19 01:08:11 +00:00
lda #1
2017-10-12 15:04:27 +00:00
sta L9937
2018-01-24 23:39:12 +00:00
yax_call launch_dialog, index_download_dialog, L9937
2017-10-12 15:04:27 +00:00
rts
L99BC: lda #$80
sta L918D
2018-02-19 01:08:11 +00:00
ldy #5
2017-10-12 15:04:27 +00:00
L99C3: lda L9931,y
sta L97DD,y
dey
bpl L99C3
2018-02-19 01:08:11 +00:00
lda #0
2017-10-12 15:04:27 +00:00
sta LA425
2018-02-06 23:36:39 +00:00
copy16 #L99EB, L9186
2017-10-12 15:04:27 +00:00
rts
2018-02-19 05:37:15 +00:00
L99DC: lda #3
2017-10-12 15:04:27 +00:00
sta L9937
2018-01-24 23:39:12 +00:00
yax_call launch_dialog, index_download_dialog, L9937
2017-10-12 15:04:27 +00:00
rts
2018-02-19 05:37:15 +00:00
L99EB: lda #4
2017-10-12 15:04:27 +00:00
sta L9937
2018-01-24 23:39:12 +00:00
yax_call launch_dialog, index_download_dialog, L9937
2018-02-19 05:37:15 +00:00
cmp #2
2017-10-12 15:04:27 +00:00
bne L99FE
rts
L99FE: jmp LA39F
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-19 01:08:11 +00:00
.proc L9A01
2018-02-24 05:12:41 +00:00
copy16 #$0080, LE05B
2017-10-12 15:04:27 +00:00
beq L9A0F
L9A0D: lda #$FF
L9A0F: sta L9B31
2018-02-19 05:37:15 +00:00
lda #2
2017-10-12 15:04:27 +00:00
sta L9937
jsr LA379
bit L9189
bvc L9A22
jsr L9BC9
2018-02-06 23:36:39 +00:00
L9A22: bit LE05B
2017-10-12 15:04:27 +00:00
bpl L9A70
bvs L9A50
lda L9B31
bne L9A36
lda selected_window_index
2017-10-12 15:04:27 +00:00
bne L9A36
jmp L9B28
L9A36: ldx $1FC0
ldy L9B32
dey
L9A3D: iny
inx
2018-01-17 15:41:23 +00:00
lda $220,y
2017-10-12 15:04:27 +00:00
sta $1FC0,x
2018-01-17 15:41:23 +00:00
cpy $220
2017-10-12 15:04:27 +00:00
bne L9A3D
stx $1FC0
jmp L9A70
L9A50: ldx $1FC0
2018-01-24 04:11:38 +00:00
lda #'/'
2017-10-12 15:04:27 +00:00
sta $1FC1,x
inc $1FC0
ldy #$00
ldx $1FC0
L9A60: iny
inx
2018-02-06 23:36:39 +00:00
lda LE04B,y
2017-10-12 15:04:27 +00:00
sta $1FC0,x
2018-02-06 23:36:39 +00:00
cpy LE04B
2017-10-12 15:04:27 +00:00
bne L9A60
stx $1FC0
2018-01-23 02:09:15 +00:00
L9A70: yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params2
2017-10-12 15:04:27 +00:00
beq L9A81
2018-02-13 05:14:23 +00:00
jsr show_error_alert
2017-10-12 15:04:27 +00:00
jmp L9A70
2018-02-06 04:37:41 +00:00
L9A81: lda file_info_params2::storage_type
2018-01-20 03:41:20 +00:00
cmp #ST_VOLUME_DIRECTORY
2017-10-12 15:04:27 +00:00
beq L9A90
2018-01-20 03:41:20 +00:00
cmp #ST_LINKED_DIRECTORY
2017-10-12 15:04:27 +00:00
beq L9A90
lda #$00
beq L9A95
2018-02-15 05:07:31 +00:00
L9A90: jsr decrement_LA2ED
2017-10-12 15:04:27 +00:00
lda #$FF
L9A95: sta L9B30
jsr LA40A
2018-02-15 05:07:31 +00:00
lda LA2ED+1
2017-10-12 15:04:27 +00:00
bne L9AA8
lda LA2ED
bne L9AA8
jmp LA39F
L9AA8: ldy #$07
2018-01-17 14:59:34 +00:00
L9AAA: lda file_info_params2,y
2018-01-18 01:49:27 +00:00
sta create_params2,y
2017-10-12 15:04:27 +00:00
dey
cpy #$02
bne L9AAA
2018-03-06 05:27:41 +00:00
lda #ACCESS_DEFAULT
2018-01-18 01:49:27 +00:00
sta create_params2::access
2018-02-06 23:36:39 +00:00
lda LE05B
2017-10-12 15:04:27 +00:00
beq L9B23
jsr L9C01
bcs L9B2C
ldy #$11
ldx #$0B
2018-01-17 14:59:34 +00:00
L9AC8: lda file_info_params2,y
2018-01-18 01:49:27 +00:00
sta create_params2,x
2017-10-12 15:04:27 +00:00
dex
dey
cpy #$0D
bne L9AC8
2018-02-06 04:37:41 +00:00
lda create_params2::storage_type
2018-01-20 03:41:20 +00:00
cmp #ST_VOLUME_DIRECTORY
2017-10-12 15:04:27 +00:00
bne L9AE0
2018-01-20 03:41:20 +00:00
lda #ST_LINKED_DIRECTORY
2018-02-06 04:37:41 +00:00
sta create_params2::storage_type
2018-01-23 02:09:15 +00:00
L9AE0: yax_call JT_MLI_RELAY, CREATE, create_params2
2017-10-12 15:04:27 +00:00
beq L9B23
cmp #$47
bne L9B1D
bit L918D
bmi L9B14
2018-02-19 05:37:15 +00:00
lda #3
2017-10-12 15:04:27 +00:00
sta L9937
jsr L9BBF
pha
2018-02-19 05:37:15 +00:00
lda #2
2017-10-12 15:04:27 +00:00
sta L9937
pla
cmp #$02
beq L9B14
cmp #$03
beq L9B2C
cmp #$04
bne L9B1A
lda #$80
sta L918D
L9B14: jsr LA426
jmp L9B23
L9B1A: jmp LA39F
2018-02-13 05:14:23 +00:00
L9B1D: jsr show_error_alert
2017-10-12 15:04:27 +00:00
jmp L9AE0
L9B23: lda L9B30
beq L9B2D
L9B28: jmp L98D8
2017-12-31 20:32:47 +00:00
.byte 0
2017-10-12 15:04:27 +00:00
L9B2C: rts
L9B2D: jmp L9CDA
2017-12-31 20:32:47 +00:00
L9B30: .byte 0
L9B31: .byte 0
2018-02-19 01:08:11 +00:00
.endproc
L9A0D := L9A01::L9A0D
2017-12-31 20:32:47 +00:00
L9B32: .byte 0
2018-02-19 01:08:11 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-19 01:08:11 +00:00
2018-01-21 22:35:37 +00:00
L9B33: jmp LA360
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-19 01:08:11 +00:00
.proc L9B36
jsr check_escape_key_down
2018-02-16 03:12:59 +00:00
beq :+
2017-10-12 15:04:27 +00:00
jmp LA39F
2018-02-16 03:12:59 +00:00
: lda L97BD
2017-10-12 15:04:27 +00:00
cmp #$0F
bne L9B88
2018-02-15 05:07:31 +00:00
jsr append_to_path_220
2018-02-19 01:08:11 +00:00
: yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params2
2017-10-12 15:04:27 +00:00
beq L9B59
2018-02-13 05:14:23 +00:00
jsr show_error_alert
2018-02-19 01:08:11 +00:00
jmp :-
2017-10-12 15:04:27 +00:00
L9B59: jsr LA33B
jsr LA40A
2018-02-15 05:07:31 +00:00
jsr decrement_LA2ED
lda LA2ED+1
2017-10-12 15:04:27 +00:00
bne L9B6F
lda LA2ED
bne L9B6F
jmp LA39F
L9B6F: jsr L9E19
bcs L9B7A
2018-02-15 05:07:31 +00:00
jsr remove_path_segment_220
2017-10-12 15:04:27 +00:00
jmp L9BBE
L9B7A: jsr LA360
2018-02-15 05:07:31 +00:00
jsr remove_path_segment_220
2017-10-12 15:04:27 +00:00
lda #$FF
sta L9923
jmp L9BBE
L9B88: jsr LA33B
2018-02-15 05:07:31 +00:00
jsr append_to_path_220
2017-10-12 15:04:27 +00:00
jsr LA40A
2018-01-23 02:09:15 +00:00
L9B91: yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params2
2017-10-12 15:04:27 +00:00
beq L9BA2
2018-02-13 05:14:23 +00:00
jsr show_error_alert
2017-10-12 15:04:27 +00:00
jmp L9B91
L9BA2: jsr L9C01
bcc L9BAA
jmp LA39F
2018-02-15 05:07:31 +00:00
L9BAA: jsr remove_path_segment_220
2017-10-12 15:04:27 +00:00
jsr L9E19
bcs L9BBB
2018-02-15 05:07:31 +00:00
jsr append_to_path_220
2017-10-12 15:04:27 +00:00
jsr L9CDA
2018-02-15 05:07:31 +00:00
jsr remove_path_segment_220
2017-10-12 15:04:27 +00:00
L9BBB: jsr LA360
L9BBE: rts
2018-02-19 01:08:11 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-01-23 02:09:15 +00:00
L9BBF: yax_call launch_dialog, index_copy_file_dialog, L9937
2017-10-12 15:04:27 +00:00
rts
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-19 01:08:11 +00:00
.proc L9BC9
yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params3
2017-10-12 15:04:27 +00:00
beq L9BDA
2018-02-13 05:14:23 +00:00
jsr show_error_alert_dst
2017-10-12 15:04:27 +00:00
jmp L9BC9
2018-02-06 18:06:44 +00:00
L9BDA: sub16 file_info_params3::aux_type, file_info_params3::blocks_used, L9BFF
cmp16 L9BFF, LA2EF
2017-10-12 15:04:27 +00:00
bcs L9BFE
jmp L9185
L9BFE: rts
2018-02-06 18:10:34 +00:00
L9BFF: .word 0
2018-02-19 01:08:11 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-06 18:10:34 +00:00
2017-10-12 15:04:27 +00:00
L9C01: jsr L9C1A
bcc L9C19
2018-02-19 05:37:15 +00:00
lda #4
2017-10-12 15:04:27 +00:00
sta L9937
jsr L9BBF
beq L9C13
jmp LA39F
2018-02-19 05:37:15 +00:00
L9C13: lda #3
2017-10-12 15:04:27 +00:00
sta L9937
sec
L9C19: rts
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-19 01:08:11 +00:00
.proc L9C1A
yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params2
2017-10-12 15:04:27 +00:00
beq L9C2B
2018-02-13 05:14:23 +00:00
jsr show_error_alert
2017-10-12 15:04:27 +00:00
jmp L9C1A
L9C2B: lda #$00
sta L9CD8
sta L9CD9
2018-01-23 02:09:15 +00:00
L9C33: yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params3
2017-10-12 15:04:27 +00:00
beq L9C48
cmp #$46
beq L9C54
2018-02-13 05:14:23 +00:00
jsr show_error_alert_dst
2017-10-12 15:04:27 +00:00
jmp L9C33
2018-02-06 17:31:58 +00:00
L9C48: copy16 file_info_params3::blocks_used, L9CD8
2017-10-12 15:04:27 +00:00
L9C54: lda $1FC0
sta L9CD6
ldy #$01
L9C5C: iny
cpy $1FC0
bcs L9CCC
lda $1FC0,y
cmp #$2F
bne L9C5C
tya
sta $1FC0
sta L9CD7
2018-01-23 02:09:15 +00:00
L9C70: yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params3
2017-10-12 15:04:27 +00:00
beq L9C95
pha
lda L9CD6
sta $1FC0
pla
2018-02-13 05:14:23 +00:00
jsr show_error_alert_dst
2017-10-12 15:04:27 +00:00
jmp L9C70
lda L9CD7
sta $1FC0
jmp L9C70
jmp LA39F
2018-02-06 18:06:44 +00:00
L9C95: sub16 file_info_params3::aux_type, file_info_params3::blocks_used, L9CD4
add16 L9CD4, L9CD8, L9CD4
cmp16 L9CD4, file_info_params2::blocks_used
2017-10-12 15:04:27 +00:00
bcs L9CCC
sec
bcs L9CCD
L9CCC: clc
L9CCD: lda L9CD6
sta $1FC0
rts
2018-02-06 18:10:34 +00:00
L9CD4: .word 0
2017-12-31 20:32:47 +00:00
L9CD6: .byte 0
L9CD7: .byte 0
L9CD8: .byte 0
L9CD9: .byte 0
2018-02-19 01:08:11 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-19 01:08:11 +00:00
2018-02-19 05:37:15 +00:00
.proc L9CDA
jsr decrement_LA2ED
2017-10-12 15:04:27 +00:00
lda #$00
sta L9E17
sta L9E18
2018-01-18 01:35:35 +00:00
sta mark_params::position
sta mark_params::position+1
sta mark_params::position+2
2018-01-18 02:07:22 +00:00
sta mark_params2::position
sta mark_params2::position+1
sta mark_params2::position+2
2017-10-12 15:04:27 +00:00
jsr L9D62
jsr L9D74
jsr L9D81
beq L9D09
lda #$FF
sta L9E17
bne L9D0C
L9D09: jsr L9D9C
L9D0C: jsr L9DA9
bit L9E17
bpl L9D28
jsr L9E0D
L9D17: jsr L9D81
bne L9D17
jsr L9D9C
2018-01-23 02:09:15 +00:00
yax_call JT_MLI_RELAY, SET_MARK, mark_params2
2017-10-12 15:04:27 +00:00
L9D28: bit L9E18
bmi L9D51
jsr L9DE8
bit L9E17
bpl L9D0C
jsr L9E03
jsr L9D62
jsr L9D74
2018-01-23 02:09:15 +00:00
yax_call JT_MLI_RELAY, SET_MARK, mark_params
2017-10-12 15:04:27 +00:00
beq L9D0C
lda #$FF
sta L9E18
jmp L9D0C
L9D51: jsr L9E03
bit L9E17
bmi L9D5C
jsr L9E0D
L9D5C: jsr LA46D
jmp LA479
2018-01-23 02:09:15 +00:00
L9D62: yax_call JT_MLI_RELAY, OPEN, open_params4
2017-10-12 15:04:27 +00:00
beq L9D73
2018-02-13 05:14:23 +00:00
jsr show_error_alert
2017-10-12 15:04:27 +00:00
jmp L9D62
L9D73: rts
2018-01-18 01:49:27 +00:00
L9D74: lda open_params4::ref_num
2018-01-18 02:07:22 +00:00
sta read_params6::ref_num
sta close_params5::ref_num
2018-01-18 01:35:35 +00:00
sta mark_params::ref_num
2017-10-12 15:04:27 +00:00
rts
2018-01-23 02:09:15 +00:00
L9D81: yax_call JT_MLI_RELAY, OPEN, open_params5
2017-10-12 15:04:27 +00:00
beq L9D9B
cmp #$45
beq L9D96
2018-02-13 05:14:23 +00:00
jsr show_error_alert_dst
2017-10-12 15:04:27 +00:00
jmp L9D81
2018-02-13 05:14:23 +00:00
L9D96: jsr show_error_alert_dst
2017-10-12 15:04:27 +00:00
lda #$45
L9D9B: rts
2018-01-18 02:07:22 +00:00
L9D9C: lda open_params5::ref_num
sta write_params::ref_num
2018-01-18 01:35:35 +00:00
sta close_params3::ref_num
2018-01-18 02:07:22 +00:00
sta mark_params2::ref_num
2017-10-12 15:04:27 +00:00
rts
2018-02-06 17:31:58 +00:00
L9DA9: copy16 #$0AC0, read_params6::request_count
2018-01-23 02:09:15 +00:00
L9DB3: yax_call JT_MLI_RELAY, READ, read_params6
2017-10-12 15:04:27 +00:00
beq L9DC8
cmp #$4C
beq L9DD9
2018-02-13 05:14:23 +00:00
jsr show_error_alert
2017-10-12 15:04:27 +00:00
jmp L9DB3
2018-02-06 17:31:58 +00:00
L9DC8: copy16 read_params6::trans_count, write_params::request_count
2018-02-06 04:37:41 +00:00
ora read_params6::trans_count
2017-10-12 15:04:27 +00:00
bne L9DDE
L9DD9: lda #$FF
sta L9E18
2018-01-23 02:09:15 +00:00
L9DDE: yax_call JT_MLI_RELAY, GET_MARK, mark_params
2017-10-12 15:04:27 +00:00
rts
2018-01-23 02:09:15 +00:00
L9DE8: yax_call JT_MLI_RELAY, WRITE, write_params
2017-10-12 15:04:27 +00:00
beq L9DF9
2018-02-13 05:14:23 +00:00
jsr show_error_alert_dst
2017-10-12 15:04:27 +00:00
jmp L9DE8
2018-01-23 02:09:15 +00:00
L9DF9: yax_call JT_MLI_RELAY, GET_MARK, mark_params2
2017-10-12 15:04:27 +00:00
rts
2018-01-23 02:09:15 +00:00
L9E03: yax_call JT_MLI_RELAY, CLOSE, close_params3
2017-10-12 15:04:27 +00:00
rts
2018-01-23 02:09:15 +00:00
L9E0D: yax_call JT_MLI_RELAY, CLOSE, close_params5
2017-10-12 15:04:27 +00:00
rts
2017-12-31 20:32:47 +00:00
L9E17: .byte 0
L9E18: .byte 0
2018-02-19 05:37:15 +00:00
.endproc
.proc L9E19
ldx #$07
2018-01-17 14:59:34 +00:00
L9E1B: lda file_info_params2,x
2018-01-18 02:07:22 +00:00
sta create_params3,x
2017-10-12 15:04:27 +00:00
dex
cpx #$03
bne L9E1B
2018-01-23 02:09:15 +00:00
L9E26: yax_call JT_MLI_RELAY, CREATE, create_params3
2017-10-12 15:04:27 +00:00
beq L9E6F
cmp #$47
bne L9E69
bit L918D
bmi L9E60
2018-02-19 05:37:15 +00:00
lda #3
2017-10-12 15:04:27 +00:00
sta L9937
2018-01-23 02:09:15 +00:00
yax_call launch_dialog, index_copy_file_dialog, L9937
2017-10-12 15:04:27 +00:00
pha
2018-02-19 05:37:15 +00:00
lda #2
2017-10-12 15:04:27 +00:00
sta L9937
pla
cmp #$02
beq L9E60
cmp #$03
beq L9E71
cmp #$04
bne L9E66
lda #$80
sta L918D
L9E60: jsr LA426
jmp L9E6F
L9E66: jmp LA39F
2018-02-13 05:14:23 +00:00
L9E69: jsr show_error_alert_dst
2017-10-12 15:04:27 +00:00
jmp L9E26
L9E6F: clc
rts
L9E71: sec
rts
2018-02-19 05:37:15 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-02-19 05:37:15 +00:00
L9E73: .addr L9F94 ; Overlay for L97DD
.addr rts2
.addr LA02E
2017-12-31 20:32:47 +00:00
L9E79: .byte 0
2018-02-05 04:46:26 +00:00
L9E7A: .word 0
2018-02-19 05:37:15 +00:00
.addr $220
2018-02-05 04:46:26 +00:00
2017-10-12 15:04:27 +00:00
L9E7E: sta L9E79
2018-02-06 23:36:39 +00:00
copy16 #L9EB1, L9183
copy16 #L9EA3, L917D
2017-10-12 15:04:27 +00:00
jsr LA044
2018-02-06 23:36:39 +00:00
copy16 #L9ED3, L9180
2017-10-12 15:04:27 +00:00
rts
2018-02-06 23:36:39 +00:00
L9EA3: stax L9E7A
2018-02-19 05:37:15 +00:00
lda #1
2017-10-12 15:04:27 +00:00
sta L9E79
jmp LA044
2018-02-06 23:36:39 +00:00
L9EB1: lda #$02
2017-10-12 15:04:27 +00:00
sta L9E79
jsr LA044
beq L9EBE
jmp LA39F
L9EBE: rts
2018-02-19 05:37:15 +00:00
L9EBF: ldy #5
2017-10-12 15:04:27 +00:00
L9EC1: lda L9E73,y
sta L97DD,y
dey
bpl L9EC1
lda #$00
sta LA425
sta L918D
rts
2018-02-06 23:36:39 +00:00
L9ED3: lda #$05
2017-10-12 15:04:27 +00:00
sta L9E79
jmp LA044
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-19 05:37:15 +00:00
.proc L9EDB
lda #$03
2017-10-12 15:04:27 +00:00
sta L9E79
jsr LA379
2018-01-23 02:09:15 +00:00
L9EE3: yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params2
2017-10-12 15:04:27 +00:00
beq L9EF4
2018-02-13 05:14:23 +00:00
jsr show_error_alert
2017-10-12 15:04:27 +00:00
jmp L9EE3
2018-02-06 04:37:41 +00:00
L9EF4: lda file_info_params2::storage_type
2017-10-12 15:04:27 +00:00
sta L9F1D
2018-01-20 03:41:20 +00:00
cmp #ST_LINKED_DIRECTORY
2017-10-12 15:04:27 +00:00
beq L9F02
lda #$00
beq L9F04
L9F02: lda #$FF
L9F04: sta L9F1C
beq L9F1E
jsr L98D8
lda L9F1D
cmp #$0D
bne L9F18
lda #$FF
sta L9F1D
L9F18: jmp L9F1E
rts
2017-12-31 20:32:47 +00:00
L9F1C: .byte 0
L9F1D: .byte 0
2018-02-19 05:37:15 +00:00
2018-02-06 23:36:39 +00:00
L9F1E: bit LE05C
2017-10-12 15:04:27 +00:00
bmi L9F26
jsr LA3EF
2018-02-15 05:07:31 +00:00
L9F26: jsr decrement_LA2ED
2018-01-23 02:09:15 +00:00
L9F29: yax_call JT_MLI_RELAY, DESTROY, destroy_params
2017-10-12 15:04:27 +00:00
beq L9F8D
cmp #$4E
bne L9F8E
bit L918D
bmi L9F62
lda #$04
sta L9E79
jsr LA044
pha
lda #$03
sta L9E79
pla
cmp #$03
beq L9F8D
cmp #$02
beq L9F62
cmp #$04
bne L9F5F
lda #$80
sta L918D
bne L9F62
L9F5F: jmp LA39F
2018-01-23 02:09:15 +00:00
L9F62: yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params2
2018-01-18 01:54:54 +00:00
lda file_info_params2::access
2017-10-12 15:04:27 +00:00
and #$80
bne L9F8D
2018-03-06 05:27:41 +00:00
lda #ACCESS_DEFAULT
2018-01-18 01:54:54 +00:00
sta file_info_params2::access
2018-01-17 14:59:34 +00:00
lda #7 ; param count for SET_FILE_INFO
sta file_info_params2
2018-01-23 02:09:15 +00:00
yax_call JT_MLI_RELAY, SET_FILE_INFO, file_info_params2
2018-01-17 14:59:34 +00:00
lda #$A ; param count for GET_FILE_INFO
sta file_info_params2
2017-10-12 15:04:27 +00:00
jmp L9F29
L9F8D: rts
2018-02-13 05:14:23 +00:00
L9F8E: jsr show_error_alert
2017-10-12 15:04:27 +00:00
jmp L9F29
2018-02-19 05:37:15 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-19 05:37:15 +00:00
.proc L9F94
2018-02-16 03:12:59 +00:00
jsr check_escape_key_down
beq :+
2017-10-12 15:04:27 +00:00
jmp LA39F
2018-02-16 03:12:59 +00:00
: jsr append_to_path_220
2018-02-06 23:36:39 +00:00
bit LE05C
2017-10-12 15:04:27 +00:00
bmi L9FA7
jsr LA3EF
2018-02-15 05:07:31 +00:00
L9FA7: jsr decrement_LA2ED
2018-01-23 02:09:15 +00:00
L9FAA: yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params2
2017-10-12 15:04:27 +00:00
beq L9FBB
2018-02-13 05:14:23 +00:00
jsr show_error_alert
2017-10-12 15:04:27 +00:00
jmp L9FAA
2018-02-06 04:37:41 +00:00
L9FBB: lda file_info_params2::storage_type
2018-01-20 03:41:20 +00:00
cmp #ST_LINKED_DIRECTORY
2017-10-12 15:04:27 +00:00
beq LA022
2018-01-23 02:09:15 +00:00
L9FC2: yax_call JT_MLI_RELAY, DESTROY, destroy_params
2017-10-12 15:04:27 +00:00
beq LA022
cmp #$4E
bne LA01C
bit L918D
bmi LA001
lda #$04
sta L9E79
2018-01-23 02:09:15 +00:00
yax_call launch_dialog, index_delete_file_dialog, L9E79
2017-10-12 15:04:27 +00:00
pha
lda #$03
sta L9E79
pla
cmp #$03
beq LA022
cmp #$02
2018-02-03 05:11:49 +00:00
beq LA001
2017-10-12 15:04:27 +00:00
cmp #$04
bne L9FFE
lda #$80
sta L918D
bne LA001
L9FFE: jmp LA39F
2018-03-06 05:27:41 +00:00
LA001: lda #ACCESS_DEFAULT
2018-01-18 01:54:54 +00:00
sta file_info_params2::access
2018-01-17 14:59:34 +00:00
lda #7 ; param count for SET_FILE_INFO
sta file_info_params2
2018-01-23 02:09:15 +00:00
yax_call JT_MLI_RELAY, SET_FILE_INFO, file_info_params2
2018-01-17 14:59:34 +00:00
lda #$A ; param count for GET_FILE_INFO
sta file_info_params2
2017-10-12 15:04:27 +00:00
jmp L9FC2
2018-02-13 05:14:23 +00:00
LA01C: jsr show_error_alert
2017-10-12 15:04:27 +00:00
jmp L9FC2
2018-02-15 05:07:31 +00:00
LA022: jmp remove_path_segment_220
2017-10-12 15:04:27 +00:00
2018-02-15 05:07:31 +00:00
jsr remove_path_segment_220
2017-10-12 15:04:27 +00:00
lda #$FF
sta L9923
rts
2018-02-19 05:37:15 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-01-23 02:09:15 +00:00
LA02E: yax_call JT_MLI_RELAY, DESTROY, destroy_params
2017-10-12 15:04:27 +00:00
beq LA043
cmp #$4E
beq LA043
2018-02-13 05:14:23 +00:00
jsr show_error_alert
2017-10-12 15:04:27 +00:00
jmp LA02E
LA043: rts
2018-01-23 02:09:15 +00:00
LA044: yax_call launch_dialog, index_delete_file_dialog, L9E79
2017-10-12 15:04:27 +00:00
rts
2018-01-21 22:35:37 +00:00
LA04E: .addr LA170
.addr rts2
.addr rts2
2017-12-31 20:32:47 +00:00
LA054: .byte 0
2018-02-05 04:46:26 +00:00
LA055: .word 0
2018-01-21 22:35:37 +00:00
.addr $220
2017-10-12 15:04:27 +00:00
LA059: lda #$00
sta LA054
bit L918B
bpl LA085
2018-02-06 23:36:39 +00:00
copy16 #LA0D1, L9183
copy16 #LA0B5, L917D
2017-10-12 15:04:27 +00:00
jsr LA10A
2018-02-06 23:36:39 +00:00
copy16 #LA0F8, L9180
2018-02-06 17:31:58 +00:00
rts
2018-02-06 23:36:39 +00:00
LA085: copy16 #LA0C3, L9183
copy16 #LA0A7, L917D
2017-10-12 15:04:27 +00:00
jsr LA100
2018-02-06 23:36:39 +00:00
copy16 #LA0F0, L9180
2017-10-12 15:04:27 +00:00
rts
2018-02-06 23:36:39 +00:00
LA0A7: stax LA055
2017-10-12 15:04:27 +00:00
lda #$01
sta LA054
jmp LA100
2018-02-06 23:36:39 +00:00
LA0B5: stax LA055
2017-10-12 15:04:27 +00:00
lda #$01
sta LA054
jmp LA10A
2018-02-06 23:36:39 +00:00
LA0C3: lda #$02
2017-10-12 15:04:27 +00:00
sta LA054
jsr LA100
beq LA0D0
jmp LA39F
LA0D0: rts
2018-02-06 23:36:39 +00:00
LA0D1: lda #$02
2017-10-12 15:04:27 +00:00
sta LA054
jsr LA10A
beq LA0DE
jmp LA39F
LA0DE: rts
LA0DF: lda #$00
sta LA425
ldy #$05
LA0E6: lda LA04E,y
sta L97DD,y
dey
bpl LA0E6
rts
2018-02-06 23:36:39 +00:00
LA0F0: lda #$04
2017-10-12 15:04:27 +00:00
sta LA054
jmp LA100
2018-02-06 23:36:39 +00:00
LA0F8: lda #$04
2017-10-12 15:04:27 +00:00
sta LA054
jmp LA10A
2018-01-23 02:09:15 +00:00
LA100: yax_call launch_dialog, index_lock_dialog, LA054
2017-10-12 15:04:27 +00:00
rts
2018-01-23 02:09:15 +00:00
LA10A: yax_call launch_dialog, index_unlock_dialog, LA054
2017-10-12 15:04:27 +00:00
rts
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-19 05:37:15 +00:00
.proc LA114
lda #$03
2017-10-12 15:04:27 +00:00
sta LA054
jsr LA379
ldx $1FC0
ldy L9B32
dey
LA123: iny
inx
2018-01-17 15:41:23 +00:00
lda $220,y
2017-10-12 15:04:27 +00:00
sta $1FC0,x
2018-01-17 15:41:23 +00:00
cpy $220
2017-10-12 15:04:27 +00:00
bne LA123
stx $1FC0
2018-01-23 02:09:15 +00:00
LA133: yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params2
2017-10-12 15:04:27 +00:00
beq LA144
2018-02-13 05:14:23 +00:00
jsr show_error_alert
2017-10-12 15:04:27 +00:00
jmp LA133
2018-02-06 04:37:41 +00:00
LA144: lda file_info_params2::storage_type
2017-10-12 15:04:27 +00:00
sta LA169
2018-01-20 03:41:20 +00:00
cmp #ST_VOLUME_DIRECTORY
2017-10-12 15:04:27 +00:00
beq LA156
2018-01-20 03:41:20 +00:00
cmp #ST_LINKED_DIRECTORY
2017-10-12 15:04:27 +00:00
beq LA156
lda #$00
beq LA158
LA156: lda #$FF
LA158: sta LA168
beq LA16A
jsr L98D8
lda LA169
cmp #$0F
bne LA16A
rts
2017-12-31 20:32:47 +00:00
LA168: .byte 0
LA169: .byte 0
2017-10-12 15:04:27 +00:00
LA16A: jsr LA173
2018-02-15 05:07:31 +00:00
jmp append_to_path_220
2018-02-19 05:37:15 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-02-15 05:07:31 +00:00
LA170: jsr append_to_path_220
2017-10-12 15:04:27 +00:00
LA173: jsr LA1C3
2018-02-15 05:07:31 +00:00
jsr decrement_LA2ED
2018-01-23 02:09:15 +00:00
LA179: yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params2
2017-10-12 15:04:27 +00:00
beq LA18A
2018-02-13 05:14:23 +00:00
jsr show_error_alert
2017-10-12 15:04:27 +00:00
jmp LA179
2018-02-06 04:37:41 +00:00
LA18A: lda file_info_params2::storage_type
2018-01-20 03:41:20 +00:00
cmp #ST_VOLUME_DIRECTORY
2017-10-12 15:04:27 +00:00
beq LA1C0
2018-01-20 03:41:20 +00:00
cmp #ST_LINKED_DIRECTORY
2017-10-12 15:04:27 +00:00
beq LA1C0
bit L918B
bpl LA19E
2018-03-06 05:27:41 +00:00
lda #ACCESS_DEFAULT
2017-10-12 15:04:27 +00:00
bne LA1A0
LA19E: lda #$21
2018-01-18 01:54:54 +00:00
LA1A0: sta file_info_params2::access
2018-01-17 14:59:34 +00:00
LA1A3: lda #7 ; param count for SET_FILE_INFO
sta file_info_params2
2018-01-23 02:09:15 +00:00
yax_call JT_MLI_RELAY, SET_FILE_INFO, file_info_params2
2017-10-12 15:04:27 +00:00
pha
2018-01-17 14:59:34 +00:00
lda #$A ; param count for GET_FILE_INFO
sta file_info_params2
2017-10-12 15:04:27 +00:00
pla
beq LA1C0
2018-02-13 05:14:23 +00:00
jsr show_error_alert
2017-10-12 15:04:27 +00:00
jmp LA1A3
2018-02-15 05:07:31 +00:00
LA1C0: jmp remove_path_segment_220
2017-10-12 15:04:27 +00:00
2018-02-16 03:12:59 +00:00
LA1C3: sub16 LA2ED, #1, LA055
2017-10-12 15:04:27 +00:00
bit L918B
bpl LA1DC
jmp LA10A
LA1DC: jmp LA100
2018-01-21 22:35:37 +00:00
LA1DF: .byte 0
.addr LA2ED, LA2EF
2018-01-13 03:06:55 +00:00
2017-10-12 15:04:27 +00:00
LA1E4: lda #$00
sta LA1DF
2018-02-06 23:36:39 +00:00
copy16 #LA220, L9183
copy16 #LA211, L917D
2018-01-23 02:09:15 +00:00
yax_call launch_dialog, index_get_size_dialog, LA1DF
2018-02-06 23:36:39 +00:00
copy16 #LA233, L9180
2017-10-12 15:04:27 +00:00
rts
2018-02-06 23:36:39 +00:00
LA211: lda #$01
2017-10-12 15:04:27 +00:00
sta LA1DF
2018-01-23 02:09:15 +00:00
yax_call launch_dialog, index_get_size_dialog, LA1DF
2017-10-12 15:04:27 +00:00
LA21F: rts
2018-02-06 23:36:39 +00:00
LA220: lda #$02
2017-10-12 15:04:27 +00:00
sta LA1DF
2018-01-23 02:09:15 +00:00
yax_call launch_dialog, index_get_size_dialog, LA1DF
2017-10-12 15:04:27 +00:00
beq LA21F
jmp LA39F
2018-02-06 23:36:39 +00:00
LA233: lda #$03
2017-10-12 15:04:27 +00:00
sta LA1DF
2018-01-23 02:09:15 +00:00
yax_call launch_dialog, index_get_size_dialog, LA1DF
2017-10-12 15:04:27 +00:00
LA241: rts
2018-01-21 22:35:37 +00:00
LA242: .addr LA2AE,rts2,rts2
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-19 05:37:15 +00:00
.proc LA248
lda #$00
2017-10-12 15:04:27 +00:00
sta LA425
2018-02-19 05:37:15 +00:00
ldy #5
2017-10-12 15:04:27 +00:00
LA24F: lda LA242,y
sta L97DD,y
dey
bpl LA24F
2018-02-15 05:07:31 +00:00
lda #0
2017-10-12 15:04:27 +00:00
sta LA2ED
2018-02-15 05:07:31 +00:00
sta LA2ED+1
2017-10-12 15:04:27 +00:00
sta LA2EF
2018-02-15 05:07:31 +00:00
sta LA2EF+1
2017-10-12 15:04:27 +00:00
ldy #$17
lda #$00
2018-01-15 04:55:54 +00:00
LA26A: sta BITMAP,y
2017-10-12 15:04:27 +00:00
dey
bpl LA26A
rts
2018-02-19 05:37:15 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-19 05:37:15 +00:00
.proc LA271
jsr LA379
2018-01-23 02:09:15 +00:00
LA274: yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params2
2017-10-12 15:04:27 +00:00
beq LA285
2018-02-13 05:14:23 +00:00
jsr show_error_alert
2017-10-12 15:04:27 +00:00
jmp LA274
2018-02-06 04:37:41 +00:00
LA285: lda file_info_params2::storage_type
2017-10-12 15:04:27 +00:00
sta LA2AA
2018-01-20 03:41:20 +00:00
cmp #ST_VOLUME_DIRECTORY
2017-10-12 15:04:27 +00:00
beq LA297
2018-01-20 03:41:20 +00:00
cmp #ST_LINKED_DIRECTORY
2017-10-12 15:04:27 +00:00
beq LA297
lda #$00
beq LA299
LA297: lda #$FF
LA299: sta LA2A9
beq LA2AB
jsr L98D8
lda LA2AA
cmp #$0F
bne LA2AB
rts
2017-12-31 20:32:47 +00:00
LA2A9: .byte 0
LA2AA: .byte 0
2018-02-19 05:37:15 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-19 05:37:15 +00:00
2017-10-12 15:04:27 +00:00
LA2AB: jmp LA2AE
LA2AE: bit L9189
2018-02-16 03:12:59 +00:00
bvc :+
2018-02-15 05:07:31 +00:00
jsr append_to_path_220
2018-01-23 02:09:15 +00:00
yax_call JT_MLI_RELAY, GET_FILE_INFO, file_info_params2
2018-02-16 03:12:59 +00:00
bne :+
2018-02-14 05:52:36 +00:00
add16 LA2EF, file_info_params2::blocks_used, LA2EF
2018-02-26 00:06:17 +00:00
: inc16 LA2ED
bit L9189
2018-02-16 03:12:59 +00:00
bvc :+
2018-02-15 05:07:31 +00:00
jsr remove_path_segment_220
2018-02-16 03:12:59 +00:00
: ldax LA2ED
2017-10-12 15:04:27 +00:00
jmp L917C
2018-02-15 05:07:31 +00:00
LA2ED: .word 0
LA2EF: .word 0
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-13 16:18:11 +00:00
2018-02-15 05:07:31 +00:00
.proc decrement_LA2ED
lda LA2ED
bne :+
dec LA2ED+1
: dec LA2ED
2017-10-12 15:04:27 +00:00
rts
2018-02-15 05:07:31 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-15 05:07:31 +00:00
;;; Append name at L97AD to path at $220
.proc append_to_path_220
path := $220
2017-10-12 15:04:27 +00:00
2018-02-15 05:07:31 +00:00
lda L97AD
bne :+
2017-10-12 15:04:27 +00:00
rts
2018-02-15 05:07:31 +00:00
: ldx #0
ldy path
2018-01-24 04:11:38 +00:00
lda #'/'
2018-02-15 05:07:31 +00:00
sta path+1,y
2017-10-12 15:04:27 +00:00
iny
2018-02-15 05:07:31 +00:00
loop: cpx L97AD
bcs done
lda L97AD+1,x
sta path+1,y
2017-10-12 15:04:27 +00:00
inx
iny
2018-02-15 05:07:31 +00:00
jmp loop
2017-10-12 15:04:27 +00:00
2018-02-15 05:07:31 +00:00
done: sty $220
2017-10-12 15:04:27 +00:00
rts
2018-02-15 05:07:31 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-15 05:07:31 +00:00
;;; Remove segment from path at $220
2017-10-12 15:04:27 +00:00
2018-02-15 05:07:31 +00:00
.proc remove_path_segment_220
path := $220
ldx path ; length
bne :+
rts
: lda path,x
cmp #'/'
beq found
2017-10-12 15:04:27 +00:00
dex
2018-02-15 05:07:31 +00:00
bne :-
stx path
2017-10-12 15:04:27 +00:00
rts
2018-02-15 05:07:31 +00:00
found: dex
stx path
2017-10-12 15:04:27 +00:00
rts
2018-02-15 05:07:31 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-19 01:08:11 +00:00
.proc LA33B
lda L97AD
2017-10-12 15:04:27 +00:00
bne LA341
rts
LA341: ldx #$00
ldy $1FC0
2018-01-24 04:11:38 +00:00
lda #'/'
2017-10-12 15:04:27 +00:00
sta $1FC1,y
iny
LA34C: cpx L97AD
bcs LA35C
2018-02-18 08:01:08 +00:00
lda L97AD+1,x
2017-10-12 15:04:27 +00:00
sta $1FC1,y
inx
iny
jmp LA34C
LA35C: sty $1FC0
rts
2018-02-19 01:08:11 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-19 01:08:11 +00:00
.proc LA360
ldx $1FC0
2017-10-12 15:04:27 +00:00
bne LA366
rts
LA366: lda $1FC0,x
cmp #$2F
beq LA374
dex
bne LA366
stx $1FC0
rts
LA374: dex
stx $1FC0
rts
2018-02-19 01:08:11 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-19 01:08:11 +00:00
.proc LA379
ldy #$00
2017-10-12 15:04:27 +00:00
sty L9B32
dey
LA37F: iny
2018-02-15 16:08:59 +00:00
lda path_buf3,y
2017-10-12 15:04:27 +00:00
cmp #$2F
bne LA38A
sty L9B32
2018-01-17 15:41:23 +00:00
LA38A: sta $220,y
2018-02-15 16:08:59 +00:00
cpy path_buf3
2017-10-12 15:04:27 +00:00
bne LA37F
2018-02-15 16:08:59 +00:00
ldy path_buf4
LA395: lda path_buf4,y
2017-10-12 15:04:27 +00:00
sta $1FC0,y
dey
bpl LA395
rts
2018-02-19 01:08:11 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
LA39F: jsr L917F
jmp LA3A7
2018-02-16 03:12:59 +00:00
.proc LA3A7_impl
2018-02-26 05:03:58 +00:00
DEFINE_CLOSE_PARAMS close_params
2018-01-18 01:35:35 +00:00
2018-02-16 03:12:59 +00:00
start: yax_call JT_MLI_RELAY, CLOSE, close_params
lda selected_window_index
2018-02-16 03:12:59 +00:00
beq :+
2018-01-31 05:42:26 +00:00
sta getwinport_params2::window_id
2018-01-30 16:57:36 +00:00
yax_call JT_MGTK_RELAY, MGTK::GetWinPort, getwinport_params2
yax_call JT_MGTK_RELAY, MGTK::SetPort, grafport2
2018-02-16 03:12:59 +00:00
: ldx stack_stash
2017-10-12 15:04:27 +00:00
txs
2018-02-16 03:29:05 +00:00
return #$FF
2018-02-16 03:12:59 +00:00
.endproc
LA3A7 := LA3A7_impl::start
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-16 03:12:59 +00:00
.proc check_escape_key_down
yax_call JT_MGTK_RELAY, MGTK::GetEvent, event_params
2018-02-28 02:38:18 +00:00
lda event_kind
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_key_down
2018-02-16 03:12:59 +00:00
bne nope
2018-02-28 02:38:18 +00:00
lda event_key
2018-02-27 04:13:18 +00:00
cmp #CHAR_ESCAPE
2018-02-16 03:12:59 +00:00
bne nope
2017-10-12 15:04:27 +00:00
lda #$FF
2018-02-16 03:12:59 +00:00
bne done
nope: lda #$00
done: rts
.endproc
2017-10-12 15:04:27 +00:00
2018-02-19 05:37:15 +00:00
LA3EF: sub16 LA2ED, #1, L9E7A
2018-01-23 02:09:15 +00:00
yax_call launch_dialog, index_delete_file_dialog, L9E79
2017-10-12 15:04:27 +00:00
rts
2018-03-15 03:53:20 +00:00
LA40A: sub16 LA2ED, #1, L9938
2018-01-23 02:09:15 +00:00
yax_call launch_dialog, index_copy_file_dialog, L9937
2017-10-12 15:04:27 +00:00
rts
2017-12-31 20:32:47 +00:00
LA425: .byte 0
2018-02-19 01:08:11 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-19 05:37:15 +00:00
2018-02-19 01:08:11 +00:00
.proc LA426
jsr LA46D
2018-03-06 05:27:41 +00:00
lda #ACCESS_DEFAULT
2018-01-18 01:35:35 +00:00
sta file_info_params3::access
2017-10-12 15:04:27 +00:00
jsr LA479
2018-02-06 04:37:41 +00:00
lda file_info_params2::file_type
2017-10-12 15:04:27 +00:00
cmp #$0F
beq LA46C
2018-01-23 02:09:15 +00:00
yax_call JT_MLI_RELAY, OPEN, open_params5
2017-10-12 15:04:27 +00:00
beq LA449
2018-02-13 05:14:23 +00:00
jsr show_error_alert_dst
2017-10-12 15:04:27 +00:00
jmp LA426
2018-01-18 02:07:22 +00:00
LA449: lda open_params5::ref_num
2018-01-18 01:35:35 +00:00
sta set_eof_params::ref_num
sta close_params3::ref_num
2018-01-23 02:09:15 +00:00
LA452: yax_call JT_MLI_RELAY, SET_EOF, set_eof_params
2017-10-12 15:04:27 +00:00
beq LA463
2018-02-13 05:14:23 +00:00
jsr show_error_alert_dst
2017-10-12 15:04:27 +00:00
jmp LA452
2018-01-23 02:09:15 +00:00
LA463: yax_call JT_MLI_RELAY, CLOSE, close_params3
2017-10-12 15:04:27 +00:00
LA46C: rts
2018-02-19 01:08:11 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-02-19 01:08:11 +00:00
.proc LA46D
ldx #10
loop: lda file_info_params2::access,x
2018-01-18 01:35:35 +00:00
sta file_info_params3::access,x
2017-10-12 15:04:27 +00:00
dex
2018-02-19 01:08:11 +00:00
bpl loop
2017-10-12 15:04:27 +00:00
rts
2018-02-19 01:08:11 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-02-19 01:08:11 +00:00
.proc LA479
lda #7 ; SET_FILE_INFO param_count
2018-01-18 01:35:35 +00:00
sta file_info_params3
2018-01-23 02:09:15 +00:00
yax_call JT_MLI_RELAY, SET_FILE_INFO, file_info_params3
2017-10-12 15:04:27 +00:00
pha
2018-01-18 01:35:35 +00:00
lda #$A ; GET_FILE_INFO param_count
sta file_info_params3
2017-10-12 15:04:27 +00:00
pla
2018-02-19 01:08:11 +00:00
beq done
2018-02-13 05:14:23 +00:00
jsr show_error_alert_dst
2017-10-12 15:04:27 +00:00
jmp LA479
2018-02-19 01:08:11 +00:00
done: rts
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-13 05:14:23 +00:00
.proc show_error_alert_impl
flag_set:
ldx #$80
bne :+
flag_clear:
ldx #0
: stx flag
2018-03-06 05:20:00 +00:00
cmp #ERR_VOL_NOT_FOUND ; if err is "not found"
2018-02-13 05:14:23 +00:00
beq not_found ; prompt specifically for src/dst disk
2018-03-06 05:20:00 +00:00
cmp #ERR_PATH_NOT_FOUND
2018-02-13 05:14:23 +00:00
beq not_found
2018-01-20 22:31:48 +00:00
jsr JT_SHOW_ALERT0
2018-02-13 05:14:23 +00:00
bne LA4C2 ; cancel???
2017-10-12 15:04:27 +00:00
rts
2018-02-13 05:14:23 +00:00
not_found:
bit flag
bpl :+
lda #$FD ; "Please insert destination disk"
jmp show
2017-10-12 15:04:27 +00:00
2018-02-13 05:14:23 +00:00
: lda #$FC ; "Please insert source disk"
show: jsr JT_SHOW_ALERT0
2017-10-12 15:04:27 +00:00
bne LA4C2
2018-02-28 02:38:18 +00:00
jmp do_on_line
2017-10-12 15:04:27 +00:00
2017-12-31 02:02:15 +00:00
LA4C2: jmp LA39F
2018-02-13 05:14:23 +00:00
flag: .byte 0
2018-02-28 02:38:18 +00:00
do_on_line:
2018-02-13 05:14:23 +00:00
yax_call JT_MLI_RELAY, ON_LINE, on_line_params2
2017-10-12 15:04:27 +00:00
rts
2018-02-13 05:14:23 +00:00
.endproc
show_error_alert := show_error_alert_impl::flag_clear
show_error_alert_dst := show_error_alert_impl::flag_set
2018-01-21 03:33:15 +00:00
.assert * = $A4D0, error, "Segment length mismatch"
PAD_TO $A500
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-21 23:37:55 +00:00
;;; Dialog Launcher (or just proc handler???)
2018-01-21 18:44:26 +00:00
index_about_dialog := 0
index_copy_file_dialog := 1
index_delete_file_dialog := 2
index_new_folder_dialog := 3
index_get_info_dialog := 6
index_lock_dialog := 7
index_unlock_dialog := 8
index_rename_dialog := 9
2018-01-24 23:39:12 +00:00
index_download_dialog := $A
2018-01-23 16:33:12 +00:00
index_get_size_dialog := $B
index_warning_dialog := $C
2018-01-21 18:44:26 +00:00
launch_dialog:
jmp launch_dialog_impl
2017-10-12 15:04:27 +00:00
dialog_proc_table:
.addr show_about_dialog
2018-01-14 05:20:59 +00:00
.addr show_copy_file_dialog
.addr show_delete_file_dialog
.addr show_new_folder_dialog
2018-01-21 18:44:26 +00:00
.addr rts1
.addr rts1
.addr show_get_info_dialog
2018-01-14 05:20:59 +00:00
.addr show_lock_dialog
.addr show_unlock_dialog
.addr show_rename_dialog
2018-01-24 23:39:12 +00:00
.addr show_download_dialog
2018-01-21 23:37:55 +00:00
.addr show_get_size_dialog
2018-01-23 16:33:12 +00:00
.addr show_warning_dialog
2018-01-14 05:20:59 +00:00
dialog_param_addr:
.addr 0
2018-01-22 07:00:34 +00:00
.byte 0
2018-01-17 15:03:02 +00:00
.proc launch_dialog_impl
stax dialog_param_addr
2017-10-12 15:04:27 +00:00
tya
asl a
tax
copy16 dialog_proc_table,x, jump_addr
lda #0
2018-01-15 18:08:50 +00:00
sta LD8EB
sta LD8EC
sta LD8F0
sta LD8F1
sta LD8F2
sta LD8E8
sta LD8F5
sta LD8ED
2018-01-22 07:00:34 +00:00
sta cursor_ip_flag
2017-10-12 15:04:27 +00:00
lda #$14
2018-01-15 18:08:50 +00:00
sta LD8E9
copy16 #rts1, jump_relay+1
2018-01-22 07:00:34 +00:00
jsr set_cursor_pointer
2018-01-05 04:27:15 +00:00
jump_addr := *+1
2018-01-17 03:36:54 +00:00
jmp dummy0000 ; self-modified
.endproc
2018-01-21 18:44:26 +00:00
2018-01-23 16:33:12 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-23 16:33:12 +00:00
;;; Message handler for OK/Cancel dialog
2018-02-16 03:12:59 +00:00
.proc prompt_input_loop
2018-02-03 03:38:35 +00:00
lda LD8E8
2018-02-16 03:12:59 +00:00
beq :+
2018-01-15 18:08:50 +00:00
dec LD8E9
2018-02-16 03:12:59 +00:00
bne :+
2017-10-12 15:04:27 +00:00
jsr LB8F5
lda #$14
2018-01-15 18:08:50 +00:00
sta LD8E9
2018-02-16 03:12:59 +00:00
: MGTK_RELAY_CALL MGTK::GetEvent, event_params
2018-02-28 02:38:18 +00:00
lda event_kind
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_button_down
2018-02-16 03:12:59 +00:00
bne :+
2018-02-04 07:22:56 +00:00
jmp prompt_click_handler
2017-10-12 15:04:27 +00:00
2018-02-16 03:12:59 +00:00
: cmp #MGTK::event_kind_key_down
bne :+
2018-02-04 07:22:56 +00:00
jmp prompt_key_handler
2017-10-12 15:04:27 +00:00
2018-02-16 03:12:59 +00:00
: lda LD8E8
2018-01-23 16:33:12 +00:00
beq prompt_input_loop
2018-02-28 02:38:18 +00:00
MGTK_RELAY_CALL MGTK::FindWindow, event_coords
lda findwindow_which_area
2018-02-16 03:12:59 +00:00
bne :+
2018-01-23 16:33:12 +00:00
jmp prompt_input_loop
2017-10-12 15:04:27 +00:00
2018-03-05 05:33:56 +00:00
: lda findwindow_window_id
2018-03-15 07:00:36 +00:00
cmp winfo_alert_dialog
2018-02-16 03:12:59 +00:00
beq :+
2018-01-23 16:33:12 +00:00
jmp prompt_input_loop
2017-10-12 15:04:27 +00:00
2018-03-15 07:00:36 +00:00
: lda winfo_alert_dialog
jsr set_port_from_window_id
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
2018-01-30 16:57:36 +00:00
sta event_params
2018-03-02 02:25:42 +00:00
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
MGTK_RELAY_CALL MGTK::MoveTo, screentowindow_windowx
2018-02-03 05:11:49 +00:00
MGTK_RELAY_CALL MGTK::InRect, rect1
2018-02-04 04:06:16 +00:00
cmp #MGTK::inrect_inside
2018-02-16 03:12:59 +00:00
bne out
2018-01-22 07:00:34 +00:00
jsr set_cursor_insertion_point_with_flag
2018-02-16 03:12:59 +00:00
jmp done
out: jsr set_cursor_pointer_with_flag
done: jsr reset_state
2018-01-23 16:33:12 +00:00
jmp prompt_input_loop
2018-02-16 03:12:59 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-02-04 07:22:56 +00:00
;;; Click handler for prompt dialog
2018-02-16 03:12:59 +00:00
prompt_button_ok := 0
prompt_button_cancel := 1
prompt_button_yes := 2
prompt_button_no := 3
prompt_button_all := 4
.proc prompt_click_handler
2018-02-28 02:38:18 +00:00
MGTK_RELAY_CALL MGTK::FindWindow, event_coords
lda findwindow_which_area
2018-02-16 03:12:59 +00:00
bne :+
2018-02-16 03:29:05 +00:00
return #$FF
2018-02-16 03:12:59 +00:00
: cmp #MGTK::area_content
bne :+
jmp content
2018-02-16 03:29:05 +00:00
: return #$FF
2017-10-12 15:04:27 +00:00
2018-02-16 03:12:59 +00:00
content:
2018-02-28 02:38:18 +00:00
lda findwindow_window_id
2018-03-15 07:00:36 +00:00
cmp winfo_alert_dialog
2018-02-16 03:12:59 +00:00
beq :+
2018-02-16 03:29:05 +00:00
return #$FF
2018-03-15 07:00:36 +00:00
: lda winfo_alert_dialog
jsr set_port_from_window_id
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
2018-01-30 16:57:36 +00:00
sta event_params
2018-03-02 02:25:42 +00:00
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
MGTK_RELAY_CALL MGTK::MoveTo, screentowindow_windowx
2018-01-15 18:08:50 +00:00
bit LD8E7
2018-02-16 03:12:59 +00:00
bvc :+
2018-02-04 04:06:16 +00:00
jmp check_button_yes
2017-10-12 15:04:27 +00:00
2018-02-16 03:12:59 +00:00
: MGTK_RELAY_CALL MGTK::InRect, desktop_aux::ok_button_rect
2018-02-04 04:06:16 +00:00
cmp #MGTK::inrect_inside
beq check_button_ok
2018-02-04 07:22:56 +00:00
jmp maybe_check_button_cancel
2017-10-12 15:04:27 +00:00
2018-02-04 04:06:16 +00:00
check_button_ok:
jsr set_penmode_xor2
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::ok_button_rect
jsr button_loop_ok
bmi :+
lda #prompt_button_ok
: rts
2017-10-12 15:04:27 +00:00
2018-02-04 04:06:16 +00:00
check_button_yes:
MGTK_RELAY_CALL MGTK::InRect, desktop_aux::yes_button_rect
cmp #MGTK::inrect_inside
bne check_button_no
jsr set_penmode_xor2
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::yes_button_rect
jsr button_loop_yes
bmi :+
lda #prompt_button_yes
: rts
2017-10-12 15:04:27 +00:00
2018-02-04 04:06:16 +00:00
check_button_no:
MGTK_RELAY_CALL MGTK::InRect, desktop_aux::no_button_rect
cmp #MGTK::inrect_inside
bne check_button_all
jsr set_penmode_xor2
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::no_button_rect
jsr button_loop_no
bmi :+
lda #prompt_button_no
: rts
2017-10-12 15:04:27 +00:00
2018-02-04 04:06:16 +00:00
check_button_all:
MGTK_RELAY_CALL MGTK::InRect, desktop_aux::all_button_rect
cmp #MGTK::inrect_inside
2018-02-04 07:22:56 +00:00
bne maybe_check_button_cancel
jsr set_penmode_xor2
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::all_button_rect
jsr button_loop_all
bmi :+
lda #prompt_button_all
: rts
2017-10-12 15:04:27 +00:00
2018-02-04 07:22:56 +00:00
maybe_check_button_cancel:
bit LD8E7
2018-02-04 04:06:16 +00:00
bpl check_button_cancel
2018-02-16 03:29:05 +00:00
return #$FF
2017-10-12 15:04:27 +00:00
2018-02-04 04:06:16 +00:00
check_button_cancel:
MGTK_RELAY_CALL MGTK::InRect, desktop_aux::cancel_button_rect
cmp #MGTK::inrect_inside
2018-02-04 07:22:56 +00:00
beq :+
2017-10-12 15:04:27 +00:00
jmp LA6ED
2018-02-04 07:22:56 +00:00
: jsr set_penmode_xor2
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::cancel_button_rect
jsr button_loop_cancel
bmi :+
lda #prompt_button_cancel
: rts
2017-10-12 15:04:27 +00:00
2018-01-15 18:08:50 +00:00
LA6ED: bit LD8E8
2017-10-12 15:04:27 +00:00
bmi LA6F7
lda #$FF
2018-02-03 03:38:35 +00:00
jmp jump_relay
2017-10-12 15:04:27 +00:00
LA6F7: jsr LB9B8
2018-02-16 03:29:05 +00:00
return #$FF
2018-02-16 03:12:59 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-02-04 07:22:56 +00:00
;;; Key handler for prompt dialog
2018-02-16 03:12:59 +00:00
.proc prompt_key_handler
2018-02-28 02:38:18 +00:00
lda event_modifiers
2018-02-04 07:22:56 +00:00
cmp #MGTK::event_modifier_solid_apple
2017-10-12 15:04:27 +00:00
bne LA71A
2018-02-28 02:38:18 +00:00
lda event_key
2017-10-12 15:04:27 +00:00
and #$7F
2018-02-27 04:13:18 +00:00
cmp #CHAR_LEFT
2017-10-12 15:04:27 +00:00
bne LA710
jmp LA815
2018-02-27 04:13:18 +00:00
LA710: cmp #CHAR_RIGHT
2017-10-12 15:04:27 +00:00
bne LA717
jmp LA820
2018-02-16 03:29:05 +00:00
LA717: return #$FF
2017-10-12 15:04:27 +00:00
2018-02-28 02:38:18 +00:00
LA71A: lda event_key
2017-10-12 15:04:27 +00:00
and #$7F
2018-02-27 04:13:18 +00:00
cmp #CHAR_LEFT
2017-10-12 15:04:27 +00:00
bne LA72E
2018-01-15 18:08:50 +00:00
bit LD8ED
2017-10-12 15:04:27 +00:00
bpl LA72B
jmp L0CB8
LA72B: jmp LA82B
2018-02-27 04:13:18 +00:00
LA72E: cmp #CHAR_RIGHT
2017-10-12 15:04:27 +00:00
bne LA73D
2018-01-15 18:08:50 +00:00
bit LD8ED
2017-10-12 15:04:27 +00:00
bpl LA73A
jmp L0CD7
LA73A: jmp LA83E
2018-02-27 04:13:18 +00:00
LA73D: cmp #CHAR_RETURN
2017-10-12 15:04:27 +00:00
bne LA749
2018-01-15 18:08:50 +00:00
bit LD8E7
2017-10-12 15:04:27 +00:00
bvs LA717
jmp LA851
2018-02-27 04:13:18 +00:00
LA749: cmp #CHAR_ESCAPE
2017-10-12 15:04:27 +00:00
bne LA755
2018-01-15 18:08:50 +00:00
bit LD8E7
2017-10-12 15:04:27 +00:00
bmi LA717
jmp LA86F
2018-02-27 04:13:18 +00:00
LA755: cmp #CHAR_DELETE
2017-10-12 15:04:27 +00:00
bne LA75C
jmp LA88D
2018-02-27 04:13:18 +00:00
LA75C: cmp #CHAR_UP
2017-10-12 15:04:27 +00:00
bne LA76B
2018-01-15 18:08:50 +00:00
bit LD8ED
2017-10-12 15:04:27 +00:00
bmi LA768
jmp LA717
LA768: jmp L0D14
2018-02-27 04:13:18 +00:00
LA76B: cmp #CHAR_DOWN
2017-10-12 15:04:27 +00:00
bne LA77A
2018-01-15 18:08:50 +00:00
bit LD8ED
2017-10-12 15:04:27 +00:00
bmi LA777
jmp LA717
LA777: jmp L0CF9
2018-01-15 18:08:50 +00:00
LA77A: bit LD8E7
2017-10-12 15:04:27 +00:00
bvc LA79B
2018-01-12 07:15:04 +00:00
cmp #'Y'
2017-10-12 15:04:27 +00:00
beq LA7E8
2018-01-12 07:15:04 +00:00
cmp #'y'
2017-10-12 15:04:27 +00:00
beq LA7E8
2018-01-12 07:15:04 +00:00
cmp #'N'
2017-10-12 15:04:27 +00:00
beq LA7F7
2018-01-12 07:15:04 +00:00
cmp #'n'
2017-10-12 15:04:27 +00:00
beq LA7F7
2018-01-12 07:15:04 +00:00
cmp #'A'
2017-10-12 15:04:27 +00:00
beq LA806
2018-01-12 07:15:04 +00:00
cmp #'a'
2017-10-12 15:04:27 +00:00
beq LA806
2018-02-27 04:13:18 +00:00
cmp #CHAR_RETURN
2017-10-12 15:04:27 +00:00
beq LA7E8
2018-02-16 03:12:59 +00:00
2018-01-15 18:08:50 +00:00
LA79B: bit LD8F5
2017-10-12 15:04:27 +00:00
bmi LA7C8
2018-02-16 03:12:59 +00:00
cmp #'.'
2017-10-12 15:04:27 +00:00
beq LA7D8
2018-02-16 03:12:59 +00:00
cmp #'0'
2017-10-12 15:04:27 +00:00
bcs LA7AB
jmp LA717
2018-02-16 03:12:59 +00:00
LA7AB: cmp #'z'+1
2017-10-12 15:04:27 +00:00
bcc LA7B2
jmp LA717
2018-02-16 03:12:59 +00:00
LA7B2: cmp #'9'+1
2017-10-12 15:04:27 +00:00
bcc LA7D8
2018-02-16 03:12:59 +00:00
cmp #'A'
2017-10-12 15:04:27 +00:00
bcs LA7BD
jmp LA717
2018-02-16 03:12:59 +00:00
LA7BD: cmp #'Z'+1
2017-10-12 15:04:27 +00:00
bcc LA7DD
2018-02-16 03:12:59 +00:00
cmp #'a'
2017-10-12 15:04:27 +00:00
bcs LA7DD
jmp LA717
2018-02-16 03:12:59 +00:00
LA7C8: cmp #' '
2017-10-12 15:04:27 +00:00
bcs LA7CF
jmp LA717
LA7CF: cmp #$7E
beq LA7DD
bcc LA7DD
jmp LA717
2018-01-24 05:37:41 +00:00
LA7D8: ldx path_buf1
2017-10-12 15:04:27 +00:00
beq LA7E5
2018-01-15 18:08:50 +00:00
LA7DD: ldx LD8E8
2017-10-12 15:04:27 +00:00
beq LA7E5
jsr LBB0B
2018-02-16 03:29:05 +00:00
LA7E5: return #$FF
2018-02-16 03:12:59 +00:00
.endproc
2017-10-12 15:04:27 +00:00
LA7E8: jsr set_penmode_xor2
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::yes_button_rect
2018-02-16 03:29:05 +00:00
return #prompt_button_yes
2017-10-12 15:04:27 +00:00
LA7F7: jsr set_penmode_xor2
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::no_button_rect
2018-02-16 03:29:05 +00:00
return #prompt_button_no
2017-10-12 15:04:27 +00:00
LA806: jsr set_penmode_xor2
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::all_button_rect
2018-02-16 03:29:05 +00:00
return #prompt_button_all
2017-10-12 15:04:27 +00:00
2018-01-15 18:08:50 +00:00
LA815: lda LD8E8
2017-10-12 15:04:27 +00:00
beq LA81D
jsr LBC5E
2018-02-16 03:29:05 +00:00
LA81D: return #$FF
2017-10-12 15:04:27 +00:00
2018-01-15 18:08:50 +00:00
LA820: lda LD8E8
2017-10-12 15:04:27 +00:00
beq LA828
jsr LBCC9
2018-02-16 03:29:05 +00:00
LA828: return #$FF
2017-10-12 15:04:27 +00:00
2018-01-15 18:08:50 +00:00
LA82B: lda LD8E8
2017-10-12 15:04:27 +00:00
beq LA83B
2018-01-15 18:08:50 +00:00
bit LD8ED
2017-10-12 15:04:27 +00:00
bpl LA838
jmp L0CD7
LA838: jsr LBBA4
2018-02-16 03:29:05 +00:00
LA83B: return #$FF
2017-10-12 15:04:27 +00:00
2018-01-15 18:08:50 +00:00
LA83E: lda LD8E8
2017-10-12 15:04:27 +00:00
beq LA84E
2018-01-15 18:08:50 +00:00
bit LD8ED
2017-10-12 15:04:27 +00:00
bpl LA84B
jmp L0CB8
LA84B: jsr LBC03
2018-02-16 03:29:05 +00:00
LA84E: return #$FF
2017-10-12 15:04:27 +00:00
2018-03-15 07:00:36 +00:00
LA851: lda winfo_alert_dialog
jsr set_port_from_window_id
jsr set_penmode_xor2
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::ok_button_rect
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::ok_button_rect
2018-02-16 03:29:05 +00:00
return #0
2017-10-12 15:04:27 +00:00
2018-03-15 07:00:36 +00:00
LA86F: lda winfo_alert_dialog
jsr set_port_from_window_id
jsr set_penmode_xor2
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::cancel_button_rect
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::cancel_button_rect
2018-02-16 03:29:05 +00:00
return #1
2017-10-12 15:04:27 +00:00
2018-01-15 18:08:50 +00:00
LA88D: lda LD8E8
2017-10-12 15:04:27 +00:00
beq LA895
jsr LBB63
2018-02-16 03:29:05 +00:00
LA895: return #$FF
2017-10-12 15:04:27 +00:00
2018-01-14 05:20:59 +00:00
rts1:
2017-10-12 15:04:27 +00:00
rts
2018-02-03 03:38:35 +00:00
jump_relay:
jmp dummy0000
2017-12-31 20:32:47 +00:00
2018-01-11 06:31:02 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-14 05:20:59 +00:00
;;; "About" dialog
2018-01-11 07:04:47 +00:00
.proc show_about_dialog
2018-03-15 04:10:08 +00:00
MGTK_RELAY_CALL MGTK::OpenWindow, winfo_about_dialog
lda winfo_about_dialog::window_id
jsr set_port_from_window_id
jsr set_penmode_xor2
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::about_dialog_outer_rect
MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::about_dialog_inner_rect
2018-02-10 06:59:05 +00:00
addr_call draw_dialog_title, desktop_aux::str_about1
2018-02-19 01:08:11 +00:00
axy_call draw_dialog_label, 1 | DDL_CENTER, desktop_aux::str_about2
axy_call draw_dialog_label, 2 | DDL_CENTER, desktop_aux::str_about3
axy_call draw_dialog_label, 3 | DDL_CENTER, desktop_aux::str_about4
axy_call draw_dialog_label, 5, desktop_aux::str_about5
axy_call draw_dialog_label, 6 | DDL_CENTER, desktop_aux::str_about6
axy_call draw_dialog_label, 7, desktop_aux::str_about7
axy_call draw_dialog_label, 9, desktop_aux::str_about8
2018-02-19 05:37:15 +00:00
copy16 #310, dialog_label_pos
2018-02-19 01:08:11 +00:00
axy_call draw_dialog_label, 9, desktop_aux::str_about9
2018-02-19 05:37:15 +00:00
copy16 #dialog_label_default_x, dialog_label_pos
2018-01-11 07:04:47 +00:00
2018-01-30 16:57:36 +00:00
: MGTK_RELAY_CALL MGTK::GetEvent, event_params
2018-02-28 02:38:18 +00:00
lda event_kind
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_button_down
2018-01-11 07:04:47 +00:00
beq close
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_key_down
2018-01-11 07:04:47 +00:00
bne :-
2018-02-28 02:38:18 +00:00
lda event_key
2017-10-12 15:04:27 +00:00
and #$7F
2018-02-27 04:13:18 +00:00
cmp #CHAR_ESCAPE
2018-01-11 07:04:47 +00:00
beq close
2018-02-27 04:13:18 +00:00
cmp #CHAR_RETURN
2018-01-11 07:04:47 +00:00
bne :-
jmp close
2017-10-12 15:04:27 +00:00
2018-03-15 04:10:08 +00:00
close: MGTK_RELAY_CALL MGTK::CloseWindow, winfo_about_dialog
2018-01-22 07:00:34 +00:00
jsr reset_state
jsr set_cursor_pointer_with_flag
2017-10-12 15:04:27 +00:00
rts
2018-01-11 07:04:47 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-14 05:20:59 +00:00
2018-02-19 05:37:15 +00:00
.proc show_copy_file_dialog
ptr := $6
2018-01-14 05:20:59 +00:00
2018-01-24 23:39:12 +00:00
jsr copy_dialog_param_addr_to_ptr
2018-02-19 01:08:11 +00:00
ldy #0
2018-02-19 05:37:15 +00:00
lda (ptr),y
2017-10-12 15:04:27 +00:00
2018-02-19 05:37:15 +00:00
cmp #1
bne :+
jmp do1
: cmp #2
bne :+
jmp do2
: cmp #3
bne :+
jmp do3
: cmp #4
bne :+
jmp do4
: cmp #5
bne :+
jmp do5
2017-10-12 15:04:27 +00:00
2018-02-19 05:37:15 +00:00
: lda #0
2018-01-15 18:08:50 +00:00
sta LD8E8
2018-02-15 05:07:31 +00:00
jsr open_dialog_window
2018-02-10 06:59:05 +00:00
addr_call draw_dialog_title, desktop_aux::str_copy_title
2018-02-19 01:08:11 +00:00
axy_call draw_dialog_label, 1, desktop_aux::str_copy_copying
axy_call draw_dialog_label, 2, desktop_aux::str_copy_from
axy_call draw_dialog_label, 3, desktop_aux::str_copy_to
axy_call draw_dialog_label, 4, desktop_aux::str_copy_remaining
2017-10-12 15:04:27 +00:00
rts
2018-02-19 05:37:15 +00:00
do1: ldy #1
lda (ptr),y
2018-02-13 16:18:11 +00:00
sta file_count
2017-10-12 15:04:27 +00:00
iny
2018-02-19 05:37:15 +00:00
lda (ptr),y
2018-02-13 16:18:11 +00:00
sta file_count+1
jsr adjust_str_files_suffix
jsr compose_file_count_string
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LB0B6
2018-02-13 16:18:11 +00:00
addr_call draw_text1, str_file_count
2018-01-11 05:56:19 +00:00
addr_call draw_text1, str_files
2017-10-12 15:04:27 +00:00
rts
2018-02-19 05:37:15 +00:00
do2: ldy #1
lda (ptr),y
2018-02-13 16:18:11 +00:00
sta file_count
2017-10-12 15:04:27 +00:00
iny
2018-02-19 05:37:15 +00:00
lda (ptr),y
2018-02-13 16:18:11 +00:00
sta file_count+1
jsr adjust_str_files_suffix
jsr compose_file_count_string
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2017-10-12 15:04:27 +00:00
jsr LBE8D
jsr LBE9A
2018-01-24 23:39:12 +00:00
jsr copy_dialog_param_addr_to_ptr
2017-10-12 15:04:27 +00:00
ldy #$03
2018-02-19 05:37:15 +00:00
lda (ptr),y
2017-10-12 15:04:27 +00:00
tax
iny
2018-02-19 05:37:15 +00:00
lda (ptr),y
sta ptr+1
stx ptr
2017-10-12 15:04:27 +00:00
jsr LBE63
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LAE7E
2018-01-24 05:52:53 +00:00
addr_call draw_text1, path_buf0
2018-01-24 23:39:12 +00:00
jsr copy_dialog_param_addr_to_ptr
2017-10-12 15:04:27 +00:00
ldy #$05
2018-02-19 05:37:15 +00:00
lda (ptr),y
2017-10-12 15:04:27 +00:00
tax
iny
2018-02-19 05:37:15 +00:00
lda (ptr),y
sta ptr+1
stx ptr
2017-10-12 15:04:27 +00:00
jsr LBE78
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LAE82
2018-01-24 05:37:41 +00:00
addr_call draw_text1, path_buf1
2018-01-29 05:18:00 +00:00
yax_call MGTK_RELAY, MGTK::MoveTo, desktop_aux::LB0BA
2018-02-13 16:18:11 +00:00
addr_call draw_text1, str_file_count
2017-10-12 15:04:27 +00:00
rts
2018-02-19 05:37:15 +00:00
do5: jsr reset_state
2018-03-15 07:00:36 +00:00
MGTK_RELAY_CALL MGTK::CloseWindow, winfo_alert_dialog
2018-01-22 07:00:34 +00:00
jsr set_cursor_pointer
2017-10-12 15:04:27 +00:00
rts
2018-02-19 05:37:15 +00:00
do3: jsr bell
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2018-02-19 01:08:11 +00:00
axy_call draw_dialog_label, 6, desktop_aux::str_exists_prompt
2018-01-21 23:37:55 +00:00
jsr draw_yes_no_all_cancel_buttons
2018-01-23 16:33:12 +00:00
LAA7F: jsr prompt_input_loop
2017-10-12 15:04:27 +00:00
bmi LAA7F
pha
2018-01-21 23:37:55 +00:00
jsr erase_yes_no_all_cancel_buttons
2018-01-30 16:57:36 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, pencopy
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::prompt_rect
2017-10-12 15:04:27 +00:00
pla
rts
2018-02-19 05:37:15 +00:00
do4: jsr bell
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2018-02-19 01:08:11 +00:00
axy_call draw_dialog_label, 6, desktop_aux::str_large_prompt
2018-01-21 23:37:55 +00:00
jsr draw_ok_cancel_buttons
2018-01-23 16:33:12 +00:00
LAAB1: jsr prompt_input_loop
2017-10-12 15:04:27 +00:00
bmi LAAB1
pha
2018-01-21 23:37:55 +00:00
jsr erase_ok_cancel_buttons
2018-01-30 16:57:36 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, pencopy
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::prompt_rect
2017-10-12 15:04:27 +00:00
pla
rts
2018-02-19 05:37:15 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-01-24 23:39:12 +00:00
.proc bell
sta ALTZPOFF
2017-12-31 20:04:22 +00:00
sta ROMIN2
2017-12-31 02:02:15 +00:00
jsr BELL1
2017-10-12 15:04:27 +00:00
sta ALTZPON
lda LCBANK1
lda LCBANK1
rts
2018-01-24 23:39:12 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-24 23:39:12 +00:00
;;; "DownLoad" dialog
2018-01-21 23:37:55 +00:00
2018-01-24 23:39:12 +00:00
.proc show_download_dialog
ptr := $6
2017-10-12 15:04:27 +00:00
2018-01-24 23:39:12 +00:00
jsr copy_dialog_param_addr_to_ptr
ldy #0
lda (ptr),y
cmp #1
bne :+
jmp do1
: cmp #2
bne :+
jmp do2
: cmp #3
bne :+
jmp do3
: cmp #4
bne else
jmp do4
2017-10-12 15:04:27 +00:00
2018-01-24 23:39:12 +00:00
else: lda #0
2018-01-15 18:08:50 +00:00
sta LD8E8
2018-02-15 05:07:31 +00:00
jsr open_dialog_window
2018-02-10 06:59:05 +00:00
addr_call draw_dialog_title, desktop_aux::str_download
2018-02-19 01:08:11 +00:00
axy_call draw_dialog_label, 1, desktop_aux::str_copy_copying
axy_call draw_dialog_label, 2, desktop_aux::str_copy_from
axy_call draw_dialog_label, 3, desktop_aux::str_copy_to
axy_call draw_dialog_label, 4, desktop_aux::str_copy_remaining
2017-10-12 15:04:27 +00:00
rts
2018-01-24 23:39:12 +00:00
do1: ldy #1
lda (ptr),y
2018-02-13 16:18:11 +00:00
sta file_count
2017-10-12 15:04:27 +00:00
iny
2018-01-24 23:39:12 +00:00
lda (ptr),y
2018-02-13 16:18:11 +00:00
sta file_count+1
jsr adjust_str_files_suffix
jsr compose_file_count_string
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LB0B6
2018-02-13 16:18:11 +00:00
addr_call draw_text1, str_file_count
2018-01-11 05:56:19 +00:00
addr_call draw_text1, str_files
2017-10-12 15:04:27 +00:00
rts
2018-01-24 23:39:12 +00:00
do2: ldy #$01
lda (ptr),y
2018-02-13 16:18:11 +00:00
sta file_count
2017-10-12 15:04:27 +00:00
iny
2018-01-24 23:39:12 +00:00
lda (ptr),y
2018-02-13 16:18:11 +00:00
sta file_count+1
jsr adjust_str_files_suffix
jsr compose_file_count_string
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2017-10-12 15:04:27 +00:00
jsr LBE8D
2018-01-24 23:39:12 +00:00
jsr copy_dialog_param_addr_to_ptr
2017-10-12 15:04:27 +00:00
ldy #$03
2018-01-24 23:39:12 +00:00
lda (ptr),y
2017-10-12 15:04:27 +00:00
tax
iny
2018-01-24 23:39:12 +00:00
lda (ptr),y
sta ptr+1
stx ptr
2017-10-12 15:04:27 +00:00
jsr LBE63
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LAE7E
2018-01-24 05:52:53 +00:00
addr_call draw_text1, path_buf0
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LB0BA
2018-02-13 16:18:11 +00:00
addr_call draw_text1, str_file_count
2017-10-12 15:04:27 +00:00
rts
2018-01-24 23:39:12 +00:00
do3: jsr reset_state
2018-03-15 07:00:36 +00:00
MGTK_RELAY_CALL MGTK::CloseWindow, winfo_alert_dialog
2018-01-22 07:00:34 +00:00
jsr set_cursor_pointer
2017-10-12 15:04:27 +00:00
rts
2018-01-24 23:39:12 +00:00
do4: jsr bell
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2018-02-19 01:08:11 +00:00
axy_call draw_dialog_label, 6, desktop_aux::str_ramcard_full
2018-01-21 23:37:55 +00:00
jsr draw_ok_button
2018-01-24 23:39:12 +00:00
: jsr prompt_input_loop
bmi :-
2017-10-12 15:04:27 +00:00
pha
2018-01-21 23:37:55 +00:00
jsr erase_ok_button
2018-01-30 16:57:36 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, pencopy
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::prompt_rect
2017-10-12 15:04:27 +00:00
pla
rts
2018-01-24 23:39:12 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-21 23:37:55 +00:00
;;; "Get Size" dialog
2018-01-24 23:39:12 +00:00
.proc show_get_size_dialog
ptr := $6
2017-10-12 15:04:27 +00:00
2018-01-24 23:39:12 +00:00
jsr copy_dialog_param_addr_to_ptr
ldy #0
lda (ptr),y
cmp #1
bne :+
jmp do1
: cmp #2
bne :+
jmp do2
: cmp #3
bne else
jmp do3
2017-10-12 15:04:27 +00:00
2018-02-15 05:07:31 +00:00
else: jsr open_dialog_window
2018-02-10 06:59:05 +00:00
addr_call draw_dialog_title, desktop_aux::str_size_title
2018-02-19 01:08:11 +00:00
axy_call draw_dialog_label, 1, desktop_aux::str_size_number
2018-01-24 23:39:12 +00:00
ldy #1
2018-01-21 18:56:50 +00:00
jsr draw_colon
2018-02-19 01:08:11 +00:00
axy_call draw_dialog_label, 2, desktop_aux::str_size_blocks
2018-01-24 23:39:12 +00:00
ldy #2
2018-01-21 18:56:50 +00:00
jsr draw_colon
2017-10-12 15:04:27 +00:00
rts
2018-01-24 23:39:12 +00:00
do1: ldy #$01
lda (ptr),y
2018-02-13 16:18:11 +00:00
sta file_count
2017-10-12 15:04:27 +00:00
tax
iny
2018-01-24 23:39:12 +00:00
lda (ptr),y
sta ptr+1
stx ptr
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-24 23:39:12 +00:00
lda (ptr),y
2018-02-13 16:18:11 +00:00
sta file_count
2017-10-12 15:04:27 +00:00
iny
2018-01-24 23:39:12 +00:00
lda (ptr),y
2018-02-13 16:18:11 +00:00
sta file_count+1
jsr compose_file_count_string
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2018-02-19 05:37:15 +00:00
lda #165
2018-01-21 18:56:50 +00:00
sta dialog_label_pos
2018-02-19 01:08:11 +00:00
yax_call draw_dialog_label, 1, str_file_count
2018-01-24 23:39:12 +00:00
jsr copy_dialog_param_addr_to_ptr
2017-10-12 15:04:27 +00:00
ldy #$03
2018-01-24 23:39:12 +00:00
lda (ptr),y
2017-10-12 15:04:27 +00:00
tax
iny
2018-01-24 23:39:12 +00:00
lda (ptr),y
sta ptr+1
stx ptr
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-24 23:39:12 +00:00
lda (ptr),y
2018-02-13 16:18:11 +00:00
sta file_count
2017-10-12 15:04:27 +00:00
iny
2018-01-24 23:39:12 +00:00
lda (ptr),y
2018-02-13 16:18:11 +00:00
sta file_count+1
jsr compose_file_count_string
2018-02-19 05:37:15 +00:00
lda #165
2018-01-21 18:56:50 +00:00
sta dialog_label_pos
2018-02-19 01:08:11 +00:00
yax_call draw_dialog_label, 2, str_file_count
2017-10-12 15:04:27 +00:00
rts
2018-01-24 23:39:12 +00:00
do3: jsr reset_state
2018-03-15 07:00:36 +00:00
MGTK_RELAY_CALL MGTK::CloseWindow, winfo_alert_dialog
2018-01-22 07:00:34 +00:00
jsr set_cursor_pointer
2017-10-12 15:04:27 +00:00
rts
2018-03-15 07:00:36 +00:00
do2: lda winfo_alert_dialog
jsr set_port_from_window_id
2018-01-21 23:37:55 +00:00
jsr draw_ok_button
2018-01-24 23:39:12 +00:00
: jsr prompt_input_loop
bmi :-
2018-01-30 16:57:36 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, pencopy
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::press_ok_to_rect
2018-01-21 23:37:55 +00:00
jsr erase_ok_button
2018-02-16 03:29:05 +00:00
return #0
2018-01-24 23:39:12 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-21 18:56:50 +00:00
;;; "Delete File" dialog
2018-02-19 01:08:11 +00:00
.proc show_delete_file_dialog
2018-01-24 23:39:12 +00:00
jsr copy_dialog_param_addr_to_ptr
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
2018-02-19 05:37:15 +00:00
cmp #1
bne :+
jmp do1
: cmp #2
bne :+
jmp do2
: cmp #3
bne :+
jmp do3
: cmp #4
bne :+
jmp do4
: cmp #5
bne :+
jmp do5
2017-10-12 15:04:27 +00:00
2018-02-19 05:37:15 +00:00
: sta LAD1F
2017-10-12 15:04:27 +00:00
lda #$00
2018-01-15 18:08:50 +00:00
sta LD8E8
2018-02-15 05:07:31 +00:00
jsr open_dialog_window
2018-02-10 06:59:05 +00:00
addr_call draw_dialog_title, desktop_aux::str_delete_title
2017-10-12 15:04:27 +00:00
lda LAD1F
beq LAD20
2018-02-19 01:08:11 +00:00
axy_call draw_dialog_label, 4, desktop_aux::str_ok_empty
2017-10-12 15:04:27 +00:00
rts
2017-12-31 20:32:47 +00:00
LAD1F: .byte 0
2018-02-19 01:08:11 +00:00
LAD20: axy_call draw_dialog_label, 4, desktop_aux::str_delete_ok
2017-10-12 15:04:27 +00:00
rts
2018-02-19 05:37:15 +00:00
do1: ldy #$01
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-13 16:18:11 +00:00
sta file_count
2017-10-12 15:04:27 +00:00
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-13 16:18:11 +00:00
sta file_count+1
jsr adjust_str_files_suffix
jsr compose_file_count_string
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2017-10-12 15:04:27 +00:00
lda LAD1F
2018-02-03 05:11:49 +00:00
bne LAD54
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LB16A
2017-10-12 15:04:27 +00:00
jmp LAD5D
2018-01-29 05:18:00 +00:00
LAD54: MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LB172
2018-02-13 16:18:11 +00:00
LAD5D: addr_call draw_text1, str_file_count
2018-01-11 05:56:19 +00:00
addr_call draw_text1, str_files
2017-10-12 15:04:27 +00:00
rts
2018-02-19 05:37:15 +00:00
do3: ldy #$01
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-13 16:18:11 +00:00
sta file_count
2017-10-12 15:04:27 +00:00
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-13 16:18:11 +00:00
sta file_count+1
jsr adjust_str_files_suffix
jsr compose_file_count_string
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2017-10-12 15:04:27 +00:00
jsr LBE8D
2018-01-24 23:39:12 +00:00
jsr copy_dialog_param_addr_to_ptr
2017-10-12 15:04:27 +00:00
ldy #$03
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tax
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
sta $06+1
stx $06
2017-10-12 15:04:27 +00:00
jsr LBE63
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LAE7E
2018-01-24 05:52:53 +00:00
addr_call draw_text1, path_buf0
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LB16E
2018-02-13 16:18:11 +00:00
addr_call draw_text1, str_file_count
2017-10-12 15:04:27 +00:00
rts
2018-03-15 07:00:36 +00:00
do2: lda winfo_alert_dialog
jsr set_port_from_window_id
2018-01-21 23:37:55 +00:00
jsr draw_ok_cancel_buttons
2018-01-23 16:33:12 +00:00
LADC4: jsr prompt_input_loop
2017-10-12 15:04:27 +00:00
bmi LADC4
bne LADF4
2018-01-30 16:57:36 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, pencopy
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::press_ok_to_rect
2018-01-21 23:37:55 +00:00
jsr erase_ok_cancel_buttons
2018-02-19 01:08:11 +00:00
yax_call draw_dialog_label, 2, desktop_aux::str_file_colon
yax_call draw_dialog_label, 4, desktop_aux::str_delete_remaining
2017-10-12 15:04:27 +00:00
lda #$00
LADF4: rts
2018-02-19 05:37:15 +00:00
do5: jsr reset_state
2018-03-15 07:00:36 +00:00
MGTK_RELAY_CALL MGTK::CloseWindow, winfo_alert_dialog
2018-01-22 07:00:34 +00:00
jsr set_cursor_pointer
2017-10-12 15:04:27 +00:00
rts
2018-03-15 07:00:36 +00:00
do4: lda winfo_alert_dialog
jsr set_port_from_window_id
2018-02-19 01:08:11 +00:00
axy_call draw_dialog_label, 6, desktop_aux::str_delete_locked_file
2018-01-21 23:37:55 +00:00
jsr draw_yes_no_all_cancel_buttons
2018-01-23 16:33:12 +00:00
LAE17: jsr prompt_input_loop
2017-10-12 15:04:27 +00:00
bmi LAE17
pha
2018-01-21 23:37:55 +00:00
jsr erase_yes_no_all_cancel_buttons
2018-01-30 16:57:36 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, pencopy ; white
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::prompt_rect ; erase prompt
2017-10-12 15:04:27 +00:00
pla
rts
2018-02-19 01:08:11 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-21 18:56:50 +00:00
;;; "New Folder" dialog
2018-02-19 01:08:11 +00:00
.proc show_new_folder_dialog
2018-01-24 23:39:12 +00:00
jsr copy_dialog_param_addr_to_ptr
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
cmp #$80
bne LAE42
jmp LAE70
LAE42: cmp #$40
bne LAE49
jmp LAF16
LAE49: lda #$80
2018-01-15 18:08:50 +00:00
sta LD8E8
2017-10-12 15:04:27 +00:00
jsr LBD69
lda #$00
jsr LB509
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2018-02-10 06:59:05 +00:00
addr_call draw_dialog_title, desktop_aux::str_new_folder_title
jsr set_penmode_xor2
2018-02-02 06:04:23 +00:00
MGTK_RELAY_CALL MGTK::FrameRect, rect1
2017-10-12 15:04:27 +00:00
rts
LAE70: lda #$80
2018-01-15 18:08:50 +00:00
sta LD8E8
2017-10-12 15:04:27 +00:00
lda #$00
2018-01-15 18:08:50 +00:00
sta LD8E7
2017-10-12 15:04:27 +00:00
jsr LBD75
2018-01-24 23:39:12 +00:00
jsr copy_dialog_param_addr_to_ptr
2017-10-12 15:04:27 +00:00
ldy #$01
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
sta $08
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-01-21 19:47:40 +00:00
sta $08+1
2017-10-12 15:04:27 +00:00
ldy #$00
lda ($08),y
tay
LAE90: lda ($08),y
2018-01-24 05:52:53 +00:00
sta path_buf0,y
2017-10-12 15:04:27 +00:00
dey
bpl LAE90
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2018-02-19 01:08:11 +00:00
yax_call draw_dialog_label, 2, desktop_aux::str_in_colon
2018-02-19 05:37:15 +00:00
lda #55
2018-01-21 18:56:50 +00:00
sta dialog_label_pos
2018-02-19 01:08:11 +00:00
yax_call draw_dialog_label, 2, path_buf0
2018-02-19 05:37:15 +00:00
lda #dialog_label_default_x
2018-01-21 18:56:50 +00:00
sta dialog_label_pos
2018-02-19 01:08:11 +00:00
yax_call draw_dialog_label, 4, desktop_aux::str_enter_folder_name
2018-02-15 05:07:31 +00:00
jsr draw_filename_prompt
2018-01-23 16:33:12 +00:00
LAEC6: jsr prompt_input_loop
2017-10-12 15:04:27 +00:00
bmi LAEC6
bne LAF16
2018-01-24 05:37:41 +00:00
lda path_buf1
2017-10-12 15:04:27 +00:00
beq LAEC6
cmp #$10
bcc LAEE1
LAED6: lda #$FB
2018-01-20 22:31:48 +00:00
jsr JT_SHOW_ALERT0
2018-02-15 05:07:31 +00:00
jsr draw_filename_prompt
2017-10-12 15:04:27 +00:00
jmp LAEC6
2018-01-24 05:52:53 +00:00
LAEE1: lda path_buf0
2017-10-12 15:04:27 +00:00
clc
2018-01-24 05:37:41 +00:00
adc path_buf1
2017-10-12 15:04:27 +00:00
clc
adc #$01
cmp #$41
bcs LAED6
2018-01-24 05:52:53 +00:00
inc path_buf0
ldx path_buf0
2018-01-24 04:11:38 +00:00
lda #'/'
2018-01-24 05:52:53 +00:00
sta path_buf0,x
ldx path_buf0
2017-10-12 15:04:27 +00:00
ldy #$00
LAEFF: inx
iny
2018-01-24 05:37:41 +00:00
lda path_buf1,y
2018-01-24 05:52:53 +00:00
sta path_buf0,x
2018-01-24 05:37:41 +00:00
cpy path_buf1
2017-10-12 15:04:27 +00:00
bne LAEFF
2018-01-24 05:52:53 +00:00
stx path_buf0
2018-01-25 04:20:39 +00:00
ldy #<path_buf0
ldx #>path_buf0
2018-02-16 03:29:05 +00:00
return #0
2017-10-12 15:04:27 +00:00
2018-01-22 07:00:34 +00:00
LAF16: jsr reset_state
2018-03-15 07:00:36 +00:00
MGTK_RELAY_CALL MGTK::CloseWindow, winfo_alert_dialog
2018-01-22 07:00:34 +00:00
jsr set_cursor_pointer
2018-02-16 03:29:05 +00:00
return #1
2018-02-19 01:08:11 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-14 05:20:59 +00:00
;;; "Get Info" dialog
2018-02-19 01:08:11 +00:00
.proc show_get_info_dialog
ptr := $6
2018-01-24 23:39:12 +00:00
jsr copy_dialog_param_addr_to_ptr
2017-10-12 15:04:27 +00:00
ldy #$00
2018-02-19 01:08:11 +00:00
lda (ptr),y
2017-10-12 15:04:27 +00:00
bmi LAF34
jmp LAFB9
LAF34: lda #$00
2018-01-15 18:08:50 +00:00
sta LD8E8
2018-02-19 01:08:11 +00:00
lda (ptr),y
2017-10-12 15:04:27 +00:00
lsr a
lsr a
ror a
eor #$80
jsr LB509
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2018-02-10 06:59:05 +00:00
addr_call draw_dialog_title, desktop_aux::str_info_title
2018-01-24 23:39:12 +00:00
jsr copy_dialog_param_addr_to_ptr
2017-10-12 15:04:27 +00:00
ldy #$00
2018-02-19 01:08:11 +00:00
lda (ptr),y
2017-10-12 15:04:27 +00:00
and #$7F
lsr a
ror a
sta LB01D
2018-02-19 01:08:11 +00:00
yax_call draw_dialog_label, 1, desktop_aux::str_info_name
2017-10-12 15:04:27 +00:00
bit LB01D
bmi LAF78
2018-02-19 01:08:11 +00:00
yax_call draw_dialog_label, 2, desktop_aux::str_info_locked
2017-10-12 15:04:27 +00:00
jmp LAF81
2018-02-19 01:08:11 +00:00
LAF78: yax_call draw_dialog_label, 2, desktop_aux::str_info_protected
2017-10-12 15:04:27 +00:00
LAF81: bit LB01D
bpl LAF92
2018-02-19 01:08:11 +00:00
yax_call draw_dialog_label, 3, desktop_aux::str_info_blocks
2017-10-12 15:04:27 +00:00
jmp LAF9B
2018-02-19 01:08:11 +00:00
LAF92: yax_call draw_dialog_label, 3, desktop_aux::str_info_size
LAF9B: yax_call draw_dialog_label, 4, desktop_aux::str_info_create
yax_call draw_dialog_label, 5, desktop_aux::str_info_mod
yax_call draw_dialog_label, 6, desktop_aux::str_info_type
2018-01-22 07:00:34 +00:00
jmp reset_state
2017-10-12 15:04:27 +00:00
2018-03-15 07:00:36 +00:00
LAFB9: lda winfo_alert_dialog
jsr set_port_from_window_id
2018-01-24 23:39:12 +00:00
jsr copy_dialog_param_addr_to_ptr
2018-02-19 01:08:11 +00:00
ldy #0
lda (ptr),y
sta row
2017-10-12 15:04:27 +00:00
tay
2018-01-21 18:56:50 +00:00
jsr draw_colon
2018-02-19 01:08:11 +00:00
lda #165
2018-01-21 18:56:50 +00:00
sta dialog_label_pos
2018-01-24 23:39:12 +00:00
jsr copy_dialog_param_addr_to_ptr
2018-02-19 01:08:11 +00:00
lda row
cmp #2
2017-10-12 15:04:27 +00:00
bne LAFF0
2018-02-19 01:08:11 +00:00
ldy #1
lda (ptr),y
beq :+
2018-01-25 04:20:39 +00:00
addr_jump LAFF8, desktop_aux::str_yes_label
2018-02-19 01:08:11 +00:00
: addr_jump LAFF8, desktop_aux::str_no_label
2017-10-12 15:04:27 +00:00
2018-02-07 05:59:25 +00:00
LAFF0: ldy #2
2018-02-19 01:08:11 +00:00
lda (ptr),y
2017-10-12 15:04:27 +00:00
tax
dey
2018-02-19 01:08:11 +00:00
lda (ptr),y
LAFF8: ldy row
2018-01-14 05:20:59 +00:00
jsr draw_dialog_label
2018-02-19 01:08:11 +00:00
lda row
cmp #6
beq :+
2017-10-12 15:04:27 +00:00
rts
2018-02-19 01:08:11 +00:00
: jsr prompt_input_loop
bmi :-
2017-10-12 15:04:27 +00:00
pha
2018-01-22 07:00:34 +00:00
jsr reset_state
2018-03-15 07:00:36 +00:00
MGTK_RELAY_CALL MGTK::CloseWindow, winfo_alert_dialog
2018-01-22 07:00:34 +00:00
jsr set_cursor_pointer_with_flag
2017-10-12 15:04:27 +00:00
pla
rts
2017-12-31 20:32:47 +00:00
LB01D: .byte 0
2018-02-19 01:08:11 +00:00
row: .byte 0
.endproc
2018-01-21 18:56:50 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-21 18:56:50 +00:00
;;; Draw ":" after dialog label
.proc draw_colon
2018-02-19 01:08:11 +00:00
lda #160
2018-01-21 18:56:50 +00:00
sta dialog_label_pos
2018-02-09 05:42:59 +00:00
addr_call draw_dialog_label, desktop_aux::str_colon
2017-10-12 15:04:27 +00:00
rts
2018-01-21 18:56:50 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-14 05:20:59 +00:00
;;; "Lock" dialog
2018-02-19 01:08:11 +00:00
.proc show_lock_dialog
2018-01-24 23:39:12 +00:00
jsr copy_dialog_param_addr_to_ptr
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
2018-02-19 05:37:15 +00:00
cmp #1
bne :+
jmp do1
: cmp #2
bne :+
jmp do2
: cmp #3
bne :+
jmp do3
: cmp #4
bne :+
jmp do4
2017-10-12 15:04:27 +00:00
2018-02-19 05:37:15 +00:00
: lda #$00
2018-01-15 18:08:50 +00:00
sta LD8E8
2018-02-15 05:07:31 +00:00
jsr open_dialog_window
2018-02-10 06:59:05 +00:00
addr_call draw_dialog_title, desktop_aux::str_lock_title
2018-02-19 01:08:11 +00:00
yax_call draw_dialog_label, 4, desktop_aux::str_lock_ok
2017-10-12 15:04:27 +00:00
rts
2018-02-19 05:37:15 +00:00
do1: ldy #$01
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-13 16:18:11 +00:00
sta file_count
2017-10-12 15:04:27 +00:00
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-13 16:18:11 +00:00
sta file_count+1
jsr adjust_str_files_suffix
jsr compose_file_count_string
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LB231
2018-02-13 16:18:11 +00:00
addr_call draw_text1, str_file_count
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LB239
2018-01-11 05:56:19 +00:00
addr_call draw_text1, str_files
2017-10-12 15:04:27 +00:00
rts
2018-02-19 05:37:15 +00:00
do3: ldy #$01
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-13 16:18:11 +00:00
sta file_count
2017-10-12 15:04:27 +00:00
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-13 16:18:11 +00:00
sta file_count+1
jsr adjust_str_files_suffix
jsr compose_file_count_string
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2017-10-12 15:04:27 +00:00
jsr LBE8D
2018-01-24 23:39:12 +00:00
jsr copy_dialog_param_addr_to_ptr
2017-10-12 15:04:27 +00:00
ldy #$03
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tax
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
sta $06+1
stx $06
2017-10-12 15:04:27 +00:00
jsr LBE63
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LAE7E
2018-01-24 05:52:53 +00:00
addr_call draw_text1, path_buf0
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LB241
2018-02-13 16:18:11 +00:00
addr_call draw_text1, str_file_count
2017-10-12 15:04:27 +00:00
rts
2018-03-15 07:00:36 +00:00
do2: lda winfo_alert_dialog
jsr set_port_from_window_id
2018-01-21 23:37:55 +00:00
jsr draw_ok_cancel_buttons
2018-01-23 16:33:12 +00:00
LB0FA: jsr prompt_input_loop
2017-10-12 15:04:27 +00:00
bmi LB0FA
bne LB139
2018-01-30 16:57:36 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, pencopy
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::press_ok_to_rect
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::ok_button_rect
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::cancel_button_rect
2018-02-19 01:08:11 +00:00
yax_call draw_dialog_label, 2, desktop_aux::str_file_colon
yax_call draw_dialog_label, 4, desktop_aux::str_lock_remaining
2017-10-12 15:04:27 +00:00
lda #$00
LB139: rts
2018-02-19 05:37:15 +00:00
do4: jsr reset_state
2018-03-15 07:00:36 +00:00
MGTK_RELAY_CALL MGTK::CloseWindow, winfo_alert_dialog
2018-01-22 07:00:34 +00:00
jsr set_cursor_pointer
2017-10-12 15:04:27 +00:00
rts
2018-02-19 01:08:11 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-14 05:20:59 +00:00
;;; "Unlock" dialog
2018-02-19 01:08:11 +00:00
.proc show_unlock_dialog
2018-01-24 23:39:12 +00:00
jsr copy_dialog_param_addr_to_ptr
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
2018-02-19 05:37:15 +00:00
cmp #1
bne :+
jmp do1
: cmp #2
bne :+
jmp do2
: cmp #3
bne :+
jmp do3
: cmp #4
bne :+
jmp do4
2017-10-12 15:04:27 +00:00
2018-02-19 05:37:15 +00:00
: lda #$00
2018-01-15 18:08:50 +00:00
sta LD8E8
2018-02-15 05:07:31 +00:00
jsr open_dialog_window
2018-02-10 06:59:05 +00:00
addr_call draw_dialog_title, desktop_aux::str_unlock_title
2018-02-19 01:08:11 +00:00
yax_call draw_dialog_label, 4, desktop_aux::str_unlock_ok
2017-10-12 15:04:27 +00:00
rts
2018-02-19 05:37:15 +00:00
do1: ldy #$01
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-13 16:18:11 +00:00
sta file_count
2017-10-12 15:04:27 +00:00
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-13 16:18:11 +00:00
sta file_count+1
jsr adjust_str_files_suffix
jsr compose_file_count_string
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LB22D
2018-02-13 16:18:11 +00:00
addr_call draw_text1, str_file_count
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LB235
2018-01-11 05:56:19 +00:00
addr_call draw_text1, str_files
2017-10-12 15:04:27 +00:00
rts
2018-02-19 05:37:15 +00:00
do3: ldy #$01
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-13 16:18:11 +00:00
sta file_count
2017-10-12 15:04:27 +00:00
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-13 16:18:11 +00:00
sta file_count+1
jsr adjust_str_files_suffix
jsr compose_file_count_string
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2017-10-12 15:04:27 +00:00
jsr LBE8D
2018-01-24 23:39:12 +00:00
jsr copy_dialog_param_addr_to_ptr
2017-10-12 15:04:27 +00:00
ldy #$03
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tax
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
sta $06+1
stx $06
2017-10-12 15:04:27 +00:00
jsr LBE63
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LAE7E
2018-01-24 05:52:53 +00:00
addr_call draw_text1, path_buf0
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::LB23D
2018-02-13 16:18:11 +00:00
addr_call draw_text1, str_file_count
2017-10-12 15:04:27 +00:00
rts
2018-03-15 07:00:36 +00:00
do2: lda winfo_alert_dialog
jsr set_port_from_window_id
2018-01-21 23:37:55 +00:00
jsr draw_ok_cancel_buttons
2018-01-23 16:33:12 +00:00
LB218: jsr prompt_input_loop
2017-10-12 15:04:27 +00:00
bmi LB218
bne LB257
2018-01-30 16:57:36 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, pencopy
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::press_ok_to_rect
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::ok_button_rect
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::cancel_button_rect
2018-02-19 01:08:11 +00:00
yax_call draw_dialog_label, 2, desktop_aux::str_file_colon
yax_call draw_dialog_label, 4, desktop_aux::str_unlock_remaining
2017-10-12 15:04:27 +00:00
lda #$00
LB257: rts
2018-02-19 05:37:15 +00:00
do4: jsr reset_state
2018-03-15 07:00:36 +00:00
MGTK_RELAY_CALL MGTK::CloseWindow, winfo_alert_dialog
2018-01-22 07:00:34 +00:00
jsr set_cursor_pointer
2017-10-12 15:04:27 +00:00
rts
2018-02-19 01:08:11 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-14 05:20:59 +00:00
;;; "Rename" dialog
2018-02-19 01:08:11 +00:00
.proc show_rename_dialog
2018-01-24 23:39:12 +00:00
jsr copy_dialog_param_addr_to_ptr
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
cmp #$80
bne LB276
jmp LB2ED
LB276: cmp #$40
bne LB27D
jmp LB313
LB27D: jsr LBD75
2018-01-24 23:39:12 +00:00
jsr copy_dialog_param_addr_to_ptr
2017-10-12 15:04:27 +00:00
lda #$80
2018-01-15 18:08:50 +00:00
sta LD8E8
2017-10-12 15:04:27 +00:00
jsr LBD69
lda #$00
jsr LB509
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2018-02-10 06:59:05 +00:00
addr_call draw_dialog_title, desktop_aux::str_rename_title
jsr set_penmode_xor2
2018-02-02 06:04:23 +00:00
MGTK_RELAY_CALL MGTK::FrameRect, rect1
2018-02-19 01:08:11 +00:00
yax_call draw_dialog_label, 2, desktop_aux::str_rename_old
2018-02-19 05:37:15 +00:00
lda #85
2018-01-21 18:56:50 +00:00
sta dialog_label_pos
2018-01-24 23:39:12 +00:00
jsr copy_dialog_param_addr_to_ptr
2017-10-12 15:04:27 +00:00
ldy #$01
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
sta $08
iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-01-21 19:47:40 +00:00
sta $08+1
2017-10-12 15:04:27 +00:00
ldy #$00
lda ($08),y
tay
LB2CA: lda ($08),y
2018-01-16 04:33:32 +00:00
sta buf_filename,y
2017-10-12 15:04:27 +00:00
dey
bpl LB2CA
2018-02-19 01:08:11 +00:00
yax_call draw_dialog_label, 2, buf_filename
yax_call draw_dialog_label, 4, desktop_aux::str_rename_new
2017-10-12 15:04:27 +00:00
lda #$00
2018-01-24 05:37:41 +00:00
sta path_buf1
2018-02-15 05:07:31 +00:00
jsr draw_filename_prompt
2017-10-12 15:04:27 +00:00
rts
2018-02-24 05:12:41 +00:00
LB2ED: copy16 #$8000, LD8E7
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2018-01-23 16:33:12 +00:00
LB2FD: jsr prompt_input_loop
2017-10-12 15:04:27 +00:00
bmi LB2FD
bne LB313
2018-01-24 05:37:41 +00:00
lda path_buf1
2017-10-12 15:04:27 +00:00
beq LB2FD
jsr LBCC9
ldy #$43
ldx #$D4
2018-02-16 03:29:05 +00:00
return #0
2017-10-12 15:04:27 +00:00
2018-01-22 07:00:34 +00:00
LB313: jsr reset_state
2018-03-15 07:00:36 +00:00
MGTK_RELAY_CALL MGTK::CloseWindow, winfo_alert_dialog
2018-01-22 07:00:34 +00:00
jsr set_cursor_pointer
2018-02-16 03:29:05 +00:00
return #1
2018-02-19 01:08:11 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-23 16:33:12 +00:00
;;; "Warning!" dialog
2018-02-19 01:08:11 +00:00
;;; $6 ptr to message num
2018-01-23 16:33:12 +00:00
.proc show_warning_dialog
ptr := $6
2018-01-14 05:20:59 +00:00
2018-01-23 16:33:12 +00:00
;; Create window
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::HideCursor
2018-02-15 05:07:31 +00:00
jsr open_alert_window
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2018-02-10 06:59:05 +00:00
addr_call draw_dialog_title, desktop_aux::str_warning
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::ShowCursor
2018-01-24 23:39:12 +00:00
jsr copy_dialog_param_addr_to_ptr
2018-01-23 16:33:12 +00:00
;; Dig up message
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-23 16:33:12 +00:00
lda (ptr),y
2017-10-12 15:04:27 +00:00
pha
2018-01-23 16:33:12 +00:00
bmi only_ok ; high bit set means no cancel
2017-10-12 15:04:27 +00:00
tax
2018-01-23 16:33:12 +00:00
lda warning_cancel_table,x
bne ok_and_cancel
only_ok: ; no cancel button
pla
2017-10-12 15:04:27 +00:00
and #$7F
pha
2018-01-21 23:37:55 +00:00
jsr draw_ok_button
2018-01-23 16:33:12 +00:00
jmp draw_string
ok_and_cancel: ; has cancel button
jsr draw_ok_cancel_buttons
2017-10-12 15:04:27 +00:00
2018-01-23 16:33:12 +00:00
draw_string:
;; First string
pla
2017-10-12 15:04:27 +00:00
pha
2018-01-23 16:33:12 +00:00
asl a ; * 2
asl a ; * 4, since there are two strings each
2017-10-12 15:04:27 +00:00
tay
2018-01-23 16:33:12 +00:00
lda warning_message_table+1,y
2017-10-12 15:04:27 +00:00
tax
2018-01-23 16:33:12 +00:00
lda warning_message_table,y
2018-02-19 01:08:11 +00:00
ldy #3 ; row
2018-01-14 05:20:59 +00:00
jsr draw_dialog_label
2018-01-23 16:33:12 +00:00
;; Second string
2017-10-12 15:04:27 +00:00
pla
asl a
asl a
tay
2018-01-23 16:33:12 +00:00
lda warning_message_table+2+1,y
2017-10-12 15:04:27 +00:00
tax
2018-01-23 16:33:12 +00:00
lda warning_message_table+2,y
2018-02-19 01:08:11 +00:00
ldy #4 ; row
2018-01-14 05:20:59 +00:00
jsr draw_dialog_label
2018-01-23 16:33:12 +00:00
;; Input loop
: jsr prompt_input_loop
bmi :-
2017-10-12 15:04:27 +00:00
pha
2018-01-22 07:00:34 +00:00
jsr reset_state
2018-03-15 07:00:36 +00:00
MGTK_RELAY_CALL MGTK::CloseWindow, winfo_alert_dialog
2018-01-22 07:00:34 +00:00
jsr set_cursor_pointer
2017-10-12 15:04:27 +00:00
pla
rts
2018-01-23 16:33:12 +00:00
;; high bit set if "cancel" should be an option
warning_cancel_table:
.byte $80,$00,$00,$80,$00,$00,$80
2018-01-12 06:38:03 +00:00
2018-01-23 16:33:12 +00:00
warning_message_table:
.addr desktop_aux::str_insert_system_disk,desktop_aux::str_1_space
.addr desktop_aux::str_selector_list_full,desktop_aux::str_before_new_entries
.addr desktop_aux::str_selector_list_full,desktop_aux::str_before_new_entries
.addr desktop_aux::str_window_must_be_closed,desktop_aux::str_1_space
.addr desktop_aux::str_window_must_be_closed,desktop_aux::str_1_space
.addr desktop_aux::str_too_many_windows,desktop_aux::str_1_space
.addr desktop_aux::str_save_selector_list,desktop_aux::str_on_system_disk
2018-01-23 16:33:12 +00:00
.endproc
warning_msg_insert_system_disk := 0
warning_msg_selector_list_full := 1
warning_msg_selector_list_full2 := 2
warning_msg_window_must_be_closed := 3
warning_msg_window_must_be_closed2 := 4
warning_msg_too_many_windows := 5
warning_msg_save_selector_list := 6
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-12 06:38:03 +00:00
2018-01-24 23:39:12 +00:00
.proc copy_dialog_param_addr_to_ptr
2018-02-06 17:31:58 +00:00
copy16 dialog_param_addr, $06
2018-01-01 05:16:41 +00:00
rts
2018-01-24 23:39:12 +00:00
.endproc
2018-01-22 07:00:34 +00:00
.proc set_cursor_pointer_with_flag
bit cursor_ip_flag
bpl :+
jsr set_cursor_pointer
2017-10-12 15:04:27 +00:00
lda #$00
2018-01-22 07:00:34 +00:00
sta cursor_ip_flag
: rts
.endproc
2017-10-12 15:04:27 +00:00
2018-01-22 07:00:34 +00:00
.proc set_cursor_insertion_point_with_flag
bit cursor_ip_flag
bmi :+
jsr set_cursor_insertion_point
2017-10-12 15:04:27 +00:00
lda #$80
2018-01-22 07:00:34 +00:00
sta cursor_ip_flag
: rts
.endproc
cursor_ip_flag: ; high bit set if IP, clear if pointer
.byte 0
2017-10-12 15:04:27 +00:00
2018-01-22 07:00:34 +00:00
set_cursor_watch:
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::HideCursor
MGTK_RELAY_CALL MGTK::SetCursor, watch_cursor
MGTK_RELAY_CALL MGTK::ShowCursor
2017-10-12 15:04:27 +00:00
rts
2018-01-22 07:00:34 +00:00
set_cursor_pointer:
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::HideCursor
MGTK_RELAY_CALL MGTK::SetCursor, pointer_cursor
MGTK_RELAY_CALL MGTK::ShowCursor
2017-10-12 15:04:27 +00:00
rts
2018-01-22 07:00:34 +00:00
set_cursor_insertion_point:
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::HideCursor
MGTK_RELAY_CALL MGTK::SetCursor, insertion_point_cursor
MGTK_RELAY_CALL MGTK::ShowCursor
2017-10-12 15:04:27 +00:00
rts
set_penmode_xor2:
2018-01-30 16:57:36 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2017-10-12 15:04:27 +00:00
rts
ldx #$03
2018-02-28 02:38:18 +00:00
LB447: lda event_coords,x
2017-10-12 15:04:27 +00:00
sta LB502,x
dex
bpl LB447
lda #$00
sta LB501
2018-01-11 05:10:24 +00:00
lda machine_type
2017-10-12 15:04:27 +00:00
asl a
sta LB500
rol LB501
LB45F: dec LB500
lda LB500
cmp #$FF
bne LB46C
dec LB501
LB46C: lda LB501
bne LB476
lda LB500
beq LB4B7
2018-01-30 16:57:36 +00:00
LB476: MGTK_RELAY_CALL MGTK::PeekEvent, event_params
2017-10-12 15:04:27 +00:00
jsr LB4BA
bmi LB4B7
lda #$FF
sta LB508
2018-02-28 02:38:18 +00:00
lda event_kind
2017-10-12 15:04:27 +00:00
sta LB507
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_no_event
2017-10-12 15:04:27 +00:00
beq LB45F
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_drag
2017-10-12 15:04:27 +00:00
beq LB45F
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_button_up
2017-10-12 15:04:27 +00:00
bne LB4A7
2018-01-30 16:57:36 +00:00
MGTK_RELAY_CALL MGTK::GetEvent, event_params
2017-10-12 15:04:27 +00:00
jmp LB45F
LB4A7: cmp #$01
bne LB4B7
2018-01-30 16:57:36 +00:00
MGTK_RELAY_CALL MGTK::GetEvent, event_params
2018-02-16 03:29:05 +00:00
return #0
2017-10-12 15:04:27 +00:00
2018-02-16 03:29:05 +00:00
LB4B7: return #$FF
2017-10-12 15:04:27 +00:00
2018-02-28 02:38:18 +00:00
LB4BA: lda event_xcoord
2017-10-12 15:04:27 +00:00
sec
sbc LB502
sta LB506
2018-02-28 02:38:18 +00:00
lda event_xcoord+1
2017-10-12 15:04:27 +00:00
sbc LB503
bpl LB4D6
lda LB506
cmp #$FB
bcs LB4DD
2018-02-16 03:29:05 +00:00
LB4D3: return #$FF
2017-10-12 15:04:27 +00:00
LB4D6: lda LB506
cmp #$05
bcs LB4D3
2018-02-28 02:38:18 +00:00
LB4DD: lda event_ycoord
2017-10-12 15:04:27 +00:00
sec
sbc LB504
sta LB506
2018-02-28 02:38:18 +00:00
lda event_ycoord+1
2017-10-12 15:04:27 +00:00
sbc LB505
bpl LB4F6
lda LB506
cmp #$FC
bcs LB4FD
LB4F6: lda LB506
cmp #$04
bcs LB4D3
2018-02-16 03:29:05 +00:00
LB4FD: return #0
2017-10-12 15:04:27 +00:00
2017-12-31 20:32:47 +00:00
LB500: .byte 0
LB501: .byte 0
LB502: .byte 0
LB503: .byte 0
LB504: .byte 0
LB505: .byte 0
LB506: .byte 0
LB507: .byte 0
LB508: .byte 0
2018-01-15 18:08:50 +00:00
LB509: sta LD8E7
2018-02-15 05:07:31 +00:00
jsr open_dialog_window
2018-01-15 18:08:50 +00:00
bit LD8E7
2017-10-12 15:04:27 +00:00
bvc LB51A
2018-01-21 23:37:55 +00:00
jsr draw_yes_no_all_cancel_buttons
2017-10-12 15:04:27 +00:00
jmp LB526
2018-01-29 05:18:00 +00:00
LB51A: MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::ok_button_rect
2018-01-21 23:37:55 +00:00
jsr draw_ok_label
2018-01-15 18:08:50 +00:00
LB526: bit LD8E7
2017-10-12 15:04:27 +00:00
bmi LB537
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::cancel_button_rect
2018-01-21 23:37:55 +00:00
jsr draw_cancel_label
2018-01-22 07:00:34 +00:00
LB537: jmp reset_state
2017-10-12 15:04:27 +00:00
2018-02-15 05:07:31 +00:00
.proc open_dialog_window
2018-03-15 07:00:36 +00:00
MGTK_RELAY_CALL MGTK::OpenWindow, winfo_alert_dialog
lda winfo_alert_dialog
jsr set_port_from_window_id
jsr set_penmode_xor2
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::confirm_dialog_outer_rect
MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::confirm_dialog_inner_rect
2017-10-12 15:04:27 +00:00
rts
2018-02-15 05:07:31 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-02-15 05:07:31 +00:00
.proc open_alert_window
2018-03-15 07:00:36 +00:00
MGTK_RELAY_CALL MGTK::OpenWindow, winfo_alert_dialog
lda winfo_alert_dialog
jsr set_port_from_window_id
2018-01-21 23:37:55 +00:00
jsr set_fill_white
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintBits, alert_bitmap2_params
jsr set_penmode_xor2
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::confirm_dialog_outer_rect
MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::confirm_dialog_inner_rect
2017-10-12 15:04:27 +00:00
rts
2018-02-15 05:07:31 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-22 07:00:34 +00:00
2018-02-19 01:08:11 +00:00
;;; Draw dialog label.
;;; A,X has pointer to DrawText params block
;;; Y has row number (1, 2, ... ) with high bit to center it
DDL_CENTER := $80
2018-02-19 05:37:15 +00:00
2018-01-22 07:00:34 +00:00
.proc draw_dialog_label
2018-02-02 06:04:23 +00:00
textwidth_params := $8
textptr := $8
textlen := $A
result := $B
2018-02-19 01:08:11 +00:00
ptr := $6
stx ptr+1
sta ptr
2017-10-12 15:04:27 +00:00
tya
2018-01-22 07:00:34 +00:00
bmi :+
jmp skip
2017-10-12 15:04:27 +00:00
2018-02-19 01:08:11 +00:00
;; Compute text width and center it
2018-01-22 07:00:34 +00:00
: tya
2017-10-12 15:04:27 +00:00
pha
2018-02-19 01:08:11 +00:00
add16 ptr, #1, textptr
jsr load_aux_from_ptr
2018-02-02 06:04:23 +00:00
sta textlen
MGTK_RELAY_CALL MGTK::TextWidth, textwidth_params
2018-02-10 06:10:11 +00:00
lsr16 result
2018-02-10 07:33:54 +00:00
sub16 #200, result, dialog_label_pos
2017-10-12 15:04:27 +00:00
pla
tay
2018-01-22 07:00:34 +00:00
2018-02-19 01:08:11 +00:00
skip: dey ; ypos = (Y-1) * 8 + pointD::ycoord
2017-10-12 15:04:27 +00:00
tya
asl a
asl a
asl a
clc
2018-02-03 03:38:35 +00:00
adc pointD::ycoord
2018-01-21 18:56:50 +00:00
sta dialog_label_pos+2
2018-02-03 03:38:35 +00:00
lda pointD::ycoord+1
adc #0
2018-01-21 18:56:50 +00:00
sta dialog_label_pos+3
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, dialog_label_pos
2018-02-19 01:08:11 +00:00
addr_call_indirect draw_text1, ptr
2018-01-21 18:56:50 +00:00
ldx dialog_label_pos
2018-02-19 01:08:11 +00:00
lda #dialog_label_default_x ; restore original x coord
sta dialog_label_pos::xcoord
2017-10-12 15:04:27 +00:00
rts
2018-01-22 07:00:34 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-01-21 23:37:55 +00:00
draw_ok_label:
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::ok_label_pos
addr_call draw_text1, desktop_aux::str_ok_label
2017-10-12 15:04:27 +00:00
rts
2018-01-21 23:37:55 +00:00
draw_cancel_label:
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::cancel_label_pos
addr_call draw_text1, desktop_aux::str_cancel_label
2017-10-12 15:04:27 +00:00
rts
2018-01-21 23:37:55 +00:00
draw_yes_label:
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::yes_label_pos
addr_call draw_text1, desktop_aux::str_yes_label
2017-10-12 15:04:27 +00:00
rts
2018-01-21 23:37:55 +00:00
draw_no_label:
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::no_label_pos
addr_call draw_text1, desktop_aux::str_no_label
2017-10-12 15:04:27 +00:00
rts
2018-01-21 23:37:55 +00:00
draw_all_label:
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, desktop_aux::all_label_pos
addr_call draw_text1, desktop_aux::str_all_label
2017-10-12 15:04:27 +00:00
rts
2018-01-21 23:37:55 +00:00
draw_yes_no_all_cancel_buttons:
jsr set_penmode_xor2
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::yes_button_rect
MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::no_button_rect
MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::all_button_rect
MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::cancel_button_rect
2018-01-21 23:37:55 +00:00
jsr draw_yes_label
jsr draw_no_label
jsr draw_all_label
jsr draw_cancel_label
2017-10-12 15:04:27 +00:00
lda #$40
2018-01-15 18:08:50 +00:00
sta LD8E7
2017-10-12 15:04:27 +00:00
rts
2018-01-21 23:37:55 +00:00
erase_yes_no_all_cancel_buttons:
jsr set_fill_white
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::yes_button_rect
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::no_button_rect
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::all_button_rect
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::cancel_button_rect
2017-10-12 15:04:27 +00:00
rts
2018-01-21 23:37:55 +00:00
draw_ok_cancel_buttons:
jsr set_penmode_xor2
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::ok_button_rect
MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::cancel_button_rect
2018-01-21 23:37:55 +00:00
jsr draw_ok_label
jsr draw_cancel_label
2017-10-12 15:04:27 +00:00
lda #$00
2018-01-15 18:08:50 +00:00
sta LD8E7
2017-10-12 15:04:27 +00:00
rts
2018-01-21 23:37:55 +00:00
erase_ok_cancel_buttons:
jsr set_fill_white
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::ok_button_rect
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::cancel_button_rect
2017-10-12 15:04:27 +00:00
rts
2018-01-21 23:37:55 +00:00
draw_ok_button:
jsr set_penmode_xor2
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::ok_button_rect
2018-01-21 23:37:55 +00:00
jsr draw_ok_label
2017-10-12 15:04:27 +00:00
lda #$80
2018-01-15 18:08:50 +00:00
sta LD8E7
2017-10-12 15:04:27 +00:00
rts
2018-01-21 23:37:55 +00:00
erase_ok_button:
jsr set_fill_white
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::ok_button_rect
2017-10-12 15:04:27 +00:00
rts
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-22 07:00:34 +00:00
.proc draw_text1
2018-02-02 06:04:23 +00:00
params := $6
textptr := $6
textlen := $8
2018-02-05 04:35:19 +00:00
stax textptr
2018-02-19 01:08:11 +00:00
jsr load_aux_from_ptr
2018-01-22 07:00:34 +00:00
beq done
2018-02-02 06:04:23 +00:00
sta textlen
2018-02-26 00:06:17 +00:00
inc16 textptr
MGTK_RELAY_CALL MGTK::DrawText, params
2018-01-22 07:00:34 +00:00
done: rts
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-14 05:20:59 +00:00
2018-02-10 06:59:05 +00:00
.proc draw_dialog_title
2018-01-14 05:20:59 +00:00
str := $6
str_data := $6
str_len := $8
str_width := $9
2018-02-05 04:35:19 +00:00
stax str ; input is length-prefixed string
2018-01-14 05:20:59 +00:00
2018-02-19 01:08:11 +00:00
jsr load_aux_from_ptr
2018-01-14 05:20:59 +00:00
sta str_len
inc str_data ; point past length byte
bne :+
inc str_data+1
2018-01-29 05:18:00 +00:00
: MGTK_RELAY_CALL MGTK::TextWidth, str
2018-02-10 06:10:11 +00:00
lsr16 str_width ; divide by two
2018-02-10 06:59:05 +00:00
lda #>400 ; center within 400px
sta hi
lda #<400
lsr hi ; divide by two
2017-10-12 15:04:27 +00:00
ror a
sec
2018-01-14 05:20:59 +00:00
sbc str_width
2018-02-10 06:59:05 +00:00
sta pos_dialog_title::xcoord
lda hi
2018-01-14 05:20:59 +00:00
sbc str_width+1
2018-02-10 06:59:05 +00:00
sta pos_dialog_title::xcoord+1
MGTK_RELAY_CALL MGTK::MoveTo, pos_dialog_title
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::DrawText, str
2017-10-12 15:04:27 +00:00
rts
2018-02-02 06:04:23 +00:00
2018-02-10 06:59:05 +00:00
hi: .byte 0
2018-01-14 05:20:59 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-05 04:46:26 +00:00
;; Unreferenced ???
2018-02-05 04:35:19 +00:00
LB76C: stax $06
2018-02-02 06:04:23 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, point7
2018-02-09 05:42:59 +00:00
addr_call_indirect draw_text1, $06
2017-10-12 15:04:27 +00:00
rts
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 07:19:29 +00:00
;;; Adjust case in a filename (input buf A,X, output buf $A)
;;; Called from ovl2
.proc adjust_case
ptr := $A
stx ptr+1
sta ptr
ldy #0
lda (ptr),y
2017-10-12 15:04:27 +00:00
tay
2018-02-25 07:19:29 +00:00
bne loop
2017-10-12 15:04:27 +00:00
rts
2018-02-25 07:19:29 +00:00
loop: dey
beq done
bpl :+
done: rts
2017-10-12 15:04:27 +00:00
2018-02-25 07:19:29 +00:00
: lda (ptr),y
2017-10-12 15:04:27 +00:00
and #$7F
2018-02-25 07:19:29 +00:00
cmp #'/'
beq :+
cmp #'.'
bne check_alpha
: dey
jmp loop
check_alpha:
iny
lda (ptr),y
2017-10-12 15:04:27 +00:00
and #$7F
2018-02-25 07:19:29 +00:00
cmp #'A'
bcc :+
cmp #'Z'+1
bcs :+
2017-10-12 15:04:27 +00:00
clc
2018-02-25 07:19:29 +00:00
adc #('a' - 'A') ; Lowercase
sta (ptr),y
: dey
jmp loop
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
.proc set_port_from_window_id
sta getwinport_params2::window_id
2018-01-30 16:57:36 +00:00
MGTK_RELAY_CALL MGTK::GetWinPort, getwinport_params2
MGTK_RELAY_CALL MGTK::SetPort, grafport2
2018-01-01 05:16:41 +00:00
rts
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
;;; Event loop during button press - handle inverting
;;; the text as mouse is dragged in/out, report final
;;; click (A as passed) / cancel (A is negative)
button_loop_ok:
lda #prompt_button_ok
jmp button_event_loop
2017-10-12 15:04:27 +00:00
button_loop_cancel:
lda #prompt_button_cancel
jmp button_event_loop
2017-10-12 15:04:27 +00:00
button_loop_yes:
lda #prompt_button_yes
jmp button_event_loop
2017-10-12 15:04:27 +00:00
button_loop_no:
lda #prompt_button_no
jmp button_event_loop
2017-10-12 15:04:27 +00:00
button_loop_all:
lda #prompt_button_all
jmp button_event_loop
2017-10-12 15:04:27 +00:00
.proc button_event_loop
;; Configure test and fill procs
pha
2017-10-12 15:04:27 +00:00
asl a
asl a
tax
2018-02-06 17:31:58 +00:00
copy16 test_fill_button_proc_table,x, test_button_proc_addr
copy16 test_fill_button_proc_table+2,x, fill_button_proc_addr
2017-10-12 15:04:27 +00:00
pla
jmp event_loop
2017-10-12 15:04:27 +00:00
test_fill_button_proc_table:
.addr test_ok_button,fill_ok_button
2018-01-21 22:35:37 +00:00
.addr test_cancel_button,fill_cancel_button
.addr test_yes_button,fill_yes_button
.addr test_no_button,fill_no_button
.addr test_all_button,fill_all_button
2018-01-01 05:16:41 +00:00
2018-01-21 22:35:37 +00:00
test_ok_button:
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::InRect, desktop_aux::ok_button_rect
2017-10-12 15:04:27 +00:00
rts
2018-01-21 22:35:37 +00:00
test_cancel_button:
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::InRect, desktop_aux::cancel_button_rect
2017-10-12 15:04:27 +00:00
rts
2018-01-21 22:35:37 +00:00
test_yes_button:
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::InRect, desktop_aux::yes_button_rect
2017-10-12 15:04:27 +00:00
rts
2018-01-21 22:35:37 +00:00
test_no_button:
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::InRect, desktop_aux::no_button_rect
2017-10-12 15:04:27 +00:00
rts
2018-01-21 22:35:37 +00:00
test_all_button:
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::InRect, desktop_aux::all_button_rect
2017-10-12 15:04:27 +00:00
rts
2018-01-21 22:35:37 +00:00
fill_ok_button:
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::ok_button_rect
2017-10-12 15:04:27 +00:00
rts
2018-01-21 22:35:37 +00:00
fill_cancel_button:
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::cancel_button_rect
2017-10-12 15:04:27 +00:00
rts
2018-01-21 22:35:37 +00:00
fill_yes_button:
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::yes_button_rect
2017-10-12 15:04:27 +00:00
rts
2018-01-21 22:35:37 +00:00
fill_no_button:
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::no_button_rect
2017-10-12 15:04:27 +00:00
rts
2018-01-21 22:35:37 +00:00
fill_all_button:
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::all_button_rect
2017-10-12 15:04:27 +00:00
rts
test_proc: jmp (test_button_proc_addr)
fill_proc: jmp (fill_button_proc_addr)
2017-10-12 15:04:27 +00:00
test_button_proc_addr: .addr 0
fill_button_proc_addr: .addr 0
2017-10-12 15:04:27 +00:00
event_loop:
sta click_result
lda #0
sta down_flag
loop: MGTK_RELAY_CALL MGTK::GetEvent, event_params
2018-02-28 02:38:18 +00:00
lda event_kind
2018-02-03 04:10:19 +00:00
cmp #MGTK::event_kind_button_up
beq exit
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
2018-01-30 16:57:36 +00:00
sta event_params
2018-03-02 02:25:42 +00:00
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
MGTK_RELAY_CALL MGTK::MoveTo, screentowindow_windowx
jsr test_proc
2018-02-04 04:06:16 +00:00
cmp #MGTK::inrect_inside
beq inside
lda down_flag ; outside but was inside?
beq invert
jmp loop
inside: lda down_flag ; already depressed?
bne invert
jmp loop
invert: jsr set_penmode_xor2
jsr fill_proc
lda down_flag
2017-10-12 15:04:27 +00:00
clc
adc #$80
sta down_flag
jmp loop
2017-10-12 15:04:27 +00:00
exit: lda down_flag ; was depressed?
beq clicked
2018-02-16 03:29:05 +00:00
return #$FF ; hi bit = cancelled
2017-10-12 15:04:27 +00:00
clicked:
jsr fill_proc ; invert one last time
2018-02-16 03:29:05 +00:00
return click_result ; grab expected result
2017-10-12 15:04:27 +00:00
down_flag:
.byte 0
click_result:
.byte 0
rts ; ???
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-02 06:04:23 +00:00
.proc LB8F5
point := $6
xcoord := $6
ycoord := $8
2018-02-15 05:07:31 +00:00
jsr measure_path_buf1
2018-02-05 04:35:19 +00:00
stax xcoord
2018-02-06 17:31:58 +00:00
copy16 point6::ycoord, ycoord
2018-02-02 06:04:23 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, point
2018-01-31 05:22:13 +00:00
MGTK_RELAY_CALL MGTK::SetPortBits, setportbits_params3
2018-01-15 18:08:50 +00:00
bit LD8EB
2017-10-12 15:04:27 +00:00
bpl LB92D
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::SetTextBG, desktop_aux::LAE6C
2017-10-12 15:04:27 +00:00
lda #$00
2018-01-15 18:08:50 +00:00
sta LD8EB
2017-10-12 15:04:27 +00:00
beq LB93B
2018-01-29 05:18:00 +00:00
LB92D: MGTK_RELAY_CALL MGTK::SetTextBG, desktop_aux::LAE6D
2017-10-12 15:04:27 +00:00
lda #$FF
2018-01-15 18:08:50 +00:00
sta LD8EB
2018-02-02 06:04:23 +00:00
drawtext_params := $6
textptr := $6
textlen := $8
2018-02-06 17:31:58 +00:00
LB93B: copy16 #LD8EF, textptr
2018-01-15 18:08:50 +00:00
lda LD8EE
2018-02-02 06:04:23 +00:00
sta textlen
MGTK_RELAY_CALL MGTK::DrawText, drawtext_params
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::SetTextBG, desktop_aux::LAE6D
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2017-10-12 15:04:27 +00:00
rts
2018-02-02 06:04:23 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-15 05:07:31 +00:00
.proc draw_filename_prompt
lda path_buf1
beq done
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2018-01-21 23:37:55 +00:00
jsr set_fill_white
2018-02-02 06:04:23 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, rect1
2018-01-30 16:57:36 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
2018-02-02 06:04:23 +00:00
MGTK_RELAY_CALL MGTK::FrameRect, rect1
MGTK_RELAY_CALL MGTK::MoveTo, point6
2018-01-31 05:22:13 +00:00
MGTK_RELAY_CALL MGTK::SetPortBits, setportbits_params3
2018-01-24 05:37:41 +00:00
addr_call draw_text1, path_buf1
addr_call draw_text1, path_buf2
2018-01-11 05:56:19 +00:00
addr_call draw_text1, str_2_spaces
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2018-02-15 05:07:31 +00:00
done: rts
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2017-10-12 15:04:27 +00:00
2018-02-19 07:44:08 +00:00
.proc LB9B8
2018-03-02 02:25:42 +00:00
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
MGTK_RELAY_CALL MGTK::MoveTo, screentowindow_windowx
2018-02-02 06:04:23 +00:00
MGTK_RELAY_CALL MGTK::InRect, rect1
2018-02-04 04:06:16 +00:00
cmp #MGTK::inrect_inside
2018-02-19 07:44:08 +00:00
beq :+
2017-10-12 15:04:27 +00:00
rts
2018-02-19 07:44:08 +00:00
: jsr measure_path_buf1
2018-02-05 04:35:19 +00:00
stax $06
2018-03-05 05:33:56 +00:00
cmp16 screentowindow_windowx, $06
2017-10-12 15:04:27 +00:00
bcs LB9EE
jmp LBA83
2018-02-19 07:44:08 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-02-02 06:04:23 +00:00
.proc LB9EE
ptr := $6
2018-02-15 05:07:31 +00:00
jsr measure_path_buf1
2018-02-05 04:35:19 +00:00
stax LBB09
2018-01-24 05:37:41 +00:00
ldx path_buf2
2017-10-12 15:04:27 +00:00
inx
2018-01-24 05:37:41 +00:00
lda #' '
sta path_buf2,x
inc path_buf2
2018-02-06 17:31:58 +00:00
copy16 #path_buf2, ptr
2018-01-24 05:37:41 +00:00
lda path_buf2
2018-02-02 06:04:23 +00:00
sta ptr+2
LBA10: MGTK_RELAY_CALL MGTK::TextWidth, ptr
2018-02-06 18:06:44 +00:00
add16 $09, LBB09, $09
cmp16 $09, $D20D
2017-10-12 15:04:27 +00:00
bcc LBA42
dec $08
lda $08
cmp #$01
bne LBA10
2018-01-24 05:37:41 +00:00
dec path_buf2
2017-10-12 15:04:27 +00:00
jmp LBB05
2018-02-02 06:04:23 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-02-19 07:44:08 +00:00
.proc LBA42
lda $08
2018-01-24 05:37:41 +00:00
cmp path_buf2
2017-10-12 15:04:27 +00:00
bcc LBA4F
2018-01-24 05:37:41 +00:00
dec path_buf2
2017-10-12 15:04:27 +00:00
jmp LBCC9
LBA4F: ldx #$02
2018-01-24 05:37:41 +00:00
ldy path_buf1
2017-10-12 15:04:27 +00:00
iny
2018-01-24 05:37:41 +00:00
LBA55: lda path_buf2,x
sta path_buf1,y
2017-10-12 15:04:27 +00:00
cpx $08
beq LBA64
iny
inx
jmp LBA55
2018-01-24 05:37:41 +00:00
LBA64: sty path_buf1
2017-10-12 15:04:27 +00:00
ldy #$02
ldx $08
inx
2018-01-24 05:37:41 +00:00
LBA6C: lda path_buf2,x
sta path_buf2,y
cpx path_buf2
2017-10-12 15:04:27 +00:00
beq LBA7C
iny
inx
jmp LBA6C
LBA7C: dey
2018-01-24 05:37:41 +00:00
sty path_buf2
2017-10-12 15:04:27 +00:00
jmp LBB05
2018-02-19 07:44:08 +00:00
.endproc
2018-02-02 06:04:23 +00:00
.proc LBA83
params := $6
textptr := $6
textlen := $8
result := $9
2018-02-06 17:31:58 +00:00
copy16 #path_buf1, textptr
2018-01-24 05:37:41 +00:00
lda path_buf1
2018-02-02 06:04:23 +00:00
sta textlen
: MGTK_RELAY_CALL MGTK::TextWidth, params
2018-02-05 03:56:25 +00:00
add16 result, point6::xcoord, result
2018-02-06 18:06:44 +00:00
cmp16 result, $D20D
2017-10-12 15:04:27 +00:00
bcc LBABF
2018-02-02 06:04:23 +00:00
dec textlen
lda textlen
cmp #1
bcs :-
2017-10-12 15:04:27 +00:00
jmp LBC5E
2018-02-02 06:04:23 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-02-19 07:44:08 +00:00
.proc LBABF
inc $08
2018-02-19 22:06:12 +00:00
ldy #0
2017-10-12 15:04:27 +00:00
ldx $08
2018-01-24 05:37:41 +00:00
LBAC5: cpx path_buf1
2017-10-12 15:04:27 +00:00
beq LBAD5
inx
iny
2018-01-24 05:37:41 +00:00
lda path_buf1,x
2018-02-19 22:06:12 +00:00
sta LD3C0+2,y
2017-10-12 15:04:27 +00:00
jmp LBAC5
LBAD5: iny
2018-02-19 22:06:12 +00:00
sty LD3C0+1
ldx #1
ldy LD3C0+1
2018-01-24 05:37:41 +00:00
LBADE: cpx path_buf2
2017-10-12 15:04:27 +00:00
beq LBAEE
inx
iny
2018-01-24 05:37:41 +00:00
lda path_buf2,x
2018-02-19 22:06:12 +00:00
sta LD3C0+1,y
2017-10-12 15:04:27 +00:00
jmp LBADE
2018-02-19 22:06:12 +00:00
LBAEE: sty LD3C0+1
2018-01-15 18:08:50 +00:00
lda LD8EF
2018-02-19 22:06:12 +00:00
sta LD3C0+2
LBAF7: lda LD3C0+1,y
2018-01-24 05:37:41 +00:00
sta path_buf2,y
2017-10-12 15:04:27 +00:00
dey
bpl LBAF7
lda $08
2018-01-24 05:37:41 +00:00
sta path_buf1
2018-02-19 07:44:08 +00:00
;; fall through
.endproc
2018-02-15 05:07:31 +00:00
LBB05: jsr draw_filename_prompt
2017-10-12 15:04:27 +00:00
rts
2018-02-05 04:46:26 +00:00
LBB09: .word 0
2017-10-12 15:04:27 +00:00
LBB0B: sta LBB62
2018-01-24 05:37:41 +00:00
lda path_buf1
2017-10-12 15:04:27 +00:00
clc
2018-01-24 05:37:41 +00:00
adc path_buf2
2017-10-12 15:04:27 +00:00
cmp #$10
bcc LBB1A
rts
2018-02-02 06:04:23 +00:00
.proc LBB1A
point := $6
xcoord := $6
ycoord := $8
lda LBB62
2018-01-24 05:37:41 +00:00
ldx path_buf1
2017-10-12 15:04:27 +00:00
inx
2018-01-24 05:37:41 +00:00
sta path_buf1,x
2018-01-15 18:08:50 +00:00
sta str_1_char+1
2018-02-15 05:07:31 +00:00
jsr measure_path_buf1
2018-01-24 05:37:41 +00:00
inc path_buf1
2018-02-05 04:35:19 +00:00
stax xcoord
2018-02-06 17:31:58 +00:00
copy16 point6::ycoord, ycoord
2018-02-02 06:04:23 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, point
2018-01-31 05:22:13 +00:00
MGTK_RELAY_CALL MGTK::SetPortBits, setportbits_params3
2018-01-15 18:08:50 +00:00
addr_call draw_text1, str_1_char
2018-01-24 05:37:41 +00:00
addr_call draw_text1, path_buf2
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2017-10-12 15:04:27 +00:00
rts
2018-02-02 06:04:23 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2017-12-31 20:32:47 +00:00
LBB62: .byte 0
2018-01-24 05:37:41 +00:00
LBB63: lda path_buf1
2017-10-12 15:04:27 +00:00
bne LBB69
rts
2018-02-02 06:04:23 +00:00
.proc LBB69
point := $6
xcoord := $6
ycoord := $8
dec path_buf1
2018-02-15 05:07:31 +00:00
jsr measure_path_buf1
2018-02-05 04:35:19 +00:00
stax xcoord
2018-02-06 17:31:58 +00:00
copy16 point6::ycoord, ycoord
2018-02-02 06:04:23 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, point
2018-01-31 05:22:13 +00:00
MGTK_RELAY_CALL MGTK::SetPortBits, setportbits_params3
2018-01-24 05:37:41 +00:00
addr_call draw_text1, path_buf2
2018-01-11 05:56:19 +00:00
addr_call draw_text1, str_2_spaces
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2017-10-12 15:04:27 +00:00
rts
2018-02-02 06:04:23 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-01-24 05:37:41 +00:00
LBBA4: lda path_buf1
2017-10-12 15:04:27 +00:00
bne LBBAA
rts
2018-02-02 06:04:23 +00:00
.proc LBBAA
point := $6
xcoord := $6
ycoord := $8
ldx path_buf2
2018-01-24 05:37:41 +00:00
cpx #1
2017-10-12 15:04:27 +00:00
beq LBBBC
2018-01-24 05:37:41 +00:00
LBBB1: lda path_buf2,x
2018-03-05 05:52:38 +00:00
sta path_buf2+1,x
2017-10-12 15:04:27 +00:00
dex
2018-01-24 05:37:41 +00:00
cpx #1
2017-10-12 15:04:27 +00:00
bne LBBB1
2018-01-24 05:37:41 +00:00
LBBBC: ldx path_buf1
lda path_buf1,x
2018-03-05 05:52:38 +00:00
sta path_buf2+2
2018-01-24 05:37:41 +00:00
dec path_buf1
inc path_buf2
2018-02-15 05:07:31 +00:00
jsr measure_path_buf1
2018-02-05 04:35:19 +00:00
stax xcoord
2018-02-06 17:31:58 +00:00
copy16 point6::ycoord, ycoord
2018-02-02 06:04:23 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, point
2018-01-31 05:22:13 +00:00
MGTK_RELAY_CALL MGTK::SetPortBits, setportbits_params3
2018-01-24 05:37:41 +00:00
addr_call draw_text1, path_buf2
2018-01-11 05:56:19 +00:00
addr_call draw_text1, str_2_spaces
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2017-10-12 15:04:27 +00:00
rts
2018-02-02 06:04:23 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-01-24 05:37:41 +00:00
LBC03: lda path_buf2
2017-10-12 15:04:27 +00:00
cmp #$02
bcs LBC0B
rts
2018-01-24 05:37:41 +00:00
LBC0B: ldx path_buf1
2017-10-12 15:04:27 +00:00
inx
2018-03-05 05:52:38 +00:00
lda path_buf2+2
2018-01-24 05:37:41 +00:00
sta path_buf1,x
inc path_buf1
ldx path_buf2
2017-10-12 15:04:27 +00:00
cpx #$03
bcc LBC2D
ldx #$02
2018-03-05 05:52:38 +00:00
LBC21: lda path_buf2+1,x
2018-01-24 05:37:41 +00:00
sta path_buf2,x
2017-10-12 15:04:27 +00:00
inx
2018-01-24 05:37:41 +00:00
cpx path_buf2
2017-10-12 15:04:27 +00:00
bne LBC21
2018-01-24 05:37:41 +00:00
LBC2D: dec path_buf2
2018-02-02 06:04:23 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, point6
2018-01-31 05:22:13 +00:00
MGTK_RELAY_CALL MGTK::SetPortBits, setportbits_params3
2018-01-24 05:37:41 +00:00
addr_call draw_text1, path_buf1
addr_call draw_text1, path_buf2
2018-01-11 05:56:19 +00:00
addr_call draw_text1, str_2_spaces
2018-03-15 07:00:36 +00:00
lda winfo_alert_dialog
jsr set_port_from_window_id
2017-10-12 15:04:27 +00:00
rts
2018-01-24 05:37:41 +00:00
LBC5E: lda path_buf1
2017-10-12 15:04:27 +00:00
bne LBC64
rts
2018-01-24 05:37:41 +00:00
LBC64: ldx path_buf2
2017-10-12 15:04:27 +00:00
cpx #$01
beq LBC79
2018-01-24 05:37:41 +00:00
LBC6B: lda path_buf2,x
2018-02-19 22:06:12 +00:00
sta LD3C0,x
2017-10-12 15:04:27 +00:00
dex
cpx #$01
bne LBC6B
2018-01-24 05:37:41 +00:00
ldx path_buf2
2017-10-12 15:04:27 +00:00
LBC79: dex
2018-02-19 22:06:12 +00:00
stx LD3C0+1
2018-01-24 05:37:41 +00:00
ldx path_buf1
LBC80: lda path_buf1,x
2018-03-05 05:52:38 +00:00
sta path_buf2+1,x
2017-10-12 15:04:27 +00:00
dex
bne LBC80
2018-01-15 18:08:50 +00:00
lda LD8EF
2018-03-05 05:52:38 +00:00
sta path_buf2+1
2018-01-24 05:37:41 +00:00
inc path_buf1
lda path_buf1
sta path_buf2
lda path_buf1
2017-10-12 15:04:27 +00:00
clc
2018-02-19 22:06:12 +00:00
adc LD3C0+1
2017-10-12 15:04:27 +00:00
tay
pha
2018-02-19 22:06:12 +00:00
ldx LD3C0+1
2017-10-12 15:04:27 +00:00
beq LBCB3
2018-02-19 22:06:12 +00:00
LBCA6: lda LD3C0+1,x
2018-01-24 05:37:41 +00:00
sta path_buf2,y
2017-10-12 15:04:27 +00:00
dex
dey
2018-01-24 05:37:41 +00:00
cpy path_buf2
2017-10-12 15:04:27 +00:00
bne LBCA6
LBCB3: pla
2018-01-24 05:37:41 +00:00
sta path_buf2
2017-10-12 15:04:27 +00:00
lda #$00
2018-01-24 05:37:41 +00:00
sta path_buf1
2018-02-02 06:04:23 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, point6
2018-02-15 05:07:31 +00:00
jsr draw_filename_prompt
2017-10-12 15:04:27 +00:00
rts
2018-01-24 05:37:41 +00:00
LBCC9: lda path_buf2
2017-10-12 15:04:27 +00:00
cmp #$02
bcs LBCD1
rts
2018-01-24 05:37:41 +00:00
LBCD1: ldx path_buf2
2017-10-12 15:04:27 +00:00
dex
txa
clc
2018-01-24 05:37:41 +00:00
adc path_buf1
2017-10-12 15:04:27 +00:00
pha
tay
2018-01-24 05:37:41 +00:00
ldx path_buf2
LBCDF: lda path_buf2,x
sta path_buf1,y
2017-10-12 15:04:27 +00:00
dex
dey
2018-01-24 05:37:41 +00:00
cpy path_buf1
2017-10-12 15:04:27 +00:00
bne LBCDF
pla
2018-01-24 05:37:41 +00:00
sta path_buf1
2017-10-12 15:04:27 +00:00
lda #$01
2018-01-24 05:37:41 +00:00
sta path_buf2
2018-02-02 06:04:23 +00:00
MGTK_RELAY_CALL MGTK::MoveTo, point6
2018-02-15 05:07:31 +00:00
jsr draw_filename_prompt
2017-10-12 15:04:27 +00:00
rts
2018-02-05 04:35:19 +00:00
stax $06
2017-10-12 15:04:27 +00:00
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tay
clc
2018-01-24 05:37:41 +00:00
adc path_buf1
2017-10-12 15:04:27 +00:00
pha
tax
2018-01-17 15:41:23 +00:00
LBD11: lda ($06),y
2018-01-24 05:37:41 +00:00
sta path_buf1,x
2017-10-12 15:04:27 +00:00
dey
dex
2018-01-24 05:37:41 +00:00
cpx path_buf1
2017-10-12 15:04:27 +00:00
bne LBD11
pla
2018-01-24 05:37:41 +00:00
sta path_buf1
2017-10-12 15:04:27 +00:00
rts
2018-01-24 05:37:41 +00:00
LBD22: ldx path_buf1
2017-10-12 15:04:27 +00:00
cpx #$00
beq LBD33
2018-01-24 05:37:41 +00:00
dec path_buf1
lda path_buf1,x
2017-10-12 15:04:27 +00:00
cmp #$2F
bne LBD22
LBD33: rts
jsr LBD22
2018-02-15 05:07:31 +00:00
jsr draw_filename_prompt
2017-10-12 15:04:27 +00:00
rts
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-15 05:07:31 +00:00
;;; Compute width of path_buf1, offset point6, return x coord in (A,X)
.proc measure_path_buf1
textwidth_params := $6
2018-02-02 06:04:23 +00:00
textptr := $6
textlen := $8
2018-02-15 05:07:31 +00:00
result := $9
2018-02-02 06:04:23 +00:00
2018-02-15 05:07:31 +00:00
copy16 #path_buf1+1, textptr
2018-01-24 05:37:41 +00:00
lda path_buf1
2018-02-02 06:04:23 +00:00
sta textlen
bne :+
2018-02-05 04:21:34 +00:00
ldax point6::xcoord
2017-10-12 15:04:27 +00:00
rts
2018-02-15 05:07:31 +00:00
: MGTK_RELAY_CALL MGTK::TextWidth, textwidth_params
2018-02-02 06:04:23 +00:00
lda result
2017-10-12 15:04:27 +00:00
clc
2018-02-02 06:04:23 +00:00
adc point6::xcoord
2017-10-12 15:04:27 +00:00
tay
2018-02-02 06:04:23 +00:00
lda result+1
adc point6::xcoord+1
2017-10-12 15:04:27 +00:00
tax
tya
rts
2018-02-02 06:04:23 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-15 05:07:31 +00:00
2017-10-12 15:04:27 +00:00
LBD69: lda #$01
2018-01-24 05:37:41 +00:00
sta path_buf2
2018-01-15 18:08:50 +00:00
lda LD8EF
2018-03-05 05:52:38 +00:00
sta path_buf2+1
2017-10-12 15:04:27 +00:00
rts
LBD75: lda #$00
2018-01-24 05:37:41 +00:00
sta path_buf1
2017-10-12 15:04:27 +00:00
rts
2018-02-19 01:08:11 +00:00
.proc load_aux_from_ptr
target := $20
;; Backup copy of $20
ldx #proc_len
: lda target,x
sta saved_proc_buf,x
2017-10-12 15:04:27 +00:00
dex
2018-02-19 01:08:11 +00:00
bpl :-
;; Overwrite with proc
ldx #proc_len
: lda proc,x
sta target,x
2017-10-12 15:04:27 +00:00
dex
2018-02-19 01:08:11 +00:00
bpl :-
;; Call proc
jsr target
2017-10-12 15:04:27 +00:00
pha
2018-02-19 01:08:11 +00:00
;; Restore copy
ldx #proc_len
: lda saved_proc_buf,x
sta target,x
2017-10-12 15:04:27 +00:00
dex
2018-02-19 01:08:11 +00:00
bpl :-
2017-10-12 15:04:27 +00:00
pla
rts
2018-02-19 01:08:11 +00:00
.proc proc
sta RAMRDON
2017-10-12 15:04:27 +00:00
sta RAMWRTON
2018-02-19 01:08:11 +00:00
ldy #0
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
sta RAMRDOFF
sta RAMWRTOFF
rts
2018-02-19 01:08:11 +00:00
.endproc
proc_len = .sizeof(proc)
2017-10-12 15:04:27 +00:00
2018-02-19 01:08:11 +00:00
saved_proc_buf:
.res 20, 0
.endproc
2018-02-13 16:18:11 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-13 16:18:11 +00:00
;;; Make str_files singlular or plural based on file_count
.proc adjust_str_files_suffix
ldx str_files
lda file_count+1 ; > 255?
bne :+
lda file_count
cmp #2 ; > 2?
bcs :+
lda #' ' ; singlular
2018-01-11 05:36:09 +00:00
sta str_files,x
2017-10-12 15:04:27 +00:00
rts
2018-02-13 16:18:11 +00:00
: lda #'s' ; plural
2018-01-11 05:36:09 +00:00
sta str_files,x
2017-10-12 15:04:27 +00:00
rts
2018-02-13 16:18:11 +00:00
.endproc
2017-10-12 15:04:27 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-13 16:18:11 +00:00
.proc compose_file_count_string
lda file_count
sta value
lda file_count+1
sta value+1
2018-01-11 05:36:09 +00:00
2018-02-13 16:18:11 +00:00
;; Init string with spaces
ldx #7
2018-01-11 05:36:09 +00:00
lda #' '
2018-02-13 16:18:11 +00:00
: sta str_file_count,x
2017-10-12 15:04:27 +00:00
dex
2018-01-11 05:36:09 +00:00
bne :-
2018-02-13 16:18:11 +00:00
lda #0
sta nonzero_flag
ldy #0 ; y = position in string
ldx #0 ; x = which power index is subtracted (*2)
;; For each power of ten
loop: lda #0
sta digit
;; Keep subtracting/incrementing until zero is hit
sloop: cmp16 value, powers,x
bpl subtract
lda digit
bne not_pad
bit nonzero_flag
bmi not_pad
;; Pad with space
lda #' '
bne :+
;; Convert to ASCII
not_pad:
ora #'0'
2017-10-12 15:04:27 +00:00
pha
lda #$80
2018-02-13 16:18:11 +00:00
sta nonzero_flag
2017-10-12 15:04:27 +00:00
pla
2018-02-13 16:18:11 +00:00
;; Place the character, move to next
: sta str_file_count+2,y
2017-10-12 15:04:27 +00:00
iny
inx
inx
2018-02-13 16:18:11 +00:00
cpx #8 ; up to 4 digits (*2) via subtraction
2017-10-12 15:04:27 +00:00
beq LBE4E
2018-02-13 16:18:11 +00:00
jmp loop
2017-10-12 15:04:27 +00:00
2018-02-13 16:18:11 +00:00
subtract:
inc digit
sub16 value, powers,x, value
jmp sloop
2017-10-12 15:04:27 +00:00
2018-02-13 16:18:11 +00:00
LBE4E: lda value ; handle last digit
2018-01-13 03:06:55 +00:00
ora #'0'
2018-02-13 16:18:11 +00:00
sta str_file_count+2,y
2017-10-12 15:04:27 +00:00
rts
2018-02-13 16:18:11 +00:00
powers: .word 10000,1000,100,10
value: .addr 0 ; remaining value as subtraction proceeds
digit: .byte 0 ; current digit being accumulated
nonzero_flag: ; high bit set once a non-zero digit seen
.byte 0
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-13 16:18:11 +00:00
2017-10-12 15:04:27 +00:00
LBE63: ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tay
2018-01-17 15:41:23 +00:00
LBE68: lda ($06),y
2018-01-24 05:52:53 +00:00
sta path_buf0,y
2017-10-12 15:04:27 +00:00
dey
bpl LBE68
2018-02-25 07:19:29 +00:00
addr_call adjust_case, path_buf0
2017-10-12 15:04:27 +00:00
rts
LBE78: ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2017-10-12 15:04:27 +00:00
tay
2018-01-17 15:41:23 +00:00
LBE7D: lda ($06),y
2018-01-24 05:37:41 +00:00
sta path_buf1,y
2017-10-12 15:04:27 +00:00
dey
bpl LBE7D
2018-02-25 07:19:29 +00:00
addr_call adjust_case, path_buf1
2017-10-12 15:04:27 +00:00
rts
2018-01-21 23:37:55 +00:00
LBE8D: jsr set_fill_white
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::LAE86
2017-10-12 15:04:27 +00:00
rts
2018-01-21 23:37:55 +00:00
LBE9A: jsr set_fill_white
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::LAE8E
2017-10-12 15:04:27 +00:00
rts
2018-01-21 23:37:55 +00:00
set_fill_white:
2018-01-30 16:57:36 +00:00
MGTK_RELAY_CALL MGTK::SetPenMode, pencopy
2017-10-12 15:04:27 +00:00
rts
2018-01-22 07:00:34 +00:00
reset_state:
2018-01-30 16:57:36 +00:00
MGTK_RELAY_CALL MGTK::InitPort, grafport3
MGTK_RELAY_CALL MGTK::SetPort, grafport3
2017-10-12 15:04:27 +00:00
rts
2018-01-21 03:33:15 +00:00
.assert * = $BEC4, error, "Segment length mismatch"
PAD_TO $BF00
2018-01-16 05:10:43 +00:00
2018-01-05 04:27:15 +00:00
.endproc ; desktop_main
2018-01-11 06:31:02 +00:00
desktop_main_pop_zp_addrs := desktop_main::pop_zp_addrs
desktop_main_push_zp_addrs := desktop_main::push_zp_addrs
2018-01-06 05:17:13 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-06 05:17:13 +00:00
;;; Segment loaded into MAIN $800-$FFF
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-06 05:17:13 +00:00
;;; Appears to be init sequence - machine identification, etc
.proc desktop_800
2018-01-06 07:33:21 +00:00
2018-01-06 05:17:13 +00:00
.org $800
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-09 05:42:59 +00:00
2018-01-06 05:17:13 +00:00
start:
2018-02-09 05:42:59 +00:00
.proc detect_machine
2018-01-06 05:17:13 +00:00
;; Detect machine type
;; See Apple II Miscellaneous #7: Apple II Family Identification
lda #0
sta iigs_flag
2018-01-13 03:06:55 +00:00
lda ID_BYTE_FBC0 ; 0 = IIc or IIc+
2018-01-06 05:17:13 +00:00
beq :+
sec ; Follow detection protocol
2018-01-13 03:06:55 +00:00
jsr ID_BYTE_FE1F ; RTS on pre-IIgs
2018-01-06 05:17:13 +00:00
bcs :+ ; carry clear = IIgs
lda #$80
sta iigs_flag
2018-01-13 03:06:55 +00:00
: ldx ID_BYTE_FBB3
ldy ID_BYTE_FBC0
2018-01-06 05:17:13 +00:00
cpx #$06 ; Ensure a IIe or later
beq :+
brk ; Otherwise (][, ][+, ///), just crash
: sta ALTZPON
lda LCBANK1
lda LCBANK1
sta SET80COL
2018-02-19 07:44:08 +00:00
2018-02-18 19:33:21 +00:00
stx startdesktop_params::machine
sty startdesktop_params::subid
2018-02-19 07:44:08 +00:00
2018-01-06 05:17:13 +00:00
cpy #0
beq is_iic ; Now identify/store specific machine type.
2018-01-28 16:08:39 +00:00
bit iigs_flag ; (number is used in double-click timer)
2018-01-06 05:17:13 +00:00
bpl is_iie
2018-01-28 16:08:39 +00:00
lda #$FD ; IIgs
2018-01-11 05:10:24 +00:00
sta machine_type
2018-02-09 05:42:59 +00:00
jmp init_video
2018-01-06 05:17:13 +00:00
2018-01-28 16:08:39 +00:00
is_iie: lda #$96 ; IIe
2018-01-11 05:10:24 +00:00
sta machine_type
2018-02-09 05:42:59 +00:00
jmp init_video
2018-01-06 05:17:13 +00:00
2018-01-28 16:08:39 +00:00
is_iic: lda #$FA ; IIc
2018-01-11 05:10:24 +00:00
sta machine_type
2018-02-09 05:42:59 +00:00
jmp init_video
.endproc
2018-01-06 05:17:13 +00:00
iigs_flag: ; High bit set if IIgs detected.
.byte 0
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-09 05:42:59 +00:00
.proc init_video
2018-01-06 05:17:13 +00:00
sta CLR80VID
sta DHIRESON
sta DHIRESOFF
sta DHIRESON ; For good measure???
sta DHIRESOFF
sta SET80VID
2018-02-01 18:00:17 +00:00
sta DHIRESON ; Also AN3_OFF
sta HR2_ON ; For Le Chat Mauve: 560 B&W mode
sta HR3_ON
2018-01-06 05:17:13 +00:00
bit iigs_flag
2018-02-09 05:42:59 +00:00
bpl end
2018-01-06 05:17:13 +00:00
;; Force B&W mode on the IIgs
lda NEWVIDEO
ora #(1<<5) ; B&W
sta NEWVIDEO
2018-02-09 05:42:59 +00:00
;; fall through
end:
.endproc
2018-01-06 05:17:13 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-09 05:42:59 +00:00
.proc detach_ramdisk
;; Make a copy of the original device list
ldx DEVCNT
2018-01-06 05:17:13 +00:00
inx
: lda DEVLST-1,x
sta DESKTOP_DEVICELIST,x
dex
bpl :-
2018-02-09 05:42:59 +00:00
;; Look for /RAM
2018-01-06 05:17:13 +00:00
ldx DEVCNT
: lda DEVLST,x
2018-01-18 17:32:25 +00:00
;; BUG: ProDOS Tech Note #21 says $B3,$B7,$BB or $BF could be /RAM
2018-01-06 05:17:13 +00:00
cmp #(1<<7 | 3<<4 | DT_RAM) ; unit_num for /RAM is Slot 3, Drive 2
beq found_ram
dex
bpl :-
2018-02-09 05:42:59 +00:00
bmi init_mgtk
2018-01-06 05:17:13 +00:00
found_ram:
jsr remove_device
2018-02-09 05:42:59 +00:00
;; fall through
.endproc
2018-01-06 05:17:13 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-09 05:42:59 +00:00
;; Initialize MGTK
.proc init_mgtk
2018-02-18 19:33:21 +00:00
MGTK_RELAY_CALL MGTK::StartDeskTop, startdesktop_params
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::SetMenu, splash_menu
MGTK_RELAY_CALL MGTK::SetZP1, zp_use_flag0
MGTK_RELAY_CALL MGTK::SetCursor, watch_cursor
MGTK_RELAY_CALL MGTK::ShowCursor
2018-02-09 05:42:59 +00:00
;; fall through
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-09 05:42:59 +00:00
;; Populate icon_entries table
.proc populate_icon_entries_table
ptr := $6
jsr desktop_main::push_zp_addrs
2018-02-09 05:42:59 +00:00
copy16 #icon_entries, ptr
ldx #1
2018-02-18 01:15:27 +00:00
loop: cpx #max_icon_count
2018-02-09 05:42:59 +00:00
bne :+
jsr desktop_main::pop_zp_addrs
2018-02-09 05:42:59 +00:00
jmp clear_window_icon_tables
: txa
2018-01-06 05:17:13 +00:00
pha
asl a
tax
2018-02-09 05:42:59 +00:00
copy16 ptr, icon_entry_address_table,x
2018-01-06 05:17:13 +00:00
pla
pha
2018-02-09 05:42:59 +00:00
ldy #0
sta (ptr),y
2018-01-06 05:17:13 +00:00
iny
2018-02-09 05:42:59 +00:00
lda #0
sta (ptr),y
lda ptr
2018-01-06 05:17:13 +00:00
clc
2018-02-08 05:36:53 +00:00
adc #icon_entry_size
2018-02-09 05:42:59 +00:00
sta ptr
bcc :+
inc ptr+1
: pla
2018-01-06 05:17:13 +00:00
tax
inx
2018-02-09 05:42:59 +00:00
jmp loop
.endproc
2018-01-06 05:17:13 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-09 05:42:59 +00:00
;; Zero the window icon tables
.proc clear_window_icon_tables
sta RAMWRTON
2018-01-06 05:17:13 +00:00
lda #$00
tax
2018-02-09 05:42:59 +00:00
loop: sta $1F00,x ; window 8, icon use map
sta $1E00,x ; window 6, 7
sta $1D00,x ; window 4, 5
sta $1C00,x ; window 2, 3
sta $1B00,x ; window 0, 1 (0=desktop)
2018-01-06 05:17:13 +00:00
inx
2018-02-09 05:42:59 +00:00
bne loop
2018-01-06 05:17:13 +00:00
sta RAMWRTOFF
2018-02-08 05:36:53 +00:00
jmp create_trash_icon
2018-02-09 05:42:59 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-06 05:17:13 +00:00
2018-02-08 05:36:53 +00:00
trash_name: PASCAL_STRING " Trash "
2018-02-09 05:42:59 +00:00
.proc create_trash_icon
ptr := $6
2018-02-08 05:36:53 +00:00
lda #0
2018-02-08 05:48:19 +00:00
sta cached_window_id
2018-02-03 03:38:35 +00:00
lda #1
2018-02-08 05:48:19 +00:00
sta cached_window_icon_count
2018-01-15 05:23:48 +00:00
sta LDD9E
2018-02-08 05:36:53 +00:00
jsr DESKTOP_ALLOC_ICON
2018-02-09 05:42:59 +00:00
sta trash_icon_num
2018-02-08 05:48:19 +00:00
sta cached_window_icon_list
2018-02-09 05:42:59 +00:00
jsr desktop_main::icon_entry_lookup
stax ptr
ldy #icon_entry_offset_win_type
lda #icon_entry_type_trash
sta (ptr),y
2018-02-07 05:59:25 +00:00
ldy #icon_entry_offset_iconbits
lda #<desktop_aux::trash_icon
2018-02-09 05:42:59 +00:00
sta (ptr),y
2018-01-06 05:17:13 +00:00
iny
lda #>desktop_aux::trash_icon
2018-02-09 05:42:59 +00:00
sta (ptr),y
2018-01-06 05:17:13 +00:00
iny
2018-02-09 05:42:59 +00:00
ldx #0
: lda trash_name,x
sta (ptr),y
2018-01-06 05:17:13 +00:00
iny
inx
2018-02-08 05:36:53 +00:00
cpx trash_name
2018-02-09 05:42:59 +00:00
bne :-
2018-02-08 05:36:53 +00:00
lda trash_name,x
2018-02-09 05:42:59 +00:00
sta (ptr),y
;; fall through
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-09 05:42:59 +00:00
;; create volume icons???
.proc init_volumes
2018-01-15 04:55:54 +00:00
lda DEVCNT
2018-02-16 20:14:39 +00:00
sta devcnt
inc devcnt
2018-02-09 05:42:59 +00:00
ldx #0
: lda DEVLST,x
and #%10001111 ; drive, not slot, $CnFE status
cmp #%10001011 ; drive 1 ... ??? $CnFE = $Bx ?
2018-02-16 20:14:39 +00:00
beq :+
2018-01-06 05:17:13 +00:00
inx
2018-02-16 20:14:39 +00:00
cpx devcnt
2018-02-09 05:42:59 +00:00
bne :-
2018-02-16 20:14:39 +00:00
jmp done
2018-01-06 05:17:13 +00:00
2018-02-16 20:14:39 +00:00
: lda DEVLST,x
2018-01-06 05:17:13 +00:00
stx L09F8
sta L0A02
ldx #$11
lda L0A02
and #$80
2018-02-16 20:14:39 +00:00
beq :+
2018-01-06 05:17:13 +00:00
ldx #$21
2018-02-16 20:14:39 +00:00
: stx L09B5
2018-01-06 05:17:13 +00:00
lda L0A02
and #$70
lsr a
lsr a
lsr a
clc
adc L09B5
sta L09B5
2018-02-16 20:14:39 +00:00
2018-01-21 22:45:48 +00:00
L09B5 := *+1
lda $BF00 ; self-modified
2018-02-16 20:14:39 +00:00
2018-01-17 15:41:23 +00:00
sta $06+1
2018-01-06 05:17:13 +00:00
lda #$00
2018-01-17 15:41:23 +00:00
sta $06
2018-01-06 05:17:13 +00:00
ldy #$07
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-02-16 20:14:39 +00:00
bne done
2018-01-06 05:17:13 +00:00
ldy #$FB
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-01-06 05:17:13 +00:00
and #$7F
2018-02-16 20:14:39 +00:00
bne done
2018-01-06 05:17:13 +00:00
ldy #$FF
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-01-06 05:17:13 +00:00
clc
adc #$03
2018-01-17 15:41:23 +00:00
sta $06
2018-02-16 20:14:39 +00:00
2018-01-06 05:17:13 +00:00
jsr L09F9
.byte 0
2018-01-21 22:45:48 +00:00
.addr L09FC
2018-02-16 20:14:39 +00:00
bcs done
2018-01-21 22:45:48 +00:00
lda $1F00
2018-02-16 20:14:39 +00:00
cmp #2
bcs done
2018-01-06 05:17:13 +00:00
ldx L09F8
2018-02-16 20:14:39 +00:00
: lda DEVLST+1,x
2018-01-15 04:55:54 +00:00
sta DEVLST,x
2018-01-06 05:17:13 +00:00
inx
2018-02-16 20:14:39 +00:00
cpx devcnt
bne :-
2018-01-15 04:55:54 +00:00
dec DEVCNT
2018-02-16 20:14:39 +00:00
done: jmp load_selector_list
2018-01-06 05:17:13 +00:00
L09F8: .byte 0
2018-02-16 20:14:39 +00:00
2018-01-17 15:41:23 +00:00
L09F9: jmp ($06)
2018-01-06 05:17:13 +00:00
2018-01-21 22:45:48 +00:00
L09FC: .byte $03
2018-01-06 05:17:13 +00:00
.byte 0
.byte 0
.byte $1F
.byte 0
2018-02-16 20:14:39 +00:00
devcnt: .byte 0
2018-01-06 05:17:13 +00:00
L0A02: .byte 0
2018-02-09 05:42:59 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-06 05:17:13 +00:00
2018-02-16 20:14:39 +00:00
.proc load_selector_list
ptr1 := $6
ptr2 := $8
selector_list_io_buf := $1000
selector_list_data_buf := $1400
selector_list_data_len := $400
MGTK_RELAY_CALL MGTK::CheckEvents
MLI_RELAY_CALL GET_PREFIX, desktop_main::get_prefix_params
2018-01-29 16:38:23 +00:00
MGTK_RELAY_CALL MGTK::CheckEvents
2018-02-16 20:14:39 +00:00
lda #0
2018-01-06 05:17:13 +00:00
sta L0A92
2018-02-16 20:14:39 +00:00
jsr read_selector_list
lda selector_list_data_buf
2018-01-06 05:17:13 +00:00
clc
2018-02-16 20:14:39 +00:00
adc selector_list_data_buf+1
2018-01-24 05:52:53 +00:00
sta LD343
2018-02-16 20:14:39 +00:00
lda #0
2018-01-24 05:52:53 +00:00
sta LD343+1
2018-02-16 20:14:39 +00:00
lda selector_list_data_buf
2018-01-06 05:17:13 +00:00
sta L0A93
L0A3B: lda L0A92
cmp L0A93
beq L0A8F
2018-02-16 20:14:39 +00:00
jsr calc_data_addr
stax ptr1
2018-01-06 05:17:13 +00:00
lda L0A92
2018-02-16 20:14:39 +00:00
jsr calc_entry_addr
stax ptr2
ldy #0
lda (ptr1),y
2018-01-06 05:17:13 +00:00
tay
2018-02-16 20:14:39 +00:00
L0A59: lda (ptr1),y
sta (ptr2),y
2018-01-06 05:17:13 +00:00
dey
bpl L0A59
2018-02-16 20:14:39 +00:00
ldy #15
lda (ptr1),y
sta (ptr2),y
2018-01-06 05:17:13 +00:00
lda L0A92
2018-02-16 20:14:39 +00:00
jsr calc_data_str
stax ptr1
2018-01-06 05:17:13 +00:00
lda L0A92
2018-02-16 20:14:39 +00:00
jsr calc_entry_str
stax ptr2
ldy #0
lda (ptr1),y
2018-01-06 05:17:13 +00:00
tay
2018-02-16 20:14:39 +00:00
L0A7F: lda (ptr1),y
sta (ptr2),y
2018-01-06 05:17:13 +00:00
dey
bpl L0A7F
inc L0A92
2018-01-12 09:16:37 +00:00
inc selector_menu
2018-01-06 05:17:13 +00:00
jmp L0A3B
2018-02-10 06:10:11 +00:00
L0A8F: jmp calc_header_item_widths
2018-01-06 05:17:13 +00:00
L0A92: .byte 0
L0A93: .byte 0
.byte 0
2018-02-16 20:14:39 +00:00
;;; --------------------------------------------------
2018-02-09 05:42:59 +00:00
2018-02-16 20:14:39 +00:00
calc_data_addr:
jsr desktop_main::a_times_16
2018-01-06 05:17:13 +00:00
clc
2018-02-16 20:14:39 +00:00
adc #<(selector_list_data_buf+2)
2018-01-06 05:17:13 +00:00
tay
txa
2018-02-16 20:14:39 +00:00
adc #>(selector_list_data_buf+2)
2018-01-06 05:17:13 +00:00
tax
tya
rts
2018-02-16 20:14:39 +00:00
calc_entry_addr:
jsr desktop_main::a_times_16
2018-01-06 05:17:13 +00:00
clc
2018-02-09 05:42:59 +00:00
adc #<run_list_entries
2018-01-06 05:17:13 +00:00
tay
txa
2018-02-09 05:42:59 +00:00
adc #>run_list_entries
2018-01-06 05:17:13 +00:00
tax
tya
rts
2018-02-16 20:14:39 +00:00
calc_entry_str:
jsr desktop_main::a_times_64
2018-01-06 05:17:13 +00:00
clc
2018-02-09 05:42:59 +00:00
adc #<(run_list_entries + $80)
2018-01-06 05:17:13 +00:00
tay
txa
2018-02-09 05:42:59 +00:00
adc #>(run_list_entries + $80)
2018-01-06 05:17:13 +00:00
tax
tya
rts
2018-02-16 20:14:39 +00:00
calc_data_str:
jsr desktop_main::a_times_64
2018-01-06 05:17:13 +00:00
clc
2018-02-16 20:14:39 +00:00
adc #<(selector_list_data_buf+2 + $180)
2018-01-06 05:17:13 +00:00
tay
txa
2018-02-16 20:14:39 +00:00
adc #>(selector_list_data_buf+2 + $180)
2018-01-06 05:17:13 +00:00
tax
tya
rts
2018-02-16 20:14:39 +00:00
;;; --------------------------------------------------
2018-02-26 05:03:58 +00:00
DEFINE_OPEN_PARAMS open_params, str_selector_list, selector_list_io_buf
2018-01-06 05:17:13 +00:00
2018-01-17 20:41:21 +00:00
str_selector_list:
PASCAL_STRING "Selector.List"
2018-01-06 05:17:13 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_READ_PARAMS read_params, selector_list_data_buf, selector_list_data_len
DEFINE_CLOSE_PARAMS close_params
2018-01-14 07:09:51 +00:00
2018-02-16 20:14:39 +00:00
read_selector_list:
MLI_RELAY_CALL OPEN, open_params
2018-01-14 07:24:19 +00:00
lda open_params::ref_num
2018-01-14 07:52:03 +00:00
sta read_params::ref_num
MLI_RELAY_CALL READ, read_params
2018-01-14 07:24:19 +00:00
MLI_RELAY_CALL CLOSE, close_params
2018-01-06 05:17:13 +00:00
rts
2018-02-16 20:14:39 +00:00
.endproc
2018-01-06 05:17:13 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-10 05:24:35 +00:00
2018-02-10 06:10:11 +00:00
.proc calc_header_item_widths
2018-02-10 05:24:35 +00:00
;; Enough space for "123456"
addr_call desktop_main::measure_text1, str_from_int
stax dx
;; Width of "123456 Items"
addr_call desktop_main::measure_text1, str_items
2018-03-05 05:52:38 +00:00
addax dx, width_items_label
2018-02-10 05:24:35 +00:00
;; Width of "123456K in disk"
addr_call desktop_main::measure_text1, str_k_in_disk
2018-03-05 05:52:38 +00:00
addax dx, width_k_in_disk_label
2018-02-10 05:24:35 +00:00
;; Width of "123456K available"
addr_call desktop_main::measure_text1, str_k_available
2018-03-05 05:52:38 +00:00
addax dx, width_k_available_label
2018-02-10 05:24:35 +00:00
add16 width_k_in_disk_label, width_k_available_label, width_right_labels
add16 width_items_label, #5, width_items_label_padded
2018-02-10 06:10:11 +00:00
add16 width_items_label_padded, width_k_in_disk_label, width_left_labels
add16 width_left_labels, #3, width_left_labels
2018-02-09 05:42:59 +00:00
jmp enumerate_desk_accessories
2018-01-06 05:17:13 +00:00
2018-02-10 05:24:35 +00:00
dx: .word 0
.endproc
2018-01-06 05:17:13 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-09 05:42:59 +00:00
.proc enumerate_desk_accessories
MGTK_RELAY_CALL MGTK::CheckEvents ; ???
;; Does the directory exist?
2018-01-14 08:24:50 +00:00
MLI_RELAY_CALL GET_FILE_INFO, get_file_info_params
2018-02-10 05:24:35 +00:00
beq :+
2018-01-06 05:17:13 +00:00
jmp L0D0A
2018-02-28 02:38:18 +00:00
: lda get_file_info_type
2018-02-09 05:42:59 +00:00
cmp #FT_DIRECTORY
2018-01-06 05:17:13 +00:00
beq L0BC3
jmp L0D0A
2018-02-10 05:24:35 +00:00
L0BC3: MLI_RELAY_CALL OPEN, open_params
2018-02-28 02:38:18 +00:00
lda open_ref_num
sta read_ref_num
sta close_ref_num
2018-02-10 05:24:35 +00:00
MLI_RELAY_CALL READ, read_params
2018-01-06 05:17:13 +00:00
lda #$00
sta L0D04
sta L0D05
lda #$01
sta L0D08
lda $1425
and #$7F
sta L0D03
lda #$02
2018-01-12 09:16:37 +00:00
sta apple_menu
2018-01-06 05:17:13 +00:00
lda $1424
sta L0D07
lda $1423
sta L0D06
lda #$2B
2018-01-17 15:41:23 +00:00
sta $06
2018-01-06 05:17:13 +00:00
lda #$14
2018-01-17 15:41:23 +00:00
sta $06+1
2018-01-06 05:17:13 +00:00
L0C0C: ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-01-06 05:17:13 +00:00
and #$0F
bne L0C17
jmp L0C81
L0C17: inc L0D04
ldy #$10
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-01-06 05:17:13 +00:00
cmp #$F1
beq L0C25
jmp L0C81
L0C25: inc L0D05
2018-02-06 17:31:58 +00:00
copy16 #buf, $08
2018-01-06 05:17:13 +00:00
lda #$00
sta L0D09
2018-01-12 09:16:37 +00:00
lda apple_menu
2018-01-06 05:17:13 +00:00
sec
sbc #$02
asl a
rol L0D09
asl a
rol L0D09
asl a
rol L0D09
asl a
rol L0D09
clc
adc $08
sta $08
lda L0D09
2018-01-21 19:47:40 +00:00
adc $08+1
sta $08+1
2018-01-06 05:17:13 +00:00
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-01-06 05:17:13 +00:00
and #$0F
sta ($08),y
tay
2018-01-17 15:41:23 +00:00
L0C60: lda ($06),y
2018-01-06 05:17:13 +00:00
sta ($08),y
dey
bne L0C60
2018-02-09 05:42:59 +00:00
addr_call_indirect desktop_main::capitalize_string, $08
;; Convert periods to spaces
2018-01-06 05:17:13 +00:00
lda ($08),y
tay
L0C71: lda ($08),y
2018-02-09 05:42:59 +00:00
cmp #'.'
2018-01-06 05:17:13 +00:00
bne L0C7B
2018-02-09 05:42:59 +00:00
lda #' '
2018-01-06 05:17:13 +00:00
sta ($08),y
L0C7B: dey
2018-02-09 05:42:59 +00:00
2018-01-06 05:17:13 +00:00
bne L0C71
2018-01-12 09:16:37 +00:00
inc apple_menu
2018-01-06 05:17:13 +00:00
L0C81: lda L0D05
cmp #$08
bcc L0C8B
jmp L0CCB
L0C8B: lda L0D04
cmp L0D03
bne L0C96
jmp L0CCB
L0C96: inc L0D08
lda L0D08
cmp L0D07
bne L0CBA
2018-02-10 05:24:35 +00:00
MLI_RELAY_CALL READ, read_params
2018-02-06 17:31:58 +00:00
copy16 #$1404, $06
2018-01-06 05:17:13 +00:00
lda #$00
sta L0D08
jmp L0C0C
2018-02-05 04:04:14 +00:00
L0CBA: add16_8 $06, L0D06, $06
2018-01-06 05:17:13 +00:00
jmp L0C0C
2018-02-10 05:24:35 +00:00
L0CCB: MLI_RELAY_CALL CLOSE, close_params
2018-01-06 05:17:13 +00:00
jmp L0D0A
2018-02-26 05:03:58 +00:00
DEFINE_OPEN_PARAMS open_params, str_desk_acc, $1000
2018-02-28 02:38:18 +00:00
open_ref_num := open_params::ref_num
2018-01-14 07:24:19 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_READ_PARAMS read_params, $1400, $200
2018-02-28 02:38:18 +00:00
read_ref_num := read_params::ref_num
2018-01-14 07:52:03 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_GET_FILE_INFO_PARAMS get_file_info_params, str_desk_acc
2018-02-28 02:38:18 +00:00
get_file_info_type := get_file_info_params::file_type
2018-01-14 08:24:50 +00:00
2018-01-06 05:17:13 +00:00
.byte 0
2018-01-14 07:24:19 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_CLOSE_PARAMS close_params
2018-02-28 02:38:18 +00:00
close_ref_num := close_params::ref_num
2018-01-06 05:17:13 +00:00
2018-01-17 20:41:21 +00:00
str_desk_acc:
2018-01-06 05:17:13 +00:00
PASCAL_STRING "Desk.acc"
L0D03: .byte 0
L0D04: .byte 0
L0D05: .byte 0
L0D06: .byte 0
L0D07: .byte 0
L0D08: .byte 0
L0D09: .byte 0
2018-02-09 05:42:59 +00:00
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-06 05:17:13 +00:00
2018-02-16 20:14:39 +00:00
.proc L0D0A
2018-02-16 21:27:31 +00:00
ldy #0
sty desktop_main::pending_alert
2018-01-06 05:17:13 +00:00
sty L0E33
L0D12: lda L0E33
asl a
tay
2018-02-06 17:31:58 +00:00
copy16 $DB00,y, $08
2018-01-06 05:17:13 +00:00
ldy L0E33
2018-01-15 04:55:54 +00:00
lda DEVLST,y
2018-01-06 05:17:13 +00:00
pha
txa
pha
tya
pha
2018-02-08 05:48:19 +00:00
inc cached_window_icon_count
2018-01-15 05:23:48 +00:00
inc LDD9E
2018-01-15 04:55:54 +00:00
lda DEVLST,y
jsr desktop_main::get_device_info
2018-01-06 05:17:13 +00:00
sta L0E34
2018-01-29 16:38:23 +00:00
MGTK_RELAY_CALL MGTK::CheckEvents
2018-01-06 05:17:13 +00:00
pla
tay
pla
tax
pla
pha
lda L0E34
cmp #$28
bne L0D64
ldy L0E33
2018-01-15 04:55:54 +00:00
lda DEVLST,y
2018-01-06 05:17:13 +00:00
and #$0F
beq L0D6D
ldx L0E33
jsr remove_device
jmp L0E25
L0D64: cmp #$57
bne L0D6D
2018-02-16 21:27:31 +00:00
lda #$F9 ; "... 2 volumes with the same name..."
sta desktop_main::pending_alert
2018-01-06 05:17:13 +00:00
L0D6D: pla
pha
and #$0F
sta L0E32
cmp #$00
bne L0D7F
2018-01-12 09:16:37 +00:00
addr_jump L0DAD, str_slot_drive
2018-01-06 05:17:13 +00:00
L0D7F: cmp #$0B
beq L0DA9
cmp #$04
bne L0DC2
pla
pha
2018-01-21 22:35:37 +00:00
and #$70 ; Compute $CnFB
2018-01-06 05:17:13 +00:00
lsr a
lsr a
lsr a
lsr a
ora #$C0
sta L0D96
2018-01-21 22:35:37 +00:00
L0D96 := *+2
lda $C7FB ; self-modified
2018-01-06 05:17:13 +00:00
and #$01
bne L0DA2
2018-01-12 09:16:37 +00:00
addr_jump L0DAD, str_profile_slot_x
2018-01-06 05:17:13 +00:00
2018-01-12 09:16:37 +00:00
L0DA2: addr_jump L0DAD, str_ramcard_slot_x
2018-01-06 05:17:13 +00:00
2018-02-05 04:21:34 +00:00
L0DA9: ldax #str_unidisk_xy
2018-02-05 04:35:19 +00:00
L0DAD: stax $06
2018-01-06 05:17:13 +00:00
ldy #$00
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-01-06 05:17:13 +00:00
sta L0DBE
L0DB8: iny
2018-01-17 15:41:23 +00:00
lda ($06),y
2018-01-06 05:17:13 +00:00
sta ($08),y
2018-01-21 22:45:48 +00:00
L0DBE := *+1
cpy #0
2018-01-06 05:17:13 +00:00
bne L0DB8
tay
L0DC2: pla
pha
and #$70
lsr a
lsr a
lsr a
lsr a
ora #$30
tax
lda L0E32
cmp #$04
bne L0DF0
pla
pha
2018-01-21 22:35:37 +00:00
and #$70 ; compute $CnFB
2018-01-06 05:17:13 +00:00
lsr a
lsr a
lsr a
lsr a
ora #$C0
sta L0DE3
2018-01-21 22:35:37 +00:00
L0DE3 := *+2
lda $C7FB ; self-modified
2018-01-06 05:17:13 +00:00
and #$01
bne L0DEC
ldy #$0E
bne L0DFA
L0DEC: ldy #$0E
bne L0DFA
L0DF0: cmp #$0B
bne L0DF8
ldy #$0F
bne L0DFA
L0DF8: ldy #$06
L0DFA: txa
sta ($08),y
lda L0E32
and #$0F
cmp #$04
beq L0E21
pla
pha
rol a
lda #$00
adc #$01
ora #$30
pha
lda L0E32
and #$0F
bne L0E1C
ldy #$10
pla
bne L0E1F
L0E1C: ldy #$11
pla
L0E1F: sta ($08),y
L0E21: pla
inc L0E33
L0E25: lda L0E33
2018-01-15 04:55:54 +00:00
cmp DEVCNT
2018-01-06 05:17:13 +00:00
beq L0E2F
2018-02-12 07:54:09 +00:00
bcs populate_startup_menu
2018-01-06 05:17:13 +00:00
L0E2F: jmp L0D12
L0E32: .byte 0
L0E33: .byte 0
L0E34: .byte 0
2018-02-16 20:14:39 +00:00
.endproc
2018-01-06 05:17:13 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-09 05:42:59 +00:00
2018-01-06 05:17:13 +00:00
;; Remove device num in X from devices list
.proc remove_device
dex
L0E36: inx
lda DEVLST+1,x
sta DEVLST,x
2018-02-15 16:08:59 +00:00
lda devlst_copy+1,x
sta devlst_copy,x
2018-01-06 05:17:13 +00:00
cpx DEVCNT
bne L0E36
dec DEVCNT
rts
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-09 05:42:59 +00:00
2018-02-12 07:54:09 +00:00
.proc populate_startup_menu
lda DEVCNT
2018-01-06 05:17:13 +00:00
clc
2018-02-12 07:54:09 +00:00
adc #3
2018-02-19 22:06:12 +00:00
sta LE270
2018-02-12 07:54:09 +00:00
lda #0
sta slot
2018-01-06 05:17:13 +00:00
tay
tax
2018-02-12 07:54:09 +00:00
loop: lda DEVLST,y
and #$70 ; mask off slot
beq done
2018-01-06 05:17:13 +00:00
lsr a
lsr a
lsr a
lsr a
2018-02-12 07:54:09 +00:00
cmp slot ; same as last?
beq :+
cmp #2 ; ???
bne prepare
: cpy DEVCNT
beq done
2018-01-06 05:17:13 +00:00
iny
2018-02-12 07:54:09 +00:00
jmp loop
2018-01-06 05:17:13 +00:00
2018-02-12 07:54:09 +00:00
prepare:
sta slot
2018-01-06 05:17:13 +00:00
clc
2018-02-12 07:54:09 +00:00
adc #'0'
sta char
txa ; pointer to nth sNN string
2018-01-06 05:17:13 +00:00
pha
asl a
tax
2018-02-12 07:54:09 +00:00
copy16 slot_string_table,x, item_ptr
ldx startup_menu_item_1 ; replace second-from-last char
2018-01-06 05:17:13 +00:00
dex
2018-02-12 07:54:09 +00:00
lda char
item_ptr := *+1
2018-01-17 03:36:54 +00:00
sta dummy1234,x
2018-02-12 07:54:09 +00:00
2018-01-06 05:17:13 +00:00
pla
tax
inx
cpy DEVCNT
2018-02-12 07:54:09 +00:00
beq done
2018-01-06 05:17:13 +00:00
iny
2018-02-12 07:54:09 +00:00
jmp loop
2018-01-06 05:17:13 +00:00
2018-02-12 07:54:09 +00:00
done: stx startup_menu
2018-01-06 05:17:13 +00:00
jmp L0EE1
2018-02-12 07:54:09 +00:00
char: .byte 0
slot: .byte 0
2018-01-14 08:24:50 +00:00
2018-02-12 07:54:09 +00:00
slot_string_table:
.addr startup_menu_item_1
.addr startup_menu_item_2
.addr startup_menu_item_3
.addr startup_menu_item_4
.addr startup_menu_item_5
.addr startup_menu_item_6
.addr startup_menu_item_7
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-01-14 08:24:50 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_GET_FILE_INFO_PARAMS get_file_info_params2, desktop_main::sys_start_path
2018-01-06 05:17:13 +00:00
.byte 0
2018-01-14 08:01:19 +00:00
2018-02-26 05:03:58 +00:00
DEFINE_GET_PREFIX_PARAMS get_prefix_params, desktop_main::sys_start_path
2018-01-14 07:09:51 +00:00
2018-02-13 04:41:17 +00:00
str_system_start: PASCAL_STRING "System/Start"
2018-01-14 07:09:51 +00:00
2018-02-12 07:54:09 +00:00
.proc L0EE1
2018-02-19 07:44:08 +00:00
lda #0
2018-02-13 04:41:17 +00:00
sta desktop_main::sys_start_flag
jsr desktop_main::get_LD3FF
2018-01-06 05:17:13 +00:00
cmp #$80
beq L0EFE
2018-01-14 08:01:19 +00:00
MLI_RELAY_CALL GET_PREFIX, get_prefix_params
2018-02-13 04:41:17 +00:00
bne config_toolkit
dec desktop_main::sys_start_path
2018-01-06 05:17:13 +00:00
jmp L0F05
2018-02-13 04:41:17 +00:00
L0EFE: addr_call desktop_main::copy_LD3AD_str, desktop_main::sys_start_path
L0F05: ldx desktop_main::sys_start_path
;; Find last /
floop: lda desktop_main::sys_start_path,x
2018-01-24 04:11:38 +00:00
cmp #'/'
2018-02-13 04:41:17 +00:00
beq :+
2018-01-06 05:17:13 +00:00
dex
2018-02-13 04:41:17 +00:00
bne floop
;; Replace last path segment with "System/Start"
: ldy #0
cloop: inx
2018-01-06 05:17:13 +00:00
iny
2018-02-13 04:41:17 +00:00
lda str_system_start,y
sta desktop_main::sys_start_path,x
cpy str_system_start
bne cloop
stx desktop_main::sys_start_path
;; Does it point at anything? If so, set flag.
2018-01-14 08:24:50 +00:00
MLI_RELAY_CALL GET_FILE_INFO, get_file_info_params2
2018-02-13 04:41:17 +00:00
bne config_toolkit
2018-01-06 05:17:13 +00:00
lda #$80
2018-02-13 04:41:17 +00:00
sta desktop_main::sys_start_flag
;; Final MGTK configuration
config_toolkit:
MGTK_RELAY_CALL MGTK::CheckEvents
2018-01-29 05:18:00 +00:00
MGTK_RELAY_CALL MGTK::SetMenu, desktop_aux::desktop_menu
MGTK_RELAY_CALL MGTK::SetCursor, pointer_cursor
2018-02-19 07:44:08 +00:00
lda #0
2018-03-05 05:33:56 +00:00
sta active_window_id
jsr desktop_main::L66A2
2018-02-12 01:21:37 +00:00
jsr desktop_main::disable_eject_menu_item
jsr desktop_main::disable_file_menu_items
2018-01-29 05:18:00 +00:00
jmp MGTK::MLI
2018-02-12 07:54:09 +00:00
.endproc
2018-01-06 05:17:13 +00:00
2018-01-21 03:33:15 +00:00
.assert * = $0F60, error, "Segment length mismatch"
PAD_TO $1000
2018-01-21 18:44:26 +00:00
2018-01-06 05:17:13 +00:00
.endproc ; desktop_800