VOGONS


QEMU 3Dfx Glide Pass-Through

Topic actions

Reply 60 of 236, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie
Bladeforce wrote on 2021-06-04, 08:32:

The latest Wine runs it fine with 3d acceleration.

It's great to hear that, Thanks! I only ported several Wine versions optimized for QEMU and out of them only the old versions work, which was old enough that WineD3D was based on XPDM instead of WDDM. When Wine-6.0 stable gets its next point release, I will port the version and provide free upgrade for all the donors of qemu-3dfx. I am sorry to say that you barked up the wrong tree, PCem does not use Wine. The better latest Wine runs Windows games, so does QEMU or Boxedwine. PCem is simply out in the cold ... ouch.🤣

If your goal is to let everyone know that they don't need QEMU to play games, then it is perfectly fine with me. It has always been that way, we have dgVoodoo2, nGlide, dxwrappers, Wine/DXVK on Linux and all kinds of other ways, as long as they work, be my guest. QEMU has never been the only way to play a game, it has always been one of the ways. If it was so unfortune that it is the only way for M1, then just don't buy an M1. Isn't that simple?

Bladeforce wrote on 2021-06-04, 08:32:

I am really curious as to your personal distaste of pcem. Sarah walker has done amazing work on that project and yet every other post of yours has to diss pcem. Lack of class man

Intel has served the high-tech industry well for decades and yet every M1 press & YouTube video review has never stopped humiliating the company. Isn't this a way of life the world we live today? I am not pointing to the author of PCem, but true lack of class and spread of falsehood are those who downplayed the importance of key technology that they don't have. I won't go too far this time to annoy the moderator.

Reply 61 of 236, by CybeREX

User metadata
Rank Newbie
Rank
Newbie

Hello. The first, thanks for develop option to play old games on modern HW!
But I need little help with compiling qemu-3dfx. Can someone point me to the right way? When I go step by step guide "Building QEMU" I got this error (Linux machine)

[2172/8432] Compiling C object libqemu-alpha-softmmu.fa.p/hw_alpha_pci.c.o
[2173/8432] Compiling C object libqemu-alpha-softmmu.fa.p/target_alpha_translate.c.o
[2174/8432] Compiling C object libqemu-alpha-softmmu.fa.p/meson-generated_.._qapi_qapi-types-misc-target.c.o
[2175/8432] Compiling C object libqemu-alpha-softmmu.fa.p/meson-generated_.._qapi_qapi-visit-machine-target.c.o
[2176/8432] Compiling C object libqemu-alpha-softmmu.fa.p/meson-generated_.._qapi_qapi-introspect.c.o
[2177/8432] Compiling C object libqemu-alpha-softmmu.fa.p/meson-generated_.._qapi_qapi-visit.c.o
[2178/8432] Compiling C object libqemu-alpha-softmmu.fa.p/meson-generated_.._qapi_qapi-events-machine-target.c.o
[2179/8432] Compiling C object libqemu-alpha-softmmu.fa.p/meson-generated_.._qapi_qapi-commands-machine-target.c.o
[2180/8432] Compiling C object libqemu-alpha-softmmu.fa.p/meson-generated_.._qapi_qapi-types.c.o
[2181/8432] Linking target qemu-system-aarch64
FAILED: qemu-system-aarch64
c++ @qemu-system-aarch64.rsp
/usr/bin/ld: libcommon.fa.p/hw_mesa_mglcntx_linux.c.o: in function `MGLUpdateGuestBufo':
/home/old-games/myqemu/qemu-3dfx/qemu-5.2.0/build/../hw/mesa/mglcntx_linux.c:50: undefined reference to `kvm_update_guest_pa_range'
/usr/bin/ld: libcommon.fa.p/hw_3dfx_glidewnd.c.o: in function `glide_mapbufo':
/home/old-games/myqemu/qemu-3dfx/qemu-5.2.0/build/../hw/3dfx/glidewnd.c:86: undefined reference to `kvm_update_guest_pa_range'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
make[1]: *** [Makefile:171: run-ninja] Error 1
make[1]: Leaving directory '/home/old-games/myqemu/qemu-3dfx/qemu-5.2.0/build'
make: *** [GNUmakefile:11: all] Error 2

Reply 63 of 236, by CybeREX

User metadata
Rank Newbie
Rank
Newbie

