aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaroslav Hensl <jara@hensl.cz>2024-11-20 00:08:47 +0100
committerJaroslav Hensl <jara@hensl.cz>2024-11-20 00:08:47 +0100
commit12ce43bf38e0c92c6565a4d3f91d2c9a7b230f04 (patch)
tree65dc73453514388c3297ac380b8fb4083390e5f5
parent1cc70b8dbcd13a23a8db7cc416e466ee37d263d5 (diff)
downloadvmdisp9x-12ce43bf38e0c92c6565a4d3f91d2c9a7b230f04.tar.gz
DDI support, RC fix on mouse, fixed README
-rw-r--r--3d_accel.h5
-rw-r--r--README.md65
-rw-r--r--dddrv.c140
-rw-r--r--ddk/ddrawi.h13
-rw-r--r--vmdahal.h13
-rw-r--r--vmdisp9x.inf4
-rw-r--r--vxd_main.c6
-rw-r--r--vxd_svga.c4
-rw-r--r--vxd_vbe.c3
9 files changed, 106 insertions, 147 deletions
diff --git a/3d_accel.h b/3d_accel.h
index f96e90a..5e7298a 100644
--- a/3d_accel.h
+++ b/3d_accel.h
@@ -105,7 +105,8 @@ THE SOFTWARE.
# define FBPTR *
#endif
-#define FBHA_OVERLAYS_MAX 16
+#define FBHDA_OVERLAYS_MAX 16
+#define FBHDA_ROW_ALIGN 8
typedef struct FBHDA_overlay
{
@@ -138,7 +139,7 @@ typedef struct FBHDA
DWORD vram_size;
char vxdname[16]; /* file name or "NT" */
DWORD overlay;
- FBHDA_overlay_t overlays[FBHA_OVERLAYS_MAX];
+ FBHDA_overlay_t overlays[FBHDA_OVERLAYS_MAX];
DWORD overlays_size;
DWORD gamma; /* fixed decimal point, 65536 = 1.0 */
DWORD system_surface;
diff --git a/README.md b/README.md
index ad79cd1..88f85fe 100644
--- a/README.md
+++ b/README.md
@@ -6,16 +6,16 @@ Virtual Display driver for Windows 95/98/Me. Supported devices are:
Supported and tested virtualization software are:
- ~~VirtualBox 6.0 (2D, software 3D)~~
-- VirtualBox 6.1 (2D, hardware OpenGL 2.1 through DX9 or OpenGL)
-- VirtualBox 7.0 (2D, hardware OpenGL 2.1 through DX9 or OpenGL)
-- VMWare Player 16 (2D, software 3D)
-- VMWare Workstation 17 (2D, hardware OpenGL 2.1)
+- VirtualBox 6.1 (2D, hardware OpenGL 2.1 through DX9/OpenGL)
+- VirtualBox 7.x (2D, hardware OpenGL 2.1 through DX9/OpenGL or 4.1 through DX11/Vulkan)
+- VMWare Player 16 (2D, hardware OpenGL 2.1/3.3)
+- VMWare Workstation 17 (2D, hardware OpenGL 2.1/4.3)
- QEMU 7.x, 8.0 (2D, software 3D)
2D driver is very generic and probably works with other Virtualization software as well, 3D part required my Mesa port = https://github.com/JHRobotics/mesa9x. See its documentation for more info.
-## Full acceleration package
-This repository contains only basic 2D driver, for 3D (hardware or software) acceleration you need sort of addition libraries and wrappers. My all-in-one package is here: https://github.com/JHRobotics/softgpu
+## Easy installation
+This repository only contains the display driver, if you want user friendly installation, please use [SoftGPU](https://github.com/JHRobotics/softgpu) instead (this driver is part of SoftGPU project). There is also small [tutorial here](https://github.com/JHRobotics/vmdisp9x/issues/9#issuecomment-2452598883).
## Origin
Driver is based on [Michal Necasek's VirtualBox driver](http://www.os2museum.com/wp/windows-9x-video-minidriver-hd/). With my modifications:
@@ -25,37 +25,35 @@ Driver is based on [Michal Necasek's VirtualBox driver](http://www.os2museum.com
- 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
+- added DirectX support (in development)
QEMU support (`-vga std`) is from [Philip Kelley driver modification](https://github.com/phkelley/boxv9x)
-## 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
+## OpenGL support
+OpenGL is supported by OpenGL ICD driver loading (you can use software only driver but also exists HW accelerated implementations). Currently supported ICD drivers are [Mesa9x](https://github.com/JHRobotics/mesa9x/) or my [qemu-3dfx fork](https://github.com/JHRobotics/qemu-3dfx).
## DirectDraw support
-2D only accelerated drawing is available. User DLL (RING-3) code is in separated project: https://github.com/JHRobotics/vmhal9x
+DirectDraw is supported, Ring-3 driver is in separated project [VMHal9x](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 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
+## Direct3D support
+DirectDraw is now in development, most of D3D code is in VMHal9x, rasterization is done by Mesa9x. **D3D is not part of releases yet!**
-## DirectX support
-Microsoft DirectDraw/DirectX is complex and relatively complicated API handled by DDI driver. For Windows 9x there are 4 version of this API DirectX: DirectX 2.0 - 6.1 through DDRAW.dll, DirectX 7 still through DDRAW.dll, DirectX through D3D8.dll and DirectX 9 through D3D9.dll. DDI driver has feature level (basically equals API version request with some forward compatibility) and every API required minimum level, for example DirectX 8 required DDI version 6 as minimum, DirectX 9 required 7. Behaviour changes with DirectX 10 which required DDI version 10. If you wish to implement DDI 9 you must also implement all older. This change with DirectX 11 where is needed only actual feature set and all older DDI can be emulated - but is out of reach by Windows 9x and we still stuck DirectX 9.
-There no DDI support in this driver, but here is Wine project (and with part called WineD3D) which can translate DirectX (and DirectDraw too) calls to OpenGL. Minimum is OpenGL with version 2.1 or better. My port WineD3D for Windows 9x is here: https://github.com/JHRobotics/wine9x
+## Glide support
+Glide support has nothing to do with display driver. But when OpenGL is supported is possible to use [OpenGlide9X](ttps://github.com/JHRobotics/openglide9x) wrapper to translate Glide (2 and 3) calls to OpenGL.
-Of course, there is alternative for DX8 and DX9 called Swiftshader 2.0
## VirtualBox
-This driver supporting VirtualBox 6.x and 7.0 (in theory older versions should work, but they weren't test). Supported are all 3 adapters: *VBoxVGA*, *VBoxSVGA* and *VMSVGA*. For better performance (and HW 3D acceleration) is using *VBoxSVGA* or *VMSVGA* recommended. [There is known issue](https://github.com/JHRobotics/vmdisp9x/issues/2), that more than 64 MB VRAM does not work on some configuration. So, for best compatibility set the **video memory** to **64 MB**. Don't worry about low memory for 3D, more on [VRAM size topic](#vram-size).
+VirtualBox is supported from version 6.1 (but 5.0 and 6.0 with some limitation works). More on [SoftGPU readme](https://github.com/JHRobotics/softgpu/#virtualbox-vm-setup-with-hw-acceleration).
-## VMware
-Driver supports VMware Workstation and WMware Player 16 and 17 (in theory older should works too).
+## VMware Workstation and Player
+VMware workstation is supported in current version (17.5.x). In theory, this driver can work from version 9.x, but I don't have enough resources to do complete testing of old closed non-free software. More information also on [SoftGPU readme](https://github.com/JHRobotics/softgpu/?tab=readme-ov-file#vmware-workstation-setup-with-hw-acceleration).
## QEMU
-QEMU is supported since **v1.2023.0.10**. Supported adapters are `-vga std` which using modified VBE driver (`qemumini.drv`) and `-vga vmware` where VMware driver now works but is limited to 32 bpp colors only. I plan to support *VirGL* in future, but currently no 3D acceleration isn't available in QEMU.
+QEMU is supported since **v1.2023.0.10**. Supported adapters are `-vga std` which using modified VBE driver (`qemumini.drv`) and `-vga vmware` where VMware driver now works but is limited to 32bpp colours only. I plan to support *VirGL* in future, but currently no 3D acceleration isn't available in vanilla QEMU (but HW acceleration is possible with [QEMU-3DFX](https://github.com/kjliew/qemu-3dfx).
## Technical
@@ -67,30 +65,30 @@ QEMU is supported since **v1.2023.0.10**. Supported adapters are `-vga std` whic
### Adapters
-Default inf file is supporting these 4 adapter:
+Default `*.inf` file is supporting these 4 adapters:
-`[VBox]` Default adapter to VirtualBox (VBoxVGA) (until version 6.0 only one adapter) - using 16 bit `boxvmini.drv` driver. Device identification is `PCI\VEN_80EE&DEV_BEEF&SUBSYS_00000000`.
+`[VBox]` Default adapter to VirtualBox (VBoxVGA) (until version 6.0 only one adapter) - using 16-bit `boxvmini.drv` driver. Device identification is `PCI\VEN_80EE&DEV_BEEF&SUBSYS_00000000`.
-`[Qemu]` QEMUs `-vga std` (or `-device VGA`) device - using 16 bit `qemumini.drv` driver. Device identification is `PCI\VEN_1234&DEV_1111`.
+`[Qemu]` QEMUs `-vga std` (or `-device VGA`) device - using 16-bit `qemumini.drv` driver. Device identification is `PCI\VEN_1234&DEV_1111`.
-`[VMSvga]` VMware adapter, VirtualBox VMSVGA and QEMU `-vga vmware`. Using 16 bit `vmwsmini.drv` driver and 32 bit `vmwsmini.vxd` driver. Device identification is `PCI\VEN_15AD&DEV_0405&SUBSYS_040515AD`.
+`[VMSvga]` VMware adapter, VirtualBox VMSVGA and QEMU `-vga vmware`. Using 16-bit `vmwsmini.drv` driver and 32-bit `vmwsmini.vxd` driver. Device identification is `PCI\VEN_15AD&DEV_0405&SUBSYS_040515AD`.
-`[VBoxSvga]` VirtualBox VBoxSVGA, using 16 bit `vmwsmini.drv` driver and 32 bit `vmwsmini.vxd` driver. Device identification is `PCI\VEN_80EE&DEV_BEEF&SUBSYS_040515AD`.
+`[VBoxSvga]` VirtualBox VBoxSVGA, using 16-bit `vmwsmini.drv` driver and 32-bit `vmwsmini.vxd` driver. Device identification is `PCI\VEN_80EE&DEV_BEEF&SUBSYS_040515AD`.
## Resolutions support
-With default `*.inf` file, default maximum resolution is 1920 x 1200. Maximum wired resolution is 5120 x 4096. For compatibility reasons maximum of VRAM is limited to 128 MB (If you set to adapter more, it'll report only first 128 MB).
+With default `*.inf` file, maximum resolution is 1920 x 1200. Maximum wired resolution is 5120 x 4096. For compatibility reasons maximum of VRAM is limited to 128 MB (If you set to adapter more, it'll report only first 128 MB).
-However it is possible increase the limit to 256 MB (Windows 9x maximum), if code is compiled with defined `VRAM256MB` (edit `makefile` to set this and recompile project) maximum resolution for this settings is 8192 x 5120.
+However, it is possible increase the limit to 256 MB (Windows 9x maximum) by set this registry key: `HKLM\Software\VMWSVGA\VRAMLimit` to 256. (You can also decrease VRAM size by same way and have more free space is system area.)
### QXGA, WQHD, 4K and 5K
-Resolutions sets larger than FullHD, are present in inf file, but needs to be *enabled* if you wish use them. They're split to 4 individual section:
+Resolutions sets larger than FullHD, are present in inf file, but needs to be *enabled* if you wish would use them. They're split to 4 individual sections:
- `[VM.QXGA]` - QXGA, QWXGA and some others bit larger then FullHD
- `[VM.WQHD]` - 1440p resolutions set
- `[VM.UHD]` - 4K resolutions set
- `[VM.R5K]` - 5K resolutions set
-To enable one of them just append section name to `AddReg=` parameter to corresponding adapter. For example to add 4K to **VMware adapter** change:
+To enable one of them just append section name to `AddReg=` parameter to corresponding adapter. For example, to add 4K to **VMware adapter** change:
```
[VMSvga]
@@ -116,7 +114,7 @@ To add custom resolution just append line to `[VM.AddReg]` section with followin
HKR,"MODES\{BPP}\{WIDTH},{HEIGHT}"
```
-For example adding 1366x768 for all color modes can look like:
+For example, adding 1366x768 for all colour modes can look like:
```
HKR,"MODES\8\1366,768"
@@ -127,11 +125,11 @@ HKR,"MODES\32\1366,768"
### VRAM size
-In current state the driver using VRAM as framebuffer only. For example if you're using 1920 x 1080 x 32 bpp, driver consume only 8 MB of VRAM and rest of is unutilized. Even if you using HW accelerated graphics with this driver all textures, surface and even backbuffers (implemented as surfaces) are stored in virtual machine's RAM.
+Due limitation of virtual display card is usually required have enough memory for 2 display buffers, when 1st one is always in 32bpp. So, for 1024x768 16bpp you need about 4.5 MB VRAM (1024 x 768 x 4 + 1024 x 768 x 2). When HW acceleration is used, VRAM is not well utilized - textures and frame buffers must be in system RAM.
## Security
-In 2D mode any application could read and write guest frame buffer and rest of video ram. If 3D is enabled and works (on hypervisor site) is possible by any application to write virtual GPU FIFO which could leads to read memory of different process (in same guest) or crash the guest. These risks are noted but needs to be mentioned that these old systems haven't or has only minimal security management. For example, Microsoft Windows 9x system hasn't no file system rights, all process has mapped system memory (in last 1 GB of 32bit memory space) and any user could run 16bit application where have access to everything including I/O because of compatibility.
+In 2D mode any application could read and write guest frame buffer and rest of video ram. If 3D is enabled and works (on hypervisor side) is possible by any application to write virtual GPU FIFO which could leads to read memory of different process (in same guest) or crash the guest. These risks are noted but needs to be mentioned that these old systems haven’t any or has only minimal security management. For example, Microsoft Windows 9x systems haven't file system rights, all process has mapped system memory (in last 1 GB of 32-bit memory space) and any user could run 16-bit application where have access to everything including I/O because of compatibility.
## Compilation from source
Install [Open Watcom 1.9](http://openwatcom.org/ftp/install/), then type
@@ -142,9 +140,10 @@ Edit `makefile` to enable addition logging and you can read original [readdev.tx
## Todo
- Complete recomended mini-VDD function in [minivdd.c](minivdd.c), stubs here and cites from original MSDN are in comments.
-- Complete GPU10 functions (with synchronization with Mesa)
+- ~Complete GPU10 functions (with synchronization with Mesa)~
- VirGL
- DDI
+- VESA support
## External links
http://www.os2museum.com/wp/windows-9x-video-minidriver-hd/
diff --git a/dddrv.c b/dddrv.c
index 09c1719..ea62714 100644
--- a/dddrv.c
+++ b/dddrv.c
@@ -44,45 +44,6 @@ const static DD32BITDRIVERDATA_t drv_vmhal9x = {
};
/*
-static DDHALMODEINFO_t modeInfo[] = {
- { 640, 480, 640, 8, DDMODEINFO_PALETTIZED, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
- { 640, 480, 1280, 16, 0, 0, 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 },
- { 640, 480, 2560, 32, 0, 0, 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000 },
- { 800, 600, 800, 8, DDMODEINFO_PALETTIZED, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
- { 800, 600, 1600, 16, 0, 0, 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 },
- { 800, 600, 3200, 32, 0, 0, 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000 },
- { 1024, 768, 1024, 8, DDMODEINFO_PALETTIZED, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
- { 1024, 768, 2048, 16, 0, 0, 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 },
- { 1024, 768, 4096, 32, 0, 0, 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000 },
- { 1280, 1024, 1280, 8, DDMODEINFO_PALETTIZED, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
- { 1280, 1024, 2560, 16, 0, 0, 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 },
- { 1280, 1024, 5120, 32, 0, 0, 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000 },
- { 1600, 1200, 1600, 8, DDMODEINFO_PALETTIZED, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
- { 1600, 1200, 3200, 16, 0, 0, 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 },
- { 1600, 1200, 6400, 32, 0, 0, 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000 },
- { 720, 480, 720, 8, DDMODEINFO_PALETTIZED, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
- { 720, 480, 1440, 16, 0, 0, 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 },
- { 720, 480, 2880, 32, 0, 0, 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000 },
- { 1280, 720, 1280, 8, DDMODEINFO_PALETTIZED, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
- { 1280, 720, 2560, 16, 0, 0, 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 },
- { 1280, 720, 5120, 32, 0, 0, 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000 },
- { 1366, 768, 1280, 8, DDMODEINFO_PALETTIZED, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
- { 1366, 768, 2732, 16, 0, 0, 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 },
- { 1366, 768, 5464, 32, 0, 0, 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000 },
- { 1440, 900, 1440, 8, DDMODEINFO_PALETTIZED, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
- { 1440, 900, 2880, 16, 0, 0, 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 },
- { 1440, 900, 5760, 32, 0, 0, 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000 },
- { 1920, 1080, 1920, 8, DDMODEINFO_PALETTIZED, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
- { 1920, 1080, 3840, 16, 0, 0, 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 },
- { 1920, 1080, 7680, 32, 0, 0, 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000 },
- { 1920, 1200, 1920, 8, DDMODEINFO_PALETTIZED, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
- { 1920, 1200, 3840, 16, 0, 0, 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 },
- { 1920, 1200, 7680, 32, 0, 0, 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000 },
-};*/
-
-//#define NUMMODES (sizeof(modeInfo)/sizeof(DDHALMODEINFO_t))
-
-/*
* pre-declare our HAL fns
*/
DWORD __loadds __far __fastcall HALDestroyDriver(LPDDHAL_DESTROYDRIVERDATA);
@@ -232,7 +193,12 @@ static void buildPixelFormat(LPDDHALMODEINFO lpMode, LPDDPIXELFORMAT lpddpf)
*/
static void buildDDHALInfo(VMDAHAL_t __far *hal, int modeidx)
{
- static DWORD AlignTbl [ 9 ] = { 16, 16, 16, 16, 16, 16, 16, 16, 16 }; /* we can now use aligned AVX to manipulate with surfaces */
+ static DWORD AlignTbl [ 9 ] = {
+ FBHDA_ROW_ALIGN, FBHDA_ROW_ALIGN, FBHDA_ROW_ALIGN,
+ FBHDA_ROW_ALIGN, FBHDA_ROW_ALIGN, FBHDA_ROW_ALIGN,
+ FBHDA_ROW_ALIGN, FBHDA_ROW_ALIGN, FBHDA_ROW_ALIGN
+ }; /* reduced to 8 to work correctly with glPixelStorei */
+
int ii;
BOOL can_flip;
WORD heap;
@@ -307,68 +273,6 @@ static void buildDDHALInfo(VMDAHAL_t __far *hal, int modeidx)
/*
* capabilities supported
*/
-
- //! hal->ddHALInfo.ddCaps.dwCaps = DDCAPS_GDI;
-/*
- hal->ddHALInfo.ddCaps.dwCaps = DDCAPS_GDI |
- DDCAPS_BLT |
- //DDCAPS_3D | //fix #SPR 15230
- DDCAPS_ALPHA |
- DDCAPS_BLTDEPTHFILL |
- DDCAPS_BLTCOLORFILL |
- DDCAPS_COLORKEY ;
-
- hal->ddHALInfo.ddCaps.dwCKeyCaps = DDCKEYCAPS_SRCBLT;
-
- hal->ddHALInfo.ddCaps.dwFXCaps = 0x00000000;
-
- hal->ddHALInfo.ddCaps.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN |
- DDSCAPS_PRIMARYSURFACE |
- DDSCAPS_ALPHA;//ly | //###
-//ly DDSCAPS_3DDEVICE |
-//ly DDSCAPS_TEXTURE |
-//ly DDSCAPS_ZBUFFER;
-
-// if (S3MobileData.b3DCaps & (Virge_3D | VirgeGX_3D)){
- if (wBpp >= 16){ //ly
- ddHALInfo.ddCaps.dwCaps |= DDCAPS_BLTDEPTHFILL;
- ddHALInfo.ddCaps.ddsCaps.dwCaps |=
- DDSCAPS_3DDEVICE |
- DDSCAPS_TEXTURE |
- DDSCAPS_ZBUFFER |
- DDSCAPS_MIPMAP;
-
- //ddHALInfo.ddCaps.dwZBufferBitDepths = DDBD_16;
- }
-*/
-/*
- if( STREAMS_PROCESSOR_PRESENT )
- {
- ddHALInfo.ddCaps.dwCaps |=
- DDCAPS_ALPHA |
- DDCAPS_COLORKEY |
- DDCAPS_OVERLAY |
- DDCAPS_OVERLAYSTRETCH |
- DDCAPS_OVERLAYFOURCC |
- DDCAPS_OVERLAYCANTCLIP;
-
- ddHALInfo.ddCaps.dwCKeyCaps |=
- DDCKEYCAPS_SRCOVERLAY |
- DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV |
- DDCKEYCAPS_SRCOVERLAYONEACTIVE |
- DDCKEYCAPS_SRCOVERLAYYUV |
- DDCKEYCAPS_DESTOVERLAY |
- DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV |
- DDCKEYCAPS_DESTOVERLAYONEACTIVE |
- DDCKEYCAPS_DESTOVERLAYYUV;
-
- ddHALInfo.ddCaps.ddsCaps.dwCaps |= DDSCAPS_OVERLAY; //###
-
- ddHALInfo.ddCaps.dwFXAlphaCaps |= DDFXALPHACAPS_OVERLAYALPHAPIXELS;
- ddHALInfo.ddCaps.dwFXCaps |=
- DDFXCAPS_OVERLAYSTRETCHX |
- DDFXCAPS_OVERLAYSTRETCHY;
- }*/
hal->ddHALInfo.ddCaps.dwCaps = DDCAPS_GDI | /* HW is shared with GDI */
DDCAPS_BLT | /* BLT is supported */
DDCAPS_BLTDEPTHFILL | /* depth fill */
@@ -394,6 +298,15 @@ static void buildDDHALInfo(VMDAHAL_t __far *hal, int modeidx)
hal->ddHALInfo.ddCaps.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN |
DDSCAPS_ALPHA;
+
+ /* 3D support */
+ if(hal->d3dhal_global != NULL)
+ {
+ hal->ddHALInfo.ddCaps.dwCaps |= DDCAPS_3D;
+ hal->ddHALInfo.ddCaps.ddsCaps.dwCaps |= hal->d3dhal_flags.ddscaps;
+ hal->ddHALInfo.ddCaps.dwZBufferBitDepths |= hal->d3dhal_flags.zcaps;
+ }
+
if(can_flip)
{
hal->ddHALInfo.ddCaps.ddsCaps.dwCaps |= DDSCAPS_FLIP | DDSCAPS_PRIMARYSURFACE;
@@ -433,7 +346,7 @@ static void buildDDHALInfo(VMDAHAL_t __far *hal, int modeidx)
hal->ddHALInfo.lpDDPaletteCallbacks = &cbDDPaletteCallbacks;
/*
- * FOURCCs supported
+ * FOURCCs not supported
*/
hal->ddHALInfo.ddCaps.dwNumFourCCCodes = 0;
hal->ddHALInfo.lpdwFourCC = NULL;
@@ -443,6 +356,13 @@ static void buildDDHALInfo(VMDAHAL_t __far *hal, int modeidx)
*/
hal->ddHALInfo.dwNumModes = hal->modes_count;
hal->ddHALInfo.lpModeInfo = VMDAHAL_modes(hal);
+
+ /*
+ * D3D HAL
+ */
+ hal->ddHALInfo.lpD3DGlobalDriverData = (ULONG_PTR)hal->d3dhal_global;
+ hal->ddHALInfo.lpD3DHALCallbacks = (ULONG_PTR)hal->d3dhal_callbacks;
+ hal->ddHALInfo.lpDDExeBufCallbacks = NULL;
} /* buildDDHALInfo */
@@ -535,7 +455,16 @@ BOOL DDCreateDriverObject(int bReset)
cbDDCallbacks.SetExclusiveMode = hal->cb32.SetExclusiveMode;
if(cbDDCallbacks.SetExclusiveMode) cbDDCallbacks.dwFlags |= DDHAL_CB32_SETEXCLUSIVEMODE;
- dbg_printf("Dup DD32 calls\n");
+ cbDDCallbacks.FlipToGDISurface = hal->cb32.FlipToGDISurface;
+ if(cbDDCallbacks.FlipToGDISurface) cbDDCallbacks.dwFlags |= DDHAL_CB32_FLIPTOGDISURFACE;
+
+ if(hal->cb32.DestroyDriver)
+ {
+ cbDDCallbacks.DestroyDriver = hal->cb32.DestroyDriver;
+ cbDDCallbacks.dwFlags |= DDHAL_CB32_DESTROYDRIVER;
+ }
+
+ dbg_printf("Dump DD32 calls\n");
dbg_printf(" CanCreateSurface = %lX\n", cbDDCallbacks.CanCreateSurface);
dbg_printf(" CreateSurface = %lX\n", cbDDCallbacks.CreateSurface);
dbg_printf(" Blt = %lX\n", cbDDSurfaceCallbacks.Blt);
@@ -546,7 +475,8 @@ BOOL DDCreateDriverObject(int bReset)
dbg_printf(" GetFlipStatus = %lX\n", cbDDSurfaceCallbacks.GetFlipStatus);
dbg_printf(" DestroySurface = %lX\n", cbDDSurfaceCallbacks.DestroySurface);
dbg_printf(" GetDriverInfo = %lX\n", hal->ddHALInfo.GetDriverInfo);
- dbg_printf(" WaitForVerticalBlank = %lX\n\n", cbDDCallbacks.WaitForVerticalBlank);
+ dbg_printf(" WaitForVerticalBlank = %lX\n", cbDDCallbacks.WaitForVerticalBlank);
+ dbg_printf(" DestroyDriver = %lX\n\n", cbDDCallbacks.DestroyDriver);
return lpDDHAL_SetInfo(&(hal->ddHALInfo), bReset);
}
diff --git a/ddk/ddrawi.h b/ddk/ddrawi.h
index b80091d..33c89d4 100644
--- a/ddk/ddrawi.h
+++ b/ddk/ddrawi.h
@@ -2126,4 +2126,17 @@ DWORD DDHinstance(void);
/* DCI-Defined error codes */
#define DCI_OK 0 /* success */
+
+
+/*
+ * DIRECTDRAW BITDEPTH CONSTANTS
+ */
+#define DDBD_1 0x00004000l
+#define DDBD_2 0x00002000l
+#define DDBD_4 0x00001000l
+#define DDBD_8 0x00000800l
+#define DDBD_16 0x00000400l
+#define DDBD_24 0X00000200l
+#define DDBD_32 0x00000100l
+
#endif /* __DDRAWI_H__INCLUDED__ */
diff --git a/vmdahal.h b/vmdahal.h
index b39779f..bd16b83 100644
--- a/vmdahal.h
+++ b/vmdahal.h
@@ -20,6 +20,7 @@ typedef struct DDHALMODEINFO2
typedef struct VMDAHALCB32
{
+ LPDDHAL_DESTROYDRIVER DestroyDriver;
LPDDHAL_CREATESURFACE CreateSurface;
LPDDHAL_CANCREATESURFACE CanCreateSurface;
LPDDHALSURFCB_DESTROYSURFACE DestroySurface;
@@ -38,6 +39,7 @@ typedef struct VMDAHALCB32
LPDDHAL_WAITFORVERTICALBLANK WaitForVerticalBlank;
LPDDHAL_SETMODE SetMode;
LPDDHAL_SETEXCLUSIVEMODE SetExclusiveMode;
+ LPDDHAL_FLIPTOGDISURFACE FlipToGDISurface;
} VMDAHALCB32_t;
struct VXD_pair
@@ -49,6 +51,12 @@ struct VXD_pair
#define VXD_PAIRS_CNT 32
#define DISP_MODES_MAX 512
+typedef struct VMDAHAL_D3DCAPS
+{
+ DWORD ddscaps;
+ DWORD zcaps;
+} VMDAHAL_D3DCAPS_t;
+
typedef struct VMDAHAL
{
DWORD dwSize;
@@ -78,7 +86,10 @@ typedef struct VMDAHAL
DDHALMODEINFO2_t modes[DISP_MODES_MAX];
DWORD modes_count;
DWORD custom_mode_id;
-
+
+ DWORD d3dhal_global;
+ DWORD d3dhal_callbacks;
+ VMDAHAL_D3DCAPS_t d3dhal_flags;
} VMDAHAL_t;
#pragma pack(pop)
diff --git a/vmdisp9x.inf b/vmdisp9x.inf
index 73ab4bb..451ebe6 100644
--- a/vmdisp9x.inf
+++ b/vmdisp9x.inf
@@ -23,7 +23,7 @@ DX.CopyBackup=10,SYSBCKUP
[SourceDisksNames]
; BOXV9X is the driver disk volume label
-1="Virtual Display Driver for Win9x Disk",,0
+1="VMDisp9x Display Driver for Win9x Disk",,0
[SourceDisksFiles]
boxvmini.drv=1
@@ -391,7 +391,7 @@ HKR,"MODES\24\5120,4096"
HKR,"MODES\32\5120,4096"
[Strings]
-Mfg="VirtualBox"
+Mfg="JHRobotics"
VBoxVideoVGA.DeviceDesc="VBox VGA PCI Adapter"
VBoxVideoSVGA.DeviceDesc="VBox SVGA PCI Adapter"
VBoxVideoVM2.DeviceDesc="VMWare SVGA-II PCI Adapter"
diff --git a/vxd_main.c b/vxd_main.c
index 9336e48..dc06fed 100644
--- a/vxd_main.c
+++ b/vxd_main.c
@@ -325,11 +325,15 @@ WORD __stdcall VXD_API_Proc(PCRS_32 state)
break;
/* mouse */
case OP_MOUSE_LOAD:
+ Begin_Critical_Section(0);
state->Client_ECX = mouse_load();
+ End_Critical_Section();
rc = 1;
break;
case OP_MOUSE_BUFFER:
+ Begin_Critical_Section(0);
state->Client_ECX = (DWORD)mouse_buffer();
+ End_Critical_Section();
rc = 1;
break;
case OP_MOUSE_MOVE:
@@ -468,7 +472,7 @@ static void configure_FBHDA()
RegReadConf(HKEY_LOCAL_MACHINE, reg_path, "FORCE_QEMU3DFX", &force_qemu3dfx);
RegReadConf(HKEY_LOCAL_MACHINE, reg_path, "GAMMA_QUIRK", &gamma_quirk);
- for(i = 1; i < FBHA_OVERLAYS_MAX; i++)
+ for(i = 1; i < FBHDA_OVERLAYS_MAX; i++)
{
char *ptr;
strcpy(buf, "OVERLAY_");
diff --git a/vxd_svga.c b/vxd_svga.c
index e958183..b4559e2 100644
--- a/vxd_svga.c
+++ b/vxd_svga.c
@@ -665,7 +665,7 @@ BOOL SVGA3D_Init(void)
DWORD SVGA_pitch(DWORD width, DWORD bpp)
{
DWORD bp = (bpp + 7) / 8;
- return (bp * width + 15) & 0xFFFFFFF0UL;
+ return (bp * width + (FBHDA_ROW_ALIGN-1)) & (~((DWORD)FBHDA_ROW_ALIGN-1));
}
static DWORD SVGA_DT_stride(DWORD w, DWORD h)
@@ -1448,7 +1448,7 @@ DWORD FBHDA_overlay_setup(DWORD overlay, DWORD width, DWORD height, DWORD bpp)
{
dbg_printf("FBHDA_overlay_setup: %ld\n", overlay);
- if(overlay >= FBHA_OVERLAYS_MAX)
+ if(overlay >= FBHDA_OVERLAYS_MAX)
return 0;
if(overlay == 0)
diff --git a/vxd_vbe.c b/vxd_vbe.c
index bf4cf3f..79f9508 100644
--- a/vxd_vbe.c
+++ b/vxd_vbe.c
@@ -172,7 +172,8 @@ BOOL VBE_valid()
static DWORD VBE_pitch(DWORD width, DWORD bpp)
{
DWORD bp = (bpp + 7) / 8;
- return (bp * width + 3) & 0xFFFFFFFC;
+// return (bp * width + 3) & 0xFFFFFFFC;
+ return (bp * width + (FBHDA_ROW_ALIGN-1)) & (~((DWORD)FBHDA_ROW_ALIGN-1));
}
BOOL VBE_validmode(DWORD w, DWORD h, DWORD bpp)