mirror of
https://github.com/blondie7575/WeeGUI.git
synced 2024-06-20 02:29:27 +00:00
HIMEM now set properly to protect weegui code
This commit is contained in:
parent
42d7777370
commit
666083762f
|
@ -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
|
||||
|
|
BIN
weegui.dsk
BIN
weegui.dsk
Binary file not shown.
14
weegui.s
14
weegui.s
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user