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:
parent
913425791e
commit
c80f22e23a
6 changed files with 203 additions and 170 deletions
|
|
@ -69,7 +69,7 @@ var CPUDef = {
|
||||||
BIT5: 0x0020, // bit 5: reserved, always clear
|
BIT5: 0x0020, // bit 5: reserved, always clear
|
||||||
ZF: 0x0040, // bit 6: Zero flag
|
ZF: 0x0040, // bit 6: Zero flag
|
||||||
SF: 0x0080, // bit 7: Sign flag
|
SF: 0x0080, // bit 7: Sign flag
|
||||||
ALL: 0x00D5, // CF, PF, AF, ZF, SF
|
ALL: 0x00D5, // all "arithmetic" flags (CF, PF, AF, ZF, SF)
|
||||||
MASK: 0x00FF, //
|
MASK: 0x00FF, //
|
||||||
IF: 0x0200 // bit 9: Interrupt flag (for internal use only)
|
IF: 0x0200 // bit 9: Interrupt flag (for internal use only)
|
||||||
},
|
},
|
||||||
|
|
@ -113,18 +113,19 @@ var CPUDef = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Some PS flags are stored directly in regPS, hence the "direct" designation.
|
* These are the internal PS bits (outside of PS.MASK) that getPS() and setPS() can get and set,
|
||||||
|
* but which cannot be seen with any of the documented instructions.
|
||||||
*/
|
*/
|
||||||
CPUDef.PS.DIRECT = (CPUDef.PS.IF);
|
CPUDef.PS.INTERNAL = (CPUDef.PS.IF);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* However, PS "arithmetic" flags are NOT stored in regPS; they are maintained across
|
* PS "arithmetic" flags are NOT stored in regPS; they are maintained across separate result registers,
|
||||||
* separate result registers, hence the "indirect" designation.
|
* hence the RESULT designation.
|
||||||
*/
|
*/
|
||||||
CPUDef.PS.INDIRECT = (CPUDef.PS.CF | CPUDef.PS.PF | CPUDef.PS.AF | CPUDef.PS.ZF | CPUDef.PS.SF);
|
CPUDef.PS.RESULT = (CPUDef.PS.CF | CPUDef.PS.PF | CPUDef.PS.AF | CPUDef.PS.ZF | CPUDef.PS.SF);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These are the default "always set" PS bits for the 8080.
|
* These are the "always set" PS bits for the 8080.
|
||||||
*/
|
*/
|
||||||
CPUDef.PS.SET = (CPUDef.PS.BIT1);
|
CPUDef.PS.SET = (CPUDef.PS.BIT1);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2703,9 +2703,7 @@ CPUDef.opRP = function()
|
||||||
*/
|
*/
|
||||||
CPUDef.opPOPSW = function()
|
CPUDef.opPOPSW = function()
|
||||||
{
|
{
|
||||||
var w = this.popWord();
|
this.setPSW(this.popWord());
|
||||||
this.setPS(w);
|
|
||||||
this.regA = w >> 8;
|
|
||||||
this.nStepCycles -= 10;
|
this.nStepCycles -= 10;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -2755,7 +2753,7 @@ CPUDef.opCP = function()
|
||||||
*/
|
*/
|
||||||
CPUDef.opPUPSW = function()
|
CPUDef.opPUPSW = function()
|
||||||
{
|
{
|
||||||
this.pushWord((this.getPS() & 0xff) | (this.regA << 8));
|
this.pushWord(this.getPSW());
|
||||||
this.nStepCycles -= 11;
|
this.nStepCycles -= 11;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -162,8 +162,7 @@ CPUSim.prototype.resetRegs = function()
|
||||||
this.setPC(this.addrReset);
|
this.setPC(this.addrReset);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This resets the Processor Status flags (regPS), along with all the internal "result registers";
|
* This resets the Processor Status flags (regPS), along with all the internal "result registers".
|
||||||
* we've taken care to ensure that both CPL and IOPL are initialized before this first setPS() call.
|
|
||||||
*/
|
*/
|
||||||
this.setPS(0);
|
this.setPS(0);
|
||||||
|
|
||||||
|
|
@ -415,6 +414,16 @@ CPUSim.prototype.setPC = function(off)
|
||||||
this.regPC = off & 0xffff;
|
this.regPC = off & 0xffff;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clearCF()
|
||||||
|
*
|
||||||
|
* @this {CPUSim}
|
||||||
|
*/
|
||||||
|
CPUSim.prototype.clearCF = function()
|
||||||
|
{
|
||||||
|
this.resultZeroCarry &= 0xff;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getCF()
|
* getCF()
|
||||||
*
|
*
|
||||||
|
|
@ -426,121 +435,6 @@ CPUSim.prototype.getCF = function()
|
||||||
return (this.resultZeroCarry & 0x100)? CPUDef.PS.CF : 0;
|
return (this.resultZeroCarry & 0x100)? CPUDef.PS.CF : 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* getPF()
|
|
||||||
*
|
|
||||||
* @this {CPUSim}
|
|
||||||
* @return {number} 0 or CPUDef.PS.PF
|
|
||||||
*/
|
|
||||||
CPUSim.prototype.getPF = function()
|
|
||||||
{
|
|
||||||
return (CPUDef.PARITY[this.resultParitySign & 0xff])? CPUDef.PS.PF : 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* getAF()
|
|
||||||
*
|
|
||||||
* @this {CPUSim}
|
|
||||||
* @return {number} 0 or CPUDef.PS.AF
|
|
||||||
*/
|
|
||||||
CPUSim.prototype.getAF = function()
|
|
||||||
{
|
|
||||||
return ((this.resultParitySign ^ this.resultAuxOverflow) & 0x10)? CPUDef.PS.AF : 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* getZF()
|
|
||||||
*
|
|
||||||
* @this {CPUSim}
|
|
||||||
* @return {number} 0 or CPUDef.PS.ZF
|
|
||||||
*/
|
|
||||||
CPUSim.prototype.getZF = function()
|
|
||||||
{
|
|
||||||
return (this.resultZeroCarry & 0xff)? 0 : CPUDef.PS.ZF;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* getSF()
|
|
||||||
*
|
|
||||||
* @this {CPUSim}
|
|
||||||
* @return {number} 0 or CPUDef.PS.SF
|
|
||||||
*/
|
|
||||||
CPUSim.prototype.getSF = function()
|
|
||||||
{
|
|
||||||
return (this.resultParitySign & 0x80)? CPUDef.PS.SF : 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* getIF()
|
|
||||||
*
|
|
||||||
* @this {CPUSim}
|
|
||||||
* @return {number} 0 or CPUDef.PS.IF
|
|
||||||
*/
|
|
||||||
CPUSim.prototype.getIF = function()
|
|
||||||
{
|
|
||||||
return (this.regPS & CPUDef.PS.IF);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clearCF()
|
|
||||||
*
|
|
||||||
* @this {CPUSim}
|
|
||||||
*/
|
|
||||||
CPUSim.prototype.clearCF = function()
|
|
||||||
{
|
|
||||||
this.resultZeroCarry &= 0xff;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clearPF()
|
|
||||||
*
|
|
||||||
* @this {CPUSim}
|
|
||||||
*/
|
|
||||||
CPUSim.prototype.clearPF = function()
|
|
||||||
{
|
|
||||||
if (this.getPF()) this.resultParitySign ^= 0x1;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clearAF()
|
|
||||||
*
|
|
||||||
* @this {CPUSim}
|
|
||||||
*/
|
|
||||||
CPUSim.prototype.clearAF = function()
|
|
||||||
{
|
|
||||||
this.resultAuxOverflow = (this.resultParitySign & 0x10) | (this.resultAuxOverflow & ~0x10);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clearZF()
|
|
||||||
*
|
|
||||||
* @this {CPUSim}
|
|
||||||
*/
|
|
||||||
CPUSim.prototype.clearZF = function()
|
|
||||||
{
|
|
||||||
this.resultZeroCarry |= 0xff;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clearSF()
|
|
||||||
*
|
|
||||||
* @this {CPUSim}
|
|
||||||
*/
|
|
||||||
CPUSim.prototype.clearSF = function()
|
|
||||||
{
|
|
||||||
if (this.getSF()) this.resultParitySign ^= 0xc0;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clearIF()
|
|
||||||
*
|
|
||||||
* @this {CPUSim}
|
|
||||||
*/
|
|
||||||
CPUSim.prototype.clearIF = function()
|
|
||||||
{
|
|
||||||
this.regPS &= ~CPUDef.PS.IF;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setCF()
|
* setCF()
|
||||||
*
|
*
|
||||||
|
|
@ -551,71 +445,6 @@ CPUSim.prototype.setCF = function()
|
||||||
this.resultZeroCarry |= 0x100;
|
this.resultZeroCarry |= 0x100;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* setPF()
|
|
||||||
*
|
|
||||||
* @this {CPUSim}
|
|
||||||
*/
|
|
||||||
CPUSim.prototype.setPF = function()
|
|
||||||
{
|
|
||||||
if (!this.getPF()) this.resultParitySign ^= 0x1;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* setAF()
|
|
||||||
*
|
|
||||||
* @this {CPUSim}
|
|
||||||
*/
|
|
||||||
CPUSim.prototype.setAF = function()
|
|
||||||
{
|
|
||||||
this.resultAuxOverflow = (~this.resultParitySign & 0x10) | (this.resultAuxOverflow & ~0x10);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* setZF()
|
|
||||||
*
|
|
||||||
* @this {CPUSim}
|
|
||||||
*/
|
|
||||||
CPUSim.prototype.setZF = function()
|
|
||||||
{
|
|
||||||
this.resultZeroCarry &= ~0xff;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* setSF()
|
|
||||||
*
|
|
||||||
* @this {CPUSim}
|
|
||||||
*/
|
|
||||||
CPUSim.prototype.setSF = function()
|
|
||||||
{
|
|
||||||
if (!this.getSF()) this.resultParitySign ^= 0xc0;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* setIF()
|
|
||||||
*
|
|
||||||
* @this {CPUSim}
|
|
||||||
*/
|
|
||||||
CPUSim.prototype.setIF = function()
|
|
||||||
{
|
|
||||||
this.regPS |= CPUDef.PS.IF;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* updateAF(fAuxCarry)
|
|
||||||
*
|
|
||||||
* @this {CPUSim}
|
|
||||||
* @param {boolean} fAuxCarry
|
|
||||||
*/
|
|
||||||
CPUSim.prototype.updateAF = function(fAuxCarry)
|
|
||||||
{
|
|
||||||
if (fAuxCarry) {
|
|
||||||
this.setAF();
|
|
||||||
} else {
|
|
||||||
this.clearAF();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* updateCF(fCarry)
|
* updateCF(fCarry)
|
||||||
*
|
*
|
||||||
|
|
@ -631,6 +460,176 @@ CPUSim.prototype.updateCF = function(fCarry)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clearPF()
|
||||||
|
*
|
||||||
|
* @this {CPUSim}
|
||||||
|
*/
|
||||||
|
CPUSim.prototype.clearPF = function()
|
||||||
|
{
|
||||||
|
if (this.getPF()) this.resultParitySign ^= 0x1;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getPF()
|
||||||
|
*
|
||||||
|
* @this {CPUSim}
|
||||||
|
* @return {number} 0 or CPUDef.PS.PF
|
||||||
|
*/
|
||||||
|
CPUSim.prototype.getPF = function()
|
||||||
|
{
|
||||||
|
return (CPUDef.PARITY[this.resultParitySign & 0xff])? CPUDef.PS.PF : 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* setPF()
|
||||||
|
*
|
||||||
|
* @this {CPUSim}
|
||||||
|
*/
|
||||||
|
CPUSim.prototype.setPF = function()
|
||||||
|
{
|
||||||
|
if (!this.getPF()) this.resultParitySign ^= 0x1;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clearAF()
|
||||||
|
*
|
||||||
|
* @this {CPUSim}
|
||||||
|
*/
|
||||||
|
CPUSim.prototype.clearAF = function()
|
||||||
|
{
|
||||||
|
this.resultAuxOverflow = (this.resultParitySign & 0x10) | (this.resultAuxOverflow & ~0x10);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getAF()
|
||||||
|
*
|
||||||
|
* @this {CPUSim}
|
||||||
|
* @return {number} 0 or CPUDef.PS.AF
|
||||||
|
*/
|
||||||
|
CPUSim.prototype.getAF = function()
|
||||||
|
{
|
||||||
|
return ((this.resultParitySign ^ this.resultAuxOverflow) & 0x10)? CPUDef.PS.AF : 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* setAF()
|
||||||
|
*
|
||||||
|
* @this {CPUSim}
|
||||||
|
*/
|
||||||
|
CPUSim.prototype.setAF = function()
|
||||||
|
{
|
||||||
|
this.resultAuxOverflow = (~this.resultParitySign & 0x10) | (this.resultAuxOverflow & ~0x10);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* updateAF(fAuxCarry)
|
||||||
|
*
|
||||||
|
* @this {CPUSim}
|
||||||
|
* @param {boolean} fAuxCarry
|
||||||
|
*/
|
||||||
|
CPUSim.prototype.updateAF = function(fAuxCarry)
|
||||||
|
{
|
||||||
|
if (fAuxCarry) {
|
||||||
|
this.setAF();
|
||||||
|
} else {
|
||||||
|
this.clearAF();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clearZF()
|
||||||
|
*
|
||||||
|
* @this {CPUSim}
|
||||||
|
*/
|
||||||
|
CPUSim.prototype.clearZF = function()
|
||||||
|
{
|
||||||
|
this.resultZeroCarry |= 0xff;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getZF()
|
||||||
|
*
|
||||||
|
* @this {CPUSim}
|
||||||
|
* @return {number} 0 or CPUDef.PS.ZF
|
||||||
|
*/
|
||||||
|
CPUSim.prototype.getZF = function()
|
||||||
|
{
|
||||||
|
return (this.resultZeroCarry & 0xff)? 0 : CPUDef.PS.ZF;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* setZF()
|
||||||
|
*
|
||||||
|
* @this {CPUSim}
|
||||||
|
*/
|
||||||
|
CPUSim.prototype.setZF = function()
|
||||||
|
{
|
||||||
|
this.resultZeroCarry &= ~0xff;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clearSF()
|
||||||
|
*
|
||||||
|
* @this {CPUSim}
|
||||||
|
*/
|
||||||
|
CPUSim.prototype.clearSF = function()
|
||||||
|
{
|
||||||
|
if (this.getSF()) this.resultParitySign ^= 0xc0;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getSF()
|
||||||
|
*
|
||||||
|
* @this {CPUSim}
|
||||||
|
* @return {number} 0 or CPUDef.PS.SF
|
||||||
|
*/
|
||||||
|
CPUSim.prototype.getSF = function()
|
||||||
|
{
|
||||||
|
return (this.resultParitySign & 0x80)? CPUDef.PS.SF : 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* setSF()
|
||||||
|
*
|
||||||
|
* @this {CPUSim}
|
||||||
|
*/
|
||||||
|
CPUSim.prototype.setSF = function()
|
||||||
|
{
|
||||||
|
if (!this.getSF()) this.resultParitySign ^= 0xc0;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clearIF()
|
||||||
|
*
|
||||||
|
* @this {CPUSim}
|
||||||
|
*/
|
||||||
|
CPUSim.prototype.clearIF = function()
|
||||||
|
{
|
||||||
|
this.regPS &= ~CPUDef.PS.IF;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getIF()
|
||||||
|
*
|
||||||
|
* @this {CPUSim}
|
||||||
|
* @return {number} 0 or CPUDef.PS.IF
|
||||||
|
*/
|
||||||
|
CPUSim.prototype.getIF = function()
|
||||||
|
{
|
||||||
|
return (this.regPS & CPUDef.PS.IF);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* setIF()
|
||||||
|
*
|
||||||
|
* @this {CPUSim}
|
||||||
|
*/
|
||||||
|
CPUSim.prototype.setIF = function()
|
||||||
|
{
|
||||||
|
this.regPS |= CPUDef.PS.IF;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getPS()
|
* getPS()
|
||||||
*
|
*
|
||||||
|
|
@ -639,7 +638,7 @@ CPUSim.prototype.updateCF = function(fCarry)
|
||||||
*/
|
*/
|
||||||
CPUSim.prototype.getPS = function()
|
CPUSim.prototype.getPS = function()
|
||||||
{
|
{
|
||||||
return (this.regPS & ~CPUDef.PS.INDIRECT) | (this.getSF() | this.getZF() | this.getAF() | this.getPF() | this.getCF());
|
return (this.regPS & ~CPUDef.PS.RESULT) | (this.getSF() | this.getZF() | this.getAF() | this.getPF() | this.getCF());
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -656,8 +655,31 @@ CPUSim.prototype.setPS = function(regPS)
|
||||||
if (regPS & CPUDef.PS.AF) this.resultAuxOverflow |= 0x10;
|
if (regPS & CPUDef.PS.AF) this.resultAuxOverflow |= 0x10;
|
||||||
if (!(regPS & CPUDef.PS.ZF)) this.resultZeroCarry |= 0xff;
|
if (!(regPS & CPUDef.PS.ZF)) this.resultZeroCarry |= 0xff;
|
||||||
if (regPS & CPUDef.PS.SF) this.resultParitySign ^= 0xc0;
|
if (regPS & CPUDef.PS.SF) this.resultParitySign ^= 0xc0;
|
||||||
this.regPS = (this.regPS & ~CPUDef.PS.DIRECT) | (regPS & CPUDef.PS.DIRECT) | CPUDef.PS.SET;
|
this.regPS = (this.regPS & ~(CPUDef.PS.RESULT | CPUDef.PS.INTERNAL)) | (regPS & CPUDef.PS.INTERNAL) | CPUDef.PS.SET;
|
||||||
Component.assert((regPS & CPUDef.PS.INDIRECT) == (this.getPS() & CPUDef.PS.INDIRECT));
|
Component.assert((regPS & CPUDef.PS.RESULT) == (this.getPS() & CPUDef.PS.RESULT));
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getPSW()
|
||||||
|
*
|
||||||
|
* @this {CPUSim}
|
||||||
|
* @return {number}
|
||||||
|
*/
|
||||||
|
CPUSim.prototype.getPSW = function()
|
||||||
|
{
|
||||||
|
return (this.getPS() & CPUDef.PS.MASK) | (this.regA << 8);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* setPSW(w)
|
||||||
|
*
|
||||||
|
* @this {CPUSim}
|
||||||
|
* @param {number} w
|
||||||
|
*/
|
||||||
|
CPUSim.prototype.setPSW = function(w)
|
||||||
|
{
|
||||||
|
this.setPS((w & CPUDef.PS.MASK) | (this.regPS & ~CPUDef.PS.MASK));
|
||||||
|
this.regA = w >> 8;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -321,10 +321,15 @@ if (DEBUGGER) {
|
||||||
Debugger.REG_HL = 0x0A;
|
Debugger.REG_HL = 0x0A;
|
||||||
Debugger.REG_SP = 0x0B;
|
Debugger.REG_SP = 0x0B;
|
||||||
Debugger.REG_PC = 0x0C;
|
Debugger.REG_PC = 0x0C;
|
||||||
Debugger.REG_PS = 0x0D; // aka PSW (aka AF if Z80-style mnemonics)
|
Debugger.REG_PS = 0x0D;
|
||||||
|
Debugger.REG_PSW = 0x0E; // aka AF if Z80-style mnemonics
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NOTE: "PS" is the complete processor status, which includes bits like the Interrupt flag (IF),
|
||||||
|
* which is NOT the same as "PSW", which is the low 8 bits of "PS" combined with "A" in the high byte.
|
||||||
|
*/
|
||||||
Debugger.REGS = [
|
Debugger.REGS = [
|
||||||
"B", "C", "D", "E", "H", "L", "M", "A", "BC", "DE", "HL", "SP", "PC", "PSW"
|
"B", "C", "D", "E", "H", "L", "M", "A", "BC", "DE", "HL", "SP", "PC", "PS", "PSW"
|
||||||
];
|
];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -370,7 +375,7 @@ if (DEBUGGER) {
|
||||||
Debugger.TYPE_HL = (Debugger.REG_HL << 8 | Debugger.TYPE_REG | Debugger.TYPE_WORD);
|
Debugger.TYPE_HL = (Debugger.REG_HL << 8 | Debugger.TYPE_REG | Debugger.TYPE_WORD);
|
||||||
Debugger.TYPE_SP = (Debugger.REG_SP << 8 | Debugger.TYPE_REG | Debugger.TYPE_WORD);
|
Debugger.TYPE_SP = (Debugger.REG_SP << 8 | Debugger.TYPE_REG | Debugger.TYPE_WORD);
|
||||||
Debugger.TYPE_PC = (Debugger.REG_PC << 8 | Debugger.TYPE_REG | Debugger.TYPE_WORD);
|
Debugger.TYPE_PC = (Debugger.REG_PC << 8 | Debugger.TYPE_REG | Debugger.TYPE_WORD);
|
||||||
Debugger.TYPE_PS = (Debugger.REG_PS << 8 | Debugger.TYPE_REG | Debugger.TYPE_WORD);
|
Debugger.TYPE_PSW = (Debugger.REG_PSW<< 8 | Debugger.TYPE_REG | Debugger.TYPE_WORD);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TYPE_OTHER bit definitions
|
* TYPE_OTHER bit definitions
|
||||||
|
|
@ -642,11 +647,11 @@ if (DEBUGGER) {
|
||||||
/* 0xEE */ [Debugger.INS.XRI, Debugger.TYPE_A | Debugger.TYPE_OPT, Debugger.TYPE_IMM | Debugger.TYPE_BYTE],
|
/* 0xEE */ [Debugger.INS.XRI, Debugger.TYPE_A | Debugger.TYPE_OPT, Debugger.TYPE_IMM | Debugger.TYPE_BYTE],
|
||||||
/* 0xEF */ [Debugger.INS.RST, Debugger.TYPE_INT],
|
/* 0xEF */ [Debugger.INS.RST, Debugger.TYPE_INT],
|
||||||
/* 0xF0 */ [Debugger.INS.RP],
|
/* 0xF0 */ [Debugger.INS.RP],
|
||||||
/* 0xF1 */ [Debugger.INS.POP, Debugger.TYPE_PS],
|
/* 0xF1 */ [Debugger.INS.POP, Debugger.TYPE_PSW],
|
||||||
/* 0xF2 */ [Debugger.INS.JP, Debugger.TYPE_ADDR],
|
/* 0xF2 */ [Debugger.INS.JP, Debugger.TYPE_ADDR],
|
||||||
/* 0xF3 */ [Debugger.INS.DI],
|
/* 0xF3 */ [Debugger.INS.DI],
|
||||||
/* 0xF4 */ [Debugger.INS.CP, Debugger.TYPE_ADDR],
|
/* 0xF4 */ [Debugger.INS.CP, Debugger.TYPE_ADDR],
|
||||||
/* 0xF5 */ [Debugger.INS.PUSH, Debugger.TYPE_PS],
|
/* 0xF5 */ [Debugger.INS.PUSH, Debugger.TYPE_PSW],
|
||||||
/* 0xF6 */ [Debugger.INS.ORI, Debugger.TYPE_A | Debugger.TYPE_OPT, Debugger.TYPE_IMM | Debugger.TYPE_BYTE],
|
/* 0xF6 */ [Debugger.INS.ORI, Debugger.TYPE_A | Debugger.TYPE_OPT, Debugger.TYPE_IMM | Debugger.TYPE_BYTE],
|
||||||
/* 0xF7 */ [Debugger.INS.RST, Debugger.TYPE_INT],
|
/* 0xF7 */ [Debugger.INS.RST, Debugger.TYPE_INT],
|
||||||
/* 0xF8 */ [Debugger.INS.RM],
|
/* 0xF8 */ [Debugger.INS.RM],
|
||||||
|
|
@ -1347,8 +1352,8 @@ if (DEBUGGER) {
|
||||||
if (off == null) {
|
if (off == null) {
|
||||||
i = usr.indexOf(Debugger.REGS, sReg);
|
i = usr.indexOf(Debugger.REGS, sReg);
|
||||||
} else {
|
} else {
|
||||||
i = usr.indexOf(Debugger.REGS, sReg.substr(off, 3));
|
i = usr.indexOf(Debugger.REGS, sReg.substr(off, 2));
|
||||||
if (i < 0) i = usr.indexOf(Debugger.REGS, sReg.substr(off, 2));
|
if (i < 0) i = usr.indexOf(Debugger.REGS, sReg.substr(off, 1));
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
};
|
};
|
||||||
|
|
@ -1382,6 +1387,7 @@ if (DEBUGGER) {
|
||||||
case Debugger.REG_SP:
|
case Debugger.REG_SP:
|
||||||
case Debugger.REG_PC:
|
case Debugger.REG_PC:
|
||||||
case Debugger.REG_PS:
|
case Debugger.REG_PS:
|
||||||
|
case Debugger.REG_PSW:
|
||||||
cch = 4;
|
cch = 4;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -1442,7 +1448,10 @@ if (DEBUGGER) {
|
||||||
n = cpu.getPC();
|
n = cpu.getPC();
|
||||||
break;
|
break;
|
||||||
case Debugger.REG_PS:
|
case Debugger.REG_PS:
|
||||||
n = (cpu.regA << 8) | (cpu.getPS() & 0xff);
|
n = cpu.getPS();
|
||||||
|
break;
|
||||||
|
case Debugger.REG_PSW:
|
||||||
|
n = cpu.getPSW();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
@ -2581,29 +2590,29 @@ if (DEBUGGER) {
|
||||||
{
|
{
|
||||||
var b;
|
var b;
|
||||||
switch (sFlag) {
|
switch (sFlag) {
|
||||||
case 'I':
|
case "IF":
|
||||||
b = this.cpu.getIF();
|
b = this.cpu.getIF();
|
||||||
break;
|
break;
|
||||||
case 'S':
|
case "SF":
|
||||||
b = this.cpu.getSF();
|
b = this.cpu.getSF();
|
||||||
break;
|
break;
|
||||||
case 'Z':
|
case "ZF":
|
||||||
b = this.cpu.getZF();
|
b = this.cpu.getZF();
|
||||||
break;
|
break;
|
||||||
case 'A':
|
case "AF":
|
||||||
b = this.cpu.getAF();
|
b = this.cpu.getAF();
|
||||||
break;
|
break;
|
||||||
case 'P':
|
case "PF":
|
||||||
b = this.cpu.getPF();
|
b = this.cpu.getPF();
|
||||||
break;
|
break;
|
||||||
case 'C':
|
case "CF":
|
||||||
b = this.cpu.getCF();
|
b = this.cpu.getCF();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
b = 0;
|
b = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return sFlag + (b? '1' : '0') + ' ';
|
return sFlag.charAt(0) + (b? '1' : '0') + ' ';
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -2624,7 +2633,7 @@ if (DEBUGGER) {
|
||||||
*
|
*
|
||||||
* Sample 8080 register dump:
|
* Sample 8080 register dump:
|
||||||
*
|
*
|
||||||
* A=00 BC=0000 DE=0000 HL=0000 SP=0000 PSW=0002 I0 S0 Z0 A0 P0 C0
|
* A=00 BC=0000 DE=0000 HL=0000 SP=0000 I0 S0 Z0 A0 P0 C0
|
||||||
* 0000 00 NOP
|
* 0000 00 NOP
|
||||||
*
|
*
|
||||||
* @this {Debugger}
|
* @this {Debugger}
|
||||||
|
|
@ -2638,8 +2647,8 @@ if (DEBUGGER) {
|
||||||
this.getRegOutput(Debugger.REG_DE) +
|
this.getRegOutput(Debugger.REG_DE) +
|
||||||
this.getRegOutput(Debugger.REG_HL) +
|
this.getRegOutput(Debugger.REG_HL) +
|
||||||
this.getRegOutput(Debugger.REG_SP) +
|
this.getRegOutput(Debugger.REG_SP) +
|
||||||
this.getFlagOutput('I') + this.getFlagOutput('S') + this.getFlagOutput('Z') +
|
this.getFlagOutput("IF") + this.getFlagOutput("SF") + this.getFlagOutput("ZF") +
|
||||||
this.getFlagOutput('A') + this.getFlagOutput('P') + this.getFlagOutput('C');
|
this.getFlagOutput("AF") + this.getFlagOutput("PF") + this.getFlagOutput("CF");
|
||||||
return s;
|
return s;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -4131,22 +4140,25 @@ if (DEBUGGER) {
|
||||||
case "PS":
|
case "PS":
|
||||||
cpu.setPS(w);
|
cpu.setPS(w);
|
||||||
break;
|
break;
|
||||||
case 'C':
|
case "PSW":
|
||||||
|
cpu.setPSW(w);
|
||||||
|
break;
|
||||||
|
case "CF":
|
||||||
if (w) cpu.setCF(); else cpu.clearCF();
|
if (w) cpu.setCF(); else cpu.clearCF();
|
||||||
break;
|
break;
|
||||||
case 'P':
|
case "PF":
|
||||||
if (w) cpu.setPF(); else cpu.clearPF();
|
if (w) cpu.setPF(); else cpu.clearPF();
|
||||||
break;
|
break;
|
||||||
case 'A':
|
case "AF":
|
||||||
if (w) cpu.setAF(); else cpu.clearAF();
|
if (w) cpu.setAF(); else cpu.clearAF();
|
||||||
break;
|
break;
|
||||||
case 'Z':
|
case "ZF":
|
||||||
if (w) cpu.setZF(); else cpu.clearZF();
|
if (w) cpu.setZF(); else cpu.clearZF();
|
||||||
break;
|
break;
|
||||||
case 'S':
|
case "SF":
|
||||||
if (w) cpu.setSF(); else cpu.clearSF();
|
if (w) cpu.setSF(); else cpu.clearSF();
|
||||||
break;
|
break;
|
||||||
case 'I':
|
case "IF":
|
||||||
if (w) cpu.setIF(); else cpu.clearIF();
|
if (w) cpu.setIF(); else cpu.clearIF();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -13,32 +13,32 @@ function v(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id;this.name=b.
|
||||||
if(window){Pa||(Pa=window.location.search.substr(1));for(var Ra,Sa=/\+/g,Ta=/([^&=]+)=?([^&]*)/g;Ra=Ta.exec(Pa);)Qa[decodeURIComponent(Ra[1].replace(Sa," "))]=decodeURIComponent(Ra[2].replace(Sa," "))}function Ua(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}
|
if(window){Pa||(Pa=window.location.search.substr(1));for(var Ra,Sa=/\+/g,Ta=/([^&=]+)=?([^&]*)/g;Ra=Ta.exec(Pa);)Qa[decodeURIComponent(Ra[1].replace(Sa," "))]=decodeURIComponent(Ra[2].replace(Sa," "))}function Ua(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}
|
||||||
function Va(a,b){b||(b=v);a.prototype=Ua(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}var y=[],Wa={};function Xa(a,b,c){Wa[a]&&b&&(Wa[a][b]=c)}function Ya(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<y.length;b++){var d=y[b];a&&d.id.indexOf(a)||c.push(d)}return c}
|
function Va(a,b){b||(b=v);a.prototype=Ua(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}var y=[],Wa={};function Xa(a,b,c){Wa[a]&&b&&(Wa[a][b]=c)}function Ya(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<y.length;b++){var d=y[b];a&&d.id.indexOf(a)||c.push(d)}return c}
|
||||||
function Za(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<y.length;d++)if(c)c==y[d]&&(c=null);else if(!(a!=y[d].type||b&&y[d].id.indexOf(b)))return y[d]}return null}function z(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){t(c.message+" ("+a+")")}return b}
|
function Za(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<y.length;d++)if(c)c==y[d]&&(c=null);else if(!(a!=y[d].type||b&&y[d].id.indexOf(b)))return y[d]}return null}function z(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){t(c.message+" ("+a+")")}return b}
|
||||||
function bb(a,b){for(var c=C(b.parentNode,"pc8080-control"),d=0;d<c.length;d++)for(var e=c[d].childNodes,f=0;f<e.length;f++){var h=e[f];if(1===h.nodeType){var g=h.getAttribute("class");if(g)for(var l=g.split(" "),k=0;k<l.length;k++)switch(g=l[k],g){case "pc8080-binding":(g=z(h))&&g.binding&&a.pa(g.type,g.binding,h,g.value),k=l.length}}}}
|
function $a(a,b){for(var c=C(b.parentNode,"pc8080-control"),d=0;d<c.length;d++)for(var e=c[d].childNodes,f=0;f<e.length;f++){var h=e[f];if(1===h.nodeType){var g=h.getAttribute("class");if(g)for(var l=g.split(" "),k=0;k<l.length;k++)switch(g=l[k],g){case "pc8080-binding":(g=z(h))&&g.binding&&a.qa(g.type,g.binding,h,g.value),k=l.length}}}}
|
||||||
function C(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
|
function C(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
|
||||||
v.prototype={constructor:v,parent:null,toString:function(){return this.name?this.name:this.id||this.type},pa:function(a,b,c){switch(b){case "clear":return this.T[b]||(this.T[b]=c,c.onclick=function(a){return function(){a.T.print&&(a.T.print.value="")}}(this)),!0;case "print":return this.T[b]||(this.ta=this.T[b]=c,c.value="",this.g=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
|
v.prototype={constructor:v,parent:null,toString:function(){return this.name?this.name:this.id||this.type},qa:function(a,b,c){switch(b){case "clear":return this.T[b]||(this.T[b]=c,c.onclick=function(a){return function(){a.T.print&&(a.T.print.value="")}}(this)),!0;case "print":return this.T[b]||(this.ta=this.T[b]=c,c.value="",this.g=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
|
||||||
this.na=function(a,b,c){this.g(a,"notice",c)}),!0;default:return!1}},log:function(){},g:function(){},status:function(a){this.g(this.eb+": "+a)},na:function(a,b){b||t(a)},Ba:function(){return this.A.ka=!0},Aa:function(a,b){b&&(this.A.ka=!1);return!0}};function cb(a,b,c,d,e,f){var h=!0;a.F&&(!0===h?h=0:null==h&&(h=a.ja),db(a.F,a,b,c,d,e,f,h))}function eb(a,b,c){a.F&&(!0===c||fb(a,c|0))&&a.F.message(b,void 0)}
|
this.na=function(a,b,c){this.g(a,"notice",c)}),!0;default:return!1}},log:function(){},g:function(){},status:function(a){this.g(this.eb+": "+a)},na:function(a,b){b||t(a)},Ba:function(){return this.A.ka=!0},Aa:function(a,b){b&&(this.A.ka=!1);return!0}};function cb(a,b,c,d,e,f){var h=!0;a.F&&(!0===h?h=0:null==h&&(h=a.ja),db(a.F,a,b,c,d,e,f,h))}function eb(a,b,c){a.F&&(!0===c||fb(a,c|0))&&a.F.message(b,void 0)}
|
||||||
function fb(a,b){if(a.F){a===a.F?b|=0:b=b||a.ja;var c=a.F.ja&b;return!!b&&c===b||!!(c&a.F.Xb)}return!1}function gb(a,b){if(a.A.xb)return a.A.Qa&&(a.A.Qa=!1),a.A.xb=!1;if(a.A.Sa)return a.g(a.toString()+" error"),!1;a.A.Qa=b;return a.A.Qa}function hb(a,b){a.A.Qa&&(b?a.A.xb=!0:void 0===b&&a.g(a.toString()+" busy"));return a.A.Qa}function D(a){if(!a.A.Sa&&(a.A.Ta=!0,a.A.Ta)){var b=a.sb;a.sb=null;b&&b()}}function ib(a,b){b&&(a.A.Ta?b():a.sb=b);return a.A.Ta}function jb(a,b){a.A.Sa=!0;a.na(b)}
|
function fb(a,b){if(a.F){a===a.F?b|=0:b=b||a.ja;var c=a.F.ja&b;return!!b&&c===b||!!(c&a.F.Xb)}return!1}function gb(a,b){if(a.A.xb)return a.A.Qa&&(a.A.Qa=!1),a.A.xb=!1;if(a.A.Sa)return a.g(a.toString()+" error"),!1;a.A.Qa=b;return a.A.Qa}function hb(a,b){a.A.Qa&&(b?a.A.xb=!0:void 0===b&&a.g(a.toString()+" busy"));return a.A.Qa}function D(a){if(!a.A.Sa&&(a.A.Ta=!0,a.A.Ta)){var b=a.sb;a.sb=null;b&&b()}}function ib(a,b){b&&(a.A.Ta?b():a.sb=b);return a.A.Ta}function jb(a,b){a.A.Sa=!0;a.na(b)}
|
||||||
var kb="undefined"!==typeof ArrayBuffer,lb=[1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,
|
var kb="undefined"!==typeof ArrayBuffer,lb=[1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,
|
||||||
0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1];function mb(a){v.call(this,"Panel",a,mb)}Va(mb);m=mb.prototype;m.pa=function(a,b,c,d){return this.w&&this.w.pa(a,b,c,d)||this.b&&this.b.pa(a,b,c,d)||this.u&&this.u.pa(a,b,c,d)||this.F&&this.F.pa(a,b,c,d)?!0:this.parent.pa.call(this,a,b,c,d)};m.Ia=function(a,b,c,d){this.w=a;this.B=b;this.b=c;this.F=d;this.u=nb(a,"Keyboard")};m.Ba=function(a,b){b||ob();return!0};m.Aa=function(){return!0};m.va=function(){};
|
0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1];function mb(a){v.call(this,"Panel",a,mb)}Va(mb);m=mb.prototype;m.qa=function(a,b,c,d){return this.w&&this.w.qa(a,b,c,d)||this.b&&this.b.qa(a,b,c,d)||this.u&&this.u.qa(a,b,c,d)||this.F&&this.F.qa(a,b,c,d)?!0:this.parent.qa.call(this,a,b,c,d)};m.Ia=function(a,b,c,d){this.w=a;this.B=b;this.b=c;this.F=d;this.u=nb(a,"Keyboard")};m.Ba=function(a,b){b||ob();return!0};m.Aa=function(){return!0};m.va=function(){};
|
||||||
function ob(){for(var a=!1,b=C(document,"pc8080","panel"),c=0;c<b.length;c++){var d=b[c],e=z(d),f;a:{f=e.id;if(void 0!==f)for(var h=void 0,h=0;h<y.length;h++)if(y[h].id===f){f=y[h];break a}f=null}f||(a=!0,f=new mb(e));bb(f,d);a&&D(f)}}Ia(ob);
|
function ob(){for(var a=!1,b=C(document,"pc8080","panel"),c=0;c<b.length;c++){var d=b[c],e=z(d),f;a:{f=e.id;if(void 0!==f)for(var h=void 0,h=0;h<y.length;h++)if(y[h].id===f){f=y[h];break a}f=null}f||(a=!0,f=new mb(e));$a(f,d);a&&D(f)}}Ia(ob);
|
||||||
function pb(a,b,c){v.call(this,"Bus",a,pb);this.b=b;this.F=c;this.J=a.busWidth||16;this.W=Math.pow(2,this.J);this.C=this.W-1|0;this.ea=16>=this.J?10:20>=this.J?12:24>=this.J?14:15;this.ua=1<<this.ea;this.Y=this.ua>>2;this.B=this.ua-1;this.L=this.W/this.ua|0;this.K=this.L-1;this.w=[];this.u=[];this.G=this.H=!1;this.aa=[];this.ba=[];a=new E;qb(a,this.F);this.U=Array(this.L);for(b=0;b<this.L;b++)this.U[b]=a;D(this)}Va(pb);m=pb.prototype;m.reset=function(){};m.Ba=function(a,b){b||this.reset();return!0};
|
function pb(a,b,c){v.call(this,"Bus",a,pb);this.b=b;this.F=c;this.J=a.busWidth||16;this.W=Math.pow(2,this.J);this.C=this.W-1|0;this.ea=16>=this.J?10:20>=this.J?12:24>=this.J?14:15;this.ua=1<<this.ea;this.Y=this.ua>>2;this.B=this.ua-1;this.L=this.W/this.ua|0;this.K=this.L-1;this.w=[];this.u=[];this.G=this.H=!1;this.aa=[];this.ba=[];a=new E;qb(a,this.F);this.U=Array(this.L);for(b=0;b<this.L;b++)this.U[b]=a;D(this)}Va(pb);m=pb.prototype;m.reset=function(){};m.Ba=function(a,b){b||this.reset();return!0};
|
||||||
function rb(a,b,c,d){for(var e=b,f=c,h=e>>>a.ea;0<f&&h<a.U.length;){var g=a.U[h],l=h*a.ua,k=a.ua-(e-l);k>f&&(k=f);if(g&&g.size){if(g.type==d){if(e+f<=g.D)return g.nb+=g.D-e,g.D=e,!0;if(e>=g.D+g.nb){k=g.size-(e-l);k>f&&(k=f);g.nb=e-g.D+k;e=l+a.ua;f-=k;h++;continue}}return sb(1,e,f)}e=new E(e,k,a.ua,d);qb(e,a.F,g);a.U[h++]=e;e=l+a.ua;f-=k}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+tb[d]+" at "+r(b)),!0):sb(2,b,c)}m.X=function(a){return this.U[(a&this.C)>>>this.ea].ab(a&this.B,a)};
|
function rb(a,b,c,d){for(var e=b,f=c,h=e>>>a.ea;0<f&&h<a.U.length;){var g=a.U[h],l=h*a.ua,k=a.ua-(e-l);k>f&&(k=f);if(g&&g.size){if(g.type==d){if(e+f<=g.D)return g.nb+=g.D-e,g.D=e,!0;if(e>=g.D+g.nb){k=g.size-(e-l);k>f&&(k=f);g.nb=e-g.D+k;e=l+a.ua;f-=k;h++;continue}}return sb(1,e,f)}e=new E(e,k,a.ua,d);qb(e,a.F,g);a.U[h++]=e;e=l+a.ua;f-=k}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+tb[d]+" at "+r(b)),!0):sb(2,b,c)}m.X=function(a){return this.U[(a&this.C)>>>this.ea].ab(a&this.B,a)};
|
||||||
function ub(a,b){return a.U[(b&a.C)>>>a.ea].lb(b&a.B,b)}m.Ha=function(a){var b=a&this.B,c=(a&this.C)>>>this.ea;return b!=this.B?this.U[c].Tb(b,a):this.U[c++].ab(b,a)|this.U[c&this.K].ab(0,a+1)<<8};function vb(a,b){var c=b&a.B,d=(b&a.C)>>>a.ea;return c!=a.B?a.U[d].Cb(c,b):a.U[d++].lb(c,b)|a.U[d&a.K].lb(0,b+1)<<8}m.ga=function(a,b){this.U[(a&this.C)>>>this.ea].cb(a&this.B,b&255,a)};function wb(a,b,c){a.U[(b&a.C)>>>a.ea].ob(b&a.B,c&255,b)}
|
function ub(a,b){return a.U[(b&a.C)>>>a.ea].lb(b&a.B,b)}m.Ha=function(a){var b=a&this.B,c=(a&this.C)>>>this.ea;return b!=this.B?this.U[c].Tb(b,a):this.U[c++].ab(b,a)|this.U[c&this.K].ab(0,a+1)<<8};function vb(a,b){var c=b&a.B,d=(b&a.C)>>>a.ea;return c!=a.B?a.U[d].Cb(c,b):a.U[d++].lb(c,b)|a.U[d&a.K].lb(0,b+1)<<8}m.ga=function(a,b){this.U[(a&this.C)>>>this.ea].cb(a&this.B,b&255,a)};function wb(a,b,c){a.U[(b&a.C)>>>a.ea].ob(b&a.B,c&255,b)}
|
||||||
m.vb=function(a,b){var c=a&this.B,d=(a&this.C)>>>this.ea;c!=this.B?this.U[d].Vb(c,b&65535,a):(this.U[d++].cb(c,b&255,a),this.U[d&this.K].cb(0,b>>8&255,a+1))};function xb(a,b){if(void 0===b)return a.G=!a.G,a.G;void 0===a.w[b]&&(a.w[b]=[null,!1]);a.w[b][1]=!a.w[b][1];return a.w[b][1]}
|
m.vb=function(a,b){var c=a&this.B,d=(a&this.C)>>>this.ea;c!=this.B?this.U[d].Vb(c,b&65535,a):(this.U[d++].cb(c,b&255,a),this.U[d&this.K].cb(0,b>>8&255,a+1))};function xb(a,b){if(void 0===b)return a.G=!a.G,a.G;void 0===a.w[b]&&(a.w[b]=[null,!1]);a.w[b][1]=!a.w[b][1];return a.w[b][1]}
|
||||||
function yb(a,b,c){for(var d=1,e=0,f=0;0<d;){var h=a.w[b],g=a.aa[b]||1,l=1==g?255:2==g?65535:-1,k=l;void 0!==h?(h[0]&&(k=h[0](b,c),void 0===k?k=l:k&=l),a.F&&a.G!=h[1]&&zb(a.F,b,k)):a.F&&(db(a.F,a,b,null,c),a.G&&zb(a.F,b,k));e|=k<<f;f+=g<<3;b+=g;d-=g}return e}function Ib(a,b){if(void 0===b)return a.H=!a.H,a.H;void 0===a.u[b]&&(a.u[b]=[null,!1]);a.u[b][1]=!a.u[b][1];return a.u[b][1]}
|
function yb(a,b,c){for(var d=1,e=0,f=0;0<d;){var h=a.w[b],g=a.aa[b]||1,l=1==g?255:2==g?65535:-1,k=l;void 0!==h?(h[0]&&(k=h[0](b,c),void 0===k?k=l:k&=l),a.F&&a.G!=h[1]&&zb(a.F,b,k)):a.F&&(db(a.F,a,b,null,c),a.G&&zb(a.F,b,k));e|=k<<f;f+=g<<3;b+=g;d-=g}return e}function Ab(a,b){if(void 0===b)return a.H=!a.H,a.H;void 0===a.u[b]&&(a.u[b]=[null,!1]);a.u[b][1]=!a.u[b][1];return a.u[b][1]}
|
||||||
function Jb(a,b,c,d){for(var e=1,f=0;0<e;){var h=a.u[b],g=a.ba[b]||1,l=1==g?255:2==g?65535:-1,l=(c>>>=f)&l;if(void 0!==h){if(h[0])h[0](b,l,d);a.F&&a.H!=h[1]&&Kb(a.F,b,l)}else a.F&&(db(a.F,a,b,l,d),a.H&&Kb(a.F,b,l));f+=g<<3;b+=g;e-=g}}function sb(a,b,c){t("Memory block error ("+a+": "+q(b)+","+q(c)+")");return!1}var Lb;if(kb){var Mb=new ArrayBuffer(2);(new DataView(Mb)).setUint16(0,256,!0);Lb=256===(new Uint16Array(Mb))[0]}else Lb=!1;var Nb=Lb;
|
function Jb(a,b,c,d){for(var e=1,f=0;0<e;){var h=a.u[b],g=a.ba[b]||1,l=1==g?255:2==g?65535:-1,l=(c>>>=f)&l;if(void 0!==h){if(h[0])h[0](b,l,d);a.F&&a.H!=h[1]&&Kb(a.F,b,l)}else a.F&&(db(a.F,a,b,l,d),a.H&&Kb(a.F,b,l));f+=g<<3;b+=g;e-=g}}function sb(a,b,c){t("Memory block error ("+a+": "+q(b)+","+q(c)+")");return!1}var Lb;if(kb){var Mb=new ArrayBuffer(2);(new DataView(Mb)).setUint16(0,256,!0);Lb=256===(new Uint16Array(Mb))[0]}else Lb=!1;var Nb=Lb;
|
||||||
function E(a,b,c,d){this.id=Ob+=2;this.b=null;this.D=a;this.nb=b;this.size=c||0;this.type=d||Pb;this.w=d==Qb;qb(this);this.ya=this.Lb=!1;if(c)if(kb)this.G=new ArrayBuffer(c),this.H=new DataView(this.G,0,c),this.B=new Uint8Array(this.G,0,c),this.K=new Uint16Array(this.G,0,c>>1),this.b=new Int32Array(this.G,0,c>>2),Rb(this,Nb?Sb:Tb);else{this.b=Array(c>>2);for(a=0;a<this.b.length;a++)this.b[a]=0;Rb(this,Ub)}else Rb(this)}var Pb=0,Qb=2,tb=["NONE","RAM","ROM","VID","H/W"],Ob=0;
|
function E(a,b,c,d){this.id=Ob+=2;this.b=null;this.D=a;this.nb=b;this.size=c||0;this.type=d||Pb;this.w=d==Qb;qb(this);this.ya=this.Lb=!1;if(c)if(kb)this.G=new ArrayBuffer(c),this.H=new DataView(this.G,0,c),this.B=new Uint8Array(this.G,0,c),this.K=new Uint16Array(this.G,0,c>>1),this.b=new Int32Array(this.G,0,c>>2),Rb(this,Nb?Sb:Tb);else{this.b=Array(c>>2);for(a=0;a<this.b.length;a++)this.b[a]=0;Rb(this,Ub)}else Rb(this)}var Pb=0,Qb=2,tb=["NONE","RAM","ROM","VID","H/W"],Ob=0;
|
||||||
E.prototype={constructor:E,parent:null,save:function(){var a,b;if(kb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.H.getInt32(b<<2,!0);else a=this.b;return a},restore:function(a){if(a&&this.size==a.length<<2){var b;if(kb)for(b=0;b<a.length;b++)this.H.setInt32(b<<2,a[b],!0);else this.b=a;return this.ya=!0}return!1},Ja:function(a,b){b?0===this.u++&&Vb(this,Wb,!1):0===this.T++&&Xb(this,Wb,!1)},L:function(){this.F&&fb(this.F,129)&&this.F.message("attempt to read invalid block %"+q(this.D),!0);
|
E.prototype={constructor:E,parent:null,save:function(){var a,b;if(kb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.H.getInt32(b<<2,!0);else a=this.b;return a},restore:function(a){if(a&&this.size==a.length<<2){var b;if(kb)for(b=0;b<a.length;b++)this.H.setInt32(b<<2,a[b],!0);else this.b=a;return this.ya=!0}return!1},Ja:function(a,b){b?0===this.u++&&Vb(this,Wb,!1):0===this.T++&&Xb(this,Wb,!1)},L:function(){this.F&&fb(this.F,129)&&this.F.message("attempt to read invalid block %"+q(this.D),!0);
|
||||||
return 255},C:function(a,b){this.F&&fb(this.F,129)&&this.F.message("attempt to write "+r(b)+" to invalid block %"+q(this.D),!0)},W:function(a,b){return this.ab(a++,b++)|this.ab(a,b)<<8},J:function(a,b,c){this.cb(a++,b&255,c++);this.cb(a,b>>8,c)},fa:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},qa:function(a){var b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8},xa:function(a,b){var c=a>>2,d=(a&3)<<3;this.b[c]=this.b[c]&~(255<<d)|b<<d;this.ya=!0},Ga:function(a,
|
return 255},C:function(a,b){this.F&&fb(this.F,129)&&this.F.message("attempt to write "+r(b)+" to invalid block %"+q(this.D),!0)},W:function(a,b){return this.ab(a++,b++)|this.ab(a,b)<<8},J:function(a,b,c){this.cb(a++,b&255,c++);this.cb(a,b>>8,c)},fa:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ra:function(a){var b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8},xa:function(a,b){var c=a>>2,d=(a&3)<<3;this.b[c]=this.b[c]&~(255<<d)|b<<d;this.ya=!0},Ga:function(a,
|
||||||
b){var c=a>>2,d=(a&3)<<3;24>d?this.b[c]=this.b[c]&~(65535<<d)|b<<d:(this.b[c]=this.b[c]&16777215|b<<24,c++,this.b[c]=this.b[c]&-256|b>>8);this.ya=!0},aa:function(a,b){if(this.F&&null!=this.D){var c=this.F;Yb(c,this.D+a,1,c.aa)&&c.da(!0)}return this.lb(a,b)},ia:function(a,b){if(this.F&&null!=this.D){var c=this.F;Yb(c,this.D+a,2,c.aa)&&c.da(!0)}return this.Cb(a,b)},sa:function(a,b,c){if(this.F&&null!=this.D){var d=this.F;Yb(d,this.D+a,1,d.H)&&d.da(!0)}this.w?this.C(a,b,c):this.ob(a,b,c)},Fa:function(a,
|
b){var c=a>>2,d=(a&3)<<3;24>d?this.b[c]=this.b[c]&~(65535<<d)|b<<d:(this.b[c]=this.b[c]&16777215|b<<24,c++,this.b[c]=this.b[c]&-256|b>>8);this.ya=!0},aa:function(a,b){if(this.F&&null!=this.D){var c=this.F;Yb(c,this.D+a,1,c.aa)&&c.da(!0)}return this.lb(a,b)},ia:function(a,b){if(this.F&&null!=this.D){var c=this.F;Yb(c,this.D+a,2,c.aa)&&c.da(!0)}return this.Cb(a,b)},sa:function(a,b,c){if(this.F&&null!=this.D){var d=this.F;Yb(d,this.D+a,1,d.H)&&d.da(!0)}this.w?this.C(a,b,c):this.ob(a,b,c)},Fa:function(a,
|
||||||
b,c){if(this.F&&null!=this.D){var d=this.F;Yb(d,this.D+a,2,d.H)&&d.da(!0)}this.w?this.C(a,b,c):this.Db(a,b,c)},Y:function(a){return this.B[a]},ba:function(a){return this.B[a]},ha:function(a){return this.H.getUint16(a,!0)},oa:function(a){return a&1?this.B[a]|this.B[a+1]<<8:this.K[a>>1]},Ea:function(a,b){this.B[a]=b;this.ya=!0},wa:function(a,b){this.B[a]=b;this.ya=!0},Ca:function(a,b){this.H.setUint16(a,b,!0);this.ya=!0},eb:function(a,b){a&1?(this.B[a]=b,this.B[a+1]=b>>8):this.K[a>>1]=b;this.ya=!0}};
|
b,c){if(this.F&&null!=this.D){var d=this.F;Yb(d,this.D+a,2,d.H)&&d.da(!0)}this.w?this.C(a,b,c):this.Db(a,b,c)},Y:function(a){return this.B[a]},ba:function(a){return this.B[a]},ha:function(a){return this.H.getUint16(a,!0)},pa:function(a){return a&1?this.B[a]|this.B[a+1]<<8:this.K[a>>1]},Ea:function(a,b){this.B[a]=b;this.ya=!0},wa:function(a,b){this.B[a]=b;this.ya=!0},Ca:function(a,b){this.H.setUint16(a,b,!0);this.ya=!0},eb:function(a,b){a&1?(this.B[a]=b,this.B[a+1]=b>>8):this.K[a>>1]=b;this.ya=!0}};
|
||||||
function qb(a,b,c){a.F=b;a.T=a.u=0;c&&((a.T=c.T)&&Xb(a,Wb,!1),(a.u=c.u)&&Vb(a,Wb,!1))}function Zb(a,b){b?0===--a.u&&(a.cb=a.w?a.C:a.ob,a.Vb=a.w?a.J:a.Db):0===--a.T&&(a.ab=a.lb,a.Tb=a.Cb)}function Vb(a,b,c){c&&a.u||(a.cb=!a.w&&b[2]||a.C,a.Vb=!a.w&&b[3]||a.J);if(c||void 0===c)a.ob=b[2]||a.C,a.Db=b[3]||a.J}function Xb(a,b,c){c&&a.T||(a.ab=b[0]||a.L,a.Tb=b[1]||a.W);if(c||void 0===c)a.lb=b[0]||a.L,a.Cb=b[1]||a.W}function Rb(a,b){b||(b=$b);Xb(a,b,void 0);Vb(a,b,void 0)}
|
function qb(a,b,c){a.F=b;a.T=a.u=0;c&&((a.T=c.T)&&Xb(a,Wb,!1),(a.u=c.u)&&Vb(a,Wb,!1))}function Zb(a,b){b?0===--a.u&&(a.cb=a.w?a.C:a.ob,a.Vb=a.w?a.J:a.Db):0===--a.T&&(a.ab=a.lb,a.Tb=a.Cb)}function Vb(a,b,c){c&&a.u||(a.cb=!a.w&&b[2]||a.C,a.Vb=!a.w&&b[3]||a.J);if(c||void 0===c)a.ob=b[2]||a.C,a.Db=b[3]||a.J}function Xb(a,b,c){c&&a.T||(a.ab=b[0]||a.L,a.Tb=b[1]||a.W);if(c||void 0===c)a.lb=b[0]||a.L,a.Cb=b[1]||a.W}function Rb(a,b){b||(b=$b);Xb(a,b,void 0);Vb(a,b,void 0)}
|
||||||
var $b=[],Ub=[E.prototype.fa,E.prototype.qa,E.prototype.xa,E.prototype.Ga],Wb=[E.prototype.aa,E.prototype.ia,E.prototype.sa,E.prototype.Fa];if(kb)var Tb=[E.prototype.Y,E.prototype.ha,E.prototype.Ea,E.prototype.Ca],Sb=[E.prototype.ba,E.prototype.oa,E.prototype.wa,E.prototype.eb];
|
var $b=[],Ub=[E.prototype.fa,E.prototype.ra,E.prototype.xa,E.prototype.Ga],Wb=[E.prototype.aa,E.prototype.ia,E.prototype.sa,E.prototype.Fa];if(kb)var Tb=[E.prototype.Y,E.prototype.ha,E.prototype.Ea,E.prototype.Ca],Sb=[E.prototype.ba,E.prototype.pa,E.prototype.wa,E.prototype.eb];
|
||||||
function ac(a,b){v.call(this,"CPU",a,ac,1);var c=a.cycles||b,d=a.multiplier||1;this.i={};this.i.$a=c;this.i.ub=0;this.i.Na=d;this.i.zb=Math.round(this.i.$a/1E4)/100;this.i.La=this.i.zb*this.i.Na;this.A.ma=!1;this.A.yb=!1;this.A.Kb=a.autoStart;this.A.Mb=!1;this.A.Ra=!1;this.i.fb=this.i.Xa=0;this.i.gb=a.csStart;this.i.Wa=a.csInterval;this.i.Ya=a.csStop;this.aa=this.Oa.bind(this);D(this)}Va(ac);var bc=["power","reset"];m=ac.prototype;
|
function ac(a,b){v.call(this,"CPU",a,ac,1);var c=a.cycles||b,d=a.multiplier||1;this.i={};this.i.$a=c;this.i.ub=0;this.i.Na=d;this.i.zb=Math.round(this.i.$a/1E4)/100;this.i.La=this.i.zb*this.i.Na;this.A.ma=!1;this.A.yb=!1;this.A.Kb=a.autoStart;this.A.Mb=!1;this.A.Ra=!1;this.i.fb=this.i.Xa=0;this.i.gb=a.csStart;this.i.Wa=a.csInterval;this.i.Ya=a.csStop;this.aa=this.Oa.bind(this);D(this)}Va(ac);var bc=["power","reset"];m=ac.prototype;
|
||||||
m.Ia=function(a,b,c,d){this.w=a;this.B=b;this.F=d;for(b=0;b<bc.length;b++)(c=this.T[bc[b]])&&this.w.pa(null,bc[b],c);this.Ea=(b=nb(a,"Video"))&&Math.max(b.Ea,b.Zb)||60;this.K=nb(a,"ChipSet");a=cc(a,"autoStart");null!=a&&(this.A.Kb="true"==a?!0:"false"==a?!1:!!a);D(this)};m.reset=function(){this.i.ub=0};m.save=function(){return null};m.restore=function(){return!1};
|
m.Ia=function(a,b,c,d){this.w=a;this.B=b;this.F=d;for(b=0;b<bc.length;b++)(c=this.T[bc[b]])&&this.w.qa(null,bc[b],c);this.Ea=(b=nb(a,"Video"))&&Math.max(b.Ea,b.Zb)||60;this.K=nb(a,"ChipSet");a=cc(a,"autoStart");null!=a&&(this.A.Kb="true"==a?!0:"false"==a?!1:!!a);D(this)};m.reset=function(){this.i.ub=0};m.save=function(){return null};m.restore=function(){return!1};
|
||||||
m.Ba=function(a,b){if(!b){if(a&&this.restore){oc(this);if(!this.restore(a))return!1;pc(this)}else this.reset();if(this.F){var c=this.F;c.g("Type ? for help with PC8080 Debugger commands");c.va();if(c.Ga){var d=c.Ga;c.Ga=null;qc(c,d)}}else this.g("No debugger detected")}rc(this);return!0};m.Aa=function(a){return a?this.save():!0};function sc(a){(a.A.Kb||!a.F&&void 0===a.T.run)&&a.Oa(!0)}m.Ob=function(){return 0};
|
m.Ba=function(a,b){if(!b){if(a&&this.restore){oc(this);if(!this.restore(a))return!1;pc(this)}else this.reset();if(this.F){var c=this.F;c.g("Type ? for help with PC8080 Debugger commands");c.va();if(c.Ga){var d=c.Ga;c.Ga=null;qc(c,d)}}else this.g("No debugger detected")}rc(this);return!0};m.Aa=function(a){return a?this.save():!0};function sc(a){(a.A.Kb||!a.F&&void 0===a.T.run)&&a.Oa(!0)}m.Ob=function(){return 0};
|
||||||
function pc(a){void 0===a.i.gb&&(a.i.gb=0);void 0===a.i.Wa&&(a.i.Wa=-1);void 0===a.i.Ya&&(a.i.Ya=-1);a.A.Ra=0<=a.i.gb&&0<a.i.Wa;a.A.Ra&&(a.i.fb=0,a.i.Xa=a.i.gb-a.H)}function tc(a,b){if(a.A.Ra){var c=!1;a.i.fb=a.i.fb+a.Ob()|0;a.i.Xa-=b;0>=a.i.Xa&&(a.i.Xa+=a.i.Wa,c=!0);0<=a.i.Ya&&a.i.Ya<=uc(a)&&(a.i.Wa=a.i.Ya=-1,pc(a),a.da(),c=!0);c&&a.g(uc(a)+" cycles: checksum="+q(a.i.fb))}}
|
function pc(a){void 0===a.i.gb&&(a.i.gb=0);void 0===a.i.Wa&&(a.i.Wa=-1);void 0===a.i.Ya&&(a.i.Ya=-1);a.A.Ra=0<=a.i.gb&&0<a.i.Wa;a.A.Ra&&(a.i.fb=0,a.i.Xa=a.i.gb-a.H)}function tc(a,b){if(a.A.Ra){var c=!1;a.i.fb=a.i.fb+a.Ob()|0;a.i.Xa-=b;0>=a.i.Xa&&(a.i.Xa+=a.i.Wa,c=!0);0<=a.i.Ya&&a.i.Ya<=uc(a)&&(a.i.Wa=a.i.Ya=-1,pc(a),a.da(),c=!0);c&&a.g(uc(a)+" cycles: checksum="+q(a.i.fb))}}
|
||||||
m.pa=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.T[b]=c;a=!0;break;case "run":this.T[b]=c;c.onclick=function(){var a;if(a=d.w)if(a=d.w,a.A.ka)a=!0;else{var b=null,c,g=Ya(a.id);for(c=0;c<g.length&&(b=g[c],b===a||b.A.Ta);c++);if(c==g.length)for(c=0;c<g.length&&(b=g[c],b===a||b.A.ka);c++);c==g.length&&(b=a);t("The "+b.type+" component ("+b.id+") is not "+(b.A.Ta?"powered yet":"ready yet"+(b.sb?" (waiting for notification)":""))+".");a=!1}a&&(d.A.ma?d.da(!0):d.Oa(!0))};a=
|
m.qa=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.T[b]=c;a=!0;break;case "run":this.T[b]=c;c.onclick=function(){var a;if(a=d.w)if(a=d.w,a.A.ka)a=!0;else{var b=null,c,g=Ya(a.id);for(c=0;c<g.length&&(b=g[c],b===a||b.A.Ta);c++);if(c==g.length)for(c=0;c<g.length&&(b=g[c],b===a||b.A.ka);c++);c==g.length&&(b=a);t("The "+b.type+" component ("+b.id+") is not "+(b.A.Ta?"powered yet":"ready yet"+(b.sb?" (waiting for notification)":""))+".");a=!1}a&&(d.A.ma?d.da(!0):d.Oa(!0))};a=
|
||||||
!0;break;case "speed":this.T[b]=c;a=!0;break;case "setSpeed":this.T[b]=c,c.onclick=function(){vc(d,d.i.Na<<1,!0)},c.textContent=this.i.La.toFixed(2)+"Mhz",a=!0}return a};function wc(a,b,c){a.H+=b;c&&(a.C=a.b=0)}
|
!0;break;case "speed":this.T[b]=c;a=!0;break;case "setSpeed":this.T[b]=c,c.onclick=function(){vc(d,d.i.Na<<1,!0)},c.textContent=this.i.La.toFixed(2)+"Mhz",a=!0}return a};function wc(a,b,c){a.H+=b;c&&(a.C=a.b=0)}
|
||||||
function xc(a,b){var c=30;c<a.Ea&&(c=a.Ea);2>c&&(c=2);var d=1;b&&1<a.i.Na&&a.i.Ka&&(d=a.i.Ka/a.i.zb);a.i.Pb=Math.round(1E3/30);a.i.hc=Math.floor(a.i.$a/c*d);a.i.Ab=Math.floor(a.i.$a/30*d);a.i.Rb=Math.floor(a.i.$a/a.Ea*d);a.i.Qb=Math.floor(a.i.$a/2*d);b||(a.i.Za=a.i.Ab,a.i.ib=a.i.Rb,a.i.hb=a.i.Qb);a.i.Bb=0}function uc(a){return a.H+a.G+a.C-a.b}function oc(a){a.i.Ka=0;a.H=a.G=a.C=a.b=0;pc(a);vc(a,1)}
|
function xc(a,b){var c=30;c<a.Ea&&(c=a.Ea);2>c&&(c=2);var d=1;b&&1<a.i.Na&&a.i.Ka&&(d=a.i.Ka/a.i.zb);a.i.Pb=Math.round(1E3/30);a.i.hc=Math.floor(a.i.$a/c*d);a.i.Ab=Math.floor(a.i.$a/30*d);a.i.Rb=Math.floor(a.i.$a/a.Ea*d);a.i.Qb=Math.floor(a.i.$a/2*d);b||(a.i.Za=a.i.Ab,a.i.ib=a.i.Rb,a.i.hb=a.i.Qb);a.i.Bb=0}function uc(a){return a.H+a.G+a.C-a.b}function oc(a){a.i.Ka=0;a.H=a.G=a.C=a.b=0;pc(a);vc(a,1)}
|
||||||
function vc(a,b,c){var d=!1;if(void 0!==b){.8>a.i.Ka/a.i.La?b=1:d=!0;a.i.Na=b;b=a.i.zb*a.i.Na;if(a.i.La!=b){a.i.La=b;b=a.i.La.toFixed(2)+"Mhz";var e=a.T.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.w&&a.w.mb()}wc(a,a.G);a.G=0;a.i.Va=ka();a.i.Ma=0;xc(a);return d}
|
function vc(a,b,c){var d=!1;if(void 0!==b){.8>a.i.Ka/a.i.La?b=1:d=!0;a.i.Na=b;b=a.i.zb*a.i.Na;if(a.i.La!=b){a.i.La=b;b=a.i.La.toFixed(2)+"Mhz";var e=a.T.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.w&&a.w.mb()}wc(a,a.G);a.G=0;a.i.Va=ka();a.i.Ma=0;xc(a);return d}
|
||||||
|
|
@ -49,15 +49,15 @@ function rc(a,b){a.w&&(yc(a.w,-1),a.w.va(b))}function zc(a){this.Ua=a.model||808
|
||||||
m.Ob=function(){var a=this.j+this.N+this.O+this.P+this.R+this.S+this.V|0;return a=a+this.ca+this.M+Fc(this)|0};
|
m.Ob=function(){var a=this.j+this.N+this.O+this.P+this.R+this.S+this.V|0;return a=a+this.ca+this.M+Fc(this)|0};
|
||||||
m.save=function(){var a=new Gc(this);H(a,0,[this.j,this.N,this.O,this.P,this.R,this.S,this.V,this.ca,this.M,Fc(this)]);H(a,1,[this.u,this.H,this.i.Na]);for(var b=this.B,c=0,d=[],e=0;e<b.L;e++){var f=b.U[e];if(f.ya||f.Lb){d[c++]=e;var h=c++;a:if(f=f.save()){for(var g=0,l=0,k=[];g<f.length;){for(var n=f[g],p=g+1;p<f.length&&f[p]===n;)p++;k[l++]=p-g;k[l++]=n;g=p}if(k.length<f.length){f=k;break a}}d[h]=f}}H(a,2,d);return a.data()};
|
m.save=function(){var a=new Gc(this);H(a,0,[this.j,this.N,this.O,this.P,this.R,this.S,this.V,this.ca,this.M,Fc(this)]);H(a,1,[this.u,this.H,this.i.Na]);for(var b=this.B,c=0,d=[],e=0;e<b.L;e++){var f=b.U[e];if(f.ya||f.Lb){d[c++]=e;var h=c++;a:if(f=f.save()){for(var g=0,l=0,k=[];g<f.length;){for(var n=f[g],p=g+1;p<f.length&&f[p]===n;)p++;k[l++]=p-g;k[l++]=n;g=p}if(k.length<f.length){f=k;break a}}d[h]=f}}H(a,2,d);return a.data()};
|
||||||
m.restore=function(a){var b=a[0];this.j=b[0];this.N=b[1];this.O=b[2];this.P=b[3];this.R=b[4];this.S=b[5];this.V=b[6];this.ca=b[7]&65535;F(this,b[8]);Dc(this,b[9]);b=a[1];this.u=b[0];this.H=b[1];vc(this,b[3]);a:{b=this.B;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.Y){for(var f=0,h=Array(b.Y),g=0;g<e.length-1;)for(var l=e[g++],k=e[g++];l--;)h[f++]=k;e=h}f=b.U[d];if(!f||!f.restore(e)){t("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};
|
m.restore=function(a){var b=a[0];this.j=b[0];this.N=b[1];this.O=b[2];this.P=b[3];this.R=b[4];this.S=b[5];this.V=b[6];this.ca=b[7]&65535;F(this,b[8]);Dc(this,b[9]);b=a[1];this.u=b[0];this.H=b[1];vc(this,b[3]);a:{b=this.B;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.Y){for(var f=0,h=Array(b.Y),g=0;g<e.length-1;)for(var l=e[g++],k=e[g++];l--;)h[f++]=k;e=h}f=b.U[d];if(!f||!f.restore(e)){t("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};
|
||||||
m.pa=function(a,b,c){var d=!1;switch(b){case "A":case "B":case "C":case "BC":case "D":case "E":case "DE":case "H":case "L":case "HL":case "SP":case "PC":case "PS":case "IF":case "SF":case "ZF":case "AF":case "PF":case "CF":this.T[b]=c;this.Y++;d=!0;break;default:d=this.parent.pa.call(this,a,b,c)}return d};function Hc(a){return a.N<<8|a.O}function Ic(a,b){a.N=b>>8&255;a.O=b&255}function Jc(a){return a.P<<8|a.R}function Kc(a,b){a.P=b>>8&255;a.R=b&255}function I(a){return a.S<<8|a.V}
|
m.qa=function(a,b,c){var d=!1;switch(b){case "A":case "B":case "C":case "BC":case "D":case "E":case "DE":case "H":case "L":case "HL":case "SP":case "PC":case "PS":case "IF":case "SF":case "ZF":case "AF":case "PF":case "CF":this.T[b]=c;this.Y++;d=!0;break;default:d=this.parent.qa.call(this,a,b,c)}return d};function Hc(a){return a.N<<8|a.O}function Ic(a,b){a.N=b>>8&255;a.O=b&255}function Jc(a){return a.P<<8|a.R}function Kc(a,b){a.P=b>>8&255;a.R=b&255}function I(a){return a.S<<8|a.V}
|
||||||
function Lc(a,b){a.S=b>>8&255;a.V=b&255}function F(a,b){a.M=b&65535}function Mc(a){return a.I&256?1:0}function Nc(a){return lb[a.Z&255]?4:0}function Oc(a){return(a.Z^a.la)&16?16:0}function Pc(a){return a.I&255?0:64}function Qc(a){return a.Z&128?128:0}function Fc(a){return a.ra&-214|Qc(a)|Pc(a)|Oc(a)|Nc(a)|Mc(a)}function Dc(a,b){a.I=a.Z=a.la=0;b&1&&(a.I|=256);b&4||(a.Z|=1);b&16&&(a.la|=16);b&64||(a.I|=255);b&128&&(a.Z^=192);a.ra=a.ra&-513|b&512|2}
|
function Lc(a,b){a.S=b>>8&255;a.V=b&255}function F(a,b){a.M=b&65535}function Mc(a){return a.I&256?1:0}function Nc(a){return lb[a.Z&255]?4:0}function Oc(a){return(a.Z^a.la)&16?16:0}function Pc(a){return a.I&255?0:64}function Qc(a){return a.Z&128?128:0}function Fc(a){return a.oa&-214|Qc(a)|Pc(a)|Oc(a)|Nc(a)|Mc(a)}function Dc(a,b){a.I=a.Z=a.la=0;b&1&&(a.I|=256);b&4||(a.Z|=1);b&16&&(a.la|=16);b&64||(a.I|=255);b&128&&(a.Z^=192);a.oa=a.oa&-726|b&512|2}
|
||||||
function Rc(a,b){a.la=a.j^b;return a.Z=(a.I=a.j+b)&255}function Sc(a,b){a.la=a.j^b;return a.Z=(a.I=a.j+b+(a.I&256?1:0))&255}function Tc(a,b){a.I=a.Z=a.la=a.j&b;(a.j|b)&8&&(a.la^=16);return a.I}function kd(a,b){a.la=b^255;b=a.Z=b+255&255;a.I=a.I&-256|b;return b}function ld(a,b){a.la=b;b=a.Z=b+1&255;a.I=a.I&-256|b;return b}function md(a,b){return a.Z=a.I=a.la=a.j|b}function J(a,b){b^=255;a.la=a.j^b;return a.Z=(a.I=a.j+b+1^256)&255}
|
function Rc(a,b){a.la=a.j^b;return a.Z=(a.I=a.j+b)&255}function Sc(a,b){a.la=a.j^b;return a.Z=(a.I=a.j+b+(a.I&256?1:0))&255}function Tc(a,b){a.I=a.Z=a.la=a.j&b;(a.j|b)&8&&(a.la^=16);return a.I}function kd(a,b){a.la=b^255;b=a.Z=b+255&255;a.I=a.I&-256|b;return b}function ld(a,b){a.la=b;b=a.Z=b+1&255;a.I=a.I&-256|b;return b}function md(a,b){return a.Z=a.I=a.la=a.j|b}function J(a,b){b^=255;a.la=a.j^b;return a.Z=(a.I=a.j+b+1^256)&255}
|
||||||
function nd(a,b){b^=255;a.la=a.j^b;return a.Z=(a.I=a.j+b+(a.I&256?0:1)^256)&255}function od(a,b){return a.Z=a.I=a.la=a.j^b}m.X=function(a){return this.B.X(a)};m.ga=function(a,b){this.B.ga(a,b)};function L(a){var b=a.X(a.M);F(a,a.M+1);return b}function N(a){var b=a.B.Ha(a.M);F(a,a.M+2);return b}function O(a){var b=a.B.Ha(a.ca);a.ca=a.ca+2&65535;return b}function Q(a,b){a.ca=a.ca-2&65535;a.B.vb(a.ca,b)}
|
function nd(a,b){b^=255;a.la=a.j^b;return a.Z=(a.I=a.j+b+(a.I&256?0:1)^256)&255}function od(a,b){return a.Z=a.I=a.la=a.j^b}m.X=function(a){return this.B.X(a)};m.ga=function(a,b){this.B.ga(a,b)};function L(a){var b=a.X(a.M);F(a,a.M+1);return b}function N(a){var b=a.B.Ha(a.M);F(a,a.M+2);return b}function O(a){var b=a.B.Ha(a.ca);a.ca=a.ca+2&65535;return b}function Q(a,b){a.ca=a.ca-2&65535;a.B.vb(a.ca,b)}
|
||||||
function R(a,b,c,d){d=d||2;a.T[b]&&(void 0===c&&(jb(a,"Value for "+b+" is invalid"),a.da()),c=!a.A.ma||a.A.Mb?q(c,d):"--------".substr(0,d),a.T[b].textContent!=c&&(a.T[b].textContent=c))}
|
function R(a,b,c,d){d=d||2;a.T[b]&&(void 0===c&&(jb(a,"Value for "+b+" is invalid"),a.da()),c=!a.A.ma||a.A.Mb?q(c,d):"--------".substr(0,d),a.T[b].textContent!=c&&(a.T[b].textContent=c))}
|
||||||
m.va=function(a){this.Y&&(a||!this.A.ma||this.A.Mb)&&(R(this,"A",this.j),R(this,"B",this.N),R(this,"C",this.O),R(this,"BC",Hc(this),4),R(this,"D",this.P),R(this,"E",this.R),R(this,"DE",Jc(this),4),R(this,"H",this.S),R(this,"L",this.V),R(this,"HL",I(this),4),R(this,"SP",this.ca,4),R(this,"PC",this.M,4),a=Fc(this),R(this,"PS",a,4),R(this,"IF",a&512?1:0,1),R(this,"SF",a&128?1:0,1),R(this,"ZF",a&64?1:0,1),R(this,"AF",a&16?1:0,1),R(this,"PF",a&4?1:0,1),R(this,"CF",a&1?1:0,1));if(a=this.T.speed)a.textContent=
|
m.va=function(a){this.Y&&(a||!this.A.ma||this.A.Mb)&&(R(this,"A",this.j),R(this,"B",this.N),R(this,"C",this.O),R(this,"BC",Hc(this),4),R(this,"D",this.P),R(this,"E",this.R),R(this,"DE",Jc(this),4),R(this,"H",this.S),R(this,"L",this.V),R(this,"HL",I(this),4),R(this,"SP",this.ca,4),R(this,"PC",this.M,4),a=Fc(this),R(this,"PS",a,4),R(this,"IF",a&512?1:0,1),R(this,"SF",a&128?1:0,1),R(this,"ZF",a&64?1:0,1),R(this,"AF",a&16?1:0,1),R(this,"PF",a&4?1:0,1),R(this,"CF",a&1?1:0,1));if(a=this.T.speed)a.textContent=
|
||||||
this.A.ma&&this.i.Ka?this.i.Ka.toFixed(2)+"Mhz":"Stopped"};
|
this.A.ma&&this.i.Ka?this.i.Ka.toFixed(2)+"Mhz":"Stopped"};
|
||||||
m.bb=function(a){this.A.rb=!0;var b=this.A.Yb=this.F&&pd(this.F),c=a?this.A.yb?0:1:-1;this.A.yb=!1;this.C=this.b=a;do{if(this.u){var d;this.u&8&&this.ra&512?(d=199|(this.u&7)<<3,this.u&=-16,this.ra&=-513,this.L[d].call(this),d=!0):d=!1;if(d){if(!a){this.g("interrupt dispatched");break}}else if(this.u&16){this.b=0;break}}if(b){if(qd(this.F,this.M,c)){this.da();break}c=1}this.L[L(this)].call(this)}while(0<this.b);return this.A.rb?this.C-this.b:void 0===this.A.rb?0:-1};
|
m.bb=function(a){this.A.rb=!0;var b=this.A.Yb=this.F&&pd(this.F),c=a?this.A.yb?0:1:-1;this.A.yb=!1;this.C=this.b=a;do{if(this.u){var d;this.u&8&&this.oa&512?(d=199|(this.u&7)<<3,this.u&=-16,this.oa&=-513,this.L[d].call(this),d=!0):d=!1;if(d){if(!a){this.g("interrupt dispatched");break}}else if(this.u&16){this.b=0;break}}if(b){if(qd(this.F,this.M,c)){this.da();break}c=1}this.L[L(this)].call(this)}while(0<this.b);return this.A.rb?this.C-this.b:void 0===this.A.rb?0:-1};
|
||||||
Ia(function(){for(var a=C(document,"pc8080","cpu"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new zc(d);bb(d,c)}});function rd(){this.b-=4}function sd(){F(this,N(this));this.b-=10}function td(){F(this,O(this));this.b-=10}function ud(){var a=N(this);Q(this,this.M);F(this,a);this.b-=17}
|
Ia(function(){for(var a=C(document,"pc8080","cpu"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new zc(d);$a(d,c)}});function rd(){this.b-=4}function sd(){F(this,N(this));this.b-=10}function td(){F(this,O(this));this.b-=10}function ud(){var a=N(this);Q(this,this.M);F(this,a);this.b-=17}
|
||||||
var Ac=[rd,function(){Ic(this,N(this));this.b-=10},function(){this.ga(Hc(this),this.j);this.b-=7},function(){Ic(this,Hc(this)+1);this.b-=5},function(){this.N=ld(this,this.N);this.b-=5},function(){this.N=kd(this,this.N);this.b-=5},function(){this.N=L(this);this.b-=7},function(){var a=this.j<<1;this.j=a&255|a>>8;this.I=this.I&255|a&256;this.b-=4},rd,function(){var a;Lc(this,a=I(this)+Hc(this));this.I=this.I&255|a>>8&256;this.b-=10},function(){this.j=this.X(Hc(this));this.b-=7},function(){Ic(this,Hc(this)-
|
var Ac=[rd,function(){Ic(this,N(this));this.b-=10},function(){this.ga(Hc(this),this.j);this.b-=7},function(){Ic(this,Hc(this)+1);this.b-=5},function(){this.N=ld(this,this.N);this.b-=5},function(){this.N=kd(this,this.N);this.b-=5},function(){this.N=L(this);this.b-=7},function(){var a=this.j<<1;this.j=a&255|a>>8;this.I=this.I&255|a&256;this.b-=4},rd,function(){var a;Lc(this,a=I(this)+Hc(this));this.I=this.I&255|a>>8&256;this.b-=10},function(){this.j=this.X(Hc(this));this.b-=7},function(){Ic(this,Hc(this)-
|
||||||
1);this.b-=5},function(){this.O=ld(this,this.O);this.b-=5},function(){this.O=kd(this,this.O);this.b-=5},function(){this.O=L(this);this.b-=7},function(){var a=this.j<<8&256;this.j=(a|this.j)>>1;this.I=this.I&255|a;this.b-=4},rd,function(){Kc(this,N(this));this.b-=10},function(){this.ga(Jc(this),this.j);this.b-=7},function(){Kc(this,Jc(this)+1);this.b-=5},function(){this.P=ld(this,this.P);this.b-=5},function(){this.P=kd(this,this.P);this.b-=5},function(){this.P=L(this);this.b-=7},function(){var a=this.j<<
|
1);this.b-=5},function(){this.O=ld(this,this.O);this.b-=5},function(){this.O=kd(this,this.O);this.b-=5},function(){this.O=L(this);this.b-=7},function(){var a=this.j<<8&256;this.j=(a|this.j)>>1;this.I=this.I&255|a;this.b-=4},rd,function(){Kc(this,N(this));this.b-=10},function(){this.ga(Jc(this),this.j);this.b-=7},function(){Kc(this,Jc(this)+1);this.b-=5},function(){this.P=ld(this,this.P);this.b-=5},function(){this.P=kd(this,this.P);this.b-=5},function(){this.P=L(this);this.b-=7},function(){var a=this.j<<
|
||||||
1;this.j=a&255|this.I>>8;this.I=this.I&255|a&256;this.b-=4},rd,function(){var a;Lc(this,a=I(this)+Jc(this));this.I=this.I&255|a>>8&256;this.b-=10},function(){this.j=this.X(Jc(this));this.b-=7},function(){Kc(this,Jc(this)-1);this.b-=5},function(){this.R=ld(this,this.R);this.b-=5},function(){this.R=kd(this,this.R);this.b-=5},function(){this.R=L(this);this.b-=7},function(){var a=this.j<<8&256;this.j=(this.I&256|this.j)>>1;this.I=this.I&255|a;this.b-=4},rd,function(){Lc(this,N(this));this.b-=10},function(){var a=
|
1;this.j=a&255|this.I>>8;this.I=this.I&255|a&256;this.b-=4},rd,function(){var a;Lc(this,a=I(this)+Jc(this));this.I=this.I&255|a>>8&256;this.b-=10},function(){this.j=this.X(Jc(this));this.b-=7},function(){Kc(this,Jc(this)-1);this.b-=5},function(){this.R=ld(this,this.R);this.b-=5},function(){this.R=kd(this,this.R);this.b-=5},function(){this.R=L(this);this.b-=7},function(){var a=this.j<<8&256;this.j=(this.I&256|this.j)>>1;this.I=this.I&255|a;this.b-=4},rd,function(){Lc(this,N(this));this.b-=10},function(){var a=
|
||||||
|
|
@ -68,7 +68,7 @@ this.b-=5},function(){this.N=this.R;this.b-=5},function(){this.N=this.S;this.b-=
|
||||||
this.N;this.b-=5},function(){this.P=this.O;this.b-=5},function(){this.b-=5},function(){this.P=this.R;this.b-=5},function(){this.P=this.S;this.b-=5},function(){this.P=this.V;this.b-=5},function(){this.P=this.X(I(this));this.b-=7},function(){this.P=this.j;this.b-=5},function(){this.R=this.N;this.b-=5},function(){this.R=this.O;this.b-=5},function(){this.R=this.P;this.b-=5},function(){this.b-=5},function(){this.R=this.S;this.b-=5},function(){this.R=this.V;this.b-=5},function(){this.R=this.X(I(this));
|
this.N;this.b-=5},function(){this.P=this.O;this.b-=5},function(){this.b-=5},function(){this.P=this.R;this.b-=5},function(){this.P=this.S;this.b-=5},function(){this.P=this.V;this.b-=5},function(){this.P=this.X(I(this));this.b-=7},function(){this.P=this.j;this.b-=5},function(){this.R=this.N;this.b-=5},function(){this.R=this.O;this.b-=5},function(){this.R=this.P;this.b-=5},function(){this.b-=5},function(){this.R=this.S;this.b-=5},function(){this.R=this.V;this.b-=5},function(){this.R=this.X(I(this));
|
||||||
this.b-=7},function(){this.R=this.j;this.b-=5},function(){this.S=this.N;this.b-=5},function(){this.S=this.O;this.b-=5},function(){this.S=this.P;this.b-=5},function(){this.S=this.R;this.b-=5},function(){this.b-=5},function(){this.S=this.V;this.b-=5},function(){this.S=this.X(I(this));this.b-=7},function(){this.S=this.j;this.b-=5},function(){this.V=this.N;this.b-=5},function(){this.V=this.O;this.b-=5},function(){this.V=this.P;this.b-=5},function(){this.V=this.R;this.b-=5},function(){this.V=this.S;this.b-=
|
this.b-=7},function(){this.R=this.j;this.b-=5},function(){this.S=this.N;this.b-=5},function(){this.S=this.O;this.b-=5},function(){this.S=this.P;this.b-=5},function(){this.S=this.R;this.b-=5},function(){this.b-=5},function(){this.S=this.V;this.b-=5},function(){this.S=this.X(I(this));this.b-=7},function(){this.S=this.j;this.b-=5},function(){this.V=this.N;this.b-=5},function(){this.V=this.O;this.b-=5},function(){this.V=this.P;this.b-=5},function(){this.V=this.R;this.b-=5},function(){this.V=this.S;this.b-=
|
||||||
5},function(){this.b-=5},function(){this.V=this.X(I(this));this.b-=7},function(){this.V=this.j;this.b-=5},function(){this.ga(I(this),this.N);this.b-=7},function(){this.ga(I(this),this.O);this.b-=7},function(){this.ga(I(this),this.P);this.b-=7},function(){this.ga(I(this),this.R);this.b-=7},function(){this.ga(I(this),this.S);this.b-=7},function(){this.ga(I(this),this.V);this.b-=7},function(){var a=this.M-1;if(this.J.length)for(var b=0;b<this.J.length;b++)if(this.J[b](a))return;this.u|=16;this.b-=7;
|
5},function(){this.b-=5},function(){this.V=this.X(I(this));this.b-=7},function(){this.V=this.j;this.b-=5},function(){this.ga(I(this),this.N);this.b-=7},function(){this.ga(I(this),this.O);this.b-=7},function(){this.ga(I(this),this.P);this.b-=7},function(){this.ga(I(this),this.R);this.b-=7},function(){this.ga(I(this),this.S);this.b-=7},function(){this.ga(I(this),this.V);this.b-=7},function(){var a=this.M-1;if(this.J.length)for(var b=0;b<this.J.length;b++)if(this.J[b](a))return;this.u|=16;this.b-=7;
|
||||||
this.F&&fb(this,-2147483648)?(F(this,a),this.F.da()):this.ra&512||(this.F&&F(this,a),this.da())},function(){this.ga(I(this),this.j);this.b-=7},function(){this.j=this.N;this.b-=5},function(){this.j=this.O;this.b-=5},function(){this.j=this.P;this.b-=5},function(){this.j=this.R;this.b-=5},function(){this.j=this.S;this.b-=5},function(){this.j=this.V;this.b-=5},function(){this.j=this.X(I(this));this.b-=7},function(){this.b-=5},function(){this.j=Rc(this,this.N);this.b-=4},function(){this.j=Rc(this,this.O);
|
this.F&&fb(this,-2147483648)?(F(this,a),this.F.da()):this.oa&512||(this.F&&F(this,a),this.da())},function(){this.ga(I(this),this.j);this.b-=7},function(){this.j=this.N;this.b-=5},function(){this.j=this.O;this.b-=5},function(){this.j=this.P;this.b-=5},function(){this.j=this.R;this.b-=5},function(){this.j=this.S;this.b-=5},function(){this.j=this.V;this.b-=5},function(){this.j=this.X(I(this));this.b-=7},function(){this.b-=5},function(){this.j=Rc(this,this.N);this.b-=4},function(){this.j=Rc(this,this.O);
|
||||||
this.b-=4},function(){this.j=Rc(this,this.P);this.b-=4},function(){this.j=Rc(this,this.R);this.b-=4},function(){this.j=Rc(this,this.S);this.b-=4},function(){this.j=Rc(this,this.V);this.b-=4},function(){this.j=Rc(this,this.X(I(this)));this.b-=7},function(){this.j=Rc(this,this.j);this.b-=4},function(){this.j=Sc(this,this.N);this.b-=4},function(){this.j=Sc(this,this.O);this.b-=4},function(){this.j=Sc(this,this.P);this.b-=4},function(){this.j=Sc(this,this.R);this.b-=4},function(){this.j=Sc(this,this.S);
|
this.b-=4},function(){this.j=Rc(this,this.P);this.b-=4},function(){this.j=Rc(this,this.R);this.b-=4},function(){this.j=Rc(this,this.S);this.b-=4},function(){this.j=Rc(this,this.V);this.b-=4},function(){this.j=Rc(this,this.X(I(this)));this.b-=7},function(){this.j=Rc(this,this.j);this.b-=4},function(){this.j=Sc(this,this.N);this.b-=4},function(){this.j=Sc(this,this.O);this.b-=4},function(){this.j=Sc(this,this.P);this.b-=4},function(){this.j=Sc(this,this.R);this.b-=4},function(){this.j=Sc(this,this.S);
|
||||||
this.b-=4},function(){this.j=Sc(this,this.V);this.b-=4},function(){this.j=Sc(this,this.X(I(this)));this.b-=7},function(){this.j=Sc(this,this.j);this.b-=4},function(){this.j=J(this,this.N);this.b-=4},function(){this.j=J(this,this.O);this.b-=4},function(){this.j=J(this,this.P);this.b-=4},function(){this.j=J(this,this.R);this.b-=4},function(){this.j=J(this,this.S);this.b-=4},function(){this.j=J(this,this.V);this.b-=4},function(){this.j=J(this,this.X(I(this)));this.b-=7},function(){this.j=J(this,this.j);
|
this.b-=4},function(){this.j=Sc(this,this.V);this.b-=4},function(){this.j=Sc(this,this.X(I(this)));this.b-=7},function(){this.j=Sc(this,this.j);this.b-=4},function(){this.j=J(this,this.N);this.b-=4},function(){this.j=J(this,this.O);this.b-=4},function(){this.j=J(this,this.P);this.b-=4},function(){this.j=J(this,this.R);this.b-=4},function(){this.j=J(this,this.S);this.b-=4},function(){this.j=J(this,this.V);this.b-=4},function(){this.j=J(this,this.X(I(this)));this.b-=7},function(){this.j=J(this,this.j);
|
||||||
this.b-=4},function(){this.j=nd(this,this.N);this.b-=4},function(){this.j=nd(this,this.O);this.b-=4},function(){this.j=nd(this,this.P);this.b-=4},function(){this.j=nd(this,this.R);this.b-=4},function(){this.j=nd(this,this.S);this.b-=4},function(){this.j=nd(this,this.V);this.b-=4},function(){this.j=nd(this,this.X(I(this)));this.b-=7},function(){this.j=nd(this,this.j);this.b-=4},function(){this.j=Tc(this,this.N);this.b-=4},function(){this.j=Tc(this,this.O);this.b-=4},function(){this.j=Tc(this,this.P);
|
this.b-=4},function(){this.j=nd(this,this.N);this.b-=4},function(){this.j=nd(this,this.O);this.b-=4},function(){this.j=nd(this,this.P);this.b-=4},function(){this.j=nd(this,this.R);this.b-=4},function(){this.j=nd(this,this.S);this.b-=4},function(){this.j=nd(this,this.V);this.b-=4},function(){this.j=nd(this,this.X(I(this)));this.b-=7},function(){this.j=nd(this,this.j);this.b-=4},function(){this.j=Tc(this,this.N);this.b-=4},function(){this.j=Tc(this,this.O);this.b-=4},function(){this.j=Tc(this,this.P);
|
||||||
|
|
@ -79,101 +79,101 @@ this.b-=4},function(){J(this,this.O);this.b-=4},function(){J(this,this.P);this.b
|
||||||
this.b-=5},function(){Kc(this,O(this));this.b-=10},function(){var a=N(this);Mc(this)||F(this,a);this.b-=10},function(){var a=L(this);Jb(this.B,a,this.j,this.M+-2&65535);this.b-=10},function(){var a=N(this);Mc(this)||(Q(this,this.M),F(this,a),this.b-=6);this.b-=11},function(){Q(this,Jc(this));this.b-=11},function(){this.j=J(this,L(this));this.b-=7},function(){Q(this,this.M);F(this,16);this.b-=11},function(){Mc(this)&&(F(this,O(this)),this.b-=6);this.b-=5},td,function(){var a=N(this);Mc(this)&&F(this,
|
this.b-=5},function(){Kc(this,O(this));this.b-=10},function(){var a=N(this);Mc(this)||F(this,a);this.b-=10},function(){var a=L(this);Jb(this.B,a,this.j,this.M+-2&65535);this.b-=10},function(){var a=N(this);Mc(this)||(Q(this,this.M),F(this,a),this.b-=6);this.b-=11},function(){Q(this,Jc(this));this.b-=11},function(){this.j=J(this,L(this));this.b-=7},function(){Q(this,this.M);F(this,16);this.b-=11},function(){Mc(this)&&(F(this,O(this)),this.b-=6);this.b-=5},td,function(){var a=N(this);Mc(this)&&F(this,
|
||||||
a);this.b-=10},function(){var a=L(this);this.j=yb(this.B,a,this.M+-2&65535)&255;this.b-=10},function(){var a=N(this);Mc(this)&&(Q(this,this.M),F(this,a),this.b-=6);this.b-=11},ud,function(){this.j=nd(this,L(this));this.b-=7},function(){Q(this,this.M);F(this,24);this.b-=11},function(){Nc(this)||(F(this,O(this)),this.b-=6);this.b-=5},function(){Lc(this,O(this));this.b-=10},function(){var a=N(this);Nc(this)||F(this,a);this.b-=10},function(){var a=O(this);Q(this,I(this));Lc(this,a);this.b-=18},function(){var a=
|
a);this.b-=10},function(){var a=L(this);this.j=yb(this.B,a,this.M+-2&65535)&255;this.b-=10},function(){var a=N(this);Mc(this)&&(Q(this,this.M),F(this,a),this.b-=6);this.b-=11},ud,function(){this.j=nd(this,L(this));this.b-=7},function(){Q(this,this.M);F(this,24);this.b-=11},function(){Nc(this)||(F(this,O(this)),this.b-=6);this.b-=5},function(){Lc(this,O(this));this.b-=10},function(){var a=N(this);Nc(this)||F(this,a);this.b-=10},function(){var a=O(this);Q(this,I(this));Lc(this,a);this.b-=18},function(){var a=
|
||||||
N(this);Nc(this)||(Q(this,this.M),F(this,a),this.b-=6);this.b-=11},function(){Q(this,I(this));this.b-=11},function(){this.j=Tc(this,L(this));this.b-=7},function(){Q(this,this.M);F(this,32);this.b-=11},function(){Nc(this)&&(F(this,O(this)),this.b-=6);this.b-=5},function(){F(this,I(this));this.b-=5},function(){var a=N(this);Nc(this)&&F(this,a);this.b-=10},function(){var a=I(this);Lc(this,Jc(this));Kc(this,a);this.b-=5},function(){var a=N(this);Nc(this)&&(Q(this,this.M),F(this,a),this.b-=6);this.b-=
|
N(this);Nc(this)||(Q(this,this.M),F(this,a),this.b-=6);this.b-=11},function(){Q(this,I(this));this.b-=11},function(){this.j=Tc(this,L(this));this.b-=7},function(){Q(this,this.M);F(this,32);this.b-=11},function(){Nc(this)&&(F(this,O(this)),this.b-=6);this.b-=5},function(){F(this,I(this));this.b-=5},function(){var a=N(this);Nc(this)&&F(this,a);this.b-=10},function(){var a=I(this);Lc(this,Jc(this));Kc(this,a);this.b-=5},function(){var a=N(this);Nc(this)&&(Q(this,this.M),F(this,a),this.b-=6);this.b-=
|
||||||
11},ud,function(){this.j=od(this,L(this));this.b-=7},function(){Q(this,this.M);F(this,40);this.b-=11},function(){Qc(this)||(F(this,O(this)),this.b-=6);this.b-=5},function(){var a=O(this);Dc(this,a);this.j=a>>8;this.b-=10},function(){var a=N(this);Qc(this)||F(this,a);this.b-=10},function(){this.ra&=-513;this.b-=4},function(){var a=N(this);Qc(this)||(Q(this,this.M),F(this,a),this.b-=6);this.b-=11},function(){Q(this,Fc(this)&255|this.j<<8);this.b-=11},function(){this.j=md(this,L(this));this.b-=7},function(){Q(this,
|
11},ud,function(){this.j=od(this,L(this));this.b-=7},function(){Q(this,this.M);F(this,40);this.b-=11},function(){Qc(this)||(F(this,O(this)),this.b-=6);this.b-=5},function(){var a=O(this);Dc(this,a&255|this.oa&-256);this.j=a>>8;this.b-=10},function(){var a=N(this);Qc(this)||F(this,a);this.b-=10},function(){this.oa&=-513;this.b-=4},function(){var a=N(this);Qc(this)||(Q(this,this.M),F(this,a),this.b-=6);this.b-=11},function(){Q(this,Fc(this)&255|this.j<<8);this.b-=11},function(){this.j=md(this,L(this));
|
||||||
this.M);F(this,48);this.b-=11},function(){Qc(this)&&(F(this,O(this)),this.b-=6);this.b-=5},function(){this.ca=I(this)&65535;this.b-=5},function(){var a=N(this);Qc(this)&&F(this,a);this.b-=10},function(){this.ra|=512;this.b-=4},function(){var a=N(this);Qc(this)&&(Q(this,this.M),F(this,a),this.b-=6);this.b-=11},ud,function(){J(this,L(this));this.b-=7},function(){Q(this,this.M);F(this,56);this.b-=11}];
|
this.b-=7},function(){Q(this,this.M);F(this,48);this.b-=11},function(){Qc(this)&&(F(this,O(this)),this.b-=6);this.b-=5},function(){this.ca=I(this)&65535;this.b-=5},function(){var a=N(this);Qc(this)&&F(this,a);this.b-=10},function(){this.oa|=512;this.b-=4},function(){var a=N(this);Qc(this)&&(Q(this,this.M),F(this,a),this.b-=6);this.b-=11},ud,function(){J(this,L(this));this.b-=7},function(){Q(this,this.M);F(this,56);this.b-=11}];
|
||||||
function S(a){v.call(this,"ChipSet",a,S,32768);var b=a.model;b&&!vd[b]&&t("Unrecognized ChipSet model: "+b);this.Ua=vd[b]||wd;a.sound&&(this.W=null,window&&(this.W=window.AudioContext||window.webkitAudioContext),this.W&&new this.W);D(this)}Va(S);var wd=1978.1,vd={SI1978:wd};m=S.prototype;m.pa=function(){return!1};
|
function S(a){v.call(this,"ChipSet",a,S,32768);var b=a.model;b&&!vd[b]&&t("Unrecognized ChipSet model: "+b);this.Ua=vd[b]||wd;a.sound&&(this.W=null,window&&(this.W=window.AudioContext||window.webkitAudioContext),this.W&&new this.W);D(this)}Va(S);var wd=1978.1,vd={SI1978:wd};m=S.prototype;m.qa=function(){return!1};
|
||||||
m.Ia=function(a,b,c,d){this.B=b;this.b=c;this.F=d;this.w=a;if(this.Ua==wd){var e;a=xd;void 0===e&&(e=0);for(var f in a){c=b;d=+f+e;var h=a[f].bind(this);if(void 0!==h)for(var g=+f+e;g<=d;g++)void 0!==c.w[g]?t("Input port "+r(g)+" already registered"):c.w[g]=[h,!1]}var l;e=yd;void 0===l&&(l=0);for(var k in e)if(f=b,a=+k+l,c=e[k].bind(this),void 0!==c)for(d=+k+l;d<=a;d++)void 0!==f.u[d]?t("Output port "+r(d)+" already registered"):f.u[d]=[c,!1]}};
|
m.Ia=function(a,b,c,d){this.B=b;this.b=c;this.F=d;this.w=a;if(this.Ua==wd){var e;a=xd;void 0===e&&(e=0);for(var f in a){c=b;d=+f+e;var h=a[f].bind(this);if(void 0!==h)for(var g=+f+e;g<=d;g++)void 0!==c.w[g]?t("Input port "+r(g)+" already registered"):c.w[g]=[h,!1]}var l;e=yd;void 0===l&&(l=0);for(var k in e)if(f=b,a=+k+l,c=e[k].bind(this),void 0!==c)for(d=+k+l;d<=a;d++)void 0!==f.u[d]?t("Output port "+r(d)+" already registered"):f.u[d]=[c,!1]}};
|
||||||
m.Ba=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};m.Aa=function(a){return a?this.save():!0};m.reset=function(){this.G=this.H=this.C=this.u=this.L=this.K=this.J=0};m.save=function(){var a=new Gc(this);this.Ua==wd&&H(a,0,[this.J,this.K,this.L,this.u,this.C,this.G,this.H]);return a.data()};m.restore=function(a){a=a[0];this.Ua==wd&&(this.J=a[0],this.K=a[1],this.L=a[2],this.u=a[3],this.C=a[4],this.G=a[5],this.H=a[6]);return!0};m.start=function(){};m.stop=function(){};
|
m.Ba=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};m.Aa=function(a){return a?this.save():!0};m.reset=function(){this.G=this.H=this.C=this.u=this.L=this.K=this.J=0};m.save=function(){var a=new Gc(this);this.Ua==wd&&H(a,0,[this.J,this.K,this.L,this.u,this.C,this.G,this.H]);return a.data()};m.restore=function(a){a=a[0];this.Ua==wd&&(this.J=a[0],this.K=a[1],this.L=a[2],this.u=a[3],this.C=a[4],this.G=a[5],this.H=a[6]);return!0};m.start=function(){};m.stop=function(){};
|
||||||
m.cc=function(a,b){var c=this.J;cb(this,a,null,b,"STATUS0",c);return c};m.dc=function(a,b){var c=this.K;cb(this,a,null,b,"STATUS1",c);return c};m.ec=function(a,b){var c=this.L;cb(this,a,null,b,"STATUS2",c);return c};m.bc=function(a,b){var c=this.u>>8-this.C&255;cb(this,a,null,b,"SHIFT.RESULT",c);return c};m.ic=function(a,b,c){cb(this,a,b,c,"SHIFT.COUNT",null);this.C=b};m.kc=function(a,b,c){cb(this,a,b,c,"SOUND1",null);this.G=b};
|
m.cc=function(a,b){var c=this.J;cb(this,a,null,b,"STATUS0",c);return c};m.dc=function(a,b){var c=this.K;cb(this,a,null,b,"STATUS1",c);return c};m.ec=function(a,b){var c=this.L;cb(this,a,null,b,"STATUS2",c);return c};m.bc=function(a,b){var c=this.u>>8-this.C&255;cb(this,a,null,b,"SHIFT.RESULT",c);return c};m.ic=function(a,b,c){cb(this,a,b,c,"SHIFT.COUNT",null);this.C=b};m.kc=function(a,b,c){cb(this,a,b,c,"SOUND1",null);this.G=b};
|
||||||
m.jc=function(a,b,c){cb(this,a,b,c,"SHIFT.DATA",null);this.u=b<<8|this.u>>8};m.lc=function(a,b,c){cb(this,a,b,c,"SOUND2",null);this.H=b};m.mc=function(a,b,c){cb(this,a,b,c,"WATCHDOG",null)};var xd={0:S.prototype.cc,1:S.prototype.dc,2:S.prototype.ec,3:S.prototype.bc},yd={2:S.prototype.ic,3:S.prototype.kc,4:S.prototype.jc,5:S.prototype.lc,6:S.prototype.mc};Ia(function(){for(var a=C(document,"pc8080","chipset"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new S(d);bb(d,c)}});
|
m.jc=function(a,b,c){cb(this,a,b,c,"SHIFT.DATA",null);this.u=b<<8|this.u>>8};m.lc=function(a,b,c){cb(this,a,b,c,"SOUND2",null);this.H=b};m.mc=function(a,b,c){cb(this,a,b,c,"WATCHDOG",null)};var xd={0:S.prototype.cc,1:S.prototype.dc,2:S.prototype.ec,3:S.prototype.bc},yd={2:S.prototype.ic,3:S.prototype.kc,4:S.prototype.jc,5:S.prototype.lc,6:S.prototype.mc};Ia(function(){for(var a=C(document,"pc8080","chipset"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new S(d);$a(d,c)}});
|
||||||
function zd(a){v.call(this,"ROM",a,zd);this.w=null;this.H=a.addr;this.u=a.size;this.J=a.writable;this.C=a.alias;this.G=a.file;this.K=ba(this.G);if(this.G){a=this.G;var b=ca(this.K);"json"!=b&&"hex"!=b&&(a=pa()+"/api/v1/dump?file="+this.G+"&format=bytes&decimal=true");var c=this;oa(a,null,!0,function(a,b,f){Ad(c,a,b,f)})}}Va(zd);var Bd=[0,5];zd.prototype.Ia=function(a,b,c,d){this.B=b;this.b=c;this.F=d;Cd(this)};
|
function zd(a){v.call(this,"ROM",a,zd);this.w=null;this.H=a.addr;this.u=a.size;this.J=a.writable;this.C=a.alias;this.G=a.file;this.K=ba(this.G);if(this.G){a=this.G;var b=ca(this.K);"json"!=b&&"hex"!=b&&(a=pa()+"/api/v1/dump?file="+this.G+"&format=bytes&decimal=true");var c=this;oa(a,null,!0,function(a,b,f){Ad(c,a,b,f)})}}Va(zd);var Bd=[0,5];zd.prototype.Ia=function(a,b,c,d){this.B=b;this.b=c;this.F=d;Cd(this)};
|
||||||
zd.prototype.Ba=function(){if(this.Da){if(this.F){var a=this.F,b=this.id,c=this.H,d=this.u,e=this.Da,f=[],h;for(h in e){var g=e[h];"number"==typeof g&&(e[h]=g={o:g});var l=g.o,k=g.a;if(void 0!==l){var n=f,l=[l>>>0,h],p=ja(n,l,a.qb);0>p&&n.splice(-(p+1),0,l)}k&&(g.a=k.replace(/''/g,'"'))}a.J.push({nc:b,D:c,gc:d,Da:e,Eb:f})}delete this.Da}return!0};zd.prototype.Aa=function(){return!0};
|
zd.prototype.Ba=function(){if(this.Da){if(this.F){var a=this.F,b=this.id,c=this.H,d=this.u,e=this.Da,f=[],h;for(h in e){var g=e[h];"number"==typeof g&&(e[h]=g={o:g});var l=g.o,k=g.a;if(void 0!==l){var n=f,l=[l>>>0,h],p=ja(n,l,a.qb);0>p&&n.splice(-(p+1),0,l)}k&&(g.a=k.replace(/''/g,'"'))}a.J.push({nc:b,D:c,gc:d,Da:e,Eb:f})}delete this.Da}return!0};zd.prototype.Aa=function(){return!0};
|
||||||
function Ad(a,b,c,d){if(d)a.na("Unable to load system ROM (error "+d+": "+b+")");else{Xa(a.Hb,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var e=eval("("+c+")"),f=e.bytes,h=e.data;if(f)a.w=f;else if(h)for(a.w=Array(4*h.length),d=c=0;c<h.length;c++)a.w[d++]=h[c]&255,a.w[d++]=h[c]>>8&255,a.w[d++]=h[c]>>16&255,a.w[d++]=h[c]>>24&255;else a.w=e;a.Da=e.symbols;if(!a.w.length){t("Empty ROM: "+b);return}if(1==a.w.length){t(a.w[0]);return}}catch(g){a.na("ROM data error: "+g.message);return}else for(b=c.replace(/\n/gm,
|
function Ad(a,b,c,d){if(d)a.na("Unable to load system ROM (error "+d+": "+b+")");else{Xa(a.Hb,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var e=eval("("+c+")"),f=e.bytes,h=e.data;if(f)a.w=f;else if(h)for(a.w=Array(4*h.length),d=c=0;c<h.length;c++)a.w[d++]=h[c]&255,a.w[d++]=h[c]>>8&255,a.w[d++]=h[c]>>16&255,a.w[d++]=h[c]>>24&255;else a.w=e;a.Da=e.symbols;if(!a.w.length){t("Empty ROM: "+b);return}if(1==a.w.length){t(a.w[0]);return}}catch(g){a.na("ROM data error: "+g.message);return}else for(b=c.replace(/\n/gm,
|
||||||
" ").replace(/ +$/,"").split(" "),a.w=Array(b.length),e=0;e<b.length;e++)a.w[e]=aa(b[e],16);Cd(a)}}
|
" ").replace(/ +$/,"").split(" "),a.w=Array(b.length),e=0;e<b.length;e++)a.w[e]=aa(b[e],16);Cd(a)}}
|
||||||
function Cd(a){if(!ib(a))if(!a.G)D(a);else if(a.w&&a.B){a.u||(a.u=a.w.length);if(a.w.length!=a.u)jb(a,"ROM size (0x"+q(a.w.length)+") does not match specified size ("+("0x"+q(a.u))+")");else if(Dd(a,a.H)){var b=[];"number"==typeof a.C?b.push(a.C):null!=a.C&&a.C.length&&(b=a.C);for(var c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.B,h=d.u,g=[],l=d.H>>>f.ea;0<h&&l<f.U.length;)g.push(f.U[l++]),h-=f.ua;f=d.B;d=d.u;h=0;for(e>>>=f.ea;0<d&&e<f.U.length;){l=g[h++];if(!l)break;f.U[e++]=l;d-=f.ua}}delete a.w}D(a)}}
|
function Cd(a){if(!ib(a))if(!a.G)D(a);else if(a.w&&a.B){a.u||(a.u=a.w.length);if(a.w.length!=a.u)jb(a,"ROM size (0x"+q(a.w.length)+") does not match specified size ("+("0x"+q(a.u))+")");else if(Dd(a,a.H)){var b=[];"number"==typeof a.C?b.push(a.C):null!=a.C&&a.C.length&&(b=a.C);for(var c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.B,h=d.u,g=[],l=d.H>>>f.ea;0<h&&l<f.U.length;)g.push(f.U[l++]),h-=f.ua;f=d.B;d=d.u;h=0;for(e>>>=f.ea;0<d&&e<f.U.length;){l=g[h++];if(!l)break;f.U[e++]=l;d-=f.ua}}delete a.w}D(a)}}
|
||||||
function Dd(a,b){if(rb(a.B,b,a.u,a.J?1:Qb)){var c;for(c=0;c<a.w.length;c++)wb(a.B,b+c,a.w[c]);if(a.J&&256==b){for(c=0;c<Bd.length;c++)wb(a.B,Bd[c],118);Cc(a.b,function(a){return function(b){if(0<=Bd.indexOf(b)){var c=!1,h=a.b,g=a.F;if(5==b)switch(c=!0,h.O){case 2:Ed(a,String.fromCharCode(h.R));break;case 9:for(var l=Jc(h),k="",n=255;n--;){var p=a.b.X(l++);if(36==p)break;k+=String.fromCharCode(p)}Ed(a,k);break;default:c=!1}c?td.call(h):g&&(a.g("\nCP/M vector "+r(b)),F(h,b),g.da());b=!0}else b=!1;return b}}(a));
|
function Dd(a,b){if(rb(a.B,b,a.u,a.J?1:Qb)){var c;for(c=0;c<a.w.length;c++)wb(a.B,b+c,a.w[c]);if(a.J&&256==b){for(c=0;c<Bd.length;c++)wb(a.B,Bd[c],118);Cc(a.b,function(a){return function(b){if(0<=Bd.indexOf(b)){var c=!1,h=a.b,g=a.F;if(5==b)switch(c=!0,h.O){case 2:Ed(a,String.fromCharCode(h.R));break;case 9:for(var l=Jc(h),k="",n=255;n--;){var p=a.b.X(l++);if(36==p)break;k+=String.fromCharCode(p)}Ed(a,k);break;default:c=!1}c?td.call(h):g&&(a.g("\nCP/M vector "+r(b)),F(h,b),g.da());b=!0}else b=!1;return b}}(a));
|
||||||
Ec(a.b,b)}return!0}return!1}function Ed(a,b){b=b.replace(/\r/g,"");a.ta&&(a.ta.value+=b,a.ta.scrollTop=a.ta.scrollHeight)}Ia(function(){for(var a=C(document,"pc8080","rom"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new zd(d);bb(d,c)}});function Fd(a){v.call(this,"RAM",a,Fd);this.C=a.addr;this.u=a.size;this.w=!1}Va(Fd);m=Fd.prototype;m.Ia=function(a,b,c,d){this.B=b;this.b=c;this.F=d;D(this)};m.Ba=function(a,b){b||this.reset();return!0};m.Aa=function(a){return a?this.save():!0};
|
Ec(a.b,b)}return!0}return!1}function Ed(a,b){b=b.replace(/\r/g,"");a.ta&&(a.ta.value+=b,a.ta.scrollTop=a.ta.scrollHeight)}Ia(function(){for(var a=C(document,"pc8080","rom"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new zd(d);$a(d,c)}});function Fd(a){v.call(this,"RAM",a,Fd);this.C=a.addr;this.u=a.size;this.w=!1}Va(Fd);m=Fd.prototype;m.Ia=function(a,b,c,d){this.B=b;this.b=c;this.F=d;D(this)};m.Ba=function(a,b){b||this.reset();return!0};m.Aa=function(a){return a?this.save():!0};
|
||||||
m.reset=function(){!this.w&&this.u&&rb(this.B,this.C,this.u,1)&&(this.w=!0);this.w||t("No RAM allocated")};m.save=function(){return null};m.restore=function(){return!0};Ia(function(){for(var a=C(document,"pc8080","ram"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Fd(d);bb(d,c)}});function Gd(a){v.call(this,"Keyboard",a,Gd,65536);D(this)}Va(Gd);Ia(function(){for(var a=C(document,"pc8080","keyboard"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Gd(d);bb(d,c)}});
|
m.reset=function(){!this.w&&this.u&&rb(this.B,this.C,this.u,1)&&(this.w=!0);this.w||t("No RAM allocated")};m.save=function(){return null};m.restore=function(){return!0};Ia(function(){for(var a=C(document,"pc8080","ram"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Fd(d);$a(d,c)}});function Gd(a){v.call(this,"Keyboard",a,Gd,65536);D(this)}Va(Gd);Ia(function(){for(var a=C(document,"pc8080","keyboard"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Gd(d);$a(d,c)}});
|
||||||
function Hd(a,b,c,d,e){var f=this;this.wa=wa("Gecko/");var h=["","moz","ms","webkit"];v.call(this,"Video",a,Hd,262144);this.ha=a.screenWidth;this.aa=a.screenHeight;this.qa=a.bufferAddr;this.J=a.bufferCols;this.Y=a.bufferRows;this.ia=a.bufferBits||1;this.qb=a.bufferLeft||0;if(this.C=a.bufferRotate)this.C=this.C%360,0<this.C&&(this.C-=360),-90!=this.C&&(this.na("unsupported buffer rotation: "+this.C),this.C=0);this.Zb=a.interruptRate;this.Ea=a.refreshRate||60;this.L=b;this.H=c;this.Ca=d||b||null;b=
|
function Hd(a,b,c,d,e){var f=this;this.wa=wa("Gecko/");var h=["","moz","ms","webkit"];v.call(this,"Video",a,Hd,262144);this.ha=a.screenWidth;this.aa=a.screenHeight;this.ra=a.bufferAddr;this.J=a.bufferCols;this.Y=a.bufferRows;this.ia=a.bufferBits||1;this.qb=a.bufferLeft||0;if(this.C=a.bufferRotate)this.C=this.C%360,0<this.C&&(this.C-=360),-90!=this.C&&(this.na("unsupported buffer rotation: "+this.C),this.C=0);this.Zb=a.interruptRate;this.Ea=a.refreshRate||60;this.L=b;this.H=c;this.Ca=d||b||null;b=
|
||||||
a.smoothing;(c=Qa.smoothing)&&(b="true"==c);if(null!=b)for(c=0;c<h.length;c++)if(d=(d=h[c])?d+"ImageSmoothingEnabled":"imageSmoothingEnabled",void 0!==this.H[d]){this.H[d]=b;break}if(this.G=a.screenRotate)this.G=this.G%360,0<this.G&&(this.G-=360),-90!=this.G?(this.na("unsupported screen rotation: "+this.G),this.G=0):(this.H.translate(0,this.aa),this.H.rotate(this.G*Math.PI/180),this.H.scale(this.aa/this.ha,this.ha/this.aa));this.ba=1<<this.ia;this.W=Array(this.ba+2);this.W[0]=[0,0,0,255];this.W[1]=
|
a.smoothing;(c=Qa.smoothing)&&(b="true"==c);if(null!=b)for(c=0;c<h.length;c++)if(d=(d=h[c])?d+"ImageSmoothingEnabled":"imageSmoothingEnabled",void 0!==this.H[d]){this.H[d]=b;break}if(this.G=a.screenRotate)this.G=this.G%360,0<this.G&&(this.G-=360),-90!=this.G?(this.na("unsupported screen rotation: "+this.G),this.G=0):(this.H.translate(0,this.aa),this.H.rotate(this.G*Math.PI/180),this.H.scale(this.aa/this.ha,this.ha/this.aa));this.ba=1<<this.ia;this.W=Array(this.ba+2);this.W[0]=[0,0,0,255];this.W[1]=
|
||||||
[255,255,255,255];this.W[this.ba+0]=[255,255,0,255];this.W[this.ba+1]=[0,255,0,255];a=this.J;b=this.Y;this.C&&(a=this.Y,b=this.J);this.xa=this.H.createImageData(a,b);this.K=document.createElement("canvas");this.K.width=a;this.K.height=b;this.pb=this.K.getContext("2d");if(this.u=e)if(this.u.Pa=e.requestFullscreen||e.msRequestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullscreen,this.u.Pa){for(c=0;c<h.length;c++)if(d=h[c]+"fullscreenchange","on"+d in document){document.addEventListener(d,function(){Id(f,
|
[255,255,255,255];this.W[this.ba+0]=[255,255,0,255];this.W[this.ba+1]=[0,255,0,255];a=this.J;b=this.Y;this.C&&(a=this.Y,b=this.J);this.xa=this.H.createImageData(a,b);this.K=document.createElement("canvas");this.K.width=a;this.K.height=b;this.pb=this.K.getContext("2d");if(this.u=e)if(this.u.Pa=e.requestFullscreen||e.msRequestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullscreen,this.u.Pa){for(c=0;c<h.length;c++)if(d=h[c]+"fullscreenchange","on"+d in document){document.addEventListener(d,function(){Id(f,
|
||||||
document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement?!0:!1)},!1);break}for(c=0;c<h.length;c++)if(d=h[c]+"fullscreenerror","on"+d in document){document.addEventListener(d,function(){Id(f,null)},!1);break}}}Va(Hd);
|
document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement?!0:!1)},!1);break}for(c=0;c<h.length;c++)if(d=h[c]+"fullscreenerror","on"+d in document){document.addEventListener(d,function(){Id(f,null)},!1);break}}}Va(Hd);
|
||||||
Hd.prototype.Ia=function(a,b,c,d){this.w=a;this.B=b;this.b=c;this.F=d;this.oa=(this.J*this.ia>>3)*this.Y;rb(this.B,this.qa,this.oa,3)&&(this.Fa=this.oa>>1,this.Ga=16/this.ia|0,this.sa=!1,void 0===this.fa||this.fa.length!=this.Fa)&&(this.fa=Array(this.Fa));D(this)};Hd.prototype.pa=function(a,b,c){var d=this;switch(b){case "fullScreen":return this.T[b]=c,this.u&&this.u.Pa?c.onclick=function(){d.Pa()}:c.parentNode.removeChild(c),!0}return!1};
|
Hd.prototype.Ia=function(a,b,c,d){this.w=a;this.B=b;this.b=c;this.F=d;this.pa=(this.J*this.ia>>3)*this.Y;rb(this.B,this.ra,this.pa,3)&&(this.Fa=this.pa>>1,this.Ga=16/this.ia|0,this.sa=!1,void 0===this.fa||this.fa.length!=this.Fa)&&(this.fa=Array(this.Fa));D(this)};Hd.prototype.qa=function(a,b,c){var d=this;switch(b){case "fullScreen":return this.T[b]=c,this.u&&this.u.Pa?c.onclick=function(){d.Pa()}:c.parentNode.removeChild(c),!0}return!1};
|
||||||
Hd.prototype.Pa=function(){var a=!1;if(this.u){if(this.u.Pa){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.ha/this.aa;b>c&&(a=Math.round(c/b*100)+"%")}this.wa?(this.L.style.width=a,this.L.style.width=a,this.L.style.display="block",this.L.style.margin="auto"):(this.u.style.width=a,this.u.style.height="auto");this.u.style.backgroundColor="black";this.u.Pa();a=!0}this.Ca&&this.Ca.focus()}return a};
|
Hd.prototype.Pa=function(){var a=!1;if(this.u){if(this.u.Pa){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.ha/this.aa;b>c&&(a=Math.round(c/b*100)+"%")}this.wa?(this.L.style.width=a,this.L.style.width=a,this.L.style.display="block",this.L.style.margin="auto"):(this.u.style.width=a,this.u.style.height="auto");this.u.style.backgroundColor="black";this.u.Pa();a=!0}this.Ca&&this.Ca.focus()}return a};
|
||||||
function Id(a,b){!b&&a.u&&(a.wa?a.L.style.width=a.L.style.height="":a.u.style.width=a.u.style.height="");eb(a,"notifyFullScreen("+b+")",!0)}
|
function Id(a,b){!b&&a.u&&(a.wa?a.L.style.width=a.L.style.height="":a.u.style.width=a.u.style.height="");eb(a,"notifyFullScreen("+b+")",!0)}
|
||||||
Ia(function(){for(var a=C(document,"pc8080","video"),b=0;b<a.length;b++){var c=a[b],d=z(c),e=document.createElement("canvas");if(void 0===e||!e.getContext){c.innerHTML="<br/>Missing <canvas> support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=qa().indexOf("MSIE")&&(c.onresize=function(a,b,c,d){return function(){b.style.height=
|
Ia(function(){for(var a=C(document,"pc8080","video"),b=0;b<a.length;b++){var c=a[b],d=z(c),e=document.createElement("canvas");if(void 0===e||!e.getContext){c.innerHTML="<br/>Missing <canvas> support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=qa().indexOf("MSIE")&&(c.onresize=function(a,b,c,d){return function(){b.style.height=
|
||||||
(a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight),c.onresize());var f=+(d.aspect||Qa.aspect);f&&.3<=f&&3.33>=f&&(Ga("onresize",function(a,b,c){return function(){b.style.height=(a.clientWidth/c|0)+"px"}}(c,e,f)),window.onresize());c.appendChild(e);f=document.createElement("textarea");wa("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var h=e.getContext("2d"),d=new Hd(d,e,h,f,c);bb(d,c)}});
|
(a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight),c.onresize());var f=+(d.aspect||Qa.aspect);f&&.3<=f&&3.33>=f&&(Ga("onresize",function(a,b,c){return function(){b.style.height=(a.clientWidth/c|0)+"px"}}(c,e,f)),window.onresize());c.appendChild(e);f=document.createElement("textarea");wa("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var h=e.getContext("2d"),d=new Hd(d,e,h,f,c);$a(d,c)}});
|
||||||
function Jd(a){v.call(this,"Debugger",a,Jd);this.style=Kd;this.fa=this.Ca=this.L=0;this.Y=T();this.Gb=T();this.G=-1;this.C=[];this.ia=!1;this.ha=T();this.J=[];this.oa={};this.u=this.aa=this.H=[];Ld(this);this.wa=0;Md(this);this.Fa=[];Nd(this,a.messages);this.Ga=a.commands;var b=this;window?void 0===window.$&&(window.$=function(a){return qc(b,a)}):void 0===global.$&&(global.$=function(a){return qc(b,a)})}Va(Jd);
|
function Jd(a){v.call(this,"Debugger",a,Jd);this.style=Kd;this.fa=this.Ca=this.L=0;this.Y=T();this.Gb=T();this.G=-1;this.C=[];this.ia=!1;this.ha=T();this.J=[];this.pa={};this.u=this.aa=this.H=[];Ld(this);this.wa=0;Md(this);this.Fa=[];Nd(this,a.messages);this.Ga=a.commands;var b=this;window?void 0===window.$&&(window.$=function(a){return qc(b,a)}):void 0===global.$&&(global.$=function(a){return qc(b,a)})}Va(Jd);
|
||||||
var Od={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory",f:"frequencies","g [#]":"go [to #]",h:"halt","i [#]":"input port #","if":"eval expression",k:"stack trace",ln:"list nearest symbol(s)",m:"messages","o [#]":"output port #",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",s:"set options","t [#]":"trace","u [#]":"unassemble",v:"print version","var":"assign variable"},Kd=8080,Pd="NONE ACI ADC ADD ADI ANA ANI CALL CC CM CNC CNZ CP CPE CPO CZ CMA CMC CMP CPI DAA DAD DCR DCX DI EI HLT IN INR INX JMP JC JM JNC JNZ JP JPE JPO JZ LDA LDAX LHLD LXI MOV MVI NOP ORA ORI OUT PCHL POP PUSH RAL RAR RET RC RM RNC RNZ RP RPE RPO RZ RLC RRC RST SBB SBI SHLD SPHL STA STAX STC SUB SUI XCHG XRA XRI XTHL".split(" "),
|
var Od={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory",f:"frequencies","g [#]":"go [to #]",h:"halt","i [#]":"input port #","if":"eval expression",k:"stack trace",ln:"list nearest symbol(s)",m:"messages","o [#]":"output port #",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",s:"set options","t [#]":"trace","u [#]":"unassemble",v:"print version","var":"assign variable"},Kd=8080,Pd="NONE ACI ADC ADD ADI ANA ANI CALL CC CM CNC CNZ CP CPE CPO CZ CMA CMC CMP CPI DAA DAD DCR DCX DI EI HLT IN INR INX JMP JC JM JNC JNZ JP JPE JPO JZ LDA LDAX LHLD LXI MOV MVI NOP ORA ORI OUT PCHL POP PUSH RAL RAR RET RC RM RNC RNZ RP RPE RPO RZ RLC RRC RST SBB SBI SHLD SPHL STA STAX STC SUB SUI XCHG XRA XRI XTHL".split(" "),
|
||||||
Qd="NONE ADC ADC ADD ADD AND AND CALL CALLC CALLS CALLNC CALLNZ CALLNS CALLP CALLNP CALLZ NOT CMC CMP CMP DAA ADD DEC DEC CLI STI HLT IN INC INC JMP JC JS JNC JNZ JNS JP JNP JZ MOV MOV MOV MOV MOV MOV NOP OR OR OUT JMP POP PUSH RCL RCR RET RETC RETS RETNC RETNZ RETNS RETP RETNP RETZ ROL ROR RST SBB SBB MOV MOV MOV MOV STC SUB SUB XCHG XOR XOR XCHG".split(" "),Rd="B C D E H L M A BC DE HL SP PC PSW".split(" "),Sd=[[45],[42,2067,32],[71,2131,18193],[29,2067],[28,17],[22,17],[44,17,32],[63],[45,32768],
|
Qd="NONE ADC ADC ADD ADD AND AND CALL CALLC CALLS CALLNC CALLNZ CALLNS CALLP CALLNP CALLZ NOT CMC CMP CMP DAA ADD DEC DEC CLI STI HLT IN INC INC JMP JC JS JNC JNZ JNS JP JNP JZ MOV MOV MOV MOV MOV MOV NOP OR OR OUT JMP POP PUSH RCL RCR RET RETC RETS RETNC RETNZ RETNS RETP RETNP RETZ ROL ROR RST SBB SBB MOV MOV MOV MOV STC SUB SUB XCHG XOR XOR XCHG".split(" "),Rd="B C D E H L M A BC DE HL SP PC PS PSW".split(" "),Sd=[[45],[42,2067,32],[71,2131,18193],[29,2067],[28,17],[22,17],[44,17,32],[63],[45,32768],
|
||||||
[21,18963,2067],[40,18193,2131],[23,2067],[28,273],[22,273],[44,273,32],[64],[45,32768],[42,2323,32],[71,2387,18193],[29,2323],[28,529],[22,529],[44,529,32],[52],[45,32768],[21,18963,2323],[40,18193,2387],[23,2323],[28,785],[22,785],[44,785,32],[53],[45,32768],[42,2579,32],[68,115,18963],[29,2579],[28,1041],[22,1041],[44,1041,32],[20],[45,32768],[21,18963,2579],[41,18963,115],[23,2579],[28,1297],[22,1297],[44,1297,32],[16,18193],[45,32768],[42,2835,32],[70,115,18193],[29,2835],[28,1617],[22,1617],
|
[21,18963,2067],[40,18193,2131],[23,2067],[28,273],[22,273],[44,273,32],[64],[45,32768],[42,2323,32],[71,2387,18193],[29,2323],[28,529],[22,529],[44,529,32],[52],[45,32768],[21,18963,2323],[40,18193,2387],[23,2323],[28,785],[22,785],[44,785,32],[53],[45,32768],[42,2579,32],[68,115,18963],[29,2579],[28,1041],[22,1041],[44,1041,32],[20],[45,32768],[21,18963,2579],[41,18963,115],[23,2579],[28,1297],[22,1297],[44,1297,32],[16,18193],[45,32768],[42,2835,32],[70,115,18193],[29,2835],[28,1617],[22,1617],
|
||||||
[44,1617,32],[72],[45,32768],[21,18963,2835],[39,18193,115],[23,2835],[28,1809],[22,1809],[44,1809,32],[17],[43,17,17],[43,17,273],[43,17,529],[43,17,785],[43,17,1041],[43,17,1297],[43,17,1617],[43,17,1809],[43,273,17],[43,273,273],[43,273,529],[43,273,785],[43,273,1041],[43,273,1297],[43,273,1617],[43,273,1809],[43,529,17],[43,529,273],[43,529,529],[43,529,785],[43,529,1041],[43,529,1297],[43,529,1617],[43,529,1809],[43,785,17],[43,785,273],[43,785,529],[43,785,785],[43,785,1041],[43,785,1297],[43,
|
[44,1617,32],[72],[45,32768],[21,18963,2835],[39,18193,115],[23,2835],[28,1809],[22,1809],[44,1809,32],[17],[43,17,17],[43,17,273],[43,17,529],[43,17,785],[43,17,1041],[43,17,1297],[43,17,1617],[43,17,1809],[43,273,17],[43,273,273],[43,273,529],[43,273,785],[43,273,1041],[43,273,1297],[43,273,1617],[43,273,1809],[43,529,17],[43,529,273],[43,529,529],[43,529,785],[43,529,1041],[43,529,1297],[43,529,1617],[43,529,1809],[43,785,17],[43,785,273],[43,785,529],[43,785,785],[43,785,1041],[43,785,1297],[43,
|
||||||
785,1617],[43,785,1809],[43,1041,17],[43,1041,273],[43,1041,529],[43,1041,785],[43,1041,1041],[43,1041,1297],[43,1041,1617],[43,1041,1809],[43,1297,17],[43,1297,273],[43,1297,529],[43,1297,785],[43,1297,1041],[43,1297,1297],[43,1297,1617],[43,1297,1809],[43,1617,17],[43,1617,273],[43,1617,529],[43,1617,785],[43,1617,1041],[43,1617,1297],[26],[43,1617,1809],[43,1809,17],[43,1809,273],[43,1809,529],[43,1809,785],[43,1809,1041],[43,1809,1297],[43,1809,1617],[43,1809,1809],[3,18193,17],[3,18193,273],
|
785,1617],[43,785,1809],[43,1041,17],[43,1041,273],[43,1041,529],[43,1041,785],[43,1041,1041],[43,1041,1297],[43,1041,1617],[43,1041,1809],[43,1297,17],[43,1297,273],[43,1297,529],[43,1297,785],[43,1297,1041],[43,1297,1297],[43,1297,1617],[43,1297,1809],[43,1617,17],[43,1617,273],[43,1617,529],[43,1617,785],[43,1617,1041],[43,1617,1297],[26],[43,1617,1809],[43,1809,17],[43,1809,273],[43,1809,529],[43,1809,785],[43,1809,1041],[43,1809,1297],[43,1809,1617],[43,1809,1809],[3,18193,17],[3,18193,273],
|
||||||
[3,18193,529],[3,18193,785],[3,18193,1041],[3,18193,1297],[3,18193,1617],[3,18193,1809],[2,18193,17],[2,18193,273],[2,18193,529],[2,18193,785],[2,18193,1041],[2,18193,1297],[2,18193,1617],[2,18193,1809],[73,18193,17],[73,18193,273],[73,18193,529],[73,18193,785],[73,18193,1041],[73,18193,1297],[73,18193,1617],[73,18193,1809],[66,18193,17],[66,18193,273],[66,18193,529],[66,18193,785],[66,18193,1041],[66,18193,1297],[66,18193,1617],[66,18193,1809],[5,18193,17],[5,18193,273],[5,18193,529],[5,18193,785],
|
[3,18193,529],[3,18193,785],[3,18193,1041],[3,18193,1297],[3,18193,1617],[3,18193,1809],[2,18193,17],[2,18193,273],[2,18193,529],[2,18193,785],[2,18193,1041],[2,18193,1297],[2,18193,1617],[2,18193,1809],[73,18193,17],[73,18193,273],[73,18193,529],[73,18193,785],[73,18193,1041],[73,18193,1297],[73,18193,1617],[73,18193,1809],[66,18193,17],[66,18193,273],[66,18193,529],[66,18193,785],[66,18193,1041],[66,18193,1297],[66,18193,1617],[66,18193,1809],[5,18193,17],[5,18193,273],[5,18193,529],[5,18193,785],
|
||||||
[5,18193,1041],[5,18193,1297],[5,18193,1617],[5,18193,1809],[76,18193,17],[76,18193,273],[76,18193,529],[76,18193,785],[76,18193,1041],[76,18193,1297],[76,18193,1617],[76,18193,1809],[46,18193,17],[46,18193,273],[46,18193,529],[46,18193,785],[46,18193,1041],[46,18193,1297],[46,18193,1617],[46,18193,1809],[18,18193,17],[18,18193,273],[18,18193,529],[18,18193,785],[18,18193,1041],[18,18193,1297],[18,18193,1617],[18,18193,1809],[58],[50,2067],[34,51],[30,51],[11,51],[51,2067],[4,18193,33],[65,128],[62],
|
[5,18193,1041],[5,18193,1297],[5,18193,1617],[5,18193,1809],[76,18193,17],[76,18193,273],[76,18193,529],[76,18193,785],[76,18193,1041],[76,18193,1297],[76,18193,1617],[76,18193,1809],[46,18193,17],[46,18193,273],[46,18193,529],[46,18193,785],[46,18193,1041],[46,18193,1297],[46,18193,1617],[46,18193,1809],[18,18193,17],[18,18193,273],[18,18193,529],[18,18193,785],[18,18193,1041],[18,18193,1297],[18,18193,1617],[18,18193,1809],[58],[50,2067],[34,51],[30,51],[11,51],[51,2067],[4,18193,33],[65,128],[62],
|
||||||
[54],[38,51],[30,32819],[15,51],[7,51],[1,18193,33],[65,128],[57],[50,2323],[33,51],[48,33,18193],[10,51],[51,2323],[74,18193,33],[65,128],[55],[54,32768],[31,51],[27,18193,33],[8,51],[7,32819],[67,18193,33],[65,128],[61],[50,2579],[37,51],[78,19283,18963],[14,51],[51,2579],[6,18193,33],[65,128],[60],[49,2579],[36,51],[75,18963,18707],[13,51],[7,32819],[77,18193,33],[65,128],[59],[50,3347],[35,51],[24],[12,51],[51,3347],[47,18193,33],[65,128],[56],[69,19219,18963],[32,51],[25],[9,51],[7,32819],[19,
|
[54],[38,51],[30,32819],[15,51],[7,51],[1,18193,33],[65,128],[57],[50,2323],[33,51],[48,33,18193],[10,51],[51,2323],[74,18193,33],[65,128],[55],[54,32768],[31,51],[27,18193,33],[8,51],[7,32819],[67,18193,33],[65,128],[61],[50,2579],[37,51],[78,19283,18963],[14,51],[51,2579],[6,18193,33],[65,128],[60],[49,2579],[36,51],[75,18963,18707],[13,51],[7,32819],[77,18193,33],[65,128],[59],[50,3603],[35,51],[24],[12,51],[51,3603],[47,18193,33],[65,128],[56],[69,19219,18963],[32,51],[25],[9,51],[7,32819],[19,
|
||||||
18193,33],[65,128]],Td={cpu:1,bus:64,mem:128,port:256,chipset:32768,keyboard:65536,key:131072,video:262144,fdc:524288,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:536870912,warn:1073741824,halt:-2147483648};m=Jd.prototype;
|
18193,33],[65,128]],Td={cpu:1,bus:64,mem:128,port:256,chipset:32768,keyboard:65536,key:131072,video:262144,fdc:524288,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:536870912,warn:1073741824,halt:-2147483648};m=Jd.prototype;
|
||||||
m.Ia=function(a,b,c,d){this.B=b;this.b=c;this.w=a;(a=cc(a,"messages"))&&Nd(this,a);this.pb=Sd;Ud(this,function(a){a:{var b=d.B.U,c=a[0],g=a=0,l=b.length;if(c){a=V(W(d,c));if(-1===a){d.g("invalid address: "+c);break a}g=a>>>d.B.ea;l=1}d.g("blockid physical blockaddr used size type");d.g("-------- --------- ---------- ------ ------ ----");for(var c=-1,k=0;l--;){var n=b[g];n.type==c?k++||d.g("..."):(c=n.type,k=tb[c],n&&d.g(q(n.id)+" %"+q(g<<d.B.ea)+" %%"+q(n.D)+" "+r(n.nb)+" "+r(n.size)+
|
m.Ia=function(a,b,c,d){this.B=b;this.b=c;this.w=a;(a=cc(a,"messages"))&&Nd(this,a);this.pb=Sd;Ud(this,function(a){a:{var b=d.B.U,c=a[0],g=a=0,l=b.length;if(c){a=V(W(d,c));if(-1===a){d.g("invalid address: "+c);break a}g=a>>>d.B.ea;l=1}d.g("blockid physical blockaddr used size type");d.g("-------- --------- ---------- ------ ------ ----");for(var c=-1,k=0;l--;){var n=b[g];n.type==c?k++||d.g("..."):(c=n.type,k=tb[c],n&&d.g(q(n.id)+" %"+q(g<<d.B.ea)+" %%"+q(n.D)+" "+r(n.nb)+" "+r(n.size)+
|
||||||
" "+k),c!=Pb&&(c=-1),k=0);a+=d.B.ua;g++}}});D(this)};
|
" "+k),c!=Pb&&(c=-1),k=0);a+=d.B.ua;g++}}});D(this)};
|
||||||
m.pa=function(a,b,c){var d=this;switch(b){case "debugInput":return this.sa=this.T[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",qc(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?d.G<d.C.length-1&&(b=d.C[++d.G]):40==a.keyCode&&(0<d.G?b=d.C[--d.G]:(b="",d.G=-1)),null!=b){var h=b.length;c.value=b;c.setSelectionRange(h,h)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.T[b]=c,Ca(c,function(){if(d.sa){var a=d.sa.value;d.sa.value=
|
m.qa=function(a,b,c){var d=this;switch(b){case "debugInput":return this.sa=this.T[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",qc(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?d.G<d.C.length-1&&(b=d.C[++d.G]):40==a.keyCode&&(0<d.G?b=d.C[--d.G]:(b="",d.G=-1)),null!=b){var h=b.length;c.value=b;c.setSelectionRange(h,h)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.T[b]=c,Ca(c,function(){if(d.sa){var a=d.sa.value;d.sa.value=
|
||||||
"";qc(d,a,!0);return!0}return!1}),!0;case "step":return this.T[b]=c,Ca(c,function(a){var b=!1;hb(d,!0)||(gb(d,!0),b=d.bb(a?1:0),gb(d,!1));return b}),!0}return!1};m.mb=function(){this.sa&&this.sa.focus()};function V(a){a=a&&a.D;null==a&&(a=-1);return a}m.X=function(a,b){var c=255,d=V(a);-1!==d&&(c=ub(this.B,d),b&&Vd(a,b));return c};m.Ha=function(a,b){var c=65535,d=V(a);-1!==d&&(c=vb(this.B,d),b&&Vd(a,b));return c};m.ga=function(a,b,c){var d=V(a);-1!==d&&(wb(this.B,d,b),c&&Vd(a,c),rc(this.b,!0))};
|
"";qc(d,a,!0);return!0}return!1}),!0;case "step":return this.T[b]=c,Ca(c,function(a){var b=!1;hb(d,!0)||(gb(d,!0),b=d.bb(a?1:0),gb(d,!1));return b}),!0}return!1};m.mb=function(){this.sa&&this.sa.focus()};function V(a){a=a&&a.D;null==a&&(a=-1);return a}m.X=function(a,b){var c=255,d=V(a);-1!==d&&(c=ub(this.B,d),b&&Vd(a,b));return c};m.Ha=function(a,b){var c=65535,d=V(a);-1!==d&&(c=vb(this.B,d),b&&Vd(a,b));return c};m.ga=function(a,b,c){var d=V(a);-1!==d&&(wb(this.B,d,b),c&&Vd(a,c),rc(this.b,!0))};
|
||||||
m.vb=function(a,b,c){var d=V(a);if(-1!==d){var e=this.B,f=d&e.B,h=(d&e.C)>>>e.ea;f!=e.B?e.U[h].Db(f,b&65535,d):(e.U[h++].ob(f,b&255,d),e.U[h&e.K].ob(0,b>>8&255,d+1));c&&Vd(a,c);rc(this.b,!0)}};function T(a){return{D:a,za:!1}}function Wd(a){return[a.D,a.za]}function Xd(a){return{D:a[0],za:a[1]}}
|
m.vb=function(a,b,c){var d=V(a);if(-1!==d){var e=this.B,f=d&e.B,h=(d&e.C)>>>e.ea;f!=e.B?e.U[h].Db(f,b&65535,d):(e.U[h++].ob(f,b&255,d),e.U[h&e.K].ob(0,b>>8&255,d+1));c&&Vd(a,c);rc(this.b,!0)}};function T(a){return{D:a,za:!1}}function Wd(a){return[a.D,a.za]}function Xd(a){return{D:a[0],za:a[1]}}
|
||||||
function W(a,b,c){var d;c=(c?a.Y:a.Gb).D;if(void 0!==b){d=b=Yd(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;c<a.J.length;c++){var f=a.J[c].Da[d];if(void 0!==f){d=f.o;void 0!==d&&(e=T(d));break}}if(d=e)return d;c=Zd(a,b,void 0)}null!=c&&(d=T(c));return d}function $d(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Wb=ae(a,b.Ub=c[2]))}function Vd(a,b){null!=a.D&&(a.D+=b||1)}function Z(a){return q(a,4)}
|
function W(a,b,c){var d;c=(c?a.Y:a.Gb).D;if(void 0!==b){d=b=Yd(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;c<a.J.length;c++){var f=a.J[c].Da[d];if(void 0!==f){d=f.o;void 0!==d&&(e=T(d));break}}if(d=e)return d;c=Zd(a,b,void 0)}null!=c&&(d=T(c));return d}function $d(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Wb=ae(a,b.Ub=c[2]))}function Vd(a,b){null!=a.D&&(a.D+=b||1)}function Z(a){return q(a,4)}
|
||||||
function be(a,b,c){var d="";for(c=c||256;d.length<c;){var e=a.X(b,1);if(!e||36==e||127<=e)break;d+=32<=e?String.fromCharCode(e):"."}return d}function Nd(a,b){a.F=a;a.ja=a.Xb=1073741824;a.xa=null;var c=ae(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(c.length)for(var d in Td)0<=na(c,d)&&(a.ja|=Td[d],a.g(d+" messages enabled"))}function Ud(a,b){for(var c in Td)if(64==Td[c]){a.Fa[c]=b;break}}
|
function be(a,b,c){var d="";for(c=c||256;d.length<c;){var e=a.X(b,1);if(!e||36==e||127<=e)break;d+=32<=e?String.fromCharCode(e):"."}return d}function Nd(a,b){a.F=a;a.ja=a.Xb=1073741824;a.xa=null;var c=ae(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(c.length)for(var d in Td)0<=na(c,d)&&(a.ja|=Td[d],a.g(d+" messages enabled"))}function Ud(a,b){for(var c in Td)if(64==Td[c]){a.Fa[c]=b;break}}
|
||||||
function ce(a,b){var c;a=a.toUpperCase();null==b?c=na(Rd,a):(c=na(Rd,a.substr(b,3)),0>c&&(c=na(Rd,a.substr(b,2))));return c}function de(a,b){var c=0,d=ee(a,b);if(void 0!==d)switch(b){case 7:case 0:case 1:case 2:case 3:case 4:case 5:case 6:c=2;break;case 8:case 9:case 10:case 11:case 12:case 13:c=4}return c?q(d,c):"??"}
|
function ce(a,b){var c;a=a.toUpperCase();null==b?c=na(Rd,a):(c=na(Rd,a.substr(b,2)),0>c&&(c=na(Rd,a.substr(b,1))));return c}function de(a,b){var c=0,d=ee(a,b);if(void 0!==d)switch(b){case 7:case 0:case 1:case 2:case 3:case 4:case 5:case 6:c=2;break;case 8:case 9:case 10:case 11:case 12:case 13:case 14:c=4}return c?q(d,c):"??"}
|
||||||
function ee(a,b){var c;if(0<=b){var d=a.b;switch(b){case 7:c=d.j;break;case 0:c=d.N;break;case 1:c=d.O;break;case 8:c=Hc(d);break;case 2:c=d.P;break;case 3:c=d.R;break;case 9:c=Jc(d);break;case 4:c=d.S;break;case 5:c=d.V;break;case 10:c=I(d);break;case 6:c=d.X(I(d));break;case 11:c=d.ca;break;case 12:c=d.M;break;case 13:c=d.j<<8|Fc(d)&255}}return c}
|
function ee(a,b){var c;if(0<=b){var d=a.b;switch(b){case 7:c=d.j;break;case 0:c=d.N;break;case 1:c=d.O;break;case 8:c=Hc(d);break;case 2:c=d.P;break;case 3:c=d.R;break;case 9:c=Jc(d);break;case 4:c=d.S;break;case 5:c=d.V;break;case 10:c=I(d);break;case 6:c=d.X(I(d));break;case 11:c=d.ca;break;case 12:c=d.M;break;case 13:c=Fc(d);break;case 14:c=Fc(d)&255|d.j<<8}}return c}
|
||||||
function fe(a,b){b=Yd(a,b);for(var c=0,d,e;0<=(c=b.indexOf("@",c));)e=ce(b,c+1),0<=e&&(b=b.substr(0,c)+de(a,e)+b.substr(c+1+Rd[e].length)),c++;for(c=0;0<=(c=b.indexOf("#",c));)e=b.substr(c+1,2),d=aa(e,16),null!=d&&32<=d&&128>d?(d=e+" '"+String.fromCharCode(d)+"'",b=b.replace("#"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("$",c));)e=b.substr(c+1,9),(d=W(a,e))?(d=e+' "'+be(a,d)+'"',b=b.replace("$"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("^",c));)e=b.substr(c+1,9),(d=W(a,e))?(Vd(d),d=e+' "'+
|
function fe(a,b){b=Yd(a,b);for(var c=0,d,e;0<=(c=b.indexOf("@",c));)e=ce(b,c+1),0<=e&&(b=b.substr(0,c)+de(a,e)+b.substr(c+1+Rd[e].length)),c++;for(c=0;0<=(c=b.indexOf("#",c));)e=b.substr(c+1,2),d=aa(e,16),null!=d&&32<=d&&128>d?(d=e+" '"+String.fromCharCode(d)+"'",b=b.replace("#"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("$",c));)e=b.substr(c+1,9),(d=W(a,e))?(d=e+' "'+be(a,d)+'"',b=b.replace("$"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("^",c));)e=b.substr(c+1,9),(d=W(a,e))?(Vd(d),d=e+' "'+
|
||||||
be(a,d,11)+'"',b=b.replace("^"+e,d),c+=d.length):c++;return b}m.message=function(a,b){b&&(a+=" at "+Z(T(this.b.M).D));if(!this.xa||a!=this.xa)if(this.xa=a,this.ja&-2147483648&&(this.da(),a+=" (cpu halted)"),this.g(a),this.b){var c=this.b;c.i.Za=0;c.C-=c.b;c.b=0;rc(c)}};function db(a,b,c,d,e,f,h,g){g|=256;null!=f&&(a.ja&g)!=g||a.message(b.eb+"."+(null!=d?"outPort":"inPort")+"("+r(c)+","+(f?f:"unknown")+(null!=d?",0x"+q(d,2):"")+")"+(null!=h?": 0x"+q(h,2):"")+(null!=e?" at "+Z(e):""))}
|
be(a,d,11)+'"',b=b.replace("^"+e,d),c+=d.length):c++;return b}m.message=function(a,b){b&&(a+=" at "+Z(T(this.b.M).D));if(!this.xa||a!=this.xa)if(this.xa=a,this.ja&-2147483648&&(this.da(),a+=" (cpu halted)"),this.g(a),this.b){var c=this.b;c.i.Za=0;c.C-=c.b;c.b=0;rc(c)}};function db(a,b,c,d,e,f,h,g){g|=256;null!=f&&(a.ja&g)!=g||a.message(b.eb+"."+(null!=d?"outPort":"inPort")+"("+r(c)+","+(f?f:"unknown")+(null!=d?",0x"+q(d,2):"")+")"+(null!=h?": 0x"+q(h,2):"")+(null!=e?" at "+Z(e):""))}
|
||||||
function Md(a){var b;if(pd(a)){if(!a.W||!a.W.length){a.W=Array(1E3);for(b=0;b<a.W.length;b++)a.W[b]=T();a.qa=0;a.g("instruction history buffer allocated")}if(!a.K||!a.K.length)for(a.K=Array(256),b=0;b<a.K.length;b++)a.K[b]=[b,0]}else a.W&&a.W.length&&a.g("instruction history buffer freed"),a.qa=0,a.W=[],a.K=[]}m.Oa=function(a){if(!ge(this))return!1;this.b.Oa(a);return!0};
|
function Md(a){var b;if(pd(a)){if(!a.W||!a.W.length){a.W=Array(1E3);for(b=0;b<a.W.length;b++)a.W[b]=T();a.ra=0;a.g("instruction history buffer allocated")}if(!a.K||!a.K.length)for(a.K=Array(256),b=0;b<a.K.length;b++)a.K[b]=[b,0]}else a.W&&a.W.length&&a.g("instruction history buffer freed"),a.ra=0,a.W=[],a.K=[]}m.Oa=function(a){if(!ge(this))return!1;this.b.Oa(a);return!0};
|
||||||
m.bb=function(a,b,c){if(!ge(this))return!1;this.L=0;a||pd(this)&&qd(this,this.b.M,0);try{var d=this.b.bb(a);0<d&&(this.L+=d,wc(this.b,d,!0),tc(this.b,d),this.fa++)}catch(e){"number"!=typeof e&&(this.L=0,jb(this.b,e.stack||e.message))}!1!==c&&rc(this.b);this.va(b||!1);return 0<this.L};m.da=function(a){this.b&&this.b.da(a)};m.va=function(a){void 0===a&&(a=!0);this.Y=T(this.b.M);a&&1!=this.ba?he(this):ie(this)};
|
m.bb=function(a,b,c){if(!ge(this))return!1;this.L=0;a||pd(this)&&qd(this,this.b.M,0);try{var d=this.b.bb(a);0<d&&(this.L+=d,wc(this.b,d,!0),tc(this.b,d),this.fa++)}catch(e){"number"!=typeof e&&(this.L=0,jb(this.b,e.stack||e.message))}!1!==c&&rc(this.b);this.va(b||!1);return 0<this.L};m.da=function(a){this.b&&this.b.da(a)};m.va=function(a){void 0===a&&(a=!0);this.Y=T(this.b.M);a&&1!=this.ba?he(this):ie(this)};
|
||||||
function ge(a){var b;if(b=a.b&&ib(a.b))b=a.b,b.A.ka?b=!0:(b.g(b.toString()+" not powered"),b=!1);b&&!hb(a.b)?(a=a.b,a.A.Sa?(a.g(a.toString()+" error"),a=!0):a=!1,a=!a):a=!1;return a}m.Ba=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};m.Aa=function(a,b){b&&this.g(a?"suspending":"shutting down");return a?this.save():!0};m.reset=function(a){Md(this);this.fa=this.Ca=0;this.xa=null;this.L=0;this.Y=T(this.b.M);this.A.ma=!1;je(this);a||this.va()};
|
function ge(a){var b;if(b=a.b&&ib(a.b))b=a.b,b.A.ka?b=!0:(b.g(b.toString()+" not powered"),b=!1);b&&!hb(a.b)?(a=a.b,a.A.Sa?(a.g(a.toString()+" error"),a=!0):a=!1,a=!a):a=!1;return a}m.Ba=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};m.Aa=function(a,b){b&&this.g(a?"suspending":"shutting down");return a?this.save():!0};m.reset=function(a){Md(this);this.fa=this.Ca=0;this.xa=null;this.L=0;this.Y=T(this.b.M);this.A.ma=!1;je(this);a||this.va()};
|
||||||
m.save=function(){var a=new Gc(this);H(a,0,Wd(this.Y));H(a,1,Wd(this.ha));H(a,2,[this.C,this.ia,this.ja]);H(a,3,this.J);return a.data()};m.restore=function(a){var b=0;void 0!==a[2]&&(this.Y=Xd(a[b++]),this.ha=Xd(a[b++]),this.C=a[b][0],"string"==typeof this.C&&(this.C=[this.C]),this.ia=a[b][1],this.ja|=a[b][2]);a[3]&&(this.J=a[3]);return!0};m.start=function(a,b){this.ba||this.g("running");this.A.ma=!0;this.$b=a;this.ac=b};
|
m.save=function(){var a=new Gc(this);H(a,0,Wd(this.Y));H(a,1,Wd(this.ha));H(a,2,[this.C,this.ia,this.ja]);H(a,3,this.J);return a.data()};m.restore=function(a){var b=0;void 0!==a[2]&&(this.Y=Xd(a[b++]),this.ha=Xd(a[b++]),this.C=a[b][0],"string"==typeof this.C&&(this.C=[this.C]),this.ia=a[b][1],this.ja|=a[b][2]);a[3]&&(this.J=a[3]);return!0};m.start=function(a,b){this.ba||this.g("running");this.A.ma=!0;this.$b=a;this.ac=b};
|
||||||
m.stop=function(a,b){if(this.A.ma){this.A.ma=!1;this.L=b-this.ac;if(!this.ba){var c="stopped";if(this.L){var d=a-this.$b,e=0<d?Math.round(1E3*this.L/d):0,c=c+" (";pd(this)&&(c+=this.fa+" opcodes, ",this.Ca-=this.fa,this.fa=0);c+=this.L+" cycles, "+d+" ms, "+e+" hz)"}else fb(this,-2147483648)&&(c+=" (use the 't' command to execute blocked faults)");this.g(c)}this.va(!0);this.mb();je(this,this.b.M)}};function pd(a){return 1<a.u.length||!!a.wa}
|
m.stop=function(a,b){if(this.A.ma){this.A.ma=!1;this.L=b-this.ac;if(!this.ba){var c="stopped";if(this.L){var d=a-this.$b,e=0<d?Math.round(1E3*this.L/d):0,c=c+" (";pd(this)&&(c+=this.fa+" opcodes, ",this.Ca-=this.fa,this.fa=0);c+=this.L+" cycles, "+d+" ms, "+e+" hz)"}else fb(this,-2147483648)&&(c+=" (use the 't' command to execute blocked faults)");this.g(c)}this.va(!0);this.mb();je(this,this.b.M)}};function pd(a){return 1<a.u.length||!!a.wa}
|
||||||
function qd(a,b,c){var d=a.b;if(0<c&&(a.wa&&!--a.wa||Yb(a,b,1,a.u)))return!0;0<=c&&a.K.length&&(a.fa++,b=ub(a.B,b),null!=b&&(a.K[b][1]++,b=a.W[a.qa],b.D=d.M,b.za=!1,++a.qa==a.W.length&&(a.qa=0)));return!1}function zb(a,b,c){a.g("break on input from port "+r(b)+": "+q(c));a.da(!0)}function Kb(a,b,c){a.g("break on output to port "+r(b)+": "+q(c));a.da(!0)}
|
function qd(a,b,c){var d=a.b;if(0<c&&(a.wa&&!--a.wa||Yb(a,b,1,a.u)))return!0;0<=c&&a.K.length&&(a.fa++,b=ub(a.B,b),null!=b&&(a.K[b][1]++,b=a.W[a.ra],b.D=d.M,b.za=!1,++a.ra==a.W.length&&(a.ra=0)));return!1}function zb(a,b,c){a.g("break on input from port "+r(b)+": "+q(c));a.da(!0)}function Kb(a,b,c){a.g("break on output to port "+r(b)+": "+q(c));a.da(!0)}
|
||||||
function Ld(a){var b,c;a.u=["bp"];if(void 0!==a.aa)for(b=1;b<a.aa.length;b++){c=a.aa[b];var d=a.B;Zb(d.U[V(c)>>>d.ea],!1)}a.aa=["br"];if(void 0!==a.H)for(b=1;b<a.H.length;b++)c=a.H[b],d=a.B,Zb(d.U[V(c)>>>d.ea],!0);a.H=["bw"];a.Jb=0}m.Ja=function(a,b,c){var d=!0;c||ke(this,a,b,!1,!0);if(a!=this.u){var e=V(b);if(-1===e)this.g("invalid address: "+Z(b.D)),d=!1;else{var f=this.B;f.U[e>>>f.ea].Ja(e&f.B,a==this.H)}}d&&(a.push(b),c?b.za=!0:(le(this,a,a.length-1,"set"),Md(this)));return d};
|
function Ld(a){var b,c;a.u=["bp"];if(void 0!==a.aa)for(b=1;b<a.aa.length;b++){c=a.aa[b];var d=a.B;Zb(d.U[V(c)>>>d.ea],!1)}a.aa=["br"];if(void 0!==a.H)for(b=1;b<a.H.length;b++)c=a.H[b],d=a.B,Zb(d.U[V(c)>>>d.ea],!0);a.H=["bw"];a.Jb=0}m.Ja=function(a,b,c){var d=!0;c||ke(this,a,b,!1,!0);if(a!=this.u){var e=V(b);if(-1===e)this.g("invalid address: "+Z(b.D)),d=!1;else{var f=this.B;f.U[e>>>f.ea].Ja(e&f.B,a==this.H)}}d&&(a.push(b),c?b.za=!0:(le(this,a,a.length-1,"set"),Md(this)));return d};
|
||||||
function ke(a,b,c,d,e){var f=!1;c=V(c);for(var h=1;h<b.length;h++){var g=b[h];if(c==V(g)&&(!d||g.za)){f=!0;g.za||e||le(a,b,h,"cleared");b.splice(h,1);b!=a.u&&(d=a.B,Zb(d.U[c>>>d.ea],b==a.H));g.za||Md(a);break}}return f}function me(a,b){for(var c=1;c<b.length;c++)le(a,b,c);return b.length-1}function le(a,b,c,d){c=b[c];a.g(b[0]+" "+Z(c.D)+(d?" "+d:c.Ub?' "'+c.Ub+'"':""))}
|
function ke(a,b,c,d,e){var f=!1;c=V(c);for(var h=1;h<b.length;h++){var g=b[h];if(c==V(g)&&(!d||g.za)){f=!0;g.za||e||le(a,b,h,"cleared");b.splice(h,1);b!=a.u&&(d=a.B,Zb(d.U[c>>>d.ea],b==a.H));g.za||Md(a);break}}return f}function me(a,b){for(var c=1;c<b.length;c++)le(a,b,c);return b.length-1}function le(a,b,c,d){c=b[c];a.g(b[0]+" "+Z(c.D)+(d?" "+d:c.Ub?' "'+c.Ub+'"':""))}
|
||||||
function je(a,b){if(void 0!==b)Yb(a,b,1,a.u,!0),a.ba=0;else for(var c=1;c<a.u.length;c++){var d=a.u[c];if(d.za){if(!ke(a,a.u,d,!0))break;c=0}}}
|
function je(a,b){if(void 0!==b)Yb(a,b,1,a.u,!0),a.ba=0;else for(var c=1;c<a.u.length;c++){var d=a.u[c];if(d.za){if(!ke(a,a.u,d,!0))break;c=0}}}
|
||||||
function Yb(a,b,c,d,e){var f=!1;if(!a.Jb++)for(var h=1;!f&&h<d.length;h++){var g=d[h];if(!e||g.za)for(var l=V(g),k=0;k<c;k++)if(b+k==l){var n,f=!0;g.za&&(ke(a,d,g,!0),e=!0);if(n=g.Wb){for(var f=!1,p=0;p<n.length;p++)if(!ne(a,n[p],!0)){if(n[p].indexOf("if")){f=!0;break}for(var x=p+1;x<n.length&&n[x].indexOf("else");x++)p++;if(x==n.length){f=!0;break}}a.b.A.ma||(f=!0)}if(f){e||le(a,d,h,"hit");break}}}a.Jb--;return f}
|
function Yb(a,b,c,d,e){var f=!1;if(!a.Jb++)for(var h=1;!f&&h<d.length;h++){var g=d[h];if(!e||g.za)for(var l=V(g),k=0;k<c;k++)if(b+k==l){var n,f=!0;g.za&&(ke(a,d,g,!0),e=!0);if(n=g.Wb){for(var f=!1,p=0;p<n.length;p++)if(!ne(a,n[p],!0)){if(n[p].indexOf("if")){f=!0;break}for(var x=p+1;x<n.length&&n[x].indexOf("else");x++)p++;if(x==n.length){f=!0;break}}a.b.A.ma||(f=!0)}if(f){e||le(a,d,h,"hit");break}}}a.Jb--;return f}
|
||||||
function oe(a,b,c,d){for(var e=T(b.D),f=a.X(b,1),h=a.pb[f],g="",l=(8086!=a.style?Pd:Qd)[h[0]],k=h.length-1,n=0,p,x=1;x<=k;x++){var B="";p=h[x];if(void 0!==p&&!(p&16384&&a.style==Kd)){var u=p&240;if(u){var la=p&15;la?n=la:p|=n;p&61440||(p|=1==x?8192:4096);if(u&32)a:{var B=a,u=p,la=b,w=" ";switch(u&15){case 1:w=q(B.X(la,1),2);break;case 2:w=q(B.X(la,1)<<24>>24,4);break;case 3:w=q(B.Ha(la,2),4);break;default:B="imm("+r(u)+")";break a}8086==B.style&&u&64?w="["+w+"]":u&16||(w=(B.style==Kd?"$":"0x")+w);
|
function oe(a,b,c,d){for(var e=T(b.D),f=a.X(b,1),h=a.pb[f],g="",l=(8086!=a.style?Pd:Qd)[h[0]],k=h.length-1,n=0,p,x=1;x<=k;x++){var B="";p=h[x];if(void 0!==p&&!(p&16384&&a.style==Kd)){var u=p&240;if(u){var la=p&15;la?n=la:p|=n;p&61440||(p|=1==x?8192:4096);if(u&32)a:{var B=a,u=p,la=b,w=" ";switch(u&15){case 1:w=q(B.X(la,1),2);break;case 2:w=q(B.X(la,1)<<24>>24,4);break;case 3:w=q(B.Ha(la,2),4);break;default:B="imm("+r(u)+")";break a}8086==B.style&&u&64?w="["+w+"]":u&16||(w=(B.style==Kd?"$":"0x")+w);
|
||||||
B=w}else u&16?(B=(p&3840)>>8,u=Rd[B],8086==a.style&&p&64&&(6==B&&(u="HL"),u="["+u+"]"),B=u):u&128&&(B=(f>>3&7).toString());if(!B||!B.length){g="INVALID";break}0<g.length&&(g+=",");g+=B||"???"}}}f="";h=Z(e.D)+" ";if(-1!==e.D&&-1!==b.D){do if(f+=q(a.X(e,1),2),null==e.D)break;while(e.D!=b.D)}h+=ha(f,10);h=h+(p&32768?"*":" ")+ha(l,7);g&&(h+=" "+g);c&&(h=ha(h,40)+";"+c,h=a.b.A.Ra?h+("cycles="+uc(a.b).toString()+" cs="+q(a.b.i.fb)):h+(null!=d?"="+d.toString():""));return h}
|
B=w}else u&16?(B=(p&3840)>>8,u=Rd[B],8086==a.style&&p&64&&(6==B&&(u="HL"),u="["+u+"]"),B=u):u&128&&(B=(f>>3&7).toString());if(!B||!B.length){g="INVALID";break}0<g.length&&(g+=",");g+=B||"???"}}}f="";h=Z(e.D)+" ";if(-1!==e.D&&-1!==b.D){do if(f+=q(a.X(e,1),2),null==e.D)break;while(e.D!=b.D)}h+=ha(f,10);h=h+(p&32768?"*":" ")+ha(l,7);g&&(h+=" "+g);c&&(h=ha(h,40)+";"+c,h=a.b.A.Ra?h+("cycles="+uc(a.b).toString()+" cs="+q(a.b.i.fb)):h+(null!=d?"="+d.toString():""));return h}
|
||||||
function pe(a,b){var c;switch(b){case "I":c=a.b.ra&512;break;case "S":c=Qc(a.b);break;case "Z":c=Pc(a.b);break;case "A":c=Oc(a.b);break;case "P":c=Nc(a.b);break;case "C":c=Mc(a.b);break;default:c=0}return b+(c?"1":"0")+" "}function qe(a,b){return Rd[b]+"="+de(a,b)+" "}function Pe(a){return qe(a,7)+qe(a,8)+qe(a,9)+qe(a,10)+qe(a,11)+pe(a,"I")+pe(a,"S")+pe(a,"Z")+pe(a,"A")+pe(a,"P")+pe(a,"C")}
|
function pe(a,b){var c;switch(b){case "IF":c=a.b.oa&512;break;case "SF":c=Qc(a.b);break;case "ZF":c=Pc(a.b);break;case "AF":c=Oc(a.b);break;case "PF":c=Nc(a.b);break;case "CF":c=Mc(a.b);break;default:c=0}return b.charAt(0)+(c?"1":"0")+" "}function qe(a,b){return Rd[b]+"="+de(a,b)+" "}function Pe(a){return qe(a,7)+qe(a,8)+qe(a,9)+qe(a,10)+qe(a,11)+pe(a,"IF")+pe(a,"SF")+pe(a,"ZF")+pe(a,"AF")+pe(a,"PF")+pe(a,"CF")}
|
||||||
var Qe={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
|
var Qe={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
|
||||||
function Re(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<<e;break;case ">>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f<e?1:0;break;case "<=":d=f<=e?1:0;break;case ">":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break;
|
function Re(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<<e;break;case ">>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f<e?1:0;break;case "<=":d=f<=e?1:0;break;case ">":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break;
|
||||||
case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0}
|
case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0}
|
||||||
function Zd(a,b,c){var d;if(b){b=Yd(a,b);for(var e=0,f=!1,h=b,g=[],l=[],k=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<k.length;){var n=k[e++],p=n.length,n=ia(n);if(!n){f=!0;break}n=Se(a,n,null,!1===c);if(void 0===n){f=!0;c=!1;break}g.push(n);if(e==k.length)break;var n=k[e++],x=n.length;l.length&&Qe[n]<Qe[l[l.length-1]]&&Re(g,l,1);l.push(n);b=b.substr(p+x)}Re(g,l)&&1==g.length||(f=!0);f?c&&a.g("error parsing '"+h+"' at character "+(h.length-b.length)):(d=g.pop(),c&&Te(a,null,
|
function Zd(a,b,c){var d;if(b){b=Yd(a,b);for(var e=0,f=!1,h=b,g=[],l=[],k=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<k.length;){var n=k[e++],p=n.length,n=ia(n);if(!n){f=!0;break}n=Se(a,n,null,!1===c);if(void 0===n){f=!0;c=!1;break}g.push(n);if(e==k.length)break;var n=k[e++],x=n.length;l.length&&Qe[n]<Qe[l[l.length-1]]&&Re(g,l,1);l.push(n);b=b.substr(p+x)}Re(g,l)&&1==g.length||(f=!0);f?c&&a.g("error parsing '"+h+"' at character "+(h.length-b.length)):(d=g.pop(),c&&Te(a,null,
|
||||||
d))}return d}function Yd(a,b){for(var c;(c=b.match(/\{(.*?)}/))&&!(0<=c[1].indexOf("{"));){var d=Zd(a,c[1]);b=b.replace("{"+c[1]+"}",null!=d?q(d):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)d=W(a,c[1]),b=b.replace("["+c[1]+"]",d?q(a.Ha(d,0),4):"undefined");for(c=b;d=c.match(/\$([a-z]+)/i);){var e=null;switch(d[1].toLowerCase()){case "ops":e=a.fa-a.Ca}if(null==e)break;c=c.replace(d[0],e.toString())}return c}
|
d))}return d}function Yd(a,b){for(var c;(c=b.match(/\{(.*?)}/))&&!(0<=c[1].indexOf("{"));){var d=Zd(a,c[1]);b=b.replace("{"+c[1]+"}",null!=d?q(d):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)d=W(a,c[1]),b=b.replace("["+c[1]+"]",d?q(a.Ha(d,0),4):"undefined");for(c=b;d=c.match(/\$([a-z]+)/i);){var e=null;switch(d[1].toLowerCase()){case "ops":e=a.fa-a.Ca}if(null==e)break;c=c.replace(d[0],e.toString())}return c}
|
||||||
function Se(a,b,c,d){var e;void 0!==b?(e=ce(b),0<=e?e=ee(a,e):(e=a.oa[b],void 0===e&&(e=aa(b))),void 0!==e||d||a.g("invalid "+(c?c:"value")+": "+b)):d||a.g("missing "+(c||"value"));return e}
|
function Se(a,b,c,d){var e;void 0!==b?(e=ce(b),0<=e?e=ee(a,e):(e=a.pa[b],void 0===e&&(e=aa(b))),void 0!==e||d||a.g("invalid "+(c?c:"value")+": "+b)):d||a.g("missing "+(c||"value"));return e}
|
||||||
function Te(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f,h="";if(!f||4<f)f=4;for(var g=0;g<f;g++){h&&(h=","+h);var l=d&255,k=8,n="";void 0===k?k=32:32<k&&(k=32);if(null==l||isNaN(l))for(;0<k--;)n="?"+n;else for(;0<k--;)n=(l&1?"1":"0")+n,l>>=1;h=n+"b"+h;d>>=8}d="0x"+q(c)+" "+c+". ("+h+")"}a.g((null!=b?b+": ":"")+d);return e}function Ue(a,b){if(b)return Te(a,b,a.oa[b]);var c=0;for(b in a.oa)Te(a,b,a.oa[b]),c++;return 0<c}Jd.prototype.qb=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
function Te(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f,h="";if(!f||4<f)f=4;for(var g=0;g<f;g++){h&&(h=","+h);var l=d&255,k=8,n="";void 0===k?k=32:32<k&&(k=32);if(null==l||isNaN(l))for(;0<k--;)n="?"+n;else for(;0<k--;)n=(l&1?"1":"0")+n,l>>=1;h=n+"b"+h;d>>=8}d="0x"+q(c)+" "+c+". ("+h+")"}a.g((null!=b?b+": ":"")+d);return e}function Ue(a,b){if(b)return Te(a,b,a.pa[b]);var c=0;for(b in a.pa)Te(a,b,a.pa[b]),c++;return 0<c}Jd.prototype.qb=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
||||||
function Ve(a,b,c){var d=[],e=V(b)>>>0;for(b=0;b<a.J.length;b++){var f=a.J[b],h=f.D>>>0,g=f.gc;if(e>=h&&e<h+g){e=ja(f.Eb,[e-h],a.qb);0<=e?We(a,b,e,d):c&&(e=~e,We(a,b,e-1,d),We(a,b,e,d));break}}return d}function We(a,b,c,d){var e={},f=a.J[b].Eb,h=0,g=null;0<=c&&c<f.length&&(h=f[c][0],g=f[c][1]);g&&(e=a.J[b].Da[g],g="."==g.charAt(0)?null:e.l||g);d.push(g);d.push(h);d.push(e.a);d.push(e.c)}
|
function Ve(a,b,c){var d=[],e=V(b)>>>0;for(b=0;b<a.J.length;b++){var f=a.J[b],h=f.D>>>0,g=f.gc;if(e>=h&&e<h+g){e=ja(f.Eb,[e-h],a.qb);0<=e?We(a,b,e,d):c&&(e=~e,We(a,b,e-1,d),We(a,b,e,d));break}}return d}function We(a,b,c,d){var e={},f=a.J[b].Eb,h=0,g=null;0<=c&&c<f.length&&(h=f[c][0],g=f[c][1]);g&&(e=a.J[b].Da[g],g="."==g.charAt(0)?null:e.l||g);d.push(g);d.push(h);d.push(e.a);d.push(e.c)}
|
||||||
function Xe(a,b){if("?"==b)a.g("frequency commands:"),a.g("\tclear\tclear all frequency counts");else{var c,d=0;if(a.K)if("clear"==b){for(c=0;c<a.K.length;c++)a.K[c]=[c,0];a.g("frequency data cleared");d++}else if(void 0!==b)a.g("unknown frequency command: "+b),d++;else{var e=a.K.slice();e.sort(function(a,b){return b[1]-a[1]});var f=8086!=a.style?Pd:Qd;for(c=0;c<e.length;c++){var h=e[c][0],g=e[c][1];g&&(a.g((f[a.pb[h][0]]+" ").substr(0,5)+" ("+("0x"+q(h,2))+"): "+g+" times"),d++)}}d||a.g("no frequency data available")}}
|
function Xe(a,b){if("?"==b)a.g("frequency commands:"),a.g("\tclear\tclear all frequency counts");else{var c,d=0;if(a.K)if("clear"==b){for(c=0;c<a.K.length;c++)a.K[c]=[c,0];a.g("frequency data cleared");d++}else if(void 0!==b)a.g("unknown frequency command: "+b),d++;else{var e=a.K.slice();e.sort(function(a,b){return b[1]-a[1]});var f=8086!=a.style?Pd:Qd;for(c=0;c<e.length;c++){var h=e[c][0],g=e[c][1];g&&(a.g((f[a.pb[h][0]]+" ").substr(0,5)+" ("+("0x"+q(h,2))+"): "+g+" times"),d++)}}d||a.g("no frequency data available")}}
|
||||||
function Ye(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Ue(a)||a.g("no variables"),!0;if(!c[2])return Ue(a,c[1]);if(!c[3])return delete a.oa[c[1]],!0;var d=Zd(a,c[3]);return void 0!==d?(a.oa[c[1]]=d,!0):!1}a.g("invalid assignment:"+b);return!1}
|
function Ye(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Ue(a)||a.g("no variables"),!0;if(!c[2])return Ue(a,c[1]);if(!c[3])return delete a.pa[c[1]],!0;var d=Zd(a,c[3]);return void 0!==d?(a.pa[c[1]]=d,!0):!1}a.g("invalid assignment:"+b);return!1}
|
||||||
function Ze(a,b,c){var d=null;if(b=W(a,b,!0)){var e=Ve(a,b,!0);if(e.length){var f,h;e[0]&&(h="",(f=b.D-e[1])&&(h=" + "+r(f)),f=e[0]+" ("+Z(e[1])+")"+h,c&&a.g(f),d=f);4<e.length&&e[4]&&(h="",(f=e[5]-b.D)&&(h=" - "+r(f)),f=e[4]+" ("+Z(e[5])+")"+h,c&&a.g(f),d||(d=f))}else c&&a.g("no symbols")}return d}
|
function Ze(a,b,c){var d=null;if(b=W(a,b,!0)){var e=Ve(a,b,!0);if(e.length){var f,h;e[0]&&(h="",(f=b.D-e[1])&&(h=" + "+r(f)),f=e[0]+" ("+Z(e[1])+")"+h,c&&a.g(f),d=f);4<e.length&&e[4]&&(h="",(f=e[5]-b.D)&&(h=" - "+r(f)),f=e[4]+" ("+Z(e[5])+")"+h,c&&a.g(f),d||(d=f))}else c&&a.g("no symbols")}return d}
|
||||||
function $e(a,b){switch(b[1]){case "8080":a.style=Kd;break;case "8086":a.style=8086;break;case "cs":var c;void 0!==b[3]&&(c=+b[3]);switch(b[2]){case "int":a.b.i.Wa=c;break;case "start":a.b.i.gb=c;break;case "stop":a.b.i.Ya=c;break;default:a.g("unknown cs option");return}void 0!==c&&pc(a.b);a.g("checksums "+(a.b.A.Ra?"enabled":"disabled"));return;case "sp":void 0!==b[2]&&(vc(a.b,+b[2])||a.g("warning: using 1x multiplier, previous target not reached"));a.g("target speed: "+(a.b.i.La.toFixed(2)+"Mhz")+
|
function $e(a,b){switch(b[1]){case "8080":a.style=Kd;break;case "8086":a.style=8086;break;case "cs":var c;void 0!==b[3]&&(c=+b[3]);switch(b[2]){case "int":a.b.i.Wa=c;break;case "start":a.b.i.gb=c;break;case "stop":a.b.i.Ya=c;break;default:a.g("unknown cs option");return}void 0!==c&&pc(a.b);a.g("checksums "+(a.b.A.Ra?"enabled":"disabled"));return;case "sp":void 0!==b[2]&&(vc(a.b,+b[2])||a.g("warning: using 1x multiplier, previous target not reached"));a.g("target speed: "+(a.b.i.La.toFixed(2)+"Mhz")+
|
||||||
" ("+a.b.i.Na+"x)");return;case "?":a.g("debugger options:");a.g("\t8080\t\tselect 8080-style mnemonics");a.g("\t8086\t\tselect 8086-style mnemonics");a.g("\tcs int #\tset checksum cycle interval to #");a.g("\tcs start #\tset checksum cycle start count to #");a.g("\tcs stop #\tset checksum cycle stop count to #");a.g("\tsp #\t\tset speed multiplier to #");break;default:if(b[1]){a.g("unknown option: "+b[1]);return}}a.g(a.style+"-style mnemonics enabled")}
|
" ("+a.b.i.Na+"x)");return;case "?":a.g("debugger options:");a.g("\t8080\t\tselect 8080-style mnemonics");a.g("\t8086\t\tselect 8086-style mnemonics");a.g("\tcs int #\tset checksum cycle interval to #");a.g("\tcs start #\tset checksum cycle start count to #");a.g("\tcs stop #\tset checksum cycle stop count to #");a.g("\tsp #\t\tset speed multiplier to #");break;default:if(b[1]){a.g("unknown option: "+b[1]);return}}a.g(a.style+"-style mnemonics enabled")}
|
||||||
function he(a,b){var c;if(b&&"?"==b[1])a.g("register commands:"),a.g("\tr\tdump registers"),a.g("\trx [#]\tset flag or register x to [#]");else{var d=a.b;null==c&&(c=!0);if(null!=b&&1<b.length){var e=b[1],f=null,h=e.indexOf("=");if(0<h)f=e.substr(h+1),e=e.substr(0,h);else if(2<b.length)f=b[2];else{a.g("missing value for "+b[1]);return}var h=!1,g=Zd(a,f);if(void 0!==g)switch(h=!0,e.toUpperCase()){case "A":d.j=g&255;break;case "B":d.N=g&255;break;case "BC":d.N=g>>8&255;case "C":d.O=g&255;break;case "D":d.P=
|
function he(a,b){var c;if(b&&"?"==b[1])a.g("register commands:"),a.g("\tr\tdump registers"),a.g("\trx [#]\tset flag or register x to [#]");else{var d=a.b;null==c&&(c=!0);if(null!=b&&1<b.length){var e=b[1],f=null,h=e.indexOf("=");if(0<h)f=e.substr(h+1),e=e.substr(0,h);else if(2<b.length)f=b[2];else{a.g("missing value for "+b[1]);return}var h=!1,g=Zd(a,f);if(void 0!==g)switch(h=!0,e.toUpperCase()){case "A":d.j=g&255;break;case "B":d.N=g&255;break;case "BC":d.N=g>>8&255;case "C":d.O=g&255;break;case "D":d.P=
|
||||||
g&255;break;case "DE":d.P=g>>8&255;case "E":d.R=g&255;break;case "H":d.S=g&255;break;case "HL":d.S=g>>8&255;case "L":d.V=g&255;break;case "SP":d.ca=g&65535;break;case "PC":F(d,g);a.Y=T(d.M);break;case "PS":Dc(d,g);break;case "C":d.I=g?d.I|256:d.I&255;break;case "P":g?Nc(d)||(d.Z^=1):Nc(d)&&(d.Z^=1);break;case "A":d.la=g?~d.Z&16|d.la&-17:d.Z&16|d.la&-17;break;case "Z":d.I=g?d.I&-256:d.I|255;break;case "S":g?Qc(d)||(d.Z^=192):Qc(d)&&(d.Z^=192);break;case "I":d.ra=g?d.ra|512:d.ra&-513;break;default:a.g("unknown register: "+
|
g&255;break;case "DE":d.P=g>>8&255;case "E":d.R=g&255;break;case "H":d.S=g&255;break;case "HL":d.S=g>>8&255;case "L":d.V=g&255;break;case "SP":d.ca=g&65535;break;case "PC":F(d,g);a.Y=T(d.M);break;case "PS":Dc(d,g);break;case "PSW":Dc(d,g&255|d.oa&-256);d.j=g>>8;break;case "CF":d.I=g?d.I|256:d.I&255;break;case "PF":g?Nc(d)||(d.Z^=1):Nc(d)&&(d.Z^=1);break;case "AF":d.la=g?~d.Z&16|d.la&-17:d.Z&16|d.la&-17;break;case "ZF":d.I=g?d.I&-256:d.I|255;break;case "SF":g?Qc(d)||(d.Z^=192):Qc(d)&&(d.Z^=192);break;
|
||||||
e);return}if(!h){a.g("invalid value: "+f);return}rc(d);a.g("updated registers:")}a.g(Pe(a));c&&(a.Y=T(d.M),ie(a,Z(a.Y.D)))}}function af(a,b){b=ia(b);var c=b.match(/^(['"])(.*?)\1$/);c?a.g(fe(a,c[2])):Zd(a,b,!0)}function bf(a,b,c){var d="t"!=b;c=Se(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Ba(c,function(){return gb(a,!0)&&a.bb(e,d,!1)},function(){rc(a.b);gb(a,!1)})}
|
case "IF":d.oa=g?d.oa|512:d.oa&-513;break;default:a.g("unknown register: "+e);return}if(!h){a.g("invalid value: "+f);return}rc(d);a.g("updated registers:")}a.g(Pe(a));c&&(a.Y=T(d.M),ie(a,Z(a.Y.D)))}}function af(a,b){b=ia(b);var c=b.match(/^(['"])(.*?)\1$/);c?a.g(fe(a,c[2])):Zd(a,b,!0)}function bf(a,b,c){var d="t"!=b;c=Se(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Ba(c,function(){return gb(a,!0)&&a.bb(e,d,!1)},function(){rc(a.b);gb(a,!1)})}
|
||||||
function ie(a,b,c,d){if(b=W(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c){d=W(a,c,!0);if(!d||d.D<b.D)return;e=d.D-b.D;if(256<e){a.g("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=hb(a,!1)||a.ba?a.L:null;var h=null!=f?"cycles":null,g=Ve(a,b),l=b.D;if(g[0]&&d&&(!c&&d||0>g[0].indexOf("+"))){var k=g[0]+":";g[2]&&(k+=" "+g[2]);a.g(k)}g[3]&&(h=g[3],f=null);f=oe(a,b,h,f);a.g(f);a.Y=b;e-=b.D-l;c++}}}
|
function ie(a,b,c,d){if(b=W(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c){d=W(a,c,!0);if(!d||d.D<b.D)return;e=d.D-b.D;if(256<e){a.g("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=hb(a,!1)||a.ba?a.L:null;var h=null!=f?"cycles":null,g=Ve(a,b),l=b.D;if(g[0]&&d&&(!c&&d||0>g[0].indexOf("+"))){var k=g[0]+":";g[2]&&(k+=" "+g[2]);a.g(k)}g[3]&&(h=g[3],f=null);f=oe(a,b,h,f);a.g(f);a.Y=b;e-=b.D-l;c++}}}
|
||||||
function ae(a,b,c,d){if(c)if(b){0>a.G&&a.C.length&&(a.G=0);if(0>a.G||b!=a.C[a.G])a.C.splice(0,0,b),a.G=0;a.G--}else a.ia?b="end":b=a.C[a.G+1];a=[];if(b){b=b.toLowerCase().replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var h=b.charAt(f);if('"'==h||"'"==h)e?h==e&&(e=null):e=h;else if(h==d&&!e||!h)a.push(ia(b.substring(c,f))),c=f+1}}return a}
|
function ae(a,b,c,d){if(c)if(b){0>a.G&&a.C.length&&(a.G=0);if(0>a.G||b!=a.C[a.G])a.C.splice(0,0,b),a.G=0;a.G--}else a.ia?b="end":b=a.C[a.G+1];a=[];if(b){b=b.toLowerCase().replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var h=b.charAt(f);if('"'==h||"'"==h)e?h==e&&(e=null):e=h;else if(h==d&&!e||!h)a.push(ia(b.substring(c,f))),c=f+1}}return a}
|
||||||
function ne(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.g(">> "+b):(a.ia&&(a.g("ended assemble at "+Z(a.ha.D)),a.Y=a.ha,a.ia=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.xa=null;if(ib(a)&&0<b.length){a.ia&&(b="a "+Z(a.ha.D)+" "+b);var f=b.replace(/ +/g," ").split(" ");if(f&&f.length)for(var h=f[0],g=h.charAt(0),l=1;l<h.length;l++){var k=h.charAt(l);if("?"==g||"r"==g||"a">k||"z"<k){f[0]=h.substr(l);f.unshift(h.substr(0,l));break}}switch(f[0].charAt(0)){case "a":var n=W(a,f[1],!0);if(n)if(a.ha=
|
function ne(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.g(">> "+b):(a.ia&&(a.g("ended assemble at "+Z(a.ha.D)),a.Y=a.ha,a.ia=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.xa=null;if(ib(a)&&0<b.length){a.ia&&(b="a "+Z(a.ha.D)+" "+b);var f=b.replace(/ +/g," ").split(" ");if(f&&f.length)for(var h=f[0],g=h.charAt(0),l=1;l<h.length;l++){var k=h.charAt(l);if("?"==g||"r"==g||"a">k||"z"<k){f[0]=h.substr(l);f.unshift(h.substr(0,l));break}}switch(f[0].charAt(0)){case "a":var n=W(a,f[1],!0);if(n)if(a.ha=
|
||||||
n,void 0===f[2])a.g("begin assemble at "+Z(n.D)),a.ia=!0,rc(a.b);else{var p;a.g("not supported yet");p=[];if(p.length){for(var x=0;x<p.length;x++)a.ga(n,p[x],1);a.g(oe(a,a.ha))}}break;case "b":a:{var B=f[0],u=f[1],la=b;if("?"==u)a.g("breakpoint commands:"),a.g("\tbi [p]\ttoggle break on input port [p]"),a.g("\tbo [p]\ttoggle break on output port [p]"),a.g("\tbp [a]\tset exec breakpoint at addr [a]"),a.g("\tbr [a]\tset read breakpoint at addr [a]"),a.g("\tbw [a]\tset write breakpoint at addr [a]"),
|
n,void 0===f[2])a.g("begin assemble at "+Z(n.D)),a.ia=!0,rc(a.b);else{var p;a.g("not supported yet");p=[];if(p.length){for(var x=0;x<p.length;x++)a.ga(n,p[x],1);a.g(oe(a,a.ha))}}break;case "b":a:{var B=f[0],u=f[1],la=b;if("?"==u)a.g("breakpoint commands:"),a.g("\tbi [p]\ttoggle break on input port [p]"),a.g("\tbo [p]\ttoggle break on output port [p]"),a.g("\tbp [a]\tset exec breakpoint at addr [a]"),a.g("\tbr [a]\tset read breakpoint at addr [a]"),a.g("\tbw [a]\tset write breakpoint at addr [a]"),
|
||||||
a.g("\tbc [a]\tclear breakpoint at addr [a]"),a.g("\tbl\tlist all breakpoints"),a.g("\tbn [n]\tbreak after [n] instruction(s)");else{var w=B.charAt(1);if("l"==w){var da=0,da=da+me(a,a.u),da=da+me(a,a.aa);(da+=me(a,a.H))||a.g("no breakpoints")}else if("n"==w)a.wa=Se(a,u),a.g("break after "+a.wa+" instruction(s)");else if(void 0===u)a.g("missing breakpoint address");else{var K=T();if("*"!=u&&(K=W(a,u,!0),!K))break a;u=r(K.D);"c"==w?null==K.D?(Ld(a),a.g("all breakpoints cleared")):ke(a,a.u,K)||ke(a,
|
a.g("\tbc [a]\tclear breakpoint at addr [a]"),a.g("\tbl\tlist all breakpoints"),a.g("\tbn [n]\tbreak after [n] instruction(s)");else{var w=B.charAt(1);if("l"==w){var da=0,da=da+me(a,a.u),da=da+me(a,a.aa);(da+=me(a,a.H))||a.g("no breakpoints")}else if("n"==w)a.wa=Se(a,u),a.g("break after "+a.wa+" instruction(s)");else if(void 0===u)a.g("missing breakpoint address");else{var K=T();if("*"!=u&&(K=W(a,u,!0),!K))break a;u=r(K.D);"c"==w?null==K.D?(Ld(a),a.g("all breakpoints cleared")):ke(a,a.u,K)||ke(a,
|
||||||
a.aa,K)||ke(a,a.H,K)||a.g("breakpoint missing: "+Z(K.D)):"i"==w?a.g("breakpoint "+(xb(a.B,K.D)?"enabled":"cleared")+": port "+u+" (input)"):"o"==w?a.g("breakpoint "+(Ib(a.B,K.D)?"enabled":"cleared")+": port "+u+" (output)"):null!=K.D&&($d(a,K,la),"p"==w?a.Ja(a.u,K):"r"==w?a.Ja(a.aa,K):"w"==w?a.Ja(a.H,K):a.g("unknown breakpoint command: "+w))}}}break;case "c":a.ta&&(a.ta.value="");break;case "d":a:{var M,P=f[0],A=f[1],X=f[2],zf=f[3];if("?"==A){var xa="";for(M in Td)a.Fa[M]&&(xa&&(xa+=","),xa+=M);xa+=
|
a.aa,K)||ke(a,a.H,K)||a.g("breakpoint missing: "+Z(K.D)):"i"==w?a.g("breakpoint "+(xb(a.B,K.D)?"enabled":"cleared")+": port "+u+" (input)"):"o"==w?a.g("breakpoint "+(Ab(a.B,K.D)?"enabled":"cleared")+": port "+u+" (output)"):null!=K.D&&($d(a,K,la),"p"==w?a.Ja(a.u,K):"r"==w?a.Ja(a.aa,K):"w"==w?a.Ja(a.H,K):a.g("unknown breakpoint command: "+w))}}}break;case "c":a.ta&&(a.ta.value="");break;case "d":a:{var M,P=f[0],A=f[1],X=f[2],zf=f[3];if("?"==A){var xa="";for(M in Td)a.Fa[M]&&(xa&&(xa+=","),xa+=M);xa+=
|
||||||
",state,symbols";a.g("dump memory commands:");a.g("\tdb [a] [#] dump # bytes at address a");a.g("\tdw [a] [#] dump # words at address a");a.g("\tdd [a] [#] dump # dwords at address a");a.g("\tdh [#] [#] dump # instructions from history");xa.length&&a.g("dump extension commands:\n\t"+xa)}else if("state"==A){var re=cf(a.w,!0);"console"==X?console.log(re):(a.ta&&(a.ta.value=""),a.g(re))}else if("symbols"==A)for(var Uc=0;Uc<a.J.length;Uc++){var Vc=a.J[Uc],$a;for($a in Vc.Da)if("."!=$a.charAt(0)){var se=
|
",state,symbols";a.g("dump memory commands:");a.g("\tdb [a] [#] dump # bytes at address a");a.g("\tdw [a] [#] dump # words at address a");a.g("\tdd [a] [#] dump # dwords at address a");a.g("\tdh [#] [#] dump # instructions from history");xa.length&&a.g("dump extension commands:\n\t"+xa)}else if("state"==A){var re=cf(a.w,!0);"console"==X?console.log(re):(a.ta&&(a.ta.value=""),a.g(re))}else if("symbols"==A)for(var Uc=0;Uc<a.J.length;Uc++){var Vc=a.J[Uc],ab;for(ab in Vc.Da)if("."!=ab.charAt(0)){var se=
|
||||||
Vc.Da[$a].o;if(void 0!==se){var te=Vc.Da[$a].l;te&&($a=te);a.g(Z(se)+" "+$a)}}}else{if("d"==P){for(M in Td)if(f[1]==M){var ue=a.Fa[M];ue?(f.shift(),f.shift(),ue(f)):a.g("no dump registered for "+A);break a}A||(P=a.fc||"db")}else a.fc=P;if("dh"==P){var ve=A,we=X,xe="",ye=0,U=a.qa,ya=a.W;if(ya.length){var Y=+ve||a.Nb,ab=+we||10;isNaN(Y)?Y=ab:xe="more ";Y>ya.length&&(a.g("note: only "+ya.length+" available"),Y=ya.length);U-=Y;0>U&&(null==ya[ya.length-1].D?(Y=U+Y,U=0):U+=ya.length);var Wc=[];"call"==
|
Vc.Da[ab].o;if(void 0!==se){var te=Vc.Da[ab].l;te&&(ab=te);a.g(Z(se)+" "+ab)}}}else{if("d"==P){for(M in Td)if(f[1]==M){var ue=a.Fa[M];ue?(f.shift(),f.shift(),ue(f)):a.g("no dump registered for "+A);break a}A||(P=a.fc||"db")}else a.fc=P;if("dh"==P){var ve=A,we=X,xe="",ye=0,U=a.ra,ya=a.W;if(ya.length){var Y=+ve||a.Nb,bb=+we||10;isNaN(Y)?Y=bb:xe="more ";Y>ya.length&&(a.g("note: only "+ya.length+" available"),Y=ya.length);U-=Y;0>U&&(null==ya[ya.length-1].D?(Y=U+Y,U=0):U+=ya.length);var Wc=[];"call"==
|
||||||
we&&(ab=1E5,Wc=["CALL"]);for(void 0!==ve&&a.g(Y+" instructions earlier:");0<ab&&U!=a.qa;){var ze=ya[U++];if(null==ze.D)break;var Ab=T(ze.D),Af=Y--,Ae=oe(a,Ab,"history",Af);(!Wc.length||0<=Ae.indexOf(Wc[0]))&&a.g(Ae);Ab.wb&&(U+=Ab.wb,ab-=Ab.wb,Y-=Ab.wb);U>=ya.length&&(U=0);a.Nb=Y;ye++;ab--}}ye||(a.g("no "+xe+"history available"),a.Nb=void 0)}else{var dc=W(a,A);if(dc){var ec=0;X&&("l"==X.charAt(0)&&(X=X.substr(1)||zf),ec=Se(a,X)>>>0,65536<ec&&(ec=65536));for(var La="",fc="dd"==P?4:"dw"==P?2:1,gc=fc*
|
we&&(bb=1E5,Wc=["CALL"]);for(void 0!==ve&&a.g(Y+" instructions earlier:");0<bb&&U!=a.ra;){var ze=ya[U++];if(null==ze.D)break;var Bb=T(ze.D),Af=Y--,Ae=oe(a,Bb,"history",Af);(!Wc.length||0<=Ae.indexOf(Wc[0]))&&a.g(Ae);Bb.wb&&(U+=Bb.wb,bb-=Bb.wb,Y-=Bb.wb);U>=ya.length&&(U=0);a.Nb=Y;ye++;bb--}}ye||(a.g("no "+xe+"history available"),a.Nb=void 0)}else{var dc=W(a,A);if(dc){var ec=0;X&&("l"==X.charAt(0)&&(X=X.substr(1)||zf),ec=Se(a,X)>>>0,65536<ec&&(ec=65536));for(var La="",fc="dd"==P?4:"dw"==P?2:1,gc=fc*
|
||||||
ec||128,Bf=gc+15>>4||1;Bf--&&0<gc;){var hc=0,Xc=0,Bb,Cb="",Yc="",A=Z(dc.D);for(Bb=16;0<Bb&&0<gc;Bb--){var ic=a.X(dc,1),hc=hc|ic<<(Xc++<<3);Xc==fc&&(Cb+=q(hc,2*fc),Cb+=1==fc?9==Bb?"-":" ":" ",hc=Xc=0);Yc+=32<=ic&&128>ic?String.fromCharCode(ic):".";gc--}La&&(La+="\n");La+=A+" "+Cb+(0==Bb?" "+Yc:"")}La&&a.g(La);a.Gb=dc}}}}break;case "e":if("else"==f[0])break;var jc=1,Be=255,Ce=a.X,De=a.ga;"ew"==f[0]&&(jc=2,Be=65535,Ce=a.Ha,De=a.vb);var Ee=jc<<1,Fe=f[1];if(null==Fe)a.g("edit memory commands:"),a.g("\teb [a] [...] edit bytes at address a"),
|
ec||128,Bf=gc+15>>4||1;Bf--&&0<gc;){var hc=0,Xc=0,Cb,Db="",Yc="",A=Z(dc.D);for(Cb=16;0<Cb&&0<gc;Cb--){var ic=a.X(dc,1),hc=hc|ic<<(Xc++<<3);Xc==fc&&(Db+=q(hc,2*fc),Db+=1==fc?9==Cb?"-":" ":" ",hc=Xc=0);Yc+=32<=ic&&128>ic?String.fromCharCode(ic):".";gc--}La&&(La+="\n");La+=A+" "+Db+(0==Cb?" "+Yc:"")}La&&a.g(La);a.Gb=dc}}}}break;case "e":if("else"==f[0])break;var jc=1,Be=255,Ce=a.X,De=a.ga;"ew"==f[0]&&(jc=2,Be=65535,Ce=a.Ha,De=a.vb);var Ee=jc<<1,Fe=f[1];if(null==Fe)a.g("edit memory commands:"),a.g("\teb [a] [...] edit bytes at address a"),
|
||||||
a.g("\tew [a] [...] edit words at address a");else{var kc=W(a,Fe);if(kc)for(var lc=2;lc<f.length;lc++){var Db=Zd(a,f[lc]);if(void 0===Db){a.g("unrecognized value: "+f[lc]);break}Db&~Be&&a.g("warning: "+q(Db)+" exceeds "+jc+"-byte value");var Cf=Ce.call(a,kc);a.g("changing "+Z(kc.D)+" from 0x"+q(Cf,Ee)+" to 0x"+q(Db,Ee));De.call(a,kc,Db,jc)}}break;case "f":Xe(a,f[1]);break;case "g":a:{var Ge=f[1],Df=b;if(void 0!==Ge){var Zc=W(a,Ge,!0);if(!Zc)break a;$d(a,Zc,Df);a.Ja(a.u,Zc,!0)}a.Oa(!0)||c||a.g("cpu busy or unavailable, run command ignored")}break;
|
a.g("\tew [a] [...] edit words at address a");else{var kc=W(a,Fe);if(kc)for(var lc=2;lc<f.length;lc++){var Eb=Zd(a,f[lc]);if(void 0===Eb){a.g("unrecognized value: "+f[lc]);break}Eb&~Be&&a.g("warning: "+q(Eb)+" exceeds "+jc+"-byte value");var Cf=Ce.call(a,kc);a.g("changing "+Z(kc.D)+" from 0x"+q(Cf,Ee)+" to 0x"+q(Eb,Ee));De.call(a,kc,Eb,jc)}}break;case "f":Xe(a,f[1]);break;case "g":a:{var Ge=f[1],Df=b;if(void 0!==Ge){var Zc=W(a,Ge,!0);if(!Zc)break a;$d(a,Zc,Df);a.Ja(a.u,Zc,!0)}a.Oa(!0)||c||a.g("cpu busy or unavailable, run command ignored")}break;
|
||||||
case "h":a:{var $c;if(a.A.ma)$c="halting",a.da();else{if(hb(a,!0))break a;$c="already halted"}c||a.g($c)}break;case "i":if("if"==f[0]){var ad;var Eb=b.substr(2),Eb=ia(Eb);Zd(a,Eb)?(c||a.g("true: "+Eb),ad=!0):(c||a.g("false: "+Eb),ad=!1);ad||(d=!1);break}var bd=f[1];if(bd&&"?"!=bd){var cd=Se(a,bd);if(void 0!==cd){var Ef=yb(a.B,cd);a.g(r(cd)+": "+("0x"+q(Ef,2)))}}else a.g("input commands:"),a.g("\ti [p]\tread port [p]"),a.g("warning: port accesses can affect hardware state");break;case "k":var Ff=f[0];
|
case "h":a:{var $c;if(a.A.ma)$c="halting",a.da();else{if(hb(a,!0))break a;$c="already halted"}c||a.g($c)}break;case "i":if("if"==f[0]){var ad;var Fb=b.substr(2),Fb=ia(Fb);Zd(a,Fb)?(c||a.g("true: "+Fb),ad=!0):(c||a.g("false: "+Fb),ad=!1);ad||(d=!1);break}var bd=f[1];if(bd&&"?"!=bd){var cd=Se(a,bd);if(void 0!==cd){var Ef=yb(a.B,cd);a.g(r(cd)+": "+("0x"+q(Ef,2)))}}else a.g("input commands:"),a.g("\ti [p]\tread port [p]"),a.g("warning: port accesses can affect hardware state");break;case "k":var Ff=f[0];
|
||||||
if("?"==f[1])a.g("stack trace commands:"),a.g("\tk\tshow frame addresses"),a.g("\tks\tshow symbol information");else{var dd=0,He=T(),Fb=T(a.b.ca);for(a.g("stack trace for "+Z(Fb.D));10>dd;){for(var Ma=null,Gf=256;65536>Fb.D>>>0;){He.D=a.Ha(Fb,2);if(null==Fb.D||!Gf--)break;for(var Hf=a,mc=He,Ie=null,Gb=mc.D,Je=Gb,ed=1;6>=ed&&Gb;ed++){if(2<ed){mc.D=Gb;var nc=oe(Hf,mc);if(0<=nc.indexOf("CALL")){var Ke=nc.indexOf(" ");if(Gb+(nc.indexOf(" ",Ke+1)-Ke-1)/2==Je){Ie=nc;break}}}Gb--}mc.D=Je;if(Ma=Ie)break}if(!Ma||
|
if("?"==f[1])a.g("stack trace commands:"),a.g("\tk\tshow frame addresses"),a.g("\tks\tshow symbol information");else{var dd=0,He=T(),Gb=T(a.b.ca);for(a.g("stack trace for "+Z(Gb.D));10>dd;){for(var Ma=null,Gf=256;65536>Gb.D>>>0;){He.D=a.Ha(Gb,2);if(null==Gb.D||!Gf--)break;for(var Hf=a,mc=He,Ie=null,Hb=mc.D,Je=Hb,ed=1;6>=ed&&Hb;ed++){if(2<ed){mc.D=Hb;var nc=oe(Hf,mc);if(0<=nc.indexOf("CALL")){var Ke=nc.indexOf(" ");if(Hb+(nc.indexOf(" ",Ke+1)-Ke-1)/2==Je){Ie=nc;break}}}Hb--}mc.D=Je;if(Ma=Ie)break}if(!Ma||
|
||||||
null==Ma)break;var Le=null;if("ks"==Ff){var Me=Ma.match(/[0-9A-F]+$/);Me&&(Le=Ze(a,Me[0]))}Ma=ha(Ma,50)+" ;"+(Le||"stack="+Z(Fb.D));a.g(Ma);dd++}dd||a.g("no return addresses found")}break;case "l":if("ln"==f[0]){Ze(a,f[1],!0);break}break;case "m":a:{var za,Aa=null,G=f[1];"?"==G&&(G=void 0);if(void 0!==G){var Na=0;if("all"==G)Na=1610481663,G=null;else if("on"==G)Aa=!0,G=null;else if("off"==G)Aa=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(za in Td)if(G==za){Na=Td[za];Aa=!!(a.ja&
|
null==Ma)break;var Le=null;if("ks"==Ff){var Me=Ma.match(/[0-9A-F]+$/);Me&&(Le=Ze(a,Me[0]))}Ma=ha(Ma,50)+" ;"+(Le||"stack="+Z(Gb.D));a.g(Ma);dd++}dd||a.g("no return addresses found")}break;case "l":if("ln"==f[0]){Ze(a,f[1],!0);break}break;case "m":a:{var za,Aa=null,G=f[1];"?"==G&&(G=void 0);if(void 0!==G){var Na=0;if("all"==G)Na=1610481663,G=null;else if("on"==G)Aa=!0,G=null;else if("off"==G)Aa=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(za in Td)if(G==za){Na=Td[za];Aa=!!(a.ja&
|
||||||
Na);break}if(!Na){a.g("unknown message category: "+G);break a}}Na&&("on"==f[2]?(a.ja|=Na,Aa=!0):"off"==f[2]&&(a.ja&=~Na,Aa=!1))}var If=0,Ha="";for(za in Td)if(!G||G==za){var Jf=!!(a.ja&Td[za]);if(null===Aa||Aa==Jf)Ha&&(Ha+=","),++If%10||(Ha+="\n\t"),"key"==za&&(za="keys"),Ha+=za}void 0===G&&a.g("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.g((null!==Aa?Aa?"messages on: ":"messages off: ":"message categories:\n\t")+(Ha||"none"));Md(a)}break;case "o":var fd=f[1],Kf=f[2];if(fd&&
|
Na);break}if(!Na){a.g("unknown message category: "+G);break a}}Na&&("on"==f[2]?(a.ja|=Na,Aa=!0):"off"==f[2]&&(a.ja&=~Na,Aa=!1))}var If=0,Ha="";for(za in Td)if(!G||G==za){var Jf=!!(a.ja&Td[za]);if(null===Aa||Aa==Jf)Ha&&(Ha+=","),++If%10||(Ha+="\n\t"),"key"==za&&(za="keys"),Ha+=za}void 0===G&&a.g("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.g((null!==Aa?Aa?"messages on: ":"messages off: ":"message categories:\n\t")+(Ha||"none"));Md(a)}break;case "o":var fd=f[1],Kf=f[2];if(fd&&
|
||||||
"?"!=fd){var gd=Se(a,fd,"port #"),hd=Se(a,Kf);void 0!==gd&&void 0!==hd&&(Jb(a.B,gd,hd),a.g(r(gd)+": "+("0x"+q(hd,2))))}else a.g("output commands:"),a.g("\to [p] [b]\twrite byte [b] to port [p]"),a.g("warning: port accesses can affect hardware state");break;case "p":if("print"==f[0]){af(a,b.substr(5));break}var Ne="pr"==f[0]?1:0,Lf=1+Ne;if(a.ba)a.g("step in progress");else{var id=T(a.b.M);switch(a.X(id)){case 205:a.ba=Lf,Vd(id,3)}a.ba?(a.Ja(a.u,id,!0),a.Oa()||(a.w&&a.w.mb(),a.ba=0)):bf(a,Ne?"tr":"t")}break;
|
"?"!=fd){var gd=Se(a,fd,"port #"),hd=Se(a,Kf);void 0!==gd&&void 0!==hd&&(Jb(a.B,gd,hd),a.g(r(gd)+": "+("0x"+q(hd,2))))}else a.g("output commands:"),a.g("\to [p] [b]\twrite byte [b] to port [p]"),a.g("warning: port accesses can affect hardware state");break;case "p":if("print"==f[0]){af(a,b.substr(5));break}var Ne="pr"==f[0]?1:0,Lf=1+Ne;if(a.ba)a.g("step in progress");else{var id=T(a.b.M);switch(a.X(id)){case 205:a.ba=Lf,Vd(id,3)}a.ba?(a.Ja(a.u,id,!0),a.Oa()||(a.w&&a.w.mb(),a.ba=0)):bf(a,Ne?"tr":"t")}break;
|
||||||
case "r":if("reset"==b){a.w&&a.w.reset();break}he(a,f);break;case "s":$e(a,f);break;case "t":bf(a,f[0],f[1]);break;case "u":ie(a,f[1],f[2],8);break;case "v":if("var"==f[0]){Ye(a,b.substr(3))||(d=!1);break}a.g("PC8080 version 1.22.0 ("+a.b.Ua+",RELEASE"+(kb?",TYPEDARRAYS":",LONGARRAYS")+")");a.g(qa());break;case "?":if(f[1]){af(a,b.substr(1));break}var Hb="commands:",jd;for(jd in Od)Hb+="\n"+ha(jd,7)+Od[jd];pd(a)||(Hb+="\nnote: frequency/history disabled if no exec breakpoints");a.g(Hb);break;default:a.g("unknown command: "+
|
case "r":if("reset"==b){a.w&&a.w.reset();break}he(a,f);break;case "s":$e(a,f);break;case "t":bf(a,f[0],f[1]);break;case "u":ie(a,f[1],f[2],8);break;case "v":if("var"==f[0]){Ye(a,b.substr(3))||(d=!1);break}a.g("PC8080 version 1.22.0 ("+a.b.Ua+",RELEASE"+(kb?",TYPEDARRAYS":",LONGARRAYS")+")");a.g(qa());break;case "?":if(f[1]){af(a,b.substr(1));break}var Ib="commands:",jd;for(jd in Od)Ib+="\n"+ha(jd,7)+Od[jd];pd(a)||(Ib+="\nnote: frequency/history disabled if no exec breakpoints");a.g(Ib);break;default:a.g("unknown command: "+
|
||||||
b),d=!1}}}catch(Oe){a.g("debugger error: "+(Oe.stack||Oe.message)),d=!1}return d}function qc(a,b,c){b=ae(a,b,c);for(var d in b)if(!ne(a,b[d]))return!1;return!0}Ia(function(){for(var a=C(document,"pc8080","debugger"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Jd(d);bb(d,c)}});function Gc(a,b,c){this.id=a.id;this.key=df(a,b,c);this.F=a.F;ef(this,a.Sb)}function df(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
|
b),d=!1}}}catch(Oe){a.g("debugger error: "+(Oe.stack||Oe.message)),d=!1}return d}function qc(a,b,c){b=ae(a,b,c);for(var d in b)if(!ne(a,b[d]))return!1;return!0}Ia(function(){for(var a=C(document,"pc8080","debugger"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Jd(d);$a(d,c)}});function Gc(a,b,c){this.id=a.id;this.key=df(a,b,c);this.F=a.F;ef(this,a.Sb)}function df(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
|
||||||
Gc.prototype={constructor:Gc,value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){ef(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,1);c=0}}};
|
Gc.prototype={constructor:Gc,value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){ef(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,1);c=0}}};
|
||||||
function ef(a,b){a[a.id]={};b&&H(a,"parms",b);a.b=!1}function ff(a){var b=!0;if(ta()){var c=JSON.stringify(a[a.id]);va(a.key,c)||(t("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function gf(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){t(c.message||c),b=!1}return b}function hf(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:ta()&&(b=ua(a.key))?(a[a.id]=b,a.b=!0):!1}function jf(a,b){return a[a.id][b]||null}function H(a,b,c){try{a[a.id][b]=c}catch(d){}}
|
function ef(a,b){a[a.id]={};b&&H(a,"parms",b);a.b=!1}function ff(a){var b=!0;if(ta()){var c=JSON.stringify(a[a.id]);va(a.key,c)||(t("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function gf(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){t(c.message||c),b=!1}return b}function hf(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:ta()&&(b=ua(a.key))?(a[a.id]=b,a.b=!0):!1}function jf(a,b){return a[a.id][b]||null}function H(a,b,c){try{a[a.id][b]=c}catch(d){}}
|
||||||
function kf(a,b,c){v.call(this,"Computer",a,kf,67108864);this.A.ka=!1;lf(this,b);this.ba=cc(this,"autoPower",a);this.C=0;this.oa=a.busWidth||a.buswidth;this.w=mf;this.W=null;this.J=this.ia=!1;this.qa=cc(this,"url")||"";(Math.random()+.1).toString(36);this.u=nf(this);if(this.b=Za("CPU",this.id)){this.F=Za("Debugger",this.id);this.aa=[];for(b=null;b=nb(this,"Video",b);)this.aa.push(b);this.B=new pb({id:this.Hb+".bus",busWidth:this.oa},this.b,this.F);var d,e=Ya(this.id);if((this.G=Za("Panel",this.id))&&
|
function kf(a,b,c){v.call(this,"Computer",a,kf,67108864);this.A.ka=!1;lf(this,b);this.ba=cc(this,"autoPower",a);this.C=0;this.pa=a.busWidth||a.buswidth;this.w=mf;this.W=null;this.J=this.ia=!1;this.ra=cc(this,"url")||"";(Math.random()+.1).toString(36);this.u=nf(this);if(this.b=Za("CPU",this.id)){this.F=Za("Debugger",this.id);this.aa=[];for(b=null;b=nb(this,"Video",b);)this.aa.push(b);this.B=new pb({id:this.Hb+".bus",busWidth:this.pa},this.b,this.F);var d,e=Ya(this.id);if((this.G=Za("Panel",this.id))&&
|
||||||
this.G.ta)for(b=0;b<e.length;b++)d=e[b],d.na=this.G.na,d.g=this.G.g,d.ta=this.G.ta;this.g(of+" v"+pf+"\n"+qf+"\n"+rf);for(b=0;b<e.length;b++)d=e[b],d.Ia&&d.Ia(this,this.B,this.b,this.F);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.L=d:this.w=parseInt(d,10));var f;if(a=cc(this,"state")||(f=!0,a.state))b=this.fa=a,f||(this.J=!0,this.w=mf),this.w&&(this.Y=new Gc(this,pf),hf(this.Y)?b=null:delete this.Y);!b&&this.w&&(b=sf(this))&&(this.J=!0);if(b){var h=this;oa(b,null,!0,function(a,b,c){c?(h.L=null,
|
this.G.ta)for(b=0;b<e.length;b++)d=e[b],d.na=this.G.na,d.g=this.G.g,d.ta=this.G.ta;this.g(of+" v"+pf+"\n"+qf+"\n"+rf);for(b=0;b<e.length;b++)d=e[b],d.Ia&&d.Ia(this,this.B,this.b,this.F);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.L=d:this.w=parseInt(d,10));var f;if(a=cc(this,"state")||(f=!0,a.state))b=this.fa=a,f||(this.J=!0,this.w=mf),this.w&&(this.Y=new Gc(this,pf),hf(this.Y)?b=null:delete this.Y);!b&&this.w&&(b=sf(this))&&(this.J=!0);if(b){var h=this;oa(b,null,!0,function(a,b,c){c?(h.L=null,
|
||||||
h.J=!1,h.na("Unable to load machine state from server (error "+c+(b?": "+ia(b):"")+")")):(h.W=b,h.ia=!0);D(h)})}else D(this);this.T.power||(this.ba=!0);!c&&this.ba&&tf(this,this.kb)}else t("Unable to find CPU component")}Va(kf);var of="PC8080",pf="1.22.0",qf="Copyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>",rf="License: GPL version 3 or later <http://gnu.org/licenses/gpl.html>",mf=0;
|
h.J=!1,h.na("Unable to load machine state from server (error "+c+(b?": "+ia(b):"")+")")):(h.W=b,h.ia=!0);D(h)})}else D(this);this.T.power||(this.ba=!0);!c&&this.ba&&tf(this,this.kb)}else t("Unable to find CPU component")}Va(kf);var of="PC8080",pf="1.22.0",qf="Copyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>",rf="License: GPL version 3 or later <http://gnu.org/licenses/gpl.html>",mf=0;
|
||||||
function lf(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){t(d.message+" ("+c+")")}}a.K=b}function cc(a,b,c){var d=b.toLowerCase(),d=Qa[b]||Qa[d];void 0===d&&a.K&&(d=a.K[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function tf(a,b,c){for(var d=Ya(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!ib(f)){ib(f,function(){tf(a,b,c)});return}}b.call(a,c)}
|
function lf(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){t(d.message+" ("+c+")")}}a.K=b}function cc(a,b,c){var d=b.toLowerCase(),d=Qa[b]||Qa[d];void 0===d&&a.K&&(d=a.K[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function tf(a,b,c){for(var d=Ya(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!ib(f)){ib(f,function(){tf(a,b,c)});return}}b.call(a,c)}
|
||||||
|
|
@ -182,19 +182,19 @@ m.kb=function(a){void 0===a&&(a=this.w||(this.W?1:mf));if(!this.C){this.C++;var
|
||||||
h?(this.na("Error: "+h),"unable to verify user"==h&&(va("user",""),this.u=null)):this.g(f+": "+h),ef(d),hf(d)?(c=gf(d),e=!0):c=!1))}e&&uf(this,c?d:null)}else 2==a&&d.clear()}else uf(this);delete this.W;delete this.Y}e=Ya(this.id);for(f=0;f<e.length;f++)h=e[f],h!==this&&h!=this.b&&(c=wf(this,h,d,b,c));b=[d,a,c];-1!=a?tf(this,this.Ib,b):this.Ib(b)}};
|
h?(this.na("Error: "+h),"unable to verify user"==h&&(va("user",""),this.u=null)):this.g(f+": "+h),ef(d),hf(d)?(c=gf(d),e=!0):c=!1))}e&&uf(this,c?d:null)}else 2==a&&d.clear()}else uf(this);delete this.W;delete this.Y}e=Ya(this.id);for(f=0;f<e.length;f++)h=e[f],h!==this&&h!=this.b&&(c=wf(this,h,d,b,c));b=[d,a,c];-1!=a?tf(this,this.Ib,b):this.Ib(b)}};
|
||||||
function wf(a,b,c,d,e){if(!b.A.ka){b.A.ka=!0;if(b.Ba){var f=null;e&&((f=jf(c,b.id))||(f=jf(c,b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Ba(f,d)&&f&&(t("Unable to restore state for "+b.type),a.fa&&!a.ia?(c.clear(),a.w=mf,window&&window.location.reload()):a.ha=!0,b.Ba(null),e=!1)}if(!d&&b.Fb)for(a=b.Fb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
function wf(a,b,c,d,e){if(!b.A.ka){b.A.ka=!0;if(b.Ba){var f=null;e&&((f=jf(c,b.id))||(f=jf(c,b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Ba(f,d)&&f&&(t("Unable to restore state for "+b.type),a.fa&&!a.ia?(c.clear(),a.w=mf,window&&window.location.reload()):a.ha=!0,b.Ba(null),e=!1)}if(!d&&b.Fb)for(a=b.Fb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||||
m.Ib=function(a){var b=a[0],c=0>a[1];a=a[2];this.sa=!0;this.A.ka=!0;var d=this.T.power;d&&(d.textContent="Shutdown");this.b&&(wf(this,this.b,b,c,a),sc(this.b));this.ha&&(vf(this,b),b.clear());!c&&this.H&&(this.H.clear(),delete this.H);this.C=0};
|
m.Ib=function(a){var b=a[0],c=0>a[1];a=a[2];this.sa=!0;this.A.ka=!0;var d=this.T.power;d&&(d.textContent="Shutdown");this.b&&(wf(this,this.b,b,c,a),sc(this.b));this.ha&&(vf(this,b),b.clear());!c&&this.H&&(this.H.clear(),delete this.H);this.C=0};
|
||||||
function vf(a,b){if(ra("There may be a problem with your "+of+" machine.\n\nTo help us diagnose it, click OK to send this "+of+" machine state to http://www.pcjs.org.")){var c=a.qa,d=a.u||"",e=b.toString(),f=pf,h={};h.app=of;h.ver=f;h.url=c;h.user=d;h.type="bug";h.data=e;oa("http://www.pcjs.org/api/v1/report",h,!0)}}
|
function vf(a,b){if(ra("There may be a problem with your "+of+" machine.\n\nTo help us diagnose it, click OK to send this "+of+" machine state to http://www.pcjs.org.")){var c=a.ra,d=a.u||"",e=b.toString(),f=pf,h={};h.app=of;h.ver=f;h.url=c;h.user=d;h.type="bug";h.data=e;oa("http://www.pcjs.org/api/v1/report",h,!0)}}
|
||||||
function cf(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new Gc(a,pf),h=new Gc(a,pf,"validate"),g=ma();H(h,"timestamp",g);H(f,"timestamp",g);H(f,"version","1.22.0");H(f,"url",window?window.location.href:null);H(f,"browser",qa());a.b&&a.b.Aa&&(c&&a.b.da(),d=a.b.Aa(b,c),"object"===typeof d&&H(f,a.b.id,d),c&&(a.b.A.ka=!1,!1===d&&(e=null)));for(var g=Ya(a.id),l=0;l<g.length;l++){var k=g[l];k.A.ka&&(k.Aa&&(d=k.Aa(b,c),"object"===typeof d&&H(f,k.id,d)),c&&(k.A.ka=!1,!1===d&&(e=null)))}e&&(c?(g=
|
function cf(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new Gc(a,pf),h=new Gc(a,pf,"validate"),g=ma();H(h,"timestamp",g);H(f,"timestamp",g);H(f,"version","1.22.0");H(f,"url",window?window.location.href:null);H(f,"browser",qa());a.b&&a.b.Aa&&(c&&a.b.da(),d=a.b.Aa(b,c),"object"===typeof d&&H(f,a.b.id,d),c&&(a.b.A.ka=!1,!1===d&&(e=null)));for(var g=Ya(a.id),l=0;l<g.length;l++){var k=g[l];k.A.ka&&(k.Aa&&(d=k.Aa(b,c),"object"===typeof d&&H(f,k.id,d)),c&&(k.A.ka=!1,!1===d&&(e=null)))}e&&(c?(g=
|
||||||
d=!1,b?(a.u&&xf(a,a.u,f.toString()),ff(h)&&ff(f)||(e=null,d=g=!0)):a.w&&(d=!0,g=3==a.w),d&&f.clear(g)):e=f.toString());c&&(a.A.ka=!1,b=a.T.power)&&(b.textContent="Power");a.C=0;return e}m.reset=function(){this.B&&this.B.reset&&(eb(this,"Resetting "+this.B.type),this.B.reset());for(var a=Ya(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.B&&c.reset&&(eb(this,"Resetting "+c.type),c.reset())}};
|
d=!1,b?(a.u&&xf(a,a.u,f.toString()),ff(h)&&ff(f)||(e=null,d=g=!0)):a.w&&(d=!0,g=3==a.w),d&&f.clear(g)):e=f.toString());c&&(a.A.ka=!1,b=a.T.power)&&(b.textContent="Power");a.C=0;return e}m.reset=function(){this.B&&this.B.reset&&(eb(this,"Resetting "+this.B.type),this.B.reset());for(var a=Ya(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.B&&c.reset&&(eb(this,"Resetting "+c.type),c.reset())}};
|
||||||
m.start=function(a,b){for(var c=Ya(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};m.stop=function(a,b){for(var c=Ya(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
|
m.start=function(a,b){for(var c=Ya(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};m.stop=function(a,b){for(var c=Ya(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
|
||||||
m.pa=function(a,b,c){var d=this;switch(b){case "power":return this.T[b]=c,c.onclick=function(){d.C||(d.A.ka?cf(d,!1,!0):tf(d,d.kb))},!0;case "reset":return this.T[b]=c,c.onclick=function(){if(d.A.ka&&!d.C)if(d.w&&!d.L){var a=ra("Click OK to save changes to this "+of+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");cf(d,a,!0);!a&&d.fa?window&&window.location.reload():d.kb(mf)}else d.reset(),d.b&&sc(d.b)},!0;case "save":if(ea(pa(),"pcjs.org")){c.parentNode.removeChild(c);
|
m.qa=function(a,b,c){var d=this;switch(b){case "power":return this.T[b]=c,c.onclick=function(){d.C||(d.A.ka?cf(d,!1,!0):tf(d,d.kb))},!0;case "reset":return this.T[b]=c,c.onclick=function(){if(d.A.ka&&!d.C)if(d.w&&!d.L){var a=ra("Click OK to save changes to this "+of+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");cf(d,a,!0);!a&&d.fa?window&&window.location.reload():d.kb(mf)}else d.reset(),d.b&&sc(d.b)},!0;case "save":if(ea(pa(),"pcjs.org")){c.parentNode.removeChild(c);
|
||||||
break}this.T[b]=c;c.onclick=function(){var a=nf(d,!0);if(a){var b=!!(d.w&&!d.L||d.fa),c=cf(d,b);b?xf(d,a,c):d.na("Resume disabled, machine state not saved")}};return!0}return!1};
|
break}this.T[b]=c;c.onclick=function(){var a=nf(d,!0);if(a){var b=!!(d.w&&!d.L||d.fa),c=cf(d,b);b?xf(d,a,c):d.na("Resume disabled, machine state not saved")}};return!0}return!1};
|
||||||
function nf(a,b){var c=a.u;c||(c=ua("user"),void 0!==c?!c&&b&&(c=null,window&&(c=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c&&((c=yf(a,c))||a.na("The user ID is invalid."))):b&&a.na("Browser local storage is not available"));return c}
|
function nf(a,b){var c=a.u;c||(c=ua("user"),void 0!==c?!c&&b&&(c=null,window&&(c=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c&&((c=yf(a,c))||a.na("The user ID is invalid."))):b&&a.na("Browser local storage is not available"));return c}
|
||||||
function yf(a,b){a.u=null;var c=oa(pa()+"/api/v1/user?req=verify&user="+b),d=c[1];if(!c[0]&&d)try{c=eval("("+d+")"),c.code&&"ok"==c.code&&(va("user",c.data),a.u=c.data)}catch(e){t(e.message+" ("+d+")")}return a.u}function sf(a){var b=null;a.u&&(b=pa()+"/api/v1/user?req=load&user="+a.u+"&state="+df(a,pf));return b}
|
function yf(a,b){a.u=null;var c=oa(pa()+"/api/v1/user?req=verify&user="+b),d=c[1];if(!c[0]&&d)try{c=eval("("+d+")"),c.code&&"ok"==c.code&&(va("user",c.data),a.u=c.data)}catch(e){t(e.message+" ("+d+")")}return a.u}function sf(a){var b=null;a.u&&(b=pa()+"/api/v1/user?req=load&user="+a.u+"&state="+df(a,pf));return b}
|
||||||
function xf(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=df(a,pf);d.data=c;b=oa(pa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.na("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.na(c),va("user",""),a.u=null)}}
|
function xf(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=df(a,pf);d.data=c;b=oa(pa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.na("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.na(c),va("user",""),a.u=null)}}
|
||||||
function nb(a,b,c){a=Ya(a.id);for(var d=0;d<a.length;d++){var e=a[d];if(c)c==e&&(c=null);else if(e.type==b)return e}return null}m.mb=function(){};m.va=function(a){this.b&&this.b.va(a);this.G&&this.G.va(a)};
|
function nb(a,b,c){a=Ya(a.id);for(var d=0;d<a.length;d++){var e=a[d];if(c)c==e&&(c=null);else if(e.type==b)return e}return null}m.mb=function(){};m.va=function(a){this.b&&this.b.va(a);this.G&&this.G.va(a)};
|
||||||
function yc(a,b){for(var c=0;c<a.aa.length;c++)a:{var d=a.aa[c];if(0<=b){if(b&1){d=d.b;d.u=d.u&-8|10;break a}var e=d.b;e.u=e.u&-8|9;if(e=d.sa){for(var e=d.B,f=d.oa,h=!0,g=d.qa>>>e.ea;0<f&&g<e.U.length;)e.U[g].ya&&(e.U[g].ya=h=!1,e.U[g].Lb=!0),f-=e.ua,g++;e=h}if(e)break a}var g=d.qa,l=g+d.oa,k=0,n=0,p=0,e=d.J,x=0,f=d.Y,B=h=0,u=d.ia,la=(1<<u)-1;d.qb&&(u=-u,B=16+u);for(;g<l;){var w=vb(d.B,g);if(d.sa&&w===d.fa[k])n+=d.Ga;else{d.fa[k]=w;var da=B;da&&(w=w>>8|(w&255)<<8);n<e&&(e=n);for(var K=d.Ga;K--;){var M=
|
function yc(a,b){for(var c=0;c<a.aa.length;c++)a:{var d=a.aa[c];if(0<=b){if(b&1){d=d.b;d.u=d.u&-8|10;break a}var e=d.b;e.u=e.u&-8|9;if(e=d.sa){for(var e=d.B,f=d.pa,h=!0,g=d.ra>>>e.ea;0<f&&g<e.U.length;)e.U[g].ya&&(e.U[g].ya=h=!1,e.U[g].Lb=!0),f-=e.ua,g++;e=h}if(e)break a}var g=d.ra,l=g+d.pa,k=0,n=0,p=0,e=d.J,x=0,f=d.Y,B=h=0,u=d.ia,la=(1<<u)-1;d.qb&&(u=-u,B=16+u);for(;g<l;){var w=vb(d.B,g);if(d.sa&&w===d.fa[k])n+=d.Ga;else{d.fa[k]=w;var da=B;da&&(w=w>>8|(w&255)<<8);n<e&&(e=n);for(var K=d.Ga;K--;){var M=
|
||||||
w>>da&la,P=d.xa,A=n++,X=M,M=void 0,M=d.C?(P.height-A-1)*P.width+p:A+p*P.width;X&&(208<=A&&236>A?X=d.ba+0:28<=A&&72>A&&(X=d.ba+1));A=d.W[X];M*=A.length;P.data[M]=A[0];P.data[M+1]=A[1];P.data[M+2]=A[2];P.data[M+3]=A[3];da+=u}n>x&&(x=n);p<f&&(f=p);p>=h&&(h=p+1)}g+=2;k++;if(n>=d.J&&(n=0,p++,p>d.Y))break}d.sa=!0;e<d.J&&(g=x-e,h-=f,d.C&&(l=e,k=g,e=f,g=h,f=d.J-(l+k),h=k),d.pb.putImageData(d.xa,0,0,e,f,g,h),d.H.drawImage(d.K,0,0,d.K.width,d.K.height,0,0,d.ha,d.aa))}}
|
w>>da&la,P=d.xa,A=n++,X=M,M=void 0,M=d.C?(P.height-A-1)*P.width+p:A+p*P.width;X&&(208<=A&&236>A?X=d.ba+0:28<=A&&72>A&&(X=d.ba+1));A=d.W[X];M*=A.length;P.data[M]=A[0];P.data[M+1]=A[1];P.data[M+2]=A[2];P.data[M+3]=A[3];da+=u}n>x&&(x=n);p<f&&(f=p);p>=h&&(h=p+1)}g+=2;k++;if(n>=d.J&&(n=0,p++,p>d.Y))break}d.sa=!0;e<d.J&&(g=x-e,h-=f,d.C&&(l=e,k=g,e=f,g=h,f=d.J-(l+k),h=k),d.pb.putImageData(d.xa,0,0,e,f,g,h),d.H.drawImage(d.K,0,0,d.K.width,d.K.height,0,0,d.ha,d.aa))}}
|
||||||
Ia(function(){for(var a=C(document,"pc8080-machine"),b=0;b<a.length;b++)for(var c=a[b],d=z(c),c=C(c,"pc8080","computer"),e=0;e<c.length;e++){var f=c[e],h=z(f),h=new kf(h,d,!0);bb(h,f);h.ba&&tf(h,h.kb)}});Da.show.push(function(){for(var a=C(document,"pc8080","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=Za("Computer",c.id))&&c.sa&&!c.A.ka&&c.kb(-1)}});
|
Ia(function(){for(var a=C(document,"pc8080-machine"),b=0;b<a.length;b++)for(var c=a[b],d=z(c),c=C(c,"pc8080","computer"),e=0;e<c.length;e++){var f=c[e],h=z(f),h=new kf(h,d,!0);$a(h,f);h.ba&&tf(h,h.kb)}});Da.show.push(function(){for(var a=C(document,"pc8080","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=Za("Computer",c.id))&&c.sa&&!c.A.ka&&c.kb(-1)}});
|
||||||
Da.exit.push(function(){for(var a=C(document,"pc8080","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=Za("Computer",c.id))&&c.A.ka&&cf(c,!(!c.w||c.L),!0)}});var Mf=0;function Nf(a,b,c,d,e,f){e("Loading "+a+"...");oa(a,null,!0,function(h,g,l){l?(g||(g="unable to load "+a+" ("+l+")"),f(g,null)):Of(g,a,b,c,d,e,f)})}
|
Da.exit.push(function(){for(var a=C(document,"pc8080","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=Za("Computer",c.id))&&c.A.ka&&cf(c,!(!c.w||c.L),!0)}});var Mf=0;function Nf(a,b,c,d,e,f){e("Loading "+a+"...");oa(a,null,!0,function(h,g,l){l?(g||(g="unable to load "+a+" ("+l+")"),f(g,null)):Of(g,a,b,c,d,e,f)})}
|
||||||
function Of(a,b,c,d,e,f,h){function g(a,f){if(f)h(f,null);else{if(c){Xa(c,b,a);var g=b;g&&0>g.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+g+'"}';"object"==typeof resources&&(g=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(g?' url="'+g+'"':""))}e||(a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pc8080$2"));
|
function Of(a,b,c,d,e,f,h){function g(a,f){if(f)h(f,null);else{if(c){Xa(c,b,a);var g=b;g&&0>g.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+g+'"}';"object"==typeof resources&&(g=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(g?' url="'+g+'"':""))}e||(a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pc8080$2"));
|
||||||
g=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(g=new window.ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(a)):g=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){g=null,a=p.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,g)}}a?e?Pf(a,f,g):g(a,null):h("no data"+(b?" for file: "+b:""),null)}
|
g=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(g=new window.ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(a)):g=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){g=null,a=p.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,g)}}a?e?Pf(a,f,g):g(a,null):h("no data"+(b?" for file: "+b:""),null)}
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ function Eb(a){a.b=0;a.g=0;a.v=0;a.i=0;a.w=0;a.j=0;a.l=0;a.A=0;D(a,a.aa);Gb(a,0)
|
||||||
m.save=function(){var a=new E(this);F(a,0,[this.b,this.g,this.v,this.i,this.w,this.j,this.l,this.A,this.m,Ib(this)]);F(a,1,[this.D,this.M,this.c.ma]);for(var b=this.o,c=0,d=[],e=0;e<b.l;e++){var f=b.b[e];if(f.S||f.Ta){d[c++]=e;var h=c++;a:if(f=f.save()){for(var g=0,l=0,k=[];g<f.length;){for(var t=f[g],q=g+1;q<f.length&&f[q]===t;)q++;k[l++]=q-g;k[l++]=t;g=q}if(k.length<f.length){f=k;break a}}d[h]=f}}F(a,2,d);return a.data()};
|
m.save=function(){var a=new E(this);F(a,0,[this.b,this.g,this.v,this.i,this.w,this.j,this.l,this.A,this.m,Ib(this)]);F(a,1,[this.D,this.M,this.c.ma]);for(var b=this.o,c=0,d=[],e=0;e<b.l;e++){var f=b.b[e];if(f.S||f.Ta){d[c++]=e;var h=c++;a:if(f=f.save()){for(var g=0,l=0,k=[];g<f.length;){for(var t=f[g],q=g+1;q<f.length&&f[q]===t;)q++;k[l++]=q-g;k[l++]=t;g=q}if(k.length<f.length){f=k;break a}}d[h]=f}}F(a,2,d);return a.data()};
|
||||||
m.restore=function(a){var b=a[0];this.b=b[0];this.g=b[1];this.v=b[2];this.i=b[3];this.w=b[4];this.j=b[5];this.l=b[6];this.A=b[7]&65535;D(this,b[8]);Gb(this,b[9]);b=a[1];this.D=b[0];this.M=b[1];xb(this,b[3]);a:{b=this.o;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.A){for(var f=0,h=Array(b.A),g=0;g<e.length-1;)for(var l=e[g++],k=e[g++];l--;)h[f++]=k;e=h}f=b.b[d];if(!f||!f.restore(e)){r("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};
|
m.restore=function(a){var b=a[0];this.b=b[0];this.g=b[1];this.v=b[2];this.i=b[3];this.w=b[4];this.j=b[5];this.l=b[6];this.A=b[7]&65535;D(this,b[8]);Gb(this,b[9]);b=a[1];this.D=b[0];this.M=b[1];xb(this,b[3]);a:{b=this.o;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.A){for(var f=0,h=Array(b.A),g=0;g<e.length-1;)for(var l=e[g++],k=e[g++];l--;)h[f++]=k;e=h}f=b.b[d];if(!f||!f.restore(e)){r("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};
|
||||||
m.P=function(a,b,c){var d=!1;switch(b){case "A":case "B":case "C":case "BC":case "D":case "E":case "DE":case "H":case "L":case "HL":case "SP":case "PC":case "PS":case "IF":case "SF":case "ZF":case "AF":case "PF":case "CF":this.B[b]=c;this.ba++;d=!0;break;default:d=this.parent.P.call(this,a,b,c)}return d};function Jb(a){return a.g<<8|a.v}function Kb(a,b){a.g=b>>8&255;a.v=b&255}function G(a){return a.i<<8|a.w}function Lb(a,b){a.i=b>>8&255;a.w=b&255}function H(a){return a.j<<8|a.l}
|
m.P=function(a,b,c){var d=!1;switch(b){case "A":case "B":case "C":case "BC":case "D":case "E":case "DE":case "H":case "L":case "HL":case "SP":case "PC":case "PS":case "IF":case "SF":case "ZF":case "AF":case "PF":case "CF":this.B[b]=c;this.ba++;d=!0;break;default:d=this.parent.P.call(this,a,b,c)}return d};function Jb(a){return a.g<<8|a.v}function Kb(a,b){a.g=b>>8&255;a.v=b&255}function G(a){return a.i<<8|a.w}function Lb(a,b){a.i=b>>8&255;a.w=b&255}function H(a){return a.j<<8|a.l}
|
||||||
function J(a,b){a.j=b>>8&255;a.l=b&255}function D(a,b){a.m=b&65535}function K(a){return a.f&256?1:0}function Mb(a){return Pa[a.s&255]?4:0}function Ib(a){return a.G&-214|(a.s&128?128:0)|(a.f&255?0:64)|((a.s^a.C)&16?16:0)|Mb(a)|K(a)}function Gb(a,b){a.f=a.s=a.C=0;b&1&&(a.f|=256);b&4||(a.s|=1);b&16&&(a.C|=16);b&64||(a.f|=255);b&128&&(a.s^=192);a.G=a.G&-513|b&512|2}function M(a,b){a.C=a.b^b;return a.s=(a.f=a.b+b)&255}function N(a,b){a.C=a.b^b;return a.s=(a.f=a.b+b+(a.f&256?1:0))&255}
|
function J(a,b){a.j=b>>8&255;a.l=b&255}function D(a,b){a.m=b&65535}function K(a){return a.f&256?1:0}function Mb(a){return Pa[a.s&255]?4:0}function Ib(a){return a.G&-214|(a.s&128?128:0)|(a.f&255?0:64)|((a.s^a.C)&16?16:0)|Mb(a)|K(a)}function Gb(a,b){a.f=a.s=a.C=0;b&1&&(a.f|=256);b&4||(a.s|=1);b&16&&(a.C|=16);b&64||(a.f|=255);b&128&&(a.s^=192);a.G=a.G&-726|b&512|2}function M(a,b){a.C=a.b^b;return a.s=(a.f=a.b+b)&255}function N(a,b){a.C=a.b^b;return a.s=(a.f=a.b+b+(a.f&256?1:0))&255}
|
||||||
function O(a,b){a.f=a.s=a.C=a.b&b;(a.b|b)&8&&(a.C^=16);return a.f}function Nb(a,b){a.C=b^255;b=a.s=b+255&255;a.f=a.f&-256|b;return b}function Ob(a,b){a.C=b;b=a.s=b+1&255;a.f=a.f&-256|b;return b}function P(a,b){return a.s=a.f=a.C=a.b|b}function Q(a,b){b^=255;a.C=a.b^b;return a.s=(a.f=a.b+b+1^256)&255}function R(a,b){b^=255;a.C=a.b^b;return a.s=(a.f=a.b+b+(a.f&256?0:1)^256)&255}function S(a,b){return a.s=a.f=a.C=a.b^b}m.F=function(a){return this.o.F(a)};m.N=function(a,b){this.o.N(a,b)};
|
function O(a,b){a.f=a.s=a.C=a.b&b;(a.b|b)&8&&(a.C^=16);return a.f}function Nb(a,b){a.C=b^255;b=a.s=b+255&255;a.f=a.f&-256|b;return b}function Ob(a,b){a.C=b;b=a.s=b+1&255;a.f=a.f&-256|b;return b}function P(a,b){return a.s=a.f=a.C=a.b|b}function Q(a,b){b^=255;a.C=a.b^b;return a.s=(a.f=a.b+b+1^256)&255}function R(a,b){b^=255;a.C=a.b^b;return a.s=(a.f=a.b+b+(a.f&256?0:1)^256)&255}function S(a,b){return a.s=a.f=a.C=a.b^b}m.F=function(a){return this.o.F(a)};m.N=function(a,b){this.o.N(a,b)};
|
||||||
function T(a){var b=a.F(a.m);D(a,a.m+1);return b}function U(a){var b=Za(a.o,a.m);D(a,a.m+2);return b}function V(a){var b=Za(a.o,a.A);a.A=a.A+2&65535;return b}function W(a,b){a.A=a.A-2&65535;ab(a.o,a.A,b)}function X(a,b,c,d){d=d||2;a.B[b]&&(void 0===c&&(a.h.ca=!0,a.I("Value for "+b+" is invalid"),wb(a)),c=!a.h.T||a.h.Ua?n(c,d):"--------".substr(0,d),a.B[b].textContent!=c&&(a.B[b].textContent=c))}
|
function T(a){var b=a.F(a.m);D(a,a.m+1);return b}function U(a){var b=Za(a.o,a.m);D(a,a.m+2);return b}function V(a){var b=Za(a.o,a.A);a.A=a.A+2&65535;return b}function W(a,b){a.A=a.A-2&65535;ab(a.o,a.A,b)}function X(a,b,c,d){d=d||2;a.B[b]&&(void 0===c&&(a.h.ca=!0,a.I("Value for "+b+" is invalid"),wb(a)),c=!a.h.T||a.h.Ua?n(c,d):"--------".substr(0,d),a.B[b].textContent!=c&&(a.B[b].textContent=c))}
|
||||||
m.ga=function(a){this.ba&&(a||!this.h.T||this.h.Ua)&&(X(this,"A",this.b),X(this,"B",this.g),X(this,"C",this.v),X(this,"BC",Jb(this),4),X(this,"D",this.i),X(this,"E",this.w),X(this,"DE",G(this),4),X(this,"H",this.j),X(this,"L",this.l),X(this,"HL",H(this),4),X(this,"SP",this.A,4),X(this,"PC",this.m,4),a=Ib(this),X(this,"PS",a,4),X(this,"IF",a&512?1:0,1),X(this,"SF",a&128?1:0,1),X(this,"ZF",a&64?1:0,1),X(this,"AF",a&16?1:0,1),X(this,"PF",a&4?1:0,1),X(this,"CF",a&1?1:0,1));if(a=this.B.speed)a.textContent=
|
m.ga=function(a){this.ba&&(a||!this.h.T||this.h.Ua)&&(X(this,"A",this.b),X(this,"B",this.g),X(this,"C",this.v),X(this,"BC",Jb(this),4),X(this,"D",this.i),X(this,"E",this.w),X(this,"DE",G(this),4),X(this,"H",this.j),X(this,"L",this.l),X(this,"HL",H(this),4),X(this,"SP",this.A,4),X(this,"PC",this.m,4),a=Ib(this),X(this,"PS",a,4),X(this,"IF",a&512?1:0,1),X(this,"SF",a&128?1:0,1),X(this,"ZF",a&64?1:0,1),X(this,"AF",a&16?1:0,1),X(this,"PF",a&4?1:0,1),X(this,"CF",a&1?1:0,1));if(a=this.B.speed)a.textContent=
|
||||||
|
|
@ -70,8 +70,8 @@ this.a-=4},function(){this.b=R(this,this.w);this.a-=4},function(){this.b=R(this,
|
||||||
c=this.b,d=this.m+-2&65535,e=1,f=0;0<e;){var h=b.m[a],g=b.D[a]||1,l=1==g?255:2==g?65535:-1,l=(c>>>=f)&l;if(void 0!==h&&h[0])h[0](a,l,d);f+=g<<3;a+=g;e-=g}this.a-=10},function(){var a=U(this);K(this)||(W(this,this.m),D(this,a),this.a-=6);this.a-=11},function(){W(this,G(this));this.a-=11},function(){this.b=Q(this,T(this));this.a-=7},function(){W(this,this.m);D(this,16);this.a-=11},function(){K(this)&&(D(this,V(this)),this.a-=6);this.a-=5},Rb,function(){var a=U(this);K(this)&&D(this,a);this.a-=10},function(){for(var a=
|
c=this.b,d=this.m+-2&65535,e=1,f=0;0<e;){var h=b.m[a],g=b.D[a]||1,l=1==g?255:2==g?65535:-1,l=(c>>>=f)&l;if(void 0!==h&&h[0])h[0](a,l,d);f+=g<<3;a+=g;e-=g}this.a-=10},function(){var a=U(this);K(this)||(W(this,this.m),D(this,a),this.a-=6);this.a-=11},function(){W(this,G(this));this.a-=11},function(){this.b=Q(this,T(this));this.a-=7},function(){W(this,this.m);D(this,16);this.a-=11},function(){K(this)&&(D(this,V(this)),this.a-=6);this.a-=5},Rb,function(){var a=U(this);K(this)&&D(this,a);this.a-=10},function(){for(var a=
|
||||||
T(this),b=this.o,c=this.m+-2&65535,d=1,e=0,f=0;0<d;){var h=b.o[a],g=b.C[a]||1,l=1==g?255:2==g?65535:-1,k=l;void 0!==h&&h[0]&&(k=h[0](a,c),void 0===k?k=l:k&=l);e|=k<<f;f+=g<<3;a+=g;d-=g}this.b=e&255;this.a-=10},function(){var a=U(this);K(this)&&(W(this,this.m),D(this,a),this.a-=6);this.a-=11},Sb,function(){this.b=R(this,T(this));this.a-=7},function(){W(this,this.m);D(this,24);this.a-=11},function(){Mb(this)||(D(this,V(this)),this.a-=6);this.a-=5},function(){J(this,V(this));this.a-=10},function(){var a=
|
T(this),b=this.o,c=this.m+-2&65535,d=1,e=0,f=0;0<d;){var h=b.o[a],g=b.C[a]||1,l=1==g?255:2==g?65535:-1,k=l;void 0!==h&&h[0]&&(k=h[0](a,c),void 0===k?k=l:k&=l);e|=k<<f;f+=g<<3;a+=g;d-=g}this.b=e&255;this.a-=10},function(){var a=U(this);K(this)&&(W(this,this.m),D(this,a),this.a-=6);this.a-=11},Sb,function(){this.b=R(this,T(this));this.a-=7},function(){W(this,this.m);D(this,24);this.a-=11},function(){Mb(this)||(D(this,V(this)),this.a-=6);this.a-=5},function(){J(this,V(this));this.a-=10},function(){var a=
|
||||||
U(this);Mb(this)||D(this,a);this.a-=10},function(){var a=V(this);W(this,H(this));J(this,a);this.a-=18},function(){var a=U(this);Mb(this)||(W(this,this.m),D(this,a),this.a-=6);this.a-=11},function(){W(this,H(this));this.a-=11},function(){this.b=O(this,T(this));this.a-=7},function(){W(this,this.m);D(this,32);this.a-=11},function(){Mb(this)&&(D(this,V(this)),this.a-=6);this.a-=5},function(){D(this,H(this));this.a-=5},function(){var a=U(this);Mb(this)&&D(this,a);this.a-=10},function(){var a=H(this);J(this,
|
U(this);Mb(this)||D(this,a);this.a-=10},function(){var a=V(this);W(this,H(this));J(this,a);this.a-=18},function(){var a=U(this);Mb(this)||(W(this,this.m),D(this,a),this.a-=6);this.a-=11},function(){W(this,H(this));this.a-=11},function(){this.b=O(this,T(this));this.a-=7},function(){W(this,this.m);D(this,32);this.a-=11},function(){Mb(this)&&(D(this,V(this)),this.a-=6);this.a-=5},function(){D(this,H(this));this.a-=5},function(){var a=U(this);Mb(this)&&D(this,a);this.a-=10},function(){var a=H(this);J(this,
|
||||||
G(this));Lb(this,a);this.a-=5},function(){var a=U(this);Mb(this)&&(W(this,this.m),D(this,a),this.a-=6);this.a-=11},Sb,function(){this.b=S(this,T(this));this.a-=7},function(){W(this,this.m);D(this,40);this.a-=11},function(){this.s&128||(D(this,V(this)),this.a-=6);this.a-=5},function(){var a=V(this);Gb(this,a);this.b=a>>8;this.a-=10},function(){var a=U(this);this.s&128||D(this,a);this.a-=10},function(){this.G&=-513;this.a-=4},function(){var a=U(this);this.s&128||(W(this,this.m),D(this,a),this.a-=6);
|
G(this));Lb(this,a);this.a-=5},function(){var a=U(this);Mb(this)&&(W(this,this.m),D(this,a),this.a-=6);this.a-=11},Sb,function(){this.b=S(this,T(this));this.a-=7},function(){W(this,this.m);D(this,40);this.a-=11},function(){this.s&128||(D(this,V(this)),this.a-=6);this.a-=5},function(){var a=V(this);Gb(this,a&255|this.G&-256);this.b=a>>8;this.a-=10},function(){var a=U(this);this.s&128||D(this,a);this.a-=10},function(){this.G&=-513;this.a-=4},function(){var a=U(this);this.s&128||(W(this,this.m),D(this,
|
||||||
this.a-=11},function(){W(this,Ib(this)&255|this.b<<8);this.a-=11},function(){this.b=P(this,T(this));this.a-=7},function(){W(this,this.m);D(this,48);this.a-=11},function(){this.s&128&&(D(this,V(this)),this.a-=6);this.a-=5},function(){this.A=H(this)&65535;this.a-=5},function(){var a=U(this);this.s&128&&D(this,a);this.a-=10},function(){this.G|=512;this.a-=4},function(){var a=U(this);this.s&128&&(W(this,this.m),D(this,a),this.a-=6);this.a-=11},Sb,function(){Q(this,T(this));this.a-=7},function(){W(this,
|
a),this.a-=6);this.a-=11},function(){W(this,Ib(this)&255|this.b<<8);this.a-=11},function(){this.b=P(this,T(this));this.a-=7},function(){W(this,this.m);D(this,48);this.a-=11},function(){this.s&128&&(D(this,V(this)),this.a-=6);this.a-=5},function(){this.A=H(this)&65535;this.a-=5},function(){var a=U(this);this.s&128&&D(this,a);this.a-=10},function(){this.G|=512;this.a-=4},function(){var a=U(this);this.s&128&&(W(this,this.m),D(this,a),this.a-=6);this.a-=11},Sb,function(){Q(this,T(this));this.a-=7},function(){W(this,
|
||||||
this.m);D(this,56);this.a-=11}];function Y(a){u.call(this,"ChipSet",a,Y);var b=a.model;b&&!Tb[b]&&r("Unrecognized ChipSet model: "+b);this.O=Tb[b]||Ub;a.sound&&(this.m=null,window&&(this.m=window.AudioContext||window.webkitAudioContext),this.m&&new this.m);B(this)}w(Y);var Ub=1978.1,Tb={SI1978:Ub};m=Y.prototype;m.P=function(){return!1};
|
this.m);D(this,56);this.a-=11}];function Y(a){u.call(this,"ChipSet",a,Y);var b=a.model;b&&!Tb[b]&&r("Unrecognized ChipSet model: "+b);this.O=Tb[b]||Ub;a.sound&&(this.m=null,window&&(this.m=window.AudioContext||window.webkitAudioContext),this.m&&new this.m);B(this)}w(Y);var Ub=1978.1,Tb={SI1978:Ub};m=Y.prototype;m.P=function(){return!1};
|
||||||
m.da=function(a,b,c,d){this.o=b;this.a=c;this.J=d;this.u=a;if(this.O==Ub){var e;a=Vb;void 0===e&&(e=0);for(var f in a){c=b;d=+f+e;var h=a[f].bind(this);if(void 0!==h)for(var g=+f+e;g<=d;g++)void 0!==c.o[g]?r("Input port 0x"+n(g,4)+" already registered"):c.o[g]=[h,!1]}var l;e=Wb;void 0===l&&(l=0);for(var k in e)if(f=b,a=+k+l,c=e[k].bind(this),void 0!==c)for(d=+k+l;d<=a;d++)void 0!==f.m[d]?r("Output port 0x"+n(d,4)+" already registered"):f.m[d]=[c,!1]}};
|
m.da=function(a,b,c,d){this.o=b;this.a=c;this.J=d;this.u=a;if(this.O==Ub){var e;a=Vb;void 0===e&&(e=0);for(var f in a){c=b;d=+f+e;var h=a[f].bind(this);if(void 0!==h)for(var g=+f+e;g<=d;g++)void 0!==c.o[g]?r("Input port 0x"+n(g,4)+" already registered"):c.o[g]=[h,!1]}var l;e=Wb;void 0===l&&(l=0);for(var k in e)if(f=b,a=+k+l,c=e[k].bind(this),void 0!==c)for(d=+k+l;d<=a;d++)void 0!==f.m[d]?r("Output port 0x"+n(d,4)+" already registered"):f.m[d]=[c,!1]}};
|
||||||
m.X=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};m.W=function(a){return a?this.save():!0};m.reset=function(){this.f=this.g=this.c=this.b=this.l=this.j=this.i=0};m.save=function(){var a=new E(this);this.O==Ub&&F(a,0,[this.i,this.j,this.l,this.b,this.c,this.f,this.g]);return a.data()};m.restore=function(a){a=a[0];this.O==Ub&&(this.i=a[0],this.j=a[1],this.l=a[2],this.b=a[3],this.c=a[4],this.f=a[5],this.g=a[6]);return!0};m.start=function(){};m.stop=function(){};
|
m.X=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};m.W=function(a){return a?this.save():!0};m.reset=function(){this.f=this.g=this.c=this.b=this.l=this.j=this.i=0};m.save=function(){var a=new E(this);this.O==Ub&&F(a,0,[this.i,this.j,this.l,this.b,this.c,this.f,this.g]);return a.data()};m.restore=function(a){a=a[0];this.O==Ub&&(this.i=a[0],this.j=a[1],this.l=a[2],this.b=a[3],this.c=a[4],this.f=a[5],this.g=a[6]);return!0};m.start=function(){};m.stop=function(){};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue