diff --git a/src/dos/dos_execute.cpp b/src/dos/dos_execute.cpp index c089a06b..29ccb928 100644 --- a/src/dos/dos_execute.cpp +++ b/src/dos/dos_execute.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_execute.cpp,v 1.51 2005-10-17 20:17:08 c2woody Exp $ */ +/* $Id: dos_execute.cpp,v 1.52 2005-12-03 10:43:22 c2woody Exp $ */ #include #include @@ -274,6 +274,7 @@ bool DOS_Execute(char * name,PhysPt block_pt,Bit8u flags) { if (imagesize+headersize<512) imagesize = 512-headersize; } } + Bit8u * loadbuf=(Bit8u *)new Bit8u[0x10000]; if (flags!=OVERLAY) { /* Create an environment block */ envseg=block.exec.envseg; @@ -285,6 +286,14 @@ bool DOS_Execute(char * name,PhysPt block_pt,Bit8u flags) { Bit16u minsize,maxsize;Bit16u maxfree=0xffff;DOS_AllocateMemory(&pspseg,&maxfree); if (iscom) { minsize=0x1000;maxsize=0xffff; + if (machine==MCH_PCJR) { + /* try to load file into memory below 96k */ + pos=0;DOS_SeekFile(fhandle,&pos,DOS_SEEK_SET); + Bit16u dataread=0x1800; + DOS_ReadFile(fhandle,loadbuf,&dataread); + if (dataread<0x1800) maxsize=dataread; + if (minsize>maxsize) minsize=maxsize; + } } else { /* Exe size calculated from header */ minsize=long2para(imagesize+(head.minmemory<<4)+256); if (head.maxmemory!=0) maxsize=long2para(imagesize+(head.maxmemory<<4)+256); @@ -298,6 +307,11 @@ bool DOS_Execute(char * name,PhysPt block_pt,Bit8u flags) { if (maxfree #include @@ -1048,6 +1048,10 @@ public: Section_prop * section=static_cast(configuration); if (!section->Get_bool("ems")) return; + if (machine==MCH_PCJR) { + LOG_MSG("EMS disabled for PCJr machine"); + return; + } BIOS_ZeroExtendedSize(true); int67.Install(&INT67_Handler,CB_IRET,"Int 67 ems"); Bit16u call_int67=int67.Get_callback();