83Plus:Hooks:9B8C: Difference between revisions
From WikiTI
Jump to navigationJump to search
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
== Synopsis == | == Synopsis == | ||
'''Name:''' | '''Name:''' Homescreen | ||
'''Hook Pointer Block Address:''' [[83Plus:RAM: | '''Hook Pointer Block Address:''' [[83Plus:RAM:9B8C|9B8C]] | ||
'''Hook Enable BCALL:''' [[83Plus:BCALLs: | '''Hook Enable BCALL:''' [[83Plus:BCALLs:4FAB|4FAB]] | ||
'''Hook Disable BCALL:''' [[83Plus:BCALLs: | '''Hook Disable BCALL:''' [[83Plus:BCALLs:4FAE|4FAE]] | ||
'''Hook Call BCALL:''' | '''Hook Call BCALL:''' ''(none known)'' | ||
'''Hook Active Flag:''' | '''Hook Active Flag:''' [[83Plus:Flags:34#Bit_4|4, (iy + 34h)]] | ||
This hook | This hook is called when various events occur on the homescreen. | ||
== Using the Hook == | == Using the Hook == | ||
These different values, passed in | These different values, passed in A, determine what the hook should do. | ||
* | * 0: The calculator is displaying a result. | ||
* | ** [[83Plus:RAM:8478|OP1]] = the value to display | ||
** | ** You can change the value in OP1 to display something different, which will not affect the value stored to Ans. | ||
** | ** If you want to display something wider than the screen, you must also write the formatted string to [[83Plus:RAM:97B1|fmtString]]. | ||
** Change | ** Return NZ and TIOS will not display anything. | ||
* 3: | * 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 the name of the entry, 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. | |||
<nowiki>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</nowiki> | |||
== Credits and Contributions == | == Credits and Contributions == | ||
* ''' | * '''Michael Vincent:''' Analysis and writing the most amazingly cool homescreen hacks I've seen yet. | ||
Revision as of 06:14, 28 March 2005
Synopsis
Name: Homescreen
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 the name of the entry, 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.