diff --git a/applesoft.s b/applesoft.s index 027181e..086170e 100644 --- a/applesoft.s +++ b/applesoft.s @@ -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 diff --git a/weegui.dsk b/weegui.dsk index 7c41fae..8e7ae6f 100644 Binary files a/weegui.dsk and b/weegui.dsk differ diff --git a/weegui.s b/weegui.s index d59a64a..1b2df48 100644 --- a/weegui.s +++ b/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