Difference between revisions of "83Plus:Hooks:9BC8"

From WikiTI
Jump to: navigation, search
 
Line 1: Line 1:
'''Note:''' Do not take the information on this template page as actual documentation!
 
 
The Hooks are named by their hook pointer block address (the four bytes consisting of page, address, and an extra byte), in hexadecimal. An example is [[83Plus:Hooks:9B84]].
 
 
----
 
 
 
== Synopsis ==
 
== Synopsis ==
'''Name:''' ImAHook
+
'''Name:''' Token Hook
  
'''Hook Pointer Block Address:''' [[83Plus:RAM:8562|8562]]
+
'''Hook Pointer Block Address:''' [[83Plus:RAM:9BC8|9BC8]]
  
'''Hook Enable BCALL:''' [[83Plus:BCALLs:1234|1234]]
+
'''Hook Enable BCALL:''' [[83Plus:BCALLs:4F99|4F99]]
  
'''Hook Disable BCALL:''' [[83Plus:BCALLs:5678|5678]]
+
'''Hook Disable BCALL:''' [[83Plus:BCALLs:4F9C|4F9C]]
  
'''Hook Call BCALL:''' [[83Plus:BCALLs:9012|9012]]
+
'''Hook Call BCALL:''' ''(none known)''
  
'''Hook Active Flag:''' 6, (iy + 23h)
+
'''Hook Active Flag:''' [[83Plus:Flags:35#Bit_0|0, (iy + 35h)]]
  
This hook allows you to change the values that [[83Plus:BCALLs:4972|GetKey]] returns.
+
This hook allows you to change the strings displayed for TIOS tokens.
  
 
== Using the Hook ==
 
== Using the Hook ==
These different values, passed in a, determines what the hook should do.
+
* DE = token number * 2
* 1: The calculator just turned on. There seem to be no other values passed to the hook.
+
** 1-byte:     0000 to 01FE
* 2: The calculator is computing 1+1.
+
** Matrix:    0200 to 0212
** b: 1
+
** List:       0214 to 021E
** c: 1
+
** Equation:   0220 to 025C
** Change b and/or c to affect the output of the problem (which will still look like 1+1 to the user).
+
** Picture:   025E to 0270
* 3: Preparing to turn off due to 2nd+OFF.
+
** GDB:        0272 to 0284
** Zero flag: Clear to abort the power off.
+
** String:    0286 to 0298
 +
** Output Var: 029A to 0312
 +
** System Var: 0314 to 0382
 +
** Format:     0384 to 03A8
 +
** BB:        03AA to 0546 (or higher, depending on OS)
 +
* HL = default string
 +
** Change HL to display a different string, which you must copy to RAM
  
 
== Comments ==
 
== Comments ==
This hook doesn't exist. This is a demonstration only.
+
In OS 1.15 this hook was modified to prevent apps from defining new tokens.  There are two checks in the token getting routine of OS 1.15: one which treats all undefined tokens as a question mark, and one which prevents the token hook from being run if the token is not in the standard OS 1.12 token set.
 +
 
 +
This was somewhat meta-fixed in OS 1.16 to the point that all of the original extended tokens can be used.  However, it still doesn't allow new tokens to be defined.
  
== Credits and Contributions ==
+
To summarize:
* '''/dev/hda1:''' My favorite hard drive partition.
+
* On OS 1.14 and prior OS's - all BB tokens are reported as 03AA+2T, including hacked tokens.  This caused localizers to crash when they encountered the extended Symbolic tokens.
 +
* On OS 1.15 - BB tokens after GarbageCollect are not passed to the token hook at all.  They are always displayed as a question mark.
 +
* On OS 1.16, and future OS's - BC is the unmodified value as reported by 1.14 for all tokens up to the last actual token supported; DE is set to a value representing a question-mark.

Revision as of 01:22, 28 March 2005

Synopsis

Name: Token Hook

Hook Pointer Block Address: 9BC8

Hook Enable BCALL: 4F99

Hook Disable BCALL: 4F9C

Hook Call BCALL: (none known)

Hook Active Flag: 0, (iy + 35h)

This hook allows you to change the strings displayed for TIOS tokens.

Using the Hook

  • DE = token number * 2
    • 1-byte: 0000 to 01FE
    • Matrix: 0200 to 0212
    • List: 0214 to 021E
    • Equation: 0220 to 025C
    • Picture: 025E to 0270
    • GDB: 0272 to 0284
    • String: 0286 to 0298
    • Output Var: 029A to 0312
    • System Var: 0314 to 0382
    • Format: 0384 to 03A8
    • BB: 03AA to 0546 (or higher, depending on OS)
  • HL = default string
    • Change HL to display a different string, which you must copy to RAM

Comments

In OS 1.15 this hook was modified to prevent apps from defining new tokens. There are two checks in the token getting routine of OS 1.15: one which treats all undefined tokens as a question mark, and one which prevents the token hook from being run if the token is not in the standard OS 1.12 token set.

This was somewhat meta-fixed in OS 1.16 to the point that all of the original extended tokens can be used. However, it still doesn't allow new tokens to be defined.

To summarize:

  • On OS 1.14 and prior OS's - all BB tokens are reported as 03AA+2T, including hacked tokens. This caused localizers to crash when they encountered the extended Symbolic tokens.
  • On OS 1.15 - BB tokens after GarbageCollect are not passed to the token hook at all. They are always displayed as a question mark.
  • On OS 1.16, and future OS's - BC is the unmodified value as reported by 1.14 for all tokens up to the last actual token supported; DE is set to a value representing a question-mark.