DAs: winfo members

This commit is contained in:
Joshua Bell 2018-01-29 21:11:32 -08:00
parent 76311ce501
commit 6315aab0f7
6 changed files with 218 additions and 224 deletions

View File

@ -159,8 +159,8 @@ offscreen_flag:
.proc screentowindow_params
window_id := *
screen := * + 1
screenx := * + 1 ; aligns with input_state::xcoord
screeny := * + 3 ; aligns with input_state::ycoord
screenx := * + 1 ; aligns with event_params::xcoord
screeny := * + 3 ; aligns with event_params::ycoord
window := * + 5
windowx := * + 5
windowy := * + 7
@ -168,8 +168,8 @@ windowy := * + 7
.proc dragwindow_params
window_id := *
xcoord := * + 1 ; aligns with input_state::xcoord
ycoord := * + 3 ; aligns with input_state::ycoord
xcoord := * + 1 ; aligns with event_params::xcoord
ycoord := * + 3 ; aligns with event_params::ycoord
moved := * + 5 ; ignored
.endproc
@ -241,7 +241,7 @@ flag: .byte MGTK::zp_overwrite
.proc btn_c
left: .word col1_left - border_lt
top: .word row1_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -256,7 +256,7 @@ port: .word col1_left,row1_top,col1_right,row1_bot
.proc btn_e
left: .word col2_left - border_lt
top: .word row1_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -271,7 +271,7 @@ port: .word col2_left,row1_top,col2_right,row1_bot
.proc btn_eq
left: .word col3_left - border_lt
top: .word row1_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -286,7 +286,7 @@ port: .word col3_left,row1_top,col3_right,row1_bot
.proc btn_mul
left: .word col4_left - border_lt
top: .word row1_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -301,7 +301,7 @@ port: .word col4_left,row1_top,col4_right,row1_bot
.proc btn_7
left: .word col1_left - border_lt
top: .word row2_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -316,7 +316,7 @@ port: .word col1_left,row2_top,col1_right,row2_bot
.proc btn_8
left: .word col2_left - border_lt
top: .word row2_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -331,7 +331,7 @@ port: .word col2_left,row2_top,col2_right,row2_bot
.proc btn_9
left: .word col3_left - border_lt
top: .word row2_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -346,7 +346,7 @@ port: .word col3_left,row2_top,col3_right,row2_bot
.proc btn_div
left: .word col4_left - border_lt
top: .word row2_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -361,7 +361,7 @@ port: .word col4_left,row2_top,col4_right,row2_bot
.proc btn_4
left: .word col1_left - border_lt
top: .word row3_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -376,7 +376,7 @@ port: .word col1_left,row3_top,col1_right,row3_bot
.proc btn_5
left: .word col2_left - border_lt
top: .word row3_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -391,7 +391,7 @@ port: .word col2_left,row3_top,col2_right,row3_bot
.proc btn_6
left: .word col3_left - border_lt
top: .word row3_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -406,7 +406,7 @@ port: .word col3_left,row3_top,col3_right,row3_bot
.proc btn_sub
left: .word col4_left - border_lt
top: .word row3_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -421,7 +421,7 @@ port: .word col4_left,row3_top,col4_right,row3_bot
.proc btn_1
left: .word col1_left - border_lt
top: .word row4_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -436,7 +436,7 @@ port: .word col1_left,row4_top,col1_right,row4_bot
.proc btn_2
left: .word col2_left - border_lt
top: .word row4_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -451,7 +451,7 @@ port: .word col2_left,row4_top,col2_right,row4_bot
.proc btn_3
left: .word col3_left - border_lt
top: .word row4_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -466,7 +466,7 @@ port: .word col3_left,row4_top,col3_right,row4_bot
.proc btn_0
left: .word col1_left - border_lt
top: .word row5_top - border_lt
bitmap: .addr wide_button_bitmap
mapbits: .addr wide_button_bitmap
mapwidth: .byte 8 ; bitmap_stride (bytes)
.byte 0 ; ???
hoff: .word 0
@ -481,7 +481,7 @@ port: .word col1_left,row5_top,col2_right,row5_bot
.proc btn_dec
left: .word col3_left - border_lt
top: .word row5_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -496,7 +496,7 @@ port: .word col3_left,row5_top,col3_right,row5_bot
.proc btn_add
left: .word col4_left - border_lt
top: .word row4_top - border_lt
bitmap: .addr tall_button_bitmap
mapbits: .addr tall_button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -612,7 +612,7 @@ white_pattern:
.byte $00
.proc settextbg_params
mask: .byte $7F
backcolor: .byte $7F
.endproc
display_left := 10
@ -697,7 +697,7 @@ farg: .byte $00,$00,$00,$00,$00,$00
.proc title_bar_decoration ; Params for MGTK::PaintBits
left: .word 115 ; overwritten
top: .word $FFF7 ; overwritten
bitmap:.addr pixels
mapbits:.addr pixels
mapwidth: .byte 1
.byte 0 ; ???
hoff: .word 0
@ -723,15 +723,14 @@ voff: .word 0
width: .word 0
height: .word 0
pattern:.res 8, 0
mskand: .byte 0
mskor: .byte 0
colormasks: .byte 0, 0
xpos: .word 0
ypos: .word 0
hthick: .byte 0
vthick: .byte 0
mode: .byte 0
tmask: .byte 0
font: .addr 0
penwidth: .byte 0
penheight: .byte 0
penmode: .byte 0
textback: .byte 0
textfont: .addr 0
.endproc
.byte 0,0 ; ???
@ -752,13 +751,13 @@ font: .addr 0
.endproc
.proc penmode_normal
mode: .byte MGTK::pencopy
penmode: .byte MGTK::pencopy
.endproc
.byte $01,$02 ; ??
.proc penmode_xor
mode: .byte MGTK::notpenXOR
penmode: .byte MGTK::notpenXOR
.endproc
window_width := 130
@ -768,14 +767,14 @@ mode: .byte MGTK::notpenXOR
.proc winfo
window_id: .byte da_window_id
flags: .byte MGTK::option_go_away_box
options: .byte MGTK::option_go_away_box
title: .addr window_title
hscroll:.byte MGTK::scroll_option_none
vscroll:.byte MGTK::scroll_option_none
hs_max: .byte 0
hs_pos: .byte 0
vs_max: .byte 0
vs_pos: .byte 0
hthumbmax: .byte 0
hthumbpos: .byte 0
vthumbmax: .byte 0
vthumbpos: .byte 0
status: .byte 0
reserved: .byte 0
mincontwidth: .word window_width
@ -791,16 +790,15 @@ voff: .word 0
width: .word window_width
height: .word window_height
pattern:.res 8, $FF
mskand: .byte MGTK::colormask_and
mskor: .byte MGTK::colormask_or
colormasks: .byte MGTK::colormask_and, MGTK::colormask_or
xpos: .word 0
ypos: .word 0
hthick: .byte 1
vthick: .byte 1
mode: .byte 0
tmask: .byte 0
font: .addr DEFAULT_FONT
next: .addr 0
penwidth: .byte 1
penheight: .byte 1
penmode: .byte 0
textback: .byte 0
textfont: .addr DEFAULT_FONT
nextwinfo: .addr 0
.endproc
openwindow_params_top := winfo::top

