Since "model" properties are strings now, they need to be coerced to numbers

This commit is contained in:
Jeff 2016-05-14 19:00:13 -07:00 committed by Jeff Parsons
commit bc7ec763ca
19 changed files with 572 additions and 435 deletions

View file

@ -61,7 +61,7 @@ function ChipSet(parmsChipSet)
var model = parmsChipSet['model'];
/*
* this.model is a numeric version of the 'model' string; when comparing this.model to standard IBM
* this.model is a numeric version of the 'model' string; when comparing this.model to "base"
* model numbers, you should generally compare (this.model|0) to the target value, which truncates it.
*/
if (model && !ChipSet.MODELS[model]) {
@ -111,29 +111,29 @@ ChipSet.SI_1978 = {
PORT: 0,
DIP4: 0x01, // self-test request at power up?
ALWAYS_SET: 0x0E, // always set
FIRE: 0x10, // fire
LEFT: 0x20, // move left
RIGHT: 0x40, // move right
PORT7: 0x80 // some connection to port 7?
FIRE: 0x10, // 1 = fire
LEFT: 0x20, // 1 = move left
RIGHT: 0x40, // 1 = move right
PORT7: 0x80 // some connection to (undocumented) port 7
},
STATUS1: {
PORT: 1,
CREDIT: 0x01, // credit
P1: 0x02, // 1P start
P2: 0x04, // 2P start
CREDIT: 0x01, // credit (coin slot)
P2: 0x02, // 1 = 2P start
P1: 0x04, // 1 = 1P start
ALWAYS_SET: 0x08, // always set
P1_FIRE: 0x10, // P1 fire (cocktail machines only?)
P1_LEFT: 0x20, // P1 left (cocktail machines only?)
P1_RIGHT: 0x40 // P1 right (cocktail machines only?)
P1_FIRE: 0x10, // 1 = P1 fire (cocktail machines only?)
P1_LEFT: 0x20, // 1 = P1 left (cocktail machines only?)
P1_RIGHT: 0x40 // 1 = P1 right (cocktail machines only?)
},
STATUS2: {
PORT: 2,
DIP3_5: 0x03, // 00 = 3 ships, 01 = 4 ships, 10 = 5 ships, 11 = 6 ships
TILT: 0x04,
TILT: 0x04, // 1 = tilt detected
DIP6: 0x08, // 0 = extra ship at 1500, 1 = extra ship at 1000
P2_FIRE: 0x10, // P2 fire (cocktail machines only?)
P2_LEFT: 0x20, // P2 left (cocktail machines only?)
P2_RIGHT: 0x40, // P2 right (cocktail machines only?)
P2_FIRE: 0x10, // 1 = P2 fire (cocktail machines only?)
P2_LEFT: 0x20, // 1 = P2 left (cocktail machines only?)
P2_RIGHT: 0x40, // 1 = P2 right (cocktail machines only?)
DIP7: 0x80 // 0 = display coin info on demo ("attract") screen
},
SHIFT_RESULT: { // bits 0-7 of barrel shifter result
@ -218,7 +218,7 @@ ChipSet.prototype.setBinding = function(sHTMLType, sBinding, control, sValue)
* @this {ChipSet}
* @param {Computer} cmp
* @param {Bus} bus
* @param {CPUSim} cpu
* @param {CPUState} cpu
* @param {Debugger} dbg
*/
ChipSet.prototype.initBus = function(cmp, bus, cpu, dbg)