Cleaned up the handling of PS bits (not to be confused with PSW, which is PS combined with A); this fixes a bug where POP PSW was inadvertently disabling the internal interrupt flag (IF)

This commit is contained in:
Jeff Parsons 2016-05-05 13:04:46 -07:00
commit c80f22e23a
6 changed files with 203 additions and 170 deletions

View file

@ -2703,9 +2703,7 @@ CPUDef.opRP = function()
*/
CPUDef.opPOPSW = function()
{
var w = this.popWord();
this.setPS(w);
this.regA = w >> 8;
this.setPSW(this.popWord());
this.nStepCycles -= 10;
};
@ -2755,7 +2753,7 @@ CPUDef.opCP = function()
*/
CPUDef.opPUPSW = function()
{
this.pushWord((this.getPS() & 0xff) | (this.regA << 8));
this.pushWord(this.getPSW());
this.nStepCycles -= 11;
};