More PC8080 structural fixes

This commit is contained in:
Jeff Parsons 2016-04-20 13:37:37 -07:00
commit 8971097b3b
9 changed files with 83 additions and 49 deletions

View file

@ -882,7 +882,7 @@ CPUSim.prototype.updateINTR = function(fRaise)
};
/**
* updateReg(sReg, nValue)
* updateReg(sReg, nValue, cch)
*
* This function helps updateStatus() by massaging the register names and values according to
* CPU type before passing the call to displayValue(); in the "old days", updateStatus() called
@ -891,24 +891,11 @@ CPUSim.prototype.updateINTR = function(fRaise)
* @this {CPUSim}
* @param {string} sReg
* @param {number} nValue
* @param {number} [cch] (default is 2 hex digits)
*/
CPUSim.prototype.updateReg = function(sReg, nValue)
CPUSim.prototype.updateReg = function(sReg, nValue, cch)
{
var cch = 4;
if (sReg.length == 1) {
cch = 1;
nValue = nValue? 1 : 0;
}
if (this.model < 80386) {
if (sReg.length > 2) {
sReg = sReg.substr(1, 2);
}
} else {
if (sReg == "PS" || sReg.length > 2) {
cch = 8;
}
}
this.displayValue(sReg, nValue, cch);
this.displayValue(sReg, nValue, cch || 2);
};
/**
@ -934,15 +921,15 @@ CPUSim.prototype.updateStatus = function(fForce)
this.updateReg("E", this.regE);
this.updateReg("H", this.regH);
this.updateReg("L", this.regL);
this.updateReg("SP", this.getSP());
this.updateReg("PC", this.getPC());
this.updateReg("SP", this.getSP(), 4);
this.updateReg("PC", this.getPC(), 4);
var regPS = this.getPS();
this.updateReg("PS", regPS);
this.updateReg("S", (regPS & CPUDef.PS.SF));
this.updateReg("Z", (regPS & CPUDef.PS.ZF));
this.updateReg("A", (regPS & CPUDef.PS.AF));
this.updateReg("P", (regPS & CPUDef.PS.PF));
this.updateReg("C", (regPS & CPUDef.PS.CF));
this.updateReg("PS", regPS, 2);
this.updateReg("S", (regPS & CPUDef.PS.SF), 1);
this.updateReg("Z", (regPS & CPUDef.PS.ZF), 1);
this.updateReg("A", (regPS & CPUDef.PS.AF), 1);
this.updateReg("P", (regPS & CPUDef.PS.PF), 1);
this.updateReg("C", (regPS & CPUDef.PS.CF), 1);
}
}
var controlSpeed = this.bindings["speed"];

View file

@ -152,7 +152,7 @@ Panel.prototype.updateStatus = function(fForce)
* any associated HTML controls to the new component.
*
* NOTE: Unlike most other component init() functions, this one is designed to be
* called multiple times: once at load time, so that we can binding our print()
* called multiple times: once at load time, so that we can bind our print()
* function to the panel's output control ASAP, and again when the Computer component
* is verifying that all components are ready and invoking their powerUp() functions.
*

View file

@ -66,6 +66,7 @@ if (NODE) {
function Video(parmsVideo, canvas, context, textarea, container)
{
Component.call(this, "Video", parmsVideo, Video, Messages.VIDEO);
this.setReady();
}
Component.subclass(Video);

View file

@ -961,7 +961,7 @@ Panel.prototype.centerText = function(sText)
* any associated HTML controls to the new component.
*
* NOTE: Unlike most other component init() functions, this one is designed to be
* called multiple times: once at load time, so that we can binding our print()
* called multiple times: once at load time, so that we can bind our print()
* function to the panel's output control ASAP, and again when the Computer component
* is verifying that all components are ready and invoking their powerUp() functions.
*

View file

@ -459,7 +459,9 @@ Component.getComponentByID = function(id, idRelated)
return Component.components[i];
}
}
Component.log("Component ID '" + id + "' not found", "warning");
if (Component.components.length) {
Component.log("Component ID '" + id + "' not found", "warning");
}
}
return null;
};
@ -582,7 +584,7 @@ Component.bindComponentControls = function(component, element, sAppClass)
parms = Component.getComponentParms(control);
if (parms && parms['binding']) {
component.setBinding(parms['type'], parms['binding'], control, parms['value']);
} else {
} else if (!parms || parms['type'] != "description") {
Component.log("Component '" + component.toString() + "' missing binding" + (parms? " for " + parms['type'] : ""), "warning");
}
iClass = aClasses.length;

View file

@ -39,7 +39,7 @@
float: left;
font-family: "Lucida Console", monospace;
}
.pcjs-control textarea {
.pcjs-controls textarea {
font-family: Monaco, monospace;
font-size: x-small;
}

View file

@ -222,7 +222,7 @@
<div class="{$APPCLASS}-{$class}-object" data-value="{{id:'{$id}',name:'{$name}'{$comment}{$parms}}}"> </div>
</xsl:if>
<xsl:if test="control">
<div class="{$APPCLASS}-controls">
<div class="{$CSSCLASS}-controls">
<xsl:apply-templates select="control" mode="component"/>
</div>
</xsl:if>
@ -376,30 +376,30 @@
</xsl:if>
<xsl:choose>
<xsl:when test="@type = 'canvas'">
<canvas class="{$CSSCLASS}-binding {$CSSCLASS}-canvas" width="{@width}" height="{@height}" style="-webkit-user-select:none;{$border}{$fontsize}{$style}" data-value="{{{$type},{$binding}}}"><xsl:apply-templates/></canvas>
<canvas class="{$APPCLASS}-binding {$CSSCLASS}-canvas" width="{@width}" height="{@height}" style="-webkit-user-select:none;{$border}{$fontsize}{$style}" data-value="{{{$type},{$binding}}}"><xsl:apply-templates/></canvas>
</xsl:when>
<xsl:when test="@type = 'button'">
<button class="{$CSSCLASS}-binding" style="-webkit-user-select:none;{$border}{$width}{$height}{$fontsize}{$style}" data-value="{{{$type},{$binding},{$value}}}"><xsl:apply-templates/></button>
<button class="{$APPCLASS}-binding" style="-webkit-user-select:none;{$border}{$width}{$height}{$fontsize}{$style}" data-value="{{{$type},{$binding},{$value}}}"><xsl:apply-templates/></button>
</xsl:when>
<xsl:when test="@type = 'list'">
<select class="{$CSSCLASS}-binding" style="{$border}{$width}{$height}{$fontsize}{$style}" data-value="{{{$type},{$binding}}}">
<select class="{$APPCLASS}-binding" style="{$border}{$width}{$height}{$fontsize}{$style}" data-value="{{{$type},{$binding}}}">
<xsl:apply-templates select="disk|app|manifest" mode="component"/>
</select>
</xsl:when>
<xsl:when test="@type = 'text'">
<input class="{$CSSCLASS}-binding" type="text" style="{$border}{$width}{$height}{$style}" data-value="{{{$type},{$binding}}}" value="{.}" autocapitalize="off" autocorrect="off"/>
<input class="{$APPCLASS}-binding" type="text" style="{$border}{$width}{$height}{$style}" data-value="{{{$type},{$binding}}}" value="{.}" autocapitalize="off" autocorrect="off"/>
</xsl:when>
<xsl:when test="@type = 'submit'">
<input class="{$CSSCLASS}-binding" type="submit" style="{$border}{$fontsize}{$style}" data-value="{{{$type},{$binding}}}" value="{.}"/>
<input class="{$APPCLASS}-binding" type="submit" style="{$border}{$fontsize}{$style}" data-value="{{{$type},{$binding}}}" value="{.}"/>
</xsl:when>
<xsl:when test="@type = 'textarea'">
<textarea class="{$CSSCLASS}-binding" style="{$border}{$width}{$height}{$style}" data-value="{{{$type},{$binding}}}" readonly="readonly" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"> </textarea>
<textarea class="{$APPCLASS}-binding" style="{$border}{$width}{$height}{$style}" data-value="{{{$type},{$binding}}}" readonly="readonly" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"> </textarea>
</xsl:when>
<xsl:when test="@type = 'heading'">
<div><xsl:value-of select="."/></div>
</xsl:when>
<xsl:when test="@type = 'file'">
<form class="{$CSSCLASS}-binding" data-value="{{{$type},{$binding}}}">
<form class="{$APPCLASS}-binding" data-value="{{{$type},{$binding}}}">
<fieldset class="{$CSSCLASS}-fieldset">
<input type="file"/>
<input type="submit" value="Mount" disabled="true"/>
@ -407,7 +407,7 @@
</form>
</xsl:when>
<xsl:when test="@type = 'led'">
<div class="{$CSSCLASS}-binding {$CSSCLASS}-{@type}" data-value="{{{$type},{$binding}}}"><xsl:value-of select="."/></div>
<div class="{$APPCLASS}-binding {$CSSCLASS}-{@type}" data-value="{{{$type},{$binding}}}"><xsl:value-of select="."/></div>
</xsl:when>
<xsl:when test="@type = 'separator'">
<hr/>
@ -419,7 +419,7 @@
<div style="clear:both"> </div>
</xsl:when>
<xsl:otherwise>
<div class="{$CSSCLASS}-binding{$subClass} {$CSSCLASS}-{@type}" style="-webkit-user-select:none;{$border}{$width}{$height}{$fontsize}{$style}" data-value="{{{$type},{$binding}}}"><xsl:apply-templates/></div>
<div class="{$APPCLASS}-binding{$subClass} {$CSSCLASS}-{@type}" style="-webkit-user-select:none;{$border}{$width}{$height}{$fontsize}{$style}" data-value="{{{$type},{$binding}}}"><xsl:apply-templates/></div>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="@label">