Laid the groundwork for bring PCx86 up-to-date with timer functionality matching PC8080 and PDPjs (new timer services added)
This commit is contained in:
parent
d8804faba0
commit
072b8fa2df
8 changed files with 1693 additions and 1493 deletions
|
|
@ -1847,7 +1847,7 @@ class X86CPU extends CPU {
|
|||
}
|
||||
state.set(1, a);
|
||||
state.set(2, [this.segData.sName, this.segStack.sName, this.opFlags, this.opPrefixes, this.intFlags, this.regEA, this.regEAWrite]);
|
||||
state.set(3, [0, this.nTotalCycles, this.getSpeed(), fRunning]);
|
||||
state.set(3, [0, this.nTotalCycles, this.getSpeed(), fRunning, this.saveTimers()]);
|
||||
state.set(4, this.bus.saveMemory(this.isPagingEnabled()));
|
||||
return state.data();
|
||||
}
|
||||
|
|
@ -1914,16 +1914,18 @@ class X86CPU extends CPU {
|
|||
this.opFlags = a[2];
|
||||
this.opPrefixes = a[3];
|
||||
this.intFlags = a[4];
|
||||
this.regEA = a[5];
|
||||
this.regEAWrite = a[6]; // save/restore of last EA calculation(s) isn't strictly necessary, but they may be of some interest to, say, the Debugger
|
||||
this.regEA = a[5]; // save/restore of last EA calculation(s) isn't strictly necessary,
|
||||
this.regEAWrite = a[6]; // but they may be of some interest to, say, the Debugger
|
||||
|
||||
a = data[3]; // a[0] was previously nBurstDivisor (no longer used)
|
||||
this.nTotalCycles = a[1];
|
||||
a = data[3];
|
||||
this.nTotalCycles = a[1]; // a[0] was previously nBurstDivisor (no longer used)
|
||||
this.setSpeed(a[2]); // old states didn't contain a value from getSpeed(), but setSpeed() checks
|
||||
if (a[3] != null) { // less old states didn't preserve the original running state, so we must check it
|
||||
this.flags.autoStart = a[3];
|
||||
}
|
||||
|
||||
if (a[4] != null) {
|
||||
this.restoreTimers(a[4]);
|
||||
}
|
||||
return fRestored;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue