From b44662231cdcb24776bf6795502718531ebc48bc Mon Sep 17 00:00:00 2001 From: y4my4my4m <8145020+y4my4my4m@users.noreply.github.com> Date: Mon, 15 May 2023 01:26:22 +0900 Subject: [PATCH] SetPos (incomplete) --- src/Home/Telnet/Art/goo-kazuki_fuse.ans | Bin 0 -> 4075 bytes src/Home/Telnet/Telnet.ZC | 20 +++++++ src/Home/Telnet/TelnetHelpers.ZC | 67 ++++++++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 src/Home/Telnet/Art/goo-kazuki_fuse.ans diff --git a/src/Home/Telnet/Art/goo-kazuki_fuse.ans b/src/Home/Telnet/Art/goo-kazuki_fuse.ans new file mode 100644 index 0000000000000000000000000000000000000000..d9113d869261638c4ac2b35c34f72df7d146c69d GIT binary patch literal 4075 zcmbVPO-~d-5M8b$#Dh2Y(m!Elb^!^A32c-Q#5JOZWD^rZJRpuFA{YPae#~F7K3-Mz z%q+4p#@+4i>Q}E`RaXzgS#dZn4oCa-&h~IN-kl6*<>6>lFX)-u!vkI}>fvm3U?wTE zFiZW;toO|NL1WvRZ5r986dcTK-FJ{H|8pm!#qPp)uk+HHTV*4YrV44Y)%8D@t!YPi zxjBP*8)DwaXt~G-4Lv%}!{8YQ**79x3&UAzIe31>u4@dVYBRJ%)m7H~xnHN&07bc( z4`bN+;j_|`AAl|er0PKil>vwf zDiOc-zUFw9TWfcS96-G{QR z)Yf3gjX(x-c$F)T#*Ido5>e@5?E}y>! zUDPMj>6hcT)5+P#57T$2lM8)+*<}D(Pv_^Cmpj`pE{;A;UKhpL*FX0+*Xhmu-8a@| z-9w1I>Ej=_S2w?Z-Tu73y0gWqsEXpCs=hxP47Rr34_*!Ad476)o<5%(>Bv9-0!y)* AW&i*H literal 0 HcmV?d00001 diff --git a/src/Home/Telnet/Telnet.ZC b/src/Home/Telnet/Telnet.ZC index 65995528..447fa0d8 100644 --- a/src/Home/Telnet/Telnet.ZC +++ b/src/Home/Telnet/Telnet.ZC @@ -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) { diff --git a/src/Home/Telnet/TelnetHelpers.ZC b/src/Home/Telnet/TelnetHelpers.ZC index d54e999e..b4e2e26b 100644 --- a/src/Home/Telnet/TelnetHelpers.ZC +++ b/src/Home/Telnet/TelnetHelpers.ZC @@ -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) {