This commit is contained in:
y4my4my4m 2023-05-14 01:14:57 +09:00
parent a65fd10267
commit 1286fe322d
2 changed files with 6 additions and 7 deletions

View file

@ -116,7 +116,7 @@ U0 HandleControlCodes(U8 ch) {
SysLog("case 127"); SysLog("case 127");
} }
if (ch == 0x24) { if (ch == 0x24) {
DocPrint(term.doc, "$$"); DocPrint(term.doc, "$$$$");
} }
if (ch >= 32 && ch < 256) // ZealOS's ASCII is up to 255 if (ch >= 32 && ch < 256) // ZealOS's ASCII is up to 255
{ {
@ -670,18 +670,16 @@ U0 Telnet(U8 *host=NULL, U16 port=TELNET_PORT) {
show_splash: show_splash:
// SplashScreen // SplashScreen
DocClear; DocClear;
MemSet(term.buffer, 0, sizeof(term.buffer)); // Load the file into the buffer and get its size
term.buffer_len = ANSIArtLoad(art_path, term.buffer); term.buffer_len = ANSIArtLoad(art_path, term.buffer);
if (term.buffer_len > 0) { if (term.buffer_len > 0) {
term.buffer[term.buffer_len] = '\0'; term.buffer[term.buffer_len] = '\0';
// parse the buffer // parse the buffer
ANSIParse; ANSIParse;
} }
else { else {
"Error: Could not load splash screen.\n"; Print("Error: Could not load splash screen.\n");
} }
init_connection: init_connection:
while (!term.waiting_for_input || host != NULL) while (!term.waiting_for_input || host != NULL)

View file

@ -36,7 +36,7 @@ I64 ANSIArtLoad(U8 *filename, U8 *buffer) {
I64 full_blocks = file->de.size / BLK_SIZE; I64 full_blocks = file->de.size / BLK_SIZE;
I64 remaining_bytes = file->de.size % BLK_SIZE; I64 remaining_bytes = file->de.size % BLK_SIZE;
SysLog("File size: %d, Number of full blocks: %d, Remaining bytes: %d\n", file->de.size, full_blocks, remaining_bytes); // SysLog("File size: %d, Number of full blocks: %d, Remaining bytes: %d\n", file->de.size, full_blocks, remaining_bytes);
// Read the full blocks into the buffer // Read the full blocks into the buffer
I64 i, blocks_read = 0; I64 i, blocks_read = 0;
@ -54,6 +54,7 @@ I64 ANSIArtLoad(U8 *filename, U8 *buffer) {
} }
} }
I64 file_size = file->de.size;
FClose(file); FClose(file);
if (blocks_read != (full_blocks + (remaining_bytes != 0))) { if (blocks_read != (full_blocks + (remaining_bytes != 0))) {
@ -61,7 +62,7 @@ I64 ANSIArtLoad(U8 *filename, U8 *buffer) {
return -1; return -1;
} }
return file->de.size; // Return the number of bytes read return file_size; // Return the number of bytes read
} }
public I64 ANSIArtBrowser() public I64 ANSIArtBrowser()