Fixed Panel update on a reset

This commit is contained in:
Jeff Parsons 2017-01-26 11:28:59 -08:00 committed by Jeff Parsons
commit 284c2cd76b
5 changed files with 321 additions and 319 deletions

View file

@ -593,17 +593,20 @@ class CPUStatePDP11 extends CPUPDP11 {
if (!this.isRunning()) this.startCPU();
}
else {
if (this.dbg) {
if (this.dbg && this.flags.powered) {
/*
* TODO: Review the decision to always stop the CPU if the Debugger is loaded. Note that
* when stopCPU() stops a running CPU, the Debugger gets notified, so again, no need to notify it here.
* when stopCPU() stops a running CPU, the Debugger gets notified, so no need to notify it again.
*
* TODO: There are more serious problems to deal with if another component is slamming a new PC down
* the CPU's throat (presumably while also dropping some new code into RAM) while the CPU was still running;
* we should probably force a complete reset if the CPU is running, but for now, it's up to the user
* to hit the reset button themselves.
*/
if (!this.stopCPU()) this.dbg.updateStatus();
if (!this.stopCPU()) {
this.dbg.updateStatus();
this.cmp.updateDisplays(-1);
}
}
else if (fStart === false) {
this.stopCPU();

View file

@ -533,12 +533,9 @@ class PanelPDP11 extends Component {
displayValue(sLabel, nValue, cch)
{
if (this.bindings[sLabel]) {
if (nValue === undefined) {
this.setError("Value for " + sLabel + " is invalid");
this.cpu.stopCPU();
}
var sVal;
var nBase = this.dbg && this.dbg.nBase || 8;
nValue = nValue || 0;
if (!this.cpu.isRunning() || this.fDisplayLiveRegs) {
sVal = nBase == 8? Str.toOct(nValue, cch) : Str.toHex(nValue, cch);
} else {

View file

@ -137,12 +137,14 @@ class RAMPDP11 extends Component {
*/
delete this.aSymbols;
}
/*
* The Computer powers up the CPU last, at which point CPUState state is restored,
* which includes the Bus state, and since we use the Bus to allocate all our memory,
* memory contents are already restored for us, so we don't need the usual restore
* logic.
*/
if (!fRepower) {
/*
* Since we use the Bus to allocate all our memory, memory contents are already restored for us,
* so we don't save any state, and therefore no state should be restored. Just do a reset().
*/
this.assert(!data);
this.reset();
}
return true;
}