OpenSNES
Modern Open-Source SNES Development SDK
Loading...
Searching...
No Matches
text.h
Go to the documentation of this file.
1
10
11#ifndef OPENSNES_TEXT_H
12#define OPENSNES_TEXT_H
13
14#include <snes/types.h>
15
30
37
46#define TEXT_DEFAULT_TILEMAP_ADDR 0x3800
48#define TEXT_DEFAULT_FONT_TILE 0
50#define TEXT_DEFAULT_PALETTE 0
63#define TEXT_MAP_ROWS 32
64
88void textInit(u16 tilemap_addr, u16 font_tile, u8 palette);
89
103void textLoadFont(u16 vram_addr);
104
118void textLoadFont4bpp(u16 vram_addr);
119
129void textSetPos(u8 x, u8 y);
130
136
142
150void textPutChar(char c);
151
157void textPrint(const char *str);
158
166void textPrintAt(u8 x, u8 y, const char *str);
167
173void textPrintU16(u16 value);
174
181void textPrintHex(u16 value, u8 digits);
182
186void textClear(void);
187
196void textClearRect(u8 x, u8 y, u8 w, u8 h);
197
215void textFlush(void);
216
239void textModeInit(void);
240
241#endif /* OPENSNES_TEXT_H */
u8 palette[]
Full 256-color palette for BG and sprite layers (512 bytes).
static u16 c
Definition main.c:156
unsigned short u16
16-bit unsigned integer (0 to 65535)
Definition types.h:53
unsigned char u8
8-bit unsigned integer (0 to 255)
Definition types.h:47
Text rendering configuration.
Definition text.h:19
u8 map_width
Definition text.h:24
u16 font_tile
Definition text.h:21
u8 priority
Definition text.h:23
u16 tilemap_addr
Definition text.h:20
u8 palette
Definition text.h:22
void textLoadFont(u16 vram_addr)
Load font tiles to VRAM.
void textLoadFont4bpp(u16 vram_addr)
Load font as 4bpp tiles for Mode 1 BGs.
void textModeInit(void)
Initialize text display mode — one-call setup for text-based examples.
void textClear(void)
Clear entire tilemap with spaces.
TextConfig text_config
Default text configuration.
void textPrintAt(u8 x, u8 y, const char *str)
Print a string at specific position.
void textClearRect(u8 x, u8 y, u8 w, u8 h)
Clear a rectangular region (fills with spaces).
void textInit(u16 tilemap_addr, u16 font_tile, u8 palette)
Initialize the text rendering system.
void textFlush(void)
Request tilemap DMA transfer to VRAM (rarely needed).
void textPrintU16(u16 value)
Print an unsigned integer.
void textSetPos(u8 x, u8 y)
Set cursor position.
void textPutChar(char c)
Print a single character at cursor position.
void textPrintHex(u16 value, u8 digits)
Print an unsigned integer in hexadecimal.
void textPrint(const char *str)
Print a string at cursor position.
u8 textGetX(void)
Get current cursor X position.
u8 textGetY(void)
Get current cursor Y position.
OpenSNES Standard Types.