Define TEXT_BOX calls

This commit is contained in:
Joshua Bell 2017-09-01 21:02:00 -07:00
parent 21805ba609
commit 7809552846
4 changed files with 88 additions and 66 deletions

View File

@ -24,6 +24,17 @@ JUMP_TABLE_14 := $403C
JUMP_TABLE_15 := $403F
A2D_TEXT_BOX1 := $04 ; Not sure what BOX1 vs. BOX2 is for
A2D_TEXT_BOX2 := $06 ; Not sure what BOX1 vs. BOX2 is for
;; .word left pixels from screen edge
;; .word top
;; .word $2000 ???
;; .word $80 ???
;; .word hoffset pixels scrolled
;; .word voffset
;; .word width pixels
;; .word height
A2D_SET_TEXT_POS:= $0E
;; .word left
;; .word base

View File

@ -101,6 +101,17 @@ Current file: stf.s
000800 2 JUMP_TABLE_15 := $403F
000800 2
000800 2
000800 2 A2D_TEXT_BOX1 := $04 ; Not sure what BOX1 vs. BOX2 is for
000800 2 A2D_TEXT_BOX2 := $06 ; Not sure what BOX1 vs. BOX2 is for
000800 2 ;; .word left pixels from screen edge
000800 2 ;; .word top
000800 2 ;; .word $2000 ???
000800 2 ;; .word $80 ???
000800 2 ;; .word hoffset pixels scrolled
000800 2 ;; .word voffset
000800 2 ;; .word width pixels
000800 2 ;; .word height
000800 2
000800 2 A2D_SET_TEXT_POS:= $0E
000800 2 ;; .word left
000800 2 ;; .word base
@ -539,8 +550,8 @@ Current file: stf.s
0009AA 1 1C 00 top: .word 28
0009AC 1 00 20 .word $2000 ; ??? never changed
0009AE 1 80 00 .word $80 ; ??? never changed
0009B0 1 00 00 unk1: .word 0 ; ???
0009B2 1 00 00 unk2: .word 0 ; ???
0009B0 1 00 00 hoffset:.word 0
0009B2 1 00 00 voffset:.word 0
0009B4 1 00 02 width: .word 512
0009B6 1 96 00 height: .word 150
0009B8 1 .endproc
@ -559,8 +570,8 @@ Current file: stf.s
0009D0 1 1C 00 top: .word 28
0009D2 1 00 20 .word $2000
0009D4 1 80 00 .word $80
0009D6 1 00 00 unk1: .word 0
0009D8 1 00 00 unk2: .word 0
0009D6 1 00 00 hoffset:.word 0
0009D8 1 00 00 voffset:.word 0
0009DA 1 00 02 width: .word 512
0009DC 1 96 00 height: .word 150
0009DE 1 .endproc
@ -706,7 +717,7 @@ Current file: stf.s
000AB6 1 ;; create window
000AB6 1 20 00 40 38 A2D_CALL A2D_CREATE_WINDOW, window_params
000ABA 1 94 09
000ABC 1 20 00 40 04 A2D_CALL $04, text_box
000ABC 1 20 00 40 04 A2D_CALL A2D_TEXT_BOX1, text_box
000AC0 1 A8 09
000AC2 1 20 88 10 jsr L1088
000AC5 1 20 98 11 jsr calc_and_draw_mode
@ -792,10 +803,10 @@ Current file: stf.s
000B60 1 38 sec
000B61 1 AD B4 09 lda text_box::width
000B64 1 ED 61 09 sbc window_width
000B67 1 8D B0 09 sta text_box::unk1
000B67 1 8D B0 09 sta text_box::hoffset
000B6A 1 AD B5 09 lda text_box::width+1
000B6D 1 ED 62 09 sbc window_width+1
000B70 1 8D B1 09 sta text_box::unk1+1
000B70 1 8D B1 09 sta text_box::hoffset+1
000B73 1 AD 98 09 wider: lda window_params::L0998
000B76 1 AE 61 09 ldx window_width
000B79 1 E0 00 cpx #<max_width
@ -983,14 +994,14 @@ Current file: stf.s
000CBD 1 AD 8F 09 lda thumb_drag_params::pos
000CC0 1 20 EC 10 jsr L10EC
000CC3 1 A5 06 lda $06
000CC5 1 8D B0 09 sta text_box::unk1
000CC5 1 8D B0 09 sta text_box::hoffset
000CC8 1 A5 07 lda $07
000CCA 1 8D B1 09 sta text_box::unk1+1
000CCA 1 8D B1 09 sta text_box::hoffset+1
000CCD 1 18 clc
000CCE 1 AD B0 09 lda text_box::unk1
000CCE 1 AD B0 09 lda text_box::hoffset
000CD1 1 6D 61 09 adc window_width
000CD4 1 8D B4 09 sta text_box::width
000CD7 1 AD B1 09 lda text_box::unk1+1
000CD7 1 AD B1 09 lda text_box::hoffset+1
000CDA 1 6D 62 09 adc window_width+1
000CDD 1 8D B5 09 sta text_box::width+1
000CE0 1 20 D1 0D jsr update_hscroll
@ -1083,11 +1094,11 @@ Current file: stf.s
000D61 1 20 EC 10 jsr L10EC
000D64 1 18 clc
000D65 1 A5 06 lda $06
000D67 1 8D B0 09 sta text_box::unk1
000D67 1 8D B0 09 sta text_box::hoffset
000D6A 1 6D 61 09 adc window_width
000D6D 1 8D B4 09 sta text_box::width
000D70 1 A5 07 lda $07
000D72 1 8D B1 09 sta text_box::unk1+1
000D72 1 8D B1 09 sta text_box::hoffset+1
000D75 1 6D 62 09 adc window_width+1
000D78 1 8D B5 09 sta text_box::width+1
000D7B 1 60 rts
@ -1095,26 +1106,26 @@ Current file: stf.s
000D7C 1
000D7C 1 .proc L0D7C ; ?? part of vscroll
000D7C 1 A9 00 lda #0
000D7E 1 8D B2 09 sta text_box::unk2
000D81 1 8D B3 09 sta text_box::unk2+1
000D7E 1 8D B2 09 sta text_box::voffset
000D81 1 8D B3 09 sta text_box::voffset+1
000D84 1 AE 89 09 ldx update_scroll_params::pos
000D87 1 F0 12 loop: beq L0D9B
000D89 1 18 clc
000D8A 1 AD B2 09 lda text_box::unk2
000D8A 1 AD B2 09 lda text_box::voffset
000D8D 1 69 32 adc #50
000D8F 1 8D B2 09 sta text_box::unk2
000D8F 1 8D B2 09 sta text_box::voffset
000D92 1 90 03 bcc :+
000D94 1 EE B3 09 inc text_box::unk2+1
000D94 1 EE B3 09 inc text_box::voffset+1
000D97 1 CA : dex
000D98 1 4C 87 0D jmp loop
000D9B 1 .endproc
000D9B 1
000D9B 1 .proc L0D9B ; ?? part of vscroll
000D9B 1 18 clc
000D9C 1 AD B2 09 lda text_box::unk2
000D9C 1 AD B2 09 lda text_box::voffset
000D9F 1 6D 63 09 adc window_height
000DA2 1 8D B6 09 sta text_box::height
000DA5 1 AD B3 09 lda text_box::unk2+1
000DA5 1 AD B3 09 lda text_box::voffset+1
000DA8 1 6D 64 09 adc window_height+1
000DAB 1 8D B7 09 sta text_box::height+1
000DAE 1 20 A5 10 jsr L10A5
@ -1137,9 +1148,9 @@ Current file: stf.s
000DD1 1 .proc update_hscroll
000DD1 1 A9 02 lda #2
000DD3 1 8D 88 09 sta update_scroll_params::type
000DD6 1 AD B0 09 lda text_box::unk1
000DD6 1 AD B0 09 lda text_box::hoffset
000DD9 1 85 06 sta $06
000DDB 1 AD B1 09 lda text_box::unk1+1
000DDB 1 AD B1 09 lda text_box::hoffset+1
000DDE 1 85 07 sta $07
000DE0 1 20 DF 10 jsr L10DF
000DE3 1 8D 89 09 sta update_scroll_params::pos
@ -1160,7 +1171,7 @@ Current file: stf.s
000DF9 1 20 00 8E jsr UNKNOWN_CALL
000DFC 1 0C .byte $0C
000DFD 1 00 00 .addr 0
000DFF 1 20 00 40 04 A2D_CALL $04, text_box
000DFF 1 20 00 40 04 A2D_CALL A2D_TEXT_BOX1, text_box
000E03 1 A8 09
000E05 1 AD 98 09 lda window_params::L0998
000E08 1 6A ror a
@ -1175,7 +1186,7 @@ Current file: stf.s
000E1D 1
000E1D 1 20 00 40 08 L0E1D: A2D_CALL $08, L0952
000E21 1 52 09
000E23 1 20 00 40 11 A2D_CALL $11, text_box::unk1 ; ?? params are in middle of block?
000E23 1 20 00 40 11 A2D_CALL $11, text_box::hoffset ; ?? params are in middle of block?
000E27 1 B0 09
000E29 1 20 00 40 08 A2D_CALL $08, L094A
000E2D 1 4A 09
@ -1201,7 +1212,7 @@ Current file: stf.s
000E57 1 8D 6C 09 sta L096C
000E5A 1 8D 6D 09 sta L096D
000E5D 1 8D 48 09 sta L0948
000E60 1 A9 0A lda #$0A
000E60 1 A9 0A lda #$0A ; line spacing = 10
000E62 1 8D 5F 09 sta line_pos::base
000E65 1 20 DB 0E jsr L0EDB
000E68 1 AD 6D 09 L0E68: lda L096D
@ -1233,7 +1244,7 @@ Current file: stf.s
000EA9 1 D0 BD bne L0E68
000EAB 1 18 clc
000EAC 1 AD 5F 09 lda line_pos::base
000EAF 1 69 0A adc #$0A
000EAF 1 69 0A adc #$0A ; line spacing = 10
000EB1 1 8D 5F 09 sta line_pos::base
000EB4 1 90 03 bcc L0EB9
000EB6 1 EE 60 09 inc line_pos::base+1
@ -1458,14 +1469,14 @@ Current file: stf.s
001088 1
001088 1 38 L1088: sec
001089 1 AD B4 09 lda text_box::width
00108C 1 ED B0 09 sbc text_box::unk1
00108C 1 ED B0 09 sbc text_box::hoffset
00108F 1 8D 61 09 sta window_width
001092 1 AD B5 09 lda text_box::width+1
001095 1 ED B1 09 sbc text_box::unk1+1
001095 1 ED B1 09 sbc text_box::hoffset+1
001098 1 8D 62 09 sta window_width+1
00109B 1 38 sec
00109C 1 AD B6 09 lda text_box::height
00109F 1 ED B2 09 sbc text_box::unk2
00109F 1 ED B2 09 sbc text_box::voffset
0010A2 1 8D 63 09 sta window_height
0010A5 1 AD B6 09 L10A5: lda text_box::height
0010A8 1 8D 65 09 sta L0965
@ -1598,8 +1609,8 @@ Current file: stf.s
001186 1 00 00 top: .word 0
001188 1 00 20 .word $2000 ; ??
00118A 1 80 00 .word $80 ; ??
00118C 1 00 00 .word 0 ; ??
00118E 1 00 00 .word 0 ; ??
00118C 1 00 00 hoffset:.word 0
00118E 1 00 00 voffset:.word 0
001190 1 50 00 width: .word 80
001192 1 0A 00 height: .word 10
001194 1 .endproc
@ -1634,7 +1645,7 @@ Current file: stf.s
0011BD 1 .endproc
0011BD 1
0011BD 1 .proc draw_mode
0011BD 1 20 00 40 06 A2D_CALL $06, mode_box ; guess: setting up draw location ???
0011BD 1 20 00 40 06 A2D_CALL A2D_TEXT_BOX2, mode_box ; guess: setting up draw location ???
0011C1 1 84 11
0011C3 1 20 00 40 0E A2D_CALL A2D_SET_TEXT_POS, mode_pos
0011C7 1 94 11
@ -1651,7 +1662,7 @@ Current file: stf.s
0011E2 1 9D A8 09 sta text_box,x
0011E5 1 CA dex
0011E6 1 10 F7 bpl loop
0011E8 1 20 00 40 06 A2D_CALL $06, text_box
0011E8 1 20 00 40 06 A2D_CALL A2D_TEXT_BOX2, text_box
0011EC 1 A8 09
0011EE 1 60 rts
0011EF 1 .endproc

