TI99 Environment

# CALL_CHAR

Syntax

CALL_CHAR(character-code, pattern-identifier)

Description

The CALL_CHAR function allows you to define special graphics characters. Character-code specifies the ASCII character to define and must be a numeric expression with a value from 32 through the value of endchar. The value endchar is a constant set at the beginning of the program during initialization to specify how many characters are available to customize. Pattern-identifier is a 0 through 64 character string expression in hexadecimal (0-9 and A-F) which specifies the pattern of the character(s) you are defining. This string expression is a coded representation of the dots which make up a character on the screen. Each character is made up of 64 dots comprising an 8 by 8 grid as shown below. The following table shows all the possible on/off conditions for the four dots in a given block, and the binary and hexadecimal codes for each condition.

You can redefine the standard set of characters (ASCII codes 32-126) and the undefined characters, ASCII codes 127- the value of endchar. Character endchar + 1 is reserved by the TI-99 environment for sprite image manipulation.
If the pattern-identifier is less than 16 characters (or a null string), the computer assumes that the remaining characters are zeros.
If the pattern-identifier is 17 to 32 characters, two character-codes are defined, the first with the first through sixteenth characters and the second with the remaining characters, with zeros added as needed.
If the pattern-identifier is 33 to 48 characters, three character-codes are defined, the first with the first through sixteenth characters, the second with the seventeenth through thirty-second characters, and the third with the remaining characters, with zeros added as needed.
If the pattern-identifier is 49 to 64 characters, four character-codes are defined, the first with the first through sixteenth characters, the second with the seventeenth through thirty-second characters, the third with the thirty-third through forty-eighth characters, and the fourth with the remaining characters, with zeros added as needed.
If the pattern-identifier is longer than 64 characters or is long enough to define characters higher than character code endchar, the excess is ignored.
Defining sprite characters follows the exact same process as regular characters except that they can consist of up to four ASCII codes (a pattern-identifier of up to 64 characters). A sprite magnified as 1 or 2 consists of only one ASCII code. In the case of double-sized sprites with a magnification factor of 3 or 4, the sprite will require four consecutive ASCII characters, with the first ASCII code being divisible by four. Look at the following code snippet:
S1$="0103C3417F3F07070707077E7C40000080C0C080FCFEE2E3E0E0E06060606070"
CALL_CHAR(96,S1$)
CALL_MAGNIFY(4)
CALL_SPRITE(1,96,5,80,110,0,0)
TIWaitKey(): end
In the above example, the double-sized sprite will be built as a 2x2 block with the four ASCII code characters assembled as follows:

Example Code

    Example Code 1:

    CALL_CLEAR()
    A$="1898FF3D3C3CE404"
    B$="1819FFBC3C3C2720"
    CALL_COLOR(9,7,12)	` Set character color to Dark Red (7) on Light Yellow (12)
    CALL_VCHAR(12,16,96,1)
    do
       CALL_CHAR(96,A$)
       TIWAIT(250)
       CALL_CHAR(96,B$)
       TIWAIT(250)
    Loop

    Example Code 2:

    ` Creates a magnified sprite consisting of 4 graphic characters
    ` It also displays the individual graphic hex patterns using string functions
    a$ =      "0103C3417F3F0707"
    a$ = a$ + "0707077E7C400000"
    a$ = a$ + "80C0C080FCFEE2E3"
    a$ = a$ + "E0E0E06060606070"
    CALL_CHAR(128,a$)
    display_at(17,1, "128 " + "129 " + "130 " + "131",0)
    display_at(19,2,CHR$(128)+ "   " + CHR$(129)+ "   " + CHR$(130) + "   " + CHR$(131),0)
    ti_print(1,"128 " + call_charpat(128))
    ti_print(1,"129 " + call_charpat(129))
    ti_print(1,"130 " + call_charpat(130))
    ti_print(1,"131 " + call_charpat(131))
    call_magnify(3)
    call_sprite(1,128,14,50,90,0,0)
    display_at(5,1,"Press any key to change size",0)
    DO :
       tiwaitkey() : call_magnify(4)
       tiwaitkey() : call_magnify(3)
    LOOP

Go back to ...

TI99E Commands Menu
Main Menu

Copyright © Carlos Santiago Lebron - TI99 Environment 2020