The great DIP switch rewrite (major pain in the butt, but hopefully helpful for future machines)

I think the DIP switch tables could still be simplified somewhat, but most of the hard work is done now.
This commit is contained in:
Jeff Parsons 2016-03-25 16:17:35 -07:00
commit c035b6b379
11 changed files with 495 additions and 262 deletions

File diff suppressed because it is too large Load diff

View file

@ -771,7 +771,7 @@ FDC.prototype.initController = function(data)
if (this.aDrives === undefined) {
this.nDrives = 4; // default to the maximum number of drives
if (this.chipset) this.nDrives = this.chipset.getSWFloppyDrives();
if (this.chipset) this.nDrives = this.chipset.getDIPFloppyDrives();
/*
* I would prefer to allocate only nDrives, but as discussed in the handling of the FDC.REG_DATA.CMD.SENSE_INT
* command, we're faced with situations where the controller must respond to any drive in the range 0-3, regardless
@ -789,7 +789,7 @@ FDC.prototype.initController = function(data)
* the drive's physical limits accordingly (ie, max tracks, max heads, and max sectors/track).
*/
drive = this.aDrives[iDrive] = {};
var nKb = (this.chipset? this.chipset.getSWFloppyDriveSize(iDrive) : 0);
var nKb = (this.chipset? this.chipset.getDIPFloppyDriveSize(iDrive) : 0);
switch(nKb) {
case 160:
case 180:

View file

@ -158,7 +158,7 @@ RAM.prototype.powerDown = function(fSave, fShutdown)
RAM.prototype.reset = function()
{
if (!this.addrRAM && !this.fInstalled && this.chipset) {
var baseRAM = this.chipset.getSWMemorySize() * 1024;
var baseRAM = this.chipset.getDIPMemorySize() * 1024;
if (this.sizeRAM && baseRAM != this.sizeRAM) {
this.bus.removeMemory(this.addrRAM, this.sizeRAM);
this.fAllocated = false;

View file

@ -2904,7 +2904,9 @@ Video.prototype.initBus = function(cmp, bus, cpu, dbg)
this.bEGASwitches = 0x09; // our default "switches" setting (see aEGAMonitorSwitches)
this.chipset = cmp.getMachineComponent("ChipSet");
if (this.chipset && this.sSwitches) {
if (this.nCard == Video.CARD.EGA) this.bEGASwitches = this.chipset.parseSwitches(this.sSwitches, this.bEGASwitches);
if (this.nCard == Video.CARD.EGA) {
this.bEGASwitches = this.chipset.parseDIPSwitches(this.sSwitches, this.bEGASwitches);
}
}
/*
@ -3535,7 +3537,7 @@ Video.prototype.reset = function()
* on the EGA's own switch settings instead.
*/
if (this.chipset) {
nMonitorType = this.chipset.getSWVideoMonitor();
nMonitorType = this.chipset.getDIPVideoMonitor();
}
/*