1
0
Fork 0

fake a 128k-PCJr when com files are loaded low (dos memory only)

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2417
This commit is contained in:
Sebastian Strohhäcker 2005-12-19 20:39:51 +00:00
parent 2d06e15795
commit ef5e7f519e
3 changed files with 22 additions and 9 deletions

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: dos_execute.cpp,v 1.52 2005-12-03 10:43:22 c2woody Exp $ */
/* $Id: dos_execute.cpp,v 1.53 2005-12-19 20:39:51 c2woody Exp $ */
#include <string.h>
#include <ctype.h>
@ -311,6 +311,14 @@ 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) {

View file

@ -49,7 +49,14 @@ void DOS_FreeProcessMemory(Bit16u pspseg) {
if (mcb.GetPSPSeg()==pspseg) {
mcb.SetPSPSeg(MCB_FREE);
}
if (mcb.GetType()==0x5a) break;
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;
}
mcb_segment+=mcb.GetSize()+1;
mcb.SetPt(mcb_segment);
}

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: dos_programs.cpp,v 1.48 2005-12-04 21:17:28 c2woody Exp $ */
/* $Id: dos_programs.cpp,v 1.49 2005-12-19 20:39:51 c2woody Exp $ */
#include <stdlib.h>
#include <string.h>
@ -287,7 +287,9 @@ public:
Bit16u seg,blocks;blocks=0xffff;
DOS_AllocateMemory(&seg,&blocks);
WriteOut(MSG_Get("PROGRAM_MEM_CONVEN"),blocks*16/1024);
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);
if (umb_start!=0xffff) {
DOS_LinkUMBsToMemChain(1);
@ -451,11 +453,7 @@ public:
fclose(usefile);
/* write cartridge data into ROM */
Bit16u romseg=0xe000;
if ((rombuf[7]==0x42) && (rombuf[8]==0x41) && (rombuf[9]==0x53) && (rombuf[10]==0x49)) {
/* BASIC rom, doesn't work though */
romseg=0xf600;
}
Bit16u romseg=host_readw(&bootarea.rawdata[0x1ce]);
for(i=0;i<rombytesize;i++) phys_writeb((romseg<<4)+i,rombuf[i]);
/* run cartridge setup */