llvm-mos-sdk
Functions
console.h File Reference
#include <stdint.h>
#include <neo6502.h>
#include "types.h"
Include dependency graph for console.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

char neo_console_read_char (void)
 Read and remove a key press. More...
 
uint8_t neo_console_status (void)
 Check to see if the keyboard queue is empty. More...
 
void neo_console_read_line_p (neo_pstring_t *line)
 Read the current line below the cursor, and move the cursor by one line. The line is stored in Pascal string format. More...
 
void neo_console_read_line (char *line)
 Read the current line below the cursor, and move the cursor by one line. The line is stored in C string format. More...
 
void neo_console_define_hotkey_p (uint8_t hotkey, const neo_pstring_t *str)
 Define a hotkey which emits a Pascal-style string when pressed. More...
 
void neo_console_define_hotkey (uint8_t hotkey, const char *str)
 Define a hotkey which emits a C-style string when pressed. More...
 
void neo_console_define_char (char ch, const uint8_t *bitmap)
 Define a font character. More...
 
void neo_console_write_char (char ch)
 Write a character to the console. More...
 
void neo_console_set_cursor_pos (uint8_t x, uint8_t y)
 Move the cursor to the specified position. More...
 
void neo_console_list_hotkeys (void)
 Display the current function key definitions. More...
 
void neo_console_screen_size (uint8_t *width, uint8_t *height)
 Fetch the console size, in characters. More...
 
void neo_console_clear_screen (void)
 Clear the console screen. More...
 
void neo_console_cursor_pos (uint8_t *x, uint8_t *y)
 Fetch the cursor position. More...
 
void neo_console_clear_region (uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2)
 Clear all characters within the specified region. More...
 
void neo_console_set_text_color (uint8_t fg, uint8_t bg)
 Set the text color. More...
 
void neo_console_get_text_color (uint8_t *fg, uint8_t *bg)
 Fetch the text color. More...
 
void neo_console_set_cursor_visibility (uint8_t value)
 Set the cursor visibility. More...
 

Function Documentation

◆ neo_console_clear_region()

void neo_console_clear_region ( uint8_t  x1,
uint8_t  y1,
uint8_t  x2,
uint8_t  y2 
)

Clear all characters within the specified region.

Parameters
x1Begin X
y1Begin Y
x2End X
y2End Y

◆ neo_console_clear_screen()

void neo_console_clear_screen ( void  )

Clear the console screen.

◆ neo_console_cursor_pos()

void neo_console_cursor_pos ( uint8_t *  x,
uint8_t *  y 
)

Fetch the cursor position.

Parameters
xX
yY

◆ neo_console_define_char()

void neo_console_define_char ( char  ch,
const uint8_t *  bitmap 
)

Define a font character.

Parameters
chCharacter (192-255)
bitmap7-byte (bits 0..5 => 6x7) character bitmap.

◆ neo_console_define_hotkey()

void neo_console_define_hotkey ( uint8_t  hotkey,
const char *  str 
)

Define a hotkey which emits a C-style string when pressed.

Parameters
hotkeyFunction key to act as a hotkey (F1-F10 => 1-10)
strString to emit when pressed.

◆ neo_console_define_hotkey_p()

void neo_console_define_hotkey_p ( uint8_t  hotkey,
const neo_pstring_t str 
)

Define a hotkey which emits a Pascal-style string when pressed.

Parameters
hotkeyFunction key to act as a hotkey (F1-F10 => 1-10)
strString to emit when pressed.

◆ neo_console_get_text_color()

void neo_console_get_text_color ( uint8_t *  fg,
uint8_t *  bg 
)

Fetch the text color.

Parameters
fgForeground color.
bgBackground color.

◆ neo_console_list_hotkeys()

void neo_console_list_hotkeys ( void  )

Display the current function key definitions.

◆ neo_console_read_char()

char neo_console_read_char ( void  )

Read and remove a key press.

Returns
ASCII key value; 0 if no key presses queued.

◆ neo_console_read_line()

void neo_console_read_line ( char *  line)

Read the current line below the cursor, and move the cursor by one line. The line is stored in C string format.

Multi-line input is supported.

Parameters
lineBuffer for the line to be read.

◆ neo_console_read_line_p()

void neo_console_read_line_p ( neo_pstring_t line)

Read the current line below the cursor, and move the cursor by one line. The line is stored in Pascal string format.

Multi-line input is supported.

Parameters
lineBuffer for the line to be read.

◆ neo_console_screen_size()

void neo_console_screen_size ( uint8_t *  width,
uint8_t *  height 
)

Fetch the console size, in characters.

Parameters
widthWidth
heightHeight

◆ neo_console_set_cursor_pos()

void neo_console_set_cursor_pos ( uint8_t  x,
uint8_t  y 
)

Move the cursor to the specified position.

Parameters
xX
yY

◆ neo_console_set_cursor_visibility()

void neo_console_set_cursor_visibility ( uint8_t  value)

Set the cursor visibility.

◆ neo_console_set_text_color()

void neo_console_set_text_color ( uint8_t  fg,
uint8_t  bg 
)

Set the text color.

Parameters
fgForeground color.
bgBackground color.

◆ neo_console_status()

uint8_t neo_console_status ( void  )

Check to see if the keyboard queue is empty.

Returns
0xFF if the queue is empty, 0 otherwise.

◆ neo_console_write_char()

void neo_console_write_char ( char  ch)

Write a character to the console.

Parameters
chCharacter