Merge branch 'next-release'

This commit is contained in:
Jeff Parsons 2016-02-18 09:06:52 -08:00
commit f23f2e3091
6 changed files with 31 additions and 25 deletions

View file

@ -5,7 +5,7 @@ date: 2016-02-17 14:00:00
permalink: /blog/2016/02/17/
---
PCjs (v1.20.9) now offers some new, *much* easier ways to save disks and machines, thanks to the new
PCjs (v1.20.9) now offers new, *much* easier ways to save disks and machines, thanks to the new
[Save Disk](/blog/2016/02/17/#saving-disks) and [Save Machine](/blog/2016/02/17/#saving-machines) features.
With one click, PCjs can now generate a single download containing everything you need to embed any of our
IBM PC demos on your own web page.
@ -22,17 +22,17 @@ copy of the disk, click the **Load** button first. PCjs will ask you to confirm
disk and discard any changes.
Note that the disk *should* be downloaded as an **.img** file, which is nothing more than a sector-by-sector binary
dump of the disk. For example, a 360Kb double-sided double-density (DSDD) disk contains 9 512-byte sectors on each
dump of the disk. For example, a 360Kb double-sided double-density (DSDD) disk contains 9 512-byte sectors in each
of the 40 tracks on each of its 2 sides, so when you **Save** a 360Kb disk, the downloaded file should be exactly
368,640 bytes large.
The Mac OS X operating system can automatically mount most **.img** files (from disks created by DOS 2.0 or later).
Older 1.x DOS disks, along with most non-DOS disks, do not have a BIOS Parameter Block (BPB) in the boot sector, so
Older DOS 1.x disks, along with most non-DOS disks, do not have a BIOS Parameter Block (BPB) in the boot sector, so
most modern operating systems won't recognize the disk format. Other operating systems, like Windows, may require
third-party software in order to mount an **.img** file, and some third-party software may prefer a different extension,
such as **.ima** or **.bin**.
It's also recommended that make your **.img** files *read-only*, so that if you do mount them on your desktop
It's also recommended that you make your **.img** files *read-only*, so that if you do mount them on your desktop
computer, neither you nor the operating system will inadvertently modify the contents of the disk. On OS X, this is
easily done with the **chmod** utility.
@ -40,10 +40,14 @@ For example, if you saved the disk named "PC-DOS 2.00 (Disk 1)", it should have
in your Downloads folder, so the OS X Terminal command `chmod -w PCDOS200-DISK1.img` will make it read-only, and
`chmod +w PCDOS200-DISK1.img` will make it writable again.
**NOTE**: Some browsers, notably Safari, do not support named downloads, so any disks you download will end up
with default names like "Unknown" or "download". PCjs will still try to let you know what the original filename was,
so that you can rename it appropriately.
Saving Machines
---
Saving the entire state of any existing IBM PC machine is also easy now, thanks to the new **Save Machine** link.
Saving the entire state of any existing IBM PC machine is also much simpler now, using the new **Save Machine** link.
You can choose to save a machine in its initial state, or make changes to any of the machine's disks and then save it.
All your changes should be preserved.
@ -85,9 +89,9 @@ Some notes:
* PCjs may attempt to name the downloaded file **pc.json** instead of **pc.js**, because a file with a ".js"
extension could cause your web browser to block the download.
* For browsers that don't support dynamic downloads, PCjs will attempt to open a new window/tab instead. Make sure
you copy the *entire* contents of that window into a file named to **pc.js** (or **pc-dbg.js** if the machine is using
the built-in PCjs debugger).
* For browsers that don't support named downloads, PCjs will attempt to open a new window/tab instead. Make sure
you copy the *entire* contents of that window into a file named to **pc.js** (or **pc-dbg.js** if the machine is
using the built-in PCjs debugger).
* Your browser may also impose size limitations on the download. If nothing happens, the machine data may be too
large for your browser; try a different browser (eg, Firefox or Safari) or a different machine.

View file

@ -1020,9 +1020,9 @@ b+" changes applied)";b=-1;break}if(this.cf){c="unable to modify write-protected
h.toJSON=function(){var a=JSON.stringify(this.A,function(a,c){return"file"==a?void 0:c}),a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,""),a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:"),a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,""),a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")};
function Mo(a){Ya.call(this,"FDC",a,Mo,524288);this.dmaRead=this.xk;this.dmaWrite=this.yk;this.dmaFormat=this.Nk;this.W=a.autoMount||null;this.C=[];this.qa=!Ka("Mobi")&&window&&"FileReader"in window}hb(Mo);aa={};var No={3:{Qd:3,fe:0,name:aa.Yn},4:{Qd:2,fe:1,name:aa.Wn},5:{Qd:9,fe:7,name:aa.ho},6:{Qd:9,fe:7,name:aa.Rn},7:{Qd:2,fe:0,name:aa.Tn},8:{Qd:1,fe:2,name:aa.Xn},10:{Qd:2,fe:7,name:aa.Sn},13:{Qd:6,fe:7,name:aa.En},15:{Qd:3,fe:0,name:aa.Vn}};h=Mo.prototype;
h.Ub=function(a,b,c){var d=this;switch(b){case "listDisks":return this.xa[b]=c,c.onchange=function(){var a=d.xa.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){Ca("FDC option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.xa[b]=c,c.onchange=function(){var a=ca(c.value,10);null!=a&&Oo(d,a)},!0;
case "loadDrive":return this.xa[b]=c,c.onclick=function(){var a=d.xa.listDisks;a&&Po(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":return this.xa[b]=c,c.onclick=function(){var a=d.xa.listDrives;if(a&&a.options&&d.A)if(a=ca(a.value,10),a=d.A[a])if(a.Da){for(var b=a.Da,c="",k=0,q;q=wo(b,k++);)for(var r=0,x=q.length;r<x;r++)c+=String.fromCharCode(xo(b,q,r,1));b="data:application/octet-stream;base64,"+btoa(c);c=document.createElement("a");"string"==typeof c.download?(c.href=b,c.download=
a.Da.ni.replace(".json",".img"),document.body.appendChild(c),c.click(),document.body.removeChild(c)):window.open(b)}else d.Ua("No disk loaded in drive");else d.Ua("No drive selected")},!0;case "mountDrive":return this.qa?(this.xa[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Po(d,ja(b,!0),b,a)}return!1}):c.parentNode.removeChild(c),!0}return!1};
h.Jc=function(a,b,c,d){this.ja=b;this.M=c;this.ma=d;this.ia=a;this.R=Kb(a,"ChipSet");if((this.W=Qo(this.ia,"autoMount")||this.W)&&"string"==typeof this.W)try{this.W=eval("("+this.W+")")}catch(e){Ca("FDC auto-mount error: "+e.message+" ("+this.W+")"),this.W=null}Ro(this);oc(b,this,So);sc(b,this,To);this.qa&&Uo(this,"Local Disk","?");Uo(this,"Remote Disk","??");Vo(this)||yb(this)};
case "loadDrive":return this.xa[b]=c,c.onclick=function(){var a=d.xa.listDisks;a&&Po(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":return this.xa[b]=c,c.onclick=function(){var a=d.xa.listDrives;if(a&&a.options&&d.A)if(a=ca(a.value,10),a=d.A[a])if(a.Da){for(var b=a.Da,c="",k=0,q;q=wo(b,k++);)for(var r=0,x=q.length;r<x;r++)c+=String.fromCharCode(xo(b,q,r,1));b="data:application/octet-stream;base64,"+btoa(c);c=document.createElement("a");a=a.Da.ni.replace(".json",".img");"string"==
typeof c.download?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c)):(window.open(b),Ca('The disk is being downloaded, but you will need to manually rename it to "'+a+'".'))}else d.Ua("No disk loaded in drive");else d.Ua("No drive selected")},!0;case "mountDrive":return this.qa?(this.xa[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=
a.name;Po(d,ja(b,!0),b,a)}return!1}):c.parentNode.removeChild(c),!0}return!1};h.Jc=function(a,b,c,d){this.ja=b;this.M=c;this.ma=d;this.ia=a;this.R=Kb(a,"ChipSet");if((this.W=Qo(this.ia,"autoMount")||this.W)&&"string"==typeof this.W)try{this.W=eval("("+this.W+")")}catch(e){Ca("FDC auto-mount error: "+e.message+" ("+this.W+")"),this.W=null}Ro(this);oc(b,this,So);sc(b,this,To);this.qa&&Uo(this,"Local Disk","?");Uo(this,"Remote Disk","??");Vo(this)||yb(this)};
h.lc=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.ia.eh){this.C=[];for(var c=0;c<this.A.length;c++)Wo(this,c,!0);Vo(this,!0)}}else if(!this.restore(a))return!1;if(c=this.xa.listDrives){for(;c.firstChild;)c.removeChild(c.firstChild);c.textContent="";for(var d=0;d<this.la;d++){var e=document.createElement("option");e.value=d;e.textContent=String.fromCharCode(65+d)+":";c.appendChild(e)}0<this.la&&(c.value="0",Oo(this,0))}}return!0};h.kc=function(a){return a?this.save():!0};
h.reset=function(){Ro(this)};
h.save=function(){var a=new ef(this),b=0,c=[];c[b++]=this.kb;c[b++]=0;c[b++]=this.sa;c[b++]=this.Y;c[b++]=this.P;c[b++]=this.O;c[b++]=this.da;for(var d=b++,e=0,f=[],g=0;g<this.A.length;g++){var k=e++,q=this.A[g],r=0,x=[];x[r++]=q.Hb;x[r++]=[q.name,q.Gb,q.yb,q.ob,q.$a,q.$e,q.yg,q.Kf,q.Lf];x[r++]=q.mb;x[r++]=q.de+100;x[r++]=q.Wb;x[r++]=q.Cb;x[r++]=q.ee;x[r++]=q.Nb;x[r++]=q.jb;x[r++]=q.Ye;x[r++]=q.ik;x[r]=q.Je;f[k]=x}c[d]=f;d=b++;for(e=0;e<this.A.length;e++)f=this.A[e],f.Da&&Xo(this,f.Je,f.Da);c[d]=

View file

@ -970,9 +970,9 @@ b+" changes applied)";b=-1;break}if(this.pe){c="unable to modify write-protected
f.toJSON=function(){var a=JSON.stringify(this.A,function(a,c){return"file"==a?void 0:c}),a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,""),a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:"),a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,""),a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")};
function Vl(a){Ha.call(this,"FDC",a,Vl);this.dmaRead=this.sj;this.dmaWrite=this.tj;this.dmaFormat=this.Fj;this.N=a.autoMount||null;this.D=[];this.da=!wa("Mobi")&&window&&"FileReader"in window}Pa(Vl);aa={};var Wl={3:{cd:3,vd:0,name:aa.Gm},4:{cd:2,vd:1,name:aa.Em},5:{cd:9,vd:7,name:aa.Om},6:{cd:9,vd:7,name:aa.zm},7:{cd:2,vd:0,name:aa.Bm},8:{cd:1,vd:2,name:aa.Fm},10:{cd:2,vd:7,name:aa.Am},13:{cd:6,vd:7,name:aa.mm},15:{cd:3,vd:0,name:aa.Dm}};f=Vl.prototype;
f.Eb=function(a,b,c){var d=this;switch(b){case "listDisks":return this.pa[b]=c,c.onchange=function(){var a=d.pa.descDisk,b=c.options[c.selectedIndex];if(a&&b){var l={};if(b=b.getAttribute("data-value"))try{l=eval("("+b+")")}catch(p){g("FDC option error: "+p.message)}b=l.desc;void 0===b&&(b="");l=l.href;void 0!==l&&(b='<a href="'+l+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.pa[b]=c,c.onchange=function(){var a=ca(c.value,10);null!=a&&Xl(d,a)},!0;
case "loadDrive":return this.pa[b]=c,c.onclick=function(){var a=d.pa.listDisks;a&&Yl(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":return this.pa[b]=c,c.onclick=function(){var a=d.pa.listDrives;if(a&&a.options&&d.B)if(a=ca(a.value,10),a=d.B[a])if(a.za){for(var b=a.za,c="",p=0,q;q=Pl(b,p++);)for(var t=0,B=q.length;t<B;t++)c+=String.fromCharCode(Ql(b,q,t));b="data:application/octet-stream;base64,"+btoa(c);c=document.createElement("a");"string"==typeof c.download?(c.href=b,c.download=
a.za.gj.replace(".json",".img"),document.body.appendChild(c),c.click(),document.body.removeChild(c)):window.open(b)}else d.Ha("No disk loaded in drive");else d.Ha("No drive selected")},!0;case "mountDrive":return this.da?(this.pa[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Yl(d,ea(b,!0),b,a)}return!1}):c.parentNode.removeChild(c),!0}return!1};
f.nc=function(a,b,c,d){this.oa=b;this.A=c;this.Ta=d;this.ta=a;this.T=jb(a,"ChipSet");if((this.N=Zl(this.ta,"autoMount")||this.N)&&"string"==typeof this.N)try{this.N=eval("("+this.N+")")}catch(e){g("FDC auto-mount error: "+e.message+" ("+this.N+")"),this.N=null}$l(this);Mb(b,this,am);Ob(b,this,bm);this.da&&cm(this,"Local Disk","?");cm(this,"Remote Disk","??");dm(this)||$a(this)};
case "loadDrive":return this.pa[b]=c,c.onclick=function(){var a=d.pa.listDisks;a&&Yl(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":return this.pa[b]=c,c.onclick=function(){var a=d.pa.listDrives;if(a&&a.options&&d.B)if(a=ca(a.value,10),a=d.B[a])if(a.za){for(var b=a.za,c="",p=0,q;q=Pl(b,p++);)for(var t=0,B=q.length;t<B;t++)c+=String.fromCharCode(Ql(b,q,t));b="data:application/octet-stream;base64,"+btoa(c);c=document.createElement("a");a=a.za.gj.replace(".json",".img");"string"==typeof c.download?
(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c)):(window.open(b),g('The disk is being downloaded, but you will need to manually rename it to "'+a+'".'))}else d.Ha("No disk loaded in drive");else d.Ha("No drive selected")},!0;case "mountDrive":return this.da?(this.pa[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Yl(d,
ea(b,!0),b,a)}return!1}):c.parentNode.removeChild(c),!0}return!1};f.nc=function(a,b,c,d){this.oa=b;this.A=c;this.Ta=d;this.ta=a;this.T=jb(a,"ChipSet");if((this.N=Zl(this.ta,"autoMount")||this.N)&&"string"==typeof this.N)try{this.N=eval("("+this.N+")")}catch(e){g("FDC auto-mount error: "+e.message+" ("+this.N+")"),this.N=null}$l(this);Mb(b,this,am);Ob(b,this,bm);this.da&&cm(this,"Local Disk","?");cm(this,"Remote Disk","??");dm(this)||$a(this)};
f.Tb=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.ta.lg){this.D=[];for(var c=0;c<this.B.length;c++)em(this,c,!0);dm(this,!0)}}else if(!this.restore(a))return!1;if(c=this.pa.listDrives){for(;c.firstChild;)c.removeChild(c.firstChild);c.textContent="";for(var d=0;d<this.Z;d++){var e=document.createElement("option");e.value=d;e.textContent=String.fromCharCode(65+d)+":";c.appendChild(e)}0<this.Z&&(c.value="0",Xl(this,0))}}return!0};f.Sb=function(a){return a?this.save():!0};f.reset=function(){$l(this)};
f.save=function(){var a=new Td(this),b=0,c=[];c[b++]=this.Xa;c[b++]=0;c[b++]=this.ga;c[b++]=this.K;c[b++]=this.H;c[b++]=this.F;c[b++]=this.W;for(var d=b++,e=0,k=[],l=0;l<this.B.length;l++){var p=e++,q=this.B[l],t=0,B=[];B[t++]=q.qb;B[t++]=[q.name,q.ob,q.pb,q.ib,q.tb,q.me,q.Jf,q.Re,q.Se];B[t++]=q.bb;B[t++]=q.td+100;B[t++]=q.Bb;B[t++]=q.sb;B[t++]=q.ud;B[t++]=q.zb;B[t++]=q.Ya;B[t++]=q.ke;B[t++]=q.hj;B[t]=q.Td;k[p]=B}c[d]=k;d=b++;for(e=0;e<this.B.length;e++)k=this.B[e],k.za&&fm(this,k.Td,k.za);c[d]=this.D;
c[b++]=this.O;c[b]=this.J;D(a,0,c);return a.data()};f.restore=function(a){return $l(this,a[0])};

