SaturnRingLibrary 0.6
SGL wrapper
 
Loading...
Searching...
No Matches
SRL::ASCII Class Reference

Detailed Description

Interface for displaying ASCII text. Currently a direct replacement for slPrint. It removes any possible dependency on NBG0 system variables and displays 4bpp fonts to reduce required memory. Allows Storing and displaying up to 6 fonts and 8 color pallets.

#include <srl_ascii.hpp>

Static Public Member Functions

static void LoadFont (SRL::Bitmap::IBitmap *bmp, uint16_t fontId=0)
 Copies 4bpp Bitmap ASCII table to VRAM as 4bpp tileset.
 
static void LoadFontSG (uint8_t *source, uint16_t fontId=0)
 Use to load a 4bpp version of SGLs internal font.
 
static void Print (char *myString, uint8_t x, uint8_t y)
 Display ASCII string on single line. Does not clamp to screen bounds or handle overflow.
 
static void SetColor (uint16_t color, uint8_t colorIndex)
 Set color in the specified palette index of the current font pallet.
 
static void SetFont (uint16_t fontId)
 Set current font to print with (range 0-5)
 
static void SetPalette (uint16_t paletteId)
 Set current color pallet to print with (range 0-7)
 

Member Function Documentation

◆ LoadFont()

static void SRL::ASCII::LoadFont ( SRL::Bitmap::IBitmap * bmp,
uint16_t fontId = 0 )
inlinestatic

Copies 4bpp Bitmap ASCII table to VRAM as 4bpp tileset.

Parameters
bmppointer to an IBitmap interface to load
Note
image layout must be grid of 8x8 pixel characters arranged in ASCII order from left to right, top to bottom, with 1 empty 8x8 tile preceding the characters (see example in VDP2 Samples)
Parameters
fontIdIndex in the font table to load this font to (range 0-5)

◆ LoadFontSG()

static void SRL::ASCII::LoadFontSG ( uint8_t * source,
uint16_t fontId = 0 )
inlinestatic

Use to load a 4bpp version of SGLs internal font.

Parameters
sourceAddress storing SGLs 8bpp font
fontIdFont index to load to (range 0-5)

◆ Print()

static void SRL::ASCII::Print ( char * myString,
uint8_t x,
uint8_t y )
inlinestatic

Display ASCII string on single line. Does not clamp to screen bounds or handle overflow.

Parameters
myStringThe string to print
xStarting tile X coordinate on screen (0-64)
yStarting tile Y coordinate on screen (0-64)
Note
Tile (0,0) is aligned to the top left corner of the screen

◆ SetColor()

static void SRL::ASCII::SetColor ( uint16_t color,
uint8_t colorIndex )
inlinestatic

Set color in the specified palette index of the current font pallet.

Parameters
colorRGB555 color to set in current pallet
colorIndexindex to write the color to in the currently active font pallet (Clamped to 16 color palette)

◆ SetFont()

static void SRL::ASCII::SetFont ( uint16_t fontId)
inlinestatic

Set current font to print with (range 0-5)

Parameters
fontIdIndex of the desired font in font table

◆ SetPalette()

static void SRL::ASCII::SetPalette ( uint16_t paletteId)
inlinestatic

Set current color pallet to print with (range 0-7)

Parameters
paletteIdindex of the 16 color pallet in CRAM (limited to the first 8 pallets)