libww libww
WWitch compatibility library for the Wonderful toolchain
Loading...
Searching...
No Matches
text.h File Reference
#include <sys/types.h>

Go to the source code of this file.

Macros

#define NUM_HEXA   0x01
#define NUM_PADSPACE   0x00
#define NUM_PADZERO   0x02
#define NUM_ALIGN_RIGHT   0x00
#define NUM_ALIGN_LEFT   0x04
#define NUM_SIGNED   0x08
#define NUM_STORE   0x80
#define TEXT_MODE_ANK   0
#define TEXT_MODE_ANK_SJIS   1
#define TEXT_MODE_SJIS   2
#define TEXT_SCREEN_WIDTH   28
#define TEXT_SCREEN_HEIGHT   18

Functions

static void text_screen_init (void)
static void text_window_init (uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint16_t base)
static void text_set_mode (uint16_t value)
static uint16_t text_get_mode (void)
static void text_put_char (uint8_t x, uint8_t y, uint16_t ch)
uint16_t text_put_string (uint8_t x, uint8_t y, const char __far *str)
uint16_t text_put_substring (uint8_t x, uint8_t y, const char __far *str, uint16_t length)
static uint16_t text_put_numeric (uint8_t x, uint8_t y, uint8_t width, uint8_t flags, uint16_t value)
uint16_t text_store_numeric (void __far *buffer, uint8_t width, uint8_t flags, uint16_t value)
static void text_fill_char (uint8_t x, uint8_t y, uint16_t length, uint16_t ch)
static void text_set_palette (uint16_t index)
static uint16_t text_get_palette (void)
void text_set_ank_font (uint8_t start, uint8_t depth, uint16_t count, const void __far *data)
void text_get_fontdata (uint16_t ch, void __far *data)
static void text_set_screen (uint8_t id)
static uint8_t text_get_screen (void)
static void cursor_display (uint8_t value)
static uint8_t cursor_status (void)
static void cursor_set_location (uint8_t x, uint8_t y, uint8_t width, uint8_t height)
static uint32_t cursor_get_location (void)
static void cursor_set_type (uint8_t palette, uint8_t rate)
static uint16_t cursor_get_type (void)

Macro Definition Documentation

◆ NUM_ALIGN_LEFT

#define NUM_ALIGN_LEFT   0x04

Definition at line 18 of file text.h.

◆ NUM_ALIGN_RIGHT

#define NUM_ALIGN_RIGHT   0x00

Definition at line 16 of file text.h.

◆ NUM_HEXA

#define NUM_HEXA   0x01

Definition at line 10 of file text.h.

◆ NUM_PADSPACE

#define NUM_PADSPACE   0x00

Definition at line 12 of file text.h.

◆ NUM_PADZERO

#define NUM_PADZERO   0x02

Definition at line 14 of file text.h.

◆ NUM_SIGNED

#define NUM_SIGNED   0x08

Definition at line 20 of file text.h.

◆ NUM_STORE

#define NUM_STORE   0x80

Definition at line 22 of file text.h.

◆ TEXT_MODE_ANK

#define TEXT_MODE_ANK   0

Definition at line 26 of file text.h.

◆ TEXT_MODE_ANK_SJIS

#define TEXT_MODE_ANK_SJIS   1

Definition at line 28 of file text.h.

◆ TEXT_MODE_SJIS

#define TEXT_MODE_SJIS   2

Definition at line 30 of file text.h.

◆ TEXT_SCREEN_HEIGHT

#define TEXT_SCREEN_HEIGHT   18

Definition at line 34 of file text.h.

◆ TEXT_SCREEN_WIDTH

#define TEXT_SCREEN_WIDTH   28

Definition at line 33 of file text.h.

Function Documentation

◆ cursor_display()

void cursor_display ( uint8_t value)
inlinestatic
Parameters
valueCursor status (0 - disabled, 1 - enabled)

Definition at line 223 of file text.h.

◆ cursor_get_location()

uint32_t cursor_get_location ( void )
inlinestatic

Definition at line 257 of file text.h.

◆ cursor_get_type()

uint16_t cursor_get_type ( void )
inlinestatic

