Disable UMB on PCjr machine type; fixes broken MCB chain. Remove 128k PCjr faking from r2417 that was effectively disabled by r3420.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4164
This commit is contained in:
parent
bfd322cff7
commit
52d5501842
3 changed files with 4 additions and 21 deletions
|
@ -356,14 +356,6 @@ bool DOS_Execute(char * name,PhysPt block_pt,Bit8u flags) {
|
|||
maxsize=0xffff;
|
||||
/* resize to full extent of memory block */
|
||||
DOS_ResizeMemory(pspseg,&maxsize);
|
||||
/* now try to lock out memory above segment 0x2000 */
|
||||
if ((real_readb(0x2000,0)==0x5a) && (real_readw(0x2000,1)==0) && (real_readw(0x2000,3)==0x7ffe)) {
|
||||
/* MCB after PCJr graphics memory region is still free */
|
||||
if (pspseg+maxsize==0x17ff) {
|
||||
DOS_MCB cmcb((Bit16u)(pspseg-1));
|
||||
cmcb.SetType(0x5a); // last block
|
||||
}
|
||||
}
|
||||
}
|
||||
loadseg=pspseg+16;
|
||||
if (!iscom) {
|
||||
|
|
|
@ -50,14 +50,7 @@ void DOS_FreeProcessMemory(Bit16u pspseg) {
|
|||
if (mcb.GetPSPSeg()==pspseg) {
|
||||
mcb.SetPSPSeg(MCB_FREE);
|
||||
}
|
||||
if (mcb.GetType()==0x5a) {
|
||||
/* check if currently last block reaches up to the PCJr graphics memory */
|
||||
if ((machine==MCH_PCJR) && (mcb_segment+mcb.GetSize()==0x17fe) &&
|
||||
(real_readb(0x17ff,0)==0x4d) && (real_readw(0x17ff,1)==8)) {
|
||||
/* re-enable the memory past segment 0x2000 */
|
||||
mcb.SetType(0x4d);
|
||||
} else break;
|
||||
}
|
||||
if (mcb.GetType()==0x5a) break;
|
||||
if (GCC_UNLIKELY(mcb.GetType()!=0x4d)) E_Exit("Corrupt MCB chain");
|
||||
mcb_segment+=mcb.GetSize()+1;
|
||||
mcb.SetPt(mcb_segment);
|
||||
|
@ -307,10 +300,10 @@ bool DOS_FreeMemory(Bit16u segment) {
|
|||
|
||||
|
||||
void DOS_BuildUMBChain(bool umb_active,bool ems_active) {
|
||||
if (umb_active && (machine!=MCH_TANDY)) {
|
||||
if (umb_active && (!IS_TANDY_ARCH)) {
|
||||
Bit16u first_umb_seg = 0xd000;
|
||||
Bit16u first_umb_size = 0x2000;
|
||||
if(ems_active || (machine == MCH_PCJR)) first_umb_size = 0x1000;
|
||||
if(ems_active) first_umb_size = 0x1000;
|
||||
|
||||
dos_infoblock.SetStartOfUMBChain(UMB_START_SEG);
|
||||
dos_infoblock.SetUMBChainState(0); // UMBs not linked yet
|
||||
|
|
|
@ -441,9 +441,7 @@ public:
|
|||
|
||||
Bit16u seg,blocks;blocks=0xffff;
|
||||
DOS_AllocateMemory(&seg,&blocks);
|
||||
if ((machine==MCH_PCJR) && (real_readb(0x2000,0)==0x5a) && (real_readw(0x2000,1)==0) && (real_readw(0x2000,3)==0x7ffe)) {
|
||||
WriteOut(MSG_Get("PROGRAM_MEM_CONVEN"),0x7ffe*16/1024);
|
||||
} else WriteOut(MSG_Get("PROGRAM_MEM_CONVEN"),blocks*16/1024);
|
||||
WriteOut(MSG_Get("PROGRAM_MEM_CONVEN"),blocks*16/1024);
|
||||
|
||||
if (umb_start!=0xffff) {
|
||||
DOS_LinkUMBsToMemChain(1);
|
||||
|
|
Loading…
Add table
Reference in a new issue