krivulak wrote: ↑
Mon Apr 13, 2020 21:22
Back then I found out that I can manage to make about 604k free conventional memory, but Keen never seems to allocate more than 350k with standard M$ memory manager.
I think you're comparing apples and oranges here. Those 604k of free conventional memory is how much free memory you have before
starting the game. The number that's shown in the game's startup screen is how much free conventional memory you have after
the game executable was loaded into memory. The executables usually take up over 200k of memory on their own, so this big difference is totally normal. Just check out the screenshot in the first post of this thread.
If you want to get this sorted out (assuming you can get your 486 back in working order), you should start with plain, unmodded Keen 4 and tweak your startup files to get the most out of your system. If you load DOS high and don't load any unnecessary drivers and TSRs, you should be able to get to a point where you have about 617k (or more) free conventional memory under DOS. That's the amount you see when you type MEM at the DOS prompt. That means an absolute bare-bones configuration without CD-ROM drivers or anything like that.
Try creating a boot disk with the CONFIG.SYS settings I listed in the first post of this thread. The AUTOEXEC.BAT file on that boot disk should be empty. Boot from that boot disk and see how much free conventional memory you have under DOS. Also check the startup screen of KEEN4 and compare it to the one I posted. The number for "Expanded" should always be either 0 (no EMS) or 64k (with EMS). The other values may vary. You can probalby get even more than 74k of "Extended" (XMS) memory, depending on your system, but you might also get less, as reported by keenmaster486.
Unless you can get vanilla KEEN4 to show a total of 513k or more (which is how much memory is available in DOSBox), you will probably run into memory problems when trying to play mods on the same system using the same memory configuration. If you can't get the game to use XMS as well as EMS, you won't be able to get anywhere near those 513k of total available memory and the chances of getting any mods to run properly are extremely slim. And in order to allow the game to use XMS, you cannot let DOS use UMBs, which is what this thread was all about in the first place.
The problem with most mods is that modders develop them primarily for DOSBox and keep putting more and more stuff into the game levels until they run out of memory in DOSBox and are forced to stop. Sometimes these issues get fixed before release, but not always.
There is one additional thing you can try to free up a few kilobytes of memory for mods, and that is to get rid of CKPATCH. All mods of Keen 4-6 and Dreams need CKPATCH to modify parts of the game's executable in order to run. The CKPATCH program takes up about 22k of memory, so any Keen mod that uses CKPATCH will have about 22k less available memory than the orignal games on the same system. You can use my patching utility
to create a fully patched executable for each mod, so you don't have to start the mod via CKPATCH anymore and therefore free up those 22k for the game. But you'll have to modify the patch script a little for this to work, since my tool is not 100% compatible with CKPATCH.
And just FYI, the reason why conventional memory is limited to 640k is that the 8086/8088 processors only had 1 megabyte of address space. Anything above 640k was reserved for accessing hardware other than the main memory. As I mentioned before, the EGA (and VGA) video memory starts at 640k. If I remember correctly, the first IBM PCs shipped with only 64k of memory, so the famous claim that "640k should be enough for everybody" would have made sense back then. Fun fact: if your PC only has a CGA or MDA video card, you can actually have 704k of conventional memory.