SetPos (incomplete)

This commit is contained in:
y4my4my4m 2023-05-15 01:26:22 +09:00
parent 4aeb44362b
commit b44662231c
3 changed files with 87 additions and 0 deletions

Binary file not shown.

View file

@ -43,6 +43,26 @@ I64 TelnetOpen(U8 *host, U16 port) {
return sock;
}
// function to increase/decrease col or row
U0 SetPos(I64 col, I64 row, Bool relativeCol=TRUE, Bool relativeRow=TRUE) {
if (col < 0) {
if (relativeCol)
term.current_col += col;
else
term.current_col = col;
if (term.current_col > term.window_width)
term.current_col = 1;
}
if (row < 0) {
if (relativeCol)
term.current_row += row;
else
term.current_row = row;
if (term.current_row > term.window_height)
term.current_row = 1;
}
}
U0 HandleControlCodes(U8 ch) {
if (ch < 32) { // ASCII code below 32 (control character)
switch (ch) {

View file

@ -100,7 +100,74 @@ public I64 ANSIArtBrowser()
return MStrPrint("%Q%Q", "Art/", res2);
}
// U0 SetTermColor(CBGR24 *color) {
// DocPrint(term.doc, "$$TC,0x%06X$$\n", color->bgr);
// }
// U0 SetTermBGColor(CBGR24 *color) {
// DocPrint(term.doc, "$$BC,0x%06X$$\n", color->bgr);
// }
// U0 SetTermPalette(CBGR24 *palette) {
// I64 i;
// for (i = 0; i < COLORS_NUM; i++) {
// DocPrint(term.doc, "$$PC,%d,%d,%d,0x%06X$$\n", i, palette[i].r, palette[i].g, palette[i].bgr);
// }
// }
// U0 SetTermDarkMode(Bool dark) {
// if (dark) {
// DocPrint(term.doc, "$$DM,1$$\n");
// }
// else {
// DocPrint(term.doc, "$$DM,0$$\n");
// }
// }
// U0 SetTermOriginalColors(Bool original) {
// if (original) {
// DocPrint(term.doc, "$$OC,1$$\n");
// }
// else {
// DocPrint(term.doc, "$$OC,0$$\n");
// }
// }
// function to clear screen and move cursor to 0,0
// U0 Reset() {
// DocPrint(term.doc, "$$CM+LX+PRY,LE=0,RE=0$$");
// DocClear(term.doc);
// }
// // function to move cursor to 0,0
// U0 Home() {
// DocPrint(term.doc, "$$CM+LX+PRY,LE=0,RE=0$$");
// }
// // function to move cursor to 0,0 and clear screen
// U0 ClearScreen() {
// DocPrint(term.doc, "$$CM+LX+PRY,LE=0,RE=0$$");
// DocClear(term.doc);
// }
// // function to move cursor to 0,0 and clear line
// U0 ClearLine() {
// DocPrint(term.doc, "$$CM+LX+PRY,LE=0,RE=1$$");
// }
// // function to move cursor to 0,0 and clear line
// U0 ClearLineRight() {
// DocPrint(term.doc, "$$CM+LX+PRY,LE=1,RE=0$$");
// }
// // function to move cursor to 0,0 and clear line
// U0 ClearLineLeft() {
// DocPrint(term.doc, "$$CM+LX+PRY,LE=0,RE=1$$");
// }
// // function to move cursor to 0,0 and clear line
// U0 ClearLineAll() {
// DocPrint(term.doc, "$$CM+LX+PRY,LE=1,RE=1$$");
// Placeholder for the full ANSI text styling
// if (ansi_code[m] <= 10) {