Merge branch 'master' of https://github.com/jeffpar/pcjs into c1pserialupload
This commit is contained in:
commit
e9e7633fa7
294 changed files with 10332 additions and 3960 deletions
|
|
@ -57,8 +57,8 @@ function C1PCPU(parmsCPU)
|
|||
Component.call(this, "C1PCPU", parmsCPU);
|
||||
|
||||
this.clearRegs();
|
||||
this.fPower = false;
|
||||
this.fRunning = false;
|
||||
this.aFlags.fPowered = false;
|
||||
this.aFlags.fRunning = false;
|
||||
this.fAutoStart = parmsCPU["autoStart"];
|
||||
|
||||
/*
|
||||
|
|
@ -482,7 +482,7 @@ Component.subclass(Component, C1PCPU);
|
|||
*/
|
||||
C1PCPU.prototype.reset = function(fPowerOn)
|
||||
{
|
||||
if (this.fRunning)
|
||||
if (this.aFlags.fRunning)
|
||||
this.halt();
|
||||
this.clearRegs();
|
||||
this.regPC = this.getWord(this.VECTOR_RESET);
|
||||
|
|
@ -516,7 +516,7 @@ C1PCPU.prototype.setBinding = function(c, t, s, e)
|
|||
this.bindings[s] = e;
|
||||
e.onclick = function(cpu) {
|
||||
return function() {
|
||||
if (!cpu.fRunning)
|
||||
if (!cpu.aFlags.fRunning)
|
||||
cpu.run();
|
||||
else
|
||||
cpu.halt();
|
||||
|
|
@ -579,7 +579,7 @@ C1PCPU.prototype.setBuffer = function(abMemory, start, end)
|
|||
*/
|
||||
C1PCPU.prototype.setPower = function(fOn, cmp)
|
||||
{
|
||||
if (fOn && !this.fPower) {
|
||||
if (fOn && !this.aFlags.fPowered) {
|
||||
this.cmp = cmp;
|
||||
/*
|
||||
* Attach the Debugger, if any, to the CPU, so that the CPU can periodically
|
||||
|
|
@ -607,7 +607,7 @@ C1PCPU.prototype.setPower = function(fOn, cmp)
|
|||
};
|
||||
}(video);
|
||||
}
|
||||
this.fPower = true;
|
||||
this.aFlags.fPowered = true;
|
||||
this.reset(true);
|
||||
this.update();
|
||||
}
|
||||
|
|
@ -880,7 +880,7 @@ C1PCPU.prototype.displayStatus = function()
|
|||
*/
|
||||
C1PCPU.prototype.isRunning = function()
|
||||
{
|
||||
return this.fRunning;
|
||||
return this.aFlags.fRunning;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -1051,7 +1051,7 @@ C1PCPU.prototype.run = function()
|
|||
if (this.cmp) this.cmp.stop(this.msRunStart, this.nRunCycles);
|
||||
return;
|
||||
}
|
||||
if (!this.fRunning) {
|
||||
if (!this.aFlags.fRunning) {
|
||||
/*
|
||||
* setSpeed() without a speed parameter leaves the selected speed in place, but also resets the
|
||||
* cycle counter and timestamp for the current series of run() calls, calculates the maximum number
|
||||
|
|
@ -1060,7 +1060,7 @@ C1PCPU.prototype.run = function()
|
|||
*/
|
||||
this.setSpeed();
|
||||
if (this.cmp) this.cmp.start();
|
||||
this.fRunning = true;
|
||||
this.aFlags.fRunning = true;
|
||||
if (this.bindings["run"]) this.bindings["run"].innerHTML = "Halt";
|
||||
this.setFocus();
|
||||
}
|
||||
|
|
@ -1107,7 +1107,7 @@ C1PCPU.prototype.run = function()
|
|||
this.nCyclesNextYield += this.nCyclesPerYield;
|
||||
break;
|
||||
}
|
||||
} while (this.fRunning);
|
||||
} while (this.aFlags.fRunning);
|
||||
}
|
||||
catch (e) {
|
||||
this.halt();
|
||||
|
|
@ -1268,8 +1268,8 @@ C1PCPU.prototype.halt = function()
|
|||
this.isBusy(true);
|
||||
this.nBurstCycles -= this.nStepCycles;
|
||||
this.nStepCycles = 0;
|
||||
if (this.fRunning) {
|
||||
this.fRunning = false;
|
||||
if (this.aFlags.fRunning) {
|
||||
this.aFlags.fRunning = false;
|
||||
if (this.bindings["run"]) this.bindings["run"].innerHTML = "Run";
|
||||
}
|
||||
};
|
||||
|
|
@ -1303,7 +1303,7 @@ C1PCPU.prototype.update = function()
|
|||
*/
|
||||
C1PCPU.prototype.getCycles = function()
|
||||
{
|
||||
return (this.fRunning? this.nRunCycles + this.nBurstCycles - this.nStepCycles : 0);
|
||||
return (this.aFlags.fRunning? this.nRunCycles + this.nBurstCycles - this.nStepCycles : 0);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -579,8 +579,8 @@ if (DEBUGGER) {
|
|||
*/
|
||||
C1PDebugger.prototype.setPower = function(fOn, cmp)
|
||||
{
|
||||
if (fOn && !this.fPower) {
|
||||
this.fPower = true;
|
||||
if (fOn && !this.aFlags.fPowered) {
|
||||
this.aFlags.fPowered = true;
|
||||
this.cpu = cmp.getComponentByType("cpu");
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ function C1PDiskController(parmsDC)
|
|||
{
|
||||
Component.call(this, "C1PDiskController", parmsDC);
|
||||
|
||||
this.fPower = false;
|
||||
this.aFlags.fPowered = false;
|
||||
|
||||
/*
|
||||
* Our DiskController simulates the combination of an MC6820 PIA and an MC6850 ACIA.
|
||||
|
|
@ -733,8 +733,8 @@ C1PDiskController.prototype.setBuffer = function(abMemory, start, end, cpu)
|
|||
*/
|
||||
C1PDiskController.prototype.setPower = function(fOn, cmp)
|
||||
{
|
||||
if (fOn && !this.fPower) {
|
||||
this.fPower = true;
|
||||
if (fOn && !this.aFlags.fPowered) {
|
||||
this.aFlags.fPowered = true;
|
||||
if (DEBUGGER) this.dbg = cmp.getComponentByType("debugger");
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ function C1PKeyboard(parmsKbd)
|
|||
{
|
||||
Component.call(this, "C1PKeyboard", parmsKbd);
|
||||
|
||||
this.fPower = false;
|
||||
this.aFlags.fPowered = false;
|
||||
this.nDefaultModel = parmsKbd['model'];
|
||||
|
||||
/*
|
||||
|
|
@ -516,8 +516,8 @@ C1PKeyboard.prototype.setModel = function(nModel)
|
|||
*/
|
||||
C1PKeyboard.prototype.setPower = function(fOn, cmp)
|
||||
{
|
||||
if (fOn && !this.fPower) {
|
||||
this.fPower = true;
|
||||
if (fOn && !this.aFlags.fPowered) {
|
||||
this.aFlags.fPowered = true;
|
||||
this.cmp = cmp;
|
||||
if (DEBUGGER) this.dbg = cmp.getComponentByType("debugger");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@
|
|||
<cpu id="cpu6502"/>
|
||||
<ram id="ram8K" size="0x2000"/>
|
||||
<rom id="romNull" size="0x8000"/>
|
||||
<rom id="romBasic" size="0x2000" image="/devices/c1p/roms/basic-gcpatch.hex"/>
|
||||
<rom id="romSystem" size="0x0800" image="/devices/c1p/roms/system.hex"/>
|
||||
<rom id="romBasic" size="0x2000" image="/devices/c1p/rom/basic-gcpatch.hex"/>
|
||||
<rom id="romSystem" size="0x0800" image="/devices/c1p/rom/system.hex"/>
|
||||
<video id="video" screenwidth="256" screenheight="192" cols="32" rows="32" charset="/devices/c1p/video/chargen1x.png" padding="8px"/>
|
||||
<keyboard id="keyboard">
|
||||
<control type="button" class="input" binding="ctrl-c">CTRL-C</control>
|
||||
|
|
@ -53,8 +53,8 @@
|
|||
the "bindings" that connect the components to the visual elements.</p>
|
||||
<p>Here are some working examples:
|
||||
<ul>
|
||||
<li><a href="/configs/c1p/machines/8kb/large/debugger/">Challenger 1P w/Debugger</a></li>
|
||||
<li><a href="/configs/c1p/machines/8kb/array/">Challenger 1P "Server Array" Demo</a></li>
|
||||
<li><a href="/devices/c1p/machine/8kb/large/debugger/">Challenger 1P w/Debugger</a></li>
|
||||
<li><a href="/devices/c1p/machine/8kb/array/">Challenger 1P "Server Array" Demo</a></li>
|
||||
</ul>
|
||||
</p>
|
||||
<p>Here's what a machine definition XML file typically looks like:
|
||||
|
|
@ -75,8 +75,8 @@
|
|||
<lt/>cpu id="cpu6502"/<gt/>
|
||||
<lt/>ram id="ram8K" size="0x2000"/<gt/>
|
||||
<lt/>rom id="romNull" size="0x8000"/<gt/>
|
||||
<lt/>rom id="romBasic" size="0x2000" image="/devices/c1p/roms/basic-gcpatch.hex"/<gt/>
|
||||
<lt/>rom id="romSystem" size="0x0800" image="/devices/c1p/roms/system.hex"/<gt/>
|
||||
<lt/>rom id="romBasic" size="0x2000" image="/devices/c1p/rom/basic-gcpatch.hex"/<gt/>
|
||||
<lt/>rom id="romSystem" size="0x0800" image="/devices/c1p/rom/system.hex"/<gt/>
|
||||
<lt/>video id="video" screenwidth="256" screenheight="192" cols="32" rows="32"
|
||||
charset="/devices/c1p/video/chargen1x.png" width="256px" padding="8px"/<gt/>
|
||||
<lt/>keyboard id="keyboard"<gt/>
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ function C1PPanel(parmsPanel)
|
|||
{
|
||||
Component.call(this, "C1PPanel", parmsPanel);
|
||||
|
||||
this.fPower = false;
|
||||
this.aFlags.fPowered = false;
|
||||
}
|
||||
|
||||
Component.subclass(Component, C1PPanel);
|
||||
|
|
@ -77,8 +77,8 @@ C1PPanel.prototype.setBinding = function(sHTMLClass, sHTMLType, sBinding, contro
|
|||
*/
|
||||
C1PPanel.prototype.setPower = function(fOn, cmp)
|
||||
{
|
||||
if (fOn && !this.fPower) {
|
||||
this.fPower = true;
|
||||
if (fOn && !this.aFlags.fPowered) {
|
||||
this.aFlags.fPowered = true;
|
||||
this.cmp = cmp;
|
||||
this.cpu = cmp.getComponentByType("cpu");
|
||||
this.kbd = cmp.getComponentByType("keyboard");
|
||||
|
|
|
|||
|
|
@ -115,8 +115,8 @@ C1PROM.prototype.setBuffer = function(abMemory, start, end, cpu)
|
|||
*/
|
||||
C1PROM.prototype.setPower = function(fOn, cmp)
|
||||
{
|
||||
if (fOn && !this.fPower) {
|
||||
this.fPower = true;
|
||||
if (fOn && !this.aFlags.fPowered) {
|
||||
this.aFlags.fPowered = true;
|
||||
if (DEBUGGER) this.dbg = cmp.getComponentByType("debugger");
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ function C1PSerialPort(parmsSerial)
|
|||
{
|
||||
Component.call(this, "C1PSerialPort", parmsSerial);
|
||||
|
||||
this.fPower = false;
|
||||
this.aFlags.fPowered = false;
|
||||
this.fDemo = parmsSerial['demo'];
|
||||
|
||||
this.STATUS_NONE = 0x00;
|
||||
|
|
@ -194,8 +194,8 @@ C1PSerialPort.prototype.setBuffer = function(abMemory, start, end, cpu)
|
|||
*/
|
||||
C1PSerialPort.prototype.setPower = function(fOn, cmp)
|
||||
{
|
||||
if (fOn && !this.fPower) {
|
||||
this.fPower = true;
|
||||
if (fOn && !this.aFlags.fPowered) {
|
||||
this.aFlags.fPowered = true;
|
||||
this.cmp = cmp;
|
||||
this.kbd = cmp.getComponentByType("keyboard");
|
||||
if (DEBUGGER) this.dbg = cmp.getComponentByType("debugger");
|
||||
|
|
|
|||
|
|
@ -308,8 +308,8 @@ C1PVideo.prototype.setPower = function(fOn, cmp)
|
|||
* it ourselves, too. This also means that updateScreen() need check only fPower and not isReady(),
|
||||
* since we guarantee that the former implies the latter.
|
||||
*/
|
||||
if (fOn && !this.fPower && this.isReady()) {
|
||||
this.fPower = true;
|
||||
if (fOn && !this.aFlags.fPowered && this.isReady()) {
|
||||
this.aFlags.fPowered = true;
|
||||
if (DEBUGGER) this.dbg = cmp.getComponentByType("debugger");
|
||||
/*
|
||||
* If we have an associated keyboard, then ensure that the keyboard will be notified whenever
|
||||
|
|
@ -328,8 +328,8 @@ C1PVideo.prototype.setPower = function(fOn, cmp)
|
|||
}
|
||||
}
|
||||
else
|
||||
if (!fOn && this.fPower) {
|
||||
this.fPower = false;
|
||||
if (!fOn && this.aFlags.fPowered) {
|
||||
this.aFlags.fPowered = false;
|
||||
/*
|
||||
* This is where we would add some method of blanking the display, without the disturbing the video
|
||||
* buffer contents, and blocking all further updates to the display.
|
||||
|
|
@ -442,7 +442,7 @@ C1PVideo.prototype.initScreen = function()
|
|||
C1PVideo.prototype.updateScreen = function()
|
||||
{
|
||||
var offset = 0;
|
||||
if (this.fPower) {
|
||||
if (this.aFlags.fPowered) {
|
||||
while (offset < this.cbScreen) {
|
||||
var b = this.abMem[this.offVideo + offset];
|
||||
if (this.abScreen[offset] != b) {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
<xsl:variable name="MACHINECLASS">c1p</xsl:variable>
|
||||
<xsl:variable name="APPCLASS">c1pjs</xsl:variable>
|
||||
<xsl:variable name="APPVERSION">1.0.0</xsl:variable>
|
||||
<xsl:variable name="APPVERSION">1.x.x</xsl:variable>
|
||||
<xsl:variable name="SITEHOST">www.pcjs.org</xsl:variable>
|
||||
|
||||
<xsl:template name="componentStyles">
|
||||
|
|
|
|||
Loading…
Reference in a new issue