Font initialization functions
Initialize print module. Must be called after VDP_SetMode().
| void Print_SetMode( |
| ) |
Change current print mode.
| mode u8 | Print mode to select. Can be: |
PRINT_MODE_BITMAP Draw characters from RAM (R-T unpack font data and draw it). Need PRINT_USE_BITMAP or PRINT_USE_VRAM compile option.
PRINT_MODE_BITMAP_TRANS Draw characters from RAM with transparency (R-T unpack font data and draw it). Need PRINT_USE_BITMAP or PRINT_USE_VRAM compile option.
PRINT_MODE_BITMAP_VRAM Draw characters from VRAM (font data is upack once in VRAM thne drawing is done by VRAM copy). Need PRINT_USE_VRAM compile option.
PRINT_MODE_SPRITE Draw characters from sprites (load font data as sprite pattern in VRAM then display characters using sprite system). Need PRINT_USE_SPRITE compile option.
PRINT_MODE_TEXT Draw characters as pattern names (text mode). Need PRINT_USE_TEXT compile option.
| void Print_SetFont( |
| ) |
Set the current font (and set mode to RAM).
| font const u8* | Pointer to font structure. Character patterns plus a 4 bytes headers (character width/height, spacing width/height, 1st character code, last character code). |
| inline void Print_SetFontEx( |
| ) |
Set the current font
| patternX u8 | Width of the character data (should be always 8) |
| patternY u8 | Height of the character data |
| sizeX u8 | Width of the chatacter to display (can be different than the one of the data) |
| sizeY u8 | Height of the chatacter to display (can be different than the one of the data) |
| firstChr u8 | ASCII code of the first character included in the font data |
| lastChr u8 | ASCII code of the last character included in the font data |
| patterns const u8* | Address of the character data table |
Get first character code
Current font information structure
| inline void Print_SetPosition( |
| ) |
Set cursor position.
| X UX | Print cursor position X coordinate |
| Y UY | Print cursor position Y coordinate |
| inline void Print_SetCharSize( |
| ) |
Set character size.
| X u8 | Character width |
| Y u8 | Character height |
| inline void Print_SetTabSize( |
| ) |
Set tabulation size in pixel.
| size u8 | Size of the tabulation in pixel (must be a power of 2 like 16, 32, 64, ...) |
| bool Print_SetBitmapFont( |
| ) |
Initialize print module and set a font in RAM. This function requires PRINT_USE_BITMAP compile option to be set to TRUE.
| font const u8* | Pointer to font structure. Character patterns plus a 4 bytes headers (character width/height, spacing width/height, 1st character code, last character code). |
| void Print_SetVRAMFont( |
| ) |
Set the current font and upload data to VRAM . This function requires PRINT_USE_VRAM compile option to be set to TRUE.
| font const u8* | Pointer to font structure. Character patterns plus a 4 bytes headers (character width/height, spacing width/height, 1st character code, last character code). |
| y UY | Y position to store the font in VRAM |
| color u8 | Color of the font |
| void Print_SetTextFont( |
| ) |
Initialize print module and set a font in RAM. This function requires PRINT_USE_TEXT compile option to be set to TRUE.
| font const u8* | Pointer to font structure. Character patterns plus a 4 bytes headers (character width/height, spacing width/height, 1st character code, last character code). |
| offset u8 | Pattern index where to start to store the font |
| inline void Print_SelectTextFont( |
| ) |
Set print mode to text mode. This function requires PRINT_USE_TEXT compile option to be set to TRUE.
| font const u8* | Pointer to font structure. Character patterns plus a 4 bytes headers (character width/height, spacing width/height, 1st character code, last character code). |
| offset u8 | Pattern index where to start to store the font |
| void Print_SetSpriteFont( |
| ) |
Set the current font and upload to Sprite Pattern Table. This function requires PRINT_USE_SPRITE compile option to be set to TRUE.
| font const u8* | Pointer to font structure. Character patterns plus a 4 bytes headers (character width/height, spacing width/height, 1st character code, last character code). |
| patIdx u8 | Pattern index to put font character |
| sprtIdx u8 | Sprite index of the first sprite the module can use to display text |
Get pattern index of the 1st sprite character. This function requires PRINT_USE_SPRITE compile option to be set to TRUE.
Pattern index where the font is stored
Get the next sprite index. This function requires PRINT_USE_SPRITE compile option to be set to TRUE.
Sprite index of the first sprite the module can use to display text
| inline void Print_SetSpriteID( |
| ) |
Set the next sprite index. This function requires PRINT_USE_SPRITE compile option to be set to TRUE.
| id u8 | Sprite index of the first sprite the module can use to display text |
Text draw functions
| void Print_DrawChar( |
| ) |
Print a single character
| chr u8 | ASCII code of the character to draw |
| void Print_DrawCharX( |
| ) |
Print the same character many times
| chr c8 | ASCII code of the character to draw |
| num u8 | Number of the same character to display in a row |
| void Print_DrawText( |
| ) |
Print a character string
| string const c8* | Null-terminated string to draw |
| void Print_DrawHex8( |
| ) |
Print a 8-bits binary value
| value u8 | 8 bits integer to draw in hexadecimal form |
| void Print_DrawHex16( |
| ) |
Print a 16-bits hexadecimal value
| value u16 | 16 bits integer to draw in hexadecimal form |
| void Print_DrawBin8( |
| ) |
Print a 8-bits binary value
| value u8 | 8 bits integer to draw in binary form (0 or 1) |
| void Print_DrawHex32( |
| ) |
Print a 32-bits hexadecimal value This function requires PRINT_USE_32B compile option to be set to TRUE.
| value u32 | 32 bits integer to draw in hexadecimal form |
| void Print_DrawInt( |
| ) |
Print a 32-bits signed decimal value. This function requires PRINT_USE_32B compile option to be set to TRUE.
| value i32 | 32 bits signed integer to draw |
| void Print_DrawInt( |
| ) |
Print a 16-bits signed decimal value. This function requires PRINT_USE_32B compile option to be set to FALSE.
| value i16 | 16 bits signed integer to draw |
Print space.
Print tabulation.
Print return.
| void Print_DrawFormat( |
| ) |
Print a formated string with a variable number of parameters. This function requires PRINT_USE_FORMAT compile option to be set to TRUE.
| format const c8* | Printf style format |
%i or %d 16 bits signed integer
%u 16 bits unsigned integer
%[N]x 16 bits hexadecimal with N digits (default: 4)
%c ASCII coded character
%s Null-terminated string
%I or %D 32 bits signed integer
%U 32 bits unsigned integer
%[N]X 32 bits hexadecimal with N digits (default: 4)
\t Tabulation
\n Return to new line
... - Variadic parameters
Clear screen
| void Print_Backspace( |
| ) |
Clear X character back from current cursor position.
| num u8 | Number of character to clear |
| inline void Print_DrawTextAt( |
| ) |
Draw text at a given position on screen.
| x u8 | Position X coordinate |
| y u8 | Position Y coordinate |
| str const c8* | Null-terminated string to draw |
| inline void Print_DrawTextAtV( |
| ) |
Draw a vertical text at a given position on screen.
| x u8 | Position X coordinate |
| y u8 | Position Y coordinate |
| str const c8* | Null-terminated string to draw |
| inline void Print_DrawCharAt( |
| ) |
Print a single character at a given position.
| x u8 | Position X coordinate |
| y u8 | Position Y coordinate |
| chr c8 | Character to draw |
| inline void Print_DrawCharXAt( |
| ) |
Print the same character many times at a given position.
| x u8 | Position X coordinate |
| y u8 | Position Y coordinate |
| chr c8 | Character to draw |
| len u8 | Number of character to draw |
| inline void Print_DrawCharYAt( |
| ) |
Print vertically the same character many times at a given position.
| x u8 | Position X coordinate |
| y u8 | Position Y coordinate |
| chr c8 | Character to draw |
| len u8 | Number of character to draw |
| inline void Print_DrawIntAt( |
| ) |
Print a 16-bits signed decimal value at a given position.
| x u8 | Position X coordinate |
| y u8 | Position Y coordinate |
| val i16 | 16 bits integer to display |
| void Print_SetColor( |
| ) |
Set the draw color.
| text u8 | Text color (16 color index or 8 bits RGB) |
| bg u8 | Background color (16 color index or 8 bits RGB) |
| void Print_SetColorShade( |
| ) |
Set colors shade. This function requires PRINT_COLOR_NUM compile option to be set to greater than 1 value.
| shade const u8* | Pointer to font color (1 color for each line) |
| void Print_SetShadow( |
| ) |
Set shadow effect. This function requires PRINT_USE_FX_SHADOW compile option to be set to TRUE.
| offsetX i8 | Offset on X coordinate (can be negative). |
| offsetY i8 | Offset on Y coordinate (can be negative). |
| color u8 | Shadow's color. |
| void Print_EnableShadow( |
| ) |
Activate/desactivate shadow effect. This function requires PRINT_USE_FX_SHADOW compile option to be set to TRUE.
| enable bool | TRUE to enable shadow effect, FALSE to disable. |
| void Print_DrawTextShadow( |
| ) |
Print a character string with shadow FX using 2 pass rendering (to have clean shadow over all characters). This function requires PRINT_USE_2_PASS_FX and PRINT_USE_FX_SHADOW compile options to be set to TRUE.
| string const c8* | Pointer to the null-terminated string to display. |
| offsetX i8 | Shadow position offset (X coordinate). |
| offsetY i8 | Shadow position offset (X coordinate). |
| color u8 | Shadow color. |
| void Print_SetOutline( |
| ) |
Set shadow effect. This function requires PRINT_USE_FX_OUTLINE compile option to be set to TRUE.
| enable bool | TRUE to enable outline effect, FALSE to disable. |
| color u8 | Color of the outline effect |
| void Print_EnableOutline( |
| ) |
Activate/desactivate shadow effect This function requires PRINT_USE_FX_OUTLINE compile option to be set to TRUE.
| enable bool | TRUE to enable outline effect, FALSE to disable. |
| void Print_DrawTextOutline( |
| ) |
Print a character string using outline FX. This function requires PRINT_USE_2_PASS_FX and PRINT_USE_FX_OUTLINE compile options to be set to TRUE.
| string const c8* | Pointer to the null-terminated string to display |
| color u8 | Outline color |
Boxes draw functions
| void Print_DrawLineH( |
| ) |
Draw an horizontal line using characters This function requires PRINT_USE_GRAPH compile option to be set to TRUE.
| x u8 | Start position X coordinate |
| y u8 | Start position Y coordinate |
| len u8 | Lenght of the horizontal line (in print mode unit) |
| void Print_DrawLineV( |
| ) |
Draw a vertical line using characters This function requires PRINT_USE_GRAPH compile option to be set to TRUE.
| x u8 | Start position X coordinate |
| y u8 | Start position Y coordinate |
| len u8 | Lenght of the vertical line (in print mode unit) |
| void Print_DrawBox( |
| ) |
Draw a box using characters This function requires PRINT_USE_GRAPH compile option to be set to TRUE.
| x u8 | Start position X coordinate |
| y u8 | Start position Y coordinate |
| width u8 | Box width (in print mode unit) |
| height u8 | Box height (in print mode unit) |
| inline void Print_DrawTextAlign( |
| ) |
Print a character string
| str const c8* | Null-terminated string to draw |
| align u8 | Alignement flag: PRINT_ALIGN_LEFT, PRINT_ALIGN_CENTER, PRINT_ALIGN_RIGHT |
| inline void Print_DrawTextAlignAt( |
| ) |
Draw text at a given position on screen.
| x u8 | Position X coordinate |
| y u8 | Position Y coordinate |
| str const c8* | Null-terminated string to draw |
| align u8 | Alignement flag: PRINT_ALIGN_LEFT, PRINT_ALIGN_CENTER, PRINT_ALIGN_RIGHT |