Skip to content

crazii/openglide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

155 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Openglide

OpenGLide is a Glide to OpenGL wrapper. It emulates a Voodoo board so you can run old Windows Glide games by translating Glide calls into OpenGL.

This repo is based from https://github.com/voyageur/openglide, with changes includes:

  1. Maintainance and engineering: improve logging/configs/glextensions.
  2. Glide improvement:
    • Client threading support (multi-contexts).
    • Windowed & Fullscreen mode with scale methods.
    • VSync.
    • Compeleting features and bugfixes (WIP).
      • glDrawArrays fix and other bugfixes
      • TMU improvements, TMU count up to 4, 2 TMUs tested
      • Optimizations (WIP)
      • Glide3x (testing)
      • Alpha/color/texture Combine functions (full emulation done through Shaders)
      • LFB improvements (testing)
      • Napalm (WIP)
      • Shaders
      • FXAA (code from: https://github.com/mattdesl/glsl-fxaa/blob/master/fxaa.glsl) or MSAA. MSAA alpha to coverage may not work for a 2D game (like Diablo II), default setting is FXAA.

Requirements

  • System: Win9x/ME (WIP) and above, Wine
  • GPU: Geforce 2/4 (theoretically), GeForece FX recommended (untested)

Tested Systems: Windows 11 (partially), WINE 10.0 & 10.7.
Tested GPUs: NVIDIA GeForce GT 730M, RTX 2060, RTX 2080.

Tested games

Only a very limit number of games are tested, including:

  • MDK (glide2x)
  • NFS2SE (glide2x)
  • NFS3 Hot Pursuit (glide3x)
  • NFS Porsche Unleashed (glide3x, with cmdline "driver=voodoo2z")
  • Return to Castle Wolfenstein (glide2x and glide3x, to use glide2x, glide3x.dll needs to be removed from system directory)
  • Quake2 (glide2x with MiniGL)
  • Counter-Strike (glide2x with MiniGL, incorrect vertex color with 3dfxvgl 0508, see "Known Iusses" section below)
  • Diablo II (glide3x)
  • Serious Sam TFE (glide3x, with 3dfxvgl 0508, see "OpenGL ICDs" section below)

Install and Configs

For 32bit windows, copy the glide2x.dll and glide3x.dll to C:\Windows\System32\, for 64bit windows, the folder is C:\Windows\SysWOW64, for Win9x, it is C:\Windows\System. The config file is OpenGlide.ini, on windows, it should be generated at C:\Users\%USERNAME%\AppData\Local\OpenGlide.ini, after the first time you use Openglide to run 3dfx games. Please read the comments in the ini file before modify it, by default it is optimal and any changes are not recommended.
An installation program and a GUI config tool is planned so that you do not need to modify the ini file directly.

Resolution and display modes

The resolutions for games are recommended to set to 640x480, or 800x600, as openglide with scale it (with default config). The low res settings in game helps with their GUI (HUD), the GUIs are scaled along with game resolutions, but if with high-res settings in games, they may become smaller.

Openglide supports 3 display modes

  • windowed mode, no mode switch
  • desktop mode (windowed-fullscreen), no mode switch
  • application controlled, mode switch, display mode set by games

Windowed and desktop mode can disable mode switches, but still some game may have initial mode swtiches before loading glide dll, so a flash of black screen still might be seen on games startup.

Besides the display modes, openglide support 2 resolutions, which only work for non-application controlled mode.

  • original - use original game resolution. for windowed mode, it could be a fixed sized & centered window; for desktop mode, it is a black full sreen in desktop resolution, with game images (i.e.800x600) in the center
  • desktop - scale the game resolution to desktop resolution, with 3 resolution options: streched, integer scale, or fitted. this resolution mode also works for windowed mode (i.e. game windows are scaled with its contents).

OpenGL ICDs

Napalm

Napalm emulation (Voodoo 4/5) have advanced features, i.e. up to 2048x2048 texture size, 32bpp RGBA textures, DXT textures, FXT1 textures etc.
To enable Napam, the glide.TMUs in openglide.ini needs to be set to 3 or 4. (3 is recommended, as Glide3x API officially support 3 TMUs at most. 4 may not recognized for games and cause them to use 1 TMU. 4 is not quite useful except for other emulators/programs).
The Napalm emulation is incomplete; it may have problems and needs more testing.

Diablo II Hi-resolution (1.14d only, PlugY,SGD2FreeRes)

Although Openglide is not a D2 dedicated wrapper, it supports high-res for Diablo II. Unlike D2DX, the hi-res feature is not builtin, opnglide doesn't load SGD2FreeRes automatically, so to enable hi-res, you need:

  • PlugY (http://plugy.free.fr/en/index.html)
  • SGD2FreeRes (https://github.com/mir-diablo-ii-tools/SlashGaming-Diablo-II-Free-Resolution/releases)
  • Copy PlugY files and SGD2FreeRes.dll, to Diablo II folder, the glide3x.dll is also needed to be copied to Diablo II folder, as SGD2FreeRes only recoginze it in local folder.
  • Edit PlugY.ini, set DllToLoad=SGD2FreeRes.dll in [GENERAL] section
  • An optional pre-created SGD2FreeResolution.json, or run PlugY.exe -3dfx with the modified ini for the first time and exit, the json file will be generated automatically.
  • Edit SGD2FreeResolution.json, add you custom resolutions in the Ingame Resolutions, the recommended resolution is "1280x720"

Note that the resolution is treated as game resolution, and Openglide may still changes display modes with proper scales, i.e. windowed/full screen modes, based on OpenGlide.ini.
Diablo II is known for its bugs with 2 TMUs, however, you don't need change glide.TMUs=1, it is internally handled.

Known Issues

  • The texture combine, color and alpha combine functions are not fully emulated by fixed-function pipeline, so if your (legacy) GPU doesn't support shader, the rendering result may be incorrect.
  • When 3dfxvgl (0508) with glide3x used for Counter-Strike 1.5, the vertex color of scene objects are not properly set. There may be a bug in openglide or the ICD is not compatible with Counter-strike, which needs more investigation.
  • Alt+Tab or WIN+D switch may not work for some games (especially on WINE), there might be a black screen after switching. This is related to windows messages and some games may init/terminate glide window (grSstWinOpen/grSstWinClose) on some windows events (WM_SHOWWINDOW/WM_ACTIVATE etc.) in an infinite loop.
  • The extensions (Voodoo2/3 and Napalm) are not implemented.
  • LFB (Linear Frame Buffer) depth readback: 16 bit single channel (GL_RED+GL_UNSIGNED_SHORT) texture used; it may not work for legacy GPUs. W buffer format readback not implemented.
  • Not all LFB lock formats are supported, currently RGB565 and RGBA8888 are tested, 1555 not tested, others not implemented.

Build

Toolchain:

  • mingw-w64-mingw32 (msvcrt), the msvcrt packages are available in Arch Linux, AUR: mingw-w64-headers-msvcrt and mingw-w64-crt-msvcrt
  • or llvm-mingw-msvcrt (https://github.com/mstorsjo/llvm-mingw) with pdb support (non-win9x target)
  • or msvc6, free and works on WINE.

Libraries: wxWidgets 2.8.10 (https://github.com/wxWidgets/wxWidgets/releases?page=4) for win32 GUI configurator. There is a pre-built wxWidget using i686-w64-mingw32 (GCC 15.1.0), you may need to build your own to avoid ABI issues if a different gcc version is used. You can use CPPFLAGS="-std=gnu++98 -D_mkdir=mkdir -D_rmdir=rmdir" LDFLAGS="-static-libgcc -static-libstdc++" ./configure --with-msw --enable-monolithic --host=i686-w64-mingw32 --enable-shared=no --enable-stl=no --enable-std_iostreams=no to configure wxWidgets.

Like the orignal openglide, the code still uses OpenGL 1.1 with optional extensions (shader programs, framebuffer objects, sampler objects, multisamples etc.) to support legacy platforms (retro PCs), and the code changes mantain compatibility with VC6, which allows to build & debug locally on Win9x.
For mingw, the way to build win32 dll is:

./configure --host=i686-w64-mingw32
make

To build the linux library, just use
./configure

There are 4 build scripts to help with the build: build2x_mingw.sh to build glide2x linux, buildbuild2x_mingw.sh to build mingw32.
build3x.sh and build3x_mingw.sh likewise.

Note that the current focus is the win32 build and the modifications are tested in WINE, so the linux build is broken now, but will be fixed.