this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

more debug

alice 775d8b2d e28bd1aa

+69 -7
+69 -7
src/studio/screens/console.c
··· 459 459 static void consolePrintOffset(Console* console, const char* text, u8 color, s32 wrapLineOffset) 460 460 { 461 461 #ifndef BAREMETALPI 462 - printf("%s", text); 462 + printf("Debug: Entering consolePrintOffset\n"); 463 + printf("Initial text: %s\n", text); 463 464 #endif 464 465 465 466 console->cursor.pos = cursorPos(console); 467 + printf("Cursor position: x=%d, y=%d\n", console->cursor.pos.x, console->cursor.pos.y); 466 468 467 469 for(const char* ptr = text, *next = ptr; *ptr; ptr++) 468 470 { 469 471 char symbol = *ptr; 470 472 471 - printf("calling scrollConsole from consolePrintOffset\n"); 473 + printf("Processing symbol: %c\n", symbol); 474 + printf("calling scrollConsole from consolePrintOffset... SOMETHING MAY BE HERE\n"); 472 475 scrollConsole(console); 476 + printf("Scrolled console from consolePrintOffset!\n"); 473 477 474 478 if (symbol == '\n') 479 + { 480 + printf("calling nextLine(console) where symbol is BACKSLASH N\n"); 475 481 nextLine(console); 482 + printf("Moved to next line from consolePrintOffset!\n"); 483 + } 476 484 else 477 485 { 478 486 if(!iswrap(symbol)) 479 487 { 480 488 const char* cur = ptr; 481 489 s32 len = CONSOLE_BUFFER_WIDTH; 482 - 490 + printf("sus while loop in consoleprintoffset\n"); 483 491 while(*cur && !iswrap(*cur++)) len--; 484 - 492 + 493 + printf("if loop in consoleprintoffset that\'s also sus\n"); 485 494 if(len > 0 && len <= console->cursor.pos.x) 486 495 { 496 + printf("calling nextLine(console) where symbol is not backslash n\n"); 487 497 nextLine(console); 488 498 console->cursor.pos.x = wrapLineOffset; 499 + printf("Wrapped line, new cursor x=%d\n", console->cursor.pos.x); 489 500 } 490 501 } 491 - 502 + printf("calling setSymbol in that else branch\n"); 492 503 setSymbol(console, symbol, iswrap(symbol) ? tic_color_dark_grey : color, cursorOffset(console)); 504 + printf("Set symbol at position: %d\n", cursorOffset(console)); 493 505 494 506 console->cursor.pos.x++; 495 507 496 508 if (console->cursor.pos.x >= CONSOLE_BUFFER_WIDTH) 497 509 { 510 + printf("calling nextLine from that last if loop\n"); 498 511 nextLine(console); 512 + printf("Cursor wrapped to next line, new x=%d\n", console->cursor.pos.x); 499 513 console->cursor.pos.x = wrapLineOffset; 514 + printf("Cursor wrapped to next line, new x=%d\n", console->cursor.pos.x); 500 515 } 501 516 } 502 517 } 503 518 504 519 console->input.text = console->text + cursorOffset(console); 520 + printf("console->input.text is now: %p\n", console->input.text); 505 521 console->input.pos = 0; 522 + printf("Updated input text position\n"); 523 + 524 + #ifndef BAREMETALPI 525 + printf("Debug: Exiting consolePrintOffset\n"); 526 + #endif 506 527 } 507 528 508 529 static void consolePrint(Console* console, const char* text, u8 color) ··· 1410 1431 } 1411 1432 1412 1433 static void finishTabCompleteAndFreeData(void* data) { 1413 - finishTabComplete((const TabCompleteData *) data); 1414 - free(data); 1434 + if (data != NULL) { 1435 + printf("finishTabCompleteAndFreeData starting\n"); 1436 + finishTabComplete((const TabCompleteData *) data); 1437 + printf("freeing data in finishTabCompleteAndFreeData!!!!\n"); 1438 + free(data); 1439 + } else { 1440 + printf("Error: NULL data pointer provided to finishTabCompleteAndFreeData\n"); 1441 + } 1415 1442 } 1416 1443 1417 1444 static void tabCompleteFiles(TabCompleteData* data) 1418 1445 { 1446 + if (!data || !data->console || !data->console->fs) { 1447 + printf("Error: Invalid data in tabCompleteFiles\n"); 1448 + return; 1449 + } 1450 + 1451 + printf("Entering tabCompleteFiles\n"); 1419 1452 tic_fs_enum(data->console->fs, addFilenameToTabComplete, finishTabCompleteAndFreeData, MOVE(*data)); 1453 + printf("Exiting tabCompleteFiles\n"); 1420 1454 } 1421 1455 1422 1456 static void tabCompleteDirs(TabCompleteData* data) 1423 1457 { 1458 + if (!data || !data->console || !data->console->fs) { 1459 + printf("Error: Invalid data in tabCompleteDirs\n"); 1460 + return; 1461 + } 1462 + 1463 + printf("Entering tabCompleteDirs\n"); 1424 1464 tic_fs_enum(data->console->fs, addDirToTabComplete, finishTabCompleteAndFreeData, MOVE(*data)); 1465 + printf("Exiting tabCompleteDirs\n"); 1425 1466 } 1426 1467 1427 1468 static void tabCompleteFilesAndDirs(TabCompleteData* data) 1428 1469 { 1470 + if (!data || !data->console || !data->console->fs) { 1471 + printf("Error: Invalid data in tabCompleteFilesAndDirs\n"); 1472 + return; 1473 + } 1474 + 1475 + printf("Entering tabCompleteFilesAndDirs\n"); 1429 1476 tic_fs_enum(data->console->fs, addFileAndDirToTabComplete, finishTabCompleteAndFreeData, MOVE(*data)); 1477 + printf("Exiting tabCompleteFilesAndDirs\n"); 1430 1478 } 1431 1479 1432 1480 static void tabCompleteConfig(TabCompleteData* data) 1433 1481 { 1482 + if (data == NULL) { 1483 + printf("Error: tabCompleteConfig received a NULL data pointer\n"); 1484 + return; 1485 + } 1486 + 1487 + printf("Starting tab completion configuration...\n"); 1488 + 1434 1489 addTabCompleteOption(data, "reset"); 1490 + printf("Added 'reset' to tab completion options.\n"); 1491 + 1435 1492 addTabCompleteOption(data, "default"); 1493 + printf("Added 'default' to tab completion options.\n"); 1494 + 1495 + printf("calling finishTabComplete from tabCompleteConfig!!!!!\n"); 1436 1496 finishTabComplete(data); 1497 + printf("Finished configuring tab completion.\n"); 1437 1498 } 1438 1499 1439 1500 typedef struct ··· 3474 3535 char* param = strchr(input, ' '); 3475 3536 if (param == NULL) 3476 3537 { 3538 + // THIS GOT TRIGGERED AT LEAST ONCE!! 3477 3539 printf("FUCKSIE WUCKSIE POTENTIALLY!!\n"); 3478 3540 printf("Error: param is NULL in processConsoleTab\n"); 3479 3541 return;