VOGONS


Gameport devices changing PC speed?

Topic actions

Reply 20 of 37, by jwt27

User metadata
Rank Oldbie
Rank
Oldbie
NewRisingSun wrote:

I have just run Lotus III version 14/07/93 on a Pentium II DOS machine with no joysticks attached at all. The music played at the correct speed. I did not use any slowdown utility; I first successfully ran it with the CPU's internal cache disabled, then at full speed after figuring out how to patch away the "invalid opcode error" (actually a divide overflow): open LOTUS.DAT with a hex editor, search for FB F7 F1 and replace with FB 90 90. It worked correctly (as far as I can tell) with that change applied at full machine speed.

Have you tried running the game on a different machine, with a different game controller card or at least with a different joystick cable? It's not out of the question that either the controller card or the cable might give the game false positives by reporting sponanteous bit changes.

Wow, thank you so much, that fixed it! It runs without any slowdown tools now and I no longer need to have any controllers connected! And the framerate is just perfect, I don't recall this game ever running as smooth as it does now!

And you're right, I said "invalid opcode error" but that happened with some other game. Lotus crashed with a divide overflow. Is it the same bug as the well known Borland runtime error 200 that happens with certain other games?

How do you even find these fixes? I wouldn't have any idea where to look... And if I did I would probably be looking in the exe, not the dat file, 🤣.

Reply 21 of 37, by NewRisingSun

User metadata
Rank Oldbie
Rank
Oldbie
jwt27 wrote:

and I no longer need to have any controllers connected!

But my version ran correctly even when I disabled the CPU's internal cache, while yours didn't, if I read your posts correctly. So the original issue wasn't solved, was it?

jwt27 wrote:

How do you even find these fixes?

Ran the game in Microsoft CodeView; instead of bailing to DOS upon encountering the divide error, it will pause and highlight the offending machine instruction (see screenshot). You can see that to the left of the offending DIV instruction are the two bytes (F7 F1) that make up its machine code. I then searched for those two bytes in LOTUS.EXE. Finding nothing but noticing that LOTUS.EXE is extremely small, I expected that the main program code would be in LOTUS.DAT instead. Finding several instances of F7 F1 there, I took the last byte from the preceding instruction (FB) to search for the three-byte sequence FB F7 F1. Since this occurs only once in LOTUS.DAT, I knew that this would be the correct position. Now you only need to know that opcode 90 is NOP ("no operation"), so disabling the DIV instruction to avoid the divide error is as simple as replacing F7 F1 with two NOPs.

