Skip to content
This repository has been archived by the owner on Dec 24, 2020. It is now read-only.

Commit

Permalink
Merge branch 'next-release'
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffpar committed Mar 26, 2018
2 parents dc95b1d + cf65025 commit e8a2152
Show file tree
Hide file tree
Showing 4 changed files with 877 additions and 856 deletions.
18 changes: 14 additions & 4 deletions modules/pcx86/lib/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -633,11 +633,18 @@ class Card extends Controller {
this.dbg.println(sName + ": " + Str.toHex(iReg, 2));
return;
}
var i, cchMax = 18, s = "";
for (i = 0; i < asRegs.length; i++) {
var i, cchMax = 17, s = "";
var nRegs = (asRegs? asRegs.length : aRegs.length);
for (i = 0; i < nRegs; i++) {
/*
* In the case of the CRTC, we call the helper function getCRTCReg() to automatically concatenate
* the extended bits of certain registers, so that we don't have to "mentally" concatenate them.
*/
var reg = (aRegs === this.regCRTData)? this.getCRTCReg(i) : aRegs[i];
if (s) s += '\n';
s += sName + "[" + Str.toHex(i, 2) + "]: " + Str.pad(asRegs[i], cchMax) + (i === iReg? '*' : ' ') + Str.toHex(reg, reg > 0xff? 4 : 2);
var sRegName = Str.pad((asRegs? asRegs[i] : sName.substr(1) + Str.toDec(i, 3)), cchMax);
var cchReg = (asRegs? (reg < 0x100? 2 : 4) : 6);
s += sName + "[" + Str.toHex(i, 2) + "]: " + sRegName + (i === iReg? '*' : ' ') + Str.toHex(reg, cchReg);
if (reg != null) s += " (" + reg + ".)";
}
this.dbg.println(s);
Expand Down Expand Up @@ -669,6 +676,9 @@ class Card extends Controller {
/*
* There are few more EGA regs we could dump, like GRCPos1, GRCPos2, but does anyone care?
*/
if (this.nCard == Video.CARD.VGA) {
this.dumpRegs(" DAC", this.regDACAddr, this.regDACData);
}
}

/*
Expand Down Expand Up @@ -3643,7 +3653,7 @@ class Video extends Component {
* we go with a default EGA-compatible 16-color palette. We'll also use the DAC if there is one
* (ie, this is actually a VGA) and it appears to be initialized (ie, the VGA BIOS has been run).
*/
var fDAC = (aDAC && aDAC[255]);
var fDAC = (aDAC && aDAC[255] != null);
aRegs = (card.regATCData[15] != null? card.regATCData : Video.aEGAPalDef);
for (i = 0; i < 16; i++) {
b = aRegs[i] & Card.ATC.PALETTE.MASK;
Expand Down
18 changes: 14 additions & 4 deletions versions/pcx86/1.61.0/pcx86-uncompiled.js
Original file line number Diff line number Diff line change
Expand Up @@ -48808,11 +48808,18 @@ class Card extends Controller {
this.dbg.println(sName + ": " + Str.toHex(iReg, 2));
return;
}
var i, cchMax = 18, s = "";
for (i = 0; i < asRegs.length; i++) {
var i, cchMax = 17, s = "";
var nRegs = (asRegs? asRegs.length : aRegs.length);
for (i = 0; i < nRegs; i++) {
/*
* In the case of the CRTC, we call the helper function getCRTCReg() to automatically concatenate
* the extended bits of certain registers, so that we don't have to "mentally" concatenate them.
*/
var reg = (aRegs === this.regCRTData)? this.getCRTCReg(i) : aRegs[i];
if (s) s += '\n';
s += sName + "[" + Str.toHex(i, 2) + "]: " + Str.pad(asRegs[i], cchMax) + (i === iReg? '*' : ' ') + Str.toHex(reg, reg > 0xff? 4 : 2);
var sRegName = Str.pad((asRegs? asRegs[i] : sName.substr(1) + Str.toDec(i, 3)), cchMax);
var cchReg = (asRegs? (reg < 0x100? 2 : 4) : 6);
s += sName + "[" + Str.toHex(i, 2) + "]: " + sRegName + (i === iReg? '*' : ' ') + Str.toHex(reg, cchReg);
if (reg != null) s += " (" + reg + ".)";
}
this.dbg.println(s);
Expand Down Expand Up @@ -48844,6 +48851,9 @@ class Card extends Controller {
/*
* There are few more EGA regs we could dump, like GRCPos1, GRCPos2, but does anyone care?
*/
if (this.nCard == Video.CARD.VGA) {
this.dumpRegs(" DAC", this.regDACAddr, this.regDACData);
}
}

/*
Expand Down Expand Up @@ -51818,7 +51828,7 @@ class Video extends Component {
* we go with a default EGA-compatible 16-color palette. We'll also use the DAC if there is one
* (ie, this is actually a VGA) and it appears to be initialized (ie, the VGA BIOS has been run).
*/
var fDAC = (aDAC && aDAC[255]);
var fDAC = (aDAC && aDAC[255] != null);
aRegs = (card.regATCData[15] != null? card.regATCData : Video.aEGAPalDef);
for (i = 0; i < 16; i++) {
b = aRegs[i] & Card.ATC.PALETTE.MASK;
Expand Down
Loading

0 comments on commit e8a2152

Please sign in to comment.