Workaround for burn in issue

This commit is contained in:
plutoo 2018-02-21 08:38:22 +01:00
parent 842ce50c2f
commit e25aae5a97
2 changed files with 20 additions and 4 deletions

View File

@ -75,6 +75,7 @@ typedef struct PrintConsole
ConsoleFont font; ///< Font of the console ConsoleFont font; ///< Font of the console
u32 *frameBuffer; ///< Framebuffer address u32 *frameBuffer; ///< Framebuffer address
u32 *frameBuffer2; ///< Framebuffer address
int cursorX; ///< Current X location of the cursor (as a tile offset by default) int cursorX; ///< Current X location of the cursor (as a tile offset by default)
int cursorY; ///< Current Y location of the cursor (as a tile offset by default) int cursorY; ///< Current Y location of the cursor (as a tile offset by default)

View File

@ -47,6 +47,7 @@ PrintConsole defaultConsole =
256 //number of characters in the font set 256 //number of characters in the font set
}, },
(u32*)NULL, (u32*)NULL,
(u32*)NULL,
0,0, //cursorX cursorY 0,0, //cursorX cursorY
0,0, //prevcursorX prevcursorY 0,0, //prevcursorX prevcursorY
160, //console width 160, //console width
@ -123,6 +124,8 @@ static void consoleCls(char mode) {
} }
} }
gfxFlushBuffers(); gfxFlushBuffers();
gfxSwapBuffers();
gfxWaitForVsync();
} }
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------
static void consoleClearLine(char mode) { static void consoleClearLine(char mode) {
@ -176,6 +179,8 @@ static void consoleClearLine(char mode) {
} }
} }
gfxFlushBuffers(); gfxFlushBuffers();
gfxSwapBuffers();
gfxWaitForVsync();
} }
@ -547,13 +552,16 @@ PrintConsole* consoleInit(PrintConsole* console) {
console->consoleInitialised = 1; console->consoleInitialised = 1;
gfxSetMode(GfxMode_TiledSingle); gfxSetMode(GfxMode_TiledDouble);
console->frameBuffer = (u32*)gfxGetFramebuffer(NULL, NULL);
gfxSwapBuffers();
console->frameBuffer2 = (u32*)gfxGetFramebuffer(NULL, NULL);
gfxFlushBuffers(); gfxFlushBuffers();
gfxSwapBuffers();
gfxWaitForVsync(); gfxWaitForVsync();
console->frameBuffer = (u32*)gfxGetFramebuffer(NULL, NULL);
consoleCls('2'); consoleCls('2');
return currentConsole; return currentConsole;
@ -625,6 +633,9 @@ static void newRow(void) {
to = &currentConsole->frameBuffer[gfxGetFramebufferDisplayOffset(x + i, y + j)]; to = &currentConsole->frameBuffer[gfxGetFramebufferDisplayOffset(x + i, y + j)];
from = &currentConsole->frameBuffer[gfxGetFramebufferDisplayOffset(x + i, y + 8 + j)]; from = &currentConsole->frameBuffer[gfxGetFramebufferDisplayOffset(x + i, y + 8 + j)];
*to = *from; *to = *from;
to = &currentConsole->frameBuffer2[gfxGetFramebufferDisplayOffset(x + i, y + j)];
from = &currentConsole->frameBuffer2[gfxGetFramebufferDisplayOffset(x + i, y + 8 + j)];
*to = *from;
} }
} }
@ -676,6 +687,8 @@ void consoleDrawChar(int c) {
for (j=0;j<8;j++) { for (j=0;j<8;j++) {
screen = &currentConsole->frameBuffer[gfxGetFramebufferDisplayOffset(x + i, y + j)]; screen = &currentConsole->frameBuffer[gfxGetFramebufferDisplayOffset(x + i, y + j)];
if (bval >> (8*j) & mask) { *screen = fg; }else{ *screen = bg; } if (bval >> (8*j) & mask) { *screen = fg; }else{ *screen = bg; }
screen = &currentConsole->frameBuffer2[gfxGetFramebufferDisplayOffset(x + i, y + j)];
if (bval >> (8*j) & mask) { *screen = fg; }else{ *screen = bg; }
} }
mask >>= 1; mask >>= 1;
} }
@ -730,6 +743,8 @@ void consolePrintChar(int c) {
case 13: case 13:
currentConsole->cursorX = 0; currentConsole->cursorX = 0;
gfxFlushBuffers(); gfxFlushBuffers();
gfxSwapBuffers();
gfxWaitForVsync();
break; break;
default: default:
consoleDrawChar(c); consoleDrawChar(c);