Permalink
Browse files

DOS EXE loader: If the EXE header specifies a minimum memory size gre…

…ater than maximum memory size, use the minimum memory size. This fixes Putrefaction!, where the initial SS:IP would otherwise cause DOSBox-X to exit with an error (out of range)
  • Loading branch information...
joncampbell123 committed Feb 11, 2018
1 parent df3a230 commit 666dd62ecb678228bfeb65205fd2061478395fdf
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/dos/dos_execute.cpp
@@ -353,6 +353,13 @@ bool DOS_Execute(char * name,PhysPt block_pt,Bit8u flags) {
minsize=long2para(imagesize+(head.minmemory<<4)+256);
if (head.maxmemory!=0) maxsize=long2para(imagesize+(head.maxmemory<<4)+256);
else maxsize=0xffff;
/* Bugfix: scene.org mirrors/hornet/demos/1991/putrefac.zip Putrefaction !PF.{3}
* has an EXE header that specifies a maxsize less than minsize, and a
* initial stack pointer that is only valid if we use the maxsize.
*
* This allows it to run without the SS:IP out of range error below. */
if (maxsize < minsize) maxsize = minsize;
}
if (maxfree<minsize) {
if (iscom) {

0 comments on commit 666dd62

Please sign in to comment.