VOGONS


Reply 20 of 30, by thp

User metadata
Rank Newbie
Rank
Newbie

Thanks to some help in the OpenWatcom Discord, I got the DOS Glide build to build with 2.43 (needed to pass in the NOCASEEXACT option to the Watcom linker, as the glide2x.lib symbols are all uppercase), if anybody wants to give it a try (needs glide2x.ovl, either in the system directories or in the same folder as the exe).

Attachments

  • Filename
    dzze3dfx.exe
    File size
    184.21 KiB
    Downloads
    12 downloads
    File comment
    Yet another try at DOS Glide
    File license
    Fair use/fair dealing exception

Reply 21 of 30, by Gmlb256

User metadata
Rank Oldbie
Rank
Oldbie
thp wrote on 2021-10-11, 15:44:

Thanks to some help in the OpenWatcom Discord, I got the DOS Glide build to build with 2.43 (needed to pass in the NOCASEEXACT option to the Watcom linker, as the glide2x.lib symbols are all uppercase), if anybody wants to give it a try (needs glide2x.ovl, either in the system directories or in the same folder as the exe).

This 3Dfx DOS versions works without the freezing the computer, however the sounds are a bit distorted.

Reply 22 of 30, by thp

User metadata
Rank Newbie
Rank
Newbie

Here's the final build. As the behavior of real hardware vs Glide Wrappers (PCem/DOSBox-X/nGlide) was different, I actually got myself a Voodoo Graphics board this week to test it myself, and it works at 60 FPS on my K6-II 500 MHz.

Download below.

Screenshots:

Screenshot 2021-10-15 at 20.13.58.png
Filename
Screenshot 2021-10-15 at 20.13.58.png
File size
186.35 KiB
Views
265 views
File comment
OSMesa (OpenGL) VGA title screen, with dithering
File license
CC-BY-4.0
Screenshot 2021-10-15 at 20.13.43.png
Filename
Screenshot 2021-10-15 at 20.13.43.png
File size
160.34 KiB
Views
265 views
File comment
Custom rasterizer VGA title screen
File license
CC-BY-4.0
Screenshot 2021-10-15 at 20.13.32.png
Filename
Screenshot 2021-10-15 at 20.13.32.png
File size
140.72 KiB
Views
265 views
File comment
Text mode (80x43) EGA/VGA title screen
File license
CC-BY-4.0
Screenshot 2021-10-15 at 20.13.20.png
Filename
Screenshot 2021-10-15 at 20.13.20.png
File size
152.41 KiB
Views
265 views
File comment
Custom rasterizer EGA title screen
File license
CC-BY-4.0

Some pitfalls / learnings from the Glide porting:

  • One can poll grBufferNumPending() and avoid overfilling the FIFO (wait until there are no pending buffers)
  • Vertices are snapped to a 0.0625f pixel grid, the CPU rounding could be slightly different than what the graphics chip does and can cause hangs/delays (I do it the naive way and multiply it by 16, convert to long, then convert back to float and divide by 16, which the Glide Manual says exactly not to do because of performance reasons, but hey, works well enough in my tests)
  • OpenWatcom needs the NOCASEEXACT linker option to link against glide2x.lib from the Glide DOS SDK

