Fixed VESA scrolling bug
authorJohn Hodge <[email protected]>
Thu, 22 Apr 2010 00:18:25 +0000 (08:18 +0800)
committerJohn Hodge <[email protected]>
Thu, 22 Apr 2010 00:18:25 +0000 (08:18 +0800)
Kernel/Makefile.BuildNum
Kernel/drv/vterm.c
Modules/Display/VESA/main.c

index 4674272..620c1bb 100644 (file)
@@ -1 +1 @@
-BUILD_NUM = 1975
+BUILD_NUM = 1982
index 1433964..aa2b8f3 100644 (file)
@@ -211,9 +211,10 @@ void VT_InitOutput()
        giVT_OutputDevHandle = VFS_Open(gsVT_OutputDevice, VFS_OPENFLAG_WRITE);
        if(giVT_InputDevHandle == -1) {
                Log_Warning("VTerm", "Oh F**k, I can't open the video device '%s'", gsVT_OutputDevice);
+               return ;
        }
        VT_SetTerminal( 0 );
-       VT_SetResolution(1, 640, 480);
+       VT_SetResolution(1, 640, 400);
 }
 
 /**
index f24b405..e625c57 100644 (file)
@@ -224,6 +224,12 @@ Uint64 Vesa_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer)
                x = Offset % widthInChars;\r
                y = Offset / widthInChars;\r
                LOG("(x,y) = (%i,%i) = [%i,%i]", x, y, x * giVT_CharWidth, y * giVT_CharHeight * pitch);\r
+               LOG("(w,h) = (%i,%i) = [%i,%i]",\r
+                       (int)(Length % widthInChars),\r
+                       (int)(Length / widthInChars),\r
+                       (int)((Length % widthInChars) * giVT_CharWidth),\r
+                       (int)((Length / widthInChars) * giVT_CharHeight * pitch)\r
+                       );\r
                \r
                // Sanity Check\r
                if(y > gVesa_Modes[giVesaCurrentMode].height/giVT_CharHeight) {\r
@@ -240,19 +246,18 @@ Uint64 Vesa_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer)
                {\r
                        VT_Font_Render(\r
                                chars->Ch,\r
-                               dest, pitch,\r
+                               dest + x*giVT_CharWidth, pitch,\r
                                VT_Colour12to24(chars->BGCol),\r
                                VT_Colour12to24(chars->FGCol)\r
                                );\r
                        \r
-                       dest += giVT_CharWidth;\r
                        \r
                        chars ++;\r
                        x ++;\r
-                       if( x >= pitch ) {\r
+                       if( x >= widthInChars ) {\r
                                x = 0;\r
-                               y ++ ;\r
-                               dest += pitch*(giVT_CharHeight-1);\r
+                               y ++;\r
+                               dest += pitch*giVT_CharHeight;\r
                        }\r
                }\r
                Length *= sizeof(tVT_Char);\r

UCC git Repository :: git.ucc.asn.au