libmsx
C library for MSX
Loading...
Searching...
No Matches
tty.h
Go to the documentation of this file.
1// -*- coding: utf-8-unix -*-
2/*
3 * Copyright (c) 2021-2024 Daishi Mori (mori0091)
4 *
5 * This software is released under the MIT License.\n
6 * See https://github.com/mori0091/libmsx/blob/main/LICENSE
7 *
8 * GitHub libmsx project\n
9 * https://github.com/mori0091/libmsx
10 */
29#pragma once
30
31#ifndef TTY_H_
32#define TTY_H_
33
34#include <stdint.h>
35
46struct TTY_Device {
48 uint8_t columns;
50 uint8_t lines;
52 void (* clear_screen)(void);
54 void (* render_char)(uint8_t c);
56 void (* set_text_color)(uint8_t fg, uint8_t bg);
58 void (* set_border_color)(uint8_t border);
59};
60
61extern const struct TTY_Device * TTY_device;
62
68void TTY_locate(uint8_t x, uint8_t y);
69
73void TTY_linefeed(void);
74
78void TTY_cls(void);
79
84void TTY_put(uint8_t c);
85
90void TTY_set_fg_color(uint8_t fg);
91
96void TTY_set_bg_color(uint8_t bg);
97
102void TTY_set_border_color(uint8_t border);
103
109void TTY_set_text_color(uint8_t fg, uint8_t bg);
110
117void TTY_set_color(uint8_t fg, uint8_t bg, uint8_t border);
118
121#endif // TTY_H_
void TTY_linefeed(void)
MSX Line feed.
void TTY_set_border_color(uint8_t border)
MSX Set border color of the screen.
void TTY_locate(uint8_t x, uint8_t y)
MSX Set cursor position.
void TTY_set_bg_color(uint8_t bg)
MSX Set background color.
void TTY_set_text_color(uint8_t fg, uint8_t bg)
MSX Set foreground and background color.
void TTY_set_fg_color(uint8_t fg)
MSX Set foreground color.
void TTY_cls(void)
MSX Clear the screen and move the cursor to the top left corner.
const struct TTY_Device * TTY_device
void TTY_set_color(uint8_t fg, uint8_t bg, uint8_t border)
MSX Set foreground, background, and border color.
void TTY_put(uint8_t c)
MSX Send a byte to the TTY device.
Teletype/console device interface for hardware / screen mode abstraction.
Definition tty.h:46
void(* set_text_color)(uint8_t fg, uint8_t bg)
Set foreground and background color of text.
Definition tty.h:56
void(* clear_screen)(void)
Clear the text screen.
Definition tty.h:52
void(* render_char)(uint8_t c)
Render a character at the cursor position.
Definition tty.h:54
uint8_t lines
Lines of the text screen.
Definition tty.h:50
uint8_t columns
Columns of the text screen.
Definition tty.h:48
void(* set_border_color)(uint8_t border)
Set border color of the screen.
Definition tty.h:58