This new build adds a 16-color EGA version of the software rasteriser (EGA vs VGA is detected automatically, use "ega" (lowercase, without the quotes) to force the 16-color mode on VGA boards. Also, a super weird EGA/VGA text mode version for really old computers (16 colors, 80x43 "resolution"). And zyzzle gets 128 lives by just passing their username as first command line parameter.

That's it: The Glide version works, and the VGA software rasterizer turned out pretty nice, and I learned a lot about Glide, OpenWatcom, DOS overlays, OpenGL on Windows 95 and new Win32 API features. Also about EGA's planar mode, detecting CGA vs EGA vs VGA and implementing a crappy 16-color text mode rasterizer. Also, 8-bit Sound Blaster audio output under DOS. A small multi-weekend project coming to a close 😀

Version 1.2 (2021-10-15)
------------------------

- Glide port: Use grBufferNumPending() and vertex snapping to 0.0625f
- Reintroduce the DOS 3Dfx port using Glide 2.43 and wlink's NOCASEEXACT
- Allow pressing "SPACE" only after the intro has finished playing
- Win32/OpenGL: Add logging support, make bpp/depth/stencil configurable
- Allow ports to customize the font scaling (fixes text alignment)
- Add cheat command line argument to have more lives (name of requester)
- 16-color EGA mode support for DZZESFTW.EXE (force using "ega" option)
- New "mode 4350" build (DZZE4350.EXE) without sound, using text mode

Attachments

  • Filename
    DZZEE12R.ZIP
    File size
    1.45 MiB
    Downloads
    19 downloads
    File comment
    Added EGA support, fixed Glide rendering
    File license
    Fair use/fair dealing exception

Reply 23 of 30, by Gmlb256

User metadata
Rank Oldbie
Rank
Oldbie

Great that you ironed out the problems and learned something new with Glide! 😀

I know that this is final build, but I've noticed that the sound quality with the DOS 3Dfx version is not on par with the other ones having some annoying clicks when playing samples. Besides this, could be possible to add 800x600 and 1024x768 (for those using SLI on Voodoo2 cards) resolutions on the 3Dfx version?

Reply 24 of 30, by thp

User metadata
Rank Newbie
Rank
Newbie
Gmlb256 wrote on 2021-10-15, 19:19:

I know that this is final build, but I've noticed that the sound quality with the DOS 3Dfx version is not on par with the other ones having some annoying clicks when playing samples. Besides this, could be possible to add 800x600 and 1024x768 (for those using SLI on Voodoo2 cards) resolutions on the 3Dfx version?

About the sound quality, I unfortunately don't have time to dig into, it might be related to the library I'm using (SMIXW v1.30 on DOS) or a signed/unsigned 8-bit WAV mismatch.

About the resolutions: Sure, why not. Attached the two Glide builds (DOS/Windows) that now accept as command-line arguments either "1024x768", "800x600, "640x480" or "320x240" (defaulting to 640x480). You can either type these in the command line or create a batch file:

dzew3dfx 1024x768

Or for the DOS version:

dzze3dfx 800x600

Attachments

  • Filename
    dzze3dfx.exe
    File size
    184.63 KiB
    Downloads
    9 downloads
    File comment
    Dzzee 1.2 DOS Glide + resolution setting
    File license
    Fair use/fair dealing exception
  • Filename
    dzew3dfx.exe
    File size
    61 KiB
    Downloads
    25 downloads
    File comment
    Dzzee 1.2 Win Glide + resolution setting
    File license
    Fair use/fair dealing exception

Reply 25 of 30, by thp

User metadata
Rank Newbie
Rank
Newbie

In related news, homebrew ports to 3DS and Vita as well as a "modern" Windows version utilizing OpenGL and SDL2 are now available on Itch.io too: https://thp.itch.io/dzzee (the "retro" build is the same as the version available here).

Reply 26 of 30, by Gmlb256

User metadata
Rank Oldbie
Rank
Oldbie
thp wrote on 2021-10-17, 15:31:
About the resolutions: Sure, why not. Attached the two Glide builds (DOS/Windows) that now accept as command-line arguments eith […]
Show full quote

About the resolutions: Sure, why not. Attached the two Glide builds (DOS/Windows) that now accept as command-line arguments either "1024x768", "800x600, "640x480" or "320x240" (defaulting to 640x480). You can either type these in the command line or create a batch file:

dzew3dfx 1024x768

Or for the DOS version:

dzze3dfx 800x600

Thanks for the additional Glide resolutions!

Reply 27 of 30, by Stiletto

User metadata
Rank l33t++
Rank
l33t++
thp wrote on 2021-10-15, 18:19:

As the behavior of real hardware vs Glide Wrappers (PCem/DOSBox-X/nGlide) was different

Cool project!

Ostensibly speaking as a project manager for the old OpenGlide Glide wrapper, and having communicated with Glidos (OpenGlide), Dege (dgVoodoo2 and ye olde dgVoodoo), and Zeus (nGlide) frequently in the past, I am sure we'd all be interested in what can be done to bring things in line with actual hardware. (Also, sounds like you didn't try Dege's dgVoodoo2.)

PCem is, BTW, a lower-level emulation of Voodoo hardware than an API wrapper. It's intended to simulate the real silicon.

DOSBox-X, I believe, offers both a lower-level Voodoo emulation, or an API Glide wrapper, as options. When using the wrapper, you should be able to swap out the one it comes with (probably OpenGlide) with nGlide or dgVoodoo2.

Someday you should be able to obtain a similar to PCem experience using MAME (first to create a low level Voodoo Graphics/Voodoo2/etc. emulation), but its emulation of PCI-bus PC hardware is still spotty.

"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto

Reply 28 of 30, by thp

User metadata
Rank Newbie
Rank
Newbie
Stiletto wrote on 2021-10-17, 22:57:

Ostensibly speaking as a project manager for the old OpenGlide Glide wrapper, and having communicated with Glidos (OpenGlide), Dege (dgVoodoo2 and ye olde dgVoodoo), and Zeus (nGlide) frequently in the past, I am sure we'd all be interested in what can be done to bring things in line with actual hardware. (Also, sounds like you didn't try Dege's dgVoodoo2.)

Since for the last version I made that made it work, I did two things at once, I'm not sure which one made it work (it might be that both, or just one of them, or neither of them, caused the issue to go away, I didn't bisect it further):

  • Vertex snapping (as described in the "Floating Point Vertex Snapping and Area Calculations" section in the Glide 2.2 Programming Guide)
  • Poll grBufferNumPending() -- in case it overfills the FIFO

