refactor WGCreateRadio

This commit is contained in:
4am 2018-03-03 09:31:01 -05:00
parent 053690ba47
commit 366d765998
2 changed files with 36 additions and 79 deletions

65
views.s
View File

@ -105,56 +105,9 @@ WGCreateView_done:
; SH: String pointer (MSB)
;
WGCreateCheckbox:
SAVE_AXY
ldy #0
lda (PARAM0),y ; Find our new view record
pha ; Cache view ID so we can select when we're done
asl
asl
asl
asl ; Records are 16 bytes wide
tax
iny
lda (PARAM0),y
sta WG_VIEWRECORDS+0,x ; Screen X
iny
lda (PARAM0),y
sta WG_VIEWRECORDS+1,x ; Screen Y
lda #1
sta WG_VIEWRECORDS+2,x ; Initialize screen width
sta WG_VIEWRECORDS+3,x ; Initialize screen height
sta WG_VIEWRECORDS+7,x ; Initialize view width
sta WG_VIEWRECORDS+8,x ; Initialize view height
pha
lda #VIEW_STYLE_CHECK
sta WG_VIEWRECORDS+4,x ; Style
stz WG_VIEWRECORDS+5,x ; Initialize scrolling
stz WG_VIEWRECORDS+6,x
stz WG_VIEWRECORDS+9,x ; Initialize state
stz WG_VIEWRECORDS+10,x ; Initialize callback
stz WG_VIEWRECORDS+11,x
iny
lda (PARAM0),y
sta WG_VIEWRECORDS+12,x ; Title
iny
lda (PARAM0),y
sta WG_VIEWRECORDS+13,x
pla
jsr WGSelectView ; Leave this as the active view
WGCreateCheckbox_done:
RESTORE_AXY
rts
bra WGCreate1x1_common
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGCreateRadio
@ -170,7 +123,11 @@ WGCreateCheckbox_done:
; SH: String pointer (MSB)
;
WGCreateRadio:
SAVE_AXY
pha
lda #VIEW_STYLE_RADIO
WGCreate1x1_common:
sta WGCreate1x1_style+1
SAVE_XY
ldy #0
lda (PARAM0),y ; Find our new view record
@ -196,7 +153,8 @@ WGCreateRadio:
sta WG_VIEWRECORDS+7,x ; Initialize view width
sta WG_VIEWRECORDS+8,x ; Initialize view height
lda #VIEW_STYLE_RADIO
WGCreate1x1_style:
lda #$FF ; Self-modifying code!
sta WG_VIEWRECORDS+4,x ; Style
stz WG_VIEWRECORDS+5,x ; Initialize scrolling
@ -216,13 +174,12 @@ WGCreateRadio:
pla
jsr WGSelectView ; Leave this as the active view
WGCreateRadio_done:
RESTORE_AXY
RESTORE_XY
pla
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGCreateProgress
; Creates a new progress bar

Binary file not shown.