cursor movement

This commit is contained in:
y4my4my4m 2023-05-02 12:58:00 +09:00
parent f212ff574a
commit c8279797c3

View file

@ -122,15 +122,14 @@ U0 HandleControlCodes(U8 ch) {
} }
U0 HandleMCICode(U8 *ptr, I64 *index) { U0 HandleMCICode(U8 *ptr, I64 *index) {
// U8 code[4]; U8 code[4];
// MemCopy(code, ptr + *index, 3); MemCopy(code, ptr + *index, 3);
// *index += 3; *index += 3;
// if (StrCompare(code, "ET1") == 0) { if (StrCompare(code, "ET1") == 0) {
// // Handle ET1 MCI code here // Handle ET1 MCI code here
// } }
// SysLog("MCI code: %s\n", code); SysLog("MCI code: %s\n", code);
SysLog("MCI Code not implemented\n");
// Add support for other MCI codes if needed // Add support for other MCI codes if needed
} }
@ -266,8 +265,10 @@ U0 Telnet(U8 *host, U16 port=TELNET_PORT) {
ptr++; ptr++;
break; break;
} else if (*ptr == 'C') { } else if (*ptr == 'C') {
// Custom 'C' escape code for centering text I64 i;
// TODO: Handle the centering here for (i = 0; i < ansi_code; i++) {
Print(" ");
}
ptr++; ptr++;
break; break;
} else if (*ptr == '?') { } else if (*ptr == '?') {
@ -279,19 +280,17 @@ U0 Telnet(U8 *host, U16 port=TELNET_PORT) {
} else { } else {
ptr++; ptr++;
break; // Invalid character, exit loop break; // Invalid character, exit loop
} }
} }
} }
else if (*ptr == ';') { }
SysLog("; event\n"); else if (*ptr == '%' || *ptr == '|') {
ptr++;
}
} else if (*ptr == '%' || *ptr == '|') {
// MCI code detected // MCI code detected
ptr++;
HandleMCICode(ptr, &ptr); HandleMCICode(ptr, &ptr);
ptr++; ptr++;
} else { break;
}
else {
// Print the received character // Print the received character
HandleControlCodes(*ptr); HandleControlCodes(*ptr);
ptr++; ptr++;
@ -400,7 +399,7 @@ U0 TelnetPrompt() {
} }
// Dev auto-connect to test server // Dev auto-connect to test server
Telnet("mbrserver.com"); // Telnet("mbrserver.com");
// Telnet("freechess.org"); // Telnet("freechess.org");
// Telnet("dura-bbs.net", 6359); // Telnet("dura-bbs.net", 6359);
// Telnet("darkrealms.ca"); // Telnet("darkrealms.ca");
@ -409,4 +408,4 @@ Telnet("mbrserver.com");
// Telnet("20forbeers.com", 1337); // Telnet("20forbeers.com", 1337);
// ZealBBS dev server // ZealBBS dev server
// Telnet("localhost", 8888); Telnet("localhost", 8888);