Updated the PC Magazine Disks page with a new improved way of quickly loading disks into a demo machine

This commit is contained in:
Jeff Parsons 2017-07-12 10:14:01 -07:00 • committed by Jeff Parsons
commit 9cb68b77fd
10 changed files with 1286 additions and 902 deletions

File diff suppressed because it is too large Load diff

View file

@ -7,12 +7,12 @@ machines:
type: pcx86
config: /devices/pcx86/machine/5160/ega/640kb/debugger/machine.xml
drives: '[{name:"10Mb Hard Disk",type:3,path:"/disks/pcx86/fixed/10mb/MSDOS320-C400.json"}]'
autoStart: true
resume: 1
autoMount:
A:
name: None
B:
name: PC Magazine (Vol. 06 No. 08)
name: None
---
PC Magazine Disks (with Debugger)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -192,6 +192,10 @@ class FDC extends Component {
* settings that determine the number of drives and their characteristics (eg, 40-track vs. 80-track),
* which it can then pass on to initDrive().
*/
this['exports'] = {
'loadDisk': this.loadSelectedDisk
};
}
/**
@ -308,12 +312,7 @@ class FDC extends Component {
case "loadDisk":
this.bindings[sBinding] = control;
control.onclick = function onClickLoadDisk(event) {
var controlDisks = fdc.bindings["listDisks"];
if (controlDisks) {
var sDisketteName = controlDisks.options[controlDisks.selectedIndex].text;
var sDiskettePath = controlDisks.value;
fdc.loadSelectedDrive(sDisketteName, sDiskettePath);
}
fdc.loadSelectedDisk();
};
return true;
@ -1104,6 +1103,23 @@ class FDC extends Component {
return !!this.cAutoMount;
}
/**
* loadSelectedDisk()
*
* @this {FDC}
* @return {boolean}
*/
loadSelectedDisk()
{
var controlDisks = this.bindings["listDisks"];
if (controlDisks) {
var sDisketteName = controlDisks.options[controlDisks.selectedIndex].text;
var sDiskettePath = controlDisks.value;
return this.loadSelectedDrive(sDisketteName, sDiskettePath);
}
return false;
}
/**
* loadSelectedDrive(sDisketteName, sDiskettePath, file)
*
@ -1111,6 +1127,7 @@ class FDC extends Component {
* @param {string} sDisketteName
* @param {string} sDiskettePath
* @param {File} [file] is set if there's an associated File object
* @return {boolean}
*/
loadSelectedDrive(sDisketteName, sDiskettePath, file)
{
@ -1120,12 +1137,12 @@ class FDC extends Component {
if (!sDiskettePath) {
this.unloadDrive(iDrive);
return;
return true;
}
if (sDiskettePath == "?") {
this.notice('Use "Choose File" and "Mount" to select and load a local disk.');
return;
return false;
}
/*
@ -1139,7 +1156,7 @@ class FDC extends Component {
*/
if (sDiskettePath == "??") {
sDiskettePath = window.prompt("Enter the URL of a remote disk image.", "") || "";
if (!sDiskettePath) return;
if (!sDiskettePath) return false;
sDisketteName = Str.getBaseName(sDiskettePath);
if (DEBUG) this.println("Attempting to load " + sDiskettePath + " as \"" + sDisketteName + "\"");
}
@ -1147,7 +1164,7 @@ class FDC extends Component {
while (this.loadDrive(iDrive, sDisketteName, sDiskettePath, false, file) < 0) {
if (!window.confirm("Click OK to reload the original disk and discard any changes.")) {
if (DEBUG) this.println("load cancelled");
return;
return false;
}
/*
* So here's the story: loadDrive() returned true, which it does ONLY if the specified disk is already
@ -1160,9 +1177,10 @@ class FDC extends Component {
this.removeDiskHistory(sDisketteName, sDiskettePath);
this.unloadDrive(iDrive, false, true);
}
return;
return true;
}
this.notice("Unable to load the selected drive");
return false;
}
/**

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -59262,6 +59262,10 @@ class FDC extends Component {
* settings that determine the number of drives and their characteristics (eg, 40-track vs. 80-track),
* which it can then pass on to initDrive().
*/
this['exports'] = {
'loadDisk': this.loadSelectedDisk
};
}
/**
@ -59378,12 +59382,7 @@ class FDC extends Component {
case "loadDisk":
this.bindings[sBinding] = control;
control.onclick = function onClickLoadDisk(event) {
var controlDisks = fdc.bindings["listDisks"];
if (controlDisks) {
var sDisketteName = controlDisks.options[controlDisks.selectedIndex].text;
var sDiskettePath = controlDisks.value;
fdc.loadSelectedDrive(sDisketteName, sDiskettePath);
}
fdc.loadSelectedDisk();
};
return true;
@ -60174,6 +60173,23 @@ class FDC extends Component {
return !!this.cAutoMount;
}
/**
* loadSelectedDisk()
*
* @this {FDC}
* @return {boolean}
*/
loadSelectedDisk()
{
var controlDisks = this.bindings["listDisks"];
if (controlDisks) {
var sDisketteName = controlDisks.options[controlDisks.selectedIndex].text;
var sDiskettePath = controlDisks.value;
return this.loadSelectedDrive(sDisketteName, sDiskettePath);
}
return false;
}
/**
* loadSelectedDrive(sDisketteName, sDiskettePath, file)
*
@ -60181,6 +60197,7 @@ class FDC extends Component {
* @param {string} sDisketteName
* @param {string} sDiskettePath
* @param {File} [file] is set if there's an associated File object
* @return {boolean}
*/
loadSelectedDrive(sDisketteName, sDiskettePath, file)
{
@ -60190,12 +60207,12 @@ class FDC extends Component {
if (!sDiskettePath) {
this.unloadDrive(iDrive);
return;
return true;
}
if (sDiskettePath == "?") {
this.notice('Use "Choose File" and "Mount" to select and load a local disk.');
return;
return false;
}
/*
@ -60209,7 +60226,7 @@ class FDC extends Component {
*/
if (sDiskettePath == "??") {
sDiskettePath = window.prompt("Enter the URL of a remote disk image.", "") || "";
if (!sDiskettePath) return;
if (!sDiskettePath) return false;
sDisketteName = Str.getBaseName(sDiskettePath);
if (DEBUG) this.println("Attempting to load " + sDiskettePath + " as \"" + sDisketteName + "\"");
}
@ -60217,7 +60234,7 @@ class FDC extends Component {
while (this.loadDrive(iDrive, sDisketteName, sDiskettePath, false, file) < 0) {
if (!window.confirm("Click OK to reload the original disk and discard any changes.")) {
if (DEBUG) this.println("load cancelled");
return;
return false;
}
/*
* So here's the story: loadDrive() returned true, which it does ONLY if the specified disk is already
@ -60230,9 +60247,10 @@ class FDC extends Component {
this.removeDiskHistory(sDisketteName, sDiskettePath);
this.unloadDrive(iDrive, false, true);
}
return;
return true;
}
this.notice("Unable to load the selected drive");
return false;
}
/**

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long