TI-83 Plus SDK/Hooks Programming Information ============================================ Information provided by Dan Englender (dan@calc.org) Studied and transcribed into a readable document by Michael Vincent (michael@radicalsoft.org) ** INFO This document assumes you have the 83+ SDK and are familar with Z80 ASM programming. ** CONTENTS Key hooks ** KEY HOOKS ** There are two kinds of key hooks, RawKeyHook and GetKeyHook. Important: Someone at TI reversed the names, so pay attention. RawKeyHook is executed when _getkey is pressed (on par with it). GetKeyHook is executed constantly (on par with _getcsc). RawKeyHook is the more useful, so we will cover that first. ---RawKeyHook--- Installation: B_CALL(4F66h) with the following inputs: A = ROM page hook is on, HL points to hook address. Usage: The routine you set up upon installation will be called whenever _getkey is executed. When the routine is called, it will receive the following inputs: A = Key code of the key pressed You will need to have the following as outputs: A = New key code Zero flag is set if you want the keypress ignored, otherwise nonzero flag to execute the keypress. There are some odd things in the calc's operation. You must have "add a,e" in your routine too. Working sample code is below (disables 2nd+Mem press): ;App header before here ld hl,keyhook ;Load HL with pointer to routine in a,(6) ;Get the current ROM page in A bcall($4F66) ;Call RawKeyHook bjump(_JForceCmdNoChar) ;Return to TI-OS keyhook: ;The actual routine add a,e ;This is required for it to work cp $36 ;Is the key 2nd+Mem? ret nz ;Exit if not xor a ;If so, set zero flag so it doesn't work ret ;Exit