View File

@ -164,8 +164,8 @@ offscreen_flag:
.proc screentowindow_params
window_id := *
screen := * + 1
screenx := * + 1 ; aligns with input_state::xcoord
screeny := * + 3 ; aligns with input_state::ycoord
screenx := * + 1 ; aligns with event_params::xcoord
screeny := * + 3 ; aligns with event_params::ycoord
window := * + 5
windowx := * + 5
windowy := * + 7
@ -173,8 +173,8 @@ windowy := * + 7
.proc dragwindow_params
window_id := *
xcoord := * + 1 ; aligns with input_state::xcoord
ycoord := * + 3 ; aligns with input_state::ycoord
xcoord := * + 1 ; aligns with event_params::xcoord
ycoord := * + 3 ; aligns with event_params::ycoord
moved := * + 5 ; ignored
.endproc
@ -246,7 +246,7 @@ flag: .byte MGTK::zp_overwrite
.proc btn_c
left: .word col1_left - border_lt
top: .word row1_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -261,7 +261,7 @@ port: .word col1_left,row1_top,col1_right,row1_bot
.proc btn_e
left: .word col2_left - border_lt
top: .word row1_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -276,7 +276,7 @@ port: .word col2_left,row1_top,col2_right,row1_bot
.proc btn_eq
left: .word col3_left - border_lt
top: .word row1_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -291,7 +291,7 @@ port: .word col3_left,row1_top,col3_right,row1_bot
.proc btn_mul
left: .word col4_left - border_lt
top: .word row1_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -306,7 +306,7 @@ port: .word col4_left,row1_top,col4_right,row1_bot
.proc btn_7
left: .word col1_left - border_lt
top: .word row2_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -321,7 +321,7 @@ port: .word col1_left,row2_top,col1_right,row2_bot
.proc btn_8
left: .word col2_left - border_lt
top: .word row2_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -336,7 +336,7 @@ port: .word col2_left,row2_top,col2_right,row2_bot
.proc btn_9
left: .word col3_left - border_lt
top: .word row2_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -351,7 +351,7 @@ port: .word col3_left,row2_top,col3_right,row2_bot
.proc btn_div
left: .word col4_left - border_lt
top: .word row2_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -366,7 +366,7 @@ port: .word col4_left,row2_top,col4_right,row2_bot
.proc btn_4
left: .word col1_left - border_lt
top: .word row3_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -381,7 +381,7 @@ port: .word col1_left,row3_top,col1_right,row3_bot
.proc btn_5
left: .word col2_left - border_lt
top: .word row3_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -396,7 +396,7 @@ port: .word col2_left,row3_top,col2_right,row3_bot
.proc btn_6
left: .word col3_left - border_lt
top: .word row3_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -411,7 +411,7 @@ port: .word col3_left,row3_top,col3_right,row3_bot
.proc btn_sub
left: .word col4_left - border_lt
top: .word row3_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -426,7 +426,7 @@ port: .word col4_left,row3_top,col4_right,row3_bot
.proc btn_1
left: .word col1_left - border_lt
top: .word row4_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -441,7 +441,7 @@ port: .word col1_left,row4_top,col1_right,row4_bot
.proc btn_2
left: .word col2_left - border_lt
top: .word row4_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -456,7 +456,7 @@ port: .word col2_left,row4_top,col2_right,row4_bot
.proc btn_3
left: .word col3_left - border_lt
top: .word row4_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -471,7 +471,7 @@ port: .word col3_left,row4_top,col3_right,row4_bot
.proc btn_0
left: .word col1_left - border_lt
top: .word row5_top - border_lt
bitmap: .addr wide_button_bitmap
mapbits: .addr wide_button_bitmap
mapwidth: .byte 8 ; bitmap_stride (bytes)
.byte 0 ; ???
hoff: .word 0
@ -486,7 +486,7 @@ port: .word col1_left,row5_top,col2_right,row5_bot
.proc btn_dec
left: .word col3_left - border_lt
top: .word row5_top - border_lt
bitmap: .addr button_bitmap
mapbits: .addr button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -501,7 +501,7 @@ port: .word col3_left,row5_top,col3_right,row5_bot
.proc btn_add
left: .word col4_left - border_lt
top: .word row4_top - border_lt
bitmap: .addr tall_button_bitmap
mapbits: .addr tall_button_bitmap
mapwidth: .byte bitmap_stride
.byte 0 ; ???
hoff: .word 0
@ -617,7 +617,7 @@ white_pattern:
.byte $00
.proc settextbg_params
mask: .byte $7F
backcolor: .byte $7F
.endproc
display_left := 10
@ -702,7 +702,7 @@ farg: .byte $00,$00,$00,$00,$00,$00
.proc title_bar_decoration ; Params for MGTK::PaintBits
left: .word 115 ; overwritten
top: .word $FFF7 ; overwritten
bitmap:.addr pixels
mapbits:.addr pixels
mapwidth: .byte 1
.byte 0 ; ???
hoff: .word 0
@ -729,15 +729,14 @@ voff: .word 0
width: .word 0
height: .word 0
pattern:.res 8, 0
mskand: .byte 0
mskor: .byte 0
colormasks: .byte 0, 0
xpos: .word 0
ypos: .word 0
hthick: .byte 0
vthick: .byte 0
mode: .byte 0
tmask: .byte 0
font: .addr 0
penwidth: .byte 0
penheight: .byte 0
penmode: .byte 0
textback: .byte 0
textfont: .addr 0
.endproc
.assert * - port_params = 36, error
@ -760,13 +759,13 @@ height: .word screen_height - menu_bar_height - 2
.endproc
.proc penmode_normal
mode: .byte MGTK::pencopy
penmode: .byte MGTK::pencopy
.endproc
.byte $01,$02 ; ??
.proc penmode_xor
mode: .byte MGTK::notpenXOR
penmode: .byte MGTK::notpenXOR
.endproc
window_width := 130
@ -776,14 +775,14 @@ mode: .byte MGTK::notpenXOR
.proc winfo
window_id: .byte da_window_id
flags: .byte MGTK::option_go_away_box
options: .byte MGTK::option_go_away_box
title: .addr window_title
hscroll:.byte MGTK::scroll_option_none
vscroll:.byte MGTK::scroll_option_none
hs_max: .byte 0
hs_pos: .byte 0
vs_max: .byte 0
vs_pos: .byte 0
hthumbmax: .byte 0
hthumbpos: .byte 0
vthumbmax: .byte 0
vthumbpos: .byte 0
status: .byte 0
reserved: .byte 0
mincontwidth: .word window_width
@ -799,16 +798,15 @@ voff: .word 0
width: .word window_width
height: .word window_height
pattern:.res 8, $FF
mskand: .byte MGTK::colormask_and
mskor: .byte MGTK::colormask_or
colormasks: .byte MGTK::colormask_and, MGTK::colormask_or
xpos: .word 0
ypos: .word 0
hthick: .byte 1
vthick: .byte 1
mode: .byte 0
tmask: .byte $7f
font: .addr DEFAULT_FONT
next: .addr 0
penwidth: .byte 1
penheight: .byte 1
penmode: .byte 0
textback: .byte $7f
textfont: .addr DEFAULT_FONT
nextwinfo: .addr 0
.endproc
openwindow_params_top := winfo::top

