I have the following code that displays a custom menu when the [prgm] key is pressed from homescreen. (There is a separate program to install the code as a hook)(Right now it just prints "test"). The custom [prgm] menu modifies vram, as you might imagine. When the custom menu is exited, it should restore the home screen exactly as it was. I know that "call _DrawStatusBar" will redraw the status bar, but i dont know how to restore the homescreen.
RawKey Hook:
Code:
RawKey Hook:
Code:
.nolist
#include "ti84pce.inc"
#define saferam plotSScreen
#macro relocate(new_location)
#define old_location eval($)
.org new_location
#define g_location eval(new_location)
#endmacro
#macro endrelocate()
#ifdef g_location
.org $-g_location + old_location
#undefine g_location
#undefine old_location
#endif
#endmacro
.list
.db $83
ld hl,(rawKeyHookPtr)
ld bc,5+hook_start-$
add hl,bc
ld de,saferam
ld bc,hook_end-hook_start
ldir
;ret
jp saferam
hook_start:
relocate(saferam)
;call _SaveScreen
ld c,a
cp kPrgm ; was Prgms pressed?
ret nz
ld hl,$D007E0
ld b,(hl)
ld a,kQuit
cp b
jr nz,returnNormal
;enter menu
xor a
ld (penCol),a
ld (penRow),a
ld hl,RKHTest
call _VPutS
keyWaitLoop:
call _GetCSC
cp 0
jr z,keyWaitLoop
ld c,0
returnNormal:
;call _RetScreen
;call _DrawStatusBar
ld a,c
ret
RKHTest:
.db "test",0
endrelocate()
hook_end: