Today on SAX, the ONSCRIPT and OFFSCRIPT functions in the z80 and ez80 calculators' TI-OS were being discussed. For the uninitiated, these respectively contain code that is copied to (appData + 1) (that is, $8001 on the z80 calculators) and executed when the calculator is turning on after APD, or turning off. They're commonly used for things like automatically launching programs or Apps when the calculator is turned on. The discussion today revealed a few things that should be recorded for posterity:
Anything else you guys wish to add to this?
- As long-known, ONSCRIPT is unreliable. Specifically, it only triggered after an APD poweroff, not a 2nd-OFF (user) poweroff. MateoConLechuga indicated that this is because the OS checks the apdWarm flag before launching an ONSCRRIPT
- OFFSCRPTs + RawKeyHooks are usually used to simulate ONSCRIPTs, including in Doors CS/CSE/CE. An OFFSCRPT installs a single-use RawKeyHook that fires when the calculator is turned on again. The hook uninstalls itself, then launches the program or App or performs the task the programmer desired.
Anything else you guys wish to add to this?