Fixing bugs and removing debug statements
[tpg/acess2.git] / Modules / Display / VESA / main.c
index e30d640..9b3de8d 100644 (file)
 // === CONSTANTS ===\r
 #define        FLAG_LFB        0x1\r
 #define VESA_DEFAULT_FRAMEBUFFER       (KERNEL_BASE|0xA0000)\r
-#define VESA_CURSOR_PERIOD     1000\r
+#define BLINKING_CURSOR        0\r
+#if BLINKING_CURSOR\r
+# define VESA_CURSOR_PERIOD    1000\r
+#endif\r
 \r
 // === PROTOTYPES ===\r
  int   Vesa_Install(char **Arguments);\r
@@ -358,6 +361,10 @@ int Vesa_Ioctl(tVFS_Node *Node, int ID, void *Data)
                return ret;\r
        \r
        case VIDEO_IOCTL_SETCURSOR:     // Set cursor position\r
+               #if !BLINKING_CURSOR\r
+               if(giVesaCursorX > 0 && giVesaCursorY)\r
+                       Vesa_FlipCursor(Node);\r
+               #endif\r
                giVesaCursorX = ((tVideo_IOCtl_Pos*)Data)->x;\r
                giVesaCursorY = ((tVideo_IOCtl_Pos*)Data)->y;\r
                //Log_Debug("VESA", "Cursor position (%i,%i)", giVesaCursorX, giVesaCursorY);\r
@@ -366,17 +373,23 @@ int Vesa_Ioctl(tVFS_Node *Node, int ID, void *Data)
                ||      giVesaCursorX >= gpVesaCurMode->width/giVT_CharWidth\r
                ||      giVesaCursorY >= gpVesaCurMode->height/giVT_CharHeight)\r
                {\r
+                       #if BLINKING_CURSOR\r
                        if(giVesaCursorTimer != -1) {\r
                                Time_RemoveTimer(giVesaCursorTimer);\r
                                giVesaCursorTimer = -1;\r
                        }\r
+                       #endif\r
                        giVesaCursorX = -1;\r
                        giVesaCursorY = -1;\r
                }\r
                else {\r
+                       #if BLINKING_CURSOR\r
                //      Log_Debug("VESA", "Updating timer %i?", giVesaCursorTimer);\r
                        if(giVesaCursorTimer == -1)\r
                                giVesaCursorTimer = Time_CreateTimer(VESA_CURSOR_PERIOD, Vesa_FlipCursor, Node);\r
+                       #else\r
+                       Vesa_FlipCursor(Node);\r
+                       #endif\r
                }\r
                //Log_Debug("VESA", "Cursor position (%i,%i) Timer %i", giVesaCursorX, giVesaCursorY, giVesaCursorTimer);\r
                return 0;\r
@@ -511,7 +524,9 @@ void Vesa_FlipCursor(void *Arg)
        for( i = 1; i < giVT_CharHeight-1; i++, fb += pitch )\r
                *fb = ~*fb;\r
        \r
+       #if BLINKING_CURSOR\r
        giVesaCursorTimer = Time_CreateTimer(VESA_CURSOR_PERIOD, Vesa_FlipCursor, Arg);\r
+       #endif\r
 }\r
 \r
 // ------------------------\r

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