X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=3sys;a=blobdiff_plain;f=sys1%2Fkern%2Fsrc%2Fvga.c;fp=sys1%2Fkern%2Fsrc%2Fvga.c;h=c1edd9a7d92969399d8357be0fab6030f2865b3d;hp=ae7c04991981d0d8040d1a71e9c1145b15785739;hb=6ccd3a47d05be145256a79a1de100f01ebd16a79;hpb=ebc5d64326bba69c74ae103fad61b04a542f9eb2 diff --git a/sys1/kern/src/vga.c b/sys1/kern/src/vga.c index ae7c049..c1edd9a 100644 --- a/sys1/kern/src/vga.c +++ b/sys1/kern/src/vga.c @@ -30,7 +30,7 @@ void vga_setcursor(int x, int y) void vga_scroll(int s) { - yoffs = s % 25; + yoffs = s & 0x1f; s = yoffs * 80; crtc_write(CRTC_START_H, s >> 8); crtc_write(CRTC_START_L, s); @@ -53,9 +53,9 @@ void vga_clearline(int row) ptr = (uint16_t*)0xb8000 + row * 80; memset16(ptr, attr, 80); - if(row - 25 >= 0) { + if(row - 32 >= 0) { /* write a copy to wrap-around future scrolling */ - ptr -= 80 * 25; + ptr -= 80 * 32; memset16(ptr, attr, 80); } } @@ -69,9 +69,9 @@ void vga_drawchar(int x, int y, int c) ptr = (uint16_t*)0xb8000 + y * 80 + x; *ptr = val; - if(y - 25 >= 0) { + if(y - 32 >= 0) { /* write a copy to wrap-around future scrolling */ - ptr -= 80 * 25; + ptr -= 80 * 32; *ptr = val; } }