mirror of
https://github.com/mi57730/a2d.git
synced 2025-02-09 04:30:43 +00:00
lc defs for overlays, macros for exit
This commit is contained in:
parent
d39ca6d01a
commit
2e3e6e6a4c
@ -7911,7 +7911,7 @@ L511E: sta cached_window_icon_count
|
||||
jsr get_port2
|
||||
jsr offset_grafport2_and_set
|
||||
jsr set_penmode_copy
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, grafport2::cliprect::x1
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, grafport2::cliprect
|
||||
lda active_window_id
|
||||
jsr L7D5D
|
||||
stax L51EB
|
||||
@ -7996,7 +7996,7 @@ L51EF: .byte 0
|
||||
jsr get_port2
|
||||
jsr offset_grafport2_and_set
|
||||
jsr set_penmode_copy
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, grafport2::cliprect::x1
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, grafport2::cliprect
|
||||
lda active_window_id
|
||||
jsr L7D5D
|
||||
stax L5263
|
||||
@ -9583,7 +9583,7 @@ L5E8F: lda active_window_id
|
||||
sta getwinport_params2::window_id
|
||||
jsr get_set_port2
|
||||
jsr set_penmode_copy
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, grafport2::cliprect::x1
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, grafport2::cliprect
|
||||
ldx active_window_id
|
||||
dex
|
||||
lda LEC26,x
|
||||
@ -10214,7 +10214,7 @@ L650D: .word 0
|
||||
bit L5B1B
|
||||
bmi :+
|
||||
jsr cached_icons_screen_to_window
|
||||
: MGTK_RELAY_CALL MGTK::PaintRect, grafport2::cliprect::x1
|
||||
: MGTK_RELAY_CALL MGTK::PaintRect, grafport2::cliprect
|
||||
jsr reset_grafport3
|
||||
jmp L6C19
|
||||
.endproc
|
||||
@ -17358,8 +17358,8 @@ dialog_param_addr:
|
||||
jsr set_port_from_window_id
|
||||
lda winfoF
|
||||
sta event_params
|
||||
MGTK_RELAY_CALL MGTK::ScreenToWindow, event_params
|
||||
MGTK_RELAY_CALL MGTK::MoveTo, $D20D
|
||||
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
|
||||
MGTK_RELAY_CALL MGTK::MoveTo, screentowindow_windowx
|
||||
MGTK_RELAY_CALL MGTK::InRect, rect1
|
||||
cmp #MGTK::inrect_inside
|
||||
bne out
|
||||
@ -17397,8 +17397,8 @@ content:
|
||||
jsr set_port_from_window_id
|
||||
lda winfoF
|
||||
sta event_params
|
||||
MGTK_RELAY_CALL MGTK::ScreenToWindow, event_params
|
||||
MGTK_RELAY_CALL MGTK::MoveTo, $D20D
|
||||
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
|
||||
MGTK_RELAY_CALL MGTK::MoveTo, screentowindow_windowx
|
||||
bit LD8E7
|
||||
bvc :+
|
||||
jmp check_button_yes
|
||||
@ -19193,8 +19193,8 @@ loop: MGTK_RELAY_CALL MGTK::GetEvent, event_params
|
||||
beq exit
|
||||
lda winfoF
|
||||
sta event_params
|
||||
MGTK_RELAY_CALL MGTK::ScreenToWindow, event_params
|
||||
MGTK_RELAY_CALL MGTK::MoveTo, $D20D
|
||||
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
|
||||
MGTK_RELAY_CALL MGTK::MoveTo, screentowindow_windowx
|
||||
jsr test_proc
|
||||
cmp #MGTK::inrect_inside
|
||||
beq inside
|
||||
@ -19291,8 +19291,8 @@ done: rts
|
||||
;;; ==================================================
|
||||
|
||||
.proc LB9B8
|
||||
MGTK_RELAY_CALL MGTK::ScreenToWindow, event_params
|
||||
MGTK_RELAY_CALL MGTK::MoveTo, $D20D
|
||||
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
|
||||
MGTK_RELAY_CALL MGTK::MoveTo, screentowindow_windowx
|
||||
MGTK_RELAY_CALL MGTK::InRect, rect1
|
||||
cmp #MGTK::inrect_inside
|
||||
beq :+
|
||||
|
82
desktop/inc/desktoplc.inc
Normal file
82
desktop/inc/desktoplc.inc
Normal file
@ -0,0 +1,82 @@
|
||||
;;; ============================================================
|
||||
;;; Re-used param space for events/queries
|
||||
|
||||
pencopy := $D200
|
||||
penOR := $D201
|
||||
penXOR := $D202
|
||||
penBIC := $D203
|
||||
notpencopy := $D204
|
||||
notpenOR := $D205
|
||||
notpenXOR := $D206
|
||||
notpenBIC := $D207
|
||||
|
||||
|
||||
event_params := $D208
|
||||
event_kind := event_params + 0
|
||||
;; if kind is key_down
|
||||
event_key := event_params + 1
|
||||
event_modifiers := event_params + 2
|
||||
;; if kind is no_event, button_down/up, drag, or apple_key:
|
||||
event_coords := event_params + 1
|
||||
event_xcoord := event_params + 1
|
||||
event_ycoord := event_params + 3
|
||||
;; if kind is update:
|
||||
event_window_id := event_params + 1
|
||||
|
||||
screentowindow_params := event_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
|
||||
.assert screentowindow_screenx = event_xcoord, error, "param mismatch"
|
||||
.assert screentowindow_screeny = event_ycoord, error, "param mismatch"
|
||||
|
||||
findwindow_params := event_params + 1 ; offset to x/y overlap event_params x/y
|
||||
findwindow_mousex := findwindow_params + 0
|
||||
findwindow_mousey := findwindow_params + 2
|
||||
findwindow_which_area := findwindow_params + 4
|
||||
findwindow_window_id := findwindow_params + 5
|
||||
.assert findwindow_mousex = event_xcoord, error, "param mismatch"
|
||||
.assert findwindow_mousey = event_ycoord, error, "param mismatch"
|
||||
|
||||
findcontrol_params := event_params + 1 ; offset to x/y overlap event_params x/y
|
||||
findcontrol_mousex := findcontrol_params + 0
|
||||
findcontrol_mousey := findcontrol_params + 2
|
||||
findcontrol_which_ctl := findcontrol_params + 4
|
||||
findcontrol_which_part := findcontrol_params + 5
|
||||
.assert findcontrol_mousex = event_xcoord, error, "param mismatch"
|
||||
.assert findcontrol_mousey = event_ycoord, error, "param mismatch"
|
||||
|
||||
activatectl_params := event_params
|
||||
activatectl_which_ctl := activatectl_params
|
||||
activatectl_activate := activatectl_params + 1
|
||||
|
||||
trackthumb_params := event_params
|
||||
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
|
||||
.assert trackthumb_mousex = event_xcoord, error, "param mismatch"
|
||||
.assert trackthumb_mousey = event_ycoord, error, "param mismatch"
|
||||
|
||||
updatethumb_params := event_params
|
||||
updatethumb_which_ctl := updatethumb_params
|
||||
updatethumb_thumbpos := updatethumb_params + 1
|
||||
updatethumb_stash := updatethumb_params + 5 ; not part of struct
|
||||
|
||||
;;; ==================================================
|
||||
;;; Resources
|
||||
|
||||
winfo12 := $D5B7
|
||||
winfo15 := $D5F1
|
||||
|
||||
path_buf0 := $D402
|
||||
path_buf1 := $D443
|
||||
path_buf2 := $D484
|
||||
|
||||
grafport3 := $D239
|
||||
|
||||
dialog_rect1 := $DA9E
|
||||
dialog_rect2 := $DAAA
|
138
desktop/mgtk.s
138
desktop/mgtk.s
@ -14,6 +14,9 @@
|
||||
.proc mgtk
|
||||
.org $4000
|
||||
|
||||
screen_width := 560
|
||||
screen_height := 192
|
||||
|
||||
;;; ==================================================
|
||||
|
||||
;;; ZP Usage
|
||||
@ -228,6 +231,13 @@ exit_with_a:
|
||||
ldy #$FF
|
||||
rts2: rts
|
||||
|
||||
;; TODO: Macro for exit_with_a
|
||||
|
||||
.macro exit_call arg
|
||||
lda #arg
|
||||
jmp exit_with_a
|
||||
.endmacro
|
||||
|
||||
;;; ==================================================
|
||||
;;; Copy port params (36 bytes) to/from active port addr
|
||||
|
||||
@ -1581,8 +1591,7 @@ L5043: jsr L50A9
|
||||
cmp bottom
|
||||
bcc :+
|
||||
bne fail
|
||||
: lda #$80 ; success!
|
||||
jmp exit_with_a
|
||||
: exit_call $80 ; success!
|
||||
|
||||
fail: rts
|
||||
.endproc
|
||||
@ -1702,8 +1711,7 @@ L514C: sec
|
||||
bmi L5163
|
||||
rts
|
||||
|
||||
L5163: lda #$81
|
||||
jmp exit_with_a
|
||||
L5163: exit_call $81
|
||||
|
||||
;;; ==================================================
|
||||
|
||||
@ -2022,8 +2030,7 @@ L5390: jsr L5354
|
||||
bmi L5389
|
||||
jmp L546F
|
||||
|
||||
L5398: lda #$82
|
||||
jmp exit_with_a
|
||||
L5398: exit_call $82
|
||||
|
||||
L539D: ldy #1
|
||||
sty $AF
|
||||
@ -2743,8 +2750,7 @@ loop: sta glyph_row_lo,y
|
||||
bne loop
|
||||
rts
|
||||
|
||||
end: lda #$83
|
||||
jmp exit_with_a
|
||||
end: exit_call $83
|
||||
.endproc
|
||||
|
||||
glyph_row_lo:
|
||||
@ -3632,7 +3638,7 @@ stack_ptr_stash:
|
||||
viewloc: .word 0, 0
|
||||
mapbits: .addr MGTK::screen_mapbits
|
||||
mapwidth: .word MGTK::screen_mapwidth
|
||||
maprect: .word 0, 0, 560-1, 192-1
|
||||
maprect: .word 0, 0, screen_width-1, screen_height-1
|
||||
penpattern: .res 8, $FF
|
||||
colormasks: .byte MGTK::colormask_and, MGTK::colormask_or
|
||||
penloc: .word 0, 0
|
||||
@ -3649,7 +3655,7 @@ textfont: .addr 0
|
||||
viewloc: .word 0, 0
|
||||
mapbits: .addr MGTK::screen_mapbits
|
||||
mapwidth: .word MGTK::screen_mapwidth
|
||||
maprect: .word 0, 0, 560-1, 192-1
|
||||
maprect: .word 0, 0, screen_width-1, screen_height-1
|
||||
penpattern: .res 8, $FF
|
||||
colormasks: .byte MGTK::colormask_and, MGTK::colormask_or
|
||||
penloc: .word 0, 0
|
||||
@ -4194,16 +4200,14 @@ L63D1: ldx L6338
|
||||
bpl L63F6
|
||||
cpx #$00
|
||||
bne L63E5
|
||||
lda #$92
|
||||
jmp exit_with_a
|
||||
exit_call $92
|
||||
|
||||
L63E5: lda L6338
|
||||
and #$7F
|
||||
beq L63F6
|
||||
cpx L6338
|
||||
beq L63F6
|
||||
lda #$91
|
||||
jmp exit_with_a
|
||||
exit_call $91
|
||||
|
||||
L63F6: stx L6338
|
||||
lda #$80
|
||||
@ -4268,16 +4272,14 @@ L6486: lda #$80
|
||||
sta L6339
|
||||
L648B: rts
|
||||
|
||||
L648C: lda #$93
|
||||
jmp exit_with_a
|
||||
L648C: exit_call $93
|
||||
|
||||
L6491:
|
||||
lda L6337
|
||||
beq L649F
|
||||
cmp #$01
|
||||
beq L64A4
|
||||
lda #$90
|
||||
jmp exit_with_a
|
||||
exit_call $90
|
||||
|
||||
L649F: lda #$80
|
||||
sta L6337
|
||||
@ -4342,8 +4344,7 @@ L64FF: lda #$00
|
||||
sta L6538
|
||||
rts
|
||||
|
||||
L6508: lda #$94
|
||||
jmp exit_with_a
|
||||
L6508: exit_call $94
|
||||
|
||||
L650D: lda L6522
|
||||
beq L651D
|
||||
@ -4423,8 +4424,8 @@ L6594: .byte $0D,$00,$00,$20,$80,$00
|
||||
.proc fill_rect_params
|
||||
left: .word 0
|
||||
top: .word 0
|
||||
right: .word 559
|
||||
bottom: .word 191
|
||||
right: .word screen_width-1
|
||||
bottom: .word screen_height-1
|
||||
.endproc
|
||||
fill_rect_top := fill_rect_params::top
|
||||
|
||||
@ -4461,8 +4462,7 @@ checkerboard_pattern:
|
||||
ldy #2
|
||||
jmp store_xa_at_y
|
||||
|
||||
fail: lda #$95
|
||||
jmp exit_with_a
|
||||
fail: exit_call $95
|
||||
|
||||
mouse_state_addr:
|
||||
.addr mouse_state
|
||||
@ -4580,8 +4580,7 @@ modifiers := * + 3
|
||||
.proc CheckEventsImpl
|
||||
bit L6339
|
||||
bpl L666D
|
||||
lda #$97
|
||||
jmp exit_with_a
|
||||
exit_call $97
|
||||
|
||||
L666D:
|
||||
sec ; called from interrupt handler
|
||||
@ -5111,8 +5110,7 @@ L6A3C: lda #$00
|
||||
lda L633C
|
||||
sbc L633E
|
||||
bpl L6A5B
|
||||
lda #$9C
|
||||
jmp exit_with_a
|
||||
exit_call $9C
|
||||
|
||||
L6A5B: rts
|
||||
|
||||
@ -5136,8 +5134,7 @@ L6A5C: ldx $A7
|
||||
|
||||
L6A89: jsr L6A94
|
||||
bne L6A93
|
||||
lda #$9A
|
||||
jmp exit_with_a
|
||||
exit_call $9A
|
||||
|
||||
L6A93: rts
|
||||
|
||||
@ -5289,8 +5286,7 @@ L6B9E: rts
|
||||
|
||||
L6B9F: jsr L6B96
|
||||
bne L6B9E
|
||||
lda #$9B
|
||||
jmp exit_with_a
|
||||
exit_call $9B
|
||||
|
||||
;;; ==================================================
|
||||
;;; DisableItem
|
||||
@ -5944,8 +5940,7 @@ end: rts
|
||||
jsr window_by_id
|
||||
beq nope
|
||||
rts
|
||||
nope: lda #$9F
|
||||
jmp exit_with_a
|
||||
nope: exit_call $9F
|
||||
.endproc
|
||||
|
||||
L707F: MGTK_CALL MGTK::FrameRect, $C7
|
||||
@ -6434,14 +6429,12 @@ OpenWindowImpl:
|
||||
ldy #$00
|
||||
lda ($A9),y
|
||||
bne L748E
|
||||
lda #$9E
|
||||
jmp exit_with_a
|
||||
exit_call $9E
|
||||
|
||||
L748E: sta $82
|
||||
jsr window_by_id
|
||||
beq L749A
|
||||
lda #$9D
|
||||
jmp exit_with_a
|
||||
exit_call $9D
|
||||
|
||||
L749A: lda params_addr
|
||||
sta $A9
|
||||
@ -6554,8 +6547,7 @@ L750C: .res 38,0
|
||||
;; fall through
|
||||
.endproc
|
||||
|
||||
L7585: lda #$A3
|
||||
jmp exit_with_a
|
||||
L7585: exit_call $A3
|
||||
|
||||
;;; ==================================================
|
||||
;;; EndUpdate
|
||||
@ -7313,8 +7305,7 @@ FindControlImpl:
|
||||
jsr L653F
|
||||
jsr top_window
|
||||
bne L7ACE
|
||||
lda #$A0
|
||||
jmp exit_with_a
|
||||
exit_call $A0
|
||||
|
||||
L7ACE: bit $B0
|
||||
bpl L7B15
|
||||
@ -7413,13 +7404,11 @@ L7B81: cmp #$02
|
||||
lda #$00
|
||||
sta $82
|
||||
beq L7B90
|
||||
L7B8B: lda #$A4
|
||||
jmp exit_with_a
|
||||
L7B8B: exit_call $A4
|
||||
|
||||
L7B90: jsr top_window
|
||||
bne L7B9A
|
||||
lda #$A0
|
||||
jmp exit_with_a
|
||||
exit_call $A0
|
||||
|
||||
L7B9A: ldy #$06
|
||||
bit $82
|
||||
@ -7447,8 +7436,7 @@ L7BB6: cmp #$02
|
||||
lda #$00
|
||||
sta $82
|
||||
beq L7BC5
|
||||
L7BC0: lda #$A4
|
||||
jmp exit_with_a
|
||||
L7BC0: exit_call $A4
|
||||
|
||||
L7BC5: lda $82
|
||||
sta $8C
|
||||
@ -7460,8 +7448,7 @@ L7BCB: lda $83,x
|
||||
bpl L7BCB
|
||||
jsr top_window
|
||||
bne L7BE0
|
||||
lda #$A0
|
||||
jmp exit_with_a
|
||||
exit_call $A0
|
||||
|
||||
L7BE0: jsr L7A73
|
||||
jsr L653F
|
||||
@ -7619,37 +7606,39 @@ L7D1D: sta L7CB6
|
||||
|
||||
;;; 3 bytes of params, copied to $8C
|
||||
|
||||
UpdateThumbImpl:
|
||||
.proc UpdateThumbImpl
|
||||
lda $8C
|
||||
cmp #$01
|
||||
bne L7D30
|
||||
cmp #MGTK::ctl_vertical_scroll_bar
|
||||
bne :+
|
||||
lda #$80
|
||||
sta $8C
|
||||
bne L7D3F
|
||||
L7D30: cmp #$02
|
||||
bne L7D3A
|
||||
bne check_win
|
||||
|
||||
: cmp #MGTK::ctl_horizontal_scroll_bar
|
||||
bne bad_ctl
|
||||
lda #$00
|
||||
sta $8C
|
||||
beq L7D3F
|
||||
L7D3A: lda #$A4
|
||||
jmp exit_with_a
|
||||
beq check_win
|
||||
|
||||
L7D3F: jsr top_window
|
||||
bne L7D49
|
||||
lda #$A0
|
||||
jmp exit_with_a
|
||||
bad_ctl:
|
||||
exit_call $A4
|
||||
|
||||
L7D49: ldy #$07
|
||||
check_win:
|
||||
jsr top_window
|
||||
bne :+
|
||||
exit_call $A0
|
||||
|
||||
: ldy #$07
|
||||
bit $8C
|
||||
bpl L7D51
|
||||
bpl :+
|
||||
ldy #$09
|
||||
L7D51: lda $8D
|
||||
: lda $8D
|
||||
sta ($A9),y
|
||||
jsr L653C
|
||||
jsr L657E
|
||||
jsr L79A0
|
||||
jmp L6553
|
||||
|
||||
.endproc
|
||||
|
||||
;;; ==================================================
|
||||
;;; KeyboardMouse
|
||||
@ -8173,15 +8162,15 @@ L8196: sec
|
||||
cpx #$04
|
||||
bcc L8196
|
||||
sec
|
||||
lda #<(560-1)
|
||||
lda #<(screen_width-1)
|
||||
sbc L769B
|
||||
lda #>(560-1)
|
||||
lda #>(screen_width-1)
|
||||
sbc L769B+1
|
||||
bmi L81D9
|
||||
sec
|
||||
lda #<(192-1)
|
||||
lda #<(screen_height-1)
|
||||
sbc L769D
|
||||
lda #>(192-1)
|
||||
lda #>(screen_height-1)
|
||||
sbc L769D+1
|
||||
bmi L81D9
|
||||
jsr L7E98
|
||||
@ -8200,8 +8189,7 @@ L81E4: lda $AC
|
||||
beq L81F4
|
||||
lda #$00
|
||||
sta L7D74
|
||||
lda #$A1
|
||||
jmp exit_with_a
|
||||
exit_call $A1
|
||||
|
||||
L81F4: ldx #$00
|
||||
L81F6: clc
|
||||
@ -8565,8 +8553,8 @@ L8431: bit no_mouse_flag ; called after INITMOUSE
|
||||
jsr call_mouse
|
||||
end: rts
|
||||
|
||||
clamp_x_table: .word 560-1, 560/2-1, 560/4-1, 560/8-1
|
||||
clamp_y_table: .word 192-1, 192/2-1, 192/4-1, 192/8-1
|
||||
clamp_x_table: .word screen_width-1, screen_width/2-1, screen_width/4-1, screen_width/8-1
|
||||
clamp_y_table: .word screen_height-1, screen_height/2-1, screen_height/4-1, screen_height/8-1
|
||||
|
||||
.endproc
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
.include "../mgtk.inc"
|
||||
.include "../desktop.inc"
|
||||
.include "../macros.inc"
|
||||
.include "inc/desktoplc.inc"
|
||||
|
||||
;;; ==================================================
|
||||
;;; Overlay for Format/Erase
|
||||
@ -65,9 +66,9 @@ L085F: bit $D887
|
||||
bmi L0832
|
||||
lda $D57D
|
||||
jsr set_port_from_window_id
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, $D200
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, pencopy
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, $AE6E
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, $D202
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
|
||||
MGTK_RELAY_CALL MGTK::FrameRect, $D6AB
|
||||
jsr LBD75
|
||||
lda #$80
|
||||
@ -91,7 +92,7 @@ L08B7: lda $D443
|
||||
jsr set_cursor_pointer
|
||||
lda $D57D
|
||||
jsr set_port_from_window_id
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, $D200
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, pencopy
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, $AE6E
|
||||
ldx $D887
|
||||
lda DEVLST,x
|
||||
@ -110,7 +111,7 @@ L0902: jsr prompt_input_loop
|
||||
|
||||
L090C: lda $D57D
|
||||
jsr set_port_from_window_id
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, $D200
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, pencopy
|
||||
ldy #$11
|
||||
ldax #$AE6E
|
||||
jsr MGTK_RELAY
|
||||
@ -127,7 +128,7 @@ L090C: lda $D57D
|
||||
bcs L099B
|
||||
L0942: lda $D57D
|
||||
jsr set_port_from_window_id
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, $D200
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, pencopy
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, $AE6E
|
||||
axy_call draw_dialog_label, $01, $B373
|
||||
addr_call L1900, $D443
|
||||
@ -205,9 +206,9 @@ L0A18: bit $D887
|
||||
copy16 #$A898, $A89A
|
||||
lda $D57D
|
||||
jsr set_port_from_window_id
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, $D200
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, pencopy
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, $AE6E
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, $D202
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
|
||||
MGTK_RELAY_CALL MGTK::FrameRect, $D6AB
|
||||
jsr LBD75
|
||||
lda #$80
|
||||
@ -231,7 +232,7 @@ L0A7A: lda $D443
|
||||
jsr set_cursor_pointer
|
||||
lda $D57D
|
||||
jsr set_port_from_window_id
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, $D200
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, pencopy
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, $AE6E
|
||||
lda #$00
|
||||
sta $D8E8
|
||||
@ -251,7 +252,7 @@ L0AC7: jsr prompt_input_loop
|
||||
|
||||
L0AD1: lda $D57D
|
||||
jsr set_port_from_window_id
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, $D200
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, pencopy
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, $AE6E
|
||||
axy_call draw_dialog_label, $01, $B373
|
||||
addr_call L1900, $D443
|
||||
@ -341,7 +342,7 @@ L0BDC: cmp $D887
|
||||
bne L0C04
|
||||
jsr LB445
|
||||
bmi L0C03
|
||||
L0BE6: MGTK_RELAY_CALL MGTK::SetPenMode, $D202
|
||||
L0BE6: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, $AE20
|
||||
ldy #$11
|
||||
ldax #$AE20
|
||||
@ -391,7 +392,7 @@ L0C5B: asl L0CA9
|
||||
sta $D88B
|
||||
add16 $D888, #$0077, $D88C
|
||||
add16 $D88A, #$0007, $D88E
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, $D202
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, $D888
|
||||
rts
|
||||
|
||||
|
@ -418,15 +418,15 @@ L938F: .byte 0
|
||||
L9390: MGTK_RELAY_CALL MGTK::OpenWindow, $D665
|
||||
lda $D665
|
||||
jsr set_port_from_window_id
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, $D202
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
|
||||
MGTK_RELAY_CALL MGTK::FrameRect, $D6D8
|
||||
MGTK_RELAY_CALL MGTK::FrameRect, $D6E0
|
||||
MGTK_RELAY_CALL MGTK::MoveTo, $D6E8
|
||||
MGTK_RELAY_CALL MGTK::LineTo, $D6EC
|
||||
MGTK_RELAY_CALL MGTK::MoveTo, $D6F0
|
||||
MGTK_RELAY_CALL MGTK::LineTo, $D6F4
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, $D200
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, $D202
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, pencopy
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
|
||||
MGTK_RELAY_CALL MGTK::FrameRect, $D6F8
|
||||
MGTK_RELAY_CALL MGTK::FrameRect, $D700
|
||||
jsr L94A9
|
||||
@ -551,14 +551,14 @@ L94F0: stax $06
|
||||
L9539: .byte 0
|
||||
L953A: lda #$00
|
||||
sta L95BF
|
||||
L953F: MGTK_RELAY_CALL MGTK::GetEvent, $D208
|
||||
lda $D208
|
||||
cmp #$02
|
||||
L953F: MGTK_RELAY_CALL MGTK::GetEvent, event_params
|
||||
lda event_kind
|
||||
cmp #MGTK::event_kind_button_up
|
||||
beq L95A2
|
||||
lda $D665
|
||||
sta $D208
|
||||
MGTK_RELAY_CALL MGTK::ScreenToWindow, $D208
|
||||
MGTK_RELAY_CALL MGTK::MoveTo, $D20D
|
||||
sta screentowindow_window_id
|
||||
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
|
||||
MGTK_RELAY_CALL MGTK::MoveTo, screentowindow_windowx
|
||||
MGTK_RELAY_CALL MGTK::InRect, $D6F8
|
||||
cmp #MGTK::inrect_inside
|
||||
beq L957C
|
||||
@ -570,7 +570,7 @@ L957C: lda L95BF
|
||||
bne L9584
|
||||
jmp L953F
|
||||
|
||||
L9584: MGTK_RELAY_CALL MGTK::SetPenMode, $D202
|
||||
L9584: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, $D6F8
|
||||
lda L95BF
|
||||
clc
|
||||
@ -582,21 +582,21 @@ L95A2: lda L95BF
|
||||
beq L95AA
|
||||
return #$FF
|
||||
|
||||
L95AA: MGTK_RELAY_CALL MGTK::SetPenMode, $D202
|
||||
L95AA: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, $D6F8
|
||||
return #$00
|
||||
|
||||
L95BF: .byte 0
|
||||
L95C0: lda #$00
|
||||
sta L9645
|
||||
L95C5: MGTK_RELAY_CALL MGTK::GetEvent, $D208
|
||||
lda $D208
|
||||
cmp #$02
|
||||
L95C5: MGTK_RELAY_CALL MGTK::GetEvent, event_params
|
||||
lda event_kind
|
||||
cmp #MGTK::event_kind_button_up
|
||||
beq L9628
|
||||
lda $D665
|
||||
sta $D208
|
||||
MGTK_RELAY_CALL MGTK::ScreenToWindow, $D208
|
||||
MGTK_RELAY_CALL MGTK::MoveTo, $D20D
|
||||
sta screentowindow_window_id
|
||||
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
|
||||
MGTK_RELAY_CALL MGTK::MoveTo, screentowindow_windowx
|
||||
MGTK_RELAY_CALL MGTK::InRect, $D700
|
||||
cmp #MGTK::inrect_inside
|
||||
beq L9602
|
||||
@ -608,7 +608,7 @@ L9602: lda L9645
|
||||
bne L960A
|
||||
jmp L95C5
|
||||
|
||||
L960A: MGTK_RELAY_CALL MGTK::SetPenMode, $D202
|
||||
L960A: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, $D700
|
||||
lda L9645
|
||||
clc
|
||||
@ -620,31 +620,31 @@ L9628: lda L9645
|
||||
beq L9630
|
||||
return #$FF
|
||||
|
||||
L9630: MGTK_RELAY_CALL MGTK::SetPenMode, $D202
|
||||
L9630: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, $D700
|
||||
return #$01
|
||||
|
||||
L9645: .byte 0
|
||||
L9646: MGTK_RELAY_CALL MGTK::GetEvent, $D208
|
||||
lda $D208
|
||||
cmp #$01
|
||||
L9646: MGTK_RELAY_CALL MGTK::GetEvent, event_params
|
||||
lda event_kind
|
||||
cmp #MGTK::event_kind_button_down
|
||||
bne L9659
|
||||
jmp L9660
|
||||
|
||||
L9659: cmp #$03
|
||||
L9659: cmp #MGTK::event_kind_key_down
|
||||
bne L9646
|
||||
jmp L9822
|
||||
|
||||
L9660: MGTK_RELAY_CALL MGTK::FindWindow, $D209
|
||||
lda $D20D
|
||||
L9660: MGTK_RELAY_CALL MGTK::FindWindow, findwindow_params
|
||||
lda findwindow_which_area
|
||||
bne L9671
|
||||
return #$FF
|
||||
|
||||
L9671: cmp #$02
|
||||
L9671: cmp #MGTK::area_content
|
||||
beq L9678
|
||||
return #$FF
|
||||
|
||||
L9678: lda $D20E
|
||||
L9678: lda findwindow_window_id
|
||||
cmp $D665
|
||||
beq L9683
|
||||
return #$FF
|
||||
@ -652,13 +652,13 @@ L9678: lda $D20E
|
||||
L9683: lda $D665
|
||||
jsr set_port_from_window_id
|
||||
lda $D665
|
||||
sta $D208
|
||||
MGTK_RELAY_CALL MGTK::ScreenToWindow, $D208
|
||||
MGTK_RELAY_CALL MGTK::MoveTo, $D20D
|
||||
sta screentowindow_window_id
|
||||
MGTK_RELAY_CALL MGTK::ScreenToWindow, screentowindow_params
|
||||
MGTK_RELAY_CALL MGTK::MoveTo, screentowindow_windowx
|
||||
MGTK_RELAY_CALL MGTK::InRect, $D6F8
|
||||
cmp #MGTK::inrect_inside
|
||||
bne L96C8
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, $D202
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, $D6F8
|
||||
jsr L953A
|
||||
bmi L96C7
|
||||
@ -668,7 +668,7 @@ L96C7: rts
|
||||
L96C8: MGTK_RELAY_CALL MGTK::InRect, $D700
|
||||
cmp #MGTK::inrect_inside
|
||||
bne L96EF
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, $D202
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, $D700
|
||||
jsr L95C0
|
||||
bmi L96EE
|
||||
@ -789,9 +789,9 @@ L97D4: asl a
|
||||
sta $D87A
|
||||
add16 $D877, #$006A, $D87B
|
||||
add16 $D879, #$0007, $D87D
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, $D202
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, $D877
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, $D200
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, pencopy
|
||||
rts
|
||||
|
||||
L9822: lda $D20A
|
||||
@ -827,15 +827,15 @@ L9854: cmp #$0B
|
||||
|
||||
L985B: return #$FF
|
||||
|
||||
L985E: MGTK_RELAY_CALL MGTK::SetPenMode, $D202
|
||||
L985E: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, $D6F8
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, $D202
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, $D6F8
|
||||
return #$00
|
||||
|
||||
L9885: MGTK_RELAY_CALL MGTK::SetPenMode, $D202
|
||||
L9885: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, $D700
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, $D202
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, $D700
|
||||
return #$01
|
||||
|
||||
@ -1009,7 +1009,7 @@ L99ED: .byte 0
|
||||
.byte 0
|
||||
.byte 0
|
||||
.byte 0
|
||||
L99F5: MGTK_RELAY_CALL MGTK::SetPenMode, $D200
|
||||
L99F5: MGTK_RELAY_CALL MGTK::SetPenMode, pencopy
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, $D87F
|
||||
rts
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
.include "../mgtk.inc"
|
||||
.include "../desktop.inc"
|
||||
.include "../macros.inc"
|
||||
.include "inc/desktoplc.inc"
|
||||
|
||||
.macro entry arg1, arg2
|
||||
.byte arg1
|
||||
@ -15,21 +16,6 @@
|
||||
|
||||
dummy1234 := $1234
|
||||
|
||||
;;; ==================================================
|
||||
;;; Resources from language card area
|
||||
|
||||
winfo12 := $D5B7
|
||||
winfo15 := $D5F1
|
||||
|
||||
path_buf0 := $D402
|
||||
path_buf1 := $D443
|
||||
path_buf2 := $D484
|
||||
|
||||
grafport3 := $D239
|
||||
|
||||
dialog_rect1 := $DA9E
|
||||
dialog_rect2 := $DAAA
|
||||
|
||||
;;; ==================================================
|
||||
;;; Interdependent Overlays
|
||||
|
||||
|
@ -9,74 +9,6 @@
|
||||
.org $5000
|
||||
.proc common_overlay
|
||||
|
||||
;;; ============================================================
|
||||
;;; Re-used param space for events/queries
|
||||
|
||||
pencopy := $D200
|
||||
penOR := $D201
|
||||
penXOR := $D202
|
||||
penBIC := $D203
|
||||
notpencopy := $D204
|
||||
notpenOR := $D205
|
||||
notpenXOR := $D206
|
||||
notpenBIC := $D207
|
||||
|
||||
|
||||
event_params := $D208
|
||||
event_kind := event_params + 0
|
||||
;; if kind is key_down
|
||||
event_key := event_params + 1
|
||||
event_modifiers := event_params + 2
|
||||
;; if kind is no_event, button_down/up, drag, or apple_key:
|
||||
event_coords := event_params + 1
|
||||
event_xcoord := event_params + 1
|
||||
event_ycoord := event_params + 3
|
||||
;; if kind is update:
|
||||
event_window_id := event_params + 1
|
||||
|
||||
screentowindow_params := event_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
|
||||
.assert screentowindow_screenx = event_xcoord, error, "param mismatch"
|
||||
.assert screentowindow_screeny = event_ycoord, error, "param mismatch"
|
||||
|
||||
findwindow_params := event_params + 1 ; offset to x/y overlap event_params x/y
|
||||
findwindow_mousex := findwindow_params + 0
|
||||
findwindow_mousey := findwindow_params + 2
|
||||
findwindow_which_area := findwindow_params + 4
|
||||
findwindow_window_id := findwindow_params + 5
|
||||
.assert findwindow_mousex = event_xcoord, error, "param mismatch"
|
||||
.assert findwindow_mousey = event_ycoord, error, "param mismatch"
|
||||
|
||||
findcontrol_params := event_params + 1 ; offset to x/y overlap event_params x/y
|
||||
findcontrol_mousex := findcontrol_params + 0
|
||||
findcontrol_mousey := findcontrol_params + 2
|
||||
findcontrol_which_ctl := findcontrol_params + 4
|
||||
findcontrol_which_part := findcontrol_params + 5
|
||||
.assert findcontrol_mousex = event_xcoord, error, "param mismatch"
|
||||
.assert findcontrol_mousey = event_ycoord, error, "param mismatch"
|
||||
|
||||
activatectl_params := event_params
|
||||
activatectl_which_ctl := activatectl_params
|
||||
activatectl_activate := activatectl_params + 1
|
||||
|
||||
trackthumb_params := event_params
|
||||
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
|
||||
.assert trackthumb_mousex = event_xcoord, error, "param mismatch"
|
||||
.assert trackthumb_mousey = event_ycoord, error, "param mismatch"
|
||||
|
||||
updatethumb_params := event_params
|
||||
updatethumb_which_ctl := updatethumb_params
|
||||
updatethumb_thumbpos := updatethumb_params + 1
|
||||
updatethumb_stash := updatethumb_params + 5 ; not part of struct
|
||||
|
||||
;;; ============================================================
|
||||
|
||||
L5000: jmp L50B1
|
||||
|
@ -48,7 +48,7 @@ L7052: lda winfo12
|
||||
addr_call common_overlay::L5E0A, $DA67 ; "Copy a File ..."
|
||||
addr_call common_overlay::L5E57, $DA77 ; "Source filename:"
|
||||
addr_call common_overlay::L5E6F, $DA88 ; "Destination filename:"
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, $D202 ; penXOR
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR ; penXOR
|
||||
MGTK_RELAY_CALL MGTK::FrameRect, dialog_rect1
|
||||
MGTK_RELAY_CALL MGTK::FrameRect, dialog_rect2
|
||||
MGTK_RELAY_CALL MGTK::InitPort, grafport3
|
||||
|
@ -45,7 +45,7 @@ L704D: lda winfo12
|
||||
jsr common_overlay::L62C8
|
||||
addr_call common_overlay::L5E0A, $DAB6 ; "Delete a File ..."
|
||||
addr_call common_overlay::L5E57, $DAC8 ; "File to delete:"
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, $D202 ; penXOR
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR ; penXOR
|
||||
MGTK_RELAY_CALL MGTK::FrameRect, dialog_rect1
|
||||
MGTK_RELAY_CALL MGTK::InitPort, grafport3
|
||||
MGTK_RELAY_CALL MGTK::SetPort, grafport3
|
||||
|
@ -111,7 +111,7 @@ L7101: lda winfo12
|
||||
|
||||
L7116: addr_call common_overlay::L5E0A, $D718
|
||||
L711D: addr_call common_overlay::L5E6F, $D849
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, $D202 ; penXOR
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR ; penXOR
|
||||
MGTK_RELAY_CALL MGTK::FrameRect, dialog_rect1
|
||||
MGTK_RELAY_CALL MGTK::FrameRect, dialog_rect2
|
||||
addr_call common_overlay::L5E57, $D769
|
||||
@ -130,7 +130,7 @@ L711D: addr_call common_overlay::L5E6F, $D849
|
||||
addr_call common_overlay::L5DED, $D830
|
||||
MGTK_RELAY_CALL MGTK::MoveTo, $D93A
|
||||
addr_call common_overlay::L5DED, $D840
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, $D202
|
||||
MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
|
||||
MGTK_RELAY_CALL MGTK::FrameRect, $D93E
|
||||
MGTK_RELAY_CALL MGTK::FrameRect, $D946
|
||||
MGTK_RELAY_CALL MGTK::FrameRect, $D94E
|
||||
@ -408,7 +408,7 @@ L74D3: lda $D994
|
||||
sta $D994
|
||||
bcs L74E1
|
||||
dec $D995
|
||||
L74E1: MGTK_RELAY_CALL MGTK::SetPenMode, $D202
|
||||
L74E1: MGTK_RELAY_CALL MGTK::SetPenMode, penXOR
|
||||
MGTK_RELAY_CALL MGTK::PaintRect, $D98E
|
||||
rts
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user