View File

@ -215,7 +215,7 @@ year_string:
DEFINE_STRING " "
.proc event_params
state: .byte 0
kind: .byte 0
key := *
modifiers := *+1
@ -250,7 +250,7 @@ id: .byte window_id
.byte $00,$01 ; ???
.proc penmode_params
mode: .byte $02 ; this should be normal, but we do inverts ???
penmode: .byte $02 ; this should be normal, but we do inverts ???
.endproc
.byte $06 ; ???
@ -281,16 +281,15 @@ width: .word $C7
height: .word $40
.endproc
pattern:.res 8,$00
mskand: .byte MGTK::colormask_and
mskor: .byte MGTK::colormask_or
colormasks: .byte MGTK::colormask_and, MGTK::colormask_or
xpos: .word 0
ypos: .word 0
hthick: .byte 4
vthick: .byte 2
mode: .byte 0
tmask: .byte $7F
font: .addr DEFAULT_FONT
next: .addr 0
penwidth: .byte 4
penheight: .byte 2
penmode: .byte 0
textback: .byte $7F
textfont: .addr DEFAULT_FONT
nextwinfo: .addr 0
.endproc
;;; ==================================================
@ -334,7 +333,7 @@ init_window:
.proc input_loop
MGTK_CALL MGTK::GetEvent, event_params
lda event_params::state
lda event_params::kind
cmp #MGTK::button_down
bne :+
jsr on_click
@ -493,7 +492,7 @@ on_field_click:
.proc on_up_or_down
stx hit_rect_index
loop: MGTK_CALL MGTK::GetEvent, event_params ; Repeat while mouse is down
lda event_params::state
lda event_params::kind
cmp #MGTK::button_up
beq :+
jsr do_inc_or_dec
@ -780,8 +779,8 @@ label_downarrow_pos:
.word $AC,$27
.proc setpensize_params
hthick: .byte 1
vthick: .byte 1
penwidth: .byte 1
penheight: .byte 1
.endproc
;;; ==================================================

