Cleaned up disk types

This commit is contained in:
Jeff Parsons 2016-03-17 08:31:38 -07:00
commit 456aae0ebe
5 changed files with 63 additions and 64 deletions

View file

@ -2986,8 +2986,15 @@ ChipSet.prototype.advanceDMA = function(channel, fInit)
if (!channel.masked) {
chipset.bus.setByte(addrCur, b);
if (BACKTRACK) {
if (!off && obj.file && chipset.messageEnabled(Messages.DISK)) {
chipset.printMessage("loading " + obj.file.sPath + '[' + obj.offFile + "] at %" + str.toHex(addrCur), true);
if (!off && obj.file) {
if (chipset.messageEnabled(Messages.DISK)) {
chipset.printMessage("loading " + obj.file.sPath + '[' + obj.offFile + "] at %" + str.toHex(addrCur), true);
}
/*
if (obj.file.sPath == "\\SYSBAS.EXE" && obj.offFile == 512) {
chipset.cpu.stopCPU();
}
*/
}
bto = chipset.bus.addBackTrackObject(obj, bto, off);
chipset.bus.writeBackTrackObject(addrCur, bto, off);
@ -4411,14 +4418,14 @@ ChipSet.prototype.out8042InBuffData = function(port, bOut, addrFrom)
break;
/*
* This case is reserved for command bytes that the 8042 is not expecting, which should therefore be passed on
* to the Keyboard itself.
* This case is reserved for command bytes that the 8042 is not expecting, which should therefore be passed
* on to the Keyboard itself.
*
* Here's some relevant MODEL_5170 ROM BIOS code, "XMIT_8042" (missing from the original MODEL_5170 ROM BIOS listing),
* which sends a command code in AL to the Keyboard and waits for a response, returning it in AL. Note that
* the only "success" exit path from this function involves LOOPing 64K times before finally reading the Keyboard's
* response; either the hardware and/or this code seems a bit brain-damaged if that's REALLY what you had to do to ensure
* a valid response....
* Here's some relevant MODEL_5170 ROM BIOS code, "XMIT_8042" (missing from the original MODEL_5170 ROM BIOS
* listing), which sends a command code in AL to the Keyboard and waits for a response, returning it in AL.
* Note that the only "success" exit path from this function involves LOOPing 64K times before finally reading
* the Keyboard's response; either the hardware and/or this code seems a bit brain-damaged if that's REALLY
* what you had to do to ensure a valid response....
*
* F000:1B25 86E0 XCHG AH,AL
* F000:1B27 2BC9 SUB CX,CX
@ -4453,9 +4460,9 @@ ChipSet.prototype.out8042InBuffData = function(port, bOut, addrFrom)
* F000:1B62 83E901 SUB CX,0001 ; EXIT WITH SUCCESS (CX != 0)
* F000:1B65 C3 RET
*
* But WAIT, the FUN doesn't end there. After this function returns, "KBD_RESET" waits for a Keyboard interrupt
* to occur, hoping for scan code 0xAA as the Keyboard's final response. "KBD_RESET" also returns CX to the caller,
* and the caller ("TEST.21") assumes there was no interrupt if CX is zero.
* But WAIT, the FUN doesn't end there. After this function returns, "KBD_RESET" waits for a Keyboard
* interrupt to occur, hoping for scan code 0xAA as the Keyboard's final response. "KBD_RESET" also returns
* CX to the caller, and the caller ("TEST.21") assumes there was no interrupt if CX is zero.
*
* MOV AL,0FDH
* OUT INTA01,AL
@ -4470,9 +4477,9 @@ ChipSet.prototype.out8042InBuffData = function(port, bOut, addrFrom)
* JNZ G11
* ...
*
* However, if [INTR_FLAG] is set immediately, the above code will exit immediately, without ever decrementing CX.
* CX can be zero not only if the loop exhausted it, but also if no looping was required; the latter is not an
* error, but "TEST.21" assumes that it is.
* However, if [INTR_FLAG] is set immediately, the above code will exit immediately, without ever decrementing
* CX. CX can be zero not only if the loop exhausted it, but also if no looping was required; the latter is not
* an error, but "TEST.21" assumes that it is.
*/
default:
this.set8042CmdData(this.b8042CmdData & ~ChipSet.KBC.DATA.CMD.NO_CLOCK);

View file

@ -794,20 +794,12 @@ FileInfo.prototype.getSymbol = function(off, fNearest)
* iCylinder: number,
* iHead: number,
* iModify: number,
* cModify: number
* cModify: number,
* file: FileInfo,
* offFile: number
* }}
*/
var SectorData;
/**
* @class SectorInfo
* @property {number} 0 contains iCylinder
* @property {number} 1 contains iHead
* @property {number} 2 contains iSector
* @property {number} 3 contains nSectors
* @property {boolean} 4 contains fAsync
* @property {function(nErrorCode:number,fAsync:boolean)} 5 contains done
*/
var SectorInfo;
/**
* initBus(cmp, bus, cpu, dbg)
@ -1923,7 +1915,7 @@ Disk.prototype.getSectorString = function(sector, off, len)
* Like getSector(), this must convert a PBA into CHS values; consider factoring that conversion code out.
*
* @this {Disk}
* @param {Object} file
* @param {FileInfo} file
* @param {number} pba (physical block address from the file's apba)
* @param {number} off (file offset corresponding to the given pba of the given file)
* @return {boolean} true if successfully updated, false if not
@ -2047,22 +2039,22 @@ Disk.prototype.readRemoteSectors = function(iCylinder, iHead, iSector, nSectors,
};
/**
* doneReadRemoteSectors(sURLName, sURLData, nErrorCode, sectorInfo)
* doneReadRemoteSectors(sURLName, sURLData, nErrorCode, aRequest)
*
* @this {Disk}
* @param {string} sURLName
* @param {string} sURLData
* @param {number} nErrorCode
* @param {Array} sectorInfo
* @param {Array} aRequest ([iCylinder, iHead, iSector, nSectors, fAsync, done])
*/
Disk.prototype.doneReadRemoteSectors = function(sURLName, sURLData, nErrorCode, sectorInfo)
Disk.prototype.doneReadRemoteSectors = function(sURLName, sURLData, nErrorCode, aRequest)
{
var fAsync = false;
var iCylinder = sectorInfo[0];
var iHead = sectorInfo[1];
var iSector = sectorInfo[2];
var nSectors = sectorInfo[3];
var iCylinder = aRequest[0];
var iHead = aRequest[1];
var iSector = aRequest[2];
var nSectors = aRequest[3];
if (!nErrorCode) {
var abData = JSON.parse(sURLData);
@ -2092,13 +2084,13 @@ Disk.prototype.doneReadRemoteSectors = function(sURLName, sURLData, nErrorCode,
*/
iSector++;
}
fAsync = sectorInfo[4];
fAsync = aRequest[4];
} else {
if (DEBUG && this.messageEnabled()) {
this.printMessage("doneReadRemoteSectors(CHS=" + iCylinder + ':' + iHead + ':' + iSector + ",N=" + nSectors + ") returned error " + nErrorCode);
}
}
var done = sectorInfo[5];
var done = aRequest[5];
if (done) done(nErrorCode, fAsync);
};
@ -2149,21 +2141,21 @@ Disk.prototype.writeRemoteSectors = function(iCylinder, iHead, iSector, nSectors
};
/**
* doneWriteRemoteSectors(sURLName, sURLData, nErrorCode, sectorInfo)
* doneWriteRemoteSectors(sURLName, sURLData, nErrorCode, aRequest)
*
* @this {Disk}
* @param {string} sURLName
* @param {string} sURLData
* @param {number} nErrorCode
* @param {Array} sectorInfo
* @param {Array} aRequest ([iCylinder, iHead, iSector, nSectors, fAsync])
*/
Disk.prototype.doneWriteRemoteSectors = function(sURLName, sURLData, nErrorCode, sectorInfo)
Disk.prototype.doneWriteRemoteSectors = function(sURLName, sURLData, nErrorCode, aRequest)
{
var iCylinder = sectorInfo[0];
var iHead = sectorInfo[1];
var iSector = sectorInfo[2];
var nSectors = sectorInfo[3];
var fAsync = sectorInfo[4];
var iCylinder = aRequest[0];
var iHead = aRequest[1];
var iSector = aRequest[2];
var nSectors = aRequest[3];
var fAsync = aRequest[4];
this.fWriteInProgress = false;
if (iCylinder >= 0 && iCylinder < this.aDiskData.length && iHead >= 0 && iHead < this.aDiskData[iCylinder].length) {