VOGONS


QEMU 3Dfx Glide Pass-Through

Topic actions

Reply 20 of 236, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

Very cool and I thank you in advance for supporting my work.

Once I received the donation, please put a note on the paypal payment with your email address and WineD3D package will be delivered to your email address as 7z attachment. Your email must be capable of receiving binary attachment up to 2MiB in size. If you still need my latest QEMU build and entire package, then it is estimated to be around 8MiB in size. You can choose to elect 3 games for priority support and be honored as the sponsors of the games.

I only tested XvT and I hope that it applies for X-Wing, too. Otherwise, it may require the actual game or demo for me to verify before making the donation.

It could be better when the games supported Glide or OpenGL, then you wouldn't have to acquire WineD3D to play them in QEMU. And performance on Glide/OpenGL are usually better, too, and higher confidence that they will play perfectly.

Reply 21 of 236, by OSH

User metadata
Rank Member
Rank
Member

@kjliew, donation sent!
Ok, finally I compiled and set QEMU (but I had to add "--enable-libusb" before compiling, otherwise QEMU won't recognize USB) but now I have other problem: I want to use my USB joystick under QEMU. But only root has access to the USB controller. But If I start QEMU as root, there's no sound. If I start QEMU as normal user, there's sound but without joystick access. I've searched Internet but of course I couldn't find any suitable answer to my problem. So what should I do now?
And I see, 3d acceleration won't work at all. I compiled glie.dll, glide2x.dll and glide3x.dll and copied it into c:\Windows\system. fxmemmap.vxd into c:\Windows\system too. Glide2X.OVL can't find. OpneGlide is compiled and installed (I think so at least). opengl32.dll copied into game directory. And test04.exe won't start, I have such screen:

https://imgur.com/a/IHx5abm

Reply 22 of 236, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

@OSH, I sincerely thank you for your generosity, and a man by his words!
Please allow a couple days for me to prepare the package.

For Linux, always remember to use `-display sdl`. Your screenshot still showed that you were using GTK.
For non-root user to be able to use libusb access, you will need to change the udev rules to allow that. Unfortunately, this could be different on different Linux distro.
To get sound with root user, you will need to use `-audiodev driver=alsa`

Reply 24 of 236, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

I apologize for letting you wait because Linux is a bit complicated in distribution.
Can you also let me know your Linux distro? The string from `uname -a` will help me prepare the correct package for QEMU.

Reply 28 of 236, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

@OSH
Use the following registry to scale old Direct3D games with only 640x480 and play at any resolution.
Here's the example for X-Wing vs Tie Fighter (1998) Windows 98.

REGEDIT4

[-HKEY_CURRENT_USER\Software\Wine]
[HKEY_CURRENT_USER\Software\Wine\AppDefaults\z_xvt__.exe\Direct3D]
"ScaleWindow"=dword:828001e0
"UseGLSL"="disabled"

[HKEY_CURRENT_USER\Software\Wine\Direct3D]
"VideoMemorySize"="256"
"SwapInterval"=dword:0

You can use the example and expand from there to many other Direct3D games that only have limited resolution selection. "ScaleWindow" defines the window size to scale. WxH are encoded as [30:16]x[15:0]. [31] will apply bi-linear filtering.

Reply 30 of 236, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

@OSH I hope everything has gone well from your testing. Since I didn't actually tested with X-Wing with 3D acceleration but XvT, I wonder if you could leave a note to confirm it is working for my own record. I will take X-Wing as one of the 3 elected games, you still have option to elect 2 more games for me to spend time in qualifying them.

As a side note of how Ubuntu package was tested, I actually tested with nested QEMU for all Glide, OpenGL and D3D on my ArchLinux Ryzen APU laptop. I tested DOS Glide Screamer 2, Quake3 OpenGL and Moto Racer 1 D3D.

nestedVM.png
Filename
nestedVM.png
File size
984.99 KiB
Views
539 views
File comment
Nested VMs
File license
Fair use/fair dealing exception

This is an ArchLinux host running Ubuntu 20.04.2 guest in QEMU and another QEMU in Ubuntu guest running Win98 guest. The 3D APIs traverse from Glide/MESAGL pass-through to QEMU virgil3D OpenGL to Host OpenGL. It is so amazing. There was some performance penalty with nested VMs, but for light 3D games, they are still perfectly playable. Contrary to other PC emulators, Quake3, Half-Life 1 and Unreal 1/UT99 alike are all considered light 3D for QEMU KVM .... 🤣

Oh yeah, the nested QEMU on Ubuntu guest was booting off Win98 disk image on the host through "Slirp" user networking with SAMBA/CIFS mapped shared folder. No need to inject another OS image into Ubuntu guest image, how nice!

It has always been QEMU's goal to be able to emulate itself from day one even before hardware virtualization was available. This is just a testament to its capabilities.

@OSH Finally, I wish you enjoy your "Road to QEMU" and gladly leave testimonials on your experience to game with QEMU. 😉 You are a pioneer in "run virtually, play anywhere" ditto.

Reply 31 of 236, by OSH

User metadata
Rank Member
Rank
Member

Thanks kjliew! I have too much work lately, but when I have free time, I will definitely check this out!

So, finally I found some time to configure QEMU. I had some problems, but now everything works. 3D acceleration too, but not with X-Wing / XVT. If I'm trying to play original XvT from 1997, after try to launch a mission I have instant CTD., without any messages. If I try launch X-Wing Flight School (special version for X-Wing Collector Series), game starts but I see a message „Unable to find 3D Hardware”. I do something wrong, but I'm not sure what. wglgears.exe and test04.exe works, all Glide.dll , fxmemmap.vxd copied to C:\Windows\System, glide2x.ovl copied to C:\Windows, opengl32.dll copied into game's directory, OpenGlide on Ubuntu installed…
@kJliew, do you have any suggestions?

Reply 32 of 236, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

Can you show me the content of folder listing of the game installation? You can post the screenshot of explorer.
Assuming you have the right version of XvT/X-Wing re-releases that support Direct3D, they are DirectX 5.2 and require to be played with joystick. You can't play them with just keyboard & mouse.

Did you copy ddraw.dll and wined3d.dll into the game installed folder?

It is also important to follow ddthru.txt instructions to install a special pass-through version of ddraw.dll. It prevents Win98 from pinning ddraw.dll into memory. Once Win98 pinned the DLL into memory, wined3d failed to work because the WINE version of ddraw.dll will never be loaded and games looking for Direct3D acceleration will fail with "Unable to find 3D hardware". You will have to restart Win98 to remove DLL pinned into memory.

Last edited by kjliew on 2021-04-25, 23:38. Edited 1 time in total.

Reply 33 of 236, by OSH

User metadata
Rank Member
Rank
Member

Of course. First two screenshots comes from original XVT 1.0.0.1, next two from XVT Flight School and fifth is my Windows\System directory. Which size should have all Glide.dll files?

Attachments

  • 1.jpg
    Filename
    1.jpg
    File size
    163.1 KiB
    Views
    447 views
    File license
    Fair use/fair dealing exception
  • 2.jpg
    Filename
    2.jpg
    File size
    179.71 KiB
    Views
    447 views
    File license
    Fair use/fair dealing exception
  • 3.jpg
    Filename
    3.jpg
    File size
    167.26 KiB
    Views
    447 views
    File license
    Fair use/fair dealing exception
  • 4.jpg
    Filename
    4.jpg
    File size
    167.03 KiB
    Views
    447 views
    File license
    Fair use/fair dealing exception
  • 5.jpg
    Filename
    5.jpg
    File size
    162.47 KiB
    Views
    447 views
    File license
    Fair use/fair dealing exception

Reply 34 of 236, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

[wrapfx]
These are the guest stubs. They do 1st-party Glide pass-through. You place them in C:\WINDOWS\SYSTEM.

[openglide]
These are OpenGlide WIN32 for 3rd-party Glide pass-through. It is recommended to place them into game installed folder *ONLY* if you need to. Otherwise, 1st-party Glide pass-through is preferred. There are better Glide wrappers for 3rd-party pass-through, such as Zeckensack's GlideWrapper.

[g2xwrap]
These are specialty wrappers to wrap Glide 2.1 or Glide3x into Glide2x regardless of 1st-party or 3rd-party pass-through. They enables legacy Glide 2.1 games on Glide wrappers that do not support the old Glide APIs. For eg. Pandenomium! on OpenGlide or Mechwarriors 2 3Dfx on Zeckensack's GlideWrapper. Zeckensack's GlideWrapper Glide3x implementation seemed to be buggy & incomplete, so Glide3x wrapper was created specifically and tested with it extensively to enable games such as Diablo II 3Dfx and NFS5 Porsche Unleashed Glide3x Voodoo2 3rash render DLL.

1st Party vs 3rd-Party
Check out Guide to Windows 98 VM Setup on QEMU - Take #2

Can you do a "C:\WINDOWS> dir /s ddraw*.*"?

The following example shows how it should look like on Windows 98.
------------------------------------------------------------------
Volume in drive C is WIN98
Volume Serial Number is XXXX-XXXX

Directory of C:\WINDOWS\SYSBCKUP

DDRAW DLL 18,432 03-03-21 8:39p ddraw.dll
DDRAWWQ DLL 384,000 02-28-21 7:59p DDRAWWQ.DLL

Directory of C:\WINDOWS\SYSTEM

DDRAW DLL 18,432 03-03-21 8:39p ddraw.dll
DDRAWWQ DLL 384,000 12-12-02 12:14a DDRAWWQ.DLL

------------------------------------------------------------------
Last edited by kjliew on 2021-04-26, 01:38. Edited 1 time in total.

Reply 35 of 236, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

One should also pay attention to QEMU console logs. WineD3D will output lots and lots of messages because it enumerates OpenGL capabilities at startup to map into Direct3D. Pure OpenGL/3Dfx Glide typically outputs much less and simple logs.

Pure OpenGL is always 1st-party pass-through.
3Dfx Glide could be the center of confusion when one wasn't familiar with what to choose.

When Glide as 1st-party pass-through, it outputs glidept trace.

glidept: DLL loaded - glide2x.dll
trace: _grGlideInit@0 called
glidept: 6833fdf-22:10:09 Apr 17 2021 build WRAPFX32
wr2x_trace: _grSstQueryHardware@4
wr2x_trace: _grSstSelect@4
glidept: grSstWinOpen called, fmt 0 org 1 buf 2 aux 1 gLfb 0xdcc79000
glidept: LFB mode is Shared Memory (fast), One-copy
window 1024x768 (scaled)
300 frames in 5.0 seconds, 59.9 FPS
...
glidept: grSstWinClose called
glidept: grGlideShutdown called, fifo 0x5d83 data 0x40c04 shm 0x0143010 lfb 0xfb000000
glidept: GrState 0 VtxLayout 0
glidept: DLL unloaded

When Glide as 3rd-party pass-through, it outputs mesapt trace.

mesapt: DLL loaded
glcntx: ChoosePixelFormat() fmt 0x0a
glcntx: PixFmt 0x0a nAux 4 nSamples 0 0
glcntx: SetPixelFormat() fmt 0x0a ret 1
glcntx: DescribePixelFormat() dwFlags:00008225
cColorbits:32 cDepthBits:24 cStencilBits:08 ARGB8888
cAlphaShift:24 cRedShift:16 cGreenShift:08 cBlueShift:00
mesapt: wglCreateContext cntx 0 curr 0
mesapt: wglMakeCurrent cntx 1 curr 0 lvl 0
mesapt: 6833fdf-22:08:34 Apr 17 2021 build WRAPGL32
mesapt: VertexArrayCache 32MB
mesapt: DispTimerSched 2000ms
mesapt: MappedBufferObject One-copy
mesapt: Guest GL Extensions pass-through for Year ALL Length ANY
mesapt: GeForce GT 730/PCIe/SSE2 [ 25 ]
mesapt: NVIDIA Corporation [ 19 ]
mesapt: GeForce GT 730/PCIe/SSE2 [ 25 ]
mesapt: 4.6.0 NVIDIA 456.71 [ 20 ]
mesapt: 4.6.0 NVIDIA 456.71 [ 20 ]
300 frames in 5.0 seconds, 60.0 FPS
...
mesapt: wglDeleteContext cntx 1 curr 1 lvl 0
mesapt: VertexArrayStats: elemMax 000000 vertexCache 0000
mesapt: MGLStats: fifo 0x0029320 data 0x003fbde
mesapt: DLL unloaded

Reply 36 of 236, by OSH

User metadata
Rank Member
Rank
Member

Of course, but the message says: "file not found".
If I copy your ddraw.dll into C:\Windows\System and rename original ddraw.dll as ddrawwq.dll (the same in SYSBCKP), XvT won't start at all.

Attachments

  • 6.jpg
    Filename
    6.jpg
    File size
    28.67 KiB
    Views
    405 views
    File license
    Fair use/fair dealing exception

Reply 37 of 236, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

Can you run dxdiag and show the content of DirectX Files tab?
Did you install DirectX 9.0 runtime for Windows 98? You can get it from Microsoft Security Update CD 2004 which has been archived here at VOGONS.

This is how it should look like from my Win98 VM.

dxdiag.png
Filename
dxdiag.png
File size
46.86 KiB
Views
380 views
File license
Fair use/fair dealing exception
Filename
ddraw.png
File size
11.54 KiB
Downloads
No downloads
File license
Fair use/fair dealing exception
Last edited by kjliew on 2021-04-26, 23:09. Edited 1 time in total.

Reply 38 of 236, by OSH

User metadata
Rank Member
Rank
Member

I installed it now, but didn't help. Here screenshots:

Attachments

  • 11.jpg
    Filename
    11.jpg
    File size
    104.65 KiB
    Views
    381 views
    File license
    Fair use/fair dealing exception
  • 10.jpg
    Filename
    10.jpg
    File size
    112.47 KiB
    Views
    381 views
    File license
    Fair use/fair dealing exception
  • 9.jpg
    Filename
    9.jpg
    File size
    107.7 KiB
    Views
    381 views
    File license
    Fair use/fair dealing exception
  • 8.jpg
    Filename
    8.jpg
    File size
    110.52 KiB
    Views
    381 views
    File license
    Fair use/fair dealing exception
  • 7.jpg
    Filename
    7.jpg
    File size
    112.03 KiB
    Views
    381 views
    File license
    Fair use/fair dealing exception

Reply 39 of 236, by OSH

User metadata
Rank Member
Rank
Member

and second part
The message says: ddraw.dll isn't properly installed in Windows directory and should be deleted.

Attachments

  • 14.jpg
    Filename
    14.jpg
    File size
    107.69 KiB
    Views
    381 views
    File license
    Fair use/fair dealing exception
  • 13.jpg
    Filename
    13.jpg
    File size
    108.88 KiB
    Views
    381 views
    File license
    Fair use/fair dealing exception
  • 12.jpg
    Filename
    12.jpg
    File size
    108.75 KiB
    Views
    381 views
    File license
    Fair use/fair dealing exception