More PC8080 structural fixes
This commit is contained in:
parent
79fb14fdbf
commit
8971097b3b
9 changed files with 83 additions and 49 deletions
|
|
@ -2,15 +2,14 @@
|
|||
<?xml-stylesheet type="text/xsl" href="/versions/pc8080/1.21.7/machine.xsl"?>
|
||||
<machine id="invaders" class="pc8080" border="1" width="980px" pos="center" background="#FAEBD7">
|
||||
<name pos="center">Space Invaders</name>
|
||||
<computer id="cmpInvaders"/>
|
||||
<rom id="romE" addr="0x0000" size="0x0800" file="/devices/pc8080/rom/invaders/INVADERS-E.json"/>
|
||||
<rom id="romF" addr="0x0800" size="0x0800" file="/devices/pc8080/rom/invaders/INVADERS-F.json"/>
|
||||
<rom id="romG" addr="0x1000" size="0x0800" file="/devices/pc8080/rom/invaders/INVADERS-G.json"/>
|
||||
<rom id="romH" addr="0x1800" size="0x0800" file="/devices/pc8080/rom/invaders/INVADERS-H.json"/>
|
||||
<computer id="computer"/>
|
||||
<cpu id="cpu8080" model="8080" cycles="2000000"/>
|
||||
<rom id="romH" addr="0x0000" size="0x0800" file="/devices/pc8080/rom/invaders/INVADERS-H.json"/>
|
||||
<rom id="romG" addr="0x0800" size="0x0800" file="/devices/pc8080/rom/invaders/INVADERS-G.json"/>
|
||||
<rom id="romF" addr="0x1000" size="0x0800" file="/devices/pc8080/rom/invaders/INVADERS-F.json"/>
|
||||
<rom id="romE" addr="0x1800" size="0x0800" file="/devices/pc8080/rom/invaders/INVADERS-E.json"/>
|
||||
<ram id="ram" addr="0x2000" size="0x2000"/>
|
||||
<cpu id="cpu8080" model="8080" autostart="true" pos="left" padleft="8px" padbottom="8px">
|
||||
<control type="button" binding="run">Run</control>
|
||||
<control type="button" binding="reset">Reset</control>
|
||||
</cpu>
|
||||
<video id="video" screenwidth="256" screenheight="244" scale="true" aspect="1.33" rotate="90" addr="0x2000"/>
|
||||
<panel ref="/devices/pc8080/panel/default.xml"/>
|
||||
<debugger id="debugger"/>
|
||||
</machine>
|
||||
|
|
|
|||
45
devices/pc8080/panel/default.xml
Normal file
45
devices/pc8080/panel/default.xml
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<panel id="panel" width="100%" padding="8px">
|
||||
<name>Control Panel</name>
|
||||
<control type="container" class="pcjs-textarea" width="58%" padbottom="8px" padright="8px">
|
||||
<control type="textarea" binding="print" width="100%" height="260px" pos="relative" padbottom="4px" style="resize:vertical;"/>
|
||||
<control type="container">
|
||||
<control type="text" binding="debugInput" width="auto"/>
|
||||
<control type="button" binding="debugEnter">Enter</control>
|
||||
<control type="button" binding="clear">Clear</control>
|
||||
</control>
|
||||
</control>
|
||||
<control type="container" class="pcjs-registers" width="38%" padleft="8px">
|
||||
<control type="register" label="P" binding="PS" width="20px" padright="8px" padbottom="8px">00</control>
|
||||
<control type="register" label="A" binding="A" width="20px" padright="8px" padbottom="8px">00</control>
|
||||
<control pos=""/>
|
||||
<control type="register" label="B" binding="B" width="20px" padright="8px" padbottom="8px">00</control>
|
||||
<control type="register" label="C" binding="C" width="20px" padright="8px" padbottom="8px">00</control>
|
||||
<control pos=""/>
|
||||
<control type="register" label="D" binding="D" width="20px" padright="8px" padbottom="8px">00</control>
|
||||
<control type="register" label="E" binding="E" width="20px" padright="8px" padbottom="8px">00</control>
|
||||
<control pos=""/>
|
||||
<control type="register" label="H" binding="H" width="20px" padright="8px" padbottom="8px">00</control>
|
||||
<control type="register" label="L" binding="L" width="20px" padright="8px" padbottom="8px">00</control>
|
||||
<control pos=""/>
|
||||
<control type="register" label="SP" binding="SP" width="40px" padright="8px" padbottom="8px">0000</control>
|
||||
<control type="register" label="PC" binding="PC" width="40px" padright="8px" padbottom="8px">0000</control>
|
||||
<control type="container" width="200px" pos="left">
|
||||
<control type="flag" label="I" binding="I" width="8px" padright="4px" padbottom="8px">0</control>
|
||||
<control type="flag" label="S" binding="S" width="8px" padright="4px" padbottom="8px">0</control>
|
||||
<control type="flag" label="Z" binding="Z" width="8px" padright="4px" padbottom="8px">0</control>
|
||||
<control type="flag" label="A" binding="A" width="8px" padright="4px" padbottom="8px">0</control>
|
||||
<control type="flag" label="P" binding="P" width="8px" padright="4px" padbottom="8px">0</control>
|
||||
<control type="flag" label="C" binding="C" width="8px" padright="4px" padbottom="8px">0</control>
|
||||
</control>
|
||||
<control pos=""/>
|
||||
<control type="description" padbottom="8px">Speed:</control>
|
||||
<control type="description" binding="speed" padleft="4px" padbottom="8px">Stopped</control>
|
||||
</control>
|
||||
<control type="container" padleft="8px" padbottom="8px">
|
||||
<control type="button" binding="run">Run</control>
|
||||
<control type="button" binding="step">Step</control>
|
||||
<control type="button" binding="reset">Reset</control>
|
||||
<control type="button" binding="setSpeed">Fast</control>
|
||||
</control>
|
||||
</panel>
|
||||
|
|
@ -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"];
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
|
|
|||
Loading…
Reference in a new issue