Identify more state params/calls

This commit is contained in:
Joshua Bell 2017-09-13 21:35:23 -07:00
parent ae232b1cf4
commit 12acca8db7
6 changed files with 72 additions and 58 deletions

View File

@ -41,10 +41,9 @@ JUMP_TABLE_3F := $403F ; ???
;;; if <0, and with $7E to get length
;;; if $4185,(call*2) is non-zero, param block is copied.
A2D_QUERY_SCREEN := $03 ; Get screen info
A2D_QUERY_SCREEN := $03 ; Get screen state
;; (input length 0 bytes)
;; (output length 35 bytes)
;; (output length 35 bytes - NOT 36)
;; .word left
;; .word top
;; .addr addr A2D_SCREEN_ADDR
@ -54,28 +53,32 @@ A2D_QUERY_SCREEN := $03 ; Get screen info
;; .word width 560-1
;; .word height 192-1
;; .res 8 pattern
;; .byte $FF,0,0,0,0 ???
;; .byte 1,1,0,$7F,0,$88 line w,h, ???
;; .byte mskand AND mask, default $FF
;; .byte mskor ORA mask, default $00
;; .byte 0,0,0 ???
;; .byte hthick horizontal pen thickness
;; .byte vthick vertical pen thickness
;; .byte 0,$7F,0,$88 ??? (note: one byte shorter than SET_STATE)
A2D_SET_BOX1 := $04 ; Not sure what BOX1 vs. BOX2 is for
A2D_SET_STATE := $04 ; Set full drawing state
;; (input length 36 bytes)
;; - first part is like A2D_SET_BOX2
;; .word left pixels from screen edge
;; .word top
;; .addr addr A2D_SCREEN_ADDR ($2000)
;; .word stride A2D_SCREEN_STRIDE ($80)
;; .addr addr A2D_SCREEN_ADDR
;; .word stride A2D_SCREEN_STRIDE
;; .word hoffset pixels scrolled
;; .word voffset
;; .word width pixels
;; .word height
;; -- next part is full draw state ???
;; .res 8 pattern
;; .byte $FF,0,0,0,0 ???
;; .byte and_mask default $FF
;; .byte or_mask default $00
;; .byte 0,0,0 ???
;; .byte hthick horizontal pen thickness
;; .byte vthick vertical pen thickness
;; .byte 0,$7F,0,$88
;; .byte 0,$7F,0,$88,0
A2D_SET_BOX2 := $06 ; set vs. intersect? (not quite)
A2D_SET_BOX := $06 ; Set just the drawing box, subset of full state
;; (input length 16 bytes)
;; .word left pixels from screen edge
;; .word top
@ -205,7 +208,7 @@ A2D_CREATE_WINDOW := $38
;; .word height_a ???
;; .word width_b (of scroll area?)
;; .word height_b (of scroll area?)
;; - next section is identical to that for A2D_SET_BOX1
;; - next section is identical to that for A2D_SET_STATE
;; .word left pixels from screen edge
;; .word top
;; .word screen_addr
@ -215,7 +218,9 @@ A2D_CREATE_WINDOW := $38
;; .word width pixels
;; .word height
;; .res 8 pattern
;; .byte $FF,$00,$00,$00,$00,$00 ???
;; .byte and_mask default $FF
;; .byte or_mask default $00
;; .byte 0,0,0 ???
;; .byte hthick
;; .byte vthick
;; .byte $00,$7F,$00,$88,$00,$00 ???
@ -224,10 +229,10 @@ A2D_DESTROY_WINDOW := $39
;; (input length 1 byte)
;; .byte id
A2D_QUERY_BOX := $3C ; get client "box" of window
A2D_QUERY_STATE := $3C ; get drawing state of window
;; (input length 3 bytes)
;; .byte id window
;; .addr box box definition to populate, like A2D_SET_BOX1
;; .addr state state definition to populate, like A2D_SET_STATE
A2D_QUERY_TARGET := $40
;; (input length 4 bytes)
@ -300,7 +305,7 @@ A2D_UPDATE_SCROLL:= $4B
;;; ==================================================
;;; Constants
;;; Used in A2D_QUERY_BOX / A2D_SET_BOX
;;; Used in A2D_QUERY_STATE / A2D_SET_BOX
A2D_SCREEN_ADDR := $2000 ; Screen address
A2D_SCREEN_STRIDE := $80 ; Stride in bytes (???)

View File