(I suppose the real hackers would be laughing their asses off if they saw that I'm using Microsoft CodeView instead of some leet debugger tool.)

jwt27 wrote:

Is it the same bug as the well known Borland runtime error 200 that happens with certain other games?

I suppose so. It definitely looks like a system speed-specific calibration of some kind of Delay() library routine that does not seem to be used by the game itself.

Attachments

  • cv_001.png
    Filename
    cv_001.png
    File size
    14.66 KiB
    Views
    3352 views
    File license
    Fair use/fair dealing exception

Reply 22 of 37, by Calvero

User metadata
Rank Member
Rank
Member
jwt27 wrote:
Calvero wrote:

Which version of Lotus 3 are you using? The game shows its version number when you quit the game. There are at least three version: version 14/07/93, 15/09/93 and 24/02/94.
Maybe a newer version doesn't have this gameport problem.

Mine shows 15/09/93. Do you know where I can get the newer version? Is there a patch available somewhere?

24/02/94 is the CD-ROM version. I don't think there's a patch available to update from one version to another.

Reply 23 of 37, by 5u3

User metadata
Rank Oldbie
Rank
Oldbie

Nice fix, NewRisingSun 😀

Now the game works on my K6-3 machine without having to disable the cache.

BTW, unlike the Borland TP lib runtime error, which only rears its head above 500 MHz on a K6-3, Lotus III always crashed on this CPU, even at low clock speeds like 120 MHz.

I never encountered any weird behaviour with the joystick though (game version 15/09/93).

Reply 24 of 37, by jwt27

User metadata
Rank Oldbie
Rank
Oldbie
NewRisingSun wrote:

But my version ran correctly even when I disabled the CPU's internal cache, while yours didn't, if I read your posts correctly. So the original issue wasn't solved, was it?

The problem is solved now it seems, it runs at full speed now regardless of how many controllers are connected. How that works, I have no idea.

NewRisingSun wrote:

Ran the game in Microsoft CodeView; instead of bailing to DOS upon encountering the divide error, it will pause and highlight the offending machine instruction (see screenshot). You can see that to the left of the offending DIV instruction are the two bytes (F7 F1) that make up its machine code. I then searched for those two bytes in LOTUS.EXE. Finding nothing but noticing that LOTUS.EXE is extremely small, I expected that the main program code would be in LOTUS.DAT instead. Finding several instances of F7 F1 there, I took the last byte from the preceding instruction (FB) to search for the three-byte sequence FB F7 F1. Since this occurs only once in LOTUS.DAT, I knew that this would be the correct position. Now you only need to know that opcode 90 is NOP ("no operation"), so disabling the DIV instruction to avoid the divide error is as simple as replacing F7 F1 with two NOPs.

(I suppose the real hackers would be laughing their asses off if they saw that I'm using Microsoft CodeView instead of some leet debugger tool.)

Wow. That actually sounds pretty easy. Probably isn't if I tried it myself though 🤣.
That Codeview program looks useful, do you know where I can get it? (if it's freeware)

NewRisingSun wrote:

I suppose so. It definitely looks like a system speed-specific calibration of some kind of Delay() library routine that does not seem to be used by the game itself.

I was just thinking it might have something to do with the gameport calibration, I'd imagine if the counter runs too fast it might miss the bit change on the gameport. Just tested that but it appears to work fine.
Also the wheel is pretty much useless in this game anyway, the steering is completely digital. I have to turn it almost all the way to one side to make the car change direction.

Reply 25 of 37, by ruthan

User metadata
Rank Oldbie
Rank
Oldbie

I know that this thread is old.. but i hope that someone who reads that you make to solve same problem with other games and perhaps it would be possible to write some patcher.
Here is my thread with other problematic *.exes attached..
Runtime error R6003 integer divide by 0 - real Fixes for fast CPUs, no slowdown workaround..

Microsoft CodeView, looks nice..
Is somewhere some good tutorial how to use it, how to switch between game and debugger?

Im old goal oriented goatman, i care about facts and freedom, not about egos+prejudices. Hoarding=sickness. If you want respect, gain it by your behavior. I hate stupid SW limits, SW=virtual world, everything should be possible if you have enough raw HW.

Reply 26 of 37, by ruthan

User metadata
Rank Oldbie
Rank
Oldbie

I have tried to this fix on my X58 machine (floppy version) with which im able to make 97% of 170 dos games working with Yamaha or Vortex1 soundcard, details:
https://docs.zoho.com/sheet/published.do?rid= … 04bf92a9209e034

I can with it go ingame, intro is playing with music on Vortex1, but keyboard (PS2) is not working, i never had such problem with other game on same machine, probably other fix is needed.

Im old goal oriented goatman, i care about facts and freedom, not about egos+prejudices. Hoarding=sickness. If you want respect, gain it by your behavior. I hate stupid SW limits, SW=virtual world, everything should be possible if you have enough raw HW.

Reply 27 of 37, by Scali

User metadata
Rank l33t
Rank
l33t

Fun fact: In my Commodore PC10-III I had a QuickShot joystick card, which had a 3-way switch at the top, to select the CPU speed.
I suppose the idea here was that the switch change the discharge speed of the capacitors, so you could reduce CPU load, by requiring less absolute time to measure a full axis.
Still wouldn't solve the case of a disconnected device of course.
product-79624.jpg
mix_quickshot_qs120_01.jpg

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 29 of 37, by moog

User metadata
Rank Newbie
Rank
Newbie

PS/2 or USB?

Also, for people who can't seem to understand what is going on here (such as myself, for a while):
The gist of the problem is to change FB F7 F1 to FB 90 90 in LOTUS.DAT file. Specifically, you want to look for:
- address 0xAE86, where you'll just find F7 F1 to be changed to 90 90, IF your game version is 14/07/93

You can identify version 14/07/93 by these contents, along with size, and SHA512 sums:

FILENAME SIZE SHA512
LOTUS.DAT 1337856 1db150948921dacb2f68be2dc051c786ac3870a2de3da9b23c68a788fb44ecc052dc555bc7cc63eb01c0fed5c38ee6b3e0d2eb65dc922440ffb5d69331af7cd8
LOTUS.EXE 4992 4d8361687d244a1443b814f6f7e3127cbf7faa1979da1cb664f077059f3280f7ffb64c31cdfb1f73284057c8c99dbf45211fbb9c16d84274df0c270f19947bab

Audigy 2 ZS in FreeDOS
LinLin adapter documentation
+ various capacitor list threads

Reply 30 of 37, by alexclaudiu2003

User metadata
Rank Newbie
Rank
Newbie

unfortunately, it still doesn't work, it starts but I have no control. if you managed to make it work, post an archive of the game here. If you don't want to, send me an e-mail, I'll pay you.

Reply 31 of 37, by moog

User metadata
Rank Newbie
Rank
Newbie
alexclaudiu2003 wrote on 2022-01-31, 20:47:

unfortunately, it still doesn't work, it starts but I have no control. if you managed to make it work, post an archive of the game here. If you don't want to, send me an e-mail, I'll pay you.

BRUH.
You use a PS/2 or USB keyboard? Games written in Pascal language (Jazz JackRabbit, Lotus 3) have problems when you tell the BIOS to provide compatibility for the USB inputs.

>post an archive of the game here
It ain't legal afaik. I gave you plenty of info, your sha256 sums should match.

Audigy 2 ZS in FreeDOS
LinLin adapter documentation
+ various capacitor list threads

Reply 32 of 37, by alexclaudiu2003

User metadata
Rank Newbie
Rank
Newbie
moog wrote on 2022-03-07, 23:28:
BRUH. You use a PS/2 or USB keyboard? Games written in Pascal language (Jazz JackRabbit, Lotus 3) have problems when you tell th […]
Show full quote
alexclaudiu2003 wrote on 2022-01-31, 20:47:

unfortunately, it still doesn't work, it starts but I have no control. if you managed to make it work, post an archive of the game here. If you don't want to, send me an e-mail, I'll pay you.

BRUH.
You use a PS/2 or USB keyboard? Games written in Pascal language (Jazz JackRabbit, Lotus 3) have problems when you tell the BIOS to provide compatibility for the USB inputs.

>post an archive of the game here
It ain't legal afaik. I gave you plenty of info, your sha256 sums should match.

in pure dos, it works perfectly. In Windows Millennium I tried ps2 keyboard, sound card port joystick, usb keyboard, none work.

Reply 33 of 37, by moog

User metadata
Rank Newbie
Rank
Newbie
alexclaudiu2003 wrote on 2022-04-15, 11:15:

in pure dos, it works perfectly. In Windows Millennium I tried ps2 keyboard, sound card port joystick, usb keyboard, none work.

Windows Millenium runs entirely in protected mode from the ground up. It's highly unrecommended to use Windows ME for any DOS workload.

Audigy 2 ZS in FreeDOS
LinLin adapter documentation
+ various capacitor list threads

Reply 34 of 37, by alexclaudiu2003

User metadata
Rank Newbie
Rank
Newbie

I recently installed Ms-Dos 6.22 and discovered something: The game runs perfectly without installing a sound card. I tested with Aureal Vortex 2 and SoundBlaster live. If I install a sound card, the game starts but you have no control over the keyboard or mouse.

Reply 35 of 37, by rasz_pl

User metadata
Rank l33t
Rank
l33t

>Aureal Vortex 2 and SoundBlaster live

arent drivers for both of those cards installing some protected mode monitor and force dos programs to run in virtual 8086 mode?

Open Source AT&T Globalyst/NCR/FIC 486-GAC-2 proprietary Cache Module reproduction

Reply 36 of 37, by Falcosoft

User metadata
Rank Oldbie
Rank
Oldbie
rasz_pl wrote on 2023-03-08, 21:37:

>Aureal Vortex 2 and SoundBlaster live

arent drivers for both of those cards installing some protected mode monitor and force dos programs to run in virtual 8086 mode?

Aureal Vortex 2 DOS driver does not switch CPU into protected/v86 mode, but SB Live's DOS driver indirectly does since it only works with emm386 loaded.

Website, Facebook, Youtube
Falcosoft Soundfont Midi Player + Munt VSTi + BassMidi VSTi
VST Midi Driver Midi Mapper

Reply 37 of 37, by cyclone3d

User metadata
Rank l33t++
Rank
l33t++
Scali wrote on 2018-08-17, 09:29:

Fun fact: In my Commodore PC10-III I had a QuickShot joystick card, which had a 3-way switch at the top, to select the CPU speed.
I suppose the idea here was that the switch change the discharge speed of the capacitors, so you could reduce CPU load, by requiring less absolute time to measure a full axis.
Still wouldn't solve the case of a disconnected device of course.

The speed switching game cards were for compatibility with different speed systems.

A lot of old sound cards would only work on systems up to a certain speed. Past that and you would need a speed selectable game card.

One of the best was the Gravis card that used an external POT so you had a very wide range of adjustability.

If the card was too old or wasn't set to the correct speed, you would get anything from not being able to calibrate the axis to the joystick/gamepad not working at all.

Then they eventually came out with the auto adjusting game cards and sound cards that had joystick ports that worked with whatever speed computer they were put in.

Yamaha modified setupds and drivers
Yamaha XG repository
YMF7x4 Guide
Aopen AW744L II SB-LINK