Identify TEST_BOX, refine SET_POS

This commit is contained in:
Joshua Bell 2017-09-09 12:18:06 -07:00
parent b20a8ffae2
commit e9d9e06545
3 changed files with 22 additions and 17 deletions

View File

@ -49,9 +49,9 @@ A2D_SET_PATTERN := $08
A2D_UNK_0C := $0C ; Unknown - used in calculator
A2D_SET_TEXT_POS:= $0E
;; .word left
;; .word base
A2D_SET_POS := $0E
;; .word x
;; .word y
A2D_FILL_RECT := $11 ; With selected pattern
;; .word left (includes scroll pos)
@ -65,6 +65,12 @@ A2D_DRAW_RECT := $12 ; With selected pattern
;; .word right pixels
;; .word bottom
A2D_TEST_BOX := $13 ; A false if pos (via SET_POS) outside box, true if inside
;; .word left
;; .word top
;; .word right
;; .word bottom
A2D_UNK_14 := $14 ; Unknown - draws push button (calculator)
A2D_MEASURE_TEXT := $18
@ -72,7 +78,7 @@ A2D_MEASURE_TEXT := $18
;; .byte length ???
;; .word width pixels
A2D_DRAW_TEXT := $19
A2D_DRAW_TEXT := $19 ; Drawn at last SET_POS as left, baseline
;; .addr data
;; .byte length
@ -87,7 +93,7 @@ A2D_SHOW_CURSOR := $25
A2D_HIDE_CURSOR := $26
;; no parameters (pass $0000 as address)
A2D_GET_INPUT := $2A
A2D_GET_INPUT := $2A
;; .byte state (0=up, 1=press, 2=release, 3=key, 4=held)
;; if state is not 3:
;; .byte key (ASCII code; high bit clear)

View File

@ -170,7 +170,6 @@ client := * + 5
clientx := * + 5
clienty := * + 7
.endproc
;; for button "in box" test this must be followed by width/height ???
.proc drag_params
id := *
@ -1002,7 +1001,7 @@ miss: clc
bne :+
ldx #<btn_c::box
ldy #>btn_c::box
lda #$63
lda #'c'
jsr depress_button
lda #$00
jsr FLOAT
@ -1023,7 +1022,7 @@ miss: clc
bne L0FC7
ldx #<btn_e::box
ldy #>btn_e::box
lda #$65
lda #'e'
jsr depress_button
ldy L0BC8
bne L0FC6
@ -1375,9 +1374,9 @@ check_button:
sta map_coords_params::id
A2D_CALL A2D_MAP_COORDS, map_coords_params
A2D_CALL A2D_SET_TEXT_POS, map_coords_params::client
A2D_CALL $13, 0, c13_addr ; probe for "in bounding box?"
bne :inside
A2D_CALL A2D_SET_POS, map_coords_params::client
A2D_CALL A2D_TEST_BOX, 0, c13_addr
bne inside
lda button_state ; outside, not down
beq check_button ; so keep looping
@ -1455,9 +1454,9 @@ loop: lda #' '
sec
sbc measure_text_params::width
sta text_pos_params3::left
A2D_CALL A2D_SET_TEXT_POS, text_pos_params2 ; clear with spaces
A2D_CALL A2D_SET_POS, text_pos_params2 ; clear with spaces
A2D_CALL A2D_DRAW_TEXT, spaces_string
A2D_CALL A2D_SET_TEXT_POS, text_pos_params3 ; set up for display
A2D_CALL A2D_SET_POS, text_pos_params3 ; set up for display
rts
.endproc
@ -1503,7 +1502,7 @@ loop: ldy #0
sta label
A2D_CALL $14, 0, c14_addr ; draw shadowed rect
A2D_CALL A2D_SET_TEXT_POS, 0, text_addr ; button label pos
A2D_CALL A2D_SET_POS, 0, text_addr ; button label pos
A2D_CALL A2D_DRAW_TEXT, draw_text_params_label ; button label text
lda ptr ; advance to next record
@ -1549,7 +1548,7 @@ draw_title_bar:
;; and returns to the input loop.
.proc error_hook
jsr reset_buffers_and_display
A2D_CALL A2D_SET_TEXT_POS, L0C4E
A2D_CALL A2D_SET_POS, L0C4E
A2D_CALL A2D_DRAW_TEXT, error_string
jsr reset_buffer1_and_state
lda #'='

View File

@ -1009,7 +1009,7 @@ L0E68: lda L096D
bne L0E7E
jsr L0E1D
inc L0948
L0E7E: A2D_CALL A2D_SET_TEXT_POS, line_pos
L0E7E: A2D_CALL A2D_SET_POS, line_pos
sec
lda #250
sbc line_pos::left
@ -1437,7 +1437,7 @@ base: .word 10 ; vertical text offset (to baseline)
.proc draw_mode
A2D_CALL A2D_TEXT_BOX2, mode_box ; guess: setting up draw location ???
A2D_CALL A2D_SET_TEXT_POS, mode_pos
A2D_CALL A2D_SET_POS, mode_pos
lda fixed_mode_flag
beq else ; is proportional?
A2D_CALL A2D_DRAW_TEXT, fixed_str