Simplify subclassing
This commit is contained in:
parent
0e77c0c88a
commit
a2b06b7626
28 changed files with 579 additions and 607 deletions
|
|
@ -191,7 +191,7 @@ function Bus(parmsBus, cpu, dbg)
|
|||
this.setReady();
|
||||
}
|
||||
|
||||
Component.subclass(Component, Bus);
|
||||
Component.subclass(Bus);
|
||||
|
||||
if (BACKTRACK) {
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ function ChipSet(parmsChipSet)
|
|||
this.setReady();
|
||||
}
|
||||
|
||||
Component.subclass(Component, ChipSet);
|
||||
Component.subclass(ChipSet);
|
||||
|
||||
/*
|
||||
* Supported model numbers
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ function Computer(parmsComputer, parmsMachine, fSuspended) {
|
|||
}
|
||||
}
|
||||
|
||||
Component.subclass(Component, Computer);
|
||||
Component.subclass(Computer);
|
||||
|
||||
/*
|
||||
* NOTE: 1.01 is the first version to provide limited save/restore support using localStorage.
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ function CPU(parmsCPU, nCyclesDefault)
|
|||
this.setReady();
|
||||
}
|
||||
|
||||
Component.subclass(Component, CPU);
|
||||
Component.subclass(CPU);
|
||||
|
||||
/*
|
||||
* Constants that control the frequency at which various updates should occur.
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ function Debugger(parmsDbg)
|
|||
|
||||
if (DEBUGGER) {
|
||||
|
||||
Component.subclass(Component, Debugger);
|
||||
Component.subclass(Debugger);
|
||||
|
||||
/*
|
||||
* Information regarding interrupts of interest (used by messageInt() and others)
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ Disk.REMOTE_WRITE_DELAY = 2000; // 2-second delay
|
|||
*/
|
||||
Disk.nDisks = 0;
|
||||
|
||||
Component.subclass(Component, Disk);
|
||||
Component.subclass(Disk);
|
||||
|
||||
/**
|
||||
* initBus(cmp, bus, cpu, dbg)
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ function FDC(parmsFDC) {
|
|||
*/
|
||||
}
|
||||
|
||||
Component.subclass(Component, FDC);
|
||||
Component.subclass(FDC);
|
||||
|
||||
FDC.DEFAULT_DRIVE_NAME = "Floppy Drive";
|
||||
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ function HDC(parmsHDC) {
|
|||
*/
|
||||
}
|
||||
|
||||
Component.subclass(Component, HDC);
|
||||
Component.subclass(HDC);
|
||||
|
||||
/*
|
||||
* HDC defaults, in case drive parameters weren't specified
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ function Keyboard(parmsKbd)
|
|||
this.setReady();
|
||||
}
|
||||
|
||||
Component.subclass(Component, Keyboard);
|
||||
Component.subclass(Keyboard);
|
||||
|
||||
/**
|
||||
* Alphanumeric and other common (printable) ASCII codes.
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -158,7 +158,7 @@ function Mouse(parmsMouse)
|
|||
* synchronize with the mouse.
|
||||
*/
|
||||
|
||||
Component.subclass(Component, Mouse);
|
||||
Component.subclass(Mouse);
|
||||
|
||||
Mouse.ID_SERIAL = 0x4D;
|
||||
|
||||
|
|
@ -267,9 +267,10 @@ Mouse.prototype.powerUp = function(data, fRepower)
|
|||
*
|
||||
* @this {Mouse}
|
||||
* @param {boolean} fSave
|
||||
* @return {Object|boolean}
|
||||
* @param {boolean} [fShutdown]
|
||||
* @return {Object|boolean} component state if fSave; otherwise, true if successful, false if failure
|
||||
*/
|
||||
Mouse.prototype.powerDown = function(fSave)
|
||||
Mouse.prototype.powerDown = function(fSave, fShutdown)
|
||||
{
|
||||
return fSave && this.save? this.save() : true;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -49,8 +49,10 @@ if (typeof module !== 'undefined') {
|
|||
* @extends Component
|
||||
* @param {Object} parmsPanel
|
||||
*/
|
||||
function Panel(parmsPanel) {
|
||||
function Panel(parmsPanel)
|
||||
{
|
||||
Component.call(this, "Panel", parmsPanel, Panel);
|
||||
|
||||
this.canvas = null;
|
||||
this.lockMouse = -1;
|
||||
this.fMouseDown = false;
|
||||
|
|
@ -61,7 +63,7 @@ function Panel(parmsPanel) {
|
|||
}
|
||||
}
|
||||
|
||||
Component.subclass(Component, Panel);
|
||||
Component.subclass(Panel);
|
||||
|
||||
/*
|
||||
* The "Live" canvases that we create internally have the following fixed dimensions, to make drawing
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ function RAM(parmsRAM)
|
|||
this.fAllocated = false;
|
||||
}
|
||||
|
||||
Component.subclass(Component, RAM);
|
||||
Component.subclass(RAM);
|
||||
|
||||
/**
|
||||
* initBus(cmp, bus, cpu, dbg)
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ function ROM(parmsROM)
|
|||
}
|
||||
}
|
||||
|
||||
Component.subclass(Component, ROM);
|
||||
Component.subclass(ROM);
|
||||
|
||||
/*
|
||||
* ROM BIOS Data Area (RBDA) definitions, in physical address form, using the same ALL-CAPS names
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ function SerialPort(parmsSerial) {
|
|||
* for third-party apps.
|
||||
*/
|
||||
|
||||
Component.subclass(Component, SerialPort);
|
||||
Component.subclass(SerialPort);
|
||||
|
||||
/*
|
||||
* Internal name used for the I/O buffer control, if any, that we bind to the SerialPort.
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ function Video(parmsVideo, canvas, context, textarea, container)
|
|||
}
|
||||
}
|
||||
|
||||
Component.subclass(Component, Video);
|
||||
Component.subclass(Video);
|
||||
|
||||
Video.TRAPALL = true; // monitor all I/O by default (not just deltas)
|
||||
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ function X86CPU(parmsCPU) {
|
|||
this.resetRegs();
|
||||
}
|
||||
|
||||
Component.subclass(CPU, X86CPU);
|
||||
Component.subclass(X86CPU, CPU);
|
||||
|
||||
X86CPU.CYCLES_8088 = {
|
||||
nWordCyclePenalty: 4, // NOTE: accurate for the 8088/80188 only (on the 8086/80186, it applies to odd addresses only)
|
||||
|
|
|
|||
Loading…
Reference in a new issue