Fix word wrap bug on HW5

This commit is contained in:
sanni 2022-08-03 21:59:11 +02:00
parent 0a2e1ab36d
commit 92f76b324c
3 changed files with 10 additions and 2 deletions

View File

@ -386,7 +386,11 @@ void setCart_COL() {
display_Clear();
// Read game name
#if defined(enable_OLED)
get_line(gamename, &myFile, 42);
#else
get_line(gamename, &myFile, 96);
#endif
// Read CRC32 checksum
sprintf(checksumStr, "%c", myFile.read());

View File

@ -1966,14 +1966,14 @@ void println_Msg(const char myString[]) {
if ((display.tx + strlen(myString) * 6) > 128) {
int strPos = 0;
// Print until end of display
while (display.tx < 122) {
while ((display.tx < 122) && (myString[strPos] != '\0')) {
display.print(myString[strPos]);
strPos++;
}
// Newline
display.setCursor(0, display.ty + 8);
// Print until end of display and ignore remaining characters
while ((strPos < strlen(myString)) && (display.tx < 122)) {
while ((strPos < strlen(myString)) && (display.tx < 122) && (myString[strPos] != '\0')) {
display.print(myString[strPos]);
strPos++;
}

View File

@ -772,7 +772,11 @@ void setCart_INTV() {
display_Clear();
// Read game name
#if defined(enable_OLED)
get_line(gamename, &myFile, 42);
#else
get_line(gamename, &myFile, 96);
#endif
// Read CRC32 checksum
sprintf(checksumStr, "%c", myFile.read());