83Plus:Hooks:9BB0

From WikiTI
Revision as of 08:29, 9 May 2015 by KermMartian (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Synopsis

Name: App Change Hook (also called the Context Switch hook)

Hook Pointer Block Address: 9BB0

Hook Enable BCALL: 502C

Hook Disable BCALL: 502F

Hook Call BCALL: (none known)

Hook Active Flag: 2, (iy + 36h)

This hook is called at any time that TIOS changes from one app to another. Also called when the calculator is turned off.

Using the Hook

  • B = current app
    • Switching from one app to another: A = new app
    • Turning the calculator off from most apps: A = 2
    • Exiting an external app: A = 0
    • Turning the calculator off from the graph screen (possibly others): A = 0
  • HL = Address the OS is going to jump to in order to switch to new app (this is a page 0 call)

Comments

On known monochrome TI-83 Plus/TI-84 Plus calculators, the TI-OS completely ignores the output of this hook. You can force TIOS to go certain apps by using the JForce... B_JUMPs. (These B_JUMPs are probably not intended to be used inside this hook, so this may or may not be safe, depending on the apps involved.) On the TI-84 Plus C Silver Edition, you must preserve A and HL, because the OS does not ignore these values. However, it's not known if modifying A and HL is a "safe" way to change which new context is launched.