Bug fixes

- Added Exit routine for cleaning up text state and memory allocation
- Quitting no longer leaves BASIC in inverse sometimes
- Quitting now cleans up ProDOS memory properly
- Added Applesoft API for Exit
This commit is contained in:
Quinn Dunki 2015-01-16 08:18:19 -08:00
parent 7efb0613e6
commit 639ba927fc
7 changed files with 59 additions and 5 deletions

View File

@ -796,6 +796,24 @@ Not available
&GET(A$)
</pre></td></tr></table>
<br>
Miscellaneous Routines
----------------------
Other stuff you might need.
####WGExit
Cleans up and shuts down WeeGUI. If you want your application to return cleanly to Applesoft when its down, you must call this. Otherwise you may get ProDOS complaining it is out of buffers, or other strange behaviour.
<table width=100%><tr><th>Assembly</th><th>Applesoft</th></tr><tr><td><pre>
X: WGExit
</td><td><pre>
&EXIT
</pre></td></tr></table>
<br><br>
<hr>
<br>

View File

@ -8,10 +8,6 @@ Known issues
To Do:
------
- Repainting a view while the mouse cursor is on it will cause artifacts when mouse moves
- Quitting sometimes leaves BASIC in inverted text mode
- Quitting with button highlighted leaves us in inverted text mode
- After initial run of basic demo, additional run fails with no buffers available
- Make WGFillRect support 1 height and 1 width
- If called in inverse mode, clear screen clears inverse
- Fix unclosed PRE tags in documentation

View File

@ -63,3 +63,5 @@ WGScrollY = 58
WGScrollYBy = 60
WGEnableMouse = 62
WGDisableMouse = 64
WGExit = 66

View File

@ -901,6 +901,16 @@ WGAmpersand_GETstore:
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGAmpersand_EXIT
; Shuts down WeeGUI
; &EXIT
WGAmpersand_EXIT:
jsr WGExit
jsr WGBottomCursor
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGBottomCursor
; Leave the cursor state in a place that Applesoft is happy with
@ -1078,6 +1088,9 @@ WGAmpersandCommandTable:
.byte TOKEN_GET,0,0,0,0,0
.addr WGAmpersand_GET
.byte "EXIT",0,0
.addr WGAmpersand_EXIT
;.byte TOKEN_GOSUB,0,0,0,0,0,0,0,0,0,0,0,0,0 ; For internal testing of the procedural gosub
;.addr WGAmpersand_GOSUB

View File

@ -159,6 +159,9 @@ keyLoop_focusOkay:
keyLoop_quit:
ldx #WGDisableMouse
jsr WeeGUI
ldx #WGExit
jsr WeeGUI
rts
testPaintContentsClick:

Binary file not shown.

View File

@ -71,7 +71,7 @@ WGEntryPointTable:
.addr WGScrollYBy
.addr WGEnableMouse
.addr WGDisableMouse
.addr WGExit
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGInit
@ -129,6 +129,28 @@ WGInit_clearMemLoop:
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGInit
; Cleanup Should be called once at app shutdown
WGExit:
pha
lda #CHAR_NORMAL
sta INVERSE
; Remove ourselves from ProDOS memory map
lda #%00000011
trb MEMBITMAP + $0f
lda #$ff
trb MEMBITMAP + $10
trb MEMBITMAP + $11
lda #%11111100
trb MEMBITMAP + $12
pla
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WG80
; Enables 80 column mode (and enhanced video firmware)