Added TAB, ICH, and DCH ANSI
This commit is contained in:
parent
b0c4e1ef36
commit
2376d44b9e
|
@ -51,6 +51,8 @@ extern void ansi_cud(p_channel chan, short arg_count, short args[]);
|
|||
extern void ansi_cup(p_channel chan, short arg_count, short args[]);
|
||||
extern void ansi_ed(p_channel chan, short arg_count, short args[]);
|
||||
extern void ansi_el(p_channel chan, short arg_count, short args[]);
|
||||
extern void ansi_ich(p_channel chan, short arg_count, short args[]);
|
||||
extern void ansi_dch(p_channel chan, short arg_count, short args[]);
|
||||
|
||||
/*
|
||||
* Console variables and constants
|
||||
|
@ -69,6 +71,8 @@ const t_ansi_seq ansi_sequence[] = {
|
|||
{ "\x1B[#D", ansi_cud },
|
||||
{ "\x1B[#J", ansi_ed },
|
||||
{ "\x1B[#K", ansi_el },
|
||||
{ "\x1B[#@]", ansi_ich },
|
||||
{ "\x1B[#P]", ansi_dch },
|
||||
{ "\x1B[#;#H", ansi_cup },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
@ -205,6 +209,36 @@ void ansi_el(p_channel chan, short arg_count, short args[]) {
|
|||
text_clear_line(chan->dev, n);
|
||||
}
|
||||
|
||||
/*
|
||||
* ANSI Handler: insert a character
|
||||
*/
|
||||
void ansi_ich(p_channel chan, short arg_count, short args[]) {
|
||||
unsigned short n = 2;
|
||||
|
||||
TRACE("ansi_ich");
|
||||
|
||||
if (arg_count > 0) {
|
||||
n = args[0];
|
||||
}
|
||||
|
||||
text_insert(chan->dev, n);
|
||||
}
|
||||
|
||||
/*
|
||||
* ANSI Handler: delete a character
|
||||
*/
|
||||
void ansi_dch(p_channel chan, short arg_count, short args[]) {
|
||||
unsigned short n = 2;
|
||||
|
||||
TRACE("ansi_dch");
|
||||
|
||||
if (arg_count > 0) {
|
||||
n = args[0];
|
||||
}
|
||||
|
||||
text_delete(chan->dev, n);
|
||||
}
|
||||
|
||||
//
|
||||
// Initialize the console... nothing needs to happen here
|
||||
//
|
||||
|
|
|
@ -398,6 +398,50 @@ void text_clear_line(short screen, short mode) {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Insert a number of characters at the cursor position
|
||||
*
|
||||
* Inputs:
|
||||
* screen = the screen number 0 for channel A, 1 for channel B
|
||||
* count = the number of characters to insert
|
||||
*/
|
||||
void text_insert(short screen, short count) {
|
||||
int i;
|
||||
p_text_channel chan = &text_channel[screen];
|
||||
int eol_index = (chan->y + 1) * chan->columns_max - 1;
|
||||
int cursor_index = chan->y * chan->columns_max + chan->x;
|
||||
|
||||
for (i = cursor_index; i < eol_index; i++) {
|
||||
chan->text_cells[i+1] = chan->text_cells[i];
|
||||
chan->color_cells[i+1] = chan->color_cells[i];
|
||||
}
|
||||
|
||||
chan->text_cells[cursor_index] = ' ';
|
||||
chan->color_cells[cursor_index] = chan->current_color;
|
||||
}
|
||||
|
||||
/*
|
||||
* Delete a number of characters at the cursor position
|
||||
*
|
||||
* Inputs:
|
||||
* screen = the screen number 0 for channel A, 1 for channel B
|
||||
* count = the number of characters to delete
|
||||
*/
|
||||
void text_delete(short screen, short count) {
|
||||
int i;
|
||||
p_text_channel chan = &text_channel[screen];
|
||||
int eol_index = (chan->y + 1) * chan->columns_max - 1;
|
||||
int cursor_index = chan->y * chan->columns_max + chan->x;
|
||||
|
||||
for (i = cursor_index; i < eol_index; i++) {
|
||||
chan->text_cells[i] = chan->text_cells[i+1];
|
||||
chan->color_cells[i] = chan->color_cells[i+1];
|
||||
}
|
||||
|
||||
chan->text_cells[eol_index] = ' ';
|
||||
chan->color_cells[eol_index] = chan->current_color;
|
||||
}
|
||||
|
||||
/*
|
||||
* Scroll the text screen up one row
|
||||
* Inputs:
|
||||
|
@ -442,6 +486,7 @@ void text_scroll(short screen) {
|
|||
*/
|
||||
void text_put_raw(short screen, char c) {
|
||||
if (screen < MAX_TEXT_CHANNELS) {
|
||||
short x, y;
|
||||
p_text_channel chan = &text_channel[screen];
|
||||
|
||||
switch (c) {
|
||||
|
@ -460,6 +505,12 @@ void text_put_raw(short screen, char c) {
|
|||
}
|
||||
break;
|
||||
|
||||
case CHAR_TAB:
|
||||
text_get_xy(screen, &x, &y);
|
||||
y = (y & 0x07) + 8;
|
||||
text_set_xy(screen, x, y);
|
||||
break;
|
||||
|
||||
default:
|
||||
*chan->text_cursor_ptr++ = c;
|
||||
*chan->color_cursor_ptr++ = chan->current_color;
|
||||
|
|
|
@ -95,6 +95,24 @@ extern void text_clear(short screen, short mode);
|
|||
*/
|
||||
extern text_clear_line(short screen, short mode);
|
||||
|
||||
/*
|
||||
* Insert a number of characters at the cursor position
|
||||
*
|
||||
* Inputs:
|
||||
* screen = the screen number 0 for channel A, 1 for channel B
|
||||
* count = the number of characters to insert
|
||||
*/
|
||||
extern void text_insert(short screen, short count);
|
||||
|
||||
/*
|
||||
* Delete a number of characters at the cursor position
|
||||
*
|
||||
* Inputs:
|
||||
* screen = the screen number 0 for channel A, 1 for channel B
|
||||
* count = the number of characters to delete
|
||||
*/
|
||||
extern void text_delete(short screen, short count);
|
||||
|
||||
/*
|
||||
* Scroll the text screen up one row
|
||||
* Inputs:
|
||||
|
|
3864
src/foenixmcp.s68
3864
src/foenixmcp.s68
File diff suppressed because it is too large
Load diff
|
@ -10,15 +10,16 @@
|
|||
* Miscellaneous definitions
|
||||
*/
|
||||
|
||||
#define MAX_TRIES_BUSY 10000 // The maximum number of times to check for an operation to complete (general purpose)
|
||||
#define MAX_TRIES_BUSY 10000 /* The maximum number of times to check for an operation to complete (general purpose) */
|
||||
|
||||
/*
|
||||
* Definitions of special characters
|
||||
*/
|
||||
|
||||
#define CHAR_ESC '\x1B' // Escape character
|
||||
#define CHAR_CR '\x0D' // Carriage return
|
||||
#define CHAR_NL '\x0A' // Newline character
|
||||
#define CHAR_BS '\b' // Backspace
|
||||
#define CHAR_ESC '\x1B' /* Escape character */
|
||||
#define CHAR_TAB '\t' /* Vertical tab */
|
||||
#define CHAR_CR '\x0D' /* Carriage return */
|
||||
#define CHAR_NL '\x0A' /* Linefeed */
|
||||
#define CHAR_BS '\b' /* Backspace */
|
||||
|
||||
#endif
|
||||
|
|
8623
src/mapfile
8623
src/mapfile
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue