Difference between revisions of "84PCE:Syscalls:0207B4"

From WikiTI
Jump to: navigation, search
Line 52: Line 52:
| 1 || 1 || * || Draw to LCD and [[84PCE:RAM:D006C0|textShadow]]
| 1 || 1 || * || Draw to LCD and [[84PCE:RAM:D006C0|textShadow]]
| 1 || 0 || 0 || Draw to LCD, textShadow, and [[84PCE:RAM:8941|pixelShadow]]
| 1 || 0 || 0 || Draw to LCD, textShadow, and [[84PCE:RAM:D031F6:|pixelShadow]]
| 1 || 0 || 1 || Draw to LCD, textShadow, and [[84PCE:RAM:AA11|pixelShadow2]]
| 1 || 0 || 1 || Draw to LCD, textShadow, and [[84PCE:RAM:D052C6:|pixelShadow2]]

Revision as of 20:01, 25 May 2015


Hypothesized Official Name: PutMap

BCALL Address: 0207B4h

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)
  • (textFGColor) = Foreground color
  • (textBGColor) = 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)
  • putmapUsePixShad2 = 1 to use the secondary 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 UsePixShad2 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 pixelShadow2

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.