diff --git a/src/dos/dos_memory.cpp b/src/dos/dos_memory.cpp index 30de8354..efe8a46c 100644 --- a/src/dos/dos_memory.cpp +++ b/src/dos/dos_memory.cpp @@ -16,6 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* $Id: dos_memory.cpp,v 1.44 2009-06-08 17:20:02 c2woody Exp $ */ + #include "dosbox.h" #include "mem.h" #include "dos_inc.h" @@ -45,7 +47,7 @@ static void DOS_CompressMemory(void) { void DOS_FreeProcessMemory(Bit16u pspseg) { Bit16u mcb_segment=dos.firstMCB; DOS_MCB mcb(mcb_segment); - while (true) { + for (;;) { if (mcb.GetPSPSeg()==pspseg) { mcb.SetPSPSeg(MCB_FREE); } @@ -64,7 +66,7 @@ void DOS_FreeProcessMemory(Bit16u pspseg) { Bit16u umb_start=dos_infoblock.GetStartOfUMBChain(); if (umb_start==UMB_START_SEG) { DOS_MCB umb_mcb(umb_start); - while (true) { + for (;;) { if (umb_mcb.GetPSPSeg()==pspseg) { umb_mcb.SetPSPSeg(MCB_FREE); } @@ -394,8 +396,8 @@ void DOS_SetupMemory(void) { * buggy games, which compare against the interrupt table. (probably a * broken linked list implementation) */ callbackhandler.Allocate(&DOS_default_handler,"DOS default int"); - Bitu ihseg = 0x70; - Bitu ihofs = 0x08; + Bit16u ihseg = 0x70; + Bit16u ihofs = 0x08; real_writeb(ihseg,ihofs+0x00,(Bit8u)0xFE); //GRP 4 real_writeb(ihseg,ihofs+0x01,(Bit8u)0x38); //Extra Callback instruction real_writew(ihseg,ihofs+0x02,callbackhandler.Get_callback()); //The immediate word @@ -434,12 +436,12 @@ void DOS_SetupMemory(void) { if (machine==MCH_TANDY) { /* memory up to 608k available, the rest (to 640k) is used by the tandy graphics system's variable mapping of 0xb800 */ - mcb.SetSize(0x97FE - DOS_MEM_START - mcb_sizes); + mcb.SetSize(0x97FF - DOS_MEM_START - mcb_sizes); } else if (machine==MCH_PCJR) { /* memory from 128k to 640k is available */ mcb_devicedummy.SetPt((Bit16u)0x2000); mcb_devicedummy.SetPSPSeg(MCB_FREE); - mcb_devicedummy.SetSize(0x9FFE - 0x2000); + mcb_devicedummy.SetSize(0x9FFF - 0x2000); mcb_devicedummy.SetType(0x5a); /* exclude PCJr graphics region */ @@ -453,6 +455,7 @@ void DOS_SetupMemory(void) { mcb.SetType(0x4d); } else { /* complete memory up to 640k available */ + /* last paragraph used to add UMB chain to low-memory MCB chain */ mcb.SetSize(0x9FFE - DOS_MEM_START - mcb_sizes); }