1
0
Fork 0

in tandy mode remove unused buffer-paragraph reserved for UMB chain (ripsaw), fixes mech warrior tandy

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3420
This commit is contained in:
Sebastian Strohhäcker 2009-06-08 17:20:02 +00:00
parent 20f226de90
commit a070990e1b

View file

@ -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);
}