Thanks. I compile it with "-x86_64-softmmu" and it works!
also works add "--target-list=" to the end of line
"../qemu-5.2.0/configure && make --target-list="

but in next steps where you need compile Guest Wrappers got another error...

 ~/myqemu/qemu-3dfx/wrappers/3dfx/build  make && make clean
Error: MSYSTEM ==
make: *** [Makefile:62: fxlib] Error 1

What is fxlib? Searched my repository but didn't find anything similar...

Reply 64 of 236, by mr.cat

User metadata
Rank Member
Rank
Member

Well, fxlib is included with the wrappers source.
If you take a look at the Makefile it's quite obvious where this error message comes from (it's checking the environment variable MSYSTEM, expecting the value "MINGW32" there, but the var is empty).
I used to just edit the hell out of Makefiles until they bend to my will, but perhaps there are better ways to resolve this?

If you feel like experimenting you can ofc set that manually, just add MSYSTEM="MINGW32" in front of whatever command you're using. It will then most likely go through and bump into the next problem...

Reply 65 of 236, by Bruninho

User metadata
Rank Oldbie
Rank
Oldbie

I saw he did manage to compile for a M1 Mac on another thread, which is exactly what I want for the next (M?) Mac I will get, however while I am still using an Intel Mac for the next months, I tried for Intel Mac... no luck. Can't figure out why. *sighs*

"Design isn't just what it looks like and feels like. Design is how it works."
JOBS, Steve.
List of ALL Android vulnerabilities
Right to Repair sucks and is illegal!

Reply 66 of 236, by CybeREX

User metadata
Rank Newbie
Rank
Newbie

Thank you mr.cat for helping and pointing me to the solution!

OK next problem is to add to make file lines
-Wno-pointer-to-int-cast -Wno-int-to-pointer-cast

CFLAGS=-I$(QEMU_SRC_DIR)/hw/3dfx -I$(FXLIB) -D__REV__=\"$(GIT)\" -Werror -msse2 -O3 -flto -fomit-frame-pointer -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast

but I get something again) Any help to point to the right way?)

$ make && make clean
CC fxhook.o fxlib9x.o fxlibnt.o
../../fxlib/fxlib9x.c: In function ‘fxMapLinear’:
../../fxlib/fxlib9x.c:35:23: error: initialization of ‘LPDWORD’ {aka ‘unsigned int *’} from incompatible pointer type ‘FxU32 *’ {aka ‘long unsigned int *’} [-Werror=incompatible-pointer-types]
35 | LPDWORD pPhysical = Physical;
| ^~~~~~~~
../../fxlib/fxlib9x.c:36:21: error: initialization of ‘LPDWORD’ {aka ‘unsigned int *’} from incompatible pointer type ‘FxU32 *’ {aka ‘long unsigned int *’} [-Werror=incompatible-pointer-types]
36 | LPDWORD pLinear = Linear;
| ^~~~~~
../../fxlib/fxlib9x.c:44:21: error: passing argument 7 of ‘DeviceIoControl’ from incompatible pointer type [-Werror=incompatible-pointer-types]
44 | &nret, NULL);
| ^~~~~
| |
| FxU32 * {aka long unsigned int *}
In file included from /usr/include/w32api/winbase.h:21,
from /usr/include/w32api/windows.h:70,
from ../../fxlib/fxlib9x.c:1:
/usr/include/w32api/ioapiset.h:22:175: note: expected ‘LPDWORD’ {aka ‘unsigned int *’} but argument is of type ‘FxU32 *’ {aka ‘long unsigned int *’}
22 | WINBASEAPI WINBOOL WINAPI DeviceIoControl (HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlap
| ~~~~~~~~^~~~~~~~~~~~~~~
../../fxlib/fxlib9x.c: In function ‘fxSetPermission’:
../../fxlib/fxlib9x.c:84:26: error: passing argument 7 of ‘DeviceIoControl’ from incompatible pointer type [-Werror=incompatible-pointer-types]
84 | &nRet, NULL);
| ^~~~~
| |
| FxU32 * {aka long unsigned int *}
In file included from /usr/include/w32api/winbase.h:21,
from /usr/include/w32api/windows.h:70,
from ../../fxlib/fxlib9x.c:1:
/usr/include/w32api/ioapiset.h:22:175: note: expected ‘LPDWORD’ {aka ‘unsigned int *’} but argument is of type ‘FxU32 *’ {aka ‘long unsigned int *’}
22 | WINBASEAPI WINBOOL WINAPI DeviceIoControl (HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlap
| ~~~~~~~~^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:43: fxlib] Error 1

