diff --git a/_config.yml b/_config.yml index a4f934754..b0b3a7f1f 100644 --- a/_config.yml +++ b/_config.yml @@ -114,7 +114,7 @@ pcjs: - /modules/pc8080/lib/bus.js - /modules/pc8080/lib/memory.js - /modules/pc8080/lib/cpu.js - - /modules/pc8080/lib/cpusim.js + - /modules/pc8080/lib/cpustate.js - /modules/pc8080/lib/cpuops.js - /modules/pc8080/lib/chipset.js - /modules/pc8080/lib/rom.js diff --git a/devices/pc/panel/default.xml b/devices/pc/panel/default.xml index c784fff5d..b62c643a7 100644 --- a/devices/pc/panel/default.xml +++ b/devices/pc/panel/default.xml @@ -42,7 +42,7 @@ Run Step Reset - Fast + Speed Save diff --git a/devices/pc/panel/wide.xml b/devices/pc/panel/wide.xml index 8e3d41f4b..eb794d2ab 100644 --- a/devices/pc/panel/wide.xml +++ b/devices/pc/panel/wide.xml @@ -42,7 +42,7 @@ Run Step Reset - Fast + Speed Save diff --git a/devices/pc/panel/wide386.xml b/devices/pc/panel/wide386.xml index d3c2d39ac..15db7d384 100644 --- a/devices/pc/panel/wide386.xml +++ b/devices/pc/panel/wide386.xml @@ -11,7 +11,7 @@ Step Reset Save - Fast + Speed Stopped diff --git a/modules/pc8080/lib/bus.js b/modules/pc8080/lib/bus.js index d06290b6a..2b2ba7983 100644 --- a/modules/pc8080/lib/bus.js +++ b/modules/pc8080/lib/bus.js @@ -68,7 +68,7 @@ if (NODE) { * @constructor * @extends Component * @param {Object} parmsBus - * @param {CPUSim} cpu + * @param {CPUState} cpu * @param {Debugger} dbg */ function Bus(parmsBus, cpu, dbg) @@ -705,7 +705,7 @@ Bus.prototype.saveMemory = function(fAll) /** * restoreMemory(a) * - * This restores the contents of all Memory blocks; called by CPUSim.restore(). + * This restores the contents of all Memory blocks; called by CPUState.restore(). * * In theory, we ONLY have to save/restore block contents. Other block attributes, * like the type, the memory controller (if any), and the active memory access functions, diff --git a/modules/pc8080/lib/chipset.js b/modules/pc8080/lib/chipset.js index 8a996e791..185059932 100644 --- a/modules/pc8080/lib/chipset.js +++ b/modules/pc8080/lib/chipset.js @@ -61,7 +61,7 @@ function ChipSet(parmsChipSet) var model = parmsChipSet['model']; /* - * this.model is a numeric version of the 'model' string; when comparing this.model to standard IBM + * this.model is a numeric version of the 'model' string; when comparing this.model to "base" * model numbers, you should generally compare (this.model|0) to the target value, which truncates it. */ if (model && !ChipSet.MODELS[model]) { @@ -111,29 +111,29 @@ ChipSet.SI_1978 = { PORT: 0, DIP4: 0x01, // self-test request at power up? ALWAYS_SET: 0x0E, // always set - FIRE: 0x10, // fire - LEFT: 0x20, // move left - RIGHT: 0x40, // move right - PORT7: 0x80 // some connection to port 7? + FIRE: 0x10, // 1 = fire + LEFT: 0x20, // 1 = move left + RIGHT: 0x40, // 1 = move right + PORT7: 0x80 // some connection to (undocumented) port 7 }, STATUS1: { PORT: 1, - CREDIT: 0x01, // credit - P1: 0x02, // 1P start - P2: 0x04, // 2P start + CREDIT: 0x01, // credit (coin slot) + P2: 0x02, // 1 = 2P start + P1: 0x04, // 1 = 1P start ALWAYS_SET: 0x08, // always set - P1_FIRE: 0x10, // P1 fire (cocktail machines only?) - P1_LEFT: 0x20, // P1 left (cocktail machines only?) - P1_RIGHT: 0x40 // P1 right (cocktail machines only?) + P1_FIRE: 0x10, // 1 = P1 fire (cocktail machines only?) + P1_LEFT: 0x20, // 1 = P1 left (cocktail machines only?) + P1_RIGHT: 0x40 // 1 = P1 right (cocktail machines only?) }, STATUS2: { PORT: 2, DIP3_5: 0x03, // 00 = 3 ships, 01 = 4 ships, 10 = 5 ships, 11 = 6 ships - TILT: 0x04, + TILT: 0x04, // 1 = tilt detected DIP6: 0x08, // 0 = extra ship at 1500, 1 = extra ship at 1000 - P2_FIRE: 0x10, // P2 fire (cocktail machines only?) - P2_LEFT: 0x20, // P2 left (cocktail machines only?) - P2_RIGHT: 0x40, // P2 right (cocktail machines only?) + P2_FIRE: 0x10, // 1 = P2 fire (cocktail machines only?) + P2_LEFT: 0x20, // 1 = P2 left (cocktail machines only?) + P2_RIGHT: 0x40, // 1 = P2 right (cocktail machines only?) DIP7: 0x80 // 0 = display coin info on demo ("attract") screen }, SHIFT_RESULT: { // bits 0-7 of barrel shifter result @@ -218,7 +218,7 @@ ChipSet.prototype.setBinding = function(sHTMLType, sBinding, control, sValue) * @this {ChipSet} * @param {Computer} cmp * @param {Bus} bus - * @param {CPUSim} cpu + * @param {CPUState} cpu * @param {Debugger} dbg */ ChipSet.prototype.initBus = function(cmp, bus, cpu, dbg) diff --git a/modules/pc8080/lib/computer.js b/modules/pc8080/lib/computer.js index 0828fc422..9b9bf32a0 100644 --- a/modules/pc8080/lib/computer.js +++ b/modules/pc8080/lib/computer.js @@ -145,10 +145,10 @@ function Computer(parmsComputer, parmsMachine, fSuspended) { * Find the appropriate CPU (and Debugger and Control Panel, if any) * * CLOSURE COMPILER TIP: To override the type of a right-hand expression (as we need to do here, - * where we know getComponentByType() will only return an CPUSim object or null), wrap the expression + * where we know getComponentByType() will only return an CPUState object or null), wrap the expression * in parentheses. I never knew this until I stumbled across it in "Closure: The Definitive Guide". */ - this.cpu = /** @type {CPUSim} */ (Component.getComponentByType("CPU", this.id)); + this.cpu = /** @type {CPUState} */ (Component.getComponentByType("CPU", this.id)); if (!this.cpu) { Component.error("Unable to find CPU component"); return; @@ -1454,7 +1454,7 @@ Computer.prototype.updateFocus = function(fScroll) * neither. In theory, there could be BOTH, but that would be unusual. * * TODO: Consider alternate approaches to these largely register-oriented display updates. Ordinarily, we like to - * separate logic from presentation, and currently the CPUSim contains both, since it's the component that intimately + * separate logic from presentation, and currently the CPUState contains both, since it's the component that intimately * knows the names, number, sizes, etc, of all the active registers. The Panel component is the logical candidate, * but Panel is an optional component; generally, only machines that include Debugger also include Panel. * diff --git a/modules/pc8080/lib/cpu.js b/modules/pc8080/lib/cpu.js index d25d29e6d..5d34e6477 100644 --- a/modules/pc8080/lib/cpu.js +++ b/modules/pc8080/lib/cpu.js @@ -44,7 +44,7 @@ if (NODE) { * * The CPU class supports the following (parmsCPU) properties: * - * cycles: the machine's base cycles per second; the CPUSim constructor will + * cycles: the machine's base cycles per second; the CPUState constructor will * provide us with a default (based on the CPU model) to use as a fallback. * * multiplier: base cycle multiplier; default is 1. @@ -65,7 +65,7 @@ if (NODE) { * This component is primarily responsible for interfacing the CPU with the outside * world (eg, Panel and Debugger components), and managing overall CPU operation. * - * It is extended by the CPUSim component, where the simulation control logic resides. + * It is extended by the CPUState component, where the simulation control logic resides. * * @constructor * @extends Component @@ -209,7 +209,7 @@ CPU.prototype.reset = function() /** * save() * - * This is a placeholder for save support (overridden by the CPUSim component). + * This is a placeholder for save support (overridden by the CPUState component). * * @this {CPU} * @return {Object|null} @@ -222,7 +222,7 @@ CPU.prototype.save = function() /** * restore(data) * - * This is a placeholder for restore support (overridden by the CPUSim component). + * This is a placeholder for restore support (overridden by the CPUState component). * * @this {CPU} * @param {Object} data @@ -349,7 +349,7 @@ CPU.prototype.isRunning = function() /** * getChecksum() * - * This will be implemented by the CPUSim component. + * This will be implemented by the CPUState component. * * @this {CPU} * @return {number} a 32-bit summation of key elements of the current CPU state (used by the CPU checksum code) @@ -1046,7 +1046,7 @@ CPU.prototype.startCPU = function(fUpdateFocus) /** * stepCPU(nMinCycles) * - * This will be implemented by the CPUSim component. + * This will be implemented by the CPUState component. * * @this {CPU} * @param {number} nMinCycles (0 implies a single-step, and therefore breakpoints should be ignored) diff --git a/modules/pc8080/lib/cpuops.js b/modules/pc8080/lib/cpuops.js index 991e815e6..859498c22 100644 --- a/modules/pc8080/lib/cpuops.js +++ b/modules/pc8080/lib/cpuops.js @@ -41,7 +41,7 @@ if (NODE) { /** * op=0x00 (NOP) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opNOP = function() { @@ -51,7 +51,7 @@ CPUDef.opNOP = function() /** * op=0x01 (LXI B,d16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opLXIB = function() { @@ -62,7 +62,7 @@ CPUDef.opLXIB = function() /** * op=0x02 (STAX B) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opSTAXB = function() { @@ -73,7 +73,7 @@ CPUDef.opSTAXB = function() /** * op=0x03 (INX B) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opINXB = function() { @@ -84,7 +84,7 @@ CPUDef.opINXB = function() /** * op=0x04 (INR B) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opINRB = function() { @@ -95,7 +95,7 @@ CPUDef.opINRB = function() /** * op=0x05 (DCR B) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opDCRB = function() { @@ -106,7 +106,7 @@ CPUDef.opDCRB = function() /** * op=0x06 (MVI B,d8) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMVIB = function() { @@ -117,7 +117,7 @@ CPUDef.opMVIB = function() /** * op=0x07 (RLC) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opRLC = function() { @@ -130,7 +130,7 @@ CPUDef.opRLC = function() /** * op=0x09 (DAD B) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opDADB = function() { @@ -143,7 +143,7 @@ CPUDef.opDADB = function() /** * op=0x0A (LDAX B) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opLDAXB = function() { @@ -154,7 +154,7 @@ CPUDef.opLDAXB = function() /** * op=0x0B (DCX B) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opDCXB = function() { @@ -165,7 +165,7 @@ CPUDef.opDCXB = function() /** * op=0x0C (INR C) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opINRC = function() { @@ -176,7 +176,7 @@ CPUDef.opINRC = function() /** * op=0x0D (DCR C) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opDCRC = function() { @@ -187,7 +187,7 @@ CPUDef.opDCRC = function() /** * op=0x0E (MVI C,d8) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMVIC = function() { @@ -198,7 +198,7 @@ CPUDef.opMVIC = function() /** * op=0x0F (RRC) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opRRC = function() { @@ -211,7 +211,7 @@ CPUDef.opRRC = function() /** * op=0x11 (LXI D,d16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opLXID = function() { @@ -222,7 +222,7 @@ CPUDef.opLXID = function() /** * op=0x12 (STAX D) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opSTAXD = function() { @@ -233,7 +233,7 @@ CPUDef.opSTAXD = function() /** * op=0x13 (INX D) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opINXD = function() { @@ -244,7 +244,7 @@ CPUDef.opINXD = function() /** * op=0x14 (INR D) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opINRD = function() { @@ -255,7 +255,7 @@ CPUDef.opINRD = function() /** * op=0x15 (DCR D) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opDCRD = function() { @@ -266,7 +266,7 @@ CPUDef.opDCRD = function() /** * op=0x16 (MVI D,d8) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMVID = function() { @@ -277,7 +277,7 @@ CPUDef.opMVID = function() /** * op=0x17 (RAL) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opRAL = function() { @@ -290,7 +290,7 @@ CPUDef.opRAL = function() /** * op=0x19 (DAD D) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opDADD = function() { @@ -303,7 +303,7 @@ CPUDef.opDADD = function() /** * op=0x1A (LDAX D) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opLDAXD = function() { @@ -314,7 +314,7 @@ CPUDef.opLDAXD = function() /** * op=0x1B (DCX D) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opDCXD = function() { @@ -325,7 +325,7 @@ CPUDef.opDCXD = function() /** * op=0x1C (INR E) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opINRE = function() { @@ -336,7 +336,7 @@ CPUDef.opINRE = function() /** * op=0x1D (DCR E) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opDCRE = function() { @@ -347,7 +347,7 @@ CPUDef.opDCRE = function() /** * op=0x1E (MVI E,d8) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMVIE = function() { @@ -358,7 +358,7 @@ CPUDef.opMVIE = function() /** * op=0x1F (RAR) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opRAR = function() { @@ -371,7 +371,7 @@ CPUDef.opRAR = function() /** * op=0x21 (LXI H,d16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opLXIH = function() { @@ -382,7 +382,7 @@ CPUDef.opLXIH = function() /** * op=0x22 (SHLD a16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opSHLD = function() { @@ -393,7 +393,7 @@ CPUDef.opSHLD = function() /** * op=0x23 (INX H) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opINXH = function() { @@ -404,7 +404,7 @@ CPUDef.opINXH = function() /** * op=0x24 (INR H) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opINRH = function() { @@ -415,7 +415,7 @@ CPUDef.opINRH = function() /** * op=0x25 (DCR H) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opDCRH = function() { @@ -426,7 +426,7 @@ CPUDef.opDCRH = function() /** * op=0x26 (MVI H,d8) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMVIH = function() { @@ -437,7 +437,7 @@ CPUDef.opMVIH = function() /** * op=0x27 (DAA) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opDAA = function() { @@ -459,7 +459,7 @@ CPUDef.opDAA = function() /** * op=0x29 (DAD H) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opDADH = function() { @@ -472,7 +472,7 @@ CPUDef.opDADH = function() /** * op=0x2A (LHLD a16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opLHLD = function() { @@ -483,7 +483,7 @@ CPUDef.opLHLD = function() /** * op=0x2B (DCX H) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opDCXH = function() { @@ -494,7 +494,7 @@ CPUDef.opDCXH = function() /** * op=0x2C (INR L) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opINRL = function() { @@ -505,7 +505,7 @@ CPUDef.opINRL = function() /** * op=0x2D (DCR L) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opDCRL = function() { @@ -516,7 +516,7 @@ CPUDef.opDCRL = function() /** * op=0x2E (MVI L,d8) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMVIL = function() { @@ -527,7 +527,7 @@ CPUDef.opMVIL = function() /** * op=0x2F (CMA) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opCMA = function() { @@ -538,7 +538,7 @@ CPUDef.opCMA = function() /** * op=0x31 (LXI SP,d16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opLXISP = function() { @@ -549,7 +549,7 @@ CPUDef.opLXISP = function() /** * op=0x32 (STA a16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opSTA = function() { @@ -560,7 +560,7 @@ CPUDef.opSTA = function() /** * op=0x33 (INX SP) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opINXSP = function() { @@ -571,7 +571,7 @@ CPUDef.opINXSP = function() /** * op=0x34 (INR M) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opINRM = function() { @@ -583,7 +583,7 @@ CPUDef.opINRM = function() /** * op=0x35 (DCR M) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opDCRM = function() { @@ -595,7 +595,7 @@ CPUDef.opDCRM = function() /** * op=0x36 (MVI M,d8) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMVIM = function() { @@ -606,7 +606,7 @@ CPUDef.opMVIM = function() /** * op=0x37 (STC) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opSTC = function() { @@ -617,7 +617,7 @@ CPUDef.opSTC = function() /** * op=0x39 (DAD SP) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opDADSP = function() { @@ -630,7 +630,7 @@ CPUDef.opDADSP = function() /** * op=0x3A (LDA a16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opLDA = function() { @@ -641,7 +641,7 @@ CPUDef.opLDA = function() /** * op=0x3B (DCX SP) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opDCXSP = function() { @@ -652,7 +652,7 @@ CPUDef.opDCXSP = function() /** * op=0x3C (INR A) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opINRA = function() { @@ -663,7 +663,7 @@ CPUDef.opINRA = function() /** * op=0x3D (DCR A) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opDCRA = function() { @@ -674,7 +674,7 @@ CPUDef.opDCRA = function() /** * op=0x3E (MVI A,d8) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMVIA = function() { @@ -685,7 +685,7 @@ CPUDef.opMVIA = function() /** * op=0x3F (CMC) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opCMC = function() { @@ -696,7 +696,7 @@ CPUDef.opCMC = function() /** * op=0x40 (MOV B,B) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVBB = function() { @@ -706,7 +706,7 @@ CPUDef.opMOVBB = function() /** * op=0x41 (MOV B,C) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVBC = function() { @@ -717,7 +717,7 @@ CPUDef.opMOVBC = function() /** * op=0x42 (MOV B,D) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVBD = function() { @@ -728,7 +728,7 @@ CPUDef.opMOVBD = function() /** * op=0x43 (MOV B,E) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVBE = function() { @@ -739,7 +739,7 @@ CPUDef.opMOVBE = function() /** * op=0x44 (MOV B,H) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVBH = function() { @@ -750,7 +750,7 @@ CPUDef.opMOVBH = function() /** * op=0x45 (MOV B,L) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVBL = function() { @@ -761,7 +761,7 @@ CPUDef.opMOVBL = function() /** * op=0x46 (MOV B,M) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVBM = function() { @@ -772,7 +772,7 @@ CPUDef.opMOVBM = function() /** * op=0x47 (MOV B,A) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVBA = function() { @@ -783,7 +783,7 @@ CPUDef.opMOVBA = function() /** * op=0x48 (MOV C,B) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVCB = function() { @@ -794,7 +794,7 @@ CPUDef.opMOVCB = function() /** * op=0x49 (MOV C,C) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVCC = function() { @@ -804,7 +804,7 @@ CPUDef.opMOVCC = function() /** * op=0x4A (MOV C,D) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVCD = function() { @@ -815,7 +815,7 @@ CPUDef.opMOVCD = function() /** * op=0x4B (MOV C,E) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVCE = function() { @@ -826,7 +826,7 @@ CPUDef.opMOVCE = function() /** * op=0x4C (MOV C,H) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVCH = function() { @@ -837,7 +837,7 @@ CPUDef.opMOVCH = function() /** * op=0x4D (MOV C,L) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVCL = function() { @@ -848,7 +848,7 @@ CPUDef.opMOVCL = function() /** * op=0x4E (MOV C,M) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVCM = function() { @@ -859,7 +859,7 @@ CPUDef.opMOVCM = function() /** * op=0x4F (MOV C,A) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVCA = function() { @@ -870,7 +870,7 @@ CPUDef.opMOVCA = function() /** * op=0x50 (MOV D,B) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVDB = function() { @@ -881,7 +881,7 @@ CPUDef.opMOVDB = function() /** * op=0x51 (MOV D,C) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVDC = function() { @@ -892,7 +892,7 @@ CPUDef.opMOVDC = function() /** * op=0x52 (MOV D,D) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVDD = function() { @@ -902,7 +902,7 @@ CPUDef.opMOVDD = function() /** * op=0x53 (MOV D,E) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVDE = function() { @@ -913,7 +913,7 @@ CPUDef.opMOVDE = function() /** * op=0x54 (MOV D,H) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVDH = function() { @@ -924,7 +924,7 @@ CPUDef.opMOVDH = function() /** * op=0x55 (MOV D,L) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVDL = function() { @@ -935,7 +935,7 @@ CPUDef.opMOVDL = function() /** * op=0x56 (MOV D,M) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVDM = function() { @@ -946,7 +946,7 @@ CPUDef.opMOVDM = function() /** * op=0x57 (MOV D,A) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVDA = function() { @@ -957,7 +957,7 @@ CPUDef.opMOVDA = function() /** * op=0x58 (MOV E,B) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVEB = function() { @@ -968,7 +968,7 @@ CPUDef.opMOVEB = function() /** * op=0x59 (MOV E,C) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVEC = function() { @@ -979,7 +979,7 @@ CPUDef.opMOVEC = function() /** * op=0x5A (MOV E,D) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVED = function() { @@ -990,7 +990,7 @@ CPUDef.opMOVED = function() /** * op=0x5B (MOV E,E) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVEE = function() { @@ -1000,7 +1000,7 @@ CPUDef.opMOVEE = function() /** * op=0x5C (MOV E,H) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVEH = function() { @@ -1011,7 +1011,7 @@ CPUDef.opMOVEH = function() /** * op=0x5D (MOV E,L) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVEL = function() { @@ -1022,7 +1022,7 @@ CPUDef.opMOVEL = function() /** * op=0x5E (MOV E,M) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVEM = function() { @@ -1033,7 +1033,7 @@ CPUDef.opMOVEM = function() /** * op=0x5F (MOV E,A) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVEA = function() { @@ -1044,7 +1044,7 @@ CPUDef.opMOVEA = function() /** * op=0x60 (MOV H,B) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVHB = function() { @@ -1055,7 +1055,7 @@ CPUDef.opMOVHB = function() /** * op=0x61 (MOV H,C) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVHC = function() { @@ -1066,7 +1066,7 @@ CPUDef.opMOVHC = function() /** * op=0x62 (MOV H,D) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVHD = function() { @@ -1077,7 +1077,7 @@ CPUDef.opMOVHD = function() /** * op=0x63 (MOV H,E) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVHE = function() { @@ -1088,7 +1088,7 @@ CPUDef.opMOVHE = function() /** * op=0x64 (MOV H,H) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVHH = function() { @@ -1098,7 +1098,7 @@ CPUDef.opMOVHH = function() /** * op=0x65 (MOV H,L) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVHL = function() { @@ -1109,7 +1109,7 @@ CPUDef.opMOVHL = function() /** * op=0x66 (MOV H,M) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVHM = function() { @@ -1120,7 +1120,7 @@ CPUDef.opMOVHM = function() /** * op=0x67 (MOV H,A) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVHA = function() { @@ -1131,7 +1131,7 @@ CPUDef.opMOVHA = function() /** * op=0x68 (MOV L,B) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVLB = function() { @@ -1142,7 +1142,7 @@ CPUDef.opMOVLB = function() /** * op=0x69 (MOV L,C) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVLC = function() { @@ -1153,7 +1153,7 @@ CPUDef.opMOVLC = function() /** * op=0x6A (MOV L,D) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVLD = function() { @@ -1164,7 +1164,7 @@ CPUDef.opMOVLD = function() /** * op=0x6B (MOV L,E) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVLE = function() { @@ -1175,7 +1175,7 @@ CPUDef.opMOVLE = function() /** * op=0x6C (MOV L,H) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVLH = function() { @@ -1186,7 +1186,7 @@ CPUDef.opMOVLH = function() /** * op=0x6D (MOV L,L) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVLL = function() { @@ -1196,7 +1196,7 @@ CPUDef.opMOVLL = function() /** * op=0x6E (MOV L,M) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVLM = function() { @@ -1207,7 +1207,7 @@ CPUDef.opMOVLM = function() /** * op=0x6F (MOV L,A) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVLA = function() { @@ -1218,7 +1218,7 @@ CPUDef.opMOVLA = function() /** * op=0x70 (MOV M,B) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVMB = function() { @@ -1229,7 +1229,7 @@ CPUDef.opMOVMB = function() /** * op=0x71 (MOV M,C) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVMC = function() { @@ -1240,7 +1240,7 @@ CPUDef.opMOVMC = function() /** * op=0x72 (MOV M,D) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVMD = function() { @@ -1251,7 +1251,7 @@ CPUDef.opMOVMD = function() /** * op=0x73 (MOV M,E) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVME = function() { @@ -1262,7 +1262,7 @@ CPUDef.opMOVME = function() /** * op=0x74 (MOV M,H) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVMH = function() { @@ -1273,7 +1273,7 @@ CPUDef.opMOVMH = function() /** * op=0x75 (MOV M,L) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVML = function() { @@ -1284,7 +1284,7 @@ CPUDef.opMOVML = function() /** * op=0x76 (HLT) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opHLT = function() { @@ -1331,7 +1331,7 @@ CPUDef.opHLT = function() /** * op=0x77 (MOV M,A) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVMA = function() { @@ -1342,7 +1342,7 @@ CPUDef.opMOVMA = function() /** * op=0x78 (MOV A,B) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVAB = function() { @@ -1353,7 +1353,7 @@ CPUDef.opMOVAB = function() /** * op=0x79 (MOV A,C) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVAC = function() { @@ -1364,7 +1364,7 @@ CPUDef.opMOVAC = function() /** * op=0x7A (MOV A,D) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVAD = function() { @@ -1375,7 +1375,7 @@ CPUDef.opMOVAD = function() /** * op=0x7B (MOV A,E) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVAE = function() { @@ -1386,7 +1386,7 @@ CPUDef.opMOVAE = function() /** * op=0x7C (MOV A,H) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVAH = function() { @@ -1397,7 +1397,7 @@ CPUDef.opMOVAH = function() /** * op=0x7D (MOV A,L) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVAL = function() { @@ -1408,7 +1408,7 @@ CPUDef.opMOVAL = function() /** * op=0x7E (MOV A,M) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVAM = function() { @@ -1419,7 +1419,7 @@ CPUDef.opMOVAM = function() /** * op=0x7F (MOV A,A) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opMOVAA = function() { @@ -1429,7 +1429,7 @@ CPUDef.opMOVAA = function() /** * op=0x80 (ADD B) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opADDB = function() { @@ -1440,7 +1440,7 @@ CPUDef.opADDB = function() /** * op=0x81 (ADD C) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opADDC = function() { @@ -1451,7 +1451,7 @@ CPUDef.opADDC = function() /** * op=0x82 (ADD D) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opADDD = function() { @@ -1462,7 +1462,7 @@ CPUDef.opADDD = function() /** * op=0x83 (ADD E) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opADDE = function() { @@ -1473,7 +1473,7 @@ CPUDef.opADDE = function() /** * op=0x84 (ADD H) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opADDH = function() { @@ -1484,7 +1484,7 @@ CPUDef.opADDH = function() /** * op=0x85 (ADD L) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opADDL = function() { @@ -1495,7 +1495,7 @@ CPUDef.opADDL = function() /** * op=0x86 (ADD M) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opADDM = function() { @@ -1506,7 +1506,7 @@ CPUDef.opADDM = function() /** * op=0x87 (ADD A) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opADDA = function() { @@ -1517,7 +1517,7 @@ CPUDef.opADDA = function() /** * op=0x88 (ADC B) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opADCB = function() { @@ -1528,7 +1528,7 @@ CPUDef.opADCB = function() /** * op=0x89 (ADC C) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opADCC = function() { @@ -1539,7 +1539,7 @@ CPUDef.opADCC = function() /** * op=0x8A (ADC D) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opADCD = function() { @@ -1550,7 +1550,7 @@ CPUDef.opADCD = function() /** * op=0x8B (ADC E) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opADCE = function() { @@ -1561,7 +1561,7 @@ CPUDef.opADCE = function() /** * op=0x8C (ADC H) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opADCH = function() { @@ -1572,7 +1572,7 @@ CPUDef.opADCH = function() /** * op=0x8D (ADC L) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opADCL = function() { @@ -1583,7 +1583,7 @@ CPUDef.opADCL = function() /** * op=0x8E (ADC M) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opADCM = function() { @@ -1594,7 +1594,7 @@ CPUDef.opADCM = function() /** * op=0x8F (ADC A) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opADCA = function() { @@ -1605,7 +1605,7 @@ CPUDef.opADCA = function() /** * op=0x90 (SUB B) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opSUBB = function() { @@ -1616,7 +1616,7 @@ CPUDef.opSUBB = function() /** * op=0x91 (SUB C) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opSUBC = function() { @@ -1627,7 +1627,7 @@ CPUDef.opSUBC = function() /** * op=0x92 (SUB D) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opSUBD = function() { @@ -1638,7 +1638,7 @@ CPUDef.opSUBD = function() /** * op=0x93 (SUB E) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opSUBE = function() { @@ -1649,7 +1649,7 @@ CPUDef.opSUBE = function() /** * op=0x94 (SUB H) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opSUBH = function() { @@ -1660,7 +1660,7 @@ CPUDef.opSUBH = function() /** * op=0x95 (SUB L) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opSUBL = function() { @@ -1671,7 +1671,7 @@ CPUDef.opSUBL = function() /** * op=0x96 (SUB M) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opSUBM = function() { @@ -1682,7 +1682,7 @@ CPUDef.opSUBM = function() /** * op=0x97 (SUB A) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opSUBA = function() { @@ -1693,7 +1693,7 @@ CPUDef.opSUBA = function() /** * op=0x98 (SBB B) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opSBBB = function() { @@ -1704,7 +1704,7 @@ CPUDef.opSBBB = function() /** * op=0x99 (SBB C) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opSBBC = function() { @@ -1715,7 +1715,7 @@ CPUDef.opSBBC = function() /** * op=0x9A (SBB D) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opSBBD = function() { @@ -1726,7 +1726,7 @@ CPUDef.opSBBD = function() /** * op=0x9B (SBB E) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opSBBE = function() { @@ -1737,7 +1737,7 @@ CPUDef.opSBBE = function() /** * op=0x9C (SBB H) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opSBBH = function() { @@ -1748,7 +1748,7 @@ CPUDef.opSBBH = function() /** * op=0x9D (SBB L) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opSBBL = function() { @@ -1759,7 +1759,7 @@ CPUDef.opSBBL = function() /** * op=0x9E (SBB M) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opSBBM = function() { @@ -1770,7 +1770,7 @@ CPUDef.opSBBM = function() /** * op=0x9F (SBB A) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opSBBA = function() { @@ -1781,7 +1781,7 @@ CPUDef.opSBBA = function() /** * op=0xA0 (ANA B) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opANAB = function() { @@ -1792,7 +1792,7 @@ CPUDef.opANAB = function() /** * op=0xA1 (ANA C) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opANAC = function() { @@ -1803,7 +1803,7 @@ CPUDef.opANAC = function() /** * op=0xA2 (ANA D) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opANAD = function() { @@ -1814,7 +1814,7 @@ CPUDef.opANAD = function() /** * op=0xA3 (ANA E) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opANAE = function() { @@ -1825,7 +1825,7 @@ CPUDef.opANAE = function() /** * op=0xA4 (ANA H) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opANAH = function() { @@ -1836,7 +1836,7 @@ CPUDef.opANAH = function() /** * op=0xA5 (ANA L) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opANAL = function() { @@ -1847,7 +1847,7 @@ CPUDef.opANAL = function() /** * op=0xA6 (ANA M) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opANAM = function() { @@ -1858,7 +1858,7 @@ CPUDef.opANAM = function() /** * op=0xA7 (ANA A) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opANAA = function() { @@ -1869,7 +1869,7 @@ CPUDef.opANAA = function() /** * op=0xA8 (XRA B) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opXRAB = function() { @@ -1880,7 +1880,7 @@ CPUDef.opXRAB = function() /** * op=0xA9 (XRA C) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opXRAC = function() { @@ -1891,7 +1891,7 @@ CPUDef.opXRAC = function() /** * op=0xAA (XRA D) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opXRAD = function() { @@ -1902,7 +1902,7 @@ CPUDef.opXRAD = function() /** * op=0xAB (XRA E) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opXRAE = function() { @@ -1913,7 +1913,7 @@ CPUDef.opXRAE = function() /** * op=0xAC (XRA H) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opXRAH = function() { @@ -1924,7 +1924,7 @@ CPUDef.opXRAH = function() /** * op=0xAD (XRA L) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opXRAL = function() { @@ -1935,7 +1935,7 @@ CPUDef.opXRAL = function() /** * op=0xAE (XRA M) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opXRAM = function() { @@ -1946,7 +1946,7 @@ CPUDef.opXRAM = function() /** * op=0xAF (XRA A) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opXRAA = function() { @@ -1957,7 +1957,7 @@ CPUDef.opXRAA = function() /** * op=0xB0 (ORA B) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opORAB = function() { @@ -1968,7 +1968,7 @@ CPUDef.opORAB = function() /** * op=0xB1 (ORA C) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opORAC = function() { @@ -1979,7 +1979,7 @@ CPUDef.opORAC = function() /** * op=0xB2 (ORA D) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opORAD = function() { @@ -1990,7 +1990,7 @@ CPUDef.opORAD = function() /** * op=0xB3 (ORA E) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opORAE = function() { @@ -2001,7 +2001,7 @@ CPUDef.opORAE = function() /** * op=0xB4 (ORA H) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opORAH = function() { @@ -2012,7 +2012,7 @@ CPUDef.opORAH = function() /** * op=0xB5 (ORA L) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opORAL = function() { @@ -2023,7 +2023,7 @@ CPUDef.opORAL = function() /** * op=0xB6 (ORA M) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opORAM = function() { @@ -2034,7 +2034,7 @@ CPUDef.opORAM = function() /** * op=0xB7 (ORA A) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opORAA = function() { @@ -2045,7 +2045,7 @@ CPUDef.opORAA = function() /** * op=0xB8 (CMP B) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opCMPB = function() { @@ -2056,7 +2056,7 @@ CPUDef.opCMPB = function() /** * op=0xB9 (CMP C) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opCMPC = function() { @@ -2067,7 +2067,7 @@ CPUDef.opCMPC = function() /** * op=0xBA (CMP D) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opCMPD = function() { @@ -2078,7 +2078,7 @@ CPUDef.opCMPD = function() /** * op=0xBB (CMP E) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opCMPE = function() { @@ -2089,7 +2089,7 @@ CPUDef.opCMPE = function() /** * op=0xBC (CMP H) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opCMPH = function() { @@ -2100,7 +2100,7 @@ CPUDef.opCMPH = function() /** * op=0xBD (CMP L) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opCMPL = function() { @@ -2111,7 +2111,7 @@ CPUDef.opCMPL = function() /** * op=0xBE (CMP M) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opCMPM = function() { @@ -2122,7 +2122,7 @@ CPUDef.opCMPM = function() /** * op=0xBF (CMP A) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opCMPA = function() { @@ -2133,7 +2133,7 @@ CPUDef.opCMPA = function() /** * op=0xC0 (RNZ) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opRNZ = function() { @@ -2147,7 +2147,7 @@ CPUDef.opRNZ = function() /** * op=0xC1 (POP B) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opPOPB = function() { @@ -2158,7 +2158,7 @@ CPUDef.opPOPB = function() /** * op=0xC2 (JNZ a16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opJNZ = function() { @@ -2170,7 +2170,7 @@ CPUDef.opJNZ = function() /** * op=0xC3 (JMP a16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opJMP = function() { @@ -2181,7 +2181,7 @@ CPUDef.opJMP = function() /** * op=0xC4 (CNZ a16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opCNZ = function() { @@ -2197,7 +2197,7 @@ CPUDef.opCNZ = function() /** * op=0xC5 (PUSH B) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opPUSHB = function() { @@ -2208,7 +2208,7 @@ CPUDef.opPUSHB = function() /** * op=0xC6 (ADI d8) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opADI = function() { @@ -2219,7 +2219,7 @@ CPUDef.opADI = function() /** * op=0xC7 (RST 0) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opRST0 = function() { @@ -2231,7 +2231,7 @@ CPUDef.opRST0 = function() /** * op=0xC8 (RZ) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opRZ = function() { @@ -2245,7 +2245,7 @@ CPUDef.opRZ = function() /** * op=0xC9 (RET) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opRET = function() { @@ -2256,7 +2256,7 @@ CPUDef.opRET = function() /** * op=0xCA (JZ a16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opJZ = function() { @@ -2268,7 +2268,7 @@ CPUDef.opJZ = function() /** * op=0xCC (CZ a16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opCZ = function() { @@ -2284,7 +2284,7 @@ CPUDef.opCZ = function() /** * op=0xCD (CALL a16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opCALL = function() { @@ -2297,7 +2297,7 @@ CPUDef.opCALL = function() /** * op=0xCE (ACI d8) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opACI = function() { @@ -2308,7 +2308,7 @@ CPUDef.opACI = function() /** * op=0xCF (RST 1) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opRST1 = function() { @@ -2320,7 +2320,7 @@ CPUDef.opRST1 = function() /** * op=0xD0 (RNC) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opRNC = function() { @@ -2334,7 +2334,7 @@ CPUDef.opRNC = function() /** * op=0xD1 (POP D) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opPOPD = function() { @@ -2345,7 +2345,7 @@ CPUDef.opPOPD = function() /** * op=0xD2 (JNC a16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opJNC = function() { @@ -2357,7 +2357,7 @@ CPUDef.opJNC = function() /** * op=0xD3 (OUT d8) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opOUT = function() { @@ -2369,7 +2369,7 @@ CPUDef.opOUT = function() /** * op=0xD4 (CNC a16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opCNC = function() { @@ -2385,7 +2385,7 @@ CPUDef.opCNC = function() /** * op=0xD5 (PUSH D) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opPUSHD = function() { @@ -2396,7 +2396,7 @@ CPUDef.opPUSHD = function() /** * op=0xD6 (SUI d8) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opSUI = function() { @@ -2407,7 +2407,7 @@ CPUDef.opSUI = function() /** * op=0xD7 (RST 2) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opRST2 = function() { @@ -2419,7 +2419,7 @@ CPUDef.opRST2 = function() /** * op=0xD8 (RC) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opRC = function() { @@ -2433,7 +2433,7 @@ CPUDef.opRC = function() /** * op=0xDA (JC a16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opJC = function() { @@ -2445,7 +2445,7 @@ CPUDef.opJC = function() /** * op=0xDB (IN d8) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opIN = function() { @@ -2457,7 +2457,7 @@ CPUDef.opIN = function() /** * op=0xDC (CC a16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opCC = function() { @@ -2473,7 +2473,7 @@ CPUDef.opCC = function() /** * op=0xDE (SBI d8) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opSBI = function() { @@ -2484,7 +2484,7 @@ CPUDef.opSBI = function() /** * op=0xDF (RST 3) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opRST3 = function() { @@ -2496,7 +2496,7 @@ CPUDef.opRST3 = function() /** * op=0xE0 (RPO) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opRPO = function() { @@ -2510,7 +2510,7 @@ CPUDef.opRPO = function() /** * op=0xE1 (POP H) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opPOPH = function() { @@ -2521,7 +2521,7 @@ CPUDef.opPOPH = function() /** * op=0xE2 (JPO a16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opJPO = function() { @@ -2533,7 +2533,7 @@ CPUDef.opJPO = function() /** * op=0xE3 (XTHL) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opXTHL = function() { @@ -2546,7 +2546,7 @@ CPUDef.opXTHL = function() /** * op=0xE4 (CPO a16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opCPO = function() { @@ -2562,7 +2562,7 @@ CPUDef.opCPO = function() /** * op=0xE5 (PUSH H) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opPUSHH = function() { @@ -2573,7 +2573,7 @@ CPUDef.opPUSHH = function() /** * op=0xE6 (ANI d8) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opANI = function() { @@ -2584,7 +2584,7 @@ CPUDef.opANI = function() /** * op=0xE7 (RST 4) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opRST4 = function() { @@ -2596,7 +2596,7 @@ CPUDef.opRST4 = function() /** * op=0xE8 (RPE) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opRPE = function() { @@ -2610,7 +2610,7 @@ CPUDef.opRPE = function() /** * op=0xE9 (PCHL) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opPCHL = function() { @@ -2621,7 +2621,7 @@ CPUDef.opPCHL = function() /** * op=0xEA (JPE a16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opJPE = function() { @@ -2633,7 +2633,7 @@ CPUDef.opJPE = function() /** * op=0xEB (XCHG) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opXCHG = function() { @@ -2646,7 +2646,7 @@ CPUDef.opXCHG = function() /** * op=0xEC (CPE a16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opCPE = function() { @@ -2662,7 +2662,7 @@ CPUDef.opCPE = function() /** * op=0xEE (XRI d8) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opXRI = function() { @@ -2673,7 +2673,7 @@ CPUDef.opXRI = function() /** * op=0xEF (RST 5) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opRST5 = function() { @@ -2685,7 +2685,7 @@ CPUDef.opRST5 = function() /** * op=0xF0 (RP) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opRP = function() { @@ -2699,7 +2699,7 @@ CPUDef.opRP = function() /** * op=0xF1 (POP PSW) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opPOPSW = function() { @@ -2710,7 +2710,7 @@ CPUDef.opPOPSW = function() /** * op=0xF2 (JP a16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opJP = function() { @@ -2722,7 +2722,7 @@ CPUDef.opJP = function() /** * op=0xF3 (DI) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opDI = function() { @@ -2733,7 +2733,7 @@ CPUDef.opDI = function() /** * op=0xF4 (CP a16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opCP = function() { @@ -2749,7 +2749,7 @@ CPUDef.opCP = function() /** * op=0xF5 (PUSH PSW) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opPUPSW = function() { @@ -2760,7 +2760,7 @@ CPUDef.opPUPSW = function() /** * op=0xF6 (ORI d8) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opORI = function() { @@ -2771,7 +2771,7 @@ CPUDef.opORI = function() /** * op=0xF7 (RST 6) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opRST6 = function() { @@ -2783,7 +2783,7 @@ CPUDef.opRST6 = function() /** * op=0xF8 (RM) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opRM = function() { @@ -2797,7 +2797,7 @@ CPUDef.opRM = function() /** * op=0xF9 (SPHL) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opSPHL = function() { @@ -2808,7 +2808,7 @@ CPUDef.opSPHL = function() /** * op=0xFA (JM a16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opJM = function() { @@ -2820,7 +2820,7 @@ CPUDef.opJM = function() /** * op=0xFB (EI) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opEI = function() { @@ -2831,7 +2831,7 @@ CPUDef.opEI = function() /** * op=0xFC (CM a16) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opCM = function() { @@ -2847,7 +2847,7 @@ CPUDef.opCM = function() /** * op=0xFE (CPI d8) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opCPI = function() { @@ -2858,7 +2858,7 @@ CPUDef.opCPI = function() /** * op=0xFF (RST 7) * - * @this {CPUSim} + * @this {CPUState} */ CPUDef.opRST7 = function() { diff --git a/modules/pc8080/lib/cpusim.js b/modules/pc8080/lib/cpustate.js similarity index 84% rename from modules/pc8080/lib/cpusim.js rename to modules/pc8080/lib/cpustate.js index a2cae6adb..ecf4c1514 100644 --- a/modules/pc8080/lib/cpusim.js +++ b/modules/pc8080/lib/cpustate.js @@ -44,9 +44,9 @@ if (NODE) { } /** - * CPUSim(parmsCPU) + * CPUState(parmsCPU) * - * The CPUSim class uses the following (parmsCPU) properties: + * The CPUState class uses the following (parmsCPU) properties: * * model: a number (eg, 8080) that should match one of the CPUDef.MODEL_* values * @@ -54,16 +54,16 @@ if (NODE) { * constructor, along with a default speed (cycles per second) based on the specified (or default) * CPU model number. * - * The CPUSim class was initially written to simulate a 8080 microprocessor, although over time + * The CPUState class was initially written to simulate a 8080 microprocessor, although over time * it may evolved to support other microprocessors (eg, the Zilog Z80). * * @constructor * @extends CPU * @param {Object} parmsCPU */ -function CPUSim(parmsCPU) +function CPUState(parmsCPU) { - this.model = parmsCPU['model'] || CPUDef.MODEL_8080; + this.model = +parmsCPU['model'] || CPUDef.MODEL_8080; var nCyclesDefault = 0; switch(this.model) { @@ -105,17 +105,17 @@ function CPUSim(parmsCPU) this.resetRegs(); } -Component.subclass(CPUSim, CPU); +Component.subclass(CPUState, CPU); /** * addHaltCheck(fn) * * Records a function that will be called during HLT opcode processing. * - * @this {CPUSim} + * @this {CPUState} * @param {function(number)} fn */ -CPUSim.prototype.addHaltCheck = function(fn) +CPUState.prototype.addHaltCheck = function(fn) { this.afnHalt.push(fn); }; @@ -129,9 +129,9 @@ CPUSim.prototype.addHaltCheck = function(fn) * a Closure Compiler optimization is defeated when generating the function array at run-time instead of at * compile-time. * - * @this {CPUSim} + * @this {CPUState} */ -CPUSim.prototype.initProcessor = function() +CPUState.prototype.initProcessor = function() { this.aOps = CPUDef.aOps8080; }; @@ -139,9 +139,9 @@ CPUSim.prototype.initProcessor = function() /** * reset() * - * @this {CPUSim} + * @this {CPUState} */ -CPUSim.prototype.reset = function() +CPUState.prototype.reset = function() { if (this.flags.fRunning) this.stopCPU(); this.resetRegs(); @@ -153,9 +153,9 @@ CPUSim.prototype.reset = function() /** * resetRegs() * - * @this {CPUSim} + * @this {CPUState} */ -CPUSim.prototype.resetRegs = function() +CPUState.prototype.resetRegs = function() { this.regA = 0; this.regB = 0; @@ -183,10 +183,10 @@ CPUSim.prototype.resetRegs = function() /** * setReset(addr) * - * @this {CPUSim} + * @this {CPUState} * @param {number} addr */ -CPUSim.prototype.setReset = function(addr) +CPUState.prototype.setReset = function(addr) { this.addrReset = addr; this.setPC(addr); @@ -195,10 +195,10 @@ CPUSim.prototype.setReset = function(addr) /** * getChecksum() * - * @this {CPUSim} + * @this {CPUState} * @return {number} a 32-bit summation of key elements of the current CPU state (used by the CPU checksum code) */ -CPUSim.prototype.getChecksum = function() +CPUState.prototype.getChecksum = function() { var sum = (this.regA + this.regB + this.regC + this.regD + this.regE + this.regH + this.regL)|0; sum = (sum + this.getSP() + this.getPC() + this.getPS())|0; @@ -208,12 +208,12 @@ CPUSim.prototype.getChecksum = function() /** * save() * - * This implements save support for the CPUSim component. + * This implements save support for the CPUState component. * - * @this {CPUSim} + * @this {CPUState} * @return {Object|null} */ -CPUSim.prototype.save = function() +CPUState.prototype.save = function() { var state = new State(this); state.set(0, [this.regA, this.regB, this.regC, this.regD, this.regE, this.regH, this.regL, this.getSP(), this.getPC(), this.getPS()]); @@ -225,13 +225,13 @@ CPUSim.prototype.save = function() /** * restore(data) * - * This implements restore support for the CPUSim component. + * This implements restore support for the CPUState component. * - * @this {CPUSim} + * @this {CPUState} * @param {Object} data * @return {boolean} true if restore successful, false if not */ -CPUSim.prototype.restore = function(data) +CPUState.prototype.restore = function(data) { var a = data[0]; this.regA = a[0]; @@ -254,14 +254,14 @@ CPUSim.prototype.restore = function(data) /** * setBinding(sHTMLType, sBinding, control, sValue) * - * @this {CPUSim} + * @this {CPUState} * @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea", "canvas") * @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "AX") * @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement) * @param {string} [sValue] optional data value * @return {boolean} true if binding was successful, false if unrecognized binding request */ -CPUSim.prototype.setBinding = function(sHTMLType, sBinding, control, sValue) +CPUState.prototype.setBinding = function(sHTMLType, sBinding, control, sValue) { var fBound = false; switch (sBinding) { @@ -298,10 +298,10 @@ CPUSim.prototype.setBinding = function(sHTMLType, sBinding, control, sValue) /** * getBC() * - * @this {CPUSim} + * @this {CPUState} * @return {number} */ -CPUSim.prototype.getBC = function() +CPUState.prototype.getBC = function() { return (this.regB << 8) | this.regC; }; @@ -309,10 +309,10 @@ CPUSim.prototype.getBC = function() /** * setBC(w) * - * @this {CPUSim} + * @this {CPUState} * @param {number} w */ -CPUSim.prototype.setBC = function(w) +CPUState.prototype.setBC = function(w) { this.regB = (w >> 8) & 0xff; this.regC = w & 0xff; @@ -321,10 +321,10 @@ CPUSim.prototype.setBC = function(w) /** * getDE() * - * @this {CPUSim} + * @this {CPUState} * @return {number} */ -CPUSim.prototype.getDE = function() +CPUState.prototype.getDE = function() { return (this.regD << 8) | this.regE; }; @@ -332,10 +332,10 @@ CPUSim.prototype.getDE = function() /** * setDE(w) * - * @this {CPUSim} + * @this {CPUState} * @param {number} w */ -CPUSim.prototype.setDE = function(w) +CPUState.prototype.setDE = function(w) { this.regD = (w >> 8) & 0xff; this.regE = w & 0xff; @@ -344,10 +344,10 @@ CPUSim.prototype.setDE = function(w) /** * getHL() * - * @this {CPUSim} + * @this {CPUState} * @return {number} */ -CPUSim.prototype.getHL = function() +CPUState.prototype.getHL = function() { return (this.regH << 8) | this.regL; }; @@ -355,10 +355,10 @@ CPUSim.prototype.getHL = function() /** * setHL(w) * - * @this {CPUSim} + * @this {CPUState} * @param {number} w */ -CPUSim.prototype.setHL = function(w) +CPUState.prototype.setHL = function(w) { this.regH = (w >> 8) & 0xff; this.regL = w & 0xff; @@ -367,10 +367,10 @@ CPUSim.prototype.setHL = function(w) /** * getSP() * - * @this {CPUSim} + * @this {CPUState} * @return {number} */ -CPUSim.prototype.getSP = function() +CPUState.prototype.getSP = function() { return this.regSP; }; @@ -378,10 +378,10 @@ CPUSim.prototype.getSP = function() /** * setSP(off) * - * @this {CPUSim} + * @this {CPUState} * @param {number} off */ -CPUSim.prototype.setSP = function(off) +CPUState.prototype.setSP = function(off) { this.regSP = off & 0xffff; }; @@ -389,10 +389,10 @@ CPUSim.prototype.setSP = function(off) /** * getPC() * - * @this {CPUSim} + * @this {CPUState} * @return {number} */ -CPUSim.prototype.getPC = function() +CPUState.prototype.getPC = function() { return this.regPC; }; @@ -400,11 +400,11 @@ CPUSim.prototype.getPC = function() /** * offPC() * - * @this {CPUSim} + * @this {CPUState} * @param {number} off * @return {number} */ -CPUSim.prototype.offPC = function(off) +CPUState.prototype.offPC = function(off) { return (this.regPC + off) & 0xffff; }; @@ -412,10 +412,10 @@ CPUSim.prototype.offPC = function(off) /** * setPC(off) * - * @this {CPUSim} + * @this {CPUState} * @param {number} off */ -CPUSim.prototype.setPC = function(off) +CPUState.prototype.setPC = function(off) { this.regPC = off & 0xffff; }; @@ -423,9 +423,9 @@ CPUSim.prototype.setPC = function(off) /** * clearCF() * - * @this {CPUSim} + * @this {CPUState} */ -CPUSim.prototype.clearCF = function() +CPUState.prototype.clearCF = function() { this.resultZeroCarry &= 0xff; }; @@ -433,10 +433,10 @@ CPUSim.prototype.clearCF = function() /** * getCF() * - * @this {CPUSim} + * @this {CPUState} * @return {number} 0 or 1 (CPUDef.PS.CF) */ -CPUSim.prototype.getCF = function() +CPUState.prototype.getCF = function() { return (this.resultZeroCarry & 0x100)? CPUDef.PS.CF : 0; }; @@ -444,9 +444,9 @@ CPUSim.prototype.getCF = function() /** * setCF() * - * @this {CPUSim} + * @this {CPUState} */ -CPUSim.prototype.setCF = function() +CPUState.prototype.setCF = function() { this.resultZeroCarry |= 0x100; }; @@ -454,10 +454,10 @@ CPUSim.prototype.setCF = function() /** * updateCF(CF) * - * @this {CPUSim} + * @this {CPUState} * @param {number} CF (0x000 or 0x100) */ -CPUSim.prototype.updateCF = function(CF) +CPUState.prototype.updateCF = function(CF) { this.resultZeroCarry = (this.resultZeroCarry & 0xff) | CF; }; @@ -465,9 +465,9 @@ CPUSim.prototype.updateCF = function(CF) /** * clearPF() * - * @this {CPUSim} + * @this {CPUState} */ -CPUSim.prototype.clearPF = function() +CPUState.prototype.clearPF = function() { if (this.getPF()) this.resultParitySign ^= 0x1; }; @@ -475,10 +475,10 @@ CPUSim.prototype.clearPF = function() /** * getPF() * - * @this {CPUSim} + * @this {CPUState} * @return {number} 0 or CPUDef.PS.PF */ -CPUSim.prototype.getPF = function() +CPUState.prototype.getPF = function() { return (CPUDef.PARITY[this.resultParitySign & 0xff])? CPUDef.PS.PF : 0; }; @@ -486,9 +486,9 @@ CPUSim.prototype.getPF = function() /** * setPF() * - * @this {CPUSim} + * @this {CPUState} */ -CPUSim.prototype.setPF = function() +CPUState.prototype.setPF = function() { if (!this.getPF()) this.resultParitySign ^= 0x1; }; @@ -496,9 +496,9 @@ CPUSim.prototype.setPF = function() /** * clearAF() * - * @this {CPUSim} + * @this {CPUState} */ -CPUSim.prototype.clearAF = function() +CPUState.prototype.clearAF = function() { this.resultAuxOverflow = (this.resultParitySign & 0x10) | (this.resultAuxOverflow & ~0x10); }; @@ -506,10 +506,10 @@ CPUSim.prototype.clearAF = function() /** * getAF() * - * @this {CPUSim} + * @this {CPUState} * @return {number} 0 or CPUDef.PS.AF */ -CPUSim.prototype.getAF = function() +CPUState.prototype.getAF = function() { return ((this.resultParitySign ^ this.resultAuxOverflow) & 0x10)? CPUDef.PS.AF : 0; }; @@ -517,9 +517,9 @@ CPUSim.prototype.getAF = function() /** * setAF() * - * @this {CPUSim} + * @this {CPUState} */ -CPUSim.prototype.setAF = function() +CPUState.prototype.setAF = function() { this.resultAuxOverflow = (~this.resultParitySign & 0x10) | (this.resultAuxOverflow & ~0x10); }; @@ -527,9 +527,9 @@ CPUSim.prototype.setAF = function() /** * clearZF() * - * @this {CPUSim} + * @this {CPUState} */ -CPUSim.prototype.clearZF = function() +CPUState.prototype.clearZF = function() { this.resultZeroCarry |= 0xff; }; @@ -537,10 +537,10 @@ CPUSim.prototype.clearZF = function() /** * getZF() * - * @this {CPUSim} + * @this {CPUState} * @return {number} 0 or CPUDef.PS.ZF */ -CPUSim.prototype.getZF = function() +CPUState.prototype.getZF = function() { return (this.resultZeroCarry & 0xff)? 0 : CPUDef.PS.ZF; }; @@ -548,9 +548,9 @@ CPUSim.prototype.getZF = function() /** * setZF() * - * @this {CPUSim} + * @this {CPUState} */ -CPUSim.prototype.setZF = function() +CPUState.prototype.setZF = function() { this.resultZeroCarry &= ~0xff; }; @@ -558,9 +558,9 @@ CPUSim.prototype.setZF = function() /** * clearSF() * - * @this {CPUSim} + * @this {CPUState} */ -CPUSim.prototype.clearSF = function() +CPUState.prototype.clearSF = function() { if (this.getSF()) this.resultParitySign ^= 0xc0; }; @@ -568,10 +568,10 @@ CPUSim.prototype.clearSF = function() /** * getSF() * - * @this {CPUSim} + * @this {CPUState} * @return {number} 0 or CPUDef.PS.SF */ -CPUSim.prototype.getSF = function() +CPUState.prototype.getSF = function() { return (this.resultParitySign & 0x80)? CPUDef.PS.SF : 0; }; @@ -579,9 +579,9 @@ CPUSim.prototype.getSF = function() /** * setSF() * - * @this {CPUSim} + * @this {CPUState} */ -CPUSim.prototype.setSF = function() +CPUState.prototype.setSF = function() { if (!this.getSF()) this.resultParitySign ^= 0xc0; }; @@ -589,9 +589,9 @@ CPUSim.prototype.setSF = function() /** * clearIF() * - * @this {CPUSim} + * @this {CPUState} */ -CPUSim.prototype.clearIF = function() +CPUState.prototype.clearIF = function() { this.regPS &= ~CPUDef.PS.IF; }; @@ -599,10 +599,10 @@ CPUSim.prototype.clearIF = function() /** * getIF() * - * @this {CPUSim} + * @this {CPUState} * @return {number} 0 or CPUDef.PS.IF */ -CPUSim.prototype.getIF = function() +CPUState.prototype.getIF = function() { return (this.regPS & CPUDef.PS.IF); }; @@ -610,9 +610,9 @@ CPUSim.prototype.getIF = function() /** * setIF() * - * @this {CPUSim} + * @this {CPUState} */ -CPUSim.prototype.setIF = function() +CPUState.prototype.setIF = function() { this.regPS |= CPUDef.PS.IF; }; @@ -620,10 +620,10 @@ CPUSim.prototype.setIF = function() /** * getPS() * - * @this {CPUSim} + * @this {CPUState} * @return {number} */ -CPUSim.prototype.getPS = function() +CPUState.prototype.getPS = function() { return (this.regPS & ~CPUDef.PS.RESULT) | (this.getSF() | this.getZF() | this.getAF() | this.getPF() | this.getCF()); }; @@ -631,10 +631,10 @@ CPUSim.prototype.getPS = function() /** * setPS(regPS) * - * @this {CPUSim} + * @this {CPUState} * @param {number} regPS */ -CPUSim.prototype.setPS = function(regPS) +CPUState.prototype.setPS = function(regPS) { this.resultZeroCarry = this.resultParitySign = this.resultAuxOverflow = 0; if (regPS & CPUDef.PS.CF) this.resultZeroCarry |= 0x100; @@ -649,10 +649,10 @@ CPUSim.prototype.setPS = function(regPS) /** * getPSW() * - * @this {CPUSim} + * @this {CPUState} * @return {number} */ -CPUSim.prototype.getPSW = function() +CPUState.prototype.getPSW = function() { return (this.getPS() & CPUDef.PS.MASK) | (this.regA << 8); }; @@ -660,10 +660,10 @@ CPUSim.prototype.getPSW = function() /** * setPSW(w) * - * @this {CPUSim} + * @this {CPUState} * @param {number} w */ -CPUSim.prototype.setPSW = function(w) +CPUState.prototype.setPSW = function(w) { this.setPS((w & CPUDef.PS.MASK) | (this.regPS & ~CPUDef.PS.MASK)); this.regA = w >> 8; @@ -672,11 +672,11 @@ CPUSim.prototype.setPSW = function(w) /** * addByte(src) * - * @this {CPUSim} + * @this {CPUState} * @param {number} src * @return {number} regA + src */ -CPUSim.prototype.addByte = function(src) +CPUState.prototype.addByte = function(src) { this.resultAuxOverflow = this.regA ^ src; return this.resultParitySign = (this.resultZeroCarry = this.regA + src) & 0xff; @@ -685,11 +685,11 @@ CPUSim.prototype.addByte = function(src) /** * addByteCarry(src) * - * @this {CPUSim} + * @this {CPUState} * @param {number} src * @return {number} regA + src + carry */ -CPUSim.prototype.addByteCarry = function(src) +CPUState.prototype.addByteCarry = function(src) { this.resultAuxOverflow = this.regA ^ src; return this.resultParitySign = (this.resultZeroCarry = this.regA + src + ((this.resultZeroCarry & 0x100)? 1 : 0)) & 0xff; @@ -701,11 +701,11 @@ CPUSim.prototype.addByteCarry = function(src) * Ordinarily, one would expect the Auxiliary Carry flag (AF) to be clear after this operation, * but apparently the 8080 will set AF if bit 3 in either operand is set. * - * @this {CPUSim} + * @this {CPUState} * @param {number} src * @return {number} regA & src */ -CPUSim.prototype.andByte = function(src) +CPUState.prototype.andByte = function(src) { this.resultZeroCarry = this.resultParitySign = this.resultAuxOverflow = this.regA & src; if ((this.regA | src) & 0x8) this.resultAuxOverflow ^= 0x10; // set AF by inverting bit 4 in resultAuxOverflow @@ -718,11 +718,11 @@ CPUSim.prototype.andByte = function(src) * We perform this operation using 8-bit two's complement arithmetic, by negating and then adding * the implied src of 1. This appears to mimic how the 8080 manages the Auxiliary Carry flag (AF). * - * @this {CPUSim} + * @this {CPUState} * @param {number} b * @return {number} */ -CPUSim.prototype.decByte = function(b) +CPUState.prototype.decByte = function(b) { this.resultAuxOverflow = b ^ 0xff; b = this.resultParitySign = (b + 0xff) & 0xff; @@ -733,11 +733,11 @@ CPUSim.prototype.decByte = function(b) /** * incByte(b) * - * @this {CPUSim} + * @this {CPUState} * @param {number} b * @return {number} */ -CPUSim.prototype.incByte = function(b) +CPUState.prototype.incByte = function(b) { this.resultAuxOverflow = b; b = this.resultParitySign = (b + 1) & 0xff; @@ -748,11 +748,11 @@ CPUSim.prototype.incByte = function(b) /** * orByte(src) * - * @this {CPUSim} + * @this {CPUState} * @param {number} src * @return {number} regA | src */ -CPUSim.prototype.orByte = function(src) +CPUState.prototype.orByte = function(src) { return this.resultParitySign = this.resultZeroCarry = this.resultAuxOverflow = this.regA | src; }; @@ -787,11 +787,11 @@ CPUSim.prototype.orByte = function(src) * --------- * 1 0101 0110 (0x56) * - * @this {CPUSim} + * @this {CPUState} * @param {number} src * @return {number} regA - src */ -CPUSim.prototype.subByte = function(src) +CPUState.prototype.subByte = function(src) { src ^= 0xff; this.resultAuxOverflow = this.regA ^ src; @@ -808,11 +808,11 @@ CPUSim.prototype.subByte = function(src) * This mimics the behavior of subByte() when the Carry flag (CF) is clear, and hopefully also mimics how the * 8080 manages the Auxiliary Carry flag (AF) when the Carry flag (CF) is set. * - * @this {CPUSim} + * @this {CPUState} * @param {number} src * @return {number} regA - src - carry */ -CPUSim.prototype.subByteBorrow = function(src) +CPUState.prototype.subByteBorrow = function(src) { src ^= 0xff; this.resultAuxOverflow = this.regA ^ src; @@ -822,11 +822,11 @@ CPUSim.prototype.subByteBorrow = function(src) /** * xorByte(src) * - * @this {CPUSim} + * @this {CPUState} * @param {number} src * @return {number} regA ^ src */ -CPUSim.prototype.xorByte = function(src) +CPUState.prototype.xorByte = function(src) { return this.resultParitySign = this.resultZeroCarry = this.resultAuxOverflow = this.regA ^ src; }; @@ -834,11 +834,11 @@ CPUSim.prototype.xorByte = function(src) /** * getByte(addr) * - * @this {CPUSim} + * @this {CPUState} * @param {number} addr is a linear address * @return {number} byte (8-bit) value at that address */ -CPUSim.prototype.getByte = function(addr) +CPUState.prototype.getByte = function(addr) { return this.bus.getByte(addr); }; @@ -846,11 +846,11 @@ CPUSim.prototype.getByte = function(addr) /** * getWord(addr) * - * @this {CPUSim} + * @this {CPUState} * @param {number} addr is a linear address * @return {number} word (16-bit) value at that address */ -CPUSim.prototype.getWord = function(addr) +CPUState.prototype.getWord = function(addr) { return this.bus.getShort(addr); }; @@ -858,11 +858,11 @@ CPUSim.prototype.getWord = function(addr) /** * setByte(addr, b) * - * @this {CPUSim} + * @this {CPUState} * @param {number} addr is a linear address * @param {number} b is the byte (8-bit) value to write (which we truncate to 8 bits; required by opSTOSb) */ -CPUSim.prototype.setByte = function(addr, b) +CPUState.prototype.setByte = function(addr, b) { this.bus.setByte(addr, b); }; @@ -870,11 +870,11 @@ CPUSim.prototype.setByte = function(addr, b) /** * setWord(addr, w) * - * @this {CPUSim} + * @this {CPUState} * @param {number} addr is a linear address * @param {number} w is the word (16-bit) value to write (which we truncate to 16 bits to be safe) */ -CPUSim.prototype.setWord = function(addr, w) +CPUState.prototype.setWord = function(addr, w) { this.bus.setShort(addr, w); }; @@ -882,10 +882,10 @@ CPUSim.prototype.setWord = function(addr, w) /** * getPCByte() * - * @this {CPUSim} + * @this {CPUState} * @return {number} byte at the current PC; PC advanced by 1 */ -CPUSim.prototype.getPCByte = function() +CPUState.prototype.getPCByte = function() { var b = this.getByte(this.regPC); this.setPC(this.regPC + 1); @@ -895,10 +895,10 @@ CPUSim.prototype.getPCByte = function() /** * getPCWord() * - * @this {CPUSim} + * @this {CPUState} * @return {number} word at the current PC; PC advanced by 2 */ -CPUSim.prototype.getPCWord = function() +CPUState.prototype.getPCWord = function() { var w = this.getWord(this.regPC); this.setPC(this.regPC + 2); @@ -908,10 +908,10 @@ CPUSim.prototype.getPCWord = function() /** * popWord() * - * @this {CPUSim} + * @this {CPUState} * @return {number} word popped from the current SP; SP increased by 2 */ -CPUSim.prototype.popWord = function() +CPUState.prototype.popWord = function() { var w = this.getWord(this.regSP); this.setSP(this.regSP + 2); @@ -921,10 +921,10 @@ CPUSim.prototype.popWord = function() /** * pushWord(w) * - * @this {CPUSim} + * @this {CPUState} * @param {number} w is the word (16-bit) value to push at current SP; SP decreased by 2 */ -CPUSim.prototype.pushWord = function(w) +CPUState.prototype.pushWord = function(w) { this.setSP(this.regSP - 2); this.setWord(this.regSP, w); @@ -933,10 +933,10 @@ CPUSim.prototype.pushWord = function(w) /** * checkINTR() * - * @this {CPUSim} + * @this {CPUState} * @return {boolean} true if h/w interrupt has just been acknowledged, false if not */ -CPUSim.prototype.checkINTR = function() +CPUState.prototype.checkINTR = function() { if ((this.intFlags & CPUDef.INTFLAG.INTR) && this.getIF()) { var bRST = CPUDef.OPCODE.RST0 | ((this.intFlags & CPUDef.INTFLAG.INTL) << 3); @@ -951,9 +951,9 @@ CPUSim.prototype.checkINTR = function() /** * clearINTR() * - * @this {CPUSim} + * @this {CPUState} */ -CPUSim.prototype.clearINTR = function() +CPUState.prototype.clearINTR = function() { this.intFlags &= ~(CPUDef.INTFLAG.INTL | CPUDef.INTFLAG.INTR); }; @@ -973,10 +973,10 @@ CPUSim.prototype.clearINTR = function() * setIF() finally occurs, that interrupt is propagated to intFlags. But for now, we're going to assume that * scenario is rare. * - * @this {CPUSim} + * @this {CPUState} * @param {number} nLevel (0-7) */ -CPUSim.prototype.requestINTR = function(nLevel) +CPUState.prototype.requestINTR = function(nLevel) { this.intFlags = (this.intFlags & ~CPUDef.INTFLAG.INTL) | nLevel | CPUDef.INTFLAG.INTR; }; @@ -988,12 +988,12 @@ CPUSim.prototype.requestINTR = function(nLevel) * CPU type before passing the call to displayValue(); in the "old days", updateStatus() called * displayValue() directly (although then it was called displayReg()). * - * @this {CPUSim} + * @this {CPUState} * @param {string} sReg * @param {number} nValue * @param {number} [cch] (default is 2 hex digits) */ -CPUSim.prototype.updateReg = function(sReg, nValue, cch) +CPUState.prototype.updateReg = function(sReg, nValue, cch) { this.displayValue(sReg, nValue, cch || 2); }; @@ -1007,10 +1007,10 @@ CPUSim.prototype.updateReg = function(sReg, nValue, cch) * Any high-frequency updates should be performed in updateVideo(), which should avoid DOM updates, since updateVideo() * can be called up to 60 times per second (see VIDEO_UPDATES_PER_SECOND). * - * @this {CPUSim} + * @this {CPUState} * @param {boolean} [fForce] (true will display registers even if the CPU is running and "live" registers are not enabled) */ -CPUSim.prototype.updateStatus = function(fForce) +CPUState.prototype.updateStatus = function(fForce) { if (this.cLiveRegs) { if (fForce || !this.flags.fRunning || this.flags.fDisplayLiveRegs) { @@ -1052,13 +1052,13 @@ CPUSim.prototype.updateStatus = function(fForce) * As a result, the Debugger's complete independence means you can run other 8086/8088 debuggers * (eg, DEBUG) inside the simulation without interference; you can even "debug" them with the Debugger. * - * @this {CPUSim} + * @this {CPUState} * @param {number} nMinCycles (0 implies a single-step, and therefore breakpoints should be ignored) * @return {number} of cycles executed; 0 indicates a pre-execution condition (ie, an execution breakpoint * was hit), -1 indicates a post-execution condition (eg, a read or write breakpoint was hit), and a positive * number indicates successful completion of that many cycles (which should always be >= nMinCycles). */ -CPUSim.prototype.stepCPU = function(nMinCycles) +CPUState.prototype.stepCPU = function(nMinCycles) { /* * The Debugger uses fComplete to determine if the instruction completed (true) or was interrupted @@ -1143,21 +1143,21 @@ CPUSim.prototype.stepCPU = function(nMinCycles) }; /** - * CPUSim.init() + * CPUState.init() * * This function operates on every HTML element of class "cpu", extracting the - * JSON-encoded parameters for the CPUSim constructor from the element's "data-value" + * JSON-encoded parameters for the CPUState constructor from the element's "data-value" * attribute, invoking the constructor (which in turn invokes the CPU constructor) - * to create a CPUSim component, and then binding any associated HTML controls to the + * to create a CPUState component, and then binding any associated HTML controls to the * new component. */ -CPUSim.init = function() +CPUState.init = function() { var aeCPUs = Component.getElementsByClass(document, PCJSCLASS, "cpu"); for (var iCPU = 0; iCPU < aeCPUs.length; iCPU++) { var eCPU = aeCPUs[iCPU]; var parmsCPU = Component.getComponentParms(eCPU); - var cpu = new CPUSim(parmsCPU); + var cpu = new CPUState(parmsCPU); Component.bindComponentControls(cpu, eCPU, PCJSCLASS); } }; @@ -1165,6 +1165,6 @@ CPUSim.init = function() /* * Initialize every CPU module on the page */ -web.onInit(CPUSim.init); +web.onInit(CPUState.init); -if (NODE) module.exports = CPUSim; +if (NODE) module.exports = CPUState; diff --git a/modules/pc8080/lib/debugger.js b/modules/pc8080/lib/debugger.js index 7ca601724..62cd7934d 100644 --- a/modules/pc8080/lib/debugger.js +++ b/modules/pc8080/lib/debugger.js @@ -709,7 +709,7 @@ if (DEBUGGER) { * @this {Debugger} * @param {Computer} cmp * @param {Bus} bus - * @param {CPUSim} cpu + * @param {CPUState} cpu * @param {Debugger} dbg */ Debugger.prototype.initBus = function(cmp, bus, cpu, dbg) diff --git a/modules/pc8080/lib/keyboard.js b/modules/pc8080/lib/keyboard.js index 78914485e..acb4a498e 100644 --- a/modules/pc8080/lib/keyboard.js +++ b/modules/pc8080/lib/keyboard.js @@ -210,6 +210,143 @@ Keyboard.STUPID_KEYCODES[Keyboard.KEYCODE.RBRACK] = Keyboard.ASCII[']']; // 2 Keyboard.STUPID_KEYCODES[Keyboard.KEYCODE.QUOTE] = Keyboard.ASCII["'"]; // 222 -> 39 Keyboard.STUPID_KEYCODES[Keyboard.KEYCODE.FF_DASH] = Keyboard.ASCII['-']; +/** + * setBinding(sHTMLType, sBinding, control, sValue) + * + * @this {Keyboard} + * @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea", "canvas") + * @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "esc") + * @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement) + * @param {string} [sValue] optional data value + * @return {boolean} true if binding was successful, false if unrecognized binding request + */ +Keyboard.prototype.setBinding = function(sHTMLType, sBinding, control, sValue) +{ + /* + * There's a special binding that the Video component uses ("kbd") to effectively bind its + * screen to the entire keyboard, in Video.powerUp(); ie: + * + * video.kbd.setBinding("canvas", "kbd", video.canvasScreen); + * or: + * video.kbd.setBinding("textarea", "kbd", video.textareaScreen); + * + * However, it's also possible for the keyboard XML definition to define a control that serves + * a similar purpose; eg: + * + * Kbd + * + * The latter is purely experimental, while we work on finding ways to trigger the soft keyboard on + * certain pesky devices (like the Kindle Fire). Note that even if you use the latter, the former will + * still be enabled (there's currently no way to configure the Video component to not bind its screen, + * but we could certainly add one if the need ever arose). + */ + var kbd = this; + var id = sHTMLType + '-' + sBinding; + + if (this.bindings[id] === undefined) { + switch (sBinding) { + case "kbd": + /* + * Recording the binding ID prevents multiple controls (or components) from attempting to erroneously + * bind a control to the same ID, but in the case of a "dual display" configuration, we actually want + * to allow BOTH video components to call setBinding() for "kbd", so that it doesn't matter which + * display the user gives focus to. + * + * this.bindings[id] = control; + */ + control.onkeydown = function onKeyDown(event) { + return kbd.onKeyDown(event, true); + }; + control.onkeypress = function onKeyPressKbd(event) { + return kbd.onKeyPress(event); + }; + control.onkeyup = function onKeyUp(event) { + return kbd.onKeyDown(event, false); + }; + return true; + + case "caps-lock": + this.bindings[id] = control; + control.onclick = function onClickCapsLock(event) { + if (kbd.cmp) kbd.cmp.updateFocus(); + return kbd.toggleCapsLock(); + }; + return true; + + case "num-lock": + this.bindings[id] = control; + control.onclick = function onClickNumLock(event) { + if (kbd.cmp) kbd.cmp.updateFocus(); + return kbd.toggleNumLock(); + }; + return true; + + case "scroll-lock": + this.bindings[id] = control; + control.onclick = function onClickScrollLock(event) { + if (kbd.cmp) kbd.cmp.updateFocus(); + return kbd.toggleScrollLock(); + }; + return true; + + default: + /* + * Maintain support for older button codes; eg, map button code "ctrl-c" to CLICKCODE "CTRL_C" + */ + var sCode = sBinding.toUpperCase().replace(/-/g, '_'); + if (Keyboard.CLICKCODES[sCode] !== undefined && sHTMLType == "button") { + this.bindings[id] = control; + control.onclick = function(kbd, sKey, simCode) { + return function onClickKeyboard(event) { + if (!COMPILED && kbd.messageEnabled()) kbd.printMessage(sKey + " clicked", Messages.KEYS); + if (kbd.cmp) kbd.cmp.updateFocus(); + kbd.updateShiftState(simCode, true); // future-proofing if/when any LOCK keys are added to CLICKCODES + kbd.addActiveKey(simCode, true); + }; + }(this, sCode, Keyboard.CLICKCODES[sCode]); + return true; + } + else if (Keyboard.SOFTCODES[sBinding] !== undefined) { + this.cSoftCodes++; + this.bindings[id] = control; + var fnDown = function(kbd, sKey, simCode) { + return function onMouseOrTouchDownKeyboard(event) { + kbd.addActiveKey(simCode); + }; + }(this, sBinding, Keyboard.SOFTCODES[sBinding]); + var fnUp = function (kbd, sKey, simCode) { + return function onMouseOrTouchUpKeyboard(event) { + kbd.removeActiveKey(simCode); + }; + }(this, sBinding, Keyboard.SOFTCODES[sBinding]); + if ('ontouchstart' in window) { + control.ontouchstart = fnDown; + control.ontouchend = fnUp; + } else { + control.onmousedown = fnDown; + control.onmouseup = control.onmouseout = fnUp; + } + return true; + } + else if (sValue) { + /* + * Instead of just having a dedicated "test" control, we now treat any unrecognized control with + * a data value as a test control. The only caveat is that such controls must have binding IDs that + * do not conflict with predefined controls (which, of course, is the only way you can get here). + */ + this.bindings[id] = control; + control.onclick = function onClickTest(event) { + if (kbd.cmp) kbd.cmp.updateFocus(); + return kbd.injectKeys(sValue); + }; + return true; + } + break; + } + } + return false; +}; + /** * Keyboard.init() * diff --git a/modules/pc8080/lib/memory.js b/modules/pc8080/lib/memory.js index b2d2c09c0..12510adf5 100644 --- a/modules/pc8080/lib/memory.js +++ b/modules/pc8080/lib/memory.js @@ -274,7 +274,7 @@ Memory.prototype = { * save() * * This gets the contents of a Memory block as an array of 32-bit values; used by Bus.saveMemory(), - * which in turn is called by CPUSim.save(). + * which in turn is called by CPUState.save(). * * Memory blocks with custom memory controllers do NOT save their contents; that's the responsibility * of the controller component. @@ -317,7 +317,7 @@ Memory.prototype = { * restore(adw) * * This restores the contents of a Memory block from an array of 32-bit values; - * used by Bus.restoreMemory(), which is called by CPUSim.restore(), after all other + * used by Bus.restoreMemory(), which is called by CPUState.restore(), after all other * components have been restored and thus all Memory blocks have been allocated * by their respective components. * diff --git a/modules/pc8080/lib/panel.js b/modules/pc8080/lib/panel.js index 6e6ae7606..9284c0810 100644 --- a/modules/pc8080/lib/panel.js +++ b/modules/pc8080/lib/panel.js @@ -87,7 +87,7 @@ Panel.prototype.setBinding = function(sHTMLType, sBinding, control, sValue) * @this {Panel} * @param {Computer} cmp * @param {Bus} bus - * @param {CPUSim} cpu + * @param {CPUState} cpu * @param {Debugger} dbg */ Panel.prototype.initBus = function(cmp, bus, cpu, dbg) @@ -131,7 +131,7 @@ Panel.prototype.powerDown = function(fSave, fShutdown) * * Update function for Panels containing elements with high-frequency display requirements. * - * For older (and slower) DOM-based display elements, those are sill being managed by the CPUSim component, + * For older (and slower) DOM-based display elements, those are sill being managed by the CPUState component, * so it has its own updateStatus() handler. * * The Computer's updateStatus() handler is currently responsible for calling both our handler and the CPU's handler. diff --git a/modules/pc8080/lib/ram.js b/modules/pc8080/lib/ram.js index 635ad435e..b9e6a63b3 100644 --- a/modules/pc8080/lib/ram.js +++ b/modules/pc8080/lib/ram.js @@ -74,7 +74,7 @@ Component.subclass(RAM); * @this {RAM} * @param {Computer} cmp * @param {Bus} bus - * @param {CPUSim} cpu + * @param {CPUState} cpu * @param {Debugger} dbg */ RAM.prototype.initBus = function(cmp, bus, cpu, dbg) @@ -97,7 +97,7 @@ RAM.prototype.powerUp = function(data, fRepower) { if (!fRepower) { /* - * The Computer powers up the CPU last, at which point CPUSim state is restored, + * The Computer powers up the CPU last, at which point CPUState state is restored, * which includes the Bus state, and since we use the Bus to allocate all our memory, * memory contents are already restored for us, so we don't need the usual restore * logic. We just need to call reset(), to allocate memory for the RAM. @@ -118,7 +118,7 @@ RAM.prototype.powerUp = function(data, fRepower) RAM.prototype.powerDown = function(fSave, fShutdown) { /* - * The Computer powers down the CPU first, at which point CPUSim state is saved, + * The Computer powers down the CPU first, at which point CPUState state is saved, * which includes the Bus state, and since we use the Bus component to allocate all * our memory, memory contents are already saved for us, so we don't need the usual * save logic. diff --git a/modules/pc8080/lib/rom.js b/modules/pc8080/lib/rom.js index 67f0f39b4..eee24490a 100644 --- a/modules/pc8080/lib/rom.js +++ b/modules/pc8080/lib/rom.js @@ -158,7 +158,7 @@ ROM.CPM.VECTORS = [ROM.CPM.BIOS.VECTOR, ROM.CPM.BDOS.VECTOR]; * @this {ROM} * @param {Computer} cmp * @param {Bus} bus - * @param {CPUSim} cpu + * @param {CPUState} cpu * @param {Debugger} dbg */ ROM.prototype.initBus = function(cmp, bus, cpu, dbg) diff --git a/modules/pc8080/lib/video.js b/modules/pc8080/lib/video.js index 6c9848344..621c9fb13 100644 --- a/modules/pc8080/lib/video.js +++ b/modules/pc8080/lib/video.js @@ -223,7 +223,7 @@ Video.COLORS = { * @this {Video} * @param {Computer} cmp * @param {Bus} bus - * @param {CPUSim} cpu + * @param {CPUState} cpu * @param {Debugger} dbg */ Video.prototype.initBus = function(cmp, bus, cpu, dbg) diff --git a/modules/pcjs/lib/x86cpu.js b/modules/pcjs/lib/x86cpu.js index 68a73a769..87e7eef10 100644 --- a/modules/pcjs/lib/x86cpu.js +++ b/modules/pcjs/lib/x86cpu.js @@ -49,7 +49,7 @@ if (NODE) { * * The X86CPU class uses the following (parmsCPU) properties: * - * model: a number (eg, 8088) that should match one of the X86.MODEL values (default is 8088) + * model: a string (eg, "8088") that should match one of the X86.MODEL values (default is "8088") * stepping: a string (eg, "B1") that should match one of the X86.STEPPING values (default is "") * * This extends the CPU class and passes any remaining parmsCPU properties to the CPU class @@ -82,7 +82,7 @@ if (NODE) { */ function X86CPU(parmsCPU) { - this.model = parmsCPU['model'] || X86.MODEL_8088; + this.model = +parmsCPU['model'] || X86.MODEL_8088; /* * We take the 'stepping' value, convert it to a hex value, and then add that to the model to provide diff --git a/package.json b/package.json index 1ed2feaee..c8e757eca 100644 --- a/package.json +++ b/package.json @@ -146,7 +146,7 @@ "./modules/pc8080/lib/bus.js", "./modules/pc8080/lib/memory.js", "./modules/pc8080/lib/cpu.js", - "./modules/pc8080/lib/cpusim.js", + "./modules/pc8080/lib/cpustate.js", "./modules/pc8080/lib/cpuops.js", "./modules/pc8080/lib/chipset.js", "./modules/pc8080/lib/rom.js",