Binary file not shown.

View File

@ -320,8 +320,8 @@ left: .word 10
top: .word 28
.word $2000 ; ??? never changed
.word $80 ; ??? never changed
unk1: .word 0 ; ???
unk2: .word 0 ; ???
hoffset:.word 0
voffset:.word 0
width: .word 512
height: .word 150
.endproc
@ -337,8 +337,8 @@ left: .word 10
top: .word 28
.word $2000
.word $80
unk1: .word 0
unk2: .word 0
hoffset:.word 0
voffset:.word 0
width: .word 512
height: .word 150
.endproc
@ -483,7 +483,7 @@ loop: lda $8802,x
;; create window
A2D_CALL A2D_CREATE_WINDOW, window_params
A2D_CALL $04, text_box
A2D_CALL A2D_TEXT_BOX1, text_box
jsr L1088
jsr calc_and_draw_mode
jsr draw_content
@ -562,10 +562,10 @@ title: jsr on_title_bar_click
sec
lda text_box::width
sbc window_width
sta text_box::unk1
sta text_box::hoffset
lda text_box::width+1
sbc window_width+1
sta text_box::unk1+1
sta text_box::hoffset+1
wider: lda window_params::L0998
ldx window_width
cpx #<max_width
@ -751,14 +751,14 @@ loop: inx
lda thumb_drag_params::pos
jsr L10EC
lda $06
sta text_box::unk1
sta text_box::hoffset
lda $07
sta text_box::unk1+1
sta text_box::hoffset+1
clc
lda text_box::unk1
lda text_box::hoffset
adc window_width
sta text_box::width
lda text_box::unk1+1
lda text_box::hoffset+1
adc window_width+1
sta text_box::width+1
jsr update_hscroll
@ -849,11 +849,11 @@ store: sta window_params::L099B
jsr L10EC
clc
lda $06
sta text_box::unk1
sta text_box::hoffset
adc window_width
sta text_box::width
lda $07
sta text_box::unk1+1
sta text_box::hoffset+1
adc window_width+1
sta text_box::width+1
rts
@ -861,26 +861,26 @@ store: sta window_params::L099B
.proc L0D7C ; ?? part of vscroll
lda #0
sta text_box::unk2
sta text_box::unk2+1
sta text_box::voffset
sta text_box::voffset+1
ldx update_scroll_params::pos
loop: beq L0D9B
clc
lda text_box::unk2
lda text_box::voffset
adc #50
sta text_box::unk2
sta text_box::voffset
bcc :+
inc text_box::unk2+1
inc text_box::voffset+1
: dex
jmp loop
.endproc
.proc L0D9B ; ?? part of vscroll
clc
lda text_box::unk2
lda text_box::voffset
adc window_height
sta text_box::height
lda text_box::unk2+1
lda text_box::voffset+1
adc window_height+1
sta text_box::height+1
jsr L10A5
@ -903,9 +903,9 @@ end: rts
.proc update_hscroll
lda #2
sta update_scroll_params::type
lda text_box::unk1
lda text_box::hoffset
sta $06
lda text_box::unk1+1
lda text_box::hoffset+1
sta $07
jsr L10DF
sta update_scroll_params::pos
@ -924,7 +924,7 @@ end: rts
jsr UNKNOWN_CALL
.byte $0C
.addr 0
A2D_CALL $04, text_box
A2D_CALL A2D_TEXT_BOX1, text_box
lda window_params::L0998
ror a
bcc :+
@ -937,7 +937,7 @@ end: rts
.endproc
L0E1D: A2D_CALL $08, L0952
A2D_CALL $11, text_box::unk1 ; ?? params are in middle of block?
A2D_CALL $11, text_box::hoffset ; ?? params are in middle of block?
A2D_CALL $08, L094A
rts
@ -961,7 +961,7 @@ L0E1D: A2D_CALL $08, L0952
sta L096C
sta L096D
sta L0948
lda #$0A
lda #$0A ; line spacing = 10
sta line_pos::base
jsr L0EDB
L0E68: lda L096D
@ -992,7 +992,7 @@ L0EA6: lda L095A
bne L0E68
clc
lda line_pos::base
adc #$0A
adc #$0A ; line spacing = 10
sta line_pos::base
bcc L0EB9
inc line_pos::base+1
@ -1216,14 +1216,14 @@ end: rts
L1088: sec
lda text_box::width
sbc text_box::unk1
sbc text_box::hoffset
sta window_width
lda text_box::width+1
sbc text_box::unk1+1
sbc text_box::hoffset+1
sta window_width+1
sec
lda text_box::height
sbc text_box::unk2
sbc text_box::voffset
sta window_height
L10A5: lda text_box::height
sta L0965
@ -1352,8 +1352,8 @@ left: .word 0
top: .word 0
.word $2000 ; ??
.word $80 ; ??
.word 0 ; ??
.word 0 ; ??
hoffset:.word 0
voffset:.word 0
width: .word 80
height: .word 10
.endproc
@ -1388,7 +1388,7 @@ base: .word 10 ; vertical text offset (to baseline)
.endproc
.proc draw_mode
A2D_CALL $06, mode_box ; guess: setting up draw location ???
A2D_CALL A2D_TEXT_BOX2, mode_box ; guess: setting up draw location ???
A2D_CALL A2D_SET_TEXT_POS, mode_pos
lda fixed_mode_flag
beq else ; is proportional?
@ -1401,6 +1401,6 @@ loop: lda default_box,x
sta text_box,x
dex
bpl loop
A2D_CALL $06, text_box
A2D_CALL A2D_TEXT_BOX2, text_box
rts
.endproc