Fixed machine array demos, by permitting machine IDs with hyphenated numeric suffixes to use a machine state file created with an unhyphenated machine ID, and added a demo of Windows 1.0 (the "Premiere Edition")

This commit is contained in:
Jeff Parsons 2017-06-23 14:00:27 -07:00 committed by Jeff Parsons
commit 503cda40f7
27 changed files with 99 additions and 57 deletions

View file

@ -2686,11 +2686,15 @@ DiskDump.prototype.convertToJSON = function()
var bMediaTypeBPB = this.bufDisk.readUInt8(offBootSector + DiskAPI.BPB.MEDIA_TYPE);
var nSectorsTotalBPB = this.bufDisk.readUInt16LE(offBootSector + DiskAPI.BPB.TOTAL_SECS);
var nSectorsPerCylinderBPB = nSectorsPerTrackBPB * nHeadsBPB;
var nCylindersBPB = Math.floor(nSectorsTotalBPB / nSectorsPerCylinderBPB);
var nSectorsHiddenBPB = this.bufDisk.readUInt16LE(offBootSector + DiskAPI.BPB.HIDDEN_SECS);
var nCylindersBPB = (nSectorsHiddenBPB + nSectorsTotalBPB) / nSectorsPerCylinderBPB;
if (diskFormat) {
if (nCylinders != nCylindersBPB) {
DiskDump.logWarning("BPB cylinders (" + nCylindersBPB + ") do not match actual cylinders (" + nCylinders + ")");
if (nCylinders - nCylindersBPB == 1) {
DiskDump.logWarning("the BIOS may have reserved the last cylinder for diagnostics");
}
}
if (nHeads != nHeadsBPB) {
DiskDump.logWarning("BPB heads (" + nHeadsBPB + ") do not match actual heads (" + nHeads + ")");