squatina on 23/9/2007 at 19:14
This thread is about that annoying COM port error that most of us get when we start System Shock. And how to get rid of it by hex editing the cdshock executable.
But first I'll talk a little about what causes it. That's simple.
When System Shock is launched it tries to access COM1 and COM2 ports on the machine. Most older machines had both of those, but newer machines usually have only one. Some machines have no serial port at all. If your machine has only COM1 port, you'll get the error about COM2 port and similarly with only COM2, you'll get the error about COM1. If the machine doesn't have any serial port, you'll get that error for both COM1 and COM2.
For example my machine has only COM1, so I get the COM2 error. If I disable it from the device manager, I get both errors.
What does System Shock want to do with the serial ports? I'm not 100% sure, but it seems that it is looking for controllers (mouse, maybe joystick) connected to those ports. Yes, mouse used to be on serial port before PS/2 or USB devices. And SS doesn't care if your machine doesn't have these ports, it just tries blindly to access them.
Now, if you actually have old enough machine and your mouse connected to serial port, this fix is probably going to make your mouse not work with SS. I haven't been able to verify this, but if someone has such a setup, please try this and tell me what happens.
Then about the fix..
I'm not providing a fixed binary, because there are so many versions out there. The original with dos4gw, Mok's hacked one with causeway and various combinations with these and the high res patches.. Personally I use a cdshock.exe with the extender completely ripped off i.e. the plain linear executable. I'll just tell what to modify so everyone can use their favourite binary.
Search for the following sequence of bytes with your favourite hex editor. It should be in the file only once.
0f 85 bc 00 00 00 6a 01
And change it to the following.
e9 bd 00 00 00 90 6a 01
This changes a jnz instruction to a plain jmp. The last two bytes are there just so that you'll find the sequence only once.
With this simple modification the application doesn't try to access COM ports anymore. I have not found any ill effects caused by this modification. If it doesn't work on your setup then just don't use it. :rolleyes:
Kolya on 23/9/2007 at 20:03
Good job Squatina! :D
Cesar on 26/9/2007 at 20:13
Very nice! I had to rely on making fake COM port(s) from my Bluetooth hardware. lol
Having the COM port problem was causing odd lag in System Shock.
RocketMan on 27/9/2007 at 00:17
lag? you mean the com ports were being accessed ingame as well?
Twist on 27/9/2007 at 02:38
This silly little error always irritated me.
Thank you for providing a solution!
Bjossi on 27/9/2007 at 03:25
I find it hard to believe that the game would try to access the COMs in-game.
But what a wonderful fix, the COM errors annoyed me very much. :sweat:
squatina on 27/9/2007 at 06:15
Thanks guys. It was my first post here, so I decided to make a grand entrance. :D
I don't think that SS ever tried to access the ports in game, because then the error would have popped up constantly. Unless ignoring the error once caused NTVDM to always ignore it automatically.