Skip to content

Commit 36fe1ad

Browse files
Fix console scrolling with sticky first row (#596)
First row in console was sticky due to a bug reported in issue #590
1 parent 0076007 commit 36fe1ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libctru/source/console.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,15 +752,15 @@ static void newRow() {
752752

753753
if(currentConsole->cursorY > currentConsole->windowHeight) {
754754
currentConsole->cursorY = currentConsole->windowHeight;
755-
u16 *dst = &currentConsole->frameBuffer[((currentConsole->windowX - 1 ) * 8 * 240) + (239 - ((currentConsole->windowY) * 8))];
755+
u16 *dst = &currentConsole->frameBuffer[((currentConsole->windowX - 1 ) * 8 * 240) + (239 - ((currentConsole->windowY-1) * 8))];
756756
u16 *src = dst - 8;
757757

758758
int i,j;
759759

760760
for (i=0; i<(currentConsole->windowWidth)*8; i++) {
761761
u32 *from = (u32*)((int)src & ~3);
762762
u32 *to = (u32*)((int)dst & ~3);
763-
for (j=0;j<(((currentConsole->windowHeight-2)*8)/2);j++) *(to--) = *(from--);
763+
for (j=0;j<(((currentConsole->windowHeight-1)*8)/2);j++) *(to--) = *(from--);
764764
dst += 240;
765765
src += 240;
766766
}

0 commit comments

Comments
 (0)