Eliminate redundant memory allocation messages

This commit is contained in:
Jeff Parsons 2015-03-05 22:08:13 -08:00 committed by jeffpar
commit f251da711b
3 changed files with 27 additions and 29 deletions

View file

@ -4,8 +4,8 @@
<computer id="deskpro386-ega-2048k" name="Compaq DeskPro 386" buswidth="32"/>
<cpu id="cpu386" model="80386" autostart="false"/>
<ram id="ramLow" addr="0x00000" test="true" size="0xa0000" comment="ROM BIOS memory test has NOT been disabled"/>
<ram id="ramCPQ" addr="0xfa0000" size="0x60000" comment="384Kb of Compaq memory at 0xFA0000"/>
<ram id="ramExt" addr="0x100000" size="0x100000" comment="1024Kb of extended memory at 0x100000"/>
<ram id="ramCPQ" addr="0xfa0000" size="0x60000" comment="Compaq memory at 0xFA0000"/>
<ram id="ramExt" addr="0x100000" size="0x100000" comment="Extended memory at 0x100000"/>
<rom id="romEGA" addr="0xc0000" size="0x4000" file="/devices/pc/video/ibm-ega.json" notify="videoEGA"/>
<rom id="romBIOS" addr="0xf8000" size="0x8000" alias="[0xf0000,0xffff0000,0xffff8000]" file="/devices/pc/bios/compaq/deskpro386/1988-01-28.json"/>
<video ref="/devices/pc/video/video-ega-128kb-lock.xml"/>

View file

@ -164,7 +164,14 @@ RAM.prototype.reset = function()
if (!this.fAllocated && this.sizeRAM) {
if (this.bus.addMemory(this.addrRAM, this.sizeRAM, Memory.TYPE.RAM)) {
this.fAllocated = true;
this.status(Math.floor(this.sizeRAM / 1024) + "Kb");
var status = Math.floor(this.sizeRAM / 1024) + "Kb";
if (this.comment) {
status += " (" + this.comment + ")";
this.comment = null;
}
this.status(status);
/*
* NOTE: I'm specifying MAXDEBUG for status() messages because I'm not yet sure I want these
* messages buried in the app, since they're seen only when a Control Panel is active. Another

View file

@ -775,22 +775,6 @@ X86CPU.prototype.initProcessor = function()
}
}
}
/*
* The memory dispatch tables; opMem refers to the active set, based on the current OPERAND size (dataSize),
* which is based foremost on segCS.dataSize, but can also be overridden by an OPERAND size instruction prefix.
*/
this.aaOpMem = [];
this.aaOpMem[2] = {
getWord: this.getShort.bind(this),
setWord: this.setShort.bind(this)
};
if (I386) {
this.aaOpMem[4] = {
getWord: this.getLong.bind(this),
setWord: this.setLong.bind(this)
};
}
};
/**
@ -1077,8 +1061,15 @@ X86CPU.prototype.setAddrSize = function()
*/
X86CPU.prototype.setDataSize = function()
{
this.opMem = this.aaOpMem[this.dataSize];
this.bOpcodeBias = (this.dataSize == 4? 256 : 0);
if (this.dataSize == 2) {
this.bOpcodeBias = 0;
this.getWord = this.getShort;
this.setWord = this.setShort;
} else {
this.bOpcodeBias = 256;
this.getWord = this.getLong;
this.setWord = this.setLong;
}
};
/**
@ -2397,7 +2388,7 @@ X86CPU.prototype.getEAWord = function(seg, off)
this.segEA = seg;
this.regEA = seg.checkRead(this.offEA = off, (I386? this.dataSize-1 : 1));
if (this.opFlags & X86.OPFLAG.NOREAD) return 0;
var w = I386? this.opMem.getWord(this.regEA) : this.getShort(this.regEA);
var w = this.getWord(this.regEA);
if (BACKTRACK) {
this.backTrack.btiEALo = this.backTrack.btiMemLo;
this.backTrack.btiEAHi = this.backTrack.btiMemHi;
@ -2484,7 +2475,7 @@ X86CPU.prototype.modEAWord = function(seg, off)
this.segEA = seg;
this.regEAWrite = this.regEA = seg.checkRead(this.offEA = off, (I386? this.dataSize-1 : 1));
if (this.opFlags & X86.OPFLAG.NOREAD) return 0;
var w = I386? this.opMem.getWord(this.regEA) : this.getShort(this.regEA);
var w = this.getWord(this.regEA);
if (BACKTRACK) {
this.backTrack.btiEALo = this.backTrack.btiMemLo;
this.backTrack.btiEAHi = this.backTrack.btiMemHi;
@ -2545,7 +2536,7 @@ X86CPU.prototype.setEAWord = function(w)
if (!I386) {
this.setShort(this.segEA.checkWrite(this.offEA, 1), w);
} else {
this.opMem.setWord(this.segEA.checkWrite(this.offEA, this.dataSize-1), w);
this.setWord(this.segEA.checkWrite(this.offEA, this.dataSize-1), w);
}
};
@ -2579,7 +2570,7 @@ X86CPU.prototype.getSOWord = function(seg, off)
if (!I386) {
return this.getShort(seg.checkRead(off, 1));
} else {
return this.opMem.getWord(seg.checkRead(off, this.dataSize-1));
return this.getWord(seg.checkRead(off, this.dataSize-1));
}
};
@ -2613,7 +2604,7 @@ X86CPU.prototype.setSOWord = function(seg, off, w)
if (!I386) {
this.setShort(seg.checkWrite(off, 1), w);
} else {
this.opMem.setWord(seg.checkWrite(off, this.dataSize-1), w);
this.setWord(seg.checkWrite(off, this.dataSize-1), w);
}
};
@ -2854,7 +2845,7 @@ X86CPU.prototype.getIPLong = function()
*/
X86CPU.prototype.getIPWord = function()
{
var w = (PREFETCH? this.getWordPrefetch(this.regLIP) : (I386? this.opMem.getWord(this.regLIP) : this.getShort(this.regLIP)));
var w = (PREFETCH? this.getWordPrefetch(this.regLIP) : this.getWord(this.regLIP));
if (BACKTRACK) {
this.bus.updateBackTrackCode(this.regLIP, this.backTrack.btiMemLo);
this.bus.updateBackTrackCode(this.regLIP + 1, this.backTrack.btiMemHi);
@ -2891,7 +2882,7 @@ X86CPU.prototype.getSIBAddr = function(mod)
*/
X86CPU.prototype.popWord = function()
{
var w = (I386? this.opMem.getWord(this.regLSP) : this.getShort(this.regLSP));
var w = this.getWord(this.regLSP);
this.regLSP += (I386? this.dataSize : 2);
if (this.regLSP > this.regLSPLimit) {
// TODO: Generate exception in protected mode
@ -2914,7 +2905,7 @@ X86CPU.prototype.pushWord = function(w)
// TODO: Generate exception in protected mode (and bail)
this.setSP(this.regLSP - this.segSS.base);
}
if (!I386) this.setShort(this.regLSP, w); else this.opMem.setWord(this.regLSP, w);
this.setWord(this.regLSP, w);
};
/**