VOGONS


First post, by DivByZero

User metadata
Rank Newbie
Rank
Newbie

When setting up a real 486 with Dos 6.22, I setup patched versions of the Ultima games using the various collections of fan-made patches. The "Ultima Patcher" here was helpful:
https://github.com/Fenyx4/UltimaPatcher
This patcher installs the "Ultima 2 Upgrade 2.1" from "The Exodus Project" here:
https://exodus.voyd.net/2018/06/15/ultima-2-upgrade-v2-1/
This very helpful patch adds EGA graphics to Ultima II. It's been around since 2018, and works fine outside real DOS environments (dosbox, old windows, etc), but when you try and launch it in a real DOS environment, you get this error when running ULTIMA2.COM:

Error launching Ultima II

and when running ULTIMAII.EXE directly you get this message:

Error in EXE file

People note as much in the comments section of the release page I linked above, with no resolution provided. I tried to give one there, but my message went into moderation approval and was deleted without any explanation, so I'm posting a fix here for the benefit of everyone.

So the Ultima 2 upgrade patch is bad. It breaks the MS-DOS header at the start of the file, specifically the "e_cblp" and "e_cp" fields. The patch incorrectly changes the reported size of the file, but it only modifies bytes in the file, it doesn't append anything, so changing the size simply stops the exe from being recognized as valid and DOS (correctly) refuses to load it, since the size doesn't match. The filesize in bytes should be ((e_cp - 1) * 512) + e_cblp, anything else won't launch. This ONLY breaks things running under true DOS, not Windows or under DosBox, since they ignore the MS-DOS header, but if you try running the patched exe under a true dos 6.22 install for example, that's when you'll get the error. To fix it, you simply need to restore the correct fields in the header, patching two bytes total. I've attached a python script which will do exactly that. Just run it in the ultima2 install folder after installing the "Ultima 2 Upgrade 2.1" and it'll fix the game so it runs under DOS.

On a different issue, while researching this problem, I saw comments from people about a recent update to the GoG version of this game (March 2025 I believe) that breaks the update. While this is true, it's also easy to fix. The updated version changes the DOSBox machine type from "svga" to "cga", which while technically correct for the original game obviously poses a problem when an EGA upgrade has been done. To fix this, simply change "machine=cga" to "machine=svga_s3" in "dosboxULTIMA2.conf". Secondly, the new launch script runs "ULTIMAII.EXE" directly, when it needs to run "ULTIMA2.COM" instead after the patch is installed. To fix, just change "dosboxULTIMA2_single.conf" to run the correct program.

Hopefully the UltimaPatcher project incorporates these fixes soon, which is definitely an easier way to patch these games.