Fixed PCx86 to recover from situations where a page entered an "unloaded" state but wasn't actually unloaded.
This commit is contained in:
parent
8035a95cf9
commit
6c6f28c1ef
9 changed files with 2698 additions and 2630 deletions
|
|
@ -472,11 +472,20 @@ class CPU extends Component {
|
|||
case "run":
|
||||
this.bindings[sBinding] = control;
|
||||
control.onclick = function onClickRun() {
|
||||
var fRunning = cpu.flags.running;
|
||||
if (!cpu.cmp || !cpu.cmp.checkPower()) return;
|
||||
if (!cpu.flags.running)
|
||||
cpu.runCPU(true);
|
||||
else
|
||||
cpu.stopCPU(true);
|
||||
/*
|
||||
* We snapped the CPU's running flag before calling checkPower() because there are rare (REPOWER)
|
||||
* situations where checkPower() will have started the CPU as well. So toggle the CPU state ONLY
|
||||
* if the running flag remains unchanged.
|
||||
*/
|
||||
if (fRunning == cpu.flags.running) {
|
||||
if (!cpu.flags.running) {
|
||||
cpu.runCPU(true);
|
||||
} else {
|
||||
cpu.stopCPU(true);
|
||||
}
|
||||
}
|
||||
};
|
||||
fBound = true;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue