First stab at factoring some common Debugger functionality into a shared component

This commit is contained in:
Jeff Parsons 2016-09-14 15:36:38 -07:00
commit a8bb0c7841
42 changed files with 3721 additions and 4457 deletions

View file

@ -68,7 +68,7 @@ if (NODE) {
* @extends Component
* @param {Object} parmsBus
* @param {CPUState} cpu
* @param {Debugger} dbg
* @param {Debugger6502} dbg
*/
function Bus(parmsBus, cpu, dbg)
{

View file

@ -152,7 +152,7 @@ function Computer(parmsComputer, parmsMachine, fSuspended) {
Component.error("Unable to find CPU component");
return;
}
this.dbg = /** @type {Debugger} */ (Component.getComponentByType("Debugger", this.id));
this.dbg = /** @type {Debugger6502} */ (Component.getComponentByType("Debugger", this.id));
/*
* Enumerate all Video components for future updateVideo() calls.

View file

@ -160,7 +160,7 @@ CPU.BUTTONS = ["power", "reset"];
* @param {Computer} cmp
* @param {Bus} bus
* @param {CPU} cpu
* @param {Debugger} dbg
* @param {Debugger6502} dbg
*/
CPU.prototype.initBus = function(cmp, bus, cpu, dbg)
{

File diff suppressed because it is too large Load diff

View file

@ -34,7 +34,12 @@
/**
* @define {string}
*/
var APPCLASS = "pc8080"; // this @define is the default application class (formerly APPCLASS) to use
var APPCLASS = "pc6502"; // this @define is the default application class (eg, "pcx86", "c1pjs")
/**
* @define {string}
*/
var APPNAME = "PC6502"; // this @define is the default application name (eg, "PCx86", "C1Pjs")
/**
* @define {boolean}
@ -69,6 +74,26 @@ var BYTEARRAYS = false;
*/
var TYPEDARRAYS = (typeof ArrayBuffer !== 'undefined');
/*
* Combine all the shared globals and machine-specific globals into one machine-specific global object,
* which all machine components should start using; eg: "if (PCX86.DEBUG) ..." instead of "if (DEBUG) ...".
*/
var PC6502 = {
APPCLASS: APPCLASS,
APPNAME: APPNAME,
APPVERSION: APPVERSION, // shared
BYTEARRAYS: BYTEARRAYS,
COMPILED: COMPILED, // shared
CSSCLASS: CSSCLASS, // shared
DEBUG: DEBUG, // shared
DEBUGGER: DEBUGGER,
MAXDEBUG: MAXDEBUG, // shared
PRIVATE: PRIVATE, // shared
TYPEDARRAYS: TYPEDARRAYS,
SITEHOST: SITEHOST, // shared
XMLVERSION: XMLVERSION // shared
};
if (NODE) {
global.APPCLASS = APPCLASS;
global.DEBUGGER = DEBUGGER;

View file

@ -237,7 +237,7 @@ Memory.prototype = {
* @this {Memory}
* @param {Memory} mem
* @param {number} [type]
* @param {Debugger} [dbg]
* @param {Debugger6502} [dbg]
*/
clone: function(mem, type, dbg) {
/*
@ -485,7 +485,7 @@ Memory.prototype = {
* copyBreakpoints(dbg, mem)
*
* @this {Memory}
* @param {Debugger} [dbg]
* @param {Debugger6502} [dbg]
* @param {Memory} [mem] (outgoing Memory block to copy breakpoints from, if any)
*/
copyBreakpoints: function(dbg, mem) {

View file

@ -87,7 +87,7 @@ Panel.prototype.setBinding = function(sHTMLType, sBinding, control, sValue)
* @param {Computer} cmp
* @param {Bus} bus
* @param {CPUState} cpu
* @param {Debugger} dbg
* @param {Debugger6502} dbg
*/
Panel.prototype.initBus = function(cmp, bus, cpu, dbg)
{

View file

@ -74,7 +74,7 @@ Component.subclass(RAM);
* @param {Computer} cmp
* @param {Bus} bus
* @param {CPUState} cpu
* @param {Debugger} dbg
* @param {Debugger6502} dbg
*/
RAM.prototype.initBus = function(cmp, bus, cpu, dbg)
{

View file

@ -133,7 +133,7 @@ Component.subclass(ROM);
* @param {Computer} cmp
* @param {Bus} bus
* @param {CPUState} cpu
* @param {Debugger} dbg
* @param {Debugger6502} dbg
*/
ROM.prototype.initBus = function(cmp, bus, cpu, dbg)
{

View file

@ -223,7 +223,7 @@ Video.COLORS = {
* @param {Computer} cmp
* @param {Bus} bus
* @param {CPUState} cpu
* @param {Debugger} dbg
* @param {Debugger6502} dbg
*/
Video.prototype.initBus = function(cmp, bus, cpu, dbg)
{