@ -115,8 +115,8 @@ call_init:
skip: lda #0
sta L089D
lda ROMIN2
A2D_CALL A2D_QUERY_BOX, query_box_params
A2D_CALL A2D_SET_BOX1, box_params
A2D_CALL A2D_QUERY_STATE, query_state_params
A2D_CALL A2D_SET_STATE, state_params
rts
.proc routine
@ -138,7 +138,7 @@ L089D: .byte 0
;; Called after window drag is complete
;; (called with window_id in A)
.proc draw_window
sta query_box_params_id
sta query_state_params_id
lda create_window_params_top
cmp #screen_height - 1
bcc :+
@ -146,9 +146,9 @@ L089D: .byte 0
sta L089D
rts
: A2D_CALL A2D_QUERY_BOX, query_box_params
A2D_CALL A2D_SET_BOX1, box_params
lda query_box_params_id
: A2D_CALL A2D_QUERY_STATE, query_state_params
A2D_CALL A2D_SET_STATE, state_params
lda query_state_params_id
cmp #window_id
bne :+
jmp draw_background
@ -198,11 +198,11 @@ id: .byte 0
state: .byte 0
.endproc
.proc query_box_params
.proc query_state_params
id: .byte 0
.addr box_params
.addr state_params
.endproc
query_box_params_id := query_box_params::id
query_state_params_id := query_state_params::id
;; param block for a 1A call
L08D4: .byte $80
@ -675,8 +675,8 @@ pixels: .byte px(%1000001)
.byte px(%1001001)
.endproc
;; param block for a QUERY_SCREEN and SET_BOX1 calls, and ref'd in A2D_QUERY_BOX call
.proc box_params
;; param block for a QUERY_SCREEN and SET_STATE calls, and ref'd in QUERY_STATE call
.proc state_params
left: .word 0
top: .word 0
addr: .word 0
@ -686,8 +686,9 @@ voffset:.word 0
width: .word 0
height: .word 0
pattern:.res 8, 0
.byte 0
.byte 0,0,0,0,0 ; ???
mskand: .byte 0
mskor: .byte 0
.byte 0,0,0,0 ; ???
hthick: .byte 0
vthick: .byte 0
.byte 0,0,0,0,0 ; ???
@ -697,7 +698,7 @@ vthick: .byte 0
screen_width := 560
screen_height := 192
;; params for A2D_SET_BOX2 when decorating title bar
;; params for A2D_SET_BOX when decorating title bar
.proc screen_box
.word 0
.word menu_bar_height
@ -747,8 +748,9 @@ voffset:.word 0
width: .word window_width
height: .word window_height
pattern:.res 8, $FF
.byte $FF ; ???
.byte 0,0,0,0,0 ; ???
mskand: .byte $FF
mskor: .byte $00
.byte 0,0,0,0 ; ???
hthick: .byte 1
vthick: .byte 1
.byte $00,$7F,$00,$88,$00,$00 ; ???
@ -774,8 +776,8 @@ L0D18: sta ALTZPON
lda LCBANK1
A2D_CALL $1A, L08D4
A2D_CALL A2D_CREATE_WINDOW, create_window_params
A2D_CALL A2D_QUERY_SCREEN, box_params
A2D_CALL A2D_SET_BOX1, box_params ; set clipping bounds?
A2D_CALL A2D_QUERY_SCREEN, state_params
A2D_CALL A2D_SET_STATE, state_params ; set clipping bounds?
A2D_CALL $2B ; reset drawing state?
lda #$01
sta input_state_params::state
@ -1636,12 +1638,12 @@ draw_title_bar:
bcs :+
dex
: stx title_bar_decoration::top+1
A2D_CALL A2D_SET_BOX2, screen_box ; set clipping rect to whole screen
A2D_CALL A2D_SET_BOX, screen_box ; set clipping rect to whole screen
A2D_CALL A2D_DRAW_PATTERN, title_bar_decoration ; Draws decoration in title bar
lda #window_id
sta query_box_params::id
A2D_CALL A2D_QUERY_BOX, query_box_params ; get client rect
A2D_CALL A2D_SET_BOX1, box_params ; clip rect?
sta query_state_params::id
A2D_CALL A2D_QUERY_STATE, query_state_params
A2D_CALL A2D_SET_STATE, state_params
A2D_CALL A2D_SHOW_CURSOR
jsr display_buffer2
rts

View File

@ -283,7 +283,9 @@ width: .word $C7
height: .word $40
.endproc
pattern:.res 8,$00
.byte $FF,$00,$00,$00,$00,$00
mskand: .byte $FF
mskor: .byte $00
.byte $00,$00,$00,$00
hthick: .byte 4
vthick: .byte 2
.byte $00,$7F,$00,$88,$00,$00
@ -786,7 +788,7 @@ vthick: .byte 1
;;; Render the window contents
draw_window:
A2D_CALL A2D_SET_BOX1, create_window_params::box
A2D_CALL A2D_SET_STATE, create_window_params::box
A2D_CALL A2D_DRAW_RECT, border_rect
A2D_CALL A2D_SET_THICKNESS, thickness_params
A2D_CALL A2D_DRAW_RECT, date_rect