View file

@ -477,16 +477,18 @@ FDC.prototype.setBinding = function(sHTMLType, sBinding, control, sValue)
if (drive) {
if (drive.disk) {
if (DEBUG) fdc.println("saving disk " + drive.disk.sDiskPath + "...");
var uri = "data:application/octet-stream;base64," + drive.disk.encodeAsBase64();
var sURI = "data:application/octet-stream;base64," + drive.disk.encodeAsBase64();
var link = document.createElement('a');
var sFileName = drive.disk.sDiskFile.replace(".json", ".img");
if (typeof link.download == 'string') {
link.href = uri;
link.download = drive.disk.sDiskFile.replace(".json", ".img");
document.body.appendChild(link); // Firefox requires the link to be in the body (?)
link.href = sURI;
link.download = sFileName;
document.body.appendChild(link); // Firefox requires the link to be in the body
link.click();
document.body.removeChild(link);
} else {
window.open(uri);
window.open(sURI);
web.alertUser('The disk is being downloaded, but you will need to manually rename it to "' + sFileName + '".');
}
} else {
fdc.notice("No disk loaded in drive");

View file

@ -1020,9 +1020,9 @@ b+" changes applied)";b=-1;break}if(this.cf){c="unable to modify write-protected
h.toJSON=function(){var a=JSON.stringify(this.A,function(a,c){return"file"==a?void 0:c}),a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,""),a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:"),a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,""),a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")};
function Mo(a){Ya.call(this,"FDC",a,Mo,524288);this.dmaRead=this.xk;this.dmaWrite=this.yk;this.dmaFormat=this.Nk;this.W=a.autoMount||null;this.C=[];this.qa=!Ka("Mobi")&&window&&"FileReader"in window}hb(Mo);aa={};var No={3:{Qd:3,fe:0,name:aa.Yn},4:{Qd:2,fe:1,name:aa.Wn},5:{Qd:9,fe:7,name:aa.ho},6:{Qd:9,fe:7,name:aa.Rn},7:{Qd:2,fe:0,name:aa.Tn},8:{Qd:1,fe:2,name:aa.Xn},10:{Qd:2,fe:7,name:aa.Sn},13:{Qd:6,fe:7,name:aa.En},15:{Qd:3,fe:0,name:aa.Vn}};h=Mo.prototype;
h.Ub=function(a,b,c){var d=this;switch(b){case "listDisks":return this.xa[b]=c,c.onchange=function(){var a=d.xa.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){Ca("FDC option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.xa[b]=c,c.onchange=function(){var a=ca(c.value,10);null!=a&&Oo(d,a)},!0;
case "loadDrive":return this.xa[b]=c,c.onclick=function(){var a=d.xa.listDisks;a&&Po(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":return this.xa[b]=c,c.onclick=function(){var a=d.xa.listDrives;if(a&&a.options&&d.A)if(a=ca(a.value,10),a=d.A[a])if(a.Da){for(var b=a.Da,c="",k=0,q;q=wo(b,k++);)for(var r=0,x=q.length;r<x;r++)c+=String.fromCharCode(xo(b,q,r,1));b="data:application/octet-stream;base64,"+btoa(c);c=document.createElement("a");"string"==typeof c.download?(c.href=b,c.download=
a.Da.ni.replace(".json",".img"),document.body.appendChild(c),c.click(),document.body.removeChild(c)):window.open(b)}else d.Ua("No disk loaded in drive");else d.Ua("No drive selected")},!0;case "mountDrive":return this.qa?(this.xa[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Po(d,ja(b,!0),b,a)}return!1}):c.parentNode.removeChild(c),!0}return!1};
h.Jc=function(a,b,c,d){this.ja=b;this.M=c;this.ma=d;this.ia=a;this.R=Kb(a,"ChipSet");if((this.W=Qo(this.ia,"autoMount")||this.W)&&"string"==typeof this.W)try{this.W=eval("("+this.W+")")}catch(e){Ca("FDC auto-mount error: "+e.message+" ("+this.W+")"),this.W=null}Ro(this);oc(b,this,So);sc(b,this,To);this.qa&&Uo(this,"Local Disk","?");Uo(this,"Remote Disk","??");Vo(this)||yb(this)};
case "loadDrive":return this.xa[b]=c,c.onclick=function(){var a=d.xa.listDisks;a&&Po(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":return this.xa[b]=c,c.onclick=function(){var a=d.xa.listDrives;if(a&&a.options&&d.A)if(a=ca(a.value,10),a=d.A[a])if(a.Da){for(var b=a.Da,c="",k=0,q;q=wo(b,k++);)for(var r=0,x=q.length;r<x;r++)c+=String.fromCharCode(xo(b,q,r,1));b="data:application/octet-stream;base64,"+btoa(c);c=document.createElement("a");a=a.Da.ni.replace(".json",".img");"string"==
typeof c.download?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c)):(window.open(b),Ca('The disk is being downloaded, but you will need to manually rename it to "'+a+'".'))}else d.Ua("No disk loaded in drive");else d.Ua("No drive selected")},!0;case "mountDrive":return this.qa?(this.xa[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=
a.name;Po(d,ja(b,!0),b,a)}return!1}):c.parentNode.removeChild(c),!0}return!1};h.Jc=function(a,b,c,d){this.ja=b;this.M=c;this.ma=d;this.ia=a;this.R=Kb(a,"ChipSet");if((this.W=Qo(this.ia,"autoMount")||this.W)&&"string"==typeof this.W)try{this.W=eval("("+this.W+")")}catch(e){Ca("FDC auto-mount error: "+e.message+" ("+this.W+")"),this.W=null}Ro(this);oc(b,this,So);sc(b,this,To);this.qa&&Uo(this,"Local Disk","?");Uo(this,"Remote Disk","??");Vo(this)||yb(this)};
h.lc=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.ia.eh){this.C=[];for(var c=0;c<this.A.length;c++)Wo(this,c,!0);Vo(this,!0)}}else if(!this.restore(a))return!1;if(c=this.xa.listDrives){for(;c.firstChild;)c.removeChild(c.firstChild);c.textContent="";for(var d=0;d<this.la;d++){var e=document.createElement("option");e.value=d;e.textContent=String.fromCharCode(65+d)+":";c.appendChild(e)}0<this.la&&(c.value="0",Oo(this,0))}}return!0};h.kc=function(a){return a?this.save():!0};
h.reset=function(){Ro(this)};
h.save=function(){var a=new ef(this),b=0,c=[];c[b++]=this.kb;c[b++]=0;c[b++]=this.sa;c[b++]=this.Y;c[b++]=this.P;c[b++]=this.O;c[b++]=this.da;for(var d=b++,e=0,f=[],g=0;g<this.A.length;g++){var k=e++,q=this.A[g],r=0,x=[];x[r++]=q.Hb;x[r++]=[q.name,q.Gb,q.yb,q.ob,q.$a,q.$e,q.yg,q.Kf,q.Lf];x[r++]=q.mb;x[r++]=q.de+100;x[r++]=q.Wb;x[r++]=q.Cb;x[r++]=q.ee;x[r++]=q.Nb;x[r++]=q.jb;x[r++]=q.Ye;x[r++]=q.ik;x[r]=q.Je;f[k]=x}c[d]=f;d=b++;for(e=0;e<this.A.length;e++)f=this.A[e],f.Da&&Xo(this,f.Je,f.Da);c[d]=

View file

@ -970,9 +970,9 @@ b+" changes applied)";b=-1;break}if(this.pe){c="unable to modify write-protected
f.toJSON=function(){var a=JSON.stringify(this.A,function(a,c){return"file"==a?void 0:c}),a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,""),a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:"),a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,""),a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")};
function Vl(a){Ha.call(this,"FDC",a,Vl);this.dmaRead=this.sj;this.dmaWrite=this.tj;this.dmaFormat=this.Fj;this.N=a.autoMount||null;this.D=[];this.da=!wa("Mobi")&&window&&"FileReader"in window}Pa(Vl);aa={};var Wl={3:{cd:3,vd:0,name:aa.Gm},4:{cd:2,vd:1,name:aa.Em},5:{cd:9,vd:7,name:aa.Om},6:{cd:9,vd:7,name:aa.zm},7:{cd:2,vd:0,name:aa.Bm},8:{cd:1,vd:2,name:aa.Fm},10:{cd:2,vd:7,name:aa.Am},13:{cd:6,vd:7,name:aa.mm},15:{cd:3,vd:0,name:aa.Dm}};f=Vl.prototype;
f.Eb=function(a,b,c){var d=this;switch(b){case "listDisks":return this.pa[b]=c,c.onchange=function(){var a=d.pa.descDisk,b=c.options[c.selectedIndex];if(a&&b){var l={};if(b=b.getAttribute("data-value"))try{l=eval("("+b+")")}catch(p){g("FDC option error: "+p.message)}b=l.desc;void 0===b&&(b="");l=l.href;void 0!==l&&(b='<a href="'+l+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.pa[b]=c,c.onchange=function(){var a=ca(c.value,10);null!=a&&Xl(d,a)},!0;
case "loadDrive":return this.pa[b]=c,c.onclick=function(){var a=d.pa.listDisks;a&&Yl(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":return this.pa[b]=c,c.onclick=function(){var a=d.pa.listDrives;if(a&&a.options&&d.B)if(a=ca(a.value,10),a=d.B[a])if(a.za){for(var b=a.za,c="",p=0,q;q=Pl(b,p++);)for(var t=0,B=q.length;t<B;t++)c+=String.fromCharCode(Ql(b,q,t));b="data:application/octet-stream;base64,"+btoa(c);c=document.createElement("a");"string"==typeof c.download?(c.href=b,c.download=
a.za.gj.replace(".json",".img"),document.body.appendChild(c),c.click(),document.body.removeChild(c)):window.open(b)}else d.Ha("No disk loaded in drive");else d.Ha("No drive selected")},!0;case "mountDrive":return this.da?(this.pa[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Yl(d,ea(b,!0),b,a)}return!1}):c.parentNode.removeChild(c),!0}return!1};
f.nc=function(a,b,c,d){this.oa=b;this.A=c;this.Ta=d;this.ta=a;this.T=jb(a,"ChipSet");if((this.N=Zl(this.ta,"autoMount")||this.N)&&"string"==typeof this.N)try{this.N=eval("("+this.N+")")}catch(e){g("FDC auto-mount error: "+e.message+" ("+this.N+")"),this.N=null}$l(this);Mb(b,this,am);Ob(b,this,bm);this.da&&cm(this,"Local Disk","?");cm(this,"Remote Disk","??");dm(this)||$a(this)};
case "loadDrive":return this.pa[b]=c,c.onclick=function(){var a=d.pa.listDisks;a&&Yl(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":return this.pa[b]=c,c.onclick=function(){var a=d.pa.listDrives;if(a&&a.options&&d.B)if(a=ca(a.value,10),a=d.B[a])if(a.za){for(var b=a.za,c="",p=0,q;q=Pl(b,p++);)for(var t=0,B=q.length;t<B;t++)c+=String.fromCharCode(Ql(b,q,t));b="data:application/octet-stream;base64,"+btoa(c);c=document.createElement("a");a=a.za.gj.replace(".json",".img");"string"==typeof c.download?
(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c)):(window.open(b),g('The disk is being downloaded, but you will need to manually rename it to "'+a+'".'))}else d.Ha("No disk loaded in drive");else d.Ha("No drive selected")},!0;case "mountDrive":return this.da?(this.pa[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Yl(d,
ea(b,!0),b,a)}return!1}):c.parentNode.removeChild(c),!0}return!1};f.nc=function(a,b,c,d){this.oa=b;this.A=c;this.Ta=d;this.ta=a;this.T=jb(a,"ChipSet");if((this.N=Zl(this.ta,"autoMount")||this.N)&&"string"==typeof this.N)try{this.N=eval("("+this.N+")")}catch(e){g("FDC auto-mount error: "+e.message+" ("+this.N+")"),this.N=null}$l(this);Mb(b,this,am);Ob(b,this,bm);this.da&&cm(this,"Local Disk","?");cm(this,"Remote Disk","??");dm(this)||$a(this)};
f.Tb=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.ta.lg){this.D=[];for(var c=0;c<this.B.length;c++)em(this,c,!0);dm(this,!0)}}else if(!this.restore(a))return!1;if(c=this.pa.listDrives){for(;c.firstChild;)c.removeChild(c.firstChild);c.textContent="";for(var d=0;d<this.Z;d++){var e=document.createElement("option");e.value=d;e.textContent=String.fromCharCode(65+d)+":";c.appendChild(e)}0<this.Z&&(c.value="0",Xl(this,0))}}return!0};f.Sb=function(a){return a?this.save():!0};f.reset=function(){$l(this)};
f.save=function(){var a=new Td(this),b=0,c=[];c[b++]=this.Xa;c[b++]=0;c[b++]=this.ga;c[b++]=this.K;c[b++]=this.H;c[b++]=this.F;c[b++]=this.W;for(var d=b++,e=0,k=[],l=0;l<this.B.length;l++){var p=e++,q=this.B[l],t=0,B=[];B[t++]=q.qb;B[t++]=[q.name,q.ob,q.pb,q.ib,q.tb,q.me,q.Jf,q.Re,q.Se];B[t++]=q.bb;B[t++]=q.td+100;B[t++]=q.Bb;B[t++]=q.sb;B[t++]=q.ud;B[t++]=q.zb;B[t++]=q.Ya;B[t++]=q.ke;B[t++]=q.hj;B[t]=q.Td;k[p]=B}c[d]=k;d=b++;for(e=0;e<this.B.length;e++)k=this.B[e],k.za&&fm(this,k.Td,k.za);c[d]=this.D;
c[b++]=this.O;c[b]=this.J;D(a,0,c);return a.data()};f.restore=function(a){return $l(this,a[0])};