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

From WikiTI
Jump to: navigation, search
m (please don't edit)
 
(lots of stuff)
Line 1: Line 1:
I have a large amount of information on this hook, which I'm working on wikifying at the moment; please be patient, as there really is a lot of it. [[User:FloppusMaximus|FloppusMaximus]] 13:06, 28 Mar 2005 (PST)
+
[[Category:83Plus:Hooks:By_Name|Localize Hook]]
 +
[[Category:83Plus:Hooks:By_Address|9BCC - Localize Hook]]
 +
== Synopsis ==
 +
'''Name:''' Localize Hook
 +
 
 +
'''Hook Pointer Block Address:''' [[83Plus:RAM:9BCC|9BCC]]
 +
 
 +
'''Hook Enable BCALL:''' [[83Plus:BCALLs:4F93|4F93]]
 +
 
 +
'''Hook Disable BCALL:''' [[83Plus:BCALLs:4F96|4F96]] ''(note this resets [[83Plus:RAM:9B73|(localLanguage)]] to English)''
 +
 
 +
'''Hook Call BCALL:''' [[83Plus:BCALLs:4006|4006]]
 +
 
 +
'''Hook Active Flag:''' [[83Plus:Flags:35#Bit_1|1, (iy + 35h)]]
 +
 
 +
This hook allows you to change almost every string in TIOS (except tokens, which are handled by the [[83Plus:Hooks:9BC8|token hook]]) as well as the default font bitmaps.
 +
 
 +
== Using the Hook ==
 +
This hook is by far the most complicated to handle properly.
 +
 
 +
* Most conditions pass the default string in HL.  You are expected to return the string to be displayed in HL.  [[83Plus:RAM:9D65|localTokStr]] is a good place to copy your strings.  Most of these conditions will not display anything if Z is set.  Some ignore the zero flag.
 +
* [[#Menu Items (condition 9)|Condition 9]] and the [[#Font Conditions|font conditions]] do not give you the default, but they will display a string or character you define at HL if you return Z.  (You must still save all registers if you want to use the default string.)
 +
* The conditions for [[#Menu Quasi-Functions|menu quasi-functions]], [[#Data Types|data types]], and [[#Configuration Variables|configuration variables]] do not give you the default, but require you to provide a string to display.
 +
* The [[#Memory Reset|memory reset]] conditions pass a default string, but will display whatever is output regardless of flags.  The zero flag in this case is used to specify cursor coordinates: Z to use the default coordinates; NZ to use the coordinates given in DE.  Default coordinates are not passed.  (Note this applies only to the RAM and defaults resets.  The Arc Vars is a [[#Standard Conditions|standard condition]].)
 +
* A few conditions seem to want you to display the string yourself.  These conditions tell you nothing and display only the default string if NZ is set.
 +
 
 +
In many situations, it is permissible to insert your own values for cursor and pen coordinates, and indeed TI's apps sometimes do: the hook is only called when the string is actually about to be displayed.
 +
 
 +
Some items need to be returned as zero-terminated strings, some as one-byte-length prefixed strings.  As a general rule of thumb, strings that will be displayed in menus are 1BL, and others are usually ZT.
 +
 
 +
== Required Conditions ==
 +
The careful reader will notice that several conditions cannot be satisfied by a simple "save all and return NZ."  The following conditions must be handled specially, even if your hook does nothing else.
 +
 
 +
=== Menu Quasi-Functions ===
 +
* A = 0Ah
 +
* HL must be set to point to a one-byte length string
 +
* E = identifies a function
 +
{|
 +
! E !! String
 +
|-
 +
| 69 || Select
 +
|-
 +
| 7E || maximum
 +
|-
 +
| 7D || minimum
 +
|-
 +
| 7C || dr/dθ
 +
|-
 +
| 7A || dy/dt
 +
|-
 +
| 7B || dx/dt
 +
|-
 +
| 77 || dy/dx
 +
|-
 +
| 78 || ∫f(x)dx
 +
|-
 +
| 79 || zero
 +
|-
 +
| 76 || intersect
 +
|-
 +
| 75 || value
 +
|-
 +
| 6D || Pen
 +
|-
 +
| 5B || ZoomFit
 +
|}
 +
 
 +
=== Configuration Variables ===
 +
* A = 3Ah
 +
* HL must be set to point to a one-byte length string
 +
* B identifies the variable
 +
** 0 = Window
 +
** 1 = RclWindow
 +
** 2 = TblSet
 +
 
 +
=== Data Types ===
 +
* A = 3Bh
 +
* HL must be set to point to a zero-terminated string
 +
* B = variable type
 +
 
 +
=== Memory Reset ===
 +
* A = identifies reset type
 +
** 42h = "Memory Cleared"
 +
** 43h = "RAM Cleared"
 +
** 44h = "Defaults Set"
 +
* HL points to the default zero-terminated string (page 19h) which may be modified
 +
* You must either:
 +
** Set Z to place at the default coordinates, or
 +
** Return the coordinates where the string should be displayed in DE (D = column, E = row.)
 +
 
 +
== Font Conditions ==
 +
For a while this hook was called the character hook, simply because of these conditions.
 +
 
 +
=== Small Font Bitmap ===
 +
* A = 75h
 +
* B = character
 +
* Return NZ for default, or set HL to points to an 8-byte small font structure (see the [[83Plus:Hooks:9B8C|font hook]] for details.)
 +
 
 +
=== Large Font Bitmap ===
 +
* A = 76h
 +
* B = character
 +
* Return NZ for default, or set HL to points to a 7-byte large font structure (see the [[83Plus:Hooks:9B8C|font hook]] for details.)
 +
 
 +
=== Small Font Width ===
 +
* A = 77h
 +
* B = character
 +
* Return NZ for default, or set B to the desired width of the character.
 +
 
 +
== Standard Conditions ==
 +
 
 +
Virtually any string which is not handled by one of the conditions
 +
other conditions described is handled by a "standard" condition.
 +
 
 +
* A identifies a string to be displayed
 +
* HL points to the default zero terminated string, which may be modified
 +
* Return Z if you display it yourself.
 +
 
 +
== Other Optional Conditions ==
 +
 
 +
=== Mode Screen ===
 +
* A = 0 when displaying the cursor, 1 when displaying the string
 +
* HL identifies an option.
 +
* Return Z if you display it yourself
 +
 
 +
=== Menu Items (condition 7) ===
 +
* A = 7
 +
* HL points to the default '''one byte length''' string (page 1) which may be modified
 +
* E identifies a string
 +
* Return Z if you display it yourself
 +
 
 +
=== Menu Items (condition 9) ===
 +
* A = 9
 +
* E identifies a string
 +
* Return NZ for default, or set HL to points to a '''one byte length''' string
 +
 
 +
=== Error Messages ===
 +
* A = 0Ch
 +
* E = ((error code) & 7fh) - 1
 +
** (Overflow is 0, Divide by zero is 1, etc.)
 +
* HL points to the default zero terminated string (page 7) which may be modified
 +
 
 +
=== Done ===
 +
* A = 0Dh
 +
* Return Z if you display it yourself
 +
 
 +
=== Variable Names ===
 +
* A = 14h
 +
* B = identifies a variable
 +
* HL  points to the default zero terminated string (page 3) which may be modified
 +
** Note that the string does not include the = sign
 +
 
 +
=== Stat Plot Editor ===
 +
* A = 28h when displaying a cursor on a large font option
 +
* A = 29h when displaying a cursor on a small font option
 +
** E identifies an option
 +
* A = 2Ah when displaying a large font option
 +
* A = 2Bh when displaying a small font option
 +
** E identifies an option
 +
** HL points to the default zero terminated string (page 5) which may be modified
 +
** Zero flag is ignored
 +
 
 +
=== Stat Plot Editor Coordinates ===
 +
* A = 2Ch: coordinates of Data List name
 +
* A = 2Dh: coordinates of Xlist name
 +
* A = 2Eh: about to draw Ylist
 +
** No coordinates passed; you must adjust them yourself
 +
* A = 2Fh: coordinates of Freq
 +
* H = column, L = row, which may be modified
 +
 
 +
=== "EQUATION SOLVER" ===
 +
* A = 31h
 +
* HL points to the default zero terminated string (in RAM) which may be modified
 +
* Zero flag is ignored
 +
 
 +
=== "PROGRAM" ===
 +
* A = 56h
 +
* E = 88h if displaying in the program editor, where the string will be truncated to 8 characters ''(this is tentative at best)''
 +
* HL points to the default zero terminated string (page 6) which may be modified
 +
* Return Z if you display it yourself
 +
 
 +
=== About screen options ===
 +
* A = 65h: "TI-83 Plus"
 +
* A = 70h: "Help: www.ti.com/calc"
 +
* A = 7Ch: "TI-83 Plus Silver Edition"
 +
* A = 7Dh: "PROD. ID"
 +
* A = 86h: "TI-84 Plus"
 +
* A = 87h: "TI-84 Plus Silver Edition"
 +
* HL points to the default string (page 1) which may be modified
 +
** (HL) is the X coordinate where the string should be displayed
 +
** (HL+1) is the Y coordinate
 +
** (HL+2) to (HL+n) are a zero-terminated string to display
 +
* Return Z if you display it yourself
 +
 
 +
== Summary ==
 +
 
 +
{|
 +
! A= !! +0 !! +1 !! +2 !! +3 !! +4 !! +5 !! +6 !! +7
 +
|-
 +
! 00
 +
| [[#Mode Screen|Mode]] || [[#Mode Screen|Mode]] || "PMT:" || "RAM FREE" || "ARC FREE" || "SELECT" || " TRANSMIT" || [[#Menu Items (condition 7)|Menu]]
 +
|-
 +
! 08
 +
| ? || [[#Menu Items (condition 9)|Menu]] || [[#Menu Quasi-Functions|MQF]] || "ERR:" || [[#Error Messages|Error]] || [[#Done|Done]] || "Rcl " || "Name"
 +
|-
 +
! 10
 +
| "Name=" || "WINDOW" || "ZOOM FACTORS" || "TABLE SETUP" || [[#Variable Names|Vars]] || "Indpnt:" || "Depend:" || "bound"
 +
|-
 +
! 18
 +
| "left-rt" || "eqn:0=" || "Plot1" || "Plot2" || "Plot3" || "On" || "Off" || "Axis"
 +
|-
 +
! 20
 +
| ? || "Type:" || "Data List:" || "Data Axis:" || "Mark:" || "Xlist:" || "Ylist:" || "Freq:"
 +
|-
 +
! 28
 +
| [[#Stat Plot Editor|StatPlot]] || [[#Stat Plot Editor|Stat Plot]] || [[#Stat Plot Editor|Stat Plot]] || [[#Stat Plot Editor|Stat Plot]]
 +
| [[#Stat Plot Editor Coordinates|Stat Plot Coords]] || [[#Stat Plot Editor Coordinates|Stat Plot Coords]] || [[#Stat Plot Editor Coordinates|Stat Plot Coords]] || [[#Stat Plot Editor Coordinates|Stat Plot Coords]]
 +
|-
 +
! 30
 +
| ? || [[#"EQUATION SOLVER"|"EQUATION SOLVER"]] || "MATRIX[" || "CATALOG" || "Waiting..." || "Receiving..." || "DELETE  BYTES" || " Receiving..."
 +
|-
 +
! 38
 +
| "Certificate" || "Validating..." || [[#Configuration Variables|Config]] || [[#Data Types|Data types]] || "MEMORY BACKUP" || "IDList" || ? || ?
 +
|-
 +
! 40
 +
| ? || ? || [[#Memory Reset|"Memory Cleared"]] || [[#Memory Reset|"RAM Cleared"]] || [[#Memory Reset|"Defaults Set"]] || ? || ? || ?
 +
|-
 +
! 48
 +
| ? || ? || ? || ? || ? || ? || ? || ?
 +
|-
 +
! 50
 +
| ? || ? || ? || ? || ? || "Arc Vars Cleared" || [[#"PROGRAM"|"PROGRAM"]] || ?
 +
|-
 +
! 58
 +
| ? || ? || ? || ? || ? || ? || ? || ?
 +
|-
 +
! 60
 +
| ? || ? || ? || ? || ? || [[#About screen options|"TI-83 Plus"]] || ? || "DONE"
 +
|-
 +
! 68
 +
| ? || ? || ? || ? || ? || ? || ? || ?
 +
|-
 +
! 70
 +
| [[#About screen options|"Help: www.ti.com/calc"]] || ? || "Garbage" || "Collecting..." || [[#Small Font Bitmap|Small Font]] || [[#Large Font Bitmap|Large Font]] || [[#Small Font Width|Width]]
 +
|-
 +
! 78
 +
| ? || ? || ? || ? || [[#About screen options|"TI-83 Plus SE"]] || [[#About screen options|"PROD. ID"]] || ? || ?
 +
|-
 +
! 80
 +
| ? || ? || ? || ? || ? || ? || [[#About screen options|"TI-84 Plus"]] || [[#About screen options|"TI-84 Plus SE"]]
 +
|}

Revision as of 16:34, 28 March 2005

Synopsis

Name: Localize Hook

Hook Pointer Block Address: 9BCC

Hook Enable BCALL: 4F93

Hook Disable BCALL: 4F96 (note this resets (localLanguage) to English)

Hook Call BCALL: 4006

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

This hook allows you to change almost every string in TIOS (except tokens, which are handled by the token hook) as well as the default font bitmaps.

Using the Hook

This hook is by far the most complicated to handle properly.

  • Most conditions pass the default string in HL. You are expected to return the string to be displayed in HL. localTokStr is a good place to copy your strings. Most of these conditions will not display anything if Z is set. Some ignore the zero flag.
  • Condition 9 and the font conditions do not give you the default, but they will display a string or character you define at HL if you return Z. (You must still save all registers if you want to use the default string.)
  • The conditions for menu quasi-functions, data types, and configuration variables do not give you the default, but require you to provide a string to display.
  • The memory reset conditions pass a default string, but will display whatever is output regardless of flags. The zero flag in this case is used to specify cursor coordinates: Z to use the default coordinates; NZ to use the coordinates given in DE. Default coordinates are not passed. (Note this applies only to the RAM and defaults resets. The Arc Vars is a standard condition.)
  • A few conditions seem to want you to display the string yourself. These conditions tell you nothing and display only the default string if NZ is set.

In many situations, it is permissible to insert your own values for cursor and pen coordinates, and indeed TI's apps sometimes do: the hook is only called when the string is actually about to be displayed.

Some items need to be returned as zero-terminated strings, some as one-byte-length prefixed strings. As a general rule of thumb, strings that will be displayed in menus are 1BL, and others are usually ZT.

Required Conditions

The careful reader will notice that several conditions cannot be satisfied by a simple "save all and return NZ." The following conditions must be handled specially, even if your hook does nothing else.

Menu Quasi-Functions

  • A = 0Ah
  • HL must be set to point to a one-byte length string
  • E = identifies a function
E String
69 Select
7E maximum
7D minimum
7C dr/dθ
7A dy/dt
7B dx/dt
77 dy/dx
78 ∫f(x)dx
79 zero
76 intersect
75 value
6D Pen
5B ZoomFit

Configuration Variables

  • A = 3Ah
  • HL must be set to point to a one-byte length string
  • B identifies the variable
    • 0 = Window
    • 1 = RclWindow
    • 2 = TblSet

Data Types

  • A = 3Bh
  • HL must be set to point to a zero-terminated string
  • B = variable type

Memory Reset

  • A = identifies reset type
    • 42h = "Memory Cleared"
    • 43h = "RAM Cleared"
    • 44h = "Defaults Set"
  • HL points to the default zero-terminated string (page 19h) which may be modified
  • You must either:
    • Set Z to place at the default coordinates, or
    • Return the coordinates where the string should be displayed in DE (D = column, E = row.)

Font Conditions

For a while this hook was called the character hook, simply because of these conditions.

Small Font Bitmap

  • A = 75h
  • B = character
  • Return NZ for default, or set HL to points to an 8-byte small font structure (see the font hook for details.)

Large Font Bitmap

  • A = 76h
  • B = character
  • Return NZ for default, or set HL to points to a 7-byte large font structure (see the font hook for details.)

Small Font Width

  • A = 77h
  • B = character
  • Return NZ for default, or set B to the desired width of the character.

Standard Conditions

Virtually any string which is not handled by one of the conditions other conditions described is handled by a "standard" condition.

  • A identifies a string to be displayed
  • HL points to the default zero terminated string, which may be modified
  • Return Z if you display it yourself.

Other Optional Conditions

Mode Screen

  • A = 0 when displaying the cursor, 1 when displaying the string
  • HL identifies an option.
  • Return Z if you display it yourself

Menu Items (condition 7)

  • A = 7
  • HL points to the default one byte length string (page 1) which may be modified
  • E identifies a string
  • Return Z if you display it yourself

Menu Items (condition 9)

  • A = 9
  • E identifies a string
  • Return NZ for default, or set HL to points to a one byte length string

Error Messages

  • A = 0Ch
  • E = ((error code) & 7fh) - 1
    • (Overflow is 0, Divide by zero is 1, etc.)
  • HL points to the default zero terminated string (page 7) which may be modified

Done

  • A = 0Dh
  • Return Z if you display it yourself

Variable Names

  • A = 14h
  • B = identifies a variable
  • HL points to the default zero terminated string (page 3) which may be modified
    • Note that the string does not include the = sign

Stat Plot Editor

  • A = 28h when displaying a cursor on a large font option
  • A = 29h when displaying a cursor on a small font option
    • E identifies an option
  • A = 2Ah when displaying a large font option
  • A = 2Bh when displaying a small font option
    • E identifies an option
    • HL points to the default zero terminated string (page 5) which may be modified
    • Zero flag is ignored

Stat Plot Editor Coordinates

  • A = 2Ch: coordinates of Data List name
  • A = 2Dh: coordinates of Xlist name
  • A = 2Eh: about to draw Ylist
    • No coordinates passed; you must adjust them yourself
  • A = 2Fh: coordinates of Freq
  • H = column, L = row, which may be modified

"EQUATION SOLVER"

  • A = 31h
  • HL points to the default zero terminated string (in RAM) which may be modified
  • Zero flag is ignored

"PROGRAM"

  • A = 56h
  • E = 88h if displaying in the program editor, where the string will be truncated to 8 characters (this is tentative at best)
  • HL points to the default zero terminated string (page 6) which may be modified
  • Return Z if you display it yourself

About screen options

  • A = 65h: "TI-83 Plus"
  • A = 70h: "Help: www.ti.com/calc"
  • A = 7Ch: "TI-83 Plus Silver Edition"
  • A = 7Dh: "PROD. ID"
  • A = 86h: "TI-84 Plus"
  • A = 87h: "TI-84 Plus Silver Edition"
  • HL points to the default string (page 1) which may be modified
    • (HL) is the X coordinate where the string should be displayed
    • (HL+1) is the Y coordinate
    • (HL+2) to (HL+n) are a zero-terminated string to display
  • Return Z if you display it yourself

Summary

A= +0 +1 +2 +3 +4 +5 +6 +7
00 Mode Mode "PMT:" "RAM FREE" "ARC FREE" "SELECT" " TRANSMIT" Menu
08  ? Menu MQF "ERR:" Error Done "Rcl " "Name"
10 "Name=" "WINDOW" "ZOOM FACTORS" "TABLE SETUP" Vars "Indpnt:" "Depend:" "bound"
18 "left-rt" "eqn:0=" "Plot1" "Plot2" "Plot3" "On" "Off" "Axis"
20  ? "Type:" "Data List:" "Data Axis:" "Mark:" "Xlist:" "Ylist:" "Freq:"
28 StatPlot Stat Plot Stat Plot Stat Plot Stat Plot Coords Stat Plot Coords Stat Plot Coords Stat Plot Coords
30  ? "EQUATION SOLVER" "MATRIX[" "CATALOG" "Waiting..." "Receiving..." "DELETE BYTES" " Receiving..."
38 "Certificate" "Validating..." Config Data types "MEMORY BACKUP" "IDList"  ?  ?
40  ?  ? "Memory Cleared" "RAM Cleared" "Defaults Set"  ?  ?  ?
48  ?  ?  ?  ?  ?  ?  ?  ?
50  ?  ?  ?  ?  ? "Arc Vars Cleared" "PROGRAM"  ?
58  ?  ?  ?  ?  ?  ?  ?  ?
60  ?  ?  ?  ?  ? "TI-83 Plus"  ? "DONE"
68  ?  ?  ?  ?  ?  ?  ?  ?
70 "Help: www.ti.com/calc"  ? "Garbage" "Collecting..." Small Font Large Font Width
78  ?  ?  ?  ? "TI-83 Plus SE" "PROD. ID"  ?  ?
80  ?  ?  ?  ?  ?  ? "TI-84 Plus" "TI-84 Plus SE"