VOGONS

Common searches


Gameport devices changing PC speed?

Topic actions

Reply 20 of 28, 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, 🤣.

WANTED - Manuals/drivers for:

  • Tecmar Graphics Master
  • Paradise Autoswitch EGA 350 (EGA1A)

Reply 21 of 28, 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
    1150 views
    File license
    Fair use/fair dealing exception

Reply 22 of 28, 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 28, 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 28, 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.

WANTED - Manuals/drivers for:

  • Tecmar Graphics Master
  • Paradise Autoswitch EGA 350 (EGA1A)

Reply 25 of 28, 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 28, 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 28, 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/