Reply 67 of 236, by mr.cat

User metadata
Rank Member
Rank
Member

Yup like I said there's the next one...😁

That one doesn't ring a bell right away but one thing to pay attention to here is the compiler, there are multiple toolchains that are utilized.
In the case of the wrappers, you're supposed to be doing cross-crompiling (there's even some DOS stuff in there!).

Now the log doesn't show where the CC variable points to (you can always set it yourself, also make has the parameter -n that can be used to find out).
I should emphasize that I'm not suggesting this is definitely the answer to this specific problem, but it's one of the things to be aware of.

Reply 68 of 236, by CybeREX

User metadata
Rank Newbie
Rank
Newbie

1) Wrappers
Finally compiled something - is it correct?
glide.dll (88kb)
glide2x.dll (89kb)
glide3x.dll (90kb)
opengl32.dll (597kb)

2) Qemu build seems broken, I run from scratch again and stuck at this error

The Meson build system
Version: 0.55.3
Source dir: /home/retro/myqemu/qemu-3dfx/qemu-5.2.0
Build dir: /home/retro/myqemu/qemu-3dfx/build
Build type: native build

../qemu-5.2.0/meson.build:1:0: ERROR: Program or command 'head' not found or not executable

A full log can be found at /home/retro/myqemu/qemu-3dfx/build/meson-logs/meson-log.txt

ERROR: meson setup failed

Build type: native build
'utf-8' codec can't decode byte 0x90 in position 2: invalid start byte
Unusable script '/usr/bin/head'

../qemu-5.2.0/meson.build:1:0: ERROR: Program or command 'head' not found or not executable

Reply 69 of 236, by mr.cat

User metadata
Rank Member
Rank
Member

Congrats!
1) They're probably OK if you got that far (my old ones are bigger, but maybe there's unstripped debug info or something).
2) head not found 🤣
I don't know meson that well, but that's a really weird thing to happen on a Linux system if such a basic utility as "head" can't be used...can elaborate which Linux distro this is?
The error message originates from Python, so python version could be something to check (incompatibility between python2 and python3?).
But since you've already built it once it's unlikely to have anything to do with that. More likely is that you have some leftovers in your environment or the build directories.
For example, if you have set environment variables for cross-compiling, they should be removed before attempting to build qemu (it says native though).

In my experience building qemu was actually the easy part and when in doubt, you can always just start over. But any leftover old cruft can easily mess that up.

Reply 70 of 236, by Bruninho

User metadata
Rank Oldbie
Rank
Oldbie

Finally managed to compile qemu-3dfx targeting i386 and x86_64 using a Linux machine I had, however when I proceed to try and compile the guest wrappers, I have the same error as above mentioned, regarding fxlib. How to fix this so I can complete the compilation for my Ubuntu build?

EDIT: Alright, I think I managed (not without some $#*$#* obstacles) to make the wrappers, except for FXMEMMAP.VXD, OPENGL32.DLL and GLIDE2X.OVL ... not sure why it didn't...

"Design isn't just what it looks like and feels like. Design is how it works."
JOBS, Steve.
List of ALL Android vulnerabilities
Right to Repair sucks and is illegal!

Reply 71 of 236, by CybeREX

User metadata
Rank Newbie
Rank
Newbie

OK I tried compile Qemu 3dfx on windows as alter method.
I use ../qemu-5.2.0/configure && make CC=i386-windows-gcc
and here what I miss))

Program sh found: YES
Program python3 found: YES (/usr/bin/python3.exe)
C++ compiler for the host machine: c++ (gcc 10.2.0 "c++ (GCC) 10.2.0")
C++ linker for the host machine: c++ ld.bfd 2.36.1
Program cgcc found: NO
Library m found: YES
Library util found: YES
Run-time dependency appleframeworks found: NO (tried framework)
Found pkg-config: /usr/bin/pkg-config (1.7.4)
Run-time dependency pixman-1 found: NO (tried pkgconfig)

../qemu-5.2.0/meson.build:302:2: ERROR: Dependency "pixman-1" not found, tried pkgconfig

Program cgcc found: NO
Run-time dependency appleframeworks found: NO (tried framework)
Run-time dependency pixman-1 found: NO (tried pkgconfig)
ERROR: Dependency "pixman-1" not found, tried pkgconfig