View File

@ -164,7 +164,7 @@ clienty := * + 7
.endproc
.proc event_params
state: .byte 0
kind: .byte 0
key := *
modifiers := *+1
@ -593,7 +593,7 @@ setport_params:
.proc winfo
id: .byte window_id
flags: .byte MGTK::option_go_away_box
options: .byte MGTK::option_go_away_box
title: .addr name
hscroll:.byte MGTK::scroll_option_none
vscroll:.byte MGTK::scroll_option_none
@ -601,7 +601,8 @@ hthumbmax: .byte 0
hthumbpos: .byte 0
vthumbmax: .byte 0
vthumbpos: .byte 0
.byte 0,0 ; ???
status: .byte 0
reserved: .byte 0
mincontwidth: .word default_width
mincontlength: .word default_height
maxcontwidth: .word default_width
@ -617,16 +618,15 @@ width: .word default_width
height: .word default_height
pattern:.res 8, $FF
mskand: .byte MGTK::colormask_and
mskor: .byte MGTK::colormask_or
colormasks: .byte MGTK::colormask_and, MGTK::colormask_or
xpos: .word 0
ypos: .word 0
hthick: .byte 1
vthick: .byte 1
mode: .byte 0
tmask: .byte $7F
font: .addr DEFAULT_FONT
next: .addr 0
penwidth: .byte 1
penheight: .byte 1
penmode: .byte 0
textback: .byte $7F
textfont: .addr DEFAULT_FONT
nextwinfo: .addr 0
.endproc
;; This is QUERY_STATE/SET_BOX cruft only below
@ -640,15 +640,14 @@ voff: .word 0
width: .word default_width
height: .word default_height
pattern:.res 8, $FF
mskand: .byte MGTK::colormask_and
mskor: .byte MGTK::colormask_or
colormasks: .byte MGTK::colormask_and, MGTK::colormask_or
xpos: .word 0
ypos: .word 0
hthick: .byte 1
vthick: .byte 1
mode: .byte 0
tmask: .byte $7F
font: .addr DEFAULT_FONT
penwidth: .byte 1
penheight: .byte 1
penmode: .byte 0
textback: .byte $7F
textfont: .addr DEFAULT_FONT
.byte 0,0 ; ???
.endproc
@ -699,7 +698,7 @@ ploop: lda position_table+1,y
.endproc
MGTK_CALL MGTK::GetEvent, event_params
lda event_params::state
lda event_params::kind
beq scramble
jsr check_victory
bcs scramble
@ -713,7 +712,7 @@ ploop: lda position_table+1,y
.proc input_loop
MGTK_CALL MGTK::GetEvent, event_params
lda event_params::state
lda event_params::kind
cmp #MGTK::button_down
bne :+
jsr on_click

