aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaroslav Hensl <emulator@emulace.cz>2024-02-08 01:46:50 +0100
committerJaroslav Hensl <emulator@emulace.cz>2024-02-08 01:46:50 +0100
commitb384a5210524618b17768def33b312f271360e19 (patch)
treeff6c39faaf3eab8b46fe803fe15be1446c9eeb28
parent8c0387f54d4e04fe5af4fc8a62861b942ed2ee7c (diff)
downloadvmdisp9x-b384a5210524618b17768def33b312f271360e19.tar.gz
driver code refactoring / PART4: DirectDraw + little cleanup
-rw-r--r--README.md11
-rw-r--r--boxv.c204
-rw-r--r--boxv_qemu.c2
-rw-r--r--control.c1
-rw-r--r--dddrv.c50
-rw-r--r--makefile12
-rw-r--r--minidrv.h4
-rw-r--r--modes.c1
-rw-r--r--vmdahal.h10
-rw-r--r--vmdisp9x.inf23
-rw-r--r--vxd_main.c2
-rw-r--r--vxd_mouse.c4
-rw-r--r--vxd_mouse_conv.h18
-rw-r--r--vxd_vbe.c14
14 files changed, 86 insertions, 270 deletions
diff --git a/README.md b/README.md
index b63a606..ad79cd1 100644
--- a/README.md
+++ b/README.md
@@ -21,8 +21,10 @@ This repository contains only basic 2D driver, for 3D (hardware or software) acc
Driver is based on [Michal Necasek's VirtualBox driver](http://www.os2museum.com/wp/windows-9x-video-minidriver-hd/). With my modifications:
- added VMWare SVGA and VirtualBox SVGA support
- added OpenGL ICD support (simple command that only returns the name of OpenGL implementation library)
-- added 32bit mini-VDD driver stub (required for future development to better support for 16-bit applications)
-- added access to VMWare/VBox SVGA registers and FIFO to support real 3D acceleration from user space driver
+- most calls converted to 32bit mini-VDD driver (faster and not limited by 64k segmentation)
+- added access VMWare/VBox SVGA API to support real 3D acceleration from user space driver
+- added API to access VRAM/FB directly
+- added DirectDraw support
QEMU support (`-vga std`) is from [Philip Kelley driver modification](https://github.com/phkelley/boxv9x)
@@ -30,8 +32,11 @@ QEMU support (`-vga std`) is from [Philip Kelley driver modification](https://gi
## OpenGL ICD support
OpenGL is much more driver independent than DirectX, if fact, there is only 1 (ONE by words) function that needs to be served by driver, 0x1101. More on https://github.com/JHRobotics/mesa9x
+## DirectDraw support
+2D only accelerated drawing is available. User DLL (RING-3) code is in separated project: https://github.com/JHRobotics/vmhal9x
+
## Glide support
-3dfx proprietary API (later open sourced) for their Voodoo Graphics 3D accelerator cards. This has nothing to do with the display driver - keep in mind, that original Voodoo and Voodoo 2 cards were only 3D accretors and you still need some other video card to draw 2D part (= all system things). Calling from user space was through DLL (Glide2x.dll, Glide3x.dll) in Windows or driver (Glide.vxd) in DOS and they made the rest.
+3dfx proprietary API (later open sourced) for their Voodoo Graphics 3D accelerator cards. This has nothing to do with the display driver - keep in mind, that original Voodoo and Voodoo 2 cards were only 3D accelerators and you still need some other video card to draw 2D part (= all system things). Calling from user space was through DLL (Glide2x.dll, Glide3x.dll) in Windows or driver (Glide.vxd) in DOS and they made the rest.
If you have some OpenGL driver, you can use OpenGlide to translate Glide call to OpenGL. My port of Open Glide for Windows 9x is here: https://github.com/JHRobotics/openglide9x
diff --git a/boxv.c b/boxv.c
deleted file mode 100644
index 2d81e42..0000000
--- a/boxv.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/*****************************************************************************
-
-Copyright (c) 2012-2022 Michal Necasek
- 2023 Philip Kelley
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-*****************************************************************************/
-
-/* Core boxv implementation. */
-
-#include "boxv.h" /* Public interface. */
-#include "boxvint.h" /* Implementation internals. */
-#define NEEDVIDEO
-#include "io.h" /* I/O access layer, host specific. */
-
-#pragma code_seg( _INIT )
-
-/* Write a single value to an indexed register at a specified
- * index. Suitable for the CRTC or graphics controller.
- */
-inline void vid_wridx( void *cx, int idx_reg, int idx, v_byte data )
-{
- vid_outw( cx, idx_reg, idx | (data << 8) );
-}
-
-/* Set an extended non-VGA mode with given parameters. 8bpp and higher only.
- * Returns non-zero value on failure.
- */
-int BOXV_ext_mode_set( void *cx, int xres, int yres, int bpp, int v_xres, int v_yres )
-{
- /* Do basic parameter validation. */
- if( v_xres < xres || v_yres < yres )
- return( -1 );
-
- /* Put the hardware into a state where the mode can be safely set. */
- vid_inb( cx, VGA_STAT_ADDR ); /* Reset flip-flop. */
- vid_outb( cx, VGA_ATTR_W, 0 ); /* Disable palette. */
- vid_wridx( cx, VGA_SEQUENCER, VGA_SR_RESET, VGA_SR_RESET );
-
- /* Disable the extended display registers. */
- vid_outw( cx, VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_ENABLE );
- vid_outw( cx, VBE_DISPI_IOPORT_DATA, VBE_DISPI_DISABLED );
-
- /* Program the extended non-VGA registers. */
-
- /* Set X resoultion. */
- vid_outw( cx, VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_XRES );
- vid_outw( cx, VBE_DISPI_IOPORT_DATA, xres );
- /* Set Y resoultion. */
- vid_outw( cx, VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_YRES );
- vid_outw( cx, VBE_DISPI_IOPORT_DATA, yres );
- /* Set bits per pixel. */
- vid_outw( cx, VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_BPP );
- vid_outw( cx, VBE_DISPI_IOPORT_DATA, bpp );
- /* Set the virtual resolution. */
- vid_outw( cx, VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_VIRT_WIDTH );
- vid_outw( cx, VBE_DISPI_IOPORT_DATA, v_xres );
- vid_outw( cx, VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_VIRT_HEIGHT );
- vid_outw( cx, VBE_DISPI_IOPORT_DATA, v_yres );
- /* Reset the current bank. */
- vid_outw( cx, VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_BANK );
- vid_outw( cx, VBE_DISPI_IOPORT_DATA, 0 );
- /* Set the X and Y display offset to 0. */
- vid_outw( cx, VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_X_OFFSET );
- vid_outw( cx, VBE_DISPI_IOPORT_DATA, 0 );
- vid_outw( cx, VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_Y_OFFSET );
- vid_outw( cx, VBE_DISPI_IOPORT_DATA, 0 );
- /* Enable the extended display registers. */
- vid_outw( cx, VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_ENABLE );
-#ifdef QEMU
- vid_outw( cx, VBE_DISPI_IOPORT_DATA, VBE_DISPI_ENABLED | VBE_DISPI_8BIT_DAC | VBE_DISPI_LFB_ENABLED | VBE_DISPI_NOCLEARMEM );
-#else
- vid_outw( cx, VBE_DISPI_IOPORT_DATA, VBE_DISPI_ENABLED | VBE_DISPI_8BIT_DAC );
-#endif
-
- /* Re-enable the sequencer. */
- vid_wridx( cx, VGA_SEQUENCER, VGA_SR_RESET, VGA_SR0_NORESET );
-
- /* Reset flip-flop again and re-enable palette. */
- vid_inb( cx, VGA_STAT_ADDR );
- vid_outb( cx, VGA_ATTR_W, 0x20 );
-
- return( 0 );
-}
-
-/* Program the DAC. Each of the 'count' entries is 4 bytes in size,
- * red/green/blue/unused.
- * Returns non-zero on failure.
- */
-int BOXV_dac_set( void *cx, unsigned start, unsigned count, void *pal )
-{
- v_byte *prgbu = pal;
-
- /* Basic argument validation. */
- if( start + count > 256 )
- return( -1 );
-
- /* Write the starting index. */
- vid_outb( cx, VGA_DAC_W_INDEX, start );
- /* Load the RGB data. */
- while( count-- ) {
- vid_outb( cx, VGA_DAC_DATA, *prgbu++ );
- vid_outb( cx, VGA_DAC_DATA, *prgbu++ );
- vid_outb( cx, VGA_DAC_DATA, *prgbu++ );
- ++prgbu;
- }
- return( 0 );
-}
-
-/* Detect the presence of a supported adapter and amount of installed
- * video memory. Returns zero if not found.
- */
-int BOXV_detect( void *cx, unsigned long *vram_size )
-{
- v_word boxv_id;
-
- vid_outw( cx, VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_ID );
-
- boxv_id = vid_inw( cx, VBE_DISPI_IOPORT_DATA );
-#ifdef QEMU
- if( boxv_id < VBE_DISPI_ID0 || boxv_id > VBE_DISPI_ID6 )
- return( 0 );
-
- if( vram_size ) {
- vid_outw( cx, VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_VIDEO_MEMORY_64K );
- *vram_size = (unsigned long)vid_inw( cx, VBE_DISPI_IOPORT_DATA ) << 16;
- }
-
- return( boxv_id );
-#else
- if( vram_size ) {
- *vram_size = vid_ind( cx, VBE_DISPI_IOPORT_DATA );
- }
-
- if( boxv_id >= VBE_DISPI_ID0 && boxv_id <= VBE_DISPI_ID4 )
- return( boxv_id );
- else
- return( 0 );
-#endif
-}
-
-/* Disable extended mode and place the hardware into a VGA compatible state.
- * Returns non-zero on failure.
- */
-int BOXV_ext_disable( void *cx )
-{
- /* Disable the extended display registers. */
- vid_outw( cx, VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_ENABLE );
- vid_outw( cx, VBE_DISPI_IOPORT_DATA, VBE_DISPI_DISABLED );
- return( 0 );
-}
-
-/* Return the physical base address of the framebuffer. Needed in environments
- * that do not query the base through PCI.
- */
-unsigned long BOXV_get_lfb_base( void *cx )
-{
- unsigned long fb_base;
-
- /* Ask the virtual hardware for the high 16 bits. */
- vid_outw( cx, VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_FB_BASE_HI );
- fb_base = vid_inw( cx, VBE_DISPI_IOPORT_DATA );
-
- /* Old versions didn't support that, so use the default
- * if the value looks like garbage.
- */
- if( fb_base != 0 && fb_base != 0xffff )
- fb_base = fb_base << 16;
- else
- fb_base = VBE_DISPI_LFB_PHYSICAL_ADDRESS;
-
- return( fb_base );
-}
-
-unsigned long BOXV_set_offset(void *cx, unsigned long bytes, unsigned int bpp, unsigned int pitch)
-{
- unsigned int ps = ((bpp+7)/8);
- unsigned int offset_y = bytes/pitch;
- unsigned int offset_x = (bytes % pitch)/ps;
-
- vid_outw( cx, VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_Y_OFFSET );
- vid_outw( cx, VBE_DISPI_IOPORT_DATA, offset_y );
- vid_outw( cx, VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_X_OFFSET );
- vid_outw( cx, VBE_DISPI_IOPORT_DATA, offset_x );
-
- return (unsigned long)offset_y*pitch + offset_x*ps;
-}
diff --git a/boxv_qemu.c b/boxv_qemu.c
deleted file mode 100644
index 9307863..0000000
--- a/boxv_qemu.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define QEMU
-#include "boxv.c"
diff --git a/control.c b/control.c
index 0e1f24b..74d8292 100644
--- a/control.c
+++ b/control.c
@@ -154,6 +154,7 @@ LONG WINAPI __loadds Control(LPVOID lpDevice, UINT function,
{
case OPENGL_GETINFO:
case OP_FBHDA_SETUP:
+ case MOUSETRAILS:
rc = 1;
break;
case DCICOMMAND:
diff --git a/dddrv.c b/dddrv.c
index eb9c530..7d8b5da 100644
--- a/dddrv.c
+++ b/dddrv.c
@@ -37,7 +37,7 @@ THE SOFTWARE.
#include "3d_accel.h"
#include "vmdahal.h"
-const static DD32BITDRIVERDATA_t drv_bridge99 = {
+const static DD32BITDRIVERDATA_t drv_vmhal9x = {
"vmhal9x.dll",
"DriverInit",
0
@@ -178,6 +178,10 @@ static BOOL DDGetPtr(VMDAHAL_t __far *__far *pm16ptr, DWORD __far *linear)
{
_fmemset(pm16VMDAHAL, 0, sizeof(VMDAHAL_t));
pm16VMDAHAL->dwSize = sizeof(VMDAHAL_t);
+
+ pm16VMDAHAL->pFBHDA32 = hda_linear;
+ pm16VMDAHAL->pFBHDA16 = hda;
+ pm16VMDAHAL->FBHDA_version = 2024;
}
}
@@ -250,12 +254,12 @@ static void buildDDHALInfo(VMDAHAL_t __far *hal, int modeidx)
hal->ddHALInfo.lpD3DGlobalDriverData = pGbl;
//clean 3d callback pointers on 8bpps
- if(wBpp > 8)
+ if(hda->bpp > 8)
{
hal->ddHALInfo.lpDDExeBufCallbacks = pExeBuf;
}
- bytes_per_pixel = wBpp/8;
+ bytes_per_pixel = (hda->bpp+7)/8;
hal->ddHALInfo.dwSize = sizeof(hal->ddHALInfo);
hal->ddHALInfo.hInstance = hal->hInstance;
@@ -269,10 +273,10 @@ static void buildDDHALInfo(VMDAHAL_t __far *hal, int modeidx)
/*
* current primary surface attributes
*/
- hal->ddHALInfo.vmiData.fpPrimary = dwScreenFlatAddr;
- hal->ddHALInfo.vmiData.dwDisplayWidth = (DWORD) wScreenX;
- hal->ddHALInfo.vmiData.dwDisplayHeight = (DWORD) wScreenY;
- hal->ddHALInfo.vmiData.lDisplayPitch = (DWORD) CalcPitch(wScreenX, wBpp);
+ hal->ddHALInfo.vmiData.fpPrimary = hda->vram_pm32;
+ hal->ddHALInfo.vmiData.dwDisplayWidth = hda->width;
+ hal->ddHALInfo.vmiData.dwDisplayHeight = hda->height;
+ hal->ddHALInfo.vmiData.lDisplayPitch = hda->pitch;
_fmemset(&hal->ddHALInfo.vmiData.ddpfDisplay, 0, sizeof(hal->ddHALInfo.vmiData.ddpfDisplay));
hal->ddHALInfo.vmiData.ddpfDisplay.dwSize = sizeof(DDPIXELFORMAT_t);
@@ -298,8 +302,8 @@ static void buildDDHALInfo(VMDAHAL_t __far *hal, int modeidx)
vidMem[0].dwFlags = VIDMEM_ISLINEAR;
vidMem[0].ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
- vidMem[0].fpStart = dwScreenFlatAddr + screenSize;
- vidMem[0].fpEnd = dwScreenFlatAddr + dwVideoMemorySize - 1;
+ vidMem[0].fpStart = hda->vram_pm32 + hda->stride;
+ vidMem[0].fpEnd = hda->vram_pm32 + hda->vram_size - 1;
hal->ddHALInfo.vmiData.dwNumHeaps = 1;
@@ -414,7 +418,7 @@ static void buildDDHALInfo(VMDAHAL_t __far *hal, int modeidx)
/*
* required alignments of the scan lines for each kind of memory
*/
- hal->ddHALInfo.vmiData.dwOffscreenAlign = AlignTbl[ wBpp >> 2 ];
+ hal->ddHALInfo.vmiData.dwOffscreenAlign = AlignTbl[ hda->bpp >> 2 ];
hal->ddHALInfo.vmiData.dwOverlayAlign = 8;
hal->ddHALInfo.vmiData.dwTextureAlign = 8;
hal->ddHALInfo.vmiData.dwZBufferAlign = 8;
@@ -469,9 +473,9 @@ BOOL DDCreateDriverObject(int bReset)
for(modeidx = 0; modeidx < NUMMODES; modeidx++)
{
- if((modeInfo[modeidx].dwWidth == wScreenX) &&
- (modeInfo[modeidx].dwHeight == wScreenY) &&
- (modeInfo[modeidx].dwBPP == wBpp) )
+ if((modeInfo[modeidx].dwWidth == hda->width) &&
+ (modeInfo[modeidx].dwHeight == hda->height) &&
+ (modeInfo[modeidx].dwBPP == hda->bpp) )
{
break;
}
@@ -482,8 +486,8 @@ BOOL DDCreateDriverObject(int bReset)
modeidx = -1;
}
- hal->vramLinear = dwScreenFlatAddr;
- hal->vramSize = dwVideoMemorySize;
+ hal->vramLinear = hda->vram_pm32;
+ hal->vramSize = hda->vram_size;
/*
* set up hal info
@@ -493,10 +497,10 @@ BOOL DDCreateDriverObject(int bReset)
/*
* copy new data into area of memory shared with 32-bit DLL
*/
- hal->dwWidth = wScreenX;
- hal->dwHeight = wScreenY;
- hal->dwBpp = wBpp;
- hal->dwPitch = CalcPitch(wScreenX, wBpp);
+ hal->dwWidth = hda->width;
+ hal->dwHeight = hda->height;
+ hal->dwBpp = hda->bpp;
+ hal->dwPitch = hda->pitch;
/*
* get addresses of 32-bit routines
*/
@@ -551,17 +555,13 @@ BOOL DDCreateDriverObject(int bReset)
dbg_printf(" DestroySurface = %lX\n", cbDDSurfaceCallbacks.DestroySurface);
dbg_printf(" GetDriverInfo = %lX\n", hal->ddHALInfo.GetDriverInfo);
dbg_printf(" WaitForVerticalBlank = %lX\n\n", cbDDCallbacks.WaitForVerticalBlank);
-
- hal->pFBHDA32 = hda_linear;
- hal->pFBHDA16 = hda;
- hal->FBHDA_version = 2;
-
+
return lpDDHAL_SetInfo(&(hal->ddHALInfo), bReset);
}
BOOL DDGet32BitDriverName(DD32BITDRIVERDATA_t __far *dd32)
{
- _fmemcpy(dd32, &drv_bridge99, sizeof(drv_bridge99));
+ _fmemcpy(dd32, &drv_vmhal9x, sizeof(drv_vmhal9x));
if(DDGetPtr(NULL, &(dd32->dwContext)))
{
diff --git a/makefile b/makefile
index 2b6f3f2..0635e2b 100644
--- a/makefile
+++ b/makefile
@@ -1,5 +1,5 @@
OBJS = &
- boxv.obj boxv_qemu.obj dbgprint.obj dibcall.obj &
+ dbgprint.obj dibcall.obj &
dibthunk.obj dddrv.obj drvlib.obj enable.obj init.obj &
control.obj pm16_calls.obj pm16_calls_svga.obj pm16_calls_qemu.obj &
palette.obj sswhook.obj modes.obj modes_svga.obj scrsw.obj scrsw_svga.obj &
@@ -11,14 +11,12 @@ OBJS += &
INCS = -I$(%WATCOM)\h\win -Iddk -Ivmware
-VER_BUILD = 24
+VER_BUILD = 32
FLAGS = -DDRV_VER_BUILD=$(VER_BUILD)
# Define HWBLT if BitBlt can be accelerated.
#FLAGS += -DHWBLT
-# Define VRAM256MB if you want set VRAM limit to 256MB (default is 128MB)
-#FLAGS += -DVRAM256MB
# Set DBGPRINT to add debug printf logging.
#DBGPRINT = 1
@@ -47,12 +45,6 @@ CFLAGS32 += -DCOM2
all : vmwsmini.drv vmwsmini.vxd qemumini.drv qemumini.vxd boxvmini.drv boxvmini.vxd
# Object files: PM16 RING-3
-boxv.obj : boxv.c .autodepend
- $(CC) $(CFLAGS) -zW $(INCS) $(FLAGS) $<
-
-boxv_qemu.obj : boxv_qemu.c .autodepend
- $(CC) $(CFLAGS) -zW $(INCS) $(FLAGS) $<
-
dbgprint.obj : dbgprint.c .autodepend
$(CC) $(CFLAGS) -zW $(FLAGS) $<
diff --git a/minidrv.h b/minidrv.h
index 52f3291..90687f3 100644
--- a/minidrv.h
+++ b/minidrv.h
@@ -80,10 +80,6 @@ extern WORD wScreenY; /* Screen height in pixels. */
extern WORD wEnabled; /* PDevice enabled flag. */
extern RGBQUAD FAR *lpColorTable; /* Current color table. */
-extern DWORD dwScreenFlatAddr; /* Linear address of frame buffer */
-extern DWORD dwVideoMemorySize; /* Installed VRAM in bytes. */
-extern WORD wScreenPitchBytes; /* screen pitch */
-
extern DWORD VDDEntryPoint;
extern WORD OurVMHandle;
#ifdef QEMU
diff --git a/modes.c b/modes.c
index 1e379dd..fd8faac 100644
--- a/modes.c
+++ b/modes.c
@@ -59,7 +59,6 @@ WORD wPDeviceFlags = 0;
FBHDA_t __far * hda = NULL;
DWORD hda_linear = 0;
-DWORD dwScreenFlatAddr = 0; /* 32-bit flat address of VRAM. */
DWORD dwVideoMemorySize = 0; /* Installed VRAM in bytes. */
WORD wScreenPitchBytes = 0; /* Current scanline pitch. */
diff --git a/vmdahal.h b/vmdahal.h
index 9fe8bea..ec4fef8 100644
--- a/vmdahal.h
+++ b/vmdahal.h
@@ -26,6 +26,14 @@ typedef struct VMDAHALCB32
LPDDHAL_SETEXCLUSIVEMODE SetExclusiveMode;
} VMDAHALCB32_t;
+struct VXD_pair
+{
+ DWORD pid;
+ DWORD vxd;
+};
+
+#define VXD_PAIRS_CNT 32
+
typedef struct VMDAHAL
{
DWORD dwSize;
@@ -49,6 +57,8 @@ typedef struct VMDAHAL
DWORD FBHDA_version;
DWORD hDC;
+
+ struct VXD_pair vxd_table[VXD_PAIRS_CNT];
} VMDAHAL_t;
#pragma pack(pop)
diff --git a/vmdisp9x.inf b/vmdisp9x.inf
index 4b3e910..16e8fa3 100644
--- a/vmdisp9x.inf
+++ b/vmdisp9x.inf
@@ -35,15 +35,23 @@ qemumini.vxd=1
;openglide:glide2x.dll=1
;openglide:glide3x.dll=1
;wined3d:wined3d.dll=1
-;wined3d:dwine.dll=1
+;wined3d:winedd.dll=1
+;wined3d:wined8.dll=1
+;wined3d:wined9.dll=1
;wined3d:ddraw.dll=1
;wined3d:ddrawme.dll=1
;wined3d:d3d8.dll=1
;wined3d:d3d9.dll=1
-;3dfx:3dfxSpl2.dll=1,vgw9x
-;3dfx:3dfxSpl3.dll=1,vgw9x
;wined3d:ddr95.dll=1,dx
;wined3d:ddr98.dll=1,dx
+;3dfx:3dfxSpl2.dll=1,vgw9x
+;3dfx:3dfxSpl3.dll=1,vgw9x
+;nine:mesa89.dll=1
+;nine:mesa99.dll=1
+;syscopy:ddsys.dll=1,sys
+;syscopy:msd3d8.dll=1,sys
+;syscopy:msd3d9.dll=1,sys
+
;vmhal:vmhal9x.dll=1
[Manufacturer]
@@ -103,13 +111,20 @@ vmwsmini.vxd,,,0x00000004
[DX.Copy]
;wined3d:wined3d.dll,,,0x00000004
-;wined3d:dwine.dll,,,0x00000004
+;wined3d:winedd.dll,,,0x00000004
+;wined3d:wined8.dll,,,0x00000004
+;wined3d:wined9.dll,,,0x00000004
;wined3d:ddraw.dll,,,0x00000004
;wined3d:ddrawme.dll,,,0x00000004
;wined3d:d3d8.dll,,,0x00000004
;wined3d:d3d9.dll,,,0x00000004
;wined3d:ddr95.dll,,,0x00000004
;wined3d:ddr98.dll,,,0x00000004
+;nine:mesa89.dll,,,0x00000004
+;nine:mesa99.dll,,,0x00000004
+;syscopy:ddsys.dll,,,0x00000004
+;syscopy:msd3d8.dll,,,0x00000004
+;syscopy:msd3d9.dll,,,0x00000004
[DX.CopyBackup]
;wined3d:ddraw.dll,,,0x00000004
diff --git a/vxd_main.c b/vxd_main.c
index f86334f..4775795 100644
--- a/vxd_main.c
+++ b/vxd_main.c
@@ -464,7 +464,7 @@ DWORD __stdcall Device_IO_Control_proc(struct DIOCParams *params)
DWORD *inBuf = (DWORD*)params->lpInBuffer;
DWORD *outBuf = (DWORD*)params->lpOutBuffer;
- //dbg_printf(dbg_deviceiocontrol, params->dwIoControlCode);
+ dbg_printf(dbg_deviceiocontrol, params->dwIoControlCode);
switch(params->dwIoControlCode)
{
diff --git a/vxd_mouse.c b/vxd_mouse.c
index 5e5a2ad..f765625 100644
--- a/vxd_mouse.c
+++ b/vxd_mouse.c
@@ -99,8 +99,6 @@ BOOL mouse_load()
cur = (CURSORSHAPE*)mouse_buffer_mem;
- dbg_printf(dbg_mouse_cur, cur->cx, cur->cy, cur->BitsPixel, cur->Planes);
-
/* erase cursor if present */
FBHDA_access_begin(0);
@@ -174,7 +172,7 @@ BOOL mouse_load()
mouse_visible = TRUE;
mouse_empty = cursor_is_empty();
- dbg_printf(dbg_cursor_empty, mouse_empty);
+ //dbg_printf(dbg_cursor_empty, mouse_empty);
/* blit new cursor */
FBHDA_access_end(0);
diff --git a/vxd_mouse_conv.h b/vxd_mouse_conv.h
index 2fd079e..62071fb 100644
--- a/vxd_mouse_conv.h
+++ b/vxd_mouse_conv.h
@@ -39,8 +39,9 @@ static void save ## _bpp(int mx, int my){ \
int x, y; \
_type *screen; \
_type *buf = mouse_swap_data; \
+ BYTE *screen_pos = ((BYTE*)hda->vram_pm32) + hda->surface; \
if(!calc_save(mx, my)){ return; } \
- screen = (_type*)((BYTE*)hda->vram_pm32 + hda->pitch * mouse_swap_y); \
+ screen = (_type*)(screen_pos + hda->pitch * mouse_swap_y); \
for(y = 0; y < mouse_swap_h; y++) { \
for(x = 0; x < mouse_swap_w; x++) { \
*buf = screen[mouse_swap_x + x]; \
@@ -59,8 +60,9 @@ static void save24(int mx, int my)
int x, y;
BYTE *screen;
BYTE *buf = mouse_swap_data;
+ BYTE *screen_pos = ((BYTE*)hda->vram_pm32) + hda->surface;
if(!calc_save(mx, my)){ return; }
- screen = (BYTE*)hda->vram_pm32 + hda->pitch * mouse_swap_y;
+ screen = screen_pos + hda->pitch * mouse_swap_y;
for(y = 0; y < mouse_swap_h; y++)
{
for(x = 0; x < mouse_swap_w; x++)
@@ -79,8 +81,9 @@ static void restore ## _bpp () { \
int x, y; \
_type *screen; \
_type *buf = mouse_swap_data; \
+ BYTE *screen_pos = ((BYTE*)hda->vram_pm32) + hda->surface; \
if(!mouse_swap_valid){ return; } \
- screen = (_type*)((BYTE*)hda->vram_pm32 + hda->pitch * mouse_swap_y); \
+ screen = (_type*)(screen_pos + hda->pitch * mouse_swap_y); \
for(y = 0; y < mouse_swap_h; y++) { \
for(x = 0; x < mouse_swap_w; x++) { \
screen[mouse_swap_x + x] = *buf; buf++; \
@@ -98,8 +101,9 @@ void restore24()
int x, y;
BYTE *screen;
BYTE *buf = mouse_swap_data;
+ BYTE *screen_pos = ((BYTE*)hda->vram_pm32) + hda->surface;
if(!mouse_swap_valid){ return; }
- screen = (BYTE*)hda->vram_pm32 + hda->pitch * mouse_swap_y;
+ screen = screen_pos + hda->pitch * mouse_swap_y;
for(y = 0; y < mouse_swap_h; y++)
{
for(x = 0; x < mouse_swap_w; x++)
@@ -122,10 +126,11 @@ static void blit ## _bpp (int mx, int my) { \
int real_x = mx - mouse_pointx; \
int real_y = my - mouse_pointy; \
int real_xx, real_yy; \
+ BYTE *screen_pos = ((BYTE*)hda->vram_pm32) + hda->surface; \
for(y = 0; y < mouse_h; y++) { \
real_yy = real_y+y; \
if(real_yy >= 0 && real_yy < hda->height) { \
- screen_line = (_type*)(((BYTE*)hda->vram_pm32) + hda->pitch * (real_yy)); \
+ screen_line = (_type*)(screen_pos + hda->pitch * (real_yy)); \
and_line = ((_type*)mouse_andmask_data + mouse_w * y); \
xor_line = ((_type*)mouse_xormask_data + mouse_w * y); \
for(x = 0; x < mouse_w; x++) { \
@@ -149,12 +154,13 @@ static void blit24(int mx, int my)
int real_y = my - mouse_pointy;
int real_xx, real_yy;
int real_xx3, x3;
+ BYTE *screen_pos = ((BYTE*)hda->vram_pm32) + hda->surface;
for(y = 0; y < mouse_h; y++)
{
real_yy = real_y+y;
if(real_yy >= 0 && real_yy < hda->height)
{
- screen_line = ((BYTE*)hda->vram_pm32) + hda->pitch * real_yy;
+ screen_line = screen_pos + hda->pitch * real_yy;
and_line = ((BYTE*)mouse_andmask_data) + mouse_w * y * 3;
xor_line = ((BYTE*)mouse_xormask_data) + mouse_w * y * 3;
for(x = 0; x < mouse_w; x++)
diff --git a/vxd_vbe.c b/vxd_vbe.c
index 18fcae1..c6bba58 100644
--- a/vxd_vbe.c
+++ b/vxd_vbe.c
@@ -259,7 +259,7 @@ BOOL VBE_setmode(DWORD w, DWORD h, DWORD bpp)
hda->height = h;
hda->bpp = bpp;
hda->pitch = VBE_pitch(w, bpp);
- hda->stride = h * hda->bpp;
+ hda->stride = h * hda->pitch;
hda->surface = 0;
mouse_invalidate();
@@ -287,24 +287,24 @@ DWORD FBHDA_palette_get(unsigned char index)
return (r << 16) | (g << 8) | b;
}
-
BOOL FBHDA_swap(DWORD offset)
{
DWORD ps = ((hda->bpp+7)/8);
DWORD offset_y = offset/hda->pitch;
DWORD offset_x = (offset % hda->pitch)/ps;
- DWORD surface = offset/hda->stride;
if(offset + hda->stride > hda->vram_size) return FALSE; /* if exceed VRAM */
-
- if(surface == 0 && offset != 0) return FALSE; /* forbind move of half screen */
-
- hda->surface = surface;
+
+ FBHDA_access_begin(0);
outpw(VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_Y_OFFSET);
outpw(VBE_DISPI_IOPORT_DATA, (WORD)offset_y);
outpw(VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_X_OFFSET);
outpw(VBE_DISPI_IOPORT_DATA, (WORD)offset_x);
+
+ hda->surface = offset;
+
+ FBHDA_access_end(0);
return TRUE;
}