mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +02:00
Workaround for burn in issue
This commit is contained in:
parent
842ce50c2f
commit
e25aae5a97
@ -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)
|
||||||
|
@ -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 = ¤tConsole->frameBuffer[gfxGetFramebufferDisplayOffset(x + i, y + j)];
|
to = ¤tConsole->frameBuffer[gfxGetFramebufferDisplayOffset(x + i, y + j)];
|
||||||
from = ¤tConsole->frameBuffer[gfxGetFramebufferDisplayOffset(x + i, y + 8 + j)];
|
from = ¤tConsole->frameBuffer[gfxGetFramebufferDisplayOffset(x + i, y + 8 + j)];
|
||||||
*to = *from;
|
*to = *from;
|
||||||
|
to = ¤tConsole->frameBuffer2[gfxGetFramebufferDisplayOffset(x + i, y + j)];
|
||||||
|
from = ¤tConsole->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 = ¤tConsole->frameBuffer[gfxGetFramebufferDisplayOffset(x + i, y + j)];
|
screen = ¤tConsole->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 = ¤tConsole->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);
|
||||||
|
Loading…
Reference in New Issue
Block a user