Modules/BochsGA - Added DrvUtil cursor support
authorJohn Hodge <[email protected]>
Sat, 22 Oct 2011 07:20:29 +0000 (15:20 +0800)
committerJohn Hodge <[email protected]>
Sat, 22 Oct 2011 07:20:29 +0000 (15:20 +0800)
Modules/Display/BochsGA/bochsvbe.c

index d9aada9..86ba2a2 100644 (file)
@@ -193,14 +193,29 @@ int BGA_IOCtl(tVFS_Node *Node, int ID, void *Data)
                break;\r
        \r
        case VIDEO_IOCTL_SETBUFFORMAT:\r
+               DrvUtil_Video_RemoveCursor( &gBGA_DrvUtil_BufInfo );\r
                ret = gBGA_DrvUtil_BufInfo.BufferFormat;\r
                if(Data)\r
                        gBGA_DrvUtil_BufInfo.BufferFormat = *(int*)Data;\r
+               if(gBGA_DrvUtil_BufInfo.BufferFormat == VIDEO_BUFFMT_TEXT)\r
+                       DrvUtil_Video_SetCursor( &gBGA_DrvUtil_BufInfo, &gDrvUtil_TextModeCursor );\r
                break;\r
        \r
        case VIDEO_IOCTL_SETCURSOR:\r
+               DrvUtil_Video_RemoveCursor( &gBGA_DrvUtil_BufInfo );\r
                gBGA_CursorPos.x = ((tVideo_IOCtl_Pos*)Data)->x;\r
                gBGA_CursorPos.y = ((tVideo_IOCtl_Pos*)Data)->y;\r
+               if(gBGA_DrvUtil_BufInfo.BufferFormat == VIDEO_BUFFMT_TEXT)\r
+                       DrvUtil_Video_DrawCursor(\r
+                               &gBGA_DrvUtil_BufInfo,\r
+                               gBGA_CursorPos.x*giVT_CharWidth,\r
+                               gBGA_CursorPos.y*giVT_CharHeight\r
+                               );\r
+               else\r
+                       DrvUtil_Video_DrawCursor(\r
+                               &gBGA_DrvUtil_BufInfo,\r
+                               gBGA_CursorPos.x, gBGA_CursorPos.y\r
+                               );\r
                break;\r
        \r
        default:\r

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