diff options
author | Jaroslav Hensl <jara@hensl.cz> | 2023-07-06 12:52:00 +0200 |
---|---|---|
committer | Jaroslav Hensl <jara@hensl.cz> | 2023-07-06 12:52:00 +0200 |
commit | d53f427dc984abe25616287fded56d7a02a85809 (patch) | |
tree | 497fb8d9c828a06ecc722113f93da8505c754710 | |
parent | 7f80983c1b9431380a9dce18586e0eea57be5707 (diff) | |
download | vmdisp9x-d53f427dc984abe25616287fded56d7a02a85809.tar.gz |
QEMU VMWARE adapter operational + better idle on 32bpp + HW cursor (bugged in VBox, disabled by default)
-rw-r--r-- | control.c | 21 | ||||
-rw-r--r-- | dbgprint.c | 4 | ||||
-rw-r--r-- | ddk/dibeng.h | 6 | ||||
-rw-r--r-- | dibcall.c | 176 | ||||
-rw-r--r-- | dibcall_svga.c | 2 | ||||
-rw-r--r-- | dibthunk.asm | 11 | ||||
-rw-r--r-- | enable.c | 38 | ||||
-rw-r--r-- | enable_svga.c | 2 | ||||
-rw-r--r-- | makefile | 13 | ||||
-rw-r--r-- | minidrv.h | 3 | ||||
-rw-r--r-- | modes.c | 30 | ||||
-rw-r--r-- | vmdisp9x.inf | 11 | ||||
-rw-r--r-- | vmware/svga.c | 18 | ||||
-rw-r--r-- | vmware/svga.h | 2 | ||||
-rw-r--r-- | vmwsvxd.c | 10 |
15 files changed, 331 insertions, 16 deletions
@@ -70,6 +70,12 @@ THE SOFTWARE. /* all frame buffer devices */
#define FBHDA_REQ 0x110A
+/* debug output from ring-3 application */
+#define SVGA_DBG 0x110B
+
+/* update buffer if 'need_call_update' is set */
+#define FBHDA_UPDATE 0x110C
+
/* check for drv <-> vxd <-> dll match */
#define SVGA_API 0x110F
@@ -85,6 +91,13 @@ THE SOFTWARE. #define SVGA_HWINFO_FIFO 0x1122
#define SVGA_HWINFO_CAPS 0x1123
+typedef struct _longRECT {
+ LONG left;
+ LONG top;
+ LONG right;
+ LONG bottom;
+} longRECT;
+
/**
* OpenGL ICD driver name (0x1101):
* -------------------------------------
@@ -391,6 +404,7 @@ LONG WINAPI __loadds Control(LPVOID lpDevice, UINT function, {
case OPENGL_GETINFO:
case FBHDA_REQ:
+ case FBHDA_UPDATE:
#ifdef SVGA
case SVGA_API:
/*
@@ -533,6 +547,13 @@ LONG WINAPI __loadds Control(LPVOID lpDevice, UINT function, rc = 1;
}
+ else if(function == FBHDA_UPDATE) /* input RECT, output: NULL */
+ {
+#ifdef SVGA
+ longRECT __far *lpRECT = lpInput;
+ SVGA_Update(lpRECT->left, lpRECT->top, lpRECT->right - lpRECT->left, lpRECT->bottom - lpRECT->top);
+#endif
+ }
#ifdef SVGA
else if(function == SVGA_READ_REG) /* input: uint32_t, output: uint32_t */
{
@@ -266,10 +266,14 @@ void dbg_printf( const char *s, ... ) prt_hex32( word, 4, hexa );
}
} else if( conv == 's' ) {
+#ifdef VXD32
+ prt_str((const char *)dword);
+#else
if( type_len == 'W' )
prt_str( (const char __far *)dword );
else
prt_str( (const char *)word );
+#endif
} else if( conv == 'x' || conv == 'X' ) {
hexa = conv - 'X' + 'A';
if( type_len == 'l' ) {
diff --git a/ddk/dibeng.h b/ddk/dibeng.h index 259a58c..14d73bb 100644 --- a/ddk/dibeng.h +++ b/ddk/dibeng.h @@ -129,9 +129,11 @@ extern VOID WINAPI DIB_SetPaletteTranslate( LPWORD lpIndexes ); extern VOID WINAPI DIB_SetPaletteTranslateExt( LPWORD lpIndexes, LPPDEVICE lpDIBEngine );
extern VOID WINAPI DIB_UpdateColorsExt( WORD wStartX, WORD wStart, WORD wExtX, WORD wExtY,
LPWORD lpTranslate, LPPDEVICE lpDIBEngine );
-extern VOID WINAPI DIB_SetCursorExt( LPPDEVICE lpDevice, LPVOID lpCursorShape );
+//extern VOID WINAPI DIB_SetCursorExt( LPPDEVICE lpDevice, LPVOID lpCursorShape );
+extern VOID WINAPI DIB_SetCursorExt( LPVOID lpCursor, LPPDEVICE lpDevice );
extern VOID WINAPI DIB_CheckCursorExt( LPPDEVICE lpDevice );
-extern VOID WINAPI DIB_MoveCursorExt( LPPDEVICE lpDevice, WORD absX, WORD absY );
+//extern VOID WINAPI DIB_MoveCursorExt( LPPDEVICE lpDevice, WORD absX, WORD absY );
+extern VOID WINAPI DIB_MoveCursorExt( WORD absX, WORD absY, LPPDEVICE lpDevice );
extern VOID WINAPI DIB_Inquire( LPVOID lpCursorInfo );
extern VOID WINAPI DIB_BeginAccess( LPPDEVICE lpDevice, WORD wLeft, WORD wTop, WORD wRight, WORD wBottom, WORD wFlags );
extern VOID WINAPI DIB_EndAccess( LPPDEVICE lpDevice, WORD wFlags );
@@ -22,7 +22,6 @@ THE SOFTWARE. *****************************************************************************/
-
#include "winhack.h"
#include <gdidefs.h>
#include <dibeng.h>
@@ -30,6 +29,11 @@ THE SOFTWARE. #include "minidrv.h"
+#ifdef SVGA
+# include "svga_all.h"
+# include <string.h>
+#endif
+
/*
* What's this all about? Most of the required exported driver functions can
* be passed straight to the DIB Engine. The DIB Engine in some cases requires
@@ -45,14 +49,178 @@ THE SOFTWARE. * are not hardware specific.
*/
+/* from DDK98 */
+typedef struct
+{
+ int xHotSpot, yHotSpot;
+ int cx, cy;
+ int cbWidth;
+ BYTE Planes, BitsPixel;
+} CURSORSHAPE;
+
+#ifdef SVGA
+BOOL cursorVisible = FALSE;
+#endif
+
#pragma code_seg( _TEXT )
+#ifdef SVGA
+# ifndef HWCURSOR
+static LONG cursorX = 0;
+static LONG cursorY = 0;
+static LONG cursorW = 0;
+static LONG cursorH = 0;
+static LONG cursorHX = 0;
+static LONG cursorHY = 0;
+
+void update_cursor()
+{
+ if(wBpp == 32)
+ {
+ LONG x = cursorX - cursorHX;
+ LONG y = cursorY - cursorHY;
+ LONG w = cursorW;
+ LONG h = cursorH;
+
+ if(x < 0) x = 0;
+ if(y < 0) y = 0;
+ if(x+w > wScreenX) w = wScreenX - x;
+ if(y+h > wScreenY) y = wScreenY - h;
+
+ if(w > 0 && h > 0)
+ {
+ SVGA_Update(x, y, w, h);
+ }
+ }
+}
+# endif
+#endif
+
+void WINAPI __loadds MoveCursor(WORD absX, WORD absY)
+{
+ if(wEnabled)
+ {
+#ifdef SVGA
+ if(wBpp == 32)
+ {
+# ifdef HWCURSOR
+ SVGA_MoveCursor(cursorVisible, absX, absY, 0);
+# else
+ DIB_MoveCursorExt(absX, absY, lpDriverPDevice);
+ update_cursor();
+ cursorX = absX;
+ cursorY = absY;
+ update_cursor();
+# endif
+ return;
+ }
+#endif
+ DIB_MoveCursorExt(absX, absY, lpDriverPDevice);
+ }
+}
+
+WORD WINAPI __loadds SetCursor_driver(CURSORSHAPE __far *lpCursor)
+{
+ if(wEnabled)
+ {
+#ifdef SVGA
+ if(wBpp == 32)
+ {
+# ifdef HWCURSOR
+ void __far* ANDMask = NULL;
+ void __far* XORMask = NULL;
+ SVGAFifoCmdDefineCursor cur;
+
+ if(lpCursor != NULL)
+ {
+ cur.id = 0;
+ cur.hotspotX = lpCursor->xHotSpot;
+ cur.hotspotY = lpCursor->yHotSpot;
+ cur.width = lpCursor->cx;
+ cur.height = lpCursor->cy;
+ cur.andMaskDepth = 1;
+ cur.xorMaskDepth = 1;
+
+ dbg_printf("cx: %d, cy: %d, cbWidth: %d, Planes: %d\n", lpCursor->cx, lpCursor->cy, lpCursor->cbWidth, lpCursor->Planes);
+
+ SVGA_BeginDefineCursor(&cur, &ANDMask, &XORMask);
+
+ if(ANDMask)
+ {
+ _fmemcpy(ANDMask, lpCursor+1, lpCursor->cbWidth*lpCursor->cy);
+ }
+
+ if(XORMask)
+ {
+ BYTE __far *ptr = (BYTE __far *)(lpCursor+1);
+ ptr += lpCursor->cbWidth*lpCursor->cy;
+
+ _fmemcpy(XORMask, ptr, lpCursor->cbWidth*lpCursor->cy);
+ }
+
+ SVGA_FIFOCommitAll();
+ cursorVisible = TRUE;
+ return 1;
+ }
+ else
+ {
+ /* virtual bug on SVGA_MoveCursor(FALSE, ...)
+ * so if is cursor NULL, create empty
+ */
+ cur.id = 0;
+ cur.hotspotX = 0;
+ cur.hotspotY = 0;
+ cur.width = 32;
+ cur.height = 32;
+ cur.andMaskDepth = 1;
+ cur.xorMaskDepth = 1;
+
+ SVGA_BeginDefineCursor(&cur, &ANDMask, &XORMask);
+
+ if(ANDMask) _fmemset(ANDMask, 0xFF, 4*32);
+ if(XORMask) _fmemset(XORMask, 0, 4*32);
+
+ SVGA_FIFOCommitAll();
+
+ SVGA_MoveCursor(FALSE, 0, 0, 0);
+ cursorVisible = FALSE;
+ return 1;
+ }
+# else
+ if(lpCursor != NULL)
+ {
+ cursorW = lpCursor->cx;
+ cursorH = lpCursor->cy;
+ cursorHX = lpCursor->xHotSpot;
+ cursorHY = lpCursor->yHotSpot;
+ }
+# endif
+ } // 32bpp
+#endif
+ DIB_SetCursorExt(lpCursor, lpDriverPDevice);
+ return 1;
+ }
+ return 0;
+}
+
/* Exported as DISPLAY.104 */
void WINAPI __loadds CheckCursor( void )
{
- if( wEnabled ) {
- DIB_CheckCursorExt( lpDriverPDevice );
- }
+ if( wEnabled ) {
+#ifdef SVGA
+# ifndef HWCURSOR
+ DIB_CheckCursorExt( lpDriverPDevice );
+ if(wBpp == 32)
+ {
+ update_cursor();
+ }
+# else
+ if(wBpp != 32) DIB_CheckCursorExt( lpDriverPDevice );
+# endif
+#else
+ DIB_CheckCursorExt( lpDriverPDevice );
+#endif
+ }
}
/* If there is no hardware screen-to-screen BitBlt, there's no point in
diff --git a/dibcall_svga.c b/dibcall_svga.c new file mode 100644 index 0000000..3089eb8 --- /dev/null +++ b/dibcall_svga.c @@ -0,0 +1,2 @@ +#define SVGA
+#include "dibcall.c"
diff --git a/dibthunk.asm b/dibthunk.asm index 3bcdde7..07e3d21 100644 --- a/dibthunk.asm +++ b/dibthunk.asm @@ -77,8 +77,15 @@ DIBTHK GetPalette, _lpDriverPDevice DIBTHK SetPaletteTranslate, _lpDriverPDevice
DIBTHK GetPaletteTranslate, _lpDriverPDevice
DIBTHK UpdateColors, _lpDriverPDevice
-DIBTHK SetCursor, _lpDriverPDevice
-DIBTHK MoveCursor, _lpDriverPDevice
+;DIBTHK SetCursor, _lpDriverPDevice
+;DIBTHK MoveCursor, _lpDriverPDevice
+
+;; There is collision with driver's SetCursor ans WINAPI function of same name
+;; and this is hack to resolve it without modify of headers
+extrn SetCursor_driver : far
+public SetCursor
+SetCursor:
+ jmp SetCursor_driver
;; Forwarders that simply jump to the DIB Engine.
;; Sorted by ordinal number.
@@ -32,6 +32,10 @@ THE SOFTWARE. #include <string.h>
+#ifdef SVGA
+# include "svga_all.h"
+#endif
+
/* Pretend we have a 208 by 156 mm screen. */
#define DISPLAY_HORZ_MM 208
#define DISPLAY_VERT_MM 156
@@ -139,8 +143,37 @@ DWORD PASCAL CreateDIBPDeviceX( LPBITMAPINFO lpInfo, LPPDEVICE lpDevice, LPVOID "shr eax, 16" \
"xchg ax, dx"
+#ifdef SVGA
+static uint32 updateX = 0;
+static uint32 updateY = 0;
+static uint32 updateW = 0;
+static uint32 updateH = 0;
+#endif
+
#pragma code_seg( _INIT )
+#ifdef SVGA
+VOID WINAPI __loadds SVGA_DIB_BeginAccess( LPPDEVICE lpDevice, WORD wLeft, WORD wTop, WORD wRight, WORD wBottom, WORD wFlags )
+{
+ updateX = wLeft;
+ updateY = wTop;
+ updateW = wRight - wLeft;
+ updateH = wBottom - wTop;
+
+ DIB_BeginAccess(lpDevice, wLeft, wTop, wRight, wBottom, wFlags);
+}
+
+VOID WINAPI __loadds SVGA_DIB_EndAccess( LPPDEVICE lpDevice, WORD wFlags )
+{
+ DIB_EndAccess(lpDevice, wFlags);
+ if(wBpp == 32)
+ {
+ SVGA_Update(updateX, updateY, updateW, updateH);
+ }
+}
+#endif
+
+
/* GDI calls Enable twice at startup, first to query the GDIINFO structure
* and then to initialize the video hardware.
*/
@@ -237,8 +270,13 @@ UINT WINAPI __loadds Enable( LPVOID lpDevice, UINT style, LPSTR lpDeviceType, dbg_printf( "Enable: CreateDIBPDevice returned %lX\n", dwRet );
/* Now fill out the begin/end access callbacks. */
+#ifdef SVGA
+ lpEng->deBeginAccess = SVGA_DIB_BeginAccess;
+ lpEng->deEndAccess = SVGA_DIB_EndAccess;
+#else
lpEng->deBeginAccess = DIB_BeginAccess;
lpEng->deEndAccess = DIB_EndAccess;
+#endif
/* Program the DAC in non-direct color modes. */
if( wBpp <= 8 ) {
diff --git a/enable_svga.c b/enable_svga.c new file mode 100644 index 0000000..845c3fc --- /dev/null +++ b/enable_svga.c @@ -0,0 +1,2 @@ +#define SVGA
+#include "enable.c"
@@ -3,6 +3,7 @@ OBJS = dibthunk.obj dibcall.obj enable.obj init.obj palette.obj & drvlib.obj control_vxd.obj minivdd_svga.obj vmwsvxd.obj &
scrsw_svga.obj control_svga.obj modes_svga.obj palette_svga.obj &
pci.obj svga.obj svga3d.obj svga32.obj pci32.obj dddrv.obj &
+ enable_svga.obj dibcall_svga.obj
INCS = -I$(%WATCOM)\h\win -Iddk -Ivmware
@@ -12,6 +13,8 @@ FLAGS = -DDRV_VER_BUILD=$(VER_BUILD) -DCAP_R5G6B5_ALWAYS_WRONG # Define HWBLT if BitBlt can be accelerated.
#FLAGS += -DHWBLT
+# Define HWCURSOR if you want accelerate cursor (SVGA only)
+#FLAGS += -DHWCURSOR
# Set DBGPRINT to add debug printf logging.
#DBGPRINT = 1
@@ -68,6 +71,9 @@ dbgprint32.obj : dbgprint32.c .autodepend dibcall.obj : dibcall.c .autodepend
$(CC) $(CFLAGS) -zW $(INCS) $(FLAGS) $<
+
+dibcall_svga.obj : dibcall_svga.c .autodepend
+ $(CC) $(CFLAGS) -zW $(INCS) $(FLAGS) $<
dibthunk.obj : dibthunk.asm
wasm -q $(FLAGS) $<
@@ -75,6 +81,9 @@ dibthunk.obj : dibthunk.asm enable.obj : enable.c .autodepend
$(CC) $(CFLAGS) -zW $(INCS) $(FLAGS) $<
+enable_svga.obj : enable_svga.c .autodepend
+ $(CC) $(CFLAGS) -zW $(INCS) $(FLAGS) $<
+
init.obj : init.c .autodepend
$(CC) $(CFLAGS) -zW $(INCS) $(FLAGS) $<
@@ -218,9 +227,9 @@ vmwsmini.drv : $(OBJS) vmwsmini.res dibeng.lib wlink op quiet, start=DriverInit_ disable 2055 $(DBGFILE) @<<vmwsmini.lnk
system windows dll initglobal
file dibthunk.obj
-file dibcall.obj
+file dibcall_svga.obj
file drvlib.obj
-file enable.obj
+file enable_svga.obj
file init.obj
file palette_svga.obj
file scrsw_svga.obj
@@ -103,9 +103,12 @@ typedef struct _FBHDA DWORD pitch;
DWORD fb_pm32; /* eq. linear address, mapped to shared or kernel space*/
void __far * fb_pm16; /* usable in this driver */
+ DWORD flags;
} FBHDA;
#pragma pack(pop)
+#define FBHDA_NEED_UPDATE 1
+
extern FBHDA __far * FBHDA_ptr;
extern DWORD FBHDA_linear;
@@ -186,11 +186,16 @@ static int IsModeOK( WORD wXRes, WORD wYRes, WORD wBpp ) return( 0 );
#ifdef SVGA
- /* not working in vmware, in vbox working without acceleration, so only confusing users */
+ /* not working in vmware, in vbox is working without acceleration, so only confusing users */
if(wBpp == 24)
{
return 0;
}
+
+ if(gSVGA.only32bit && wBpp != 32)
+ {
+ return 0;
+ }
#endif
/* Make sure there's enough VRAM for it. */
@@ -363,8 +368,25 @@ static int SetDisplayMode( WORD wXRes, WORD wYRes, int bFullSet ) {
SVGA_defineScreen(wXRes, wYRes, wBpp);
}
-
- SVGA_WriteReg(SVGA_REG_TRACES, TRUE);
+
+ /*
+ * JH: this is a bit stupid = all SVGA command cannot work with non 32 bpp.
+ * SVGA_CMD_UPDATE included. So if we're working in 32 bpp, we'll disable
+ * traces and updating framebuffer changes with SVGA_CMD_UPDATE.
+ * On non 32 bpp we just enable SVGA_REG_TRACES.
+ *
+ * QEMU hasn't SVGA_REG_TRACES register and framebuffer cannot be se to
+ * 16 or 8 bpp = we supporting only 32 bpp moders if we're running under it.
+ */
+ if(wBpp == 32)
+ {
+ SVGA_WriteReg(SVGA_REG_TRACES, FALSE);
+ }
+ else
+ {
+ SVGA_WriteReg(SVGA_REG_TRACES, TRUE);
+ }
+
SVGA_WriteReg(SVGA_REG_ENABLE, TRUE);
SVGA_Flush();
@@ -383,8 +405,10 @@ static int SetDisplayMode( WORD wXRes, WORD wYRes, int bFullSet ) FBHDA_ptr->bpp = wBpp;
#ifdef SVGA
FBHDA_ptr->pitch = SVGA_ReadReg(SVGA_REG_BYTES_PER_LINE);
+ FBHDA_ptr->flags = FBHDA_NEED_UPDATE;
#else
FBHDA_ptr->pitch = CalcPitch( wScrX, wBpp );
+ FBHDA_ptr->flags = 0;
#endif
}
diff --git a/vmdisp9x.inf b/vmdisp9x.inf index 6ea79ef..967a3d1 100644 --- a/vmdisp9x.inf +++ b/vmdisp9x.inf @@ -50,12 +50,19 @@ vmwsmini.vxd=1 %VBoxVideoVGA.DeviceDesc%=VBox, PCI\VEN_80EE&DEV_BEEF&SUBSYS_00000000
%VBoxVideoSVGA.DeviceDesc%=VBoxSvga, PCI\VEN_80EE&DEV_BEEF&SUBSYS_040515AD
%VBoxVideoVM.DeviceDesc%=VMSvga, PCI\VEN_15AD&DEV_0405&SUBSYS_040515AD
+;Line for QEMU STD, but driver not working now
+;%QemuStd.DeviceDesc%=QemuSTD, PCI\VEN_1234&DEV_1111
[VBox]
CopyFiles=VBox.Copy,Dx.Copy,DX.CopyBackup,Voodoo.Copy
DelReg=VM.DelReg
AddReg=VBox.AddReg,VM.AddReg,DX.addReg
+[QemuStd]
+CopyFiles=VBox.Copy,Dx.Copy,DX.CopyBackup,Voodoo.Copy
+DelReg=VM.DelReg
+AddReg=VBox.AddReg,VM.AddReg,DX.addReg
+
[VBoxSvga]
CopyFiles=VMSvga.Copy,Dx.Copy,DX.CopyBackup,Voodoo.Copy
DelReg=VM.DelReg
@@ -102,10 +109,12 @@ vmwsmini.vxd,,,0x00000004 [VBox.AddReg]
HKR,DEFAULT,drv,,boxvmini.drv
;HKR,DEFAULT,minivdd,,boxvmini.vxd
+HKR,DEFAULT,Mode,,"8,640,480"
[VMSvga.AddReg]
HKR,DEFAULT,drv,,vmwsmini.drv
HKR,DEFAULT,minivdd,,vmwsmini.vxd
+HKR,DEFAULT,Mode,,"32,640,480"
[VM.DelReg]
HKR,,Ver
@@ -119,7 +128,6 @@ HKLM,Software\Microsoft\Windows\CurrentVersion\OpenGLdrivers,VMWSVGA [VM.AddReg]
HKR,,Ver,,4.0
HKR,,DevLoader,,*vdd
-HKR,DEFAULT,Mode,,"8,640,480"
HKR,DEFAULT,vdd,,"*vdd,*vflatd"
;HKR,DEFAULT,carddvdd,,cardsamp.vxd
HKR,DEFAULT,RefreshRate,,-1
@@ -197,3 +205,4 @@ Mfg="VirtualBox" VBoxVideoVGA.DeviceDesc="VBox VGA PCI Adapter"
VBoxVideoSVGA.DeviceDesc="VBox SVGA PCI Adapter"
VBoxVideoVM.DeviceDesc="VMWare SVGA-II PCI Adapter"
+QemuStd.DeviceDesc="QEMU STD VGA PCI Adapter"
diff --git a/vmware/svga.c b/vmware/svga.c index 76d69fb..0091a19 100644 --- a/vmware/svga.c +++ b/vmware/svga.c @@ -259,6 +259,22 @@ SVGA_Init(Bool enableFIFO) gSVGA.fifoSel = 0; gSVGA.fifoAct = 0; + /* set if SVGA supporting different BPP then 32 */ + SVGA_WriteReg(SVGA_REG_ENABLE, TRUE); + SVGA_WriteReg(SVGA_REG_CONFIG_DONE, TRUE); + + SVGA_WriteReg(SVGA_REG_BITS_PER_PIXEL, 8); + if(SVGA_ReadReg(SVGA_REG_CONFIG_DONE) == 0) + { + gSVGA.only32bit = 1; + } + else + { + gSVGA.only32bit = 0; + } + SVGA_WriteReg(SVGA_REG_ENABLE, FALSE); + SVGA_WriteReg(SVGA_REG_CONFIG_DONE, FALSE); + if(enableFIFO) { SVGA_Enable(); @@ -320,7 +336,7 @@ SVGA_Enable(void) SVGA_WriteReg(SVGA_REG_ENABLE, TRUE); SVGA_WriteReg(SVGA_REG_CONFIG_DONE, TRUE); - + /* * Now that the FIFO is initialized, we can do an IRQ sanity check. * This makes sure that the VM's chipset and our own IRQ code diff --git a/vmware/svga.h b/vmware/svga.h index 6095045..1800982 100644 --- a/vmware/svga.h +++ b/vmware/svga.h @@ -85,6 +85,8 @@ typedef struct SVGADevice { /* VMWare SVGAII and VBox SVGA is same device with different PCI ID */ uint16 vendorId; uint16 deviceId; + /* adaper in QEMU works only on 32bit */ + uint32 only32bit; #ifndef REALLY_TINY volatile struct { @@ -97,6 +97,9 @@ char dbg_dic_unknown[] = "DeviceIOControl: Unknown: %d\n"; char dbg_dic_system[] = "DeviceIOControl: System code: %d\n";
char dbg_get_ppa[] = "%lx -> %lx\n";
char dbg_get_ppa_beg[] = "Virtual: %lx\n";
+
+char dbg_str[] = "%s\n";
+
#endif
DWORD *DispatchTable = 0;
@@ -169,7 +172,7 @@ void Sys_Critical_Init_proc() * 32-bit DeviceIoControl ends here
*
*/
-
+#define SVGA_DBG 0x110B
#define SVGA_SYNC 0x1116
#define SVGA_RING 0x1117
@@ -189,6 +192,11 @@ DWORD __stdcall Device_IO_Control_entry(struct DIOCParams *params) //dbg_printf(dbg_dic_ring);
SVGA_WriteReg(SVGA_REG_SYNC, 1);
return 0;
+ case SVGA_DBG:
+#ifdef DBGPRINT
+ dbg_printf(dbg_str, params->lpInBuffer);
+#endif
+ return 0;
}
dbg_printf(dbg_dic_unknown, params->dwIoControlCode);
|