1
0
Fork 0

MakeEnv: added hack to allow creation from envblock in unused mem (0xCD)

Dos_Execute: extrabytes now added to the imagesize


Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@661
This commit is contained in:
Ulf Wohlers 2003-02-06 22:21:58 +00:00
parent 9be6cee6ac
commit 00080a4d9d

View file

@ -137,6 +137,9 @@ static bool MakeEnv(char * name,Bit16u * segment) {
}
if (parentenv) {
// hack to allow creation from envblock in unused mem (0xCD)
if (readw(envread)==0xCDCD) writew(envread,0x0000);
for (envsize=0; ;envsize++) {
if (envsize>=MAXENV - ENV_KEEPFREE) {
DOS_SetError(DOSERR_ENVIRONMENT_INVALID);
@ -230,7 +233,7 @@ bool DOS_Execute(char * name,PhysPt block_pt,Bit8u flags) {
else {
headersize=head.headersize*16;
imagesize=(head.pages)*512-headersize;
if (head.extrabytes) imagesize-=(512-head.extrabytes);
if (head.extrabytes) imagesize += head.extrabytes % 512;
}
if (flags!=OVERLAY) {
/* Create an environment block */