Correct stack pointer for COM format programs when there is less than 64K of memory available. Fixes Corncob 3D issue reported in bug #443.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3988
This commit is contained in:
parent
c898d14351
commit
2b837cf6fb
1 changed files with 5 additions and 2 deletions
|
@ -419,8 +419,11 @@ bool DOS_Execute(char * name,PhysPt block_pt,Bit8u flags) {
|
|||
RealPt csip,sssp;
|
||||
if (iscom) {
|
||||
csip=RealMake(pspseg,0x100);
|
||||
sssp=RealMake(pspseg,0xfffe);
|
||||
mem_writew(PhysMake(pspseg,0xfffe),0);
|
||||
if (memsize<0x1000) {
|
||||
LOG(LOG_EXEC,LOG_WARN)("COM format with only %X paragraphs available",memsize);
|
||||
sssp=RealMake(pspseg,(memsize<<4)-2);
|
||||
} else sssp=RealMake(pspseg,0xfffe);
|
||||
mem_writew(Real2Phys(sssp),0);
|
||||
} else {
|
||||
csip=RealMake(loadseg+head.initCS,head.initIP);
|
||||
sssp=RealMake(loadseg+head.initSS,head.initSP);
|
||||
|
|
Loading…
Add table
Reference in a new issue