More Compaq-specific tweaks

This commit is contained in:
Jeff Parsons 2015-04-15 20:40:18 -07:00 committed by jeffpar
commit b9252390bf
6 changed files with 339 additions and 179 deletions

View file

@ -476,17 +476,21 @@ Bus.prototype.getA20 = function()
*/
Bus.prototype.setA20 = function(fEnable)
{
this.assert(fEnable !== undefined);
if (fEnable !== undefined) {
if (this.nBusWidth > 20) {
var addrMask = (this.busMask & ~0x100000) | (fEnable? 0x100000 : 0);
if (addrMask != this.busMask) {
this.busMask = addrMask;
/*
* This callback is required only because the CPU "insists" on using its own memory access functions.
*/
if (this.cpu) this.cpu.setAddressMask(addrMask);
}
/*
* TODO: Until I determine why the Compaq DeskPro 386 ROM is switching to protected-mode
* with the A20 line disabled, resulting in an almost immediate crash, I'm ignoring its requests
* to turn A20 off.
*/
if (I386 && COMPAQ386) fEnable = true;
if (this.nBusWidth > 20) {
var addrMask = (this.busMask & ~0x100000) | (fEnable? 0x100000 : 0);
if (addrMask != this.busMask) {
this.busMask = addrMask;
/*
* This callback is required only because the CPU "insists" on using its own memory access functions.
*/
if (this.cpu) this.cpu.setAddressMask(addrMask);
}
}
};