int Vesa_Int_SetMode(int Mode);\r
int Vesa_Int_FindMode(tVideo_IOCtl_Mode *data);\r
int Vesa_Int_ModeInfo(tVideo_IOCtl_Mode *data);\r
+void Vesa_int_HideCursor(void);\r
+void Vesa_int_ShowCursor(void);\r
void Vesa_FlipCursor(void *Arg);\r
\r
// === GLOBALS ===\r
return Vesa_Int_ModeInfo((tVideo_IOCtl_Mode*)Data);\r
\r
case VIDEO_IOCTL_SETBUFFORMAT:\r
- DrvUtil_Video_DrawCursor( &gVesa_BufInfo, -1, -1 );\r
- giVesaCursorX = -1;\r
- #if BLINKING_CURSOR\r
- if(giVesaCursorTimer != -1) {\r
- Time_RemoveTimer(giVesaCursorTimer);\r
- giVesaCursorTimer = -1;\r
- }\r
- #endif\r
+ Vesa_int_HideCursor();\r
ret = gVesa_BufInfo.BufferFormat;\r
if(Data) gVesa_BufInfo.BufferFormat = *(int*)Data;\r
if(gVesa_BufInfo.BufferFormat == VIDEO_BUFFMT_TEXT)\r
DrvUtil_Video_SetCursor( &gVesa_BufInfo, &gDrvUtil_TextModeCursor );\r
+ Vesa_int_ShowCursor();\r
return ret;\r
\r
case VIDEO_IOCTL_SETCURSOR: // Set cursor position\r
- DrvUtil_Video_RemoveCursor( &gVesa_BufInfo );\r
- #if BLINKING_CURSOR\r
- if(giVesaCursorTimer != -1) {\r
- Time_RemoveTimer(giVesaCursorTimer);\r
- giVesaCursorTimer = -1;\r
- }\r
- #endif\r
+ Vesa_int_HideCursor();\r
giVesaCursorX = ((tVideo_IOCtl_Pos*)Data)->x;\r
giVesaCursorY = ((tVideo_IOCtl_Pos*)Data)->y;\r
- gbVesa_CursorVisible = (giVesaCursorX >= 0);\r
- if(gVesa_BufInfo.BufferFormat == VIDEO_BUFFMT_TEXT)\r
- {\r
- DrvUtil_Video_DrawCursor(\r
- &gVesa_BufInfo,\r
- giVesaCursorX*giVT_CharWidth,\r
- giVesaCursorY*giVT_CharHeight\r
- );\r
- #if BLINKING_CURSOR\r
- giVesaCursorTimer = Time_CreateTimer(VESA_CURSOR_PERIOD, Vesa_FlipCursor, NULL);\r
- #endif\r
- }\r
- else\r
- DrvUtil_Video_DrawCursor(\r
- &gVesa_BufInfo,\r
- giVesaCursorX,\r
- giVesaCursorY\r
- );\r
+ Vesa_int_ShowCursor();\r
return 0;\r
}\r
return 0;\r
return 1;\r
}\r
\r
+void Vesa_int_HideCursor(void)\r
+{\r
+ DrvUtil_Video_RemoveCursor( &gVesa_BufInfo );\r
+ #if BLINKING_CURSOR\r
+ if(giVesaCursorTimer != -1) {\r
+ Time_RemoveTimer(giVesaCursorTimer);\r
+ giVesaCursorTimer = -1;\r
+ }\r
+ #endif\r
+}\r
+\r
+void Vesa_int_ShowCursor(void)\r
+{\r
+ gbVesa_CursorVisible = (giVesaCursorX >= 0);\r
+ if(gVesa_BufInfo.BufferFormat == VIDEO_BUFFMT_TEXT)\r
+ {\r
+ DrvUtil_Video_DrawCursor(\r
+ &gVesa_BufInfo,\r
+ giVesaCursorX*giVT_CharWidth,\r
+ giVesaCursorY*giVT_CharHeight\r
+ );\r
+ #if BLINKING_CURSOR\r
+ giVesaCursorTimer = Time_CreateTimer(VESA_CURSOR_PERIOD, Vesa_FlipCursor, NULL);\r
+ #endif\r
+ }\r
+ else\r
+ DrvUtil_Video_DrawCursor(\r
+ &gVesa_BufInfo,\r
+ giVesaCursorX,\r
+ giVesaCursorY\r
+ );\r
+}\r
+\r
/**\r
- * \brief Updates the state of the text cursor\r
- * \note Just does a bitwise not on the cursor region\r
+ * \brief Swaps the text cursor on/off\r
*/\r
void Vesa_FlipCursor(void *Arg)\r
{\r