libtonc
Tilemap text

Text for regular and affine tilemaps. More...

Modules

 Character text, column-major
 Text on surface composed of 4bpp tiles, mapped in column-major order.
 

Regular tilemaps

void tte_init_se (int bgnr, u16 bgcnt, SCR_ENTRY se0, u32 clrs, u32 bupofs, const TFont *font, fnDrawg proc)
 Initialize text system for screen-entry fonts.
 
void se_erase (int left, int top, int right, int bottom)
 Erase part of the regular tilemap canvas.
 
void se_drawg_w8h8 (uint gid)
 Character-plot for reg BGs using an 8x8 font.
 
void se_drawg_w8h16 (uint gid)
 Character-plot for reg BGs using an 8x16 font.
 
void se_drawg (uint gid)
 Character-plot for reg BGs, any sized font.
 
void se_drawg_s (uint gid)
 Character-plot for reg BGs, any sized, vertically tiled font.
 

Affine tilemaps

void tte_init_ase (int bgnr, u16 bgcnt, u8 ase0, u32 clrs, u32 bupofs, const TFont *font, fnDrawg proc)
 Initialize text system for affine screen-entry fonts.
 
void ase_erase (int left, int top, int right, int bottom)
 Erase part of the affine tilemap canvas.
 
void ase_drawg_w8h8 (uint gid)
 Character-plot for affine BGs using an 8x8 font.
 
void ase_drawg_w8h16 (uint gid)
 Character-plot for affine BGs using an 8x16 font.
 
void ase_drawg (uint gid)
 Character-plot for affine Bgs, any size.
 
void ase_drawg_s (uint gid)
 Character-plot for affine BGs, any sized,vertically oriented font.
 

Detailed Description

Text for regular and affine tilemaps.

The tilemap sub-system loads the tiles into memory first, then writes to the map to show the letters. For this to work properly, the glyph sizes should be 8-pixel aligned.

Note
At present, the regular tilemap text ignores screenblock boundaries, so 512px wide maps may not work properly.

Function Documentation

◆ tte_init_ase()

void tte_init_ase ( int  bgnr,
u16  bgcnt,
u8  ase0,
u32  clrs,
u32  bupofs,
const TFont font,
fnDrawg  proc 
)

Initialize text system for affine screen-entry fonts.

Parameters
bgnrNumber of background to be used for text.
bgcntBackground control flags.
ase0Base screen entry. This allows a greater range in capabilities, like offset tile-starts.
clrscolors to use for the text. The palette entries used depends on ase0 and bupofs.
bupofsFlags for font bit-unpacking. Basically indicates pixel values (and hence palette use).
fontFont to initialize with.
procCharacter plotting procedure.

References ase_erase(), BFN_GET, TFont::bpp, TTC::cattr, TFont::cellSize, TFont::charCount, TTC::ctrl, TFont::data, TTC::dst, fwf_default, pal_bg_mem, REG_BGCNT, se_mem, SRF_BMP8, srf_init(), tile_mem, tte_get_context(), and tte_init_base().

◆ tte_init_se()

void tte_init_se ( int  bgnr,
u16  bgcnt,
SCR_ENTRY  se0,
u32  clrs,
u32  bupofs,
const TFont font,
fnDrawg  proc 
)

Initialize text system for screen-entry fonts.

Parameters
bgnrNumber of background to be used for text.
bgcntBackground control flags.
se0Base screen entry. This allows a greater range in capabilities, like offset tile-starts and palettes.
clrscolors to use for the text. The palette entries used depends on se0 and bupofs.
bupofsFlags for font bit-unpacking. Basically indicates pixel values (and hence palette use).
fontFont to initialize with.
procGlyph renderer.

References BFN_GET, BG_8BPP, TFont::bpp, TTC::cattr, TFont::cellSize, TFont::charCount, TTC::ctrl, TFont::data, TTC::dst, fwf_default, pal_bg_mem, REG_BGCNT, se_erase(), se_mem, SRF_BMP16, srf_init(), srf_set_pal(), tile_mem, tte_get_context(), and tte_init_base().