Merge branch 'master' of git://localhost/acess2
[tpg/acess2.git] / KernelLand / Modules / Display / BochsGA / bochsvbe.c
index 806c1c1..50e76d3 100644 (file)
@@ -47,8 +47,6 @@ enum {
        VBE_DISPI_INDEX_Y_OFFSET\r
 };\r
 \r
-extern void MM_DumpTables(tVAddr Start, tVAddr End);\r
-\r
 // === PROTOTYPES ===\r
 // Driver\r
  int   BGA_Install(char **Arguments);\r
@@ -63,8 +61,8 @@ void  BGA_int_SetMode(Uint16 width, Uint16 height);
  int   BGA_int_ModeInfo(tVideo_IOCtl_Mode *info);\r
  int   BGA_int_MapFB(void *Dest);\r
 // Filesystem\r
-Uint64 BGA_Read(tVFS_Node *Node, Uint64 off, Uint64 len, void *buffer);\r
-Uint64 BGA_Write(tVFS_Node *Node, Uint64 off, Uint64 len, const void *buffer);\r
+size_t BGA_Read(tVFS_Node *Node, off_t off, size_t len, void *buffer);\r
+size_t BGA_Write(tVFS_Node *Node, off_t off, size_t len, const void *buffer);\r
  int   BGA_IOCtl(tVFS_Node *Node, int ID, void *Data);\r
 \r
 // === GLOBALS ===\r
@@ -84,6 +82,7 @@ Uint  *gBGA_Framebuffer;
 const tBGA_Mode        *gpBGA_CurrentMode;\r
 const tBGA_Mode        gBGA_Modes[] = {\r
        {640,480,32, 640*480*4},\r
+       {800,480,32, 800*480*4},        // Nice mode for VM testing\r
        {800,600,32, 800*600*4},\r
        {1024,768,32, 1024*768*4}\r
 };\r
@@ -103,6 +102,10 @@ int BGA_Install(char **Arguments)
        // Check BGA Version\r
        version = BGA_int_ReadRegister(VBE_DISPI_INDEX_ID);\r
        LOG("version = 0x%x", version);\r
+       if( version == 0xFFFF ) {\r
+               // Floating bus, nothing there\r
+               return MODULE_ERR_NOTNEEDED;\r
+       }\r
        \r
        // NOTE: This driver was written for BGA versions >= 0xBOC2\r
        // NOTE: However, Qemu is braindead and doesn't return the actual version\r
@@ -141,10 +144,9 @@ void BGA_Uninstall(void)
 }\r
 \r
 /**\r
- * \fn Uint64 BGA_Read(tVFS_Node *node, Uint64 off, Uint64 len, void *buffer)\r
  * \brief Read from the framebuffer\r
  */\r
-Uint64 BGA_Read(tVFS_Node *node, Uint64 off, Uint64 len, void *buffer)\r
+size_t BGA_Read(tVFS_Node *node, off_t off, size_t len, void *buffer)\r
 {\r
        // Check Mode\r
        if(giBGA_CurrentMode == -1)     return -1;\r
@@ -161,7 +163,7 @@ Uint64 BGA_Read(tVFS_Node *node, Uint64 off, Uint64 len, void *buffer)
 /**\r
  * \brief Write to the framebuffer\r
  */\r
-Uint64 BGA_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, const void *Buffer)\r
+size_t BGA_Write(tVFS_Node *Node, off_t Offset, size_t Length, const void *Buffer)\r
 {\r
        if( giBGA_CurrentMode == -1 )   BGA_int_UpdateMode(0);\r
        return DrvUtil_Video_WriteLFB(&gBGA_DrvUtil_BufInfo, Offset, Length, Buffer);\r
@@ -218,6 +220,10 @@ int BGA_IOCtl(tVFS_Node *Node, int ID, void *Data)
                                gBGA_CursorPos.x, gBGA_CursorPos.y\r
                                );\r
                break;\r
+\r
+       case VIDEO_IOCTL_SETCURSORBITMAP:\r
+               DrvUtil_Video_SetCursor( &gBGA_DrvUtil_BufInfo, Data );\r
+               return 0;\r
        \r
        default:\r
                LEAVE('i', -2);\r

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