checkCPMVector() actually checks CPM_VECTORS now
This commit is contained in:
parent
5b6f6756a2
commit
87d4c75712
5 changed files with 120 additions and 111 deletions
|
|
@ -112,7 +112,7 @@ function ROM(parmsROM)
|
|||
|
||||
Component.subclass(ROM);
|
||||
|
||||
ROM.FAKECPM_VECTORS = [0x0000, 0x0005];
|
||||
ROM.CPM_VECTORS = [0x0000, 0x0005];
|
||||
|
||||
/*
|
||||
* NOTE: There's currently no need for this component to have a reset() function, since
|
||||
|
|
@ -337,16 +337,16 @@ ROM.prototype.addROM = function(addr)
|
|||
if (this.fWritable && addr == 0x100) {
|
||||
/*
|
||||
* Here's where we enable our "Fake CP/M" support, triggered by the user loading a "writable ROM" image
|
||||
* at offset 0x100. Fake CP/M support works by installing HLT opcodes at well-known hard-coded CP/M offsets
|
||||
* at offset 0x100. Fake CP/M support works by installing HLT opcodes at well-known CP/M addresses
|
||||
* (namely, 0x0000, which is the CP/M reset vector, and 0x0005, which is the CP/M system call vector) and
|
||||
* then telling the CPU to call us whenever a HLT occurs, so we can check PC for one of these vectors.
|
||||
* then telling the CPU to call us whenever a HLT occurs, so we can check PC for one of these addresses.
|
||||
*/
|
||||
for (i = 0; i < ROM.FAKECPM_VECTORS.length; i++) {
|
||||
this.bus.setByteDirect(ROM.FAKECPM_VECTORS[i], CPUDef.OPCODE.HLT);
|
||||
for (i = 0; i < ROM.CPM_VECTORS.length; i++) {
|
||||
this.bus.setByteDirect(ROM.CPM_VECTORS[i], CPUDef.OPCODE.HLT);
|
||||
}
|
||||
|
||||
this.cpu.addHaltCheck(function(rom) {
|
||||
return function(addr) {rom.checkHalt(addr)};
|
||||
return function(addr) {rom.checkCPMVector(addr)};
|
||||
}(this));
|
||||
|
||||
this.cpu.setReset(addr);
|
||||
|
|
@ -360,18 +360,21 @@ ROM.prototype.addROM = function(addr)
|
|||
};
|
||||
|
||||
/**
|
||||
* checkHalt(addr)
|
||||
* checkCPMVector(addr)
|
||||
*
|
||||
* @this {ROM}
|
||||
* @param {number} addr (of the HLT opcode)
|
||||
* @return {boolean} true if special processing performed, false if not
|
||||
*/
|
||||
ROM.prototype.checkHalt = function(addr)
|
||||
ROM.prototype.checkCPMVector = function(addr)
|
||||
{
|
||||
var i = ROM.CPM_VECTORS.indexOf(addr);
|
||||
if (i >= 0) {
|
||||
if (this.dbg) {
|
||||
this.println("CP/M vector " + str.toHexWord(addr));
|
||||
this.cpu.setPC(addr); // this is purely for the Debugger's benefit, to show the HLT
|
||||
this.dbg.stopCPU();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -901,10 +901,16 @@
|
|||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="writable">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@writable"><xsl:value-of select="@writable"/></xsl:when>
|
||||
<xsl:otherwise>false</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">rom</xsl:with-param>
|
||||
<xsl:with-param name="parms">,addr:<xsl:value-of select="$addr"/>,size:<xsl:value-of select="$size"/>,alias:<xsl:value-of select="$alias"/>,file:'<xsl:value-of select="$file"/>',notify:'<xsl:value-of select="$notify"/>'</xsl:with-param>
|
||||
<xsl:with-param name="parms">,addr:<xsl:value-of select="$addr"/>,size:<xsl:value-of select="$size"/>,alias:<xsl:value-of select="$alias"/>,file:'<xsl:value-of select="$file"/>',notify:'<xsl:value-of select="$notify"/>',writable:<xsl:value-of select="$writable"/></xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
|
|
@ -1139,7 +1145,7 @@
|
|||
<xsl:choose>
|
||||
<xsl:when test="@buswidth"><xsl:value-of select="@buswidth"/></xsl:when>
|
||||
<xsl:when test="@busWidth"><xsl:value-of select="@busWidth"/></xsl:when>
|
||||
<xsl:otherwise>20</xsl:otherwise>
|
||||
<xsl:otherwise>0</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="resume">
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue