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

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<chipset id="chipset" model="5150" sw1="01001001" sw2="11110000" pos="left" padleft="8px" padbottom="8px">
<chipset id="chipset" model="5150" sw1="01001001" sw2="11111000" pos="left" padleft="8px" padbottom="8px">
<control type="switches" label="SW1" binding="sw1" left="0px"/>
<control type="switches" label="SW2" binding="sw2" left="0px"/>
<control type="description" binding="swdesc" left="0px"/>

View file

@ -12,7 +12,7 @@
<fdc ref="/disks/pc/compiled/library.xml"/>
<keyboard ref="/devices/pc/keyboard/us83-softkeys.xml"/>
<panel ref="/devices/pc/panel/wide.xml"/>
<chipset id="chipset" model="5150" sw1="01001001" sw2="10100000" pos="left" padleft="8px" padbottom="8px">
<chipset id="chipset" model="5150" sw1="01001001" sw2="10101000" pos="left" padleft="8px" padbottom="8px">
<control type="switches" label="SW1" binding="sw1" left="0px"/>
<control type="switches" label="SW2" binding="sw2" left="0px"/>
<control type="description" binding="swdesc" left="0px"/>

View file

@ -13,5 +13,5 @@
<control type="button" binding="reset">Reset</control>
</cpu>
<keyboard ref="/devices/pc/keyboard/us83-buttons-minimal.xml"/>
<chipset id="chipset" model="5150" sw1="01001001" sw2="11110000"/>
<chipset id="chipset" model="5150" sw1="01001001" sw2="11111000"/>
</machine>

View file

@ -14,5 +14,5 @@
<control type="button" binding="reset">Reset</control>
</cpu>
<keyboard ref="/devices/pc/keyboard/us83-buttons-minimal.xml"/>
<chipset id="chipset" model="5150" sw1="01000001" sw2="11110000"/>
<chipset id="chipset" model="5150" sw1="01000001" sw2="11111000"/>
</machine>

View file

@ -12,7 +12,7 @@
<keyboard ref="/devices/pc/keyboard/us83-buttons-functions.xml"/>
<debugger id="debugger"/>
<panel ref="/devices/pc/panel/wide.xml"/>
<chipset id="chipset" model="5150" sw1="01000001" sw2="11110000" pos="left" padleft="8px" padbottom="8px">
<chipset id="chipset" model="5150" sw1="01000001" sw2="11111000" pos="left" padleft="8px" padbottom="8px">
<control type="switches" label="SW1" binding="sw1" left="0px"/>
<control type="switches" label="SW2" binding="sw2" left="0px"/>
<control type="description" binding="swdesc" left="0px"/>

View file

@ -13,5 +13,5 @@
<control type="button" binding="reset">Reset</control>
</cpu>
<keyboard ref="/devices/pc/keyboard/us83-buttons-arrows.xml"/>
<chipset id="chipset" model="5150" sw1="01000001" sw2="11110000"/>
<chipset id="chipset" model="5150" sw1="01000001" sw2="11111000"/>
</machine>

View file

@ -12,7 +12,7 @@
<keyboard ref="/devices/pc/keyboard/us83-softkeys.xml"/>
<debugger id="debugger"/>
<panel ref="/devices/pc/panel/wide.xml"/>
<chipset id="chipset" model="5150" sw1="01000001" sw2="11110000" pos="left" padleft="8px" padbottom="8px">
<chipset id="chipset" model="5150" sw1="01000001" sw2="11111000" pos="left" padleft="8px" padbottom="8px">
<control type="switches" label="SW1" binding="sw1" left="0px"/>
<control type="switches" label="SW2" binding="sw2" left="0px"/>
<control type="description" binding="swdesc" left="0px"/>

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();
}
/*