Difference between revisions of "83Plus:Hooks:9B8C"
From WikiTI
m (→Example: _Random -> Random) |
m (The Homescreen Hook was never called the Font Hook...that is its own hook, and the localize hook may have been called that) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
[[Category:83Plus:Hooks:By_Name|Homescreen Hook]] [[Category:83Plus:Hooks:By_Address|9B8C - Homescreen Hook]] | [[Category:83Plus:Hooks:By_Name|Homescreen Hook]] [[Category:83Plus:Hooks:By_Address|9B8C - Homescreen Hook]] | ||
== Synopsis == | == Synopsis == | ||
− | '''Name:''' Homescreen | + | '''Official Name:''' Homescreen Hook |
'''Hook Pointer Block Address:''' [[83Plus:RAM:9B8C|9B8C]] | '''Hook Pointer Block Address:''' [[83Plus:RAM:9B8C|9B8C]] | ||
Line 27: | Line 27: | ||
** Return NZ to ignore the keypress. | ** Return NZ to ignore the keypress. | ||
* 2: An expression was entered to be evaluated. | * 2: An expression was entered to be evaluated. | ||
− | ** OP1 contains the | + | ** OP1 contains prgm!. |
+ | ** To retreive the expression to be evaluated use prgm#. | ||
** Return NZ to cancel running the program. | ** Return NZ to cancel running the program. | ||
* 3: Changing context to the homescreen. | * 3: Changing context to the homescreen. |
Latest revision as of 17:33, 4 October 2008
Synopsis
Official Name: Homescreen Hook
Hook Pointer Block Address: 9B8C
Hook Enable BCALL: 4FAB
Hook Disable BCALL: 4FAE
Hook Call BCALL: (none known)
Hook Active Flag: 4, (iy + 34h)
This hook is called when various events occur on the homescreen.
Using the Hook
These different values, passed in A, determine what the hook should do.
- 0: The calculator is displaying a result.
- 1: A key was pressed at the homescreen.
- B = keycode
- Change B to change the key that appears to be pressed.
- Return NZ to ignore the keypress.
- 2: An expression was entered to be evaluated.
- OP1 contains prgm!.
- To retreive the expression to be evaluated use prgm#.
- Return NZ to cancel running the program.
- 3: Changing context to the homescreen.
- B = previous context value
- You should always return Z in this case.
Example
The following code will display a random number as the result of any calculation.
HomescreenHook: .db 83h ; Required for all hooks or a ; are we in condition 0 (display value?) jr nz,ReturnZ B_CALL Random ; change our output value to a random # ReturnZ: cp a ; set zero condition ret
Credits and Contributions
- Michael Vincent: Analysis and writing the most amazingly cool homescreen hacks I've seen yet.