HIMEM now set properly to protect weegui code

This commit is contained in:
Quinn Dunki 2015-02-13 08:10:54 -08:00
parent 42d7777370
commit 666083762f
3 changed files with 15 additions and 2 deletions

View File

@ -34,6 +34,7 @@ AYINT = $e10c ; Convert FAC to 8-bit signed integer
GETBYT = $e6f8 ; Gets an integer at text pointer, stores in X
GETNUM = $e746 ; Gets an 8-bit, stores it X, skips past a comma
PTRGET = $dfe3 ; Finds the Applesoft variable in memory at text pointer
SETHI = $f299 ; Sets value in LINNUM to HIMEM
TOKEN_GOSUB = $b0 ; Applesoft's token for GOSUB
TOKEN_HOME = $97 ; Applesoft's token for HOME
@ -890,7 +891,7 @@ WGAmpersand_PDACTGosub:
; WGAmpersand_GET
; A non-blocking version of Applesoft GET. Returns 0 if no key
; is pending
; &GET(A$)
; &GET(A%)
WGAmpersand_GET:
jsr WGAmpersandBeginArguments

Binary file not shown.

View File

@ -108,6 +108,12 @@ WGInit:
lda #%11111100
tsb MEMBITMAP + $12
; Protect us from Applesoft by setting up HIMEM
lda #$7d ; 7d00
sta LINNUMH
stz LINNUML
jsr SETHI
jsr WG80 ; Enter 80-col text mode
jsr WGInitApplesoft ; Set up Applesoft API
@ -133,7 +139,7 @@ WGInit_clearMemLoop:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGInit
; WGExit
; Cleanup Should be called once at app shutdown
WGExit:
pha
@ -141,6 +147,12 @@ WGExit:
lda #CHAR_NORMAL
sta INVERSE
; Restore HIMEM to ProDOS default
lda #$96
sta LINNUMH
stz LINNUML
jsr SETHI
; Remove ourselves from ProDOS memory map
lda #%00000011
trb MEMBITMAP + $0f