View File

@ -171,7 +171,7 @@ base: .word 0
.proc event_params ; queried to track mouse-up
state: .byte $00
kind: .byte $00
;;; if state is MGTK::key_down
key := *
@ -193,9 +193,9 @@ ycoord := *+2
.byte 0 ; length
.endproc
.proc window_params
.proc winfo
id: .byte window_id ; window identifier
flags: .byte MGTK::option_dialog_box
options: .byte MGTK::option_dialog_box
title: .addr window_title
hscroll:.byte MGTK::scroll_option_none
vscroll:.byte MGTK::scroll_option_none
@ -203,7 +203,8 @@ hthumbmax: .byte 32
hthumbpos: .byte 0
vthumbmax: .byte 32
vthumbpos: .byte 0
.byte 0, 0 ; ???
status: .byte 0
reserved: .byte 0
mincontwidth: .word default_width
mincontlength: .word default_height
maxcontwidth: .word default_width
@ -221,16 +222,15 @@ height: .word default_height
.endproc
pattern:.res 8, 0
mskand: .byte MGTK::colormask_and
mskor: .byte MGTK::colormask_or
colormasks: .byte MGTK::colormask_and, MGTK::colormask_or
xpos: .word 0
ypos: .word 0
hthick: .byte 1
vthick: .byte 1
mode: .byte 0
tmask: .byte $7F
font: .addr DEFAULT_FONT
next: .addr 0
penwidth: .byte 1
penheight: .byte 1
penmode: .byte 0
textback: .byte $7F
textfont: .addr DEFAULT_FONT
nextwinfo: .addr 0
.endproc
@ -344,8 +344,8 @@ end: rts
MGTK_CALL MGTK::HideCursor
jsr stash_menu
MGTK_CALL MGTK::OpenWindow, window_params
MGTK_CALL MGTK::SetPort, window_params::port
MGTK_CALL MGTK::OpenWindow, winfo
MGTK_CALL MGTK::SetPort, winfo::port
jsr show_file
MGTK_CALL MGTK::ShowCursor
@ -358,7 +358,7 @@ end: rts
.proc input_loop
MGTK_CALL MGTK::GetEvent, event_params
lda event_params::state
lda event_params::kind
cmp #MGTK::button_down ; was clicked?
beq exit
cmp #MGTK::key_down ; any key?
@ -375,7 +375,7 @@ on_key:
exit:
MGTK_CALL MGTK::HideCursor
MGTK_CALL MGTK::CloseWindow, window_params
MGTK_CALL MGTK::CloseWindow, winfo
DESKTOP_CALL DESKTOP_REDRAW_ICONS
jsr unstash_menu
MGTK_CALL MGTK::ShowCursor