Reply 72 of 236, by CybeREX

User metadata
Rank Newbie
Rank
Newbie
Bruninho wrote on 2021-07-08, 02:10:

wrappers, except for FXMEMMAP.VXD, OPENGL32.DLL and GLIDE2X.OVL ... not sure why it didn't...

FXMEMMAP.VXD and GLIDE2X.OVL is from voodoo1 drivers files

OPENGL32.DLL I get from mesa compiling (like 3dfx compiling wrappers)

btw I'm able to compile it on windows 10 machine with MSYS2 MinGW 32-bit.exe (MSYS2)

Reply 73 of 236, by mr.cat

User metadata
Rank Member
Rank
Member

Please note that you need to compile GLIDE2X.OVL yourself, but that's only if you're interested in trying out DOS titles (DOSBox may serve you better there).
You can find it in the wrappers/3dfx/ovl directory (needs Watcom toolchain to build).

The kernel drivers (fxmemmap.vxd and fxptl.sys) are provided as hex files in the wrappers/3dfx/drv directory, but you can also use the originals (they can be found in multiple Glide SDK/Voodoo driver packages).

Reply 75 of 236, by mr.cat

User metadata
Rank Member
Rank
Member

Maybe related:
A troubleshooting guide for Caluser2000.

Yeah trying-and-failing is the way to do it in Linux, if you're lucky you may pick up some crumbs of knowledge on the way...
It's actually a lot better nowadays, I can't remember when I last compiled my own custom kernel 😁

If you find any clear answers to the problems you had, it would be great if you can find time to edit in an explanation, you know, for future reference.
Good luck with your endeavours!

Last edited by mr.cat on 2021-07-08, 12:11. Edited 1 time in total.

Reply 76 of 236, by CybeREX

User metadata
Rank Newbie
Rank
Newbie

Funny picture) Yes I know, I'm not programmer and can't write cool things like qemu3Dfx. I respect people that can do great things with code. But I even don't able to compile it from source code 🤣. But every time I trying, I found something new and found next blocking thing so here is nice to have people on forums that helping guide to the next point)

btw compiling still going but this time only 1371 steps . Previous was [1977/5155] and fail...

Reply 77 of 236, by Bruninho

User metadata
Rank Oldbie
Rank
Oldbie
mr.cat wrote on 2021-07-08, 08:21:

Please note that you need to compile GLIDE2X.OVL yourself, but that's only if you're interested in trying out DOS titles (DOSBox may serve you better there).
You can find it in the wrappers/3dfx/ovl directory (needs Watcom toolchain to build).

The kernel drivers (fxmemmap.vxd and fxptl.sys) are provided as hex files in the wrappers/3dfx/drv directory, but you can also use the originals (they can be found in multiple Glide SDK/Voodoo driver packages).

I get it, but the problem is that I do not have the watcom toolchain for linux and/or no clue on how to install it for Ubuntu. This is the only obstacle at the moment before I proceed to testing the entire build with my Qemu VMs and games.

"Design isn't just what it looks like and feels like. Design is how it works."
JOBS, Steve.
List of ALL Android vulnerabilities
Right to Repair sucks and is illegal!

Reply 78 of 236, by mr.cat

User metadata
Rank Member
Rank
Member

Well Bruninho my dude if that's the only obstacle you're almost there, time to stop sighing and get cracking? 😀
Here's couple of pointers for ya.

Although I can't remember the procedure very well myself (it's been a while) it looks like you can't just sudo apt install your way to Watcom. I think I got the Linux binaries here:
https://github.com/open-watcom/open-watcom-v2

and installed them to /opt.
Yikes! Executing binary blobs from the big bad internet!
If you're paranoid about that, I guess the right thing to do is to examine the source line-by-line, and compile it yourself...

Now to actually use them, you first need to make up your mind on what kind of binaries you want to build, and set the environment variables accordingly.
Arch Linux help pages can help you with that:
https://wiki.archlinux.org/title/Open_Watcom

It's quite likely that the Makefiles need some minor adjusting (directories etc.).

Reply 79 of 236, by Bruninho

User metadata
Rank Oldbie
Rank
Oldbie

I thought I had success but apparently not. the games will not run. Well, I got fed up of wasting time on it, I give up.

"Design isn't just what it looks like and feels like. Design is how it works."
JOBS, Steve.
List of ALL Android vulnerabilities
Right to Repair sucks and is illegal!