View File

@ -133,8 +133,8 @@ L08B4: sta query_box_params_id
sta L08B3
rts
: A2D_CALL A2D_QUERY_BOX, query_box_params
A2D_CALL A2D_SET_BOX1, set_box_params
: A2D_CALL A2D_QUERY_STATE, query_box_params
A2D_CALL A2D_SET_STATE, set_box_params
lda query_box_params_id
cmp #window_id
bne :+
@ -562,7 +562,7 @@ id: .byte window_id
.byte $00,$00,$00,$00,$00,$06,$00,$05
.byte $00,$41,$35,$47,$37,$36,$49
;; SET_BOX1 params (filled in by QUERY_BOX)
;; SET_STATE params (filled in by QUERY_STATE)
set_box_params:
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
@ -604,13 +604,14 @@ width: .word default_width
height: .word default_height
pattern:.res 8, $FF
.byte $FF,$00
mskand: .byte $FF
mskor: .byte $00
.byte $00,$00,$00,$00
hthick: .byte 1
vthick: .byte 1
.byte $00,$7F,$00,$88,$00,$00
;; This is QUERY_BOX/SET_BOX cruft only below
;; This is QUERY_STATE/SET_BOX cruft only below
.word default_left
.word default_top
@ -957,8 +958,8 @@ L1072: A2D_CALL A2D_SET_PATTERN, pattern_speckles
lda #window_id
sta query_box_params::id
A2D_CALL A2D_QUERY_BOX, query_box_params
A2D_CALL A2D_SET_BOX1, set_box_params
A2D_CALL A2D_QUERY_STATE, query_box_params
A2D_CALL A2D_SET_STATE, set_box_params
rts
;;; ==================================================
@ -1023,8 +1024,8 @@ saved_zp:
A2D_CALL A2D_HIDE_CURSOR
lda #window_id
sta query_box_params::id
A2D_CALL A2D_QUERY_BOX, query_box_params
A2D_CALL A2D_SET_BOX1, set_box_params
A2D_CALL A2D_QUERY_STATE, query_box_params
A2D_CALL A2D_SET_STATE, set_box_params
pla
tay

View File

@ -238,7 +238,9 @@ height: .word default_height
.endproc
pattern:.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $FF,$00,$00,$00,$00,$00
mskand: .byte $FF
mskor: .byte $00
.byte $00,$00,$00,$00
hthick: .byte 1
vthick: .byte 1
.byte $00,$7F,$00,$88,$00,$00
@ -357,7 +359,7 @@ end: rts
;; create window
A2D_CALL A2D_CREATE_WINDOW, window_params
A2D_CALL A2D_SET_BOX1, window_params::box
A2D_CALL A2D_SET_STATE, window_params::box
jsr show_file

View File

@ -328,7 +328,9 @@ height: .word default_height
.endproc
pattern:.res 8, $00
.byte $FF,$00,$00,$00,$00,$00
mskand: .byte $FF
mskor: .byte $00
.byte $00,$00,$00,$00
hthick: .byte 1
vthick: .byte 1
.byte $00,$7F,$00,$88,$00,$00
@ -489,7 +491,7 @@ loop: lda $8802,x
;; create window
A2D_CALL A2D_CREATE_WINDOW, window_params
A2D_CALL A2D_SET_BOX1, window_params::box
A2D_CALL A2D_SET_STATE, window_params::box
jsr calc_window_size
jsr calc_and_draw_mode
jsr draw_content
@ -948,7 +950,7 @@ end: rts
jsr UNKNOWN_CALL
.byte $0C
.addr 0
A2D_CALL A2D_SET_BOX1, window_params::box
A2D_CALL A2D_SET_STATE, window_params::box
lda window_params::hscroll
ror a ; check if low bit (track enabled) is set
bcc :+
@ -1426,7 +1428,7 @@ base: .word 10 ; vertical text offset (to baseline)
.endproc
.proc draw_mode
A2D_CALL A2D_SET_BOX2, mode_box ; guess: setting up draw location ???
A2D_CALL A2D_SET_BOX, mode_box ; guess: setting up draw location ???
A2D_CALL A2D_SET_POS, mode_pos
lda fixed_mode_flag
beq else ; is proportional?
@ -1439,6 +1441,6 @@ loop: lda default_box,x
sta window_params::box,x
dex
bpl loop
A2D_CALL A2D_SET_BOX2, window_params::box
A2D_CALL A2D_SET_BOX, window_params::box
rts
.endproc