If it was just the vertex snapping, it can probably be reproduced by using a 16-bit fixed-point (12.4) bits representation for the emulated hardware part (FBI), from the Glide docs:

A potential inconsistency may arise between Glide ́s and the Voodoo Graphics hardware ́s perception of area and vertex values when Glide ́s floating point values change upon conversion to the hardware ́s fixed point <12.4> representation

If it was the overfilling of the FIFO, limiting the FIFO is probably one option, but then everything has to be cycle-accurate including the PCI bus, and the issue might of course only happen depending on how fast the CPU feeds the FIFO, so might not have been visible on era-accurate pairings of CPUs and Voodoos.

The vertex snapping is something that I'd consider "good" to have for accuracy, since it can affect the visual output (if you want to reproduce what the SST-1 does pixel perfect). The FIFO overfilling is something that might be related to other components, and apart from "developer mode" (where you want to be bug-for-bug compatible to original hardware), it's good that the Glide wrappers don't lock up if the FIFO becomes full.

As for trying different wrappers, during development I am using Linux and DOSBox-X was readily available, PCem easy to build from source and nGlide worked fine in Wine, so didn't go for testing with all wrappers (especially since there's an OpenGL 1.1 build for anything non-Voodoo). One more fun thing to try would be to see how to reduce the OpenGL API usage to make it compatible with the MiniGL driver (I'm using vertex arrays from OpenGL 1.1, but that could be "backported" to glBegin()/glEnd() which seems to be what GLQuake has been using), or if the full OpenGL ICD that was released for Voodoo Graphics eventually actually did support the OpenGL 1.1 build properly.

Reply 29 of 30, by zyzzle

User metadata
Rank Newbie
Rank
Newbie
thp wrote on 2021-10-15, 18:19:

And zyzzle gets 128 lives by just passing their username as first command line parameter.

Wow, thanks for all that you do! And, new versions are GREAT! 16-color EGA version works well, and is a really neat retro touch. Now, I'll get really dizzy with so many lives...