add WGReset

This commit is contained in:
4am 2018-03-03 09:46:36 -05:00
parent 366d765998
commit d3cad7db22
4 changed files with 38 additions and 9 deletions

View File

@ -1121,6 +1121,20 @@ X: WGExit
</table>
<br><br>
####WGReset
Deallocate all WeeGUI views and strings. This is called automatically during WeeGUI startup, but you can call it yourself at any time if you want to "start over" with no views. This does not clear the screen or repaint anything.
<table width="100%">
<tr><th>Assembly</th><th>Applesoft</th></tr><tr><td><pre>
X: WGReset
</pre></td><td><pre>
Not available
</pre></td></tr>
</table>
<br><br>
- - -

View File

@ -73,4 +73,5 @@ WGSetContentWidth = 78
WGSetContentHeight = 80
WGStrokeRoundRect = 82
WGCreateRadio = 84
WGReset = 86

Binary file not shown.

View File

@ -91,10 +91,24 @@ WGInit:
; sta LINNUML
; jsr SETHI
jsr WG80 ; Enter 80-col text mode
jsr WGInitApplesoft ; Set up Applesoft API
jsr WG80 ; Enter 80-col text mode
jsr WGInitApplesoft ; Set up Applesoft API
ldy #15 ; Clear our block allocators
RESTORE_AXY
jmp WGReset
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGReset
; Reset views and strings. Called from WGInit during app startup.
; Can also be called at any time to "start over" with no views.
; (Does not clear screen or repaint.)
;
WGReset:
SAVE_AXY
ldy #15 ; Clear our block allocators
WGInit_clearMemLoop:
tya
asl
@ -103,18 +117,18 @@ WGInit_clearMemLoop:
asl
tax
lda #0
sta WG_STRINGS,x
sta WG_VIEWRECORDS+2,x
sta WG_STRINGS,x
dey
bpl WGInit_clearMemLoop
lda #$ff
sta WG_PENDINGACTIONVIEW
sta WG_FOCUSVIEW
lda #$ff
sta WG_PENDINGACTIONVIEW
sta WG_FOCUSVIEW
RESTORE_AXY
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGExit
; Cleanup Should be called once at app shutdown