dgVoodoo v1.40+ by DEGE, 2005
=============================

dgVoodoo is a Glide Wrapper that implements Glide 2.11 and Glide 2.43 using
DirectDraw7 and Direct3D7.
dgVoodoo provides support to run Windows-based and DOS-based applications using
Glide, and it can also emulate VESA 2.0 for DOS applications.

-----------------------------------------------------------------------------

   I. Requirements
  II. Files of dgVoodoo 1.40
 III. What's news in 1.40
  IV. Working of, and using the wrapper
   V. VESA emulation
  VI. Installation
 VII. General tips for dgVoodoo
VIII. Technical notes (you can skip this section)
  IX. Resolution setting
   X. About screen shots
  XI. Using dgVoodooSetup (GUI)
 XII. Using dgVoodooSetup (Command line)
  
-----------------------------------------------------------------------------

I. Requirements
---------------

- Windows 95/98/Me/2000/XP for Windows applications
- Wndows 95/98/Me/XP for DOS applications
- DirectX 7.0 or greater
- what else important to write here? Idonnow

====================================================================================
IMPORTANT: dgVoodoo may not work with all ATI Catalyst versions, your PC may reboot
           when launching the wrapper in VDD mode with DOS-Glide applications.
           It should work in server mode however. I myself use it with Catalyst 5.6
           without any problems, but there are reports about rebooting with the same
           driver.
           So, I must say that use this shit only at your own risk !!!
====================================================================================

II. Files of dgVoodoo 1.40
--------------------------

        glide.dll                 -    Glide 2.11 driver for windows-based applications
        glide.ovl                 -    Glide 2.11 driver for DOS-based apps
                                       (see remarks on it!)
        glide2x.dll               -    Glide 2.43 driver for windows-based applications
        glide2x.ovl               -    Glide 2.43 driver for DOS-based apps
        dgVoodoo.exe              -    Glide server process for DOS-based apps
        dgVoodoo.vxd              -    Kernel module for DOS-based apps
        dgVesa.com                -    VESA 2.0 driver for DOS
        dgVoodooSetup.exe         -    Setup program
        readme_eng.txt            -    dgVoodoo documentation, English version
        readme_hun.txt            -    dgVoodoo documentation, Hungarian version