View File

@ -242,7 +242,7 @@ fixed_mode_flag:
.byte $00 ; 0 = proportional, otherwise = fixed
.proc event_params
state: .byte 0
kind: .byte 0
coords: ; spills into target query
xcoord: .word 0
ycoord: .word 0
@ -260,7 +260,7 @@ ycoord: .word 0
.endproc
.proc trackgoaway_params ; queried after close clicked to see if aborted/finished
state: .byte 0 ; 0 = aborted, 1 = clicked
goaway: .byte 0 ; 0 = aborted, 1 = clicked
.byte 0,0 ; ???
.endproc
@ -302,9 +302,9 @@ len: .byte 0 ; length
default_left := 10
default_top := 28
.proc window_params
.proc winfo
id: .byte window_id ; window identifier
flags: .byte MGTK::option_go_away_box; window flags (2=include close port)
options: .byte MGTK::option_go_away_box; window flags (2=include close port)
title: .addr $1000 ; overwritten to point at filename
hscroll:.byte MGTK::scroll_option_none
vscroll:.byte MGTK::scroll_option_normal
@ -312,7 +312,8 @@ hthumbmax: .byte 32
hthumbpos: .byte 0
vthumbmax: .byte 255
vthumbpos: .byte 0
.byte 0, 0 ; ???
status: .byte 0
reserved: .byte 0
mincontwidth: .word 200
mincontlength: .word 51
maxcontwidth: .word default_width
@ -330,19 +331,18 @@ height: .word default_height
.endproc
pattern:.res 8, $00
mskand: .byte MGTK::colormask_and
mskor: .byte MGTK::colormask_or
colormasks: .byte MGTK::colormask_and, MGTK::colormask_or
xpos: .word 0
ypos: .word 0
hthick: .byte 1
vthick: .byte 1
mode: .byte 0
tmask: .byte $7F
font: .addr DEFAULT_FONT
next: .addr 0
penwidth: .byte 1
penheight: .byte 1
penmode: .byte 0
textback: .byte $7F
textfont: .addr DEFAULT_FONT
nextwinfo: .addr 0
.endproc
;; gets copied over window_params::port after mode is drawn
;; gets copied over winfo::port after mode is drawn
.proc default_box
left: .word default_left
top: .word default_top
@ -425,10 +425,10 @@ abort: rts
: clc
lda src ; name is 9 bytes into entry
adc #9
sta window_params::title
sta winfo::title
lda src+1
adc #0
sta window_params::title+1
sta winfo::title+1
;; Append filename to path.
ldy #9
@ -497,8 +497,8 @@ loop: lda font_width_table - 1,x
jsr get_file_eof
;; create window
MGTK_CALL MGTK::OpenWindow, window_params
MGTK_CALL MGTK::SetPort, window_params::port
MGTK_CALL MGTK::OpenWindow, winfo
MGTK_CALL MGTK::SetPort, winfo::port
jsr calc_window_size
jsr calc_and_draw_mode
jsr draw_content
@ -551,10 +551,10 @@ title: jsr on_title_bar_click
.proc on_close_click
MGTK_CALL MGTK::TrackGoAway, trackgoaway_params
lda trackgoaway_params::state ; did click complete?
lda trackgoaway_params::goaway ; did click complete?
beq input_loop ; nope
jsr close_file
MGTK_CALL MGTK::CloseWindow, window_params
MGTK_CALL MGTK::CloseWindow, winfo
DESKTOP_CALL DESKTOP_REDRAW_ICONS
rts ; exits input loop
.endproc
@ -570,24 +570,24 @@ title: jsr on_title_bar_click
max_width := default_width
lda #>max_width
cmp window_params::port::width+1
cmp winfo::port::width+1
bne :+
lda #<max_width
cmp window_params::port::width
cmp winfo::port::width
: bcs wider
lda #<max_width
sta window_params::port::width
sta winfo::port::width
lda #>max_width
sta window_params::port::width+1
sta winfo::port::width+1
sec
lda window_params::port::width
lda winfo::port::width
sbc window_width
sta window_params::port::hoff
lda window_params::port::width+1
sta winfo::port::hoff
lda winfo::port::width+1
sbc window_width+1
sta window_params::port::hoff+1
wider: lda window_params::hscroll
sta winfo::port::hoff+1
wider: lda winfo::hscroll
ldx window_width
cpx #<max_width
bne enable
@ -599,7 +599,7 @@ wider: lda window_params::hscroll
enable: ora #MGTK::scroll_option_active ; enable scroll
: sta window_params::hscroll
: sta winfo::hscroll
sec
lda #<max_width
sbc window_width
@ -672,11 +672,11 @@ end: rts
.endproc
.proc on_vscroll_above_click
loop: lda window_params::vthumbpos
loop: lda winfo::vthumbpos
beq end
jsr calc_track_scroll_delta
sec
lda window_params::vthumbpos
lda winfo::vthumbpos
sbc track_scroll_delta
bcs store
lda #0 ; underflow
@ -687,7 +687,7 @@ end: rts
.endproc
.proc on_vscroll_up_click
loop : lda window_params::vthumbpos
loop : lda winfo::vthumbpos
beq end
sec
sbc #1
@ -700,12 +700,12 @@ end: rts
vscroll_max := $FA
.proc on_vscroll_below_click
loop: lda window_params::vthumbpos
loop: lda winfo::vthumbpos
cmp #vscroll_max ; pos == max ?
beq end
jsr calc_track_scroll_delta
clc
lda window_params::vthumbpos
lda winfo::vthumbpos
adc track_scroll_delta ; pos + delta
bcs overflow
cmp #vscroll_max+1 ; > max ?
@ -719,7 +719,7 @@ end: rts
.endproc
.proc on_vscroll_down_click
loop: lda window_params::vthumbpos
loop: lda winfo::vthumbpos
cmp #vscroll_max
beq end
clc
@ -782,16 +782,16 @@ loop: inx
lda thumb_drag_params::pos
jsr mul_by_16
lda $06
sta window_params::port::hoff
sta winfo::port::hoff
lda $07
sta window_params::port::hoff+1
sta winfo::port::hoff+1
clc
lda window_params::port::hoff
lda winfo::port::hoff
adc window_width
sta window_params::port::width
lda window_params::port::hoff+1
sta winfo::port::width
lda winfo::port::hoff+1
adc window_width+1
sta window_params::port::width+1
sta winfo::port::width+1
jsr update_hscroll
jsr draw_content
end: rts
@ -799,7 +799,7 @@ end: rts
.proc on_hscroll_after_click
ldx #2
lda window_params::hthumbmax
lda winfo::hthumbmax
jmp hscroll_common
.endproc
@ -811,7 +811,7 @@ end: rts
.proc on_hscroll_right_click
ldx #1
lda window_params::hthumbmax
lda winfo::hthumbmax
jmp hscroll_common
.endproc
@ -824,23 +824,23 @@ end: rts
.proc hscroll_common
sta compare+1
stx delta+1
loop: lda window_params::hthumbpos
loop: lda winfo::hthumbpos
compare:cmp #$0A ; self-modified
bne continue
rts
continue:
clc
lda window_params::hthumbpos
lda winfo::hthumbpos
delta: adc #1 ; self-modified
bmi overflow
cmp window_params::hthumbmax
cmp winfo::hthumbmax
beq store
bcc store
lda window_params::hthumbmax
lda winfo::hthumbmax
jmp store
overflow:
lda #0
store: sta window_params::hthumbpos
store: sta winfo::hthumbpos
jsr adjust_box_width
jsr update_hscroll
jsr draw_content
@ -874,44 +874,44 @@ store: sta window_params::hthumbpos
;;; only used from hscroll code?
.proc adjust_box_width
lda window_params::hthumbpos
lda winfo::hthumbpos
jsr mul_by_16
clc
lda $06
sta window_params::port::hoff
sta winfo::port::hoff
adc window_width
sta window_params::port::width
sta winfo::port::width
lda $07
sta window_params::port::hoff+1
sta winfo::port::hoff+1
adc window_width+1
sta window_params::port::width+1
sta winfo::port::width+1
rts
.endproc
.proc update_voffset
lda #0
sta window_params::port::voff
sta window_params::port::voff+1
sta winfo::port::voff
sta winfo::port::voff+1
ldx updatethumb_params::pos
loop: beq adjust_box_height
clc
lda window_params::port::voff
lda winfo::port::voff
adc #50
sta window_params::port::voff
sta winfo::port::voff
bcc :+
inc window_params::port::voff+1
inc winfo::port::voff+1
: dex
jmp loop
.endproc
.proc adjust_box_height
clc
lda window_params::port::voff
lda winfo::port::voff
adc window_height
sta window_params::port::height
lda window_params::port::voff+1
sta winfo::port::height
lda winfo::port::voff+1
adc window_height+1
sta window_params::port::height+1
sta winfo::port::height+1
jsr calc_line_position
lda #0
sta L096A
@ -932,9 +932,9 @@ end: rts
.proc update_hscroll
lda #2
sta updatethumb_params::type
lda window_params::port::hoff
lda winfo::port::hoff
sta $06
lda window_params::port::hoff+1
lda winfo::port::hoff+1
sta $07
jsr div_by_16
sta updatethumb_params::pos
@ -951,12 +951,12 @@ end: rts
.proc finish_resize ; only called from dead code
DESKTOP_CALL DESKTOP_REDRAW_ICONS
MGTK_CALL MGTK::SetPort, window_params::port
lda window_params::hscroll
MGTK_CALL MGTK::SetPort, winfo::port
lda winfo::hscroll
ror a ; check if low bit (track enabled) is set
bcc :+
jsr update_hscroll
: lda window_params::vthumbpos
: lda winfo::vthumbpos
sta updatethumb_params::pos
jsr update_vscroll
jsr draw_content
@ -965,7 +965,7 @@ end: rts
.proc clear_window
MGTK_CALL MGTK::SetPattern, white_pattern
MGTK_CALL MGTK::PaintRect, window_params::port::hoff
MGTK_CALL MGTK::PaintRect, winfo::port::hoff
MGTK_CALL MGTK::SetPattern, black_pattern
rts
.endproc
@ -1275,16 +1275,16 @@ end: rts
.proc calc_window_size
sec
lda window_params::port::width
sbc window_params::port::hoff
lda winfo::port::width
sbc winfo::port::hoff
sta window_width
lda window_params::port::width+1
sbc window_params::port::hoff+1
lda winfo::port::width+1
sbc winfo::port::hoff+1
sta window_width+1
sec
lda window_params::port::height
sbc window_params::port::voff
lda winfo::port::height
sbc winfo::port::voff
sta window_height
;; fall through
.endproc
@ -1292,9 +1292,9 @@ end: rts
;;; ==================================================
.proc calc_line_position
lda window_params::port::height
lda winfo::port::height
sta L0965
lda window_params::port::height+1
lda winfo::port::height+1
sta L0966
lda #0
@ -1450,14 +1450,14 @@ base: .word 10 ; vertical text offset (to baseline)
.proc calc_and_draw_mode
sec
lda window_params::port::top
lda winfo::port::top
sbc #title_bar_height
sta mode_box::top
clc
lda window_params::port::left
lda winfo::port::left
adc window_width
pha
lda window_params::port::left+1
lda winfo::port::left+1
adc window_width+1
tax
sec
@ -1481,9 +1481,9 @@ else: MGTK_CALL MGTK::DrawText, prop_str
endif: ldx #$0F
loop: lda default_box,x
sta window_params::port,x
sta winfo::port,x
dex
bpl loop
MGTK_CALL MGTK::SetPortBits, window_params::port
MGTK_CALL MGTK::SetPortBits, winfo::port
rts
.endproc