From 366d765998779e34619521158be341147d84c8ee Mon Sep 17 00:00:00 2001 From: 4am Date: Sat, 3 Mar 2018 09:31:01 -0500 Subject: [PATCH] refactor WGCreateRadio --- views.s | 115 +++++++++++++++++------------------------------------ weegui.dsk | Bin 143360 -> 143360 bytes 2 files changed, 36 insertions(+), 79 deletions(-) diff --git a/views.s b/views.s index 66108bf..2e56ce2 100644 --- a/views.s +++ b/views.s @@ -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 - - 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 - + pha + lda #VIEW_STYLE_CHECK + bra WGCreate1x1_common ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; WGCreateRadio @@ -170,59 +123,63 @@ 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 - pha ; Cache view ID so we can select when we're done + 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 + asl ; Records are 16 bytes wide tax iny - lda (PARAM0),y - sta WG_VIEWRECORDS+0,x ; Screen X + lda (PARAM0),y + sta WG_VIEWRECORDS+0,x ; Screen X iny - lda (PARAM0),y - sta WG_VIEWRECORDS+1,x ; Screen Y + 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 + 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 - lda #VIEW_STYLE_RADIO - sta WG_VIEWRECORDS+4,x ; Style +WGCreate1x1_style: + lda #$FF ; Self-modifying code! + sta WG_VIEWRECORDS+4,x ; Style - stz WG_VIEWRECORDS+5,x ; Initialize scrolling - stz WG_VIEWRECORDS+6,x + 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 + 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 + lda (PARAM0),y + sta WG_VIEWRECORDS+12,x ; Title iny - lda (PARAM0),y - sta WG_VIEWRECORDS+13,x + lda (PARAM0),y + sta WG_VIEWRECORDS+13,x pla - jsr WGSelectView ; Leave this as the active view + jsr WGSelectView ; Leave this as the active view -WGCreateRadio_done: - RESTORE_AXY + RESTORE_XY + pla rts - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; WGCreateProgress ; Creates a new progress bar diff --git a/weegui.dsk b/weegui.dsk index a7913c136e035de73e14dbda39f9b88b95b4b1b4..f2848868e7d005ad23c51cd344953a9287ba5d4a 100644 GIT binary patch delta 5044 zcma)AdvH@#8b5h74+@(s&mm!b6*|pM^SCCR@N=qFd(^bn{b=*ZjyWcrCO$+GE z=8t>M`Of$KzUTSwxe;>DSy){7bj8j&naXyKwI8%Y+^f(GLiE~4uBP80lUJV5S;w(}7Y3t=K zOz_{w%Fy6Ntn>rUIT?W^k)u_!ot=0B=v@Nzs&D}zHuaR<7Bj9h=j}@!Q3LvtMyomG z*JvK-6%8_4Uo9GmnjO70Y^s|1XMW76ER3Sm39u*oprNU^dZeqvl2l{_(~xa_S}5|% zz#ZA6HPWU6>5l~@@aqGM=f8*3Dr!V$yc3t%*5!yfGFs=P%gCX?ePL>U`_GwI^F>Fz z8&84Xz9R!zVpit||6t5_7Zeq|jfPv8>IJ2Qq@s((7;mP2CSf0@iYRhq=i1q;#>L4V$PZw^0T4jYO+xs70M)cq zbvnDPi9zfXM0?EO3}@LJ263c*?W~)8pR6EjvI3%ih}w3EJ}23!s+rKzhm~w5Q6{5? zKFkbywnBJP)iDDbGqN!g8#A*RdoEz-bc<5LCVH`GNSwo>G0}&`mS0WNn-b@7r1UW+ z94Zs6%!@@#d8uGxUM&@L%x9%cfD4J{kZ1~t#*k=90DnLMEqHZRC1jB}Uy}UxO z%28ozdQ~iFWroxQoKYx(F>z^PnCSk1=)QoX$eEwCz-hLb1+N{cS310=N zow7zW1EgqDrc&dpqYN`zxE0J__RSzxtfC3Xwk^P6h(=*27+cCtXo53WCOQ&*EgPqY znX_y#-h-i#CWpn+t*_4p1!kdP5EB*%A#hoBt`ja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