Definition at line 282 of file text.h.

◆ cursor_set_location()

void cursor_set_location ( uint8_t x,
uint8_t y,
uint8_t width,
uint8_t height )
inlinestatic

Definition at line 247 of file text.h.

◆ cursor_set_type()

void cursor_set_type ( uint8_t palette,
uint8_t rate )
inlinestatic
Parameters
palettePalette index used by cursor area when visible
rateBlinking rate, in frames; 0 - always visible

Definition at line 272 of file text.h.

◆ cursor_status()

uint8_t cursor_status ( void )
inlinestatic
Returns
Cursor status (bit 0 - enabled?, bit 1 - currently visible?)

Definition at line 236 of file text.h.

◆ text_fill_char()

void text_fill_char ( uint8_t x,
uint8_t y,
uint16_t length,
uint16_t ch )
inlinestatic

Definition at line 140 of file text.h.

◆ text_get_fontdata()

void text_get_fontdata ( uint16_t ch,
void __far * data )
Parameters
chCharacter code
dataOutput buffer for font data

◆ text_get_mode()

uint16_t text_get_mode ( void )
inlinestatic

Get text mode.

Definition at line 90 of file text.h.

◆ text_get_palette()

uint16_t text_get_palette ( void )
inlinestatic

Get the palette used by printed text.

Returns
Palette index.

Definition at line 168 of file text.h.

◆ text_get_screen()

uint8_t text_get_screen ( void )
inlinestatic
Returns
Screen ID

Definition at line 209 of file text.h.

◆ text_put_char()

void text_put_char ( uint8_t x,
uint8_t y,
uint16_t ch )
inlinestatic

Definition at line 101 of file text.h.

◆ text_put_numeric()

uint16_t text_put_numeric ( uint8_t x,
uint8_t y,
uint8_t width,
uint8_t flags,
uint16_t value )
inlinestatic
Returns
Number of characters displayed.

Definition at line 124 of file text.h.

◆ text_put_string()

uint16_t text_put_string ( uint8_t x,
uint8_t y,
const char __far * str )
Returns
Number of characters displayed.

◆ text_put_substring()

uint16_t text_put_substring ( uint8_t x,
uint8_t y,
const char __far * str,
uint16_t length )
Returns
Number of characters displayed.

◆ text_screen_init()

void text_screen_init ( void )
inlinestatic

Initializes a text window with the following default settings:

  • X, Y = 0, 0
  • width, height = 28, 18
  • base tile = 512 - font tile count (in ASCII mode)
  • base tile = 512 - (width x height) (in Shift-JIS and mixed modes)

Definition at line 43 of file text.h.

◆ text_set_ank_font()

void text_set_ank_font ( uint8_t start,
uint8_t depth,
uint16_t count,
const void __far * data )
Parameters
startStarting character code
depth0 = 1BPP, 1 = 2BPP
countNumber of characters (tiles)
dataInput buffer containing font data

◆ text_set_mode()

void text_set_mode ( uint16_t value)
inlinestatic

Set text mode.

Definition at line 77 of file text.h.

◆ text_set_palette()

void text_set_palette ( uint16_t index)
inlinestatic

Set the palette used by printed text.

Parameters
indexPalette index.

Definition at line 154 of file text.h.

◆ text_set_screen()

void text_set_screen ( uint8_t id)
inlinestatic
Parameters
idScreen ID

Definition at line 196 of file text.h.

◆ text_store_numeric()

uint16_t text_store_numeric ( void __far * buffer,
uint8_t width,
uint8_t flags,
uint16_t value )
Returns
Number of characters stored.

◆ text_window_init()

void text_window_init ( uint8_t x,
uint8_t y,
uint8_t width,
uint8_t height,
uint16_t base )
inlinestatic

Initializes a text window on the configured screen. This requires the following number of tiles, starting from the base:

  • font tile count (in ASCII mode)
  • width x height (in Shift-JIS and mixed modes)
    Parameters
    xStarting X offset, in tiles.
    yStarting Y offset, in tiles.
    widthWidth of text window, in tiles.
    heightHeight of text window, in tiles.
    baseBase tile index.

Definition at line 64 of file text.h.