libwwcl libwwcl
WWitch compatibility layer for the Wonderful toolchain
Loading...
Searching...
No Matches
disp.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_DISP_H__
28#define __WF_LIBWW_DISP_H__
29
30#include "types.h"
31
37#define SCREEN1 0
38#define SCREEN2 1
39
40#define DCM_SCR1 0x0001
41#define DCM_SCR2 0x0002
42#define DCM_SPR 0x0004
43#define DCM_SPR_WIN 0x0008
44#define DCM_SCR2_WIN_INSIDE 0x0020
45#define DCM_SCR2_WIN_OUTSIDE 0x0030
46#define DCM_BORDER_COLOR 0x0700
47
48#define SCREEN_CHAR_WIDTH 32
49#define SCREEN_CHAR_HEIGHT 32
50#define SCREEN_PIXEL_WIDTH (SCREEN_CHAR_WIDTH * 8)
51#define SCREEN_PIXEL_HEIGHT (SCREEN_CHAR_HEIGHT * 8)
52#define LCD_CHAR_WIDTH 28
53#define LCD_CHAR_HEIGHT 18
54#define LCD_PIXEL_WIDTH (LCD_CHAR_WIDTH * 8)
55#define LCD_PIXEL_HEIGHT (LCD_CHAR_HEIGHT * 8)
56
57#define CFSFT_PALETTE 9
58#define CFM_SPR_UPPER 0x2000
59#define CFM_FLIP_H 0x4000
60#define CFM_FLIP_V 0x8000
61
62void display_control(uint16_t dcm);
63uint16_t display_status(void);
64void font_set_monodata(uint16_t start, uint16_t count, const uint8_t __far* data);
65void font_set_colordata(uint16_t start, uint16_t count, const uint8_t __far* data);
66void font_get_data(uint16_t start, uint16_t count, uint8_t __far* data);
67void font_set_color(uint16_t color);
68uint16_t font_get_color(void);
69void screen_set_char(uint8_t screen_id, uint8_t x, uint8_t y, uint8_t width, uint8_t height, const uint16_t __far* tiles);
70void screen_get_char(uint8_t screen_id, uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint16_t __far* tiles);
71uint16_t screen_get_char1(uint8_t screen_id, uint8_t x, uint8_t y);
72void screen_fill_char(uint8_t screen_id, uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint16_t tile);
73void screen_fill_attr(uint8_t screen_id, uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint16_t tile, uint16_t mask);
74void sprite_set_range(uint16_t first, uint16_t count);
75void sprite_set_char(uint16_t id, uint16_t tile);
76uint16_t sprite_get_char(uint16_t id);
77void sprite_set_location(uint16_t id, uint8_t x, uint8_t y);
78void sprite_set_char_location(uint16_t id, uint16_t tile, uint8_t x, uint8_t y);
79uint32_t sprite_get_char_location(uint16_t id);
80void sprite_set_data(uint16_t start, uint16_t count, const uint8_t __far* data);
81void screen_set_scroll(uint8_t screen_id, uint8_t x, uint8_t y);
82uint16_t screen_get_scroll(uint8_t screen_id);
83void screen2_set_window(uint8_t screen_id, uint8_t x, uint8_t y, uint8_t width, uint8_t height);
84void sprite_set_window(uint8_t screen_id, uint8_t x, uint8_t y, uint8_t width, uint8_t height);
85void palette_set_color(uint16_t id, uint16_t pal);
86uint16_t palette_get_color(uint16_t id);
87void lcd_set_color(uint16_t low, uint16_t high);
88uint32_t lcd_get_color(void);
89
90#define LCDSEG_SLEEP 0x01
91#define LCDSEG_VERTICAL 0x02
92#define LCDSEG_HORIZONTAL 0x04
93#define LCDSEG_AUX1 0x08
94#define LCDSEG_AUX2 0x10
95#define LCDSEG_AUX3 0x20
96
97void lcd_set_segments(uint16_t flags);
98uint16_t lcd_get_segments(void);
99void lcd_set_sleep(uint16_t on);
100uint16_t lcd_get_sleep(void);
101
104#endif /* __WF_LIBWW_DISP_H__ */
void font_set_monodata(uint16_t start, uint16_t count, const uint8_t __far *data)
void sprite_set_location(uint16_t id, uint8_t x, uint8_t y)
void sprite_set_char_location(uint16_t id, uint16_t tile, uint8_t x, uint8_t y)
uint16_t palette_get_color(uint16_t id)
uint16_t font_get_color(void)
uint32_t lcd_get_color(void)
uint16_t lcd_get_segments(void)
void screen_set_char(uint8_t screen_id, uint8_t x, uint8_t y, uint8_t width, uint8_t height, const uint16_t __far *tiles)
void screen_set_scroll(uint8_t screen_id, uint8_t x, uint8_t y)
uint16_t screen_get_scroll(uint8_t screen_id)
void screen_fill_attr(uint8_t screen_id, uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint16_t tile, uint16_t mask)
void lcd_set_color(uint16_t low, uint16_t high)
void lcd_set_segments(uint16_t flags)
uint16_t display_status(void)
void lcd_set_sleep(uint16_t on)
void screen2_set_window(uint8_t screen_id, uint8_t x, uint8_t y, uint8_t width, uint8_t height)
void sprite_set_range(uint16_t first, uint16_t count)
void font_set_colordata(uint16_t start, uint16_t count, const uint8_t __far *data)
void display_control(uint16_t dcm)
void palette_set_color(uint16_t id, uint16_t pal)
uint32_t sprite_get_char_location(uint16_t id)
void screen_get_char(uint8_t screen_id, uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint16_t __far *tiles)
uint16_t lcd_get_sleep(void)
void sprite_set_char(uint16_t id, uint16_t tile)
void font_set_color(uint16_t color)
void screen_fill_char(uint8_t screen_id, uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint16_t tile)
uint16_t screen_get_char1(uint8_t screen_id, uint8_t x, uint8_t y)
uint16_t sprite_get_char(uint16_t id)
void font_get_data(uint16_t start, uint16_t count, uint8_t __far *data)
void sprite_set_data(uint16_t start, uint16_t count, const uint8_t __far *data)
void sprite_set_window(uint8_t screen_id, uint8_t x, uint8_t y, uint8_t width, uint8_t height)