diff --git a/modules/pc8080/lib/cpu.js b/modules/pc8080/lib/cpu.js index 1613ba40f..d25d29e6d 100644 --- a/modules/pc8080/lib/cpu.js +++ b/modules/pc8080/lib/cpu.js @@ -969,21 +969,7 @@ CPU.prototype.runCPU = function(fUpdateFocus) * nCyclesPerBurst is how many cycles we WANT to run on each iteration of stepCPU(), but it may run * significantly less (or slightly more, since we can't execute partial instructions). */ - try { - this.stepCPU(nCyclesPerBurst); - } - catch(exception) { - if (typeof exception != "number") throw exception; - if (MAXDEBUG) this.println("CPU exception " + str.toHexByte(exception)); - /* - * TODO: If we ever get into a situation where every single instruction is generating a fault - * (eg, if an 8088 executes opcode 0xFF 0xFF, which is incorrectly routed to helpFault() instead - * of fnGRPUndefined()), the browser may hang because we're failing to yield often enough. - * This is likely because the thrown exceptions are taking MUCH longer than normal instructions, - * throwing off our burst calculations. We need to either adjust the burst or break out of the - * DO-WHILE loop on every exception. - */ - } + this.stepCPU(nCyclesPerBurst); /* * nBurstCycles, less any remaining nStepCycles, is how many cycles stepCPU() ACTUALLY ran (nCycles). diff --git a/modules/pc8080/lib/nodebugger.js b/modules/pc8080/lib/nodebugger.js new file mode 100644 index 000000000..1fd18747d --- /dev/null +++ b/modules/pc8080/lib/nodebugger.js @@ -0,0 +1,47 @@ +/** + * @fileoverview Compile-time definitions for Debugger-less configurations. + * @author Jeff Parsons + * @version 1.0 + * Created 2016-May-12 + * + * Copyright © 2012-2016 Jeff Parsons + * + * This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines) + * at and . + * + * PCjs is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with PCjs. If not, + * see . + * + * You are required to include the above copyright notice in every source code file of every + * copy or modified version of this work, and to display that copyright notice on every screen + * that loads or runs any version of this software (see Computer.COPYRIGHT). + * + * Some PCjs files also attempt to load external resource files, such as character-image files, + * ROM files, and disk image files. Those external resource files are not considered part of the + * PCjs program for purposes of the GNU General Public License, and the author does not claim + * any copyright as to their contents. + */ + +"use strict"; + +/* + * WARNING: DEBUGGER needs to accurately reflect whether or not the Debugger component is (or will be) loaded. + * In the compiled case, we rely on the Closure Compiler to override DEBUGGER as appropriate. When it's *false*, + * nearly all of debugger.js will be conditionally removed by the compiler, reducing it to little more than a + * "type skeleton", which also solves some type-related warnings we would otherwise have if we tried to remove + * debugger.js from the compilation process altogether. + * + * However, when we're in "development mode" and running uncompiled code in debugger-less configurations, + * I would still like to skip loading debugger.js altogether. To do that, we must arrange for this additional file, + * nodebugger.js, to be loaded immediately after defines.js, *explicitly* overriding the previously defined value + * of DEBUGGER with *false*. + */ +DEBUGGER = false;