Fixed compile errors, added Semaphore code
[tpg/acess2.git] / Modules / Display / VESA / main.c
index 506a8b5..479be30 100644 (file)
@@ -2,7 +2,7 @@
  * AcessOS 1\r
  * Video BIOS Extensions (Vesa) Driver\r
  */\r
-#define DEBUG  0\r
+#define DEBUG  1\r
 #define VERSION        0x100\r
 \r
 #include <acess.h>\r
@@ -93,13 +93,15 @@ int Vesa_Install(char **Arguments)
                return MODULE_ERR_NOTNEEDED;\r
        }\r
        \r
-       Log_Debug("VESA", "info->VideoModes = %04x:%04x", info->VideoModes.seg, info->VideoModes.ofs);\r
+       //Log_Debug("VESA", "info->VideoModes = %04x:%04x", info->VideoModes.seg, info->VideoModes.ofs);\r
        modes = (Uint16 *) VM8086_GetPointer(gpVesa_BiosState, info->VideoModes.seg, info->VideoModes.ofs);\r
        \r
        // Read Modes\r
        for( giVesaModeCount = 0; modes[giVesaModeCount] != 0xFFFF; giVesaModeCount++ );\r
        gVesa_Modes = (tVesa_Mode *)malloc( giVesaModeCount * sizeof(tVesa_Mode) );\r
        \r
+       Log_Debug("VESA", "%i Modes", giVesaModeCount);\r
+       \r
        // Insert Text Mode\r
        gVesa_Modes[0].width = 80;\r
        gVesa_Modes[0].height = 25;\r
@@ -516,10 +518,10 @@ void Vesa_FlipCursor(void *Arg)
        \r
        //Debug("Cursor flip");\r
        \r
-       // Sanity 1\r
+       // Sanity check\r
        if(giVesaCursorX < 0 || giVesaCursorY < 0\r
-       || y*pitch + x + giVT_CharHeight*pitch > (int)gpVesaCurMode->fbSize/4) {\r
-               Debug("Cursor OOB (%i,%i)", x, y);\r
+       || y*pitch + x + (giVT_CharHeight-1)*pitch > (int)gpVesaCurMode->fbSize/4) {\r
+               Log_Notice("VESA", "Cursor OOB (%i,%i)", x, y);\r
                giVesaCursorTimer = -1;\r
                return;\r
        }\r

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