From WikiTI
Revision as of 21:01, 1 April 2013 by FloppusMaximus (Talk | contribs)

Jump to: navigation, search


Hypothesized Official Name: PutMap

BCALL Address: 44F8h

Displays a character in the large (fixed-width) font.


  • A = character to display
  • (curRow), (curCol) = row and column to display the character
  • putmapDrawColor = 1 to use curFGColor/curBGColor (0 to use black/white)
  • (curFGColor) = foreground color
  • (curBGColor) = background color
  • textInverse = 1 to swap foreground and background colors
  • textEraseBelow = 1 to erase a two-pixel border below the character
  • preClrForMode = 1 to erase a two-pixel border to the left of the character
  • appTextSave = 1 to save the character in textShadow (and pixel shadow, unless textDisplayOnly set)
  • putmapCmdPixShad = 1 to use the homescreen pixel shadow buffer
  • textDisplayOnly = 1 to disable use of the pixel shadow buffer
  • LCD output mode is assumed to be row major, left to right, top to bottom (R03 = 1038h), and the window assumed to be full height (R50 = 0, R51 = 239)


  • Character displayed
  • preClrForMode cleared
  • LCD output window reset to full width (R52 = 0, R53 = 319)
  • If appTextSave set, character stored at the appropriate address in textShadow
  • If appTextSave set and textDisplayOnly cleared, character bitmap drawn in the appropriate pixel shadow buffer



This routine is called by all of the other fixed-width text display routines, so the flags and variables listed above will also affect, e.g., PutS. In contrast to most text display routines, this routine does not change curRow/curCol (and does not handle $D6, the newline character, in any special way.)

PutMap will "draw" the input character in up to three places: the LCD itself, the textShadow buffer (which stores the ASCII characters drawn on screen), and the current pixel shadow buffer (which stores a 1-bit image of the current screen contents.) The effect of the flags is shown below:

TextSave DisplayOnly CmdPixShad Effect
0 * * Draw to LCD only
1 1 * Draw to LCD and textShadow
1 0 0 Draw to LCD, textShadow, and pixelShadow
1 0 1 Draw to LCD, textShadow, and cmdPixelShadow

Note that the putmapDrawColor flag and curFGColor/curBGColor have no effect on what is drawn in the pixel shadow - only textInverse has any effect on that. So if you draw some colored text and the screen is later scrolled, it will always be redrawn in black and white.

Clearing appTextSave, or setting textDisplayOnly, will speed up text display significantly, at the cost of making ScrollUp/ScrollDown not work correctly. For some programs, it may be better to do this, and implement scrolling yourself if need be. You will also want to do so if you intend to use the pixel shadow buffer(s) as scratch memory.

The right and top borders of the character are always drawn. If textInverse is cleared, the left border will be drawn only if preClrForMode is set, and the bottom border will be drawn only if textEraseBelow is set. If textInverse is set, all four borders will always be drawn. Note that preClrForMode is always cleared after displaying a character.