III. What's new in v1.40
------------------------

    - Command line interface for setup
    - Default DOS timer boosting period time has been changed to 80ms
    - Slight fixes

    - Lot of code refactoring, reviews, etc. (that's why this version is 1.40)
    - VESA support for XP
    - Many slight things, etc.

IV. Working of, and using the wrapper
-------------------------------------

Back in time, 3Dfx cards were driven via the API called Glide. Newer and newer version of
Glide came out as it evolved and it existed on several platforms. From viewpoint of
dgVoodoo, two important and supported platforms are DOS and Windows, and, two important
Glide versions are 2.11 and 2.43.
The driver itself was a library, that was attached either statically or dinamically to
the application using Glide.

    - DOS,      Glide 2.11, driver: lib linked statically
    - DOS,      Glide 2.43, driver: glide2x.ovl
    - Windows,  Glide 2.11, driver: glide.dll
    - Windows,  Glide 2.43, driver: glide2x.dll

So, it was enough to provide the proper file for the given Glide application (or others too,
if the driver itself also consisted of additional files) and the application run. All that Glide
wrappers, like dgVoodoo, do is replace the file(s) mentioned above with one(s) that still implement(s)
the Glide API, but all the Glide calls are converted (wrapped) into OpenGL or DirectX calls,
so no need for a real 3Dfx card to run those applications.

But, all this can't be done directly in DOS, since there is no and there have never been any
OpenGL or DirectX implementation under DOS. It means that DOS driver of dgVoodoo needs the
Windows driver. The point of the DOS driver is to be a bridge from DOS to Windows, it passes
all Glide calls from DOS to Windows.
dgVoodoo can realize the communication from DOS to Windows in two ways:

    - VDD mode: This is the preferred mode, in all aspects (technical, comfort, etc.).
                In this case the DOS driver automatically finds, starts and uses the
                Windows driver. This mode is only available under WinXP.

    - Server mode:
                In this case, launching a server application (dgVoodoo.exe) is needed. The server
                attaches the Windows driver to itself, and then, DOS driver communicates
                with the server. WinXP itself supports communication from DOS to Windows,
                while Win9x/Me doesn't, so, under Win9x/Me the wrapper has to realize it
                itself (that's why file dgVoodoo.vxd appears here).

So, usage of the wrapper:

For Windows applications, after copying proper files and potential setup (dgVoodooSetup),
you can run them without doing anything else.

For DOS applications, after copying proper files and setting up the wrapper to work in VDD mode,
you can run them without doing anything else.

For DOS applications, after copying proper files and setting up the wrapper to work in server mode,
you have to launch the server (dgVoodoo.exe) first, and then you can run them.


You can also run DOS programs in the background, but be careful! In certain cases,
when cooperative level changes (e.g. when a DOS program is being run in full screen,
but you changes to an other application), some of the Glide-functions cannot be
called without fail. This means that a game may quit with an error message, etc.


V. VESA emulation
-----------------

dgVoodoo can emulate VESA 2.0 for DOS applications, with minor-major bugs.
Similarly to the Glide emu, VESA emulation can be used in either VDD or server mode.
What is more, it needs and uses file glide2x.dll, so that, VESA emu code is
integrated into the Glide 2.43 driver (except for Win9x/Me, because most of the
emu is done by the kernel module (dgVoodoo.vxd) there and only a few parts are called
in the dll, like video refresh via DirectDraw).

[I know that I should have placed the implementation into a dll like dgVesa.dll or
 something like that, but according to the feedbacks I got and experienced, many people
 think that dgVoodoo consists of too many files, and they get confused about their usage.
 OK, I thought I won't bugger about with it then, integration made things go easier
 as well, as for switching between VESA and Glide modes at runtime. Maybe I will resolve
 it in about 2010, when the DOS part of this wrapper will be unusable not only in practice,
 but theoretically too, as 64 bit Windows doesn't support 16 bit code.]

VESA emu of dgVoodoo supports all resolutions from 320 x 200 to 1280 x 1024 in
8, 16 and 32 bit color depths. 320 x 200 x 256color is a standard VGA mode, you can
enable it for emulation.

To use VESA emulation, you will need to run the DOS-driver, dgVesa. Under Win9x/Me,
when the server is running with VESA emu enabled, it installs DOS driver automatically
into each newly opened DOS-box, so in that case using dgVesa is needless.
(DOS driver of VESA emu is for maintaining the contact between DOS and Windows, like
the DOS driver of Glide.)


VI. Installation
----------------

Important: If you have any of the previous versions installed, overwrite each component
           of dgVoodoo, don't mix them with older version files or with files with the
           same names from other software!

Global installation: copy all the needed files to your Windows folder
Local installation: copy all the needed files to the folder of the application/game you
                    want to play


Installing dgVoodoo to run Windows apps
.......................................


    Just copy the following files into the proper folder, depending on you do global or
    local installation:

        GLIDE2X.DLL
        GLIDE.DLL           (in the case you need Glide 2.11 support as well, but take
                             advice from me, and do local install for Glide2.11)
        DGVOODOOSETUP.EXE

     After doing this and setup, Windows applications should work.


Installing dgVoodoo to run DOS apps
...................................

    Just copy the following files into the proper folder, depending on you do global or
    local installation:

        GLIDE2X.DLL
        GLIDE2X.OVL
        DGVOODOOSETUP.EXE
        DGVOODOO.EXE
        DGVOODOO.VXD        (this file is required under Win9x/Me only, WinXP won't miss it)
        DGVESA.COM          (if you need VESA emulation)

    After doing this and setup, DOS applications can be launched (VDD mode), or
    you have to start the server first, and then DOS applications can be launched
    (server mode).

VII. General tips for dgVoodoo
------------------------------

- There are no magic options to set, so that if dgVoodoo won't work at all with default
  settings, probably won't work at all with others too. Only exception is maybe the
  difference between VDD- and server-mode.

- DON'T USE the server (dgVoodoo.exe) in compatibility mode (WinXP)!!!!
  It messes up the detection of version of the operating system, so the server may think
  it's running under Win98.

- When your screen is flashing, try to use the wrapper with "closer to a real hardware"
  option enabled. Flashing occures when a game unexpectedly behaviors and the wrapper
  locks the LFB in a very optimalized way (most likely in 16 bit full screen).

- If you start a DOS game, and the glide-window appears, and then nothing happens, try
  to run that program with unhided console window. It's possible the game exits with an
  error message, but you cannot see anything because the console window is hided.

- If you want the smoothest animation try to set the refresh frequency to the closest one
  to the desired freq (see setup)

- Automatically generated mipmap levels can cause serious artifacts, so it is not
  recommended to use it in general. Missing levels are generated by resampling the
  original texture and it means colorkey-pixels are going to be recoloured to
  something different color around a given shape. Alpha values can also be modified
  in a wrong way if an application uses alpha testing.
  Furthermore, when an application refreshes certain textures continuously, speed
  can be degraded due to calculating all the levels every time.

- Some applications were programmed in a way that it utilizes properties of a real
  hardware when locks the LFB, so they weren't completely programmed according to
  the Glide specification (such a program is e. g. Extreme Assault Demo). If you get "slided"
  pixel rows or something similars, try to enable the "closer to a real hardware"
  option of the wrapper. This option does not confuse other programs but eats up more
  memory and provides slower buffercontent caching, so do not use it if not needed.
  NOTE that this option is automatically enabled when using Glide 2.11 to
  keep compatibility of Voodoo1.

- dgVoodoo generates additional timer interrupts when it works in DOS Glide mode,
  so DOS games may seem to be faster than normal. This was brought in earlier, because
  3D rendering could be too time-consuming, taking out much execution time of DOS, resulting in
  losing timer interrupts, so that games slowed down to slowmotion.
  Since then, I've improved cooperation of certain threads, so this problem may not take place
  now (I hope, at least).
  Previous versions (like 1.31) generated one timer interrupt after each 15ms, now this version do
  that after each 40ms by default (in 1.40+, it's been changed to 80ms).
  Time of period was a hidden option in all of the previous versions. Since games can be faster
  than normal, if you want, now you can turn off timer boosting in the setup, or can set to the
  aforementioned 40ms. (It's a limited choice, since it could be set to other values too, but
  I'm far from happy to make this option public at all).

- I think all of Glide 2.11 DOS-applications have their Glide libraries statically
  linked (according to the Glide 2.11 SDK). However file glide.ovl could only be usable by dynamic
  linking. I myself don't know of any program using it in this way. That's why this file exists
  but isn't included in this version.

- Focus problem (Win9x/Me):

  If serverproc loses the focus, it suspends the served DOS box and wakes it up when it gets
  back the focus. In some cases the serverproc gets the focus but Windows does not send
  any message about it (or I coded it nastily) so you have to inactivate and reactivate the
  window of the server manually. In full screen, you can do it by moving the invisible mouse
  cursor to the edge of the screen and resize the window (when mouse focus is not set to
  the DOS-box).

  In certain cases it can be very annoying that mouse focus is set to the DOS box.
  For example, when you run the program in windowed mode, you can't resize the window
  severely. However, if Ctrl-Alt is pressed, mouse focus is released from the DOS box.
  If you click on the window, it gets back the focus.


VIII. Technical notes (you can skip this section)
-------------------------------------------------

Glide LFB locking
.................

    - Option "closer to a real hardware" is automatically enabled when Glide 2.11 is used,
      because of maintaining the Voodoo1-compatibility. It means that stride (AKA pitch or logical
      line length) for LFB operations is always 2048 bytes, and read/write pointers to buffers
      are "constant" (for particular formats).

    - A hidden option, "No matching LFB formats" are also automatically enabled for
      Glide 2.11 to avoid buffer pointer mismatch problem. In fact, this prevent dgVoodoo
      from using directly any of its internal optimized buffers in order to read/write pointers of
      a particular buffer always do point to a certain memory area (this is important in Glide 2.11).

    - "No matching formats" is also enabled when you use the wrapper for DOS programs under WinXP
       in server mode. This is because matching lfb formats means using directly one of the
       internal buffers residing in the video memory. Thus, the DOS program and the locked buffer
       would be in separate address spaces. Note that when "no matching formats" is enabled, there is
       no extra conversion from the format to the same format, just a raw copy is done.


DOS Glide
.........

    - In VDD mode, the wrapper file (glide2x.dll) is attached directly to the
      NTVDM process running the DOS program as a VDD (Virtual Device Driver). You can
      avoid running the serverprocess, the application and the wrapper share the same
      process and address space like in case of Windows applications. Also, more than one
      applications can use the wrapper simultaneously.


    - Disadvantages of server mode under WinXP: Since the application and the wrapper run
      as two separated processes in separate address spaces, dgVoodoo can't utilize matching
      LFB formats (it considers them as if they were always different), server can serve only
      one DOS program.
      You should try this mode if you have troubles with VDD mode.


VESA Emu
........

    - dgVoodoo reports VGA-compatibility altough its compatibility is restricted
      to the palette registers and the vertical blank (3DA) register.
      It means X mode cannot be emulated, etc.
      (But, this project is not about developing VESA to the perfectness...)

    - Linear/Flat Frame Buffer mode is not supported under Windows Xp.

    - Under Windows 98/Me, Bank Switching is done by changing the actual memory mapping
      in kernel mode. However it is beyond the possibilities under Windows XP, so copying
      large 64K memory blocks is needed there. Thus, it is slower than W98/Me implementation.

    - Win9x/Me only: If you use dgVoodoo for VESA in a DOS box, then you stop it
      and use the original driver, you will probably see a messy screen. This is because
      dgVoodoo overwrites the memory mapping for videomemory set up by VDD
      (Virtual Display Driver) and cannot fully restore it. In this case close
      that DOS box and use another.

    - Win9x/Me only: VESA init can fail when starting the server.
      The memory area used as videomemory is allocated when kernel module is loaded into
      the kernel. (When it is unloaded, this memory area is released.) Normally the kernel
      module behaves as a dynamic VXD. It means it is loaded and unloaded to/from
      kernel by the serverproc. The main problem is the videomemory has to be
      physically continuous but Windows cannot provide it if bulk of the
      physical pages are messy-allocated for running applications.
      If you want, you can insert the following line in SYSTEM.INI into the
      [386Enh] section:
             device = dgVoodoo.vxd
      In this case kernel module is used as a static VXD, so it is loaded into
      the kernel during Windows startup. It reserves 2MB as videomemory (because
      it cannot read the current configuration) and releases it when Windows shuts down.

IX. Resolution setting
----------------------

If an application does not allow you to set the required resolution you can
do it by dgVoodoo. If an application accesses the LFB frequently then video
memory has to be resized, but, if hardware acceleration is available, it won't
cause slowdown necessarily.

You can use all of the resolutions supported by your video card.

X. Screen shots
---------------

You can save the content of the screen into a file or to the clipboard.
You can do it by pressing the "Pause" button in case of Windows apps and DOS in XP,
and "Scroll Lock" for Win9x/Me DOS. I know it should be done by the same button for
all platforms but I cannot solve it (temporarily). The result of the saving
operation can be seen on a green label in the middle of the screen except when
you are in an 8 bit full screen mode (VESA) because the label cannot be drawn by the
3D hardware.
If the screen is saved into a file, the name of the saved file is the same as
the application's concatenated by an ordinal number. It is saved to the "Temp"
directory on the same drive where the application is. If the name of the
application is unknown (only in DOS) then filename is
C:\Temp\dgVoodoo_xyz_.bmp where _xyz_ is an ordinal number.
The saved file is 8 bit (full screen, VESA), 16 or 32 bit depending on what
the bit depth of the used videomode is. The saved file is always saved as
a BMP file and dgVoodoo is not intended to support any other format in the
future. Just save the screen then convert it to whatever you want.

XI. Using dgVoodooSetup (GUI)
-----------------------------

dgVoodoo does not have a configuation file from which it reads the actual
settings. Settings are stored in GLIDE2X.DLL and GLIDE.DLL instead.
The setup program needs these file as well.

Setup program organizes setup options on three pages.
Page "Global" contains options that affects both the Glide and VESA emulation.
Page "Glide" contains options for Glide.
Page "VESA" contains option for VESA.

Let's have a look at the setup-dialog:

Platform        Here you can select the Win or DOS platform to configure.

Language / Nyelv
        You can select a language to setup in, and which the wrapper itself uses.

Instance of dgVoodoo
        In this list you can see the names of wrapper files to be configured.
        By default, setup searches for such files in the current directory, but
        if none is found, it does it in Windows directory. You can add additional
        wrapper files to the list by "Search" button.
        "Win dir" and "./" button adds files from Windows and current directory
        if any is found there.

Below this field, you can see the actual page. You can select between pages by the tabs.

Page "Global"
-------------

Display device
        You can select which screen adapter to use.

Display driver
        You can select which rendering driver to use.
        (dgVoodoo will probably work unproperly with software drivers, but I
         think that's not a big pain. :) )


Screen mode
        You can select between full screen and windowed mode.

Screen bit depth
        You can set the bit depth of full screen mode.
        In windowed mode bit depth is determined by the
        actual settings of the desktop. These settings can be seen
        above the tabs. If it is not compatible with
        dgVoodoo (so that it is not a 16 or 32 bit mode), you will
        be warned.
        16 bit mode can be useful for fast LFB accesses.

Enable screen shots
        You can enable the screen saving here.

Saving to file
        You can enable saving to file here.

Saving to the clipboard
        You can enable saving to the clipboard here.

Working in VDD mode
        Only for DOS under WinXP: you can set VDD mode here.

Active in background
        Only for DOS under WinXP: by enabling this option, DOS programs
        runs in the background too.

Hide console
        Only for DOS: Hides the console window of the application.

Set mouse focus to application
        Only for DOS: If application is running, mouse focus is set
        to the application. You can use the mouse by enabling this
        option.

Enable Ctrl-Alt
        If enabled, you can release the mouse focus from DOS box by this
        key combination.

Always preserve window size
        Only for DOS, in windowed mode: if you resize the window, further
        mode switchings (e.g. between VESA and Glide) won't resize the
        window to the default size when a new resolution is applied.
        
Preserve aspect ratio
        Preserves aspect ratio of the window during sizing.

Page "Glide"
------------

DirectX textures bit depth
                Bit depth of textures used in Direct3D. dgVoodoo can use the
                following texture formats (arbitrary component order):
                        - 16 bit ARGB_4444
                        - 16 bit ARGB_1555
                        - 16 bit RGB_555
                        - 16 bit RGB_565
                        - 32 bit ARGB_8888
                        - 32 bit RGB_888
                        -  8 bit P8
                At startup, it puts all the texture formats supported by your card
                into a list. When dgVoodoo has to decide which format to use for a
                particular 3Dfx format (best fit) it select it from the list.
                Options meaning:
                        - 16 bit: select from only 16 bit formats
                        - 32 bit: select from only 32 bit formats
                        - Optimal: select from any format including paletted
                                   (8 bit) textures

Refresh rate
                Monitor freq is the closest supported freq:
                 At init, every glide based application gives the resolution and
                 refresh rate at which it wants the monitor to work.
                 If this option is enabled, the wrapper automatically selects one
                 of the supported freqs that is closest to the freq given by the
                 application.
                 (In practice, this frequency usually is about 60-70Hz.)
		 If this option is disabled, the monitor freq will be the one the user selected.
                 (Default=real value is determined by the driver of video card, usually it
                  means the highest supported freq, or the one set for the desktop)

                Refreshing:
                 refreshing is aligned to the real vertical sync, may ending in using different
                 freq than the application required (first option), or
                 refresh is also restricted to the freq application required
                 (second option). This can cause flickering because certain frames
                 may not be rendered.

                Summarized:
                 - If you aren't interested in using the same freq that the application
                   requires, then DON'T let the wrapper set the monitor
                   freq to the closest supported one and use the first option for refreshing.
                 
                 - If you ARE interested in using the same freq, then use the second option for
                   refreshing.
                 
                 - If this causes an ugly flickering then let the wrapper set
                   the monitor freq to the closest supported one.
                   (If you are lucky, real freq will be close to the required freq.)
                   (This is recommended for smoothest animation!)

                Always wait for vertical sync:
                 Waits for at least one vertical retracing even if an application doesn't
                 demand it. It can be useful for applications not synchronizing themselves
                 to the refreshing ending in running too fast on modern computers,
                 or rendering artifacts such as horizontal refresh-lines.

LFB access      
                - Disable LFB access (read, write)
                        Accessing the LFB can be a slow operation.
                        If you disable access in this check box, applications still
                        has the sense they access the LFB but in fact they access an
                        unused buffer instead. Because of it the appearing may not be
                        complete (and can be bad if reading) but the application can
                        run at max speed.

                - Use hardware cache buffers when possible
                        Keep this option enabled
                
                - Use fastwrite for unmatching formats
                        Keep this option enabled

                - Disable texture tiles
                        This differs from Betas of 1.40!:
                        This version decides itself whether it uses textures or not
                        for an LFB locking operation.
                        (It's done only for active pixel-pipeline, but, checking
                        necessity of textures is done even in this case.)
                        If locking LFB with texture tiles turns out to be slow or cause
                        other unknown problems, disable it and it will work like in
                        previous versions.

                - Closer to a real hardware
                        LFB has such properties that are closer to the LFB properties
                        of a real Voodoo card

                Note: if an application tries to read/write the aux buffer when it
                is used as a depth or alpha buffer, then it will always manipulate
                the unused buffer (locking depth and alpha buffers are not implemented
                yet :-| ).

Resolution
                You can override the the resolution of an application here.
                This list contains all the supported resolutions.

Refresh rate
                You can set the refresh freq of your monitor here.
                You cannot do it if you use the wrapper in windowed mode or monitor freq
                is set to the closest supported one.
                
Texture memory size
                Size of the emulated texture memory.

Perfect texture memory emulation
                You can enable perfect texmem emulation by this option.
                When it is enabled, the wrapper can use exactly the same mipmaps
                that are required by the application. In this case texture reallocating
                and reloading is always done automatically if needed.
                If you disable this option texture memory emulation is done in the same
                way as in previous versions.

Disable mipmapping
                If you don't like mipmapping in a game, you can disable it, falling back
                to using only the first mipmap of textures.

Force trilinear mipmapping
                Interpolating between the levels of mipmaps

Autogenerate mipmaps
                If a mipmap consists of only one level, missing levels are generated.
                This option does not override multilevel mipmaps.

Force bilinear filtering
                You can force textures to be always blurred.

Gamma correction
                You can set the gamma correction between 0% and 400%.
                This also works in windowed mode!

Colorkeying method
                Colorkeying is the effect when pixels that matches the colorkey are not rendered.
                
                You can select between four methods for colokeying:

                - Native: General colorkeying method using the native colorkeying of cards
                          (this was method 2 in previous versions)

                - Native for TNTs:
                          This method is a special alpha based colorkeying for TNT cards only
                          (TNTs implement their cking on an alpha based conception,
                           working under special circumstances only)
                          (this was method 1 in previous versions)

                - Alpha based:
                          General colorkeying method using alpha testing and
                          mask textures as alpha channels

                - Automatic:
                          It always forces alpha based colorkeying by default, but if it
                          won't work due to either lack of enough videomemory or constraints of
                          alpha based method, then it falls back to native colorkeying.

                Alpha based colorkeying is the closest to the real Glide-colorkeying
                and it should give the same results on every video cards, that's why automatic
                method always forces this by default.
                Disadvantages: this method cannot provide colorkeying at all if alpha testing
                is enabled in special modes and also, wrong results may be produced if special
                alpha blending modes are used.

Force triple buffering
                You can force the wrapper to always use three buffers for animation. This can
                speed up things, but also can produce wrong appearance if the application uses
                the content of previous frames.

Fix TR's shadow-problem
                You can avoid the no-shadow problem in Tomb Raider 1.
                Don't use this option when using another Dos-program.

Clipping by Direct3D
                If an application doesn't do its own geometry clipping but make the wrapper do
                it, clipping is done by Direct3D in 3D (altough Glide supports only 2D clipping)
                if this option is enabled. However you may have troubles with 3D clipping
                (like in Red Baron), in this case try out the own 2D clipping algorithm of the
                wrapper by disabling this option. (2D clipping is not perfect for polygons
                with negative W-coordinates...)

Enable using hardware vertex buffers
                If this option enabled, dgVoodoo puts all the geometry data directly into the
                hardware buffer of the video card, avoiding extra copies. However this also can cause
                problems, so I let you disable it.
                
Force W-buffering
                You can force true W-buffering if your video card supports it (old ATI cards,
                and pre-GeForce 6xxx series).
                
Timer boosting
                Turning on and off timer boosting, for more see section "General Tips".

Page "VESA"
----------

This page is used only for DOS.

Use built-in VESA support
                You can enable the VESA emulation.

Refresh frequency
                Refresh freq. You can get smooth animations at higher freqs, but be
                careful: refreshing the screen is time-consuming so the higher the
                freq the more time is spent on refreshing, the less time is left
                for the program for running. 

Emulated video memory
                Size of the video memory (see related problems).
                Size of mem should not be smaller than a particular video mode requires.

Mode 13h support
                You can enable emulating the standard 320x200 256 color VGA-mode.

Disable Flat/Linear Frame Buffer Modes (Win9x/Me)
                Since implementation of the VESA emu is far from perfect, some programs
                may not work in linear mode. So, disable it to force the program to
                use good old bank switching VESA technique.


You can save your settings by pressing button "OK", while "Cancel" quits
without saving.

XII. Using dgVoodooSetup (Command Line, advanced)
-------------------------------------------------

If command line of dgVoodooSetup is not empty, GUI interface does not pop up,
information for setup operations are taken from the command line. No any feedback
on the console. (Damn, an application can't be both a GUI and Console application
under Windows, at least not in an easy way.)
This is useful for using the setup in command line scripts.

You can model the GUI workflow, which is usually the following:
- configuration is loaded from either the wrapper file (glide2x.dll, glide.dll),
  or from an exported config file
- some config changes are applied if needed
- configuration is either saved in the wrapper file, or exported to external config
  file, or both

Command line options:

dgVoodooSetup [wrapperfile] [/opt1] ... [/optn]

where wrapperfile can be:

    File                            Specified file
    $Win$[File]|[:0|1|2]            $Win$ prefix is changed to Windows directory
                                    if File is specified, appended to Win dir
                                    
    $FirstFound$[:0|1|2]            directory where wrapper file is first found

                                    1 = glide.dll, 2 = glide2x.dll, 0 = any of them
                                    default = 0

where options:

    (E/D = Enable/Disable)
    (Dec = decimal number)
    (Hex = hexadecimal number prefixed by 'x' or '0x')
    (Default of boolean operations (On|Off|Inv) = On)

options for operations
    
    /?, /h, /help                   Help for command line options
    
    /NoSave                         Does not save config in wrapper file
    /Import:configfile              Load config from configfile, mandatory parameter
    /Export:configfile              Save config in configfile, mandatory parameter
    /ExportToText:textfile          Export config into textfile, mandatory parameter

    /Platform[:Win|Dos]             Load appropriate platform config, default = Win
    /Lang[:Eng|Hun]                 Language, default = Eng

options modifying config:

    /Windowed[:On|Off|Inv]          E/D windowed mode.
    /BitDepth[:16|32]               Color buffer bit depth in full scr mode.
                                    Default: 16
    /ScrShot[:On|Off|Inv]           E/D screen shots.
    /ScrShotToCb[:On|Off|Inv]       E/D screen shots going to clipboard
    /VDDMode[:On|Off|Inv]           E/D VDD mode
    /RunInBkgnd[:On|Off|Inv]        E/D running in background
    /CLIPOPF[:On|Off|Inv]           Force handling CLI/POPF (XP)
    /HideConsole[:On|Off|Inv]       Hide/Show console window
    /Mouse[:On|Off|Inv]             E/D setting mouse focus to Dos
    /MouseCtrlAlt[:On|Off|Inv]      E/D Ctrl-Alt to release mouse focus
    /PreWinSize[:On|Off|Inv]        E/D Preserving window size
    /PreWinAspRat[:On|Off|Inv]      E/D Preserving window aspect ratio

    /MonFreq[:Hex|Dec]              Monitor freq, 0 = default freq, default = 0
    /ClosestMonFreq[:On|Off|Inv]    E/D Setting the closest supported monitor
                                    freq to the one that app requires,
                                    overrides MonFreq setting
    /SyncToAppFreq[:On|Off|Inv]     E/D syncing to app freq
                                    (not syncing to refreshing)
    /WaitOneRetrace[:On|Off|Inv]    E/D waiting for at least one retrace

    /TextureBitDepth[:0|16|32]      Bit depth of D3D textures, 0 = optimal,
                                    default = 0
    /PerfectTexEmu[:On|Off|Inv]     E/D perfect texture memory emu
    /StoreTexCopies[:On|Off|Inv]    E/D storing texture copies
    /DisableMipMap[:On|Off|Inv]     E/D mipmapping
    /ForceTriMipMap[:On|Off|Inv]    E/D forcing trilinear mipmapping
    /AutoGenMipmap[:On|Off|Inv]     E/D autogenerating mipmap levels

    /LfbAccess[:Enable|Disable|DisableRead|DisableWrite]
                                    Setting LFB acessibility, default = Enable
    /HwCacheBuffs[:On|Off|Inv]      E/D hardware cache buffers
    /FastWriteUnmatch[:On|Off|Inv]  E/D fastwriting for unmatching formats
    /FastWriteMatch[:On|Off|Inv]    E/D fastwriting for matching formats
    /ColorFmtOnLfbFmt[:On|Off|Inv]  E/D Lfb read/write format affected by color format
    /RescaleChangesOnly[:On|Off|Inv]E/D rescaling only lfb changes at write
    /FlushAtUnlock[:On|Off|Inv]     E/D always flushing lfb changes when unlocking
    /NoMatchingFmt[:On|Off|Inv]     E/D no matching lfb formats
    /NoTextureTiles[:On|Off|Inv]    E/D texture tiles for lfb writing
    /LfbRealHw[:On|Off|Inv]         E/D closer to a real hardware

    /CKMethod[:Auto|Alpha|Native|NativeTNT]
                                    Setting colorkeying method, default = Auto
    /CKTntInFallback[:On|Off|Inv]   E/D using native TNT method when fallback in auto
    /AlphaRef[:Hex|Dec]             Alpha reference value for auto ck mode,
                                    range: 0-255, default = 0

    /TexMemSize[:Hex|Dec]           Texture memory size in kB, default = 8192

    /XRes[:Hex|Dec]                 Overrided horizontal resolution
    /YRes[:Hex|Dec]                 Overrided vertical resolution
                                    (X=0 and Y=0 means resolution required by app)
    
    /Gamma[:Hex|Dec]                Gamma correction in percents,
                                    range: 0-400, default = 100

    /ForceTriBuff[:On|Off|Inv]      E/D forcing triple buffering
    /FixTR1[:On|Off|Inv]            E/D fixing shadow bug in TR1
    /ClipByD3D[:On|Off|Inv]         E/D geometry clipping by Direct3D
    /GlideGamma[:On|Off|Inv]        E/D Glide gamma ramp
    /HwVertexBuff[:On|Off|Inv]      E/D hardware vertex buffers
    /WBuffDetMethod[:ForceZ|ForceW|DriverFlag|DrawingTest]
                                    Setting W-buff emulation detection method,
                                    def = DriverFlag
    /DepthColorEq[:On|Off|Inv]      E/D setting bit depth of depth buffer to the same
                                    as color buffer
    /ForceIndexed[:On|Off|Inv]      E/D forcing indexed primitives
    /PreferTMUW[:On|Off|Inv]        E/D preferring W of TMU when needed
    /TimerBoost[:Hex|Dec]           Timer boost period time in ms for DOS
                                    0 = boosting disabled, default = 80

    /Vesa[:On|Off|Inv]              E/D built-in VESA support
    /VesaRefRate[:Hex|Dec]          VESA refresh rate in Hz, range: 45-70,
                                    default = 50
    /VesaMem[:Hex|Dec]              VESA videomemory in kB, default = 1024
    /Supp13[:On|Off|Inv]            E/D VGA mode 0x13 (320x200x8)
    /DisableFlat[:On|Off|Inv]       E/D Flat/Linear VESA modes

    /MirrorVert[:On|Off|Inv]        E/D mirroring the screen vertically

Configuration is loaded from the wrapper file, but /Import option overrides it if
specified. If neither wrapper file nor external config file is specified then
default config is used. Then, all config modifications are done, and config is
saved in wrapper file if /NoSave is not specified, and, it will be saved into an
external config file if /Export is used. Also, it will be exported into a text file
if /ExportToText is present.
If an option has a parameter, it is separated by a colon. If a parameter is not mandatory
and not specified, then default parameter is used.
In case of syntax error or unrecognized options, nothing is done.
Command line options are case insensitive.

Examples:

    dgVoodooSetup $FirstFound$:2 /Platform:Dos /Windowed:On

    Searches for the glide2x.dll file (current dir and Win dir), loads the DOS config,
    sets windowed mode, then saves the config.

    dgVoodooSetup $Win$Glide2x.dll /Platform:win /CKMethod /Export:MyConfig.cfg

    Searches for the glide2x.dll file in Win dir, loads the Win config,
    sets colorkeying method to automatic, then saves the config and also exports it
    to MyConfig.cfg.

    dgVoodooSetup /Platform:win /LfbAccess:DisableRead /ExportToText:MyConfig.txt

    Takes the default config, disables lfb access for read, then exports it to
    MyConfig.txt text file.

Remarks:

    $Win$:1 is the same as $Win$glide.dll, and $Win$:2 is the same as $Win$glide2x.dll.
    
    $Win$:0 (or just $Win$) searches for glide2x.dll in Windows dir, and, if it is not found
     it searches for glide.dll

    $FirstFound$:0 (or just $FirstFound$) searches for glide2x.dll or glide.dll in current dir and
    Windows dir.
    Search order is:

     current_dir\glide2x.dll
     current_dir\glide.dll
     Win_dir\glide2x.dll
     Win_dir\glide.dll

    as done in GUI.

    I hope it is really gruesome, enjoy! :)
