libwwcl libwwcl
WWitch compatibility layer for the Wonderful toolchain
Loading...
Searching...
No Matches
text.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Adrian "asie" Siekierka
3 *
4 * This software is provided 'as-is', without any express or implied
5 * warranty. In no event will the authors be held liable for any damages
6 * arising from the use of this software.
7 *
8 * Permission is granted to anyone to use this software for any purpose,
9 * including commercial applications, and to alter it and redistribute it
10 * freely, subject to the following restrictions:
11 *
12 * 1. The origin of this software must not be misrepresented; you must not
13 * claim that you wrote the original software. If you use this software
14 * in a product, an acknowledgment in the product documentation would be
15 * appreciated but is not required.
16 *
17 * 2. Altered source versions must be plainly marked as such, and must not be
18 * misrepresented as being the original software.
19 *
20 * 3. This notice may not be removed or altered from any source distribution.
21 */
22
27#ifndef __WF_LIBWW_TEXT_H__
28#define __WF_LIBWW_TEXT_H__
29
30#include "types.h"
31
37#define TEXT_SCREEN_WIDTH 28
38#define TEXT_SCREEN_HEIGHT 18
39
41void text_window_init(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint16_t base);
42
43#define TEXT_MODE_ANK 0
44#define TEXT_MODE_ANK_SJIS 1
45#define TEXT_MODE_SJIS 2
46
47void text_set_mode(uint16_t mode);
48uint16_t text_get_mode(void);
49void text_put_char(uint8_t x, uint8_t y, uint16_t chr);
50uint16_t text_put_string(uint8_t x, uint8_t y, const char __far* str);
51uint16_t text_put_substring(uint8_t x, uint8_t y, const char __far* str, uint16_t length);
52
53#define NUM_HEXA 0x01
54#define NUM_PADSPACE 0x00
55#define NUM_PADZERO 0x02
56#define NUM_ALIGN_RIGHT 0x00
57#define NUM_ALIGN_LEFT 0x04
58#define NUM_SIGNED 0x08
59#define NUM_STORE 0x80
60
61uint16_t text_put_numeric(uint8_t x, uint8_t y, uint8_t width, uint8_t flags, uint16_t value);
62uint16_t text_fill_char(uint8_t x, uint8_t y, uint16_t length, uint16_t chr);
63void text_set_palette(uint16_t palette_index);
64uint16_t text_get_palette(void);
65void text_get_fontdata(uint16_t chr, void __far* buf);
66void text_set_screen(uint8_t screen_id);
67uint16_t text_get_screen(void);
68void cursor_display(uint8_t on);
69uint16_t cursor_status(void);
70void cursor_set_location(uint8_t x, uint8_t y, uint8_t width, uint8_t height);
71uint32_t cursor_get_location(void);
72void cursor_set_type(uint16_t palette_index, uint16_t blink_interval);
73uint32_t cursor_get_type(void);
74
77#endif /* __WF_LIBWW_TEXT_H__ */
void cursor_set_type(uint16_t palette_index, uint16_t blink_interval)
uint32_t cursor_get_type(void)
uint16_t text_fill_char(uint8_t x, uint8_t y, uint16_t length, uint16_t chr)
uint16_t text_put_numeric(uint8_t x, uint8_t y, uint8_t width, uint8_t flags, uint16_t value)
void text_set_palette(uint16_t palette_index)
uint16_t cursor_status(void)
void text_set_mode(uint16_t mode)
uint16_t text_get_mode(void)
void text_put_char(uint8_t x, uint8_t y, uint16_t chr)
void text_window_init(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint16_t base)
uint16_t text_put_string(uint8_t x, uint8_t y, const char __far *str)
uint32_t cursor_get_location(void)
void cursor_set_location(uint8_t x, uint8_t y, uint8_t width, uint8_t height)
uint16_t text_get_screen(void)
void text_screen_init(void)
void text_get_fontdata(uint16_t chr, void __far *buf)
uint16_t text_put_substring(uint8_t x, uint8_t y, const char __far *str, uint16_t length)
uint16_t text_get_palette(void)
void cursor_display(uint8_t on)
void text_set_screen(uint8_t screen_id)