Merge branch 'next-release'
This commit is contained in:
commit
c54a27e2e5
434 changed files with 18628 additions and 3770 deletions
|
|
@ -29,7 +29,7 @@
|
|||
}
|
||||
.pcjs-label {
|
||||
font-size: small;
|
||||
line-height: 19px;
|
||||
line-height: 20px;
|
||||
vertical-align: middle;
|
||||
float: left;
|
||||
font-family: Monaco, "Lucida Console", monospace;
|
||||
|
|
@ -47,14 +47,14 @@
|
|||
font-family: Monaco, "Lucida Console", monospace;
|
||||
font-size: small;
|
||||
text-align: center;
|
||||
line-height: 19px;
|
||||
line-height: 20px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.pcjs-register {
|
||||
font-family: Monaco, "Lucida Console", monospace;
|
||||
font-size: small;
|
||||
text-align: center;
|
||||
line-height: 19px;
|
||||
line-height: 20px;
|
||||
vertical-align: middle;
|
||||
border: 1px solid black;
|
||||
}
|
||||
|
|
@ -96,6 +96,21 @@
|
|||
line-height: 34px;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.pcjs-panel-group {
|
||||
color: #ffffff;
|
||||
background-color: #404040;
|
||||
}
|
||||
.pcjs-tripled {
|
||||
padding: 1px;
|
||||
}
|
||||
.pcjs-tripled-label {
|
||||
text-align: right;
|
||||
padding: 8px;
|
||||
}
|
||||
.pcjs-ledpad {
|
||||
line-height: 32px;
|
||||
background-color: #000000;
|
||||
}
|
||||
.pcjs-led {
|
||||
float: left;
|
||||
width: 8px;
|
||||
|
|
@ -103,19 +118,18 @@
|
|||
margin: 4px;
|
||||
border: 1px solid black;
|
||||
text-align: center;
|
||||
line-height: 19px;
|
||||
vertical-align: middle;
|
||||
background-color: #000000;
|
||||
}
|
||||
.pcjs-rled {
|
||||
float: left;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
margin: 4px;
|
||||
border: 1px solid black;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
line-height: 19px;
|
||||
background-color: #000000;
|
||||
vertical-align: middle;
|
||||
background-color: #ff0000;
|
||||
}
|
||||
.pcjs-screen {
|
||||
clear: both;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- author="Jeff Parsons (@jeffpar)" website="http://www.pcjs.org/" created="2012-05-05" modified="2016-04-15" license="http://www.gnu.org/licenses/gpl.html" -->
|
||||
<!DOCTYPE xsl:stylesheet [
|
||||
<!ENTITY nbsp " "> <!ENTITY ne "≠"> <!ENTITY le "≤"> <!ENTITY ge "≥">
|
||||
]>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
|
||||
|
|
@ -13,11 +14,11 @@
|
|||
<xsl:variable name="CSSCLASS">pcjs</xsl:variable>
|
||||
<xsl:variable name="APPCLASS">pcx86</xsl:variable>
|
||||
<xsl:variable name="APPNAME">PCx86</xsl:variable>
|
||||
<xsl:variable name="APPVERSION">1.30.0</xsl:variable>
|
||||
<xsl:variable name="APPVERSION">1.30.1</xsl:variable>
|
||||
<xsl:variable name="SITEHOST">www.pcjs.org</xsl:variable>
|
||||
|
||||
<xsl:template name="componentStyles">
|
||||
<link rel="stylesheet" type="text/css" href="/versions/pcx86/1.30.0/components.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/versions/pcx86/1.30.1/components.css"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="componentScripts">
|
||||
|
|
@ -330,6 +331,7 @@
|
|||
<xsl:when test="@pos = 'center'">margin:0 auto;</xsl:when>
|
||||
<xsl:when test="@pos">position:<xsl:value-of select="@pos"/>;</xsl:when>
|
||||
<xsl:when test="$left != '' or $top != ''">position:relative;</xsl:when>
|
||||
<xsl:when test="@container">text-align:<xsl:value-of select="@container"/>;</xsl:when>
|
||||
<xsl:otherwise><xsl:if test="$left = ''">float:left;</xsl:if></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
|
@ -411,7 +413,7 @@
|
|||
</form>
|
||||
</xsl:when>
|
||||
<xsl:when test="@type = 'led' or @type = 'rled'">
|
||||
<div class="{$APPCLASS}-binding {$CSSCLASS}-{@type}" data-value="{{{$type},{$binding}}}"><xsl:value-of select="."/></div>
|
||||
<div class="{$APPCLASS}-binding {$CSSCLASS}-{@type}" data-value="{{{$type},{$binding}}}" style="display:inline-block;"><xsl:value-of select="."/></div>
|
||||
</xsl:when>
|
||||
<xsl:when test="@type = 'separator'">
|
||||
<hr/>
|
||||
|
|
@ -710,16 +712,16 @@
|
|||
|
||||
<xsl:template match="device[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="name">
|
||||
<xsl:variable name="type">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@name"><xsl:value-of select="@name"/></xsl:when>
|
||||
<xsl:when test="@type"><xsl:value-of select="@type"/></xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">device</xsl:with-param>
|
||||
<xsl:with-param name="parms">,name:'<xsl:value-of select="$name"/>'</xsl:with-param>
|
||||
<xsl:with-param name="parms">,type:'<xsl:value-of select="$type"/>'</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,49 @@
|
|||
(function(){var l,aa,ba={163840:[40,1,8],184320:[40,1,9],327680:[40,2,8],368640:[40,2,9],737280:[80,2,9],1228800:[80,2,15],1474560:[80,2,18],2949120:[80,2,36],21368320:[615,4,17]},p={uo:1,dl:3,vo:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,ue:65,Bi:66,Ci:67,Di:68,E:69,Ei:70,Fi:71,Gi:72,Hi:73,Ii:74,Ji:75,Ki:76,Li:77,Mi:78,Ni:79,Oi:80,Q:81,Pi:82,
|
||||
(function(){/*
|
||||
http://pcjs.org/modules/shared/lib/diskapi.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/dumpapi.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/reportapi.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/userapi.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/keys.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/strlib.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/usrlib.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/weblib.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/x86.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/interrupts.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/messages.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/debugger.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/debugger.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/embed.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/defines.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/component.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/defines.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/panel.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/bus.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/memory.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/cpu.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/x86seg.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/x86cpu.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/x86fpu.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/x86func.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/x86help.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/x86mods.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/x86ops.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/x86op0f.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/chipset.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/rom.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/ram.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/keyboard.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/video.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/parallelport.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/serialport.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/mouse.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/disk.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/fdc.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/hdc.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/computer.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/save.js (C) Jeff Parsons 2012-2016
|
||||
*/
|
||||
var l,aa,ba={163840:[40,1,8],184320:[40,1,9],327680:[40,2,8],368640:[40,2,9],737280:[80,2,9],1228800:[80,2,15],1474560:[80,2,18],2949120:[80,2,36],21368320:[615,4,17]},p={uo:1,dl:3,vo:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,ue:65,Bi:66,Ci:67,Di:68,E:69,Ei:70,Fi:71,Gi:72,Hi:73,Ii:74,Ji:75,Ki:76,Li:77,Mi:78,Ni:79,Oi:80,Q:81,Pi:82,
|
||||
Qi:83,Ri:84,Si:85,Ti:86,Ui:87,Vi:88,Wi:89,ng:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,ve:97,ol:98,ql:99,d:100,e:101,Al:102,Bl:103,Cl:104,Dl:105,Tm:106,k:107,Um:108,Ym:109,n:110,en:111,p:112,q:113,r:114,lo:115,t:116,oo:117,po:118,qo:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126},ca={};ca[186]=p[";"];ca[187]=p["="];ca[188]=p[","];ca[189]=p["-"];ca[190]=p["."];ca[191]=p["/"];ca[192]=p["`"];ca[219]=p["["];ca[220]=p["\\"];ca[221]=p["]"];ca[222]=p["'"];ca[173]=p["-"];var da={};da[p["1"]]=p["!"];
|
||||
da[p["2"]]=p["@"];da[p["3"]]=p["#"];da[p["4"]]=p.$;da[p["5"]]=p["%"];da[p["6"]]=p["^"];da[p["7"]]=p["&"];da[p["8"]]=p["*"];da[p["9"]]=p["("];da[p["0"]]=p[")"];da[186]=p[":"];da[187]=p["+"];da[188]=p["<"];da[189]=p._;da[190]=p[">"];da[191]=p["?"];da[192]=p["~"];da[219]=p["{"];da[220]=p["|"];da[221]=p["}"];da[222]=p['"'];da[173]=p._;da[61]=p["+"];da[59]=p[":"];
|
||||
function ea(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
|
||||
|
|
@ -370,9 +415,9 @@ a;Lf(this);return a},function(a){this.S|=2;this.A-=14+(-1===this.D?0:2);if(-1!==
|
|||
this.ja?b|=-16777216:80386<=this.ja&&2!=this.ba&&(a|=b<<16);this.nb(this.D+2,b);this.A-=12}return a},function(a){-1===this.D||this.ca&131072?E.call(this,6):(this.Ec=this.oa(this.D+2)&(this.R|this.R<<8),a&=65535,this.zd=this.Ec+a,this.S|=2,this.A-=11);return a},function(a){-1===this.D||this.ca&131072?E.call(this,6):(this.Mc=this.oa(this.D+2)&(this.R|this.R<<8),a&=65535,this.Sd=this.Mc+a,this.S|=2,this.A-=12);return a},function(){this.A-=2+(-1===this.D?0:1);return this.$a},W,function(a){this.ca&131072?
|
||||
E.call(this,6):(Of(this,a),this.A-=-1===this.D?3:6,this.S|=2);return a},W],tk=[W,W,W,W,Hh,Kh,Jh,Ih];
|
||||
function X(a){bb.call(this,"ChipSet",a,X,32768);var b=a.model;b&&!uk[b]&&w("Unrecognized ChipSet model: "+b);this.ja=uk[b]||vk;this.C=[];b=wk(a[xk]);this.C[0]=[b,b];null==b&&(this.ia=[360,360],(b=a.floppies)&&b.length&&(this.ia=b),yk(this,zk,this.ia.length),yk(this,Ak,a.monitor||(this.ja<kg?"mono":"ega")));b=wk(a[Bk]);this.C[1]=[b,b];this.cb=this.Da=1;this.ja>=kg&&(this.cb=this.Da=2);this.ka=a.scaleTimers||!1;this.Ub=a.rtcDate;this.Db=!1;a.sound&&(this.sb=this.Fa=null,window&&(this.sb=window.AudioContext||
|
||||
window.webkitAudioContext),this.sb&&(this.Fa=new this.sb));this.reset(!0);xb(this)}jb(X);var vk=5150.9,kg=5170,uk={5150:5150,5160:5160,5170:kg,att6300:5160.101,mpc1600:5150.101,z150:5160.15,compaq:5150.102,other:vk,deskpro386:5180},xk="sw1",Bk="sw2",Ck={jl:1,ONE:0,Io:64,Go:128,xo:192,Lc:192,Xg:6},Dk={Ho:16,to:32,yo:48,Lc:48,Xg:4},zk=1,Ak=4,Ek={5150:[{},{}]};Ek[5150][0][zk]={Lc:192,gd:{1:0,2:64,3:128,4:192},Pd:"Number of Floppy Drives"};Ek[5150][0][3]={Lc:2,gd:{0:0,1:2},Pd:"Coprocessor"};
|
||||
window.webkitAudioContext),this.sb&&(this.Fa=new this.sb));this.reset(!0);xb(this)}jb(X);var vk=5150.9,kg=5170,uk={5150:5150,5160:5160,5170:kg,att6300:5160.101,mpc1600:5150.101,z150:5160.15,compaq:5150.102,other:vk,deskpro386:5180},xk="sw1",Bk="sw2",Ck={jl:1,ONE:0,Io:64,Go:128,xo:192,Lc:192,Xg:6},Dk={Ho:16,to:32,yo:48,Lc:48,Xg:4},zk=1,Ak=4,Ek={5150:[{},{}]};Ek[5150][0][zk]={Lc:192,gd:{1:0,2:64,3:128,4:192},Pd:"Number of Floppy Drives"};Ek[5150][0][3]={Lc:2,gd:{0:0,1:2},Pd:"FPU"};
|
||||
Ek[5150][0][Ak]={Lc:48,gd:{0:0,1:16,2:32,3:48,none:0,tv:16,color:32,cga:32,mda:48,mono:48,ega:0,vga:0},Pd:"Monitor Type"};Ek[5150][0][5]={Lc:12,gd:{16:0,32:4,48:8,64:12},Pd:"Base Memory (16Kb Increments)"};Ek[5150][1][6]={Lc:31,gd:{0:0,32:1,64:2,96:3,128:4,160:5,192:6,224:7,256:8,288:9,320:10,352:11,384:12,416:13,448:14,480:15,512:16,544:17,576:18},Pd:"Expansion Memory (32Kb Increments)"};Ek[5160]=[{},{}];Ek[5160][0][zk]=Ek[5150][0][zk];Ek[5160][0][3]=Ek[5150][0][3];Ek[5160][0][Ak]=Ek[5150][0][Ak];
|
||||
Ek[5160][0][5]={Lc:12,gd:{64:0,128:4,192:8,256:12},Pd:"Base Memory (64Kb Increments)"};Ek[5160][1][6]=Ek[5150][1][6];Ek[5160.101]=[{},{}];Ek[5160.101][0][5]={Lc:143,gd:{128:1,256:130,512:8,640:141},Pd:"Base Memory (128Kb Increments)"};Ek[5160.101][0][3]={Lc:16,gd:{0:0,1:16},Pd:"Coprocessor"};Ek[5160.101][1][2]={Lc:1,gd:{0:0,1:1},Pd:"Floppy Type"};Ek[5160.101][1][zk]=Ek[5150][0][zk];Ek[5160.101][1][Ak]=Ek[5150][0][Ak];l=X.prototype;
|
||||
Ek[5160][0][5]={Lc:12,gd:{64:0,128:4,192:8,256:12},Pd:"Base Memory (64Kb Increments)"};Ek[5160][1][6]=Ek[5150][1][6];Ek[5160.101]=[{},{}];Ek[5160.101][0][5]={Lc:143,gd:{128:1,256:130,512:8,640:141},Pd:"Base Memory (128Kb Increments)"};Ek[5160.101][0][3]={Lc:16,gd:{0:0,1:16},Pd:"FPU"};Ek[5160.101][1][2]={Lc:1,gd:{0:0,1:1},Pd:"Floppy Type"};Ek[5160.101][1][zk]=Ek[5150][0][zk];Ek[5160.101][1][Ak]=Ek[5150][0][Ak];l=X.prototype;
|
||||
l.Pb=function(a,b,c){switch(b){case xk:return this.qa[b]=c,Fk(this,0,b),!0;case Bk:if(5150==(this.ja|0)||5160.101==this.ja)return this.qa[b]=c,Fk(this,1,b),!0;break;case "swdesc":return this.qa[b]=c,!0}return!1};
|
||||
l.Ic=function(a,b,c,d){this.ga=b;this.F=c;this.ha=d;this.X=a;this.Tb=Jb(a,"FPU");yk(this,3,this.Tb?1:0,!0);this.B=Jb(a,"Keyboard");this.gb=c.Y.Id/1193181;qc(b,this,Gk);yc(b,this,Hk);this.ja<kg?5160.101!=this.ja?(qc(b,this,Ik),yc(b,this,Jk)):(qc(b,this,Kk),yc(b,this,Lk)):(qc(b,this,Mk),yc(b,this,Nk),5180==(this.ja|0)&&(qc(b,this,Ok),yc(b,this,Pk)));if(d){var e=this;Qk(d,1024,function(){for(var a=0;a<e.vc.length;a++){for(var b=e.vc[a],c="PIC"+a+":",d=0;d<b.Yc.length;d++)c+=" IC"+(d+1)+"="+u(b.Yc[d]);
|
||||
c+=" IMR="+u(b.Ad)+" IRR="+u(b.lc)+" ISR="+u(b.Oc)+" DELAY="+b.nf;e.ha.O(c)}});Qk(d,2048,function(a){a=(a=a[0])?+a:null;for(var b=0;b<e.V.length;b++)if(null==a||b==a){Rk(e,b);var c=e.V[b],d="TIMER"+b+":",f=0;if(null!=c.md)for(var n=0;n<=c.md;n++)f|=c.Ab[n]<<8*n;d+=" mode="+(c.mode>>1)+" bytes="+c.md+" count="+v(f);e.ha.O(d)}});Qk(d,4096,function(){for(var a="",b=0;64>b;b++){var c=13>=b?Sk(e,b):e.A[b];a&&(a+="\n");a+="CMOS["+u(b)+"]: "+u(c)}e.ha.O(a)})}lf(c,26,this.Pm.bind(this))};
|
||||
|
|
@ -392,7 +437,7 @@ function Fk(a,b,c){for(var d="",e=a.qa[c],f=1;8>=f;f++){var g="pcjs-bitCell";f||
|
|||
function Yk(a,b,c){for(var d=null,e=Ek[a.ja]||Ek[a.ja|0]||Ek[5150],f=0;f<e.length;f++){var g=e[f];if(g&&(g=g[b])){a=a.C[f][c?0:1]&g.Lc;for(var h in g.gd)if(g.gd[h]==a&&(d=h,"number"==typeof+d))break;break}}return d}function $k(a,b){if(b<+Yk(a,zk,void 0)){if(!a.ia)return 1;if(b<a.ia.length)switch(a.ia[b]){case 160:case 180:case 320:case 360:return 1;case 720:return 3;case 1200:return 2;case 1440:return 4}}return 0}function Xk(a,b){return+Yk(a,5,b)+ +Yk(a,6,b)}
|
||||
function wk(a,b){if(a){b=0;for(var c=1,d=0;d<a.length;d++)"0"==a.charAt(d)&&(b|=c),c<<=1}return b}function yk(a,b,c,d){for(var e=Ek[a.ja]||Ek[a.ja|0]||Ek[5150],f=0;f<e.length;f++){var g=e[f];if(g&&(g=g[b]))for(var h in g.gd)if(h==c){a.C[f][d?0:1]&=~g.Lc;a.C[f][d?0:1]|=g.gd[h];return}}}function ll(a,b){a.setAttribute("data-value",b?"1":"0");a.style.color=b?"#ffffff":"#000000";a.style.backgroundColor=b?"#000000":"#ffffff"}function Tk(a){jl(a,0,xk);jl(a,1,Bk);ml(a)}
|
||||
function jl(a,b,c,d){if(c=a.qa[c]){d=d?a.C[b][0]:a.C[b][1]=a.C[b][0];c=tb(c,"pcjs-bitCell");for(var e=0;e<c.length;e++){var f=kl(a,b,e);c[e].setAttribute("title",f&&f.Pd||"Reserved");ll(c[e],d&1<<e?!1:!0);c[e].onclick=function(a,b){return function(){var c="1"!=b.getAttribute("data-value");ll(b,c);var d=b.getAttribute("id").split("-"),e=1<<+d[1]-1;switch(d[0]){case xk:a.C[0][0]=a.C[0][0]&~e|(c?0:e);break;case Bk:a.C[1][0]=a.C[1][0]&~e|(c?0:e)}ml(a)}}(a,c[e])}}}
|
||||
function ml(a){var b=a.qa.swdesc;if(null!=b){var c;c=""+(Xk(a,!0)+"Kb");c+=", "+(+ +Yk(a,3,!0)?"":"No ")+"Coprocessor";c+=", "+{0:"Enhanced Color",1:"TV",2:"Color",3:"Monochrome"}[+Yk(a,Ak,!0)]+" Monitor";c+=", "+ +Yk(a,zk,!0)+" Floppy Drives";if(null!=a.C[0][1]&&a.C[0][1]!=a.C[0][0]||null!=a.C[1][1]&&a.C[1][1]!=a.C[1][0])c+=" (Reset required)";b.textContent=c}}
|
||||
function ml(a){var b=a.qa.swdesc;if(null!=b){var c;c=""+(Xk(a,!0)+"Kb");c+=", "+(+ +Yk(a,3,!0)?"":"No ")+"FPU";c+=", "+{0:"Enhanced Color",1:"TV",2:"Color",3:"Monochrome"}[+Yk(a,Ak,!0)]+" Monitor";c+=", "+ +Yk(a,zk,!0)+" Floppy Drives";if(null!=a.C[0][1]&&a.C[0][1]!=a.C[0][0]||null!=a.C[1][1]&&a.C[1][1]!=a.C[1][0])c+=" (Reset required)";b.textContent=c}}
|
||||
function nl(a,b,c,d,e){var f=a.L[b],g=f.Dc[c],h=g.Eb[f.Kb];z(a,768)&&x(a,d,null,e,"DMA"+b+".CHANNEL"+c+".ADDR["+f.Kb+"]",h,!0);f.Kb^=1;b||c||f.Kb||(g.Eb[0]++,255<g.Eb[0]&&(g.Eb[0]=0,g.Eb[1]++,255<g.Eb[1]&&(g.Eb[1]=0)));return h}function ol(a,b,c,d,e,f){var g=a.L[b];z(a,768)&&x(a,d,e,f,"DMA"+b+".CHANNEL"+c+".ADDR["+g.Kb+"]",null,!0);a=g.Dc[c];a.Eb[g.Kb]=a.og[g.Kb]=e;g.Kb^=1}
|
||||
function pl(a,b,c,d,e){var f=a.L[b],g=f.Dc[c],h=g.Ab[f.Kb];z(a,768)&&x(a,d,null,e,"DMA"+b+".CHANNEL"+c+".COUNT["+f.Kb+"]",h,!0);f.Kb^=1;b||c||f.Kb||(g.Ab[0]--,0>g.Ab[0]&&(g.Ab[0]=255,g.Ab[1]--,0>g.Ab[1]&&(g.Ab[1]=255)));return h}function ql(a,b,c,d,e,f){var g=a.L[b];z(a,768)&&x(a,d,e,f,"DMA"+b+".CHANNEL"+c+".COUNT["+g.Kb+"]",null,!0);a=g.Dc[c];a.Ab[g.Kb]=a.Fc[g.Kb]=e;g.Kb^=1}function rl(a,b,c,d){var e=a.L[b],f=e.Yb|1;e.Yb&=-16;z(a,768)&&x(a,c,null,d,"DMA"+b+".STATUS",f,!0);return f}
|
||||
function sl(a,b,c,d,e){var f=a.L[b];z(a,768)&&x(a,c,d,e,"DMA"+b+".REQ",null,!0);a=d&3;f.Yb=f.Yb&~(16<<a)|(d&4)<<a+2;f.dj=d}function tl(a,b,c,d,e){var f=a.L[b];z(a,768)&&x(a,c,d,e,"DMA"+b+".MASK",null,!0);b=d&3;c=f.Dc[b];c.Ge=!!(d&4);c.Ge||ul(a,f.Zm+b)}function vl(a,b,c,d,e){z(a,768)&&x(a,c,d,e,"DMA"+b+".MODE",null,!0);a.L[b].Dc[d&3].mode=d}function wl(a,b,c,d){var e=a.L[b].ej;z(a,768)&&x(a,c,null,d,"DMA"+b+".TEMP",e,!0);return e}
|
||||
|
|
@ -779,28 +824,28 @@ g[0]){Lr(a,g[1],!0);break}Mr(a,g);break;case "m":if("mouse"==g[0]){var si=g[1],v
|
|||
null;else if("off"==Ma)vc=!1,Ma=null;else{"keys"==Ma&&(Ma="key");"kbd"==Ma&&(Ma="keyboard");for(uc in Eb)if(Ma==uc){rd=Eb[uc];vc=!!(a.wc&rd);break}if(!rd){a.O("unknown message category: "+Ma);break a}}rd&&("on"==g[2]?(a.wc|=rd,vc=!0):"off"==g[2]&&(a.wc&=~rd,vc=!1))}var qs=0,af="";for(uc in Eb)if(!Ma||Ma==uc){var rs=!!(a.wc&Eb[uc]);if(null===vc||vc==rs)af&&(af+=","),++qs%10||(af+="\n\t"),"key"==uc&&(uc="keys"),af+=uc}void 0===Ma&&a.O("message commands:\n\tm [category] [on|off]\tturn categories on/off");
|
||||
a.O((null!==vc?vc?"messages on: ":"messages off: ":"message categories:\n\t")+(af||"none"));yq(a)}break;case "o":var ti=g[1],ss=g[2];if(ti&&"?"!=ti){var ui=rq(a,ti,"port #"),vi=rq(a,ss);void 0!==ui&&void 0!==vi&&(zc(a.ga,ui,1,vi),a.O(v(ui)+": "+u(vi)))}else a.O("output commands:"),a.O("\to [p] [b]\twrite byte [b] to port [p]"),a.O("warning: port accesses can affect hardware state");break;case "p":if("print"==g[0]){Nr(a,b.substr(5));break}var Tn="pr"==g[0]?1:0,de=1+Tn;if(a.U)a.O("step in progress");
|
||||
else{var wg,Un=!1,kb=wq(a,M(a.F),a.F.wa.Z);do switch(wg=!1,a.Qa(kb)){case 38:case 46:case 54:case 62:case 100:case 101:case 102:case 103:case 240:fr(a,kb,1);wg=!0;break;case 204:case 206:a.U=de;fr(a,kb,1);break;case 205:case 224:case 225:case 226:a.U=de;fr(a,kb,kb.Rb?4:2);break;case 232:a.U=de;fr(a,kb,kb.Rb?5:3);break;case 154:a.U=de;fr(a,kb,kb.Rb?7:5);break;case 255:var Vn=a.tb(kb)&14591;if(4351==Vn||6399==Vn)a.U=de,yr(a,kb);break;case 243:case 242:fr(a,kb,1);Un=wg=!0;break;case 108:case 109:case 110:case 111:case 164:case 165:case 166:case 167:case 170:case 171:case 172:case 173:case 174:case 175:Un&&
|
||||
(a.U=de,fr(a,kb,1))}while(wg);a.U?(a.Rd(a.B,kb,!0),a.Ne()||(a.X&&a.X.wd(),a.U=0)):Pr(a,Tn?"tr":"t")}break;case "r":if("reset"==b){a.X&&a.X.reset();break}qr(a,g);break;case "t":Pr(a,g[0],g[1]);break;case "u":rr(a,g[1],g[2],8);break;case "v":if("var"==g[0]){Kr(a,b.substr(3))||(d=!1);break}a.O("PCx86 version 1.30.0 ("+a.F.ja+",RELEASE,NOPREFETCH"+(Ab?",TYPEDARRAYS":",LONGARRAYS")+",NOBACKTRACK)");a.O(Ca());break;case "x":a:if(g[1]&&"?"!=g[1])switch(g[1]){case "cs":var bf;void 0!==g[3]&&(bf=+g[3]);switch(g[2]){case "int":a.F.Y.jf=
|
||||
(a.U=de,fr(a,kb,1))}while(wg);a.U?(a.Rd(a.B,kb,!0),a.Ne()||(a.X&&a.X.wd(),a.U=0)):Pr(a,Tn?"tr":"t")}break;case "r":if("reset"==b){a.X&&a.X.reset();break}qr(a,g);break;case "t":Pr(a,g[0],g[1]);break;case "u":rr(a,g[1],g[2],8);break;case "v":if("var"==g[0]){Kr(a,b.substr(3))||(d=!1);break}a.O("PCx86 version 1.30.1 ("+a.F.ja+",RELEASE,NOPREFETCH"+(Ab?",TYPEDARRAYS":",LONGARRAYS")+",NOBACKTRACK)");a.O(Ca());break;case "x":a:if(g[1]&&"?"!=g[1])switch(g[1]){case "cs":var bf;void 0!==g[3]&&(bf=+g[3]);switch(g[2]){case "int":a.F.Y.jf=
|
||||
bf;break;case "start":a.F.Y.Mf=bf;break;case "stop":a.F.Y.lf=bf;break;default:a.O("unknown cs option");break a}void 0!==bf&&$c(a.F);a.O("checksums "+(a.F.la.Xe?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(dd(a.F,+g[2])||a.O("warning: using 1x multiplier, previous target not reached"));a.O("target speed: "+(a.F.Y.He.toFixed(2)+"Mhz")+" ("+a.F.Y.Wd+"x)");break;default:a.O("unknown option: "+g[1])}else a.O("execution options:"),a.O("\tcs int #\tset checksum cycle interval to #"),a.O("\tcs start #\tset checksum cycle start count to #"),
|
||||
a.O("\tcs stop #\tset checksum cycle stop count to #"),a.O("\tsp #\t\tset speed multiplier to #");break;case "?":if(g[1]){Nr(a,b.substr(1));break}var wi="commands:",xi;for(xi in Dq)wi+="\n"+pa(xi,7)+Dq[xi];ag(a)||(wi+="\nnote: frequency/history disabled if no exec breakpoints");a.O(wi);break;default:a.O("unknown command: "+b),d=!1}}}catch(Wn){a.O("debugger error: "+(Wn.stack||Wn.message)),d=!1}return d}function Aq(a,b,c){b=a.Ng(b,c);for(var d in b)if(!xr(a,b[+d]))return!1;return!0}
|
||||
Xa(function(){for(var a=tb(document,"pcx86","debugger"),b=0;b<a.length;b++){var c=a[b],d=qb(c),d=new vq(d);sb(d,c)}});
|
||||
function Rr(a,b,c){bb.call(this,"Computer",a,Rr,67108864);this.la.ic=!1;Sr(this,b);this.fa=Yc(this,"autoPower",a);this.N=0;this.ra=a.busWidth||a.buswidth;this.A=Tr;this.aa=null;this.V=this.pa=!1;this.ua=Yc(this,"url")||"";this.ya=(Math.random()+.1).toString(36).substr(2,12);this.B=Ur(this);if(this.F=pb("CPU",this.id)){this.ha=pb("Debugger",this.id);this.L=[];for(b=null;b=Jb(this,"Video",b);)this.L.push(b);this.ga=new Rb({id:this.ce+".bus",busWidth:this.ra},this.F,this.ha);var d,e=nb(this.id);if((this.C=
|
||||
pb("Panel",this.id))&&this.C.Gf)for(b=0;b<e.length;b++)d=e[b],d.Na=this.C.Na,d.O=this.C.O,d.Gf=this.C.Gf;this.O("PCx86 v1.30.0\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");for(b=0;b<e.length;b++)d=e[b],d.Ic&&d.Ic(this,this.ga,this.F,this.ha);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.W=d:this.A=parseInt(d,10));var f;if(a=Yc(this,"state")||(f=!0,a.state))b=this.ia=a,f||(this.V=!0,this.A=Tr),this.A&&(this.ea=new qf(this,
|
||||
"1.30.0"),this.ea.load()?b=null:delete this.ea);!b&&this.A&&(b=Vr(this))&&(this.V=!0);if(b){var g=this;Aa(b,null,!0,function(a,b,c){c?(g.W=null,g.V=!1,g.Na("Unable to load machine state from server (error "+c+(b?": "+qa(b):"")+")")):(g.aa=b,g.pa=!0);xb(g)})}else xb(this);this.qa.power||(this.fa=!0);!c&&this.fa&&Wr(this,this.cg)}else w("Unable to find CPU component")}jb(Rr);var Tr=0;l=Rr.prototype;l.gf=function(){return this.ya};
|
||||
pb("Panel",this.id))&&this.C.Gf)for(b=0;b<e.length;b++)d=e[b],d.Na=this.C.Na,d.O=this.C.O,d.Gf=this.C.Gf;this.O("PCx86 v1.30.1\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");for(b=0;b<e.length;b++)d=e[b],d.Ic&&d.Ic(this,this.ga,this.F,this.ha);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.W=d:this.A=parseInt(d,10));var f;if(a=Yc(this,"state")||(f=!0,a.state))b=this.ia=a,f||(this.V=!0,this.A=Tr),this.A&&(this.ea=new qf(this,
|
||||
"1.30.1"),this.ea.load()?b=null:delete this.ea);!b&&this.A&&(b=Vr(this))&&(this.V=!0);if(b){var g=this;Aa(b,null,!0,function(a,b,c){c?(g.W=null,g.V=!1,g.Na("Unable to load machine state from server (error "+c+(b?": "+qa(b):"")+")")):(g.aa=b,g.pa=!0);xb(g)})}else xb(this);this.qa.power||(this.fa=!0);!c&&this.fa&&Wr(this,this.cg)}else w("Unable to find CPU component")}jb(Rr);var Tr=0;l=Rr.prototype;l.gf=function(){return this.ya};
|
||||
function Sr(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){w(d.message+" ("+c+")")}}a.U=b}function Yc(a,b,c){var d=b.toLowerCase(),d=eb[b]||eb[d];void 0===d&&a.U&&(d=a.U[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}l.ie=function(){return this.B||""};function Wr(a,b,c){for(var d=nb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!yb(f)){yb(f,function(){Wr(a,b,c)});return}}b.call(a,c)}
|
||||
function Xr(a,b){var c=new qf(a,"1.30.0","validate");if(c.load()&&Yr(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.Na("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}
|
||||
l.cg=function(a){void 0===a&&(a=this.A||(this.aa?1:Tr));if(!this.N){this.N++;var b=!1,c=!1;this.ka=!1;var d=this.ea||new qf(this,"1.30.0");if(-1==a)b=!0;else if(a>Tr){if(d.load(this.aa)){this.X=new qf(this,"1.30.0","failsafe");this.X.load()&&(Zr(this,d),a=2,$r(this.X));this.X.set("timestamp",ua());as(this.X);var e=this.A&&!this.V;if(1==a||Ea("Click OK to restore the previous PCx86 machine state, or CANCEL to reset the machine.")){if(c=Yr(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?d.load(g):
|
||||
function Xr(a,b){var c=new qf(a,"1.30.1","validate");if(c.load()&&Yr(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.Na("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}
|
||||
l.cg=function(a){void 0===a&&(a=this.A||(this.aa?1:Tr));if(!this.N){this.N++;var b=!1,c=!1;this.ka=!1;var d=this.ea||new qf(this,"1.30.1");if(-1==a)b=!0;else if(a>Tr){if(d.load(this.aa)){this.X=new qf(this,"1.30.1","failsafe");this.X.load()&&(Zr(this,d),a=2,$r(this.X));this.X.set("timestamp",ua());as(this.X);var e=this.A&&!this.V;if(1==a||Ea("Click OK to restore the previous PCx86 machine state, or CANCEL to reset the machine.")){if(c=Yr(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?d.load(g):
|
||||
("error"==f&&"no machine state"!=g?(this.Na("Error: "+g),"unable to verify user"==g&&(Ia("user",""),this.B=null)):this.O(f+": "+g),$r(d),d.load()?(c=Yr(d),e=!0):c=!1))}e&&Xr(this,c?d:null)}else 2==a&&d.clear()}else Xr(this);delete this.aa;delete this.ea}e=nb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.F&&(c=bs(this,g,d,b,c));b=[d,a,c];-1!=a?Wr(this,this.qj,b):this.qj(b)}};
|
||||
function bs(a,b,c,d,e){if(!b.la.ic){b.la.ic=!0;if(b.hc){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.hc(f,d)&&f&&(w("Unable to restore state for "+b.type),a.ia&&!a.pa?(c.clear(),a.A=Tr,window&&window.location.reload()):a.ka=!0,b.hc(null),e=!1)}if(!d&&b.al)for(a=b.al.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
l.qj=function(a){var b=a[0],c=0>a[1];a=a[2];this.va=!0;this.la.ic=!0;var d=this.qa.power;d&&(d.textContent="Shutdown");this.F&&(bs(this,this.F,b,c,a),this.F.Cf());this.ka&&(Zr(this,b),b.clear());!c&&this.X&&(this.X.clear(),delete this.X);this.N=0};
|
||||
function Zr(a,b){if(Ea("There may be a problem with your PCx86 machine.\n\nTo help us diagnose it, click OK to send this PCx86 machine state to http://www.pcjs.org.")){var c=a.ie();b=b.toString();var d={app:"PCx86",ver:"1.30.0"};d.url=a.ua;d.user=c;d.type="bug";d.data=b;Aa("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function Qr(a,b,c){var d,e="none";if(a.N)return null;a.N--;var f=new qf(a,"1.30.0"),g=new qf(a,"1.30.0","validate"),h=ua();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.0");f.set("url",window?window.location.href:null);f.set("browser",Ca());a.F&&a.F.gc&&(c&&a.F.Wb(),d=a.F.gc(b,c),"object"===typeof d&&f.set(a.F.id,d),c&&(a.F.la.ic=!1,!1===d&&(e=null)));for(var h=nb(a.id),k=0;k<h.length;k++){var m=h[k];m.la.ic&&(m.gc&&(d=m.gc(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.la.ic=!1,
|
||||
function Zr(a,b){if(Ea("There may be a problem with your PCx86 machine.\n\nTo help us diagnose it, click OK to send this PCx86 machine state to http://www.pcjs.org.")){var c=a.ie();b=b.toString();var d={app:"PCx86",ver:"1.30.1"};d.url=a.ua;d.user=c;d.type="bug";d.data=b;Aa("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function Qr(a,b,c){var d,e="none";if(a.N)return null;a.N--;var f=new qf(a,"1.30.1"),g=new qf(a,"1.30.1","validate"),h=ua();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",Ca());a.F&&a.F.gc&&(c&&a.F.Wb(),d=a.F.gc(b,c),"object"===typeof d&&f.set(a.F.id,d),c&&(a.F.la.ic=!1,!1===d&&(e=null)));for(var h=nb(a.id),k=0;k<h.length;k++){var m=h[k];m.la.ic&&(m.gc&&(d=m.gc(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.la.ic=!1,
|
||||
!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.B&&cs(a,a.B,f.toString()),as(g)&&as(f)||(e=null,d=h=!0)):a.A&&(d=!0,h=3==a.A),d&&f.clear(h)):e=f.toString());c&&(a.la.ic=!1,b=a.qa.power)&&(b.textContent="Power");a.N=0;return e}l.reset=function(){this.ga&&this.ga.reset&&(y(this,"Resetting "+this.ga.type),this.ga.reset());for(var a=nb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.ga&&c.reset&&(y(this,"Resetting "+c.type),c.reset())}};
|
||||
l.start=function(a,b){for(var c=nb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};l.stop=function(a,b){for(var c=nb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
|
||||
l.Pb=function(a,b,c){var d=this;switch(b){case "power":return this.qa[b]=c,c.onclick=function(){d.N||(d.la.ic?Qr(d,!1,!0):Wr(d,d.cg))},!0;case "reset":return this.qa[b]=c,c.onclick=function(){if(d.la.ic&&!d.N)if(d.A&&!d.W){var a=Ea("Click OK to save changes to this PCx86 machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Qr(d,a,!0);!a&&d.ia?window&&window.location.reload():(a||(d.lh=!0),d.cg(Tr),d.lh=!1)}else d.reset(),d.F&&d.F.Cf()},!0;case "save":if(ma(Ba(),"pcjs.org"))c.parentNode.removeChild(c);
|
||||
else return this.qa[b]=c,c.onclick=function(){var a=Ur(d,!0);if(a){var b=!!(d.A&&!d.W||d.ia),c=Qr(d,b);b?cs(d,a,c):d.Na("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function Ur(a,b){var c=a.B;c||((c=Ha("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=ds(a,c))||a.Na("The user ID is invalid.")):b&&a.Na("Browser local storage is not available"));return c}
|
||||
function ds(a,b){a.B=null;b=Aa(Ba()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ia("user",b.data),a.B=b.data)}catch(d){w(d.message+" ("+c+")")}return a.B}function Vr(a){var b=null;a.B&&(b=Ba()+"/api/v1/user?req=load&user="+a.B+"&state="+es(a,"1.30.0"));return b}
|
||||
function cs(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=es(a,"1.30.0");d.data=c;b=Aa(Ba()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.Na("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.Na(c),Ia("user",""),a.B=null)}}
|
||||
function ds(a,b){a.B=null;b=Aa(Ba()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ia("user",b.data),a.B=b.data)}catch(d){w(d.message+" ("+c+")")}return a.B}function Vr(a){var b=null;a.B&&(b=Ba()+"/api/v1/user?req=load&user="+a.B+"&state="+es(a,"1.30.1"));return b}
|
||||
function cs(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=es(a,"1.30.1");d.data=c;b=Aa(Ba()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.Na("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.Na(c),Ia("user",""),a.B=null)}}
|
||||
function Jb(a,b,c){a=nb(a.id);for(var d=0;d<a.length;d++){var e=a[d];if(c)c==e&&(c=null);else if(e.type==b)return e}return null}l.wd=function(a){if(this.L.length){var b=0,c=0;a&&window&&(b=window.scrollX,c=window.scrollY);var d=this.L[0];d.X&&d.X.focus();a&&window&&window.scrollTo(b,c)}};l.pd=function(a){this.F&&this.F.pd(a);this.C&&this.C.pd(a)};
|
||||
function jd(a,b){for(var c=0;c<a.L.length;c++)un(a.L[c],b);if(a.C&&(a=a.C,a.Ja)){Ob(a,18,a.aa,a.Ga);if(a.gb){b=a.ga;var c=a.A,d,e;null==d&&(d=0);null==e&&(e=b.W-d|0);c||(c={ih:0,Td:0,Yg:[]});var f=d>>>b.La;d=d+e-1>>>b.La;c.ih=0;for(c.Td=0;f<=d;)e=b.sa[f],c.ih+=e.size,e.size&&(c.Yg.push(wa(Nb,f,0,0,e.type)),c.Td++),f++;a.A=c;a.ya=a.A.Td*a.ga.Sb/691200;d=0;a.A.fj=0;a.A.Bf||(a.A.Bf=[]);e=-1;b=0;for(var g=-1,c=0;c<a.A.Td;c++){var h=a.A.Yg[c],f=xa(Nb.type,h),h=xa(Nb.Hk,h);if(f!=e||h!=g+1)(g=c-b)&&(d+=
|
||||
Qb(a,b,g,e)),e=f,b=c;g=h}d+=Qb(a,b,c-b,e);e=a.A.ul!=d;a.A.ul=d;if(e){e=new Hb(0,0,a.aa.width,a.aa.height);a.A.Se=[];b=a.A.Td;for(d=0;d<a.A.fj;d++)c=a.A.Bf[d].Td,a.A.Se.push(Ib(e,c,b,!d)),b-=c;for(d=0;d<a.A.Se.length;d++)e=a.A.Bf[d],b=c=a.A.Se[d],f=a.Ga,(g=Fc[e.type])||(g=new Gb),f.strokeStyle="black",f.strokeRect(b.x,b.y,b.ad,b.A),f.fillStyle="string"==typeof g?g:g.toString(),f.fillRect(b.x,b.y,b.ad,b.A),b=a,f=c,b.fa=b.ua,b.W=b.va,c=f.x+(f.ad>>1),g=f.y+(f.A>>1),h=f.A,f.ad<f.A&&(h=f.ad,b.ra=!0,b.N.save(),
|
||||
|
|
@ -815,9 +860,9 @@ a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pcx86$2")
|
|||
function ts(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");Aa(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var k=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)k=0>k.indexOf(m[1])?k.replace(">",m[0]+">"):k.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=k&&(g=g.replace(h[0],k))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],g);ts(a,b,c)}})}else c(a,null)}
|
||||
function us(a,b,c,d){function e(a){if(void 0===h){var b=g&&tb(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=oa(a))}function f(a){e("Error: "+a);k&&(--fs||Za(!0));k=!1}var g,h,k=!0;fs++;lb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=m:t.appendChild(document.createTextNode(m));n.appendChild(t)}c||
|
||||
(c="/versions/pcx86/1.30.0/components.xsl");m=function(d,h){h?gs(c,null,null,!1,e,function(d,k){k?(mb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(k=h.transformNode(k))?(g.outerHTML=k,--fs||Za(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(k),(k=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(k,g),--fs||Za(!0)):f("invalid machine element: "+
|
||||
(c="/versions/pcx86/1.30.1/components.xsl");m=function(d,h){h?gs(c,null,null,!1,e,function(d,k){k?(mb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(k=h.transformNode(k))?(g.outerHTML=k,--fs||Za(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(k),(k=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(k,g),--fs||Za(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?gs(b,a,d,!0,e,m):hs(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(q){f(q.message)}return k}function vs(a,b,c,d){Za(!1);return us(a,b,c,d)}window.embedPC=vs;window.embedPCx86=vs;window.enableEvents=Za;window.sendEvent=$a;
|
||||
function ws(a,b,c,d){if(!c&&b){d.push(b);a=lb[d[0]];b=null;for(var e in a)if(ma(e,"components.xsl")){b=e.replace(".xsl",".css");break}b?Aa(b,null,!0,function(a,b){xs(b,d)}):xs(null,d)}else w("Error ("+c+") requesting "+a)}
|
||||
function xs(a,b){var c,d,e,f=b[0],g=b[1];c=b[4];c=c.match(/^(\s*\(function\(\)\{)([\s\S]*)(}\)\(\);\s*)$/);var h=lb[f],k={},m;for(m in h){var n=h[m],t=ka(m);if("xml"==t){for(t=/[ \t]*<disk [^>]*path=(['"])(.*?)\1.*?<\/disk>\n?/g;d=t.exec(h[m]);){var q=d[2];q&&(h[q]||(n=n.replace(d[0],"")))}d=m=ja(m)}else"xsl"==t&&(e=m=ja(m));k[m]=n}a&&(k[m="css"]=a);b[2]&&(k[m="parms"]=b[2]);b[3]&&(k[m="state"]=b[3]);d&&e?(a=JSON.stringify(k),g+=".js",c=c[1]+"var resources="+a+";"+c[2]+c[3],c=c.replace(/\u00A9/g,
|
||||
"©"),a=Na(c,"javascript",!1,g),a=a+(', copy it to your web server as "'+g+'", and then add the following to your web page:\n\n')+('<div id="'+f+'"></div>\n')+"...\n",a=a+('<script type="text/javascript" src="'+g+'">\x3c/script>\n')+('<script type="text/javascript">embedPC("'+f+'","'+d+'","'+e+'");\x3c/script>\n\n')+"The machine should appear where the <div> is located.",w(a)):w("Missing XML/XSL resources")}
|
||||
window.savePC=function(a,b,c){var d=pb("Computer",a),e=pb("Debugger",a);if(d){var f=Qr(d,!0),g=d.U?JSON.stringify(d.U):null;b||(b="/versions/pcjs/1.30.0/pc"+(e?"-dbg":"")+".js");if(c&&c({state:f,Ok:g}))return!0;Aa(b,null,!0,function(c,d,e){ws(c,d,e,[a,ja(b,!0),g,f])});return!0}w("Unable to identify machine '"+a+"'");return!1};})();
|
||||
window.savePC=function(a,b,c){var d=pb("Computer",a),e=pb("Debugger",a);if(d){var f=Qr(d,!0),g=d.U?JSON.stringify(d.U):null;b||(b="/versions/pcjs/1.30.1/pc"+(e?"-dbg":"")+".js");if(c&&c({state:f,Ok:g}))return!0;Aa(b,null,!0,function(c,d,e){ws(c,d,e,[a,ja(b,!0),g,f])});return!0}w("Unable to identify machine '"+a+"'");return!1};})();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,49 @@
|
|||
(function(){var l,ba,ca={163840:[40,1,8],184320:[40,1,9],327680:[40,2,8],368640:[40,2,9],737280:[80,2,9],1228800:[80,2,15],1474560:[80,2,18],2949120:[80,2,36],21368320:[615,4,17]},n={Tm:1,Sj:3,Um:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,Jd:65,wh:66,xh:67,yh:68,E:69,zh:70,Ah:71,Bh:72,Ch:73,Dh:74,Eh:75,Fh:76,Gh:77,Ih:78,Kh:79,Mh:80,Q:81,Ph:82,
|
||||
(function(){/*
|
||||
http://pcjs.org/modules/shared/lib/diskapi.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/dumpapi.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/reportapi.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/userapi.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/keys.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/strlib.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/usrlib.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/weblib.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/x86.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/interrupts.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/messages.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/debugger.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/debugger.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/embed.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/defines.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/component.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/defines.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/panel.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/bus.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/memory.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/cpu.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/x86seg.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/x86cpu.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/x86fpu.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/x86func.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/x86help.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/x86mods.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/x86ops.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/x86op0f.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/chipset.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/rom.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/ram.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/keyboard.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/video.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/parallelport.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/serialport.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/mouse.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/disk.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/fdc.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/hdc.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/pcx86/lib/computer.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/save.js (C) Jeff Parsons 2012-2016
|
||||
*/
|
||||
var l,ba,ca={163840:[40,1,8],184320:[40,1,9],327680:[40,2,8],368640:[40,2,9],737280:[80,2,9],1228800:[80,2,15],1474560:[80,2,18],2949120:[80,2,36],21368320:[615,4,17]},n={Tm:1,Sj:3,Um:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,Jd:65,wh:66,xh:67,yh:68,E:69,zh:70,Ah:71,Bh:72,Ch:73,Dh:74,Eh:75,Fh:76,Gh:77,Ih:78,Kh:79,Mh:80,Q:81,Ph:82,
|
||||
Rh:83,Th:84,Vh:85,Xh:86,Zh:87,ai:88,ci:89,vf:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Ld:97,bk:98,ck:99,d:100,e:101,mk:102,nk:103,pk:104,qk:105,Bl:106,k:107,Cl:108,Fl:109,n:110,Kl:111,p:112,q:113,r:114,Mm:115,t:116,Pm:117,Qm:118,Rm:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126},da={};da[186]=n[";"];da[187]=n["="];da[188]=n[","];da[189]=n["-"];da[190]=n["."];da[191]=n["/"];da[192]=n["`"];da[219]=n["["];da[220]=n["\\"];da[221]=n["]"];da[222]=n["'"];da[173]=n["-"];var p={};p[n["1"]]=n["!"];
|
||||
p[n["2"]]=n["@"];p[n["3"]]=n["#"];p[n["4"]]=n.$;p[n["5"]]=n["%"];p[n["6"]]=n["^"];p[n["7"]]=n["&"];p[n["8"]]=n["*"];p[n["9"]]=n["("];p[n["0"]]=n[")"];p[186]=n[":"];p[187]=n["+"];p[188]=n["<"];p[189]=n._;p[190]=n[">"];p[191]=n["?"];p[192]=n["~"];p[219]=n["{"];p[220]=n["|"];p[221]=n["}"];p[222]=n['"'];p[173]=n._;p[61]=n["+"];p[59]=n[":"];
|
||||
function ea(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
|
||||
|
|
@ -355,9 +400,9 @@ var ce=[function(){this.A-=2+(-1===this.F?0:1);return this.Zb.ja},function(){thi
|
|||
var b=this.Ab;80286==this.ca?b|=-16777216:80386<=this.ca&&2!=this.U&&(a|=b<<16);this.Va(this.F+2,b);this.A-=12}return a},function(a){-1===this.F||this.X&131072?v.call(this,6):(this.ub=this.fa(this.F+2)&(this.N|this.N<<8),a&=65535,this.wc=this.ub+a,this.L|=2,this.A-=11);return a},function(a){-1===this.F||this.X&131072?v.call(this,6):(this.Ab=this.fa(this.F+2)&(this.N|this.N<<8),a&=65535,this.xc=this.Ab+a,this.L|=2,this.A-=12);return a},function(){this.A-=2+(-1===this.F?0:1);return this.Pa},T,function(a){this.X&
|
||||
131072?v.call(this,6):(Ce(this,a),this.A-=-1===this.F?3:6,this.L|=2);return a},T],Ai=[T,T,T,T,hg,kg,jg,ig];
|
||||
function U(a){Ka.call(this,"ChipSet",a,U);var b=a.model;b&&!Bi[b]&&r("Unrecognized ChipSet model: "+b);this.ca=Bi[b]||Ci;this.D=[];b=Di(a[Ei]);this.D[0]=[b,b];null==b&&(this.Y=[360,360],(b=a.floppies)&&b.length&&(this.Y=b),Fi(this,Gi,this.Y.length),Fi(this,Hi,a.monitor||(this.ca<Se?"mono":"ega")));b=Di(a[Ii]);this.D[1]=[b,b];this.Ea=this.pa=1;this.ca>=Se&&(this.Ea=this.pa=2);this.Z=a.scaleTimers||!1;this.Xa=a.rtcDate;this.Oa=!1;a.sound&&(this.La=this.qa=null,window&&(this.La=window.AudioContext||
|
||||
window.webkitAudioContext),this.La&&(this.qa=new this.La));this.reset(!0);t(this)}Ta(U);var Ci=5150.9,Se=5170,Bi={5150:5150,5160:5160,5170:Se,att6300:5160.101,mpc1600:5150.101,z150:5160.15,compaq:5150.102,other:Ci,deskpro386:5180},Ei="sw1",Ii="sw2",Ji={Yj:1,ONE:0,gn:64,en:128,Wm:192,lc:192,eg:6},Ki={fn:16,Sm:32,Xm:48,lc:48,eg:4},Gi=1,Hi=4,W={5150:[{},{}]};W[5150][0][Gi]={lc:192,Nc:{1:0,2:64,3:128,4:192},ed:"Number of Floppy Drives"};W[5150][0][3]={lc:2,Nc:{0:0,1:2},ed:"Coprocessor"};
|
||||
window.webkitAudioContext),this.La&&(this.qa=new this.La));this.reset(!0);t(this)}Ta(U);var Ci=5150.9,Se=5170,Bi={5150:5150,5160:5160,5170:Se,att6300:5160.101,mpc1600:5150.101,z150:5160.15,compaq:5150.102,other:Ci,deskpro386:5180},Ei="sw1",Ii="sw2",Ji={Yj:1,ONE:0,gn:64,en:128,Wm:192,lc:192,eg:6},Ki={fn:16,Sm:32,Xm:48,lc:48,eg:4},Gi=1,Hi=4,W={5150:[{},{}]};W[5150][0][Gi]={lc:192,Nc:{1:0,2:64,3:128,4:192},ed:"Number of Floppy Drives"};W[5150][0][3]={lc:2,Nc:{0:0,1:2},ed:"FPU"};
|
||||
W[5150][0][Hi]={lc:48,Nc:{0:0,1:16,2:32,3:48,none:0,tv:16,color:32,cga:32,mda:48,mono:48,ega:0,vga:0},ed:"Monitor Type"};W[5150][0][5]={lc:12,Nc:{16:0,32:4,48:8,64:12},ed:"Base Memory (16Kb Increments)"};W[5150][1][6]={lc:31,Nc:{0:0,32:1,64:2,96:3,128:4,160:5,192:6,224:7,256:8,288:9,320:10,352:11,384:12,416:13,448:14,480:15,512:16,544:17,576:18},ed:"Expansion Memory (32Kb Increments)"};W[5160]=[{},{}];W[5160][0][Gi]=W[5150][0][Gi];W[5160][0][3]=W[5150][0][3];W[5160][0][Hi]=W[5150][0][Hi];
|
||||
W[5160][0][5]={lc:12,Nc:{64:0,128:4,192:8,256:12},ed:"Base Memory (64Kb Increments)"};W[5160][1][6]=W[5150][1][6];W[5160.101]=[{},{}];W[5160.101][0][5]={lc:143,Nc:{128:1,256:130,512:8,640:141},ed:"Base Memory (128Kb Increments)"};W[5160.101][0][3]={lc:16,Nc:{0:0,1:16},ed:"Coprocessor"};W[5160.101][1][2]={lc:1,Nc:{0:0,1:1},ed:"Floppy Type"};W[5160.101][1][Gi]=W[5150][0][Gi];W[5160.101][1][Hi]=W[5150][0][Hi];l=U.prototype;
|
||||
W[5160][0][5]={lc:12,Nc:{64:0,128:4,192:8,256:12},ed:"Base Memory (64Kb Increments)"};W[5160][1][6]=W[5150][1][6];W[5160.101]=[{},{}];W[5160.101][0][5]={lc:143,Nc:{128:1,256:130,512:8,640:141},ed:"Base Memory (128Kb Increments)"};W[5160.101][0][3]={lc:16,Nc:{0:0,1:16},ed:"FPU"};W[5160.101][1][2]={lc:1,Nc:{0:0,1:1},ed:"Floppy Type"};W[5160.101][1][Gi]=W[5150][0][Gi];W[5160.101][1][Hi]=W[5150][0][Hi];l=U.prototype;
|
||||
l.zb=function(a,b,c){switch(b){case Ei:return this.la[b]=c,Li(this,0,b),!0;case Ii:if(5150==(this.ca|0)||5160.101==this.ca)return this.la[b]=c,Li(this,1,b),!0;break;case "swdesc":return this.la[b]=c,!0}return!1};
|
||||
l.pc=function(a,b,c,d){this.ia=b;this.A=c;this.Ia=d;this.ba=a;this.od=mb(a,"FPU");Fi(this,3,this.od?1:0,!0);this.C=mb(a,"Keyboard");this.Ga=c.T.Yc/1193181;Sb(b,this,Mi);Ub(b,this,Ni);this.ca<Se?5160.101!=this.ca?(Sb(b,this,Oi),Ub(b,this,Pi)):(Sb(b,this,Qi),Ub(b,this,Ri)):(Sb(b,this,Si),Ub(b,this,Ti),5180==(this.ca|0)&&(Sb(b,this,Ui),Ub(b,this,Vi)))};l.Ub=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};l.Tb=function(a){return a?this.save():!0};
|
||||
l.reset=function(a){var b;Wi(this);this.G=Array(this.Ea);for(b=0;b<this.Ea;b++)Xi(this,b);this.gc=Array(this.pa);Yi(this,0,32);1<this.pa&&Yi(this,1,160);this.za=this.xa=null;this.K=Array(5180==(this.ca|0)?6:3);for(b=0;b<this.K.length;b++)Zi(this,b);this.oa=this.Ja=this.S=this.Da=null;this.ma=0;5160.101==this.ca&&(this.ka=0);if(this.ca>=Se){this.H=16;this.P=0;this.R=16;this.ua=0;this.W=160;512<=$i(this)&&(this.W|=16);3==+aj(this,Hi,void 0)&&(this.W|=64);5180==(this.ca|0)&&(this.W|=12);this.va=3;this.I=
|
||||
|
|
@ -375,7 +420,7 @@ function Li(a,b,c){for(var d="",e=a.la[c],f=1;8>=f;f++){var g="pcjs-bitCell";f||
|
|||
function aj(a,b,c){for(var d=null,e=W[a.ca]||W[a.ca|0]||W[5150],f=0;f<e.length;f++){var g=e[f];if(g&&(g=g[b])){a=a.D[f][c?0:1]&g.lc;for(var h in g.Nc)if(g.Nc[h]==a&&(d=h,"number"==typeof+d))break;break}}return d}function cj(a,b){if(b<+aj(a,Gi,void 0)){if(!a.Y)return 1;if(b<a.Y.length)switch(a.Y[b]){case 160:case 180:case 320:case 360:return 1;case 720:return 3;case 1200:return 2;case 1440:return 4}}return 0}function $i(a,b){return+aj(a,5,b)+ +aj(a,6,b)}
|
||||
function Di(a,b){if(a){b=0;for(var c=1,d=0;d<a.length;d++)"0"==a.charAt(d)&&(b|=c),c<<=1}return b}function Fi(a,b,c,d){for(var e=W[a.ca]||W[a.ca|0]||W[5150],f=0;f<e.length;f++){var g=e[f];if(g&&(g=g[b]))for(var h in g.Nc)if(h==c){a.D[f][d?0:1]&=~g.lc;a.D[f][d?0:1]|=g.Nc[h];return}}}function oj(a,b){a.setAttribute("data-value",b?"1":"0");a.style.color=b?"#ffffff":"#000000";a.style.backgroundColor=b?"#000000":"#ffffff"}function Wi(a){mj(a,0,Ei);mj(a,1,Ii);pj(a)}
|
||||
function mj(a,b,c,d){if(c=a.la[c]){d=d?a.D[b][0]:a.D[b][1]=a.D[b][0];c=bb(c,"pcjs-bitCell");for(var e=0;e<c.length;e++){var f=nj(a,b,e);c[e].setAttribute("title",f&&f.ed||"Reserved");oj(c[e],d&1<<e?!1:!0);c[e].onclick=function(a,b){return function(){var c="1"!=b.getAttribute("data-value");oj(b,c);var d=b.getAttribute("id").split("-"),e=1<<+d[1]-1;switch(d[0]){case Ei:a.D[0][0]=a.D[0][0]&~e|(c?0:e);break;case Ii:a.D[1][0]=a.D[1][0]&~e|(c?0:e)}pj(a)}}(a,c[e])}}}
|
||||
function pj(a){var b=a.la.swdesc;if(null!=b){var c;c=""+($i(a,!0)+"Kb");c+=", "+(+ +aj(a,3,!0)?"":"No ")+"Coprocessor";c+=", "+{0:"Enhanced Color",1:"TV",2:"Color",3:"Monochrome"}[+aj(a,Hi,!0)]+" Monitor";c+=", "+ +aj(a,Gi,!0)+" Floppy Drives";if(null!=a.D[0][1]&&a.D[0][1]!=a.D[0][0]||null!=a.D[1][1]&&a.D[1][1]!=a.D[1][0])c+=" (Reset required)";b.textContent=c}}
|
||||
function pj(a){var b=a.la.swdesc;if(null!=b){var c;c=""+($i(a,!0)+"Kb");c+=", "+(+ +aj(a,3,!0)?"":"No ")+"FPU";c+=", "+{0:"Enhanced Color",1:"TV",2:"Color",3:"Monochrome"}[+aj(a,Hi,!0)]+" Monitor";c+=", "+ +aj(a,Gi,!0)+" Floppy Drives";if(null!=a.D[0][1]&&a.D[0][1]!=a.D[0][0]||null!=a.D[1][1]&&a.D[1][1]!=a.D[1][0])c+=" (Reset required)";b.textContent=c}}
|
||||
function uj(a,b,c){a=a.G[b];var d=a.$b[c],e=d.gb[a.Ib];a.Ib^=1;b||c||a.Ib||(d.gb[0]++,255<d.gb[0]&&(d.gb[0]=0,d.gb[1]++,255<d.gb[1]&&(d.gb[1]=0)));return e}function vj(a,b,c,d){a=a.G[b];c=a.$b[c];c.gb[a.Ib]=c.wf[a.Ib]=d;a.Ib^=1}function wj(a,b,c){a=a.G[b];var d=a.$b[c],e=d.hb[a.Ib];a.Ib^=1;b||c||a.Ib||(d.hb[0]--,0>d.hb[0]&&(d.hb[0]=255,d.hb[1]--,0>d.hb[1]&&(d.hb[1]=255)));return e}function xj(a,b,c,d){a=a.G[b];c=a.$b[c];c.hb[a.Ib]=c.jc[a.Ib]=d;a.Ib^=1}
|
||||
function yj(a,b){a=a.G[b];b=a.Db|1;a.Db&=-16;return b}function zj(a,b,c){a=a.G[b];b=c&3;a.Db=a.Db&~(16<<b)|(c&4)<<b+2;a.hi=c}function Aj(a,b,c){b=a.G[b];var d=c&3,e=b.$b[d];e.Rd=!!(c&4);e.Rd||Bj(a,b.Gl+d)}function Cj(a,b){a=a.G[b];for(b=0;b<a.$b.length;b++)hj(a,b)}function Dj(a,b,c){return a.G[b].$b[c].xf}function Ej(a,b,c,d){a.G[b].$b[c].xf=d}function Fj(a,b,c,d,e){jj(a.G[b>>2].$b[b&3],c,d,e)}function Bj(a,b,c){b=a.G[b>>2].$b[b&3];b.Ef&&b.qg&&b.Sf?(c&&(b.done=c),b.Rd||Gj(a,b,!0)):c&&c(!0)}
|
||||
function Gj(a,b,c){c&&(b.count=b.hb[1]<<8|b.hb[0],b.type=b.mode&12,b.si=b.Ff=!1);for(var d=!1;0<=b.count&&(c=b.xf<<16|b.gb[1]<<8|b.gb[0],4==b.type?(d=!0,function(c){b.qg.call(b.Ef,b.Sf,-1,function(e,g){0>e&&(b.si||(b.si=!0),e=255);b.Rd||a.ia.Mc(c,e);(d=g)&&setTimeout(function(){Hj(b)||Gj(a,b)},0)})}(c)):8==b.type?(c=a.ia.Jb(c),0>b.qg.call(b.Ef,b.Sf,c)&&(b.Ff=!0)):0!=b.type&&(b.Ff=!0)),!d&&!Hj(b););}
|
||||
|
|
@ -602,23 +647,23 @@ function an(a,b){if(a.errorCode)return-1;do{if(a.Wa&&a.ta.write(a.Wa,a.Ua++,b))b
|
|||
var Qm={800:Z.prototype.wl,801:Z.prototype.xl,802:Z.prototype.vl},Pm={496:Z.prototype.Xj,497:Z.prototype.Dk,498:Z.prototype.Fk,499:Z.prototype.Gk,500:Z.prototype.Bk,501:Z.prototype.Ak,502:Z.prototype.Ck,503:Z.prototype.Hk},Sm={800:Z.prototype.Im,801:Z.prototype.Lm,802:Z.prototype.Km,803:Z.prototype.Jm,807:Z.prototype.nh,811:Z.prototype.nh,815:Z.prototype.nh},Rm={496:Z.prototype.Tl,497:Z.prototype.Yl,498:Z.prototype.Wl,499:Z.prototype.Xl,500:Z.prototype.Sl,501:Z.prototype.Rl,502:Z.prototype.Ul,503:Z.prototype.Ql,
|
||||
1014:Z.prototype.Vl};Ga(function(){for(var a=bb(document,"pcx86","hdc"),b=0;b<a.length;b++){var c=a[b],d=Za(c),d=new Z(d);ab(d,c)}});
|
||||
function nn(a,b,c){Ka.call(this,"Computer",a,nn);this.ea.Vb=!1;on(this,b);this.ba=nc(this,"autoPower",a);this.G=0;this.da=a.busWidth||a.buswidth;this.B=pn;this.R=null;this.K=this.Z=!1;this.ha=nc(this,"url")||"";this.ma=(Math.random()+.1).toString(36).substr(2,12);this.C=qn(this);if(this.A=Ya("CPU",this.id)){this.Ia=Ya("Debugger",this.id);this.I=[];for(b=null;b=mb(this,"Video",b);)this.I.push(b);this.ia=new ub({id:this.Fe+".bus",busWidth:this.da},this.A,this.Ia);var d,e=Wa(this.id);if((this.D=Ya("Panel",
|
||||
this.id))&&this.D.ng)for(b=0;b<e.length;b++)d=e[b],d.Ba=this.D.Ba,d.rc=this.D.rc,d.ng=this.D.ng;this.rc("PCx86 v1.30.0\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");for(b=0;b<e.length;b++)d=e[b],d.pc&&d.pc(this,this.ia,this.A,this.Ia);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.S=d:this.B=parseInt(d,10));var f;if(a=nc(this,"state")||(f=!0,a.state))b=this.W=a,f||(this.K=!0,this.B=pn),this.B&&(this.P=new de(this,"1.30.0"),
|
||||
this.id))&&this.D.ng)for(b=0;b<e.length;b++)d=e[b],d.Ba=this.D.Ba,d.rc=this.D.rc,d.ng=this.D.ng;this.rc("PCx86 v1.30.1\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");for(b=0;b<e.length;b++)d=e[b],d.pc&&d.pc(this,this.ia,this.A,this.Ia);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.S=d:this.B=parseInt(d,10));var f;if(a=nc(this,"state")||(f=!0,a.state))b=this.W=a,f||(this.K=!0,this.B=pn),this.B&&(this.P=new de(this,"1.30.1"),
|
||||
this.P.load()?b=null:delete this.P);!b&&this.B&&(b=rn(this))&&(this.K=!0);if(b){var g=this;sa(b,null,!0,function(a,b,c){c?(g.S=null,g.K=!1,g.Ba("Unable to load machine state from server (error "+c+(b?": "+la(b):"")+")")):(g.R=b,g.Z=!0);t(g)})}else t(this);this.la.power||(this.ba=!0);!c&&this.ba&&sn(this,this.gf)}else r("Unable to find CPU component")}Ta(nn);var pn=0;l=nn.prototype;l.ue=function(){return this.ma};
|
||||
function on(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){r(d.message+" ("+c+")")}}a.L=b}function nc(a,b,c){var d=b.toLowerCase(),d=Na[b]||Na[d];void 0===d&&a.L&&(d=a.L[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}l.yd=function(){return this.C||""};function sn(a,b,c){for(var d=Wa(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!db(f)){db(f,function(){sn(a,b,c)});return}}b.call(a,c)}
|
||||
function tn(a,b){var c=new de(a,"1.30.0","validate");if(c.load()&&un(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.Ba("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}
|
||||
l.gf=function(a){void 0===a&&(a=this.B||(this.R?1:pn));if(!this.G){this.G++;var b=!1,c=!1;this.Y=!1;var d=this.P||new de(this,"1.30.0");if(-1==a)b=!0;else if(a>pn){if(d.load(this.R)){this.H=new de(this,"1.30.0","failsafe");this.H.load()&&(vn(this,d),a=2,wn(this.H));this.H.set("timestamp",oa());xn(this.H);var e=this.B&&!this.K;if(1==a||ua("Click OK to restore the previous PCx86 machine state, or CANCEL to reset the machine.")){if(c=un(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?d.load(g):("error"==
|
||||
function tn(a,b){var c=new de(a,"1.30.1","validate");if(c.load()&&un(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.Ba("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}
|
||||
l.gf=function(a){void 0===a&&(a=this.B||(this.R?1:pn));if(!this.G){this.G++;var b=!1,c=!1;this.Y=!1;var d=this.P||new de(this,"1.30.1");if(-1==a)b=!0;else if(a>pn){if(d.load(this.R)){this.H=new de(this,"1.30.1","failsafe");this.H.load()&&(vn(this,d),a=2,wn(this.H));this.H.set("timestamp",oa());xn(this.H);var e=this.B&&!this.K;if(1==a||ua("Click OK to restore the previous PCx86 machine state, or CANCEL to reset the machine.")){if(c=un(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?d.load(g):("error"==
|
||||
f&&"no machine state"!=g?(this.Ba("Error: "+g),"unable to verify user"==g&&(ya("user",""),this.C=null)):this.rc(f+": "+g),wn(d),d.load()?(c=un(d),e=!0):c=!1))}e&&tn(this,c?d:null)}else 2==a&&d.clear()}else tn(this);delete this.R;delete this.P}e=Wa(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.A&&(c=yn(this,g,d,b,c));b=[d,a,c];-1!=a?sn(this,this.pi,b):this.pi(b)}};
|
||||
function yn(a,b,c,d,e){if(!b.ea.Vb){b.ea.Vb=!0;if(b.Ub){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Ub(f,d)&&f&&(r("Unable to restore state for "+b.type),a.W&&!a.Z?(c.clear(),a.B=pn,window&&window.location.reload()):a.Y=!0,b.Ub(null),e=!1)}if(!d&&b.Yh)for(a=b.Yh.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
l.pi=function(a){var b=a[0],c=0>a[1];a=a[2];this.ka=!0;this.ea.Vb=!0;var d=this.la.power;d&&(d.textContent="Shutdown");this.A&&(yn(this,this.A,b,c,a),this.A.Le());this.Y&&(vn(this,b),b.clear());!c&&this.H&&(this.H.clear(),delete this.H);this.G=0};
|
||||
function vn(a,b){if(ua("There may be a problem with your PCx86 machine.\n\nTo help us diagnose it, click OK to send this PCx86 machine state to http://www.pcjs.org.")){var c=a.yd();b=b.toString();var d={app:"PCx86",ver:"1.30.0"};d.url=a.ha;d.user=c;d.type="bug";d.data=b;sa("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function zn(a,b,c){var d,e="none";if(a.G)return null;a.G--;var f=new de(a,"1.30.0"),g=new de(a,"1.30.0","validate"),h=oa();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.0");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.A&&a.A.Tb&&(c&&rc(a.A),d=a.A.Tb(b,c),"object"===typeof d&&f.set(a.A.id,d),c&&(a.A.ea.Vb=!1,!1===d&&(e=null)));for(var h=Wa(a.id),k=0;k<h.length;k++){var m=h[k];m.ea.Vb&&(m.Tb&&(d=m.Tb(b,c),"object"===typeof d&&
|
||||
function vn(a,b){if(ua("There may be a problem with your PCx86 machine.\n\nTo help us diagnose it, click OK to send this PCx86 machine state to http://www.pcjs.org.")){var c=a.yd();b=b.toString();var d={app:"PCx86",ver:"1.30.1"};d.url=a.ha;d.user=c;d.type="bug";d.data=b;sa("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function zn(a,b,c){var d,e="none";if(a.G)return null;a.G--;var f=new de(a,"1.30.1"),g=new de(a,"1.30.1","validate"),h=oa();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.A&&a.A.Tb&&(c&&rc(a.A),d=a.A.Tb(b,c),"object"===typeof d&&f.set(a.A.id,d),c&&(a.A.ea.Vb=!1,!1===d&&(e=null)));for(var h=Wa(a.id),k=0;k<h.length;k++){var m=h[k];m.ea.Vb&&(m.Tb&&(d=m.Tb(b,c),"object"===typeof d&&
|
||||
f.set(m.id,d)),c&&(m.ea.Vb=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.C&&An(a,a.C,f.toString()),xn(g)&&xn(f)||(e=null,d=h=!0)):a.B&&(d=!0,h=3==a.B),d&&f.clear(h)):e=f.toString());c&&(a.ea.Vb=!1,b=a.la.power)&&(b.textContent="Power");a.G=0;return e}l.reset=function(){this.ia&&this.ia.reset&&this.ia.reset();for(var a=Wa(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.ia&&c.reset&&c.reset()}};
|
||||
l.start=function(a,b){for(var c=Wa(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};l.stop=function(a,b){for(var c=Wa(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
|
||||
l.zb=function(a,b,c){var d=this;switch(b){case "power":return this.la[b]=c,c.onclick=function(){d.G||(d.ea.Vb?zn(d,!1,!0):sn(d,d.gf))},!0;case "reset":return this.la[b]=c,c.onclick=function(){if(d.ea.Vb&&!d.G)if(d.B&&!d.S){var a=ua("Click OK to save changes to this PCx86 machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");zn(d,a,!0);!a&&d.W?window&&window.location.reload():(a||(d.pg=!0),d.gf(pn),d.pg=!1)}else d.reset(),d.A&&d.A.Le()},!0;case "save":if(ia(ta(),"pcjs.org"))c.parentNode.removeChild(c);
|
||||
else return this.la[b]=c,c.onclick=function(){var a=qn(d,!0);if(a){var b=!!(d.B&&!d.S||d.W),c=zn(d,b);b?An(d,a,c):d.Ba("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function qn(a,b){var c=a.C;c||((c=xa("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Bn(a,c))||a.Ba("The user ID is invalid.")):b&&a.Ba("Browser local storage is not available"));return c}
|
||||
function Bn(a,b){a.C=null;b=sa(ta()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(ya("user",b.data),a.C=b.data)}catch(d){r(d.message+" ("+c+")")}return a.C}function rn(a){var b=null;a.C&&(b=ta()+"/api/v1/user?req=load&user="+a.C+"&state="+Cn(a,"1.30.0"));return b}
|
||||
function An(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Cn(a,"1.30.0");d.data=c;b=sa(ta()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.Ba("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.Ba(c),ya("user",""),a.C=null)}}
|
||||
function Bn(a,b){a.C=null;b=sa(ta()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(ya("user",b.data),a.C=b.data)}catch(d){r(d.message+" ("+c+")")}return a.C}function rn(a){var b=null;a.C&&(b=ta()+"/api/v1/user?req=load&user="+a.C+"&state="+Cn(a,"1.30.1"));return b}
|
||||
function An(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Cn(a,"1.30.1");d.data=c;b=sa(ta()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.Ba("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.Ba(c),ya("user",""),a.C=null)}}
|
||||
function mb(a,b,c){a=Wa(a.id);for(var d=0;d<a.length;d++){var e=a[d];if(c)c==e&&(c=null);else if(e.type==b)return e}return null}function xc(a,b){if(a.I.length){var c=0,d=0;b&&window&&(c=window.scrollX,d=window.scrollY);a=a.I[0];a.G&&a.G.focus();b&&window&&window.scrollTo(c,d)}}l.Zd=function(a){this.A&&this.A.Zd(a);this.D&&this.D.Zd(a)};
|
||||
function Ac(a,b){for(var c=0;c<a.I.length;c++)nl(a.I[c],b);if(a.D&&(a=a.D,a.ua)){rb(a,18,a.S,a.ra);if(a.Ga){b=a.ia;var c=a.B,d,e;null==d&&(d=0);null==e&&(e=b.L-d|0);c||(c={mg:0,fd:0,fg:[]});var f=d>>>b.da;d=d+e-1>>>b.da;c.mg=0;for(c.fd=0;f<=d;)e=b.R[f],c.mg+=e.size,e.size&&(c.fg.push(qa(qb,f,0,0,e.type)),c.fd++),f++;a.B=c;a.ma=a.B.fd*a.ia.xb/691200;d=0;a.B.ii=0;a.B.Ke||(a.B.Ke=[]);e=-1;b=0;for(var g=-1,c=0;c<a.B.fd;c++){var h=a.B.fg[c],f=ra(qb.type,h),h=ra(qb.Cj,h);if(f!=e||h!=g+1)(g=c-b)&&(d+=tb(a,
|
||||
b,g,e)),e=f,b=c;g=h}d+=tb(a,b,c-b,e);e=a.B.fk!=d;a.B.fk=d;if(e){e=new kb(0,0,a.S.width,a.S.height);a.B.ee=[];b=a.B.fd;for(d=0;d<a.B.ii;d++)c=a.B.Ke[d].fd,a.B.ee.push(lb(e,c,b,!d)),b-=c;for(d=0;d<a.B.ee.length;d++)e=a.B.Ke[d],b=c=a.B.ee[d],f=a.ra,(g=ac[e.type])||(g=new jb),f.strokeStyle="black",f.strokeRect(b.x,b.y,b.Fc,b.A),f.fillStyle="string"==typeof g?g:g.toString(),f.fillRect(b.x,b.y,b.Fc,b.A),b=a,f=c,b.P=b.ha,b.L=b.ka,c=f.x+(f.Fc>>1),g=f.y+(f.A>>1),h=f.A,f.Fc<f.A&&(h=f.Fc,b.da=!0,b.G.save(),
|
||||
|
|
@ -633,9 +678,9 @@ a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pcx86$2")
|
|||
function Gn(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");sa(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var k=h[0],m,q=/( [a-z]+=)(['"])(.*?)\2/g;m=q.exec(f);)k=0>k.indexOf(m[1])?k.replace(">",m[0]+">"):k.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=k&&(g=g.replace(h[0],k))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],g);Gn(a,b,c)}})}else c(a,null)}
|
||||
function Hn(a,b,c,d){function e(a){if(void 0===h){var b=g&&bb(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=ka(a))}function f(a){e("Error: "+a);k&&(--Dn||Ia(!0));k=!1}var g,h,k=!0;Dn++;Ua[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var q=document.head||document.getElementsByTagName("head")[0],y=document.createElement("style");y.type="text/css";y.styleSheet?y.styleSheet.cssText=m:y.appendChild(document.createTextNode(m));q.appendChild(y)}c||
|
||||
(c="/versions/pcx86/1.30.0/components.xsl");m=function(d,h){h?En(c,null,null,!1,e,function(d,k){k?(Va(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(k=h.transformNode(k))?(g.outerHTML=k,--Dn||Ia(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(k),(k=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(k,g),--Dn||Ia(!0)):f("invalid machine element: "+
|
||||
(c="/versions/pcx86/1.30.1/components.xsl");m=function(d,h){h?En(c,null,null,!1,e,function(d,k){k?(Va(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(k=h.transformNode(k))?(g.outerHTML=k,--Dn||Ia(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(k),(k=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(k,g),--Dn||Ia(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?En(b,a,d,!0,e,m):Fn(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(w){f(w.message)}return k}function In(a,b,c,d){Ia(!1);return Hn(a,b,c,d)}window.embedPC=In;window.embedPCx86=In;window.enableEvents=Ia;window.sendEvent=Ja;
|
||||
function Jn(a,b,c,d){if(!c&&b){d.push(b);a=Ua[d[0]];b=null;for(var e in a)if(ia(e,"components.xsl")){b=e.replace(".xsl",".css");break}b?sa(b,null,!0,function(a,b){Kn(b,d)}):Kn(null,d)}else r("Error ("+c+") requesting "+a)}
|
||||
function Kn(a,b){var c,d,e,f=b[0],g=b[1];c=b[4];c=c.match(/^(\s*\(function\(\)\{)([\s\S]*)(}\)\(\);\s*)$/);var h=Ua[f],k={},m;for(m in h){var q=h[m],y=ha(m);if("xml"==y){for(y=/[ \t]*<disk [^>]*path=(['"])(.*?)\1.*?<\/disk>\n?/g;d=y.exec(h[m]);){var w=d[2];w&&(h[w]||(q=q.replace(d[0],"")))}d=m=ga(m)}else"xsl"==y&&(e=m=ga(m));k[m]=q}a&&(k[m="css"]=a);b[2]&&(k[m="parms"]=b[2]);b[3]&&(k[m="state"]=b[3]);d&&e?(a=JSON.stringify(k),g+=".js",c=c[1]+"var resources="+a+";"+c[2]+c[3],c=c.replace(/\u00A9/g,
|
||||
"©"),a=Aa(c,"javascript",!1,g),a=a+(', copy it to your web server as "'+g+'", and then add the following to your web page:\n\n')+('<div id="'+f+'"></div>\n')+"...\n",a=a+('<script type="text/javascript" src="'+g+'">\x3c/script>\n')+('<script type="text/javascript">embedPC("'+f+'","'+d+'","'+e+'");\x3c/script>\n\n')+"The machine should appear where the <div> is located.",r(a)):r("Missing XML/XSL resources")}
|
||||
window.savePC=function(a,b,c){var d=Ya("Computer",a),e=Ya("Debugger",a);if(d){var f=zn(d,!0),g=d.L?JSON.stringify(d.L):null;b||(b="/versions/pcjs/1.30.0/pc"+(e?"-dbg":"")+".js");if(c&&c({state:f,Gj:g}))return!0;sa(b,null,!0,function(c,d,e){Jn(c,d,e,[a,ga(b,!0),g,f])});return!0}r("Unable to identify machine '"+a+"'");return!1};})();
|
||||
window.savePC=function(a,b,c){var d=Ya("Computer",a),e=Ya("Debugger",a);if(d){var f=zn(d,!0),g=d.L?JSON.stringify(d.L):null;b||(b="/versions/pcjs/1.30.1/pc"+(e?"-dbg":"")+".js");if(c&&c({state:f,Gj:g}))return!0;sa(b,null,!0,function(c,d,e){Jn(c,d,e,[a,ga(b,!0),g,f])});return!0}r("Unable to identify machine '"+a+"'");return!1};})();
|
||||
|
|
|
|||
Loading…
Reference in a new issue