|
PVSnesLib
4.6.0
Documentation to code in C or ASM for the Nintendo SNES
|
contains the basic definitions for controlling the variable width font display. More...
#include <snes/snestypes.h>Go to the source code of this file.
Functions | |
| void | consoleDrawText (u16 x, u16 y, char *fmt,...) |
| Output formatted string on a screen (tiles mode) | |
| void | consoleDrawTextMap (u16 x, u16 y, u8 *map, u8 attributes, char *fmt,...) |
| Output formatted string on a screen (2 colors tiles mode) | |
| void | consoleDrawTextMapCenter (u16 y, u16 *map, u8 attributes, char *fmt,...) |
| Output formatted string on a screen, centered it (2 colors tiles mode) | |
| void | consoleInitDefaultText (u8 palnum) |
| Initialize the Text System with the font shipped in PVSNesLib. | |
| void | consoleInitText (u8 palnum, u8 palsize, u8 *tilfont, u8 *palfont) |
| Initialize the Text System. | |
| void | consoleSetTextGfxPtr (u16 vramfont) |
| Change text graphics address (4K aligned) | |
| void | consoleSetTextMapPtr (u16 offsetfont) |
| Change text Background map address for display (must be BG address) | |
| void | consoleSetTextOffset (u16 offsetfont) |
| Change text Background map address for display (must be BG address) | |
| void | consoleSetTextPal (u8 palnum, u8 *palfont, u8 palsize) |
| Change text font palette. | |
| void | consoleSetvwTextBlkTile (u16 tileEntry) |
| Sets the blank tile entry to reset a line. | |
| void | consoleSetvwTextMapAttr (u8 mapAttr) |
| Sets the high byte attr into tilemap entry. | |
| void | consoleUpdate (void) |
| Update current text buffer on screen. | |
| void | consolevwTextUpdate (void) |
| DMA all dirty line buffers to VRAM. | |
Variables | |
| u8 | scr_txt_dirty |
| flag to redraw text during vblank | |
| u8 | scr_txt_font_map [0x800] |
| tilemap used for text display | |
contains the basic definitions for controlling the variable width font display.
| void consoleDrawText | ( | u16 | x, |
| u16 | y, | ||
| char * | fmt, | ||
| ... | |||
| ) |
Output formatted string on a screen (tiles mode)
| x | The X character number the string should start on |
| y | The Y character number the string should start on |
| fmt | The Format string (see printf() documentation in your local C tutorial) |
Output a text string to the screen. Before using this, you need to call consoleInitText(). You can also print the value of variables this way, by putting a format string and additional parameters.
| void consoleDrawTextMap | ( | u16 | x, |
| u16 | y, | ||
| u8 * | map, | ||
| u8 | attributes, | ||
| char * | fmt, | ||
| ... | |||
| ) |
Output formatted string on a screen (2 colors tiles mode)
| x | The X character number the string should start on |
| y | The Y character number the string should start on |
| map | The 0x800 char map entry to put string |
| attributes | attributes for tiles |
| fmt | The Format string (see printf() documentation in your local C tutorial) |
Output a text string to the screen. Before using this, you need to call consoleInitText(). You can also print the value of variables this way, by putting a format string and additional parameters.
| void consoleDrawTextMapCenter | ( | u16 | y, |
| u16 * | map, | ||
| u8 | attributes, | ||
| char * | fmt, | ||
| ... | |||
| ) |
Output formatted string on a screen, centered it (2 colors tiles mode)
| y | The Y character number the string should start on |
| map | The 0x800 char map entry to put string |
| attributes | attributes for tiles |
| fmt | The Format string (see printf() documentation in your local C tutorial) |
Output a text string to the screen. Before using this, you need to call consoleInitText(). You can also print the value of variables this way, by putting a format string and additional parameters. The text will be centered on x axis.
| void consoleInitDefaultText | ( | u8 | palnum | ) |
Initialize the Text System with the font shipped in PVSNesLib.
| palnum | palette entry (0..7) |
Reserve a BG and load the font characters into VRAM. It will only work in tiled display modes. You can change address of graphics and map with consoleSetTextVramAdr() and consoleSetTextVramBGAdr(). Also, consoleSetTextPal can change the text palette.
| void consoleInitText | ( | u8 | palnum, |
| u8 | palsize, | ||
| u8 * | tilfont, | ||
| u8 * | palfont | ||
| ) |
Initialize the Text System.
| palnum | palette entry (0..7) |
| palsize | size of palette of text (4,16,etc ...) |
| tilfont | Pointer to tiles gfx for printing |
| palfont | Pointer to palette of text |
Reserve a BG and load the font characters into VRAM. It will only work in tiled display modes. You can change address of graphics and map with consoleSetTextVramAdr() and consoleSetTextVramBGAdr(). Also, consoleSetTextPal can change the text palette.
| consoleSetTextGfxPtr | ( | u16 | vramfont | ) |
Change text graphics address (4K aligned)
| vramfont | VRAM Background address (4K aligned) (default is $0800) |
| consoleSetTextMapPtr | ( | u16 | vrambgfont | ) |
Change text Background map address for display (must be BG address)
| vrambgfont | VRAM Background map address (default is $0800) |
| consoleSetTextOffset | ( | u16 | offsetfont | ) |
Change text Background map address for display (must be BG address)
| offsetfont | VRAM offset for text (default is 0, as it is aligned with BG tiles) |
| consoleSetTextPal | ( | u8 | palnum, |
| u8 * | palfont, | ||
| u8 | palsize | ||
| ) |
Change text font palette.
| palnum | palette entry (0..7) |
| palfont | pointer to the new palette |
| palsize | size of palette of text (4,16,etc ...) |
| void consoleSetvwTextBlkTile | ( | u16 | tileEntry | ) |
Sets the blank tile entry to reset a line.
| tileEntry | ID of the tile |
Sets the full 16-bit tilemap word used to blank a line's unused columns when consoleSetvwTextClearLine() is called. Default is 0.
| void consoleSetvwTextMapAttr | ( | u8 | mapAttr | ) |
Sets the high byte attr into tilemap entry.
| mapAttr | Attribute (VHPC CC00) |
Sets the high byte (palette/priority/flip bits) into every tilemap entry written by consoleDrawvwText(). Default is 0. VHPC CC00 is V Vectiale / H horizontal Flip P Priority bit of background C Palette selection (0-7)
| consolevwTextUpdate | ( | void | ) |
DMA all dirty line buffers to VRAM.
Call during / just before or after VBlank. Call dmaCopyVram().