First post, by moog
- Rank
- Member
Mandatory reading: Re: Runtime error R6003 integer divide by 0 - real Fixes for fast CPUs, no slowdown workaround..
In short, that message is misleading, we're not dividing by zero, we're experiencing a divide overflow.
I found something out.
Stargunner CAN be played on fast CPUs without issue! But here's the catch - disable VBE 2.0 detection. How? Here's how from the game's own synopsis:
Option: Description: Default:---------------- -------------------------- -----/vesa{+,-} Vesa 2.0 Detection. On/lfb{+,-} Vesa Linear Frame Buffer. On/tseng{+,-} Use Tseng ET4000. OFF/fade{+,-} Palette Fading. On/sound{+,-} All Sound. On/music{+,-} Music. On/soundfx{+,-} Sound Effects. On/logo{+,-} Display Apogee Logo. On/intro{+,-} Display Intro Animation. On---------------- -------------------------- -----/nomouse Disable mouse detection & use no mouse./lpt{1,2,3} Set printer port for SEGA/SNES joystick./cd:{dir} Use {dir} for configuration files. (When running from CD)Command Line Example: stargun /logo- /fade-OR Environment Variable: set stargun=/logo- /fade-Disables Apogee's logo on startup, and palette fading. Command line optionsoverride the environment variable. {+,-} means use either + or - to enable ordisable the option. A option without + or - will toggle the default value.
So when I start the game with
STARGUN.EXE /vesa-
the game works! Flawlessly, and without any performance impact - not that a Pentium III-S running at 700MHz would make me notice.
The problem appears to be entirely concentrated in broken VBE 2.0 support in newer graphic card BIOSes, such as my Voodoo 5500. There are other people backing up this as a reason: https://www.3dfxzone.it/enboard/index.php?topic=1120
But that still leaves us with a broken SETUP.EXE. I'll try and cook something up. Since Stargunner is using binary config files that contain literally all game settings, our only way to live without a SETUP.EXE is to start the game with known good settings. But that can be tricky if we don't know the layout. Here's what I'm gonna do.
Short term: I'll write something that can generate Stargunner configs, but doesn't force us to go into VBE 2.0 modes.
Long term: I'll make a patch for both STARGUN.EXE and SETUP.EXE - in the first one's case, it will turn VBE 2.0 detection off by default so people with compatible cards will have to run with /vesa+, and for SETUP.EXE I will outright disable any attempt to detect VBE 2.0.
Also while looking through the disassembly I found a motherlode of other commandline switches that /? does not reveal. The first one is /status, which gives us this prompt:
- Tseng Labs Mode : Disabled- Vesa Detection : Enabled- Raster Display : Disabled- Profiler : Disabled- Redirection : Disabled- Slow Mode : Disabled- Fading : Enabled- Hidden Icons : Enabled- Debugging Keys : Disabled- Supervisor Mode : Disabled- Logging : Enabled- Mouse : Disabled- Detect Mouse : Disabled- Sound : Enabled- Sound Effects : Enabled- Music : EnabledReady?
The array that contains recognized switches is as such:
000DEE7C off_DEE7C dd offset asc_B820A ; DATA XREF: sub_38010+3Bo000DEE7C ; sub_38710+3Bo000DEE7C ; "?"000DEE80 dd offset aDbuf ; "dbuf"000DEE84 dd offset aLogo_0 ; "logo"000DEE88 dd offset aIntro ; "intro"000DEE8C dd offset aJoystick ; "joystick"000DEE90 dd offset aNomouse ; "nomouse"000DEE94 dd offset aBuffers ; "buffers"000DEE98 dd offset aStatus ; "status"000DEE9C dd offset aSoundfx ; "soundfx"000DEEA0 dd offset aSound_0 ; "sound"000DEEA4 dd offset aMusic_0 ; "music"000DEEA8 dd offset aMouse_3 ; "mouse"000DEEAC dd offset aMoney ; "money"000DEEB0 dd offset aProfile ; "profile"000DEEB4 dd offset aRaster ; "raster"000DEEB8 dd offset aH1dden ; "h1dden"000DEEBC dd offset aDm0de ; "dm0de"000DEEC0 dd offset aRedir ; "redir"000DEEC4 dd offset aTseng ; "tseng"000DEEC8 dd offset aSuper ; "super"000DEECC dd offset aDebug ; "debug"000DEED0 dd offset aPfopt ; "pfopt"000DEED4 dd offset aLoad ; "load"000DEED8 dd offset aMono_0 ; "mono"000DEEDC dd offset aSlow ; "slow"000DEEE0 dd offset aVesa ; "vesa"000DEEE4 dd offset aFade ; "fade"000DEEE8 dd offset aFlow ; "flow"000DEEEC dd offset aSega ; "sega"000DEEF0 dd offset aSnes ; "snes"000DEEF4 dd offset aKeyb ; "keyb"000DEEF8 dd offset aVero ; "vero"000DEEFC dd offset aTest ; "test"000DEF00 dd offset aDemo ; "demo"000DEF04 dd offset aLpt ; "lpt"000DEF08 dd offset aVrs ; "vrs"000DEF0C dd offset aLfb ; "lfb"000DEF10 dd offset aLog ; "log"000DEF14 dd offset aRec ; "rec"000DEF18 dd offset aCd ; "cd"000DEF1C dd offset aCf ; "cf"000DEF20 dd offset aP ; "p"000DEF24 dd offset aT ; "t"000DEF28 dd offset aZ ; "z"000DEF2C dd offset aS_5 ; "s"000DEF30 dd offset aM ; "m"000DEF34 dd offset asc_B82F6 ; "l"000DEF38 dd offset aE ; "e"
Audigy 2 ZS in FreeDOS
LinLin adapter documentation
+ various capacitor list threads