1
0
Fork 0

Arrange stack to restore registers when a child PSP is terminated. Fixes crashes in some demos (Blashphemy by Fatal Justice, Dreamwar by Elfsong, Mystic by Xenogenesis, et al).

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3892
This commit is contained in:
ripsaw8080 2015-01-10 13:47:31 +00:00
parent 3e5241947c
commit 84bb06ea60

View file

@ -225,6 +225,10 @@ bool DOS_ChildPSP(Bit16u segment, Bit16u size) {
psp.SetFCB2(RealMake(parent_psp_seg,0x6c));
psp.SetEnvironment(psp_parent.GetEnvironment());
psp.SetSize(size);
// push registers in case child PSP is terminated
SaveRegisters();
psp.SetStack(RealMakeSeg(ss,reg_sp));
reg_sp+=18;
return true;
}