Showing changes from revision #2:
Added | Removed
Function Name
PutChar
Purpose
Displays a text character on the screen. For a simpler routine that doesn't need to display special characters or perform margin checks, see [[GEOS Programmer's Reference Guide+GEOS Kernal Routines+SmallPutChar|SmallPutChar]].
Call Address
$C145
Input
A - The character to be displayed.
R0 - $02-$03 - Pointer to extra data (used only by some control characters, may be omitted otherwise).
R1H - $05 - Row number to display at. May be 0-199, is one row above an underline.
R11 - $18-$19 - Column number to display at.
currentMode - $2E - Font style to use, as flags:
- Unused.
- Unused.
- Outlined text.
- Italic text.
- Reversed text.
- Boldface text.
- Underlined text.
windowTop - $33 - Top margin of the display window, usually 0.
windowBottom - $34 - Bottom margin of the display window, usually 199.
leftMargin - $35-$36 - Left margin of the display window.
rightMargin - $37-$38 - Right margin of the display window.
Prerequisite
Either [[GEOS Programmer's Reference Guide+GEOS Kernal Routines+UseSystemFont|UseSystemFont]] or [[GEOS Programmer's Reference Guide+GEOS Kernal Routines+LoadCharSet|LoadCharSet]] must be called prior to calling this routine in order to set up the font pointers. UseSystemFont is called during GEOS's bootup procedure as well as by the menu processor.
Description
This routine displays a character in a given location using the current font and style. If the right margin is exceeded, a branch through [[GEOS Programmer's Reference Guide+GEOS Kernal Routines+StringFaultVec|StringFaultVec]] ($84AB-$84AC) is executed.
Control Characters
Several control characters have special properties. Some require R0 to point to extra data, and those are marked below.
- Ctrl-H - Delete previous character. Location realSize ($8807) must have the width of the previous character.
- Ctrl-I - Tab.
- Ctrl-J - Vertical tab, move straight down one line.
- Ctrl-K - Set text cursor to (0,0).
- Ctrl-L - Move straight up one line.
- Ctrl-M - Carriage return plus line feed, move to the beginning of the next line.
- Ctrl-N - Turn on underlining.
- Ctrl-O - Turn off underlining.
- Ctrl-P - Followed by a table suitable for [[GEOS Programmer's Reference Guide+GEOS Kernal Routines+GraphicsString|GraphicsString]].*
- When used with [[GEOS Programmer's Reference Guide+GEOS Kernal Routines+PutString|PutString]], this must be the last character in the string. The zero byte terminating GraphicsString terminates PutString.
- Ctrl-R - Turn on reverse video.
- Ctrl-S - Turn off reverse video.
- Ctrl-T - Followed by 2 bytes which specify the new column.
- Ctrl-U - Followed by 1 byte which specifies the new row.
- Ctrl-V - Followed by 3 bytes which specify the new display position.
- Ctrl-W - Skips the next 3 bytes.
- Ctrl-X - Turn on boldface.
- Ctrl-Y - Turn on italics.
- Ctrl-Z - Turn on outline.
- Ctrl- - Turn off all effects, return to plain text. [Note: Original document left out the control character to use.]


