Added support for converting numbers to/from octal, along with improved support for binary numbers
This commit is contained in:
parent
375ddc12f3
commit
1265104e6d
15 changed files with 888 additions and 789 deletions
|
|
@ -1,10 +1,11 @@
|
|||
(function(){var m,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={to:1,cl:3,uo: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,Ai:66,Bi:67,Ci:68,E:69,Di:70,Ei:71,Fi:72,Gi:73,Hi:74,Ii:75,Ji:76,Ki:77,Li:78,Mi:79,Ni:80,Q:81,Oi:82,
|
||||
Pi:83,Qi:84,Ri:85,Si:86,Ti:87,Ui:88,Vi:89,mg:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,ve:97,nl:98,pl:99,d:100,e:101,zl:102,Al:103,Bl:104,Cl:105,Sm:106,k:107,Tm:108,Xm:109,n:110,dn:111,p:112,q:113,r:114,ko:115,t:116,no:117,oo:118,po: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);if("$"==a.charAt(0))b=16,a=a.substr(1);else if("0x"==a.substr(0,2))b=16,a=a.substr(2);else{var d=a.charAt(a.length-1).toLowerCase();"h"==d?(b=16,d=null):"."==d&&(b=10,d=null);null==d&&(a=a.substr(0,a.length-1))}var e,d=a,f=b;(f&&10!=f?16==f?null!==d.match(/^[0-9a-f]+$/i):2==f&&null!==d.match(/^[01]+$/i):null!==d.match(/^[0-9]+$/))&&!isNaN(e=parseInt(a,b))&&(c=e|0)}return c}
|
||||
function fa(a,b){var c="";void 0===b?b=32:32<b&&(b=32);if(null==a||isNaN(a))for(;0<b--;)c="?"+c;else for(;0<b--;)c=(a&1?"1":"0")+c,a>>=1;return c}function ga(a,b){var c="";if(!b||4<b)b=4;for(var d=0;d<b;d++)c&&(c=","+c),c=fa(a&255,8)+"b"+c,a>>=8;return c}function t(a,b){var c="";void 0===b?b=8:8<b&&(b=8);if(null==a||isNaN(a))for(;0<b--;)c="?"+c;else for(;0<b--;){var d=a&15,d=d+(0<=d&&9>=d?48:55),c=String.fromCharCode(d)+c;a>>=4}return c}function u(a){return"0x"+t(a,2)}
|
||||
function v(a){return"0x"+t(a,4)}function ha(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function ka(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function la(a,b){return-1!==a.indexOf(b,a.length-b.length)}var ma={"&":"&","<":"<",">":">",'"':""","'":"'"};function na(a){return a.replace(/[&<>"']/g,function(a){return ma[a]})}
|
||||
function oa(a,b,c){return c?(" "+a).slice(-b):(a+" ").slice(0,b)}function pa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var qa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};
|
||||
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?null!==d.match(/^[0-9a-f]+$/i):8==e?null!==d.match(/^[0-7]+$/):
|
||||
2==e&&null!==d.match(/^[01]+$/):null!==d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function fa(a,b){var c="";b?32<b&&(b=32):b=32;if(null==a||isNaN(a))for(;0<b--;)c="?"+c;else for(;0<b--;)c=(a&1?"1":"0")+c,a>>=1;return c}function ga(a,b,c){var d="";if(!b||4<b)b=4;for(var e=0;e<b;e++)d&&(d=","+d),d=fa(a&255,8)+d,a>>=8;return(c?"0b":"")+d}
|
||||
function t(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function u(a){return t(a,2,!0)}function v(a){return t(a,4,!0)}function ha(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}
|
||||
function ka(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function la(a,b){return-1!==a.indexOf(b,a.length-b.length)}var ma={"&":"&","<":"<",">":">",'"':""","'":"'"};function na(a){return a.replace(/[&<>"']/g,function(a){return ma[a]})}function oa(a,b,c){return c?(" "+a).slice(-b):(a+" ").slice(0,b)}
|
||||
function pa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var qa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};
|
||||
function ra(a,b,c){var d=0,e=a.length,f=0;for(void 0===c&&(c=function(a,b){return a>b?1:a<b?-1:0});d<e;){var g=d+e>>1,h;h=c(b,a[g]);0<h?d=g+1:(e=g,f=!h)}return f?d:~d}var sa=Date.now||function(){return+new Date};function ta(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}var ua=[31,28,31,30,31,30,31,31,30,31,30,31];
|
||||
function va(a,b){var c=0,d=1,e;for(e in a){if(d>=arguments.length)break;var f=a[e],g=arguments[d++],c=c&~f.uh|g<<f.shift&f.uh}return c}function xa(a,b){return(b&a.uh)>>a.shift}function ya(a,b){var c;if(Array.prototype.indexOf)return a.indexOf(b,c);c=c||0;0>c&&(c+=a.length);0>c&&(c=0);for(var d=a.length;c<d;c++)if(c in a&&a[c]===b)return c;return-1}
|
||||
function za(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"==
|
||||
|
|
@ -40,7 +41,7 @@ log:536870912,warn:1073741824,halt:-2147483648};function Fb(a){Za.call(this,"Pan
|
|||
Hb.prototype.contains=function(a,b){return a>=this.x&&a<this.x+this.ad&&b>=this.y&&b<this.y+this.A};function Ib(a,b,c,d){void 0===d&&(d=b>=c>>2);d?(b=new Hb(a.x,a.y,a.ad,a.A*b/c|0),a.y+=b.A,a.A-=b.A):(b=new Hb(a.x,a.y,a.ad*b/c|0,a.A),a.x+=b.ad,a.ad-=b.ad);return b}m=Fb.prototype;m.Pb=function(a,b,c,d){return this.X&&this.X.Pb(a,b,c,d)||this.F&&this.F.Pb(a,b,c,d)||this.B&&this.B.Pb(a,b,c,d)||this.ha&&this.ha.Pb(a,b,c,d)?!0:this.parent.Pb.call(this,a,b,c,d)};
|
||||
m.Hc=function(a,b,c,d){this.X=a;this.ga=b;this.F=c;this.ha=d;this.B=Jb(a,"Keyboard")};m.gc=function(a,b){b||Kb();return!0};m.fc=function(){return!0};m.he=function(a,b){a.button||(this.ea=b?0:-1,Lb(this,a,b))};m.Jf=function(a){Lb(this,a)};
|
||||
function Lb(a,b,c){var d=1280/null.offsetWidth,e=720/null.offsetHeight,f=null.getBoundingClientRect(),d=(b.clientX-f.left)*d|0;b=(b.clientY-f.top)*e|0;null==c&&(a.ea||(a.ea=Math.abs(a.L-d)>Math.abs(a.V-b)?1:2),1==a.ea?b=a.V:2==a.ea&&(d=a.L));a.L=d;a.V=b;if(0<=d&&1280>d&&0<=b&&720>b){a:{c=d;if(960>c&&a.A&&a.A.Qe)for(f=0;f<a.A.Qe.length;f++)if(e=a.A.Qe[f],e.contains(c,b)){c-=e.x;b-=e.y;var d=a.A.Bf[f],g=xa(Mb.Gk,a.A.Xg[d.Dl]),f=g*a.ga.Sb,d=(g+d.Td)*a.ga.Sb-1;0<b&&(f+=e.ad*(b-1)*a.ya);f+=c*a.ya;f|=0;
|
||||
f>d&&(f=d);c=f;break a}c=-1}if(-1!==c&&(c&=-16,c!=a.Ca)){b=c;if(a.context&&a.ia&&a.ka){e=a.ia.width;a.ka.fillStyle="black";a.ka.fillRect(0,360,e,360);Nb(a,378,a.ia,a.ka);a.pa=a.Da.width/24|0;if(null==b)Ob(a,"Mouse over memory to dump");else for(Ob(a,"0x"+t(b),null,0,1),f=1;16>=f;f++){d="";for(g=1;8>=g;g++){var h;h=a.ga;var k=b++;h=h.sa[(k&h.Gb)>>>h.La].re(k&h.A,k);Ob(a,t(h,2),null,1);d+=32<=h&&128>h?String.fromCharCode(h):"."}Ob(a,d,null,0,1)}a.context.drawImage(a.ia,0,360,e,360,a.rb,a.Db,a.Pa,a.cb)}a.Ca=
|
||||
f>d&&(f=d);c=f;break a}c=-1}if(-1!==c&&(c&=-16,c!=a.Ca)){b=c;if(a.context&&a.ia&&a.ka){e=a.ia.width;a.ka.fillStyle="black";a.ka.fillRect(0,360,e,360);Nb(a,378,a.ia,a.ka);a.pa=a.Da.width/24|0;if(null==b)Ob(a,"Mouse over memory to dump");else for(Ob(a,t(b,8,!0),null,0,1),f=1;16>=f;f++){d="";for(g=1;8>=g;g++){var h;h=a.ga;var k=b++;h=h.sa[(k&h.Gb)>>>h.La].re(k&h.A,k);Ob(a,t(h,2),null,1);d+=32<=h&&128>h?String.fromCharCode(h):"."}Ob(a,d,null,0,1)}a.context.drawImage(a.ia,0,360,e,360,a.rb,a.Db,a.Pa,a.cb)}a.Ca=
|
||||
c}}}m.pd=function(){};function Pb(a,b,c,d){a.A.Bf[a.A.ej++]={Dl:b,Td:c,type:d};return va(Mb,b,c,0,d)}function Nb(a,b,c,d){var e,f=null.style.color,g=a.Oa=10;a.C=g;a.U=b;a.W=a.va=18;e||(e=a.ua||a.va+"px Monaco, Lucida Console, Courier New");a.fa=a.ua=e;c&&(a.Da=c);d&&(a.N=d,a.Fa=f||"white")}
|
||||
function Ob(a,b,c,d,e){a.N.font=a.fa;a.N.fillStyle=a.Fa;a.N.fillText(b,a.C,a.U);a.C+=a.pa;null!=c&&(16!=a.Tb?b=c.toString():(b=8>a.Ka?"0x":"",b+=t(c,a.Ka)),a.N.fillText(b,a.C,a.U),a.C+=a.pa);d&&(a.C+=a.pa*d);e&&(a.C=a.Oa,a.U+=(a.W+2)*(e||1))}function Kb(){for(var a=!1,b=rb(document,"pcx86","panel"),c=0;c<b.length;c++){var d=b[c],e=ob(d),f=mb(e.id);f||(a=!0,f=new Fb(e));qb(f,d);a&&wb(f)}}Ua(Kb);
|
||||
function Qb(a,b,c){Za.call(this,"Bus",a,Qb);this.F=b;this.ha=c;this.N=a.busWidth||20;this.W=Math.pow(2,this.N);this.Cg=this.Gb=this.W-1|0;this.La=32==this.N||20>=this.N?12:24>=this.N?14:15;this.Sb=1<<this.La;this.fa=this.Sb>>2;this.A=this.Sb-1;this.U=this.W/this.Sb|0;this.ga=this.U-1;this.B=[];this.C=[];this.L=this.V=!1;this.aa=[];this.ea=[];a=new C;Rb(a,this.ha);this.sa=Array(this.U);for(b=0;b<this.U;b++)this.sa[b]=a;a=this.F;b=this.sa;c=this.La;a.kd=a.sa=b;a.La=c;a.Sb=1<<a.La;a.Fa=a.Sb-1;a.Fd=b.length;
|
||||
|
|
@ -293,7 +294,7 @@ function Rj(){var a=this.T();uf(this)?this.A-=this.B.bb:(Q(this,M(this)+a),this.
|
|||
function Vj(){var a=this.T();wf(this)||!xf(this)!=!yf(this)?this.A-=this.B.bb:(Q(this,M(this)+a),this.A-=this.B.ab)}function Wj(){this.Jb.call(this,Xj,this.xa);this.A-=-1===this.C?1:this.B.Ig}function Yj(){this.S|=1;this.$a.call(this,fi)}function Zj(){this.S|=1;this.ea.call(this,fi)}function ak(){this.Oa.call(this,fi)}function bk(){this.V.call(this,fi)}function Vd(){this.Jb.call(this,ck,xj)}function Zd(){this.ya.call(this,2==this.ba?dk:ek,xj)}
|
||||
function fk(){var a=Vf(this),b=G(this);Q(this,b);a&&I(this,J(this)+a);this.A-=this.B.Dk}function gk(){var a=G(this);Q(this,a);this.A-=this.B.Ak}function $d(){this.U=this.fa;var a=Vf(this),b=this.xa()&31;this.A-=11;K(this,this.P);var c=J(this)&this.R;if(0<b){for(this.A-=(b<<2)+(1<b?1:0);--b;)this.P=this.P&~this.R|this.P-this.ba&this.R,K(this,wd(this,this.ta,this.P&this.R));K(this,c)}this.P=this.P&~this.R|c;I(this,J(this)&~this.ta.Ba|J(this)-a&this.ta.Ba);this.U=-1}
|
||||
function ae(){this.U=this.fa;I(this,J(this)&~this.ta.Ba|this.P&this.ta.Ba);this.P=this.P&~this.R|G(this)&this.R;this.A-=5;this.U=-1}function hk(){Cj.call(this,Vf(this));this.A-=this.B.Ck}function ik(){Cj.call(this,0);this.A-=this.B.Bk}function jk(a){this.lg=a;this.V.call(this,Ph)}function kk(){this.S|=36;this.A-=this.B.nd}function ge(){ke.call(this)}function Jd(){D.call(this,6)}
|
||||
function ke(){Q(this,this.qe-this.wa.Aa);yb(this,"Undefined opcode "+u(this.Qa(this.Ha))+" at "+("0x"+t(this.Ha)));this.Wb()}
|
||||
function ke(){Q(this,this.qe-this.wa.Aa);yb(this,"Undefined opcode "+u(this.Qa(this.Ha))+" at "+t(this.Ha,8,!0));this.Wb()}
|
||||
var Fd=[function(){this.$a.call(this,xh)},function(){this.ea.call(this,yh)},function(){this.Oa.call(this,xh)},function(){this.V.call(this,yh)},function(){this.G=this.G&-256|xh.call(this,this.G&255,this.xa());this.A--},function(){this.G=this.G&~this.R|yh.call(this,this.G&this.R,this.Ma());this.A--},function(){xd(this,this.Xa.Z,this.ba,2);this.A-=this.B.Ie},function(){this.U=this.fa;zd(this,G(this));this.A-=this.B.zc;this.U=-1},function(){this.$a.call(this,Bi)},function(){this.ea.call(this,Ci)},function(){this.Oa.call(this,
|
||||
Bi)},function(){this.V.call(this,Ci)},function(){this.G=this.G&-256|Bi.call(this,this.G&255,this.xa());this.A--},function(){this.G=this.G&~this.R|Ci.call(this,this.G&this.R,this.Ma());this.A--},function(){xd(this,this.wa.Z,this.ba,2);this.A-=this.B.Ie},function(){of(this,G(this));this.A-=this.B.zc},function(){this.$a.call(this,vh)},function(){this.ea.call(this,wh)},function(){this.Oa.call(this,vh)},function(){this.V.call(this,wh)},function(){this.G=this.G&-256|vh.call(this,this.G&255,this.xa());this.A--},
|
||||
function(){this.G=this.G&~this.R|wh.call(this,this.G&this.R,this.Ma());this.A--},function(){xd(this,this.ta.Z,this.ba,2);this.A-=this.B.Ie},function(){this.U=this.fa;nd(this,G(this));this.A-=this.B.zc;this.U=-1},function(){this.$a.call(this,Di)},function(){this.ea.call(this,Ei)},function(){this.Oa.call(this,Di)},function(){this.V.call(this,Ei)},function(){this.G=this.G&-256|Di.call(this,this.G&255,this.xa());this.A--},function(){this.G=this.G&~this.R|Ei.call(this,this.G&this.R,this.Ma());this.A--},
|
||||
|
|
@ -434,8 +435,8 @@ function cm(a){Za.call(this,"ROM",a,cm);this.A=null;this.X=a.addr;this.C=a.size;
|
|||
cm.prototype.gc=function(){this.Qd&&(this.ha&&fm(this.ha,this.id,0,this.X>>>4,0,this.X,this.C,this.Qd),delete this.Qd);return!0};cm.prototype.fc=function(){return!0};
|
||||
function dm(a,b,c,d){if(d)a.Na("Unable to load system ROM (error "+d+": "+b+")");else{jb(a.ce,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var e=eval("("+c+")"),f=e.bytes,g=e.data;if(f)a.A=f;else if(g)for(a.A=Array(4*g.length),d=c=0;c<g.length;c++)a.A[d++]=g[c]&255,a.A[d++]=g[c]>>8&255,a.A[d++]=g[c]>>16&255,a.A[d++]=g[c]>>24&255;else a.A=e;a.Qd=e.symbols;if(!a.A.length){x("Empty ROM: "+b);return}if(1==a.A.length){x(a.A[0]);return}}catch(h){a.Na("ROM data error: "+h.message);return}else for(b=c.replace(/\n/gm,
|
||||
" ").replace(/ +$/,"").split(" "),a.A=Array(b.length),e=0;e<b.length;e++)a.A[e]=ea(b[e],16);em(a)}}
|
||||
function em(a){if(!xb(a))if(!a.L)wb(a);else if(a.A&&a.ga){a.C||(a.C=a.A.length);if(a.A.length!=a.C)yb(a,"ROM size (0x"+t(a.A.length)+") does not match specified size ("+("0x"+t(a.C))+")");else{var b;b=a.X;if(Yb(a.ga,b,a.C,fc)){for(var c=0;c<a.A.length;c++){var d=a.ga,e=b+c;d.sa[(e&d.Gb)>>>d.La].xf(e&d.A,a.A[c]&255,e)}b=!0}else b=!1;if(b){b=[];"number"==typeof a.N?b.push(a.N):null!=a.N&&a.N.length&&(b=a.N);for(c=0;c<b.length;c++){var d=a,e=b[c],f=cc(d.ga,d.X,d.C);bc(d.ga,e,d.C,f)}a.B&&((b=mb(a.B,a.id))?
|
||||
(c=a.A,d=a.V,5==b.Ua?gm(b,c,d||[12640,8752],8):b.Ua==hm&&gm(b,c,d||[14221,16269],8),wb(b)):a.Na("Unable to find component: "+a.B));delete a.A}}wb(a)}}Ua(function(){for(var a=rb(document,"pcx86","rom"),b=0;b<a.length;b++){var c=a[b],d=ob(c),d=new cm(d);qb(d,c)}});function im(a){Za.call(this,"RAM",a,im);this.B=a.addr;this.A=a.size;this.L=a.test;this.X=!!this.A;this.C=!1}hb(im);m=im.prototype;m.Hc=function(a,b,c,d){this.ga=b;this.F=c;this.ha=d;this.N=Jb(a,"ChipSet");wb(this)};
|
||||
function em(a){if(!xb(a))if(!a.L)wb(a);else if(a.A&&a.ga){a.C||(a.C=a.A.length);if(a.A.length!=a.C)yb(a,"ROM size ("+t(a.A.length,8,!0)+") does not match specified size ("+t(a.C,8,!0)+")");else{var b;b=a.X;if(Yb(a.ga,b,a.C,fc)){for(var c=0;c<a.A.length;c++){var d=a.ga,e=b+c;d.sa[(e&d.Gb)>>>d.La].xf(e&d.A,a.A[c]&255,e)}b=!0}else b=!1;if(b){b=[];"number"==typeof a.N?b.push(a.N):null!=a.N&&a.N.length&&(b=a.N);for(c=0;c<b.length;c++){var d=a,e=b[c],f=cc(d.ga,d.X,d.C);bc(d.ga,e,d.C,f)}a.B&&((b=mb(a.B,
|
||||
a.id))?(c=a.A,d=a.V,5==b.Ua?gm(b,c,d||[12640,8752],8):b.Ua==hm&&gm(b,c,d||[14221,16269],8),wb(b)):a.Na("Unable to find component: "+a.B));delete a.A}}wb(a)}}Ua(function(){for(var a=rb(document,"pcx86","rom"),b=0;b<a.length;b++){var c=a[b],d=ob(c),d=new cm(d);qb(d,c)}});function im(a){Za.call(this,"RAM",a,im);this.B=a.addr;this.A=a.size;this.L=a.test;this.X=!!this.A;this.C=!1}hb(im);m=im.prototype;m.Hc=function(a,b,c,d){this.ga=b;this.F=c;this.ha=d;this.N=Jb(a,"ChipSet");wb(this)};
|
||||
m.gc=function(a,b){return!b&&(this.reset(),a&&this.controller&&!this.restore(a))?!1:!0};m.fc=function(a){return a&&this.controller?this.save():!0};
|
||||
m.reset=function(){if(!this.B&&!this.X&&this.N){var a=1024*Xk(this.N);this.A&&a!=this.A&&(ec(this.ga,this.B,this.A),this.C=!1);this.A=a}!this.C&&this.A&&Yb(this.ga,this.B,this.A,1)&&(this.C=!0,"ramCPQ"==this.xd&&(this.controller=new jm(this),Yb(this.ga,km,4,4,this.controller)));if(this.C){if(this.L||lc(this.ga,1138,4660),"ramCPQ"!=this.xd&&this.N&&(a=this.N,a.A)){var b=1048576>this.B?21:23,c=a.A[b]|a.A[b+1]<<8,c=c+(this.A>>10);a.A[b]=c&255;a.A[b+1]=c>>8;al(a)}}else x("No RAM allocated")};
|
||||
m.save=function(){var a=new mf(this);this.controller&&O(a,0,this.controller.save());return a.data()};m.restore=function(a){return this.controller?this.controller.restore(a[0]):!0};function jm(a){this.N=a;this.C=lm;this.ha=mm;this.B=nm;this.A=null}var km=-2134900736,lm=65535,mm=2575,nm=2,om=[null,0],pm=[function(a){return this.controller.Qa(a)},null,null,function(a,b){this.controller.qc(a,b)},null,null];m=jm.prototype;m.save=function(){return[this.C,this.B]};
|
||||
|
|
@ -568,7 +569,7 @@ m.he=function(a,b){if(this.Gc&&this.F&&this.F.la.Ib){var c="mouse button"+a+" "+
|
|||
function Io(a,b,c,d){var e=64|(a.aa?32:0)|(a.ea?16:0)|(a.W&192)>>4|(a.U&192)>>6,f=a.U&63,g=a.W&63;B(a,8388608)&&z(a,(b?b+": ":"")+(void 0!==d?"mouse ("+c+","+d+"): ":"")+"serial packet ["+u(e)+","+u(f)+","+u(g)+"]",0,!0);a.N.fg([e,f,g]);a.U=a.W=0}Ua(function(){for(var a=rb(document,"pcx86","mouse"),b=0;b<a.length;b++){var c=a[b],d=ob(c),d=new Eo(d);qb(d,c)}});
|
||||
function Jo(a,b,c){Za.call(this,"Disk",{id:a.ce+".disk"+t(++Ko,4)},Jo,2097152);this.controller=a;this.X=a.X;this.ha=a.ha;this.B=b;this.ga=b.name;this.df=b.df;this.wg=this.N=!1;Lo(this,c,b.Bb,b.ub,b.lb,b.Va);this.U=[];this.ea=[];this.L=null;this.ia=0;this.fa=!1;wb(this)}var Ko=0;hb(Jo);function Mo(a,b,c,d,e,f){this.za=a;this.jc=c;this.bh=d;this.fj=e;this.xe=f}var No=[0,2],Oo=[24,2],Po=[60,4],Qo=[0,2],Ro=[4,2],So=[6,2],To=[28,2],Uo=[32,2],Vo=[34,2],Wo=[38,2],Xo=[44,4],Yo=[50,2];
|
||||
function Zo(a,b,c){var d;c=c||2;var e=b&511,f=$o(a.za,a.xe[b>>9]);if(f){if(e+c<=f.length)return ap(a.za,f,e,c);for(e=d=0;c--;)d|=Zo(a,b++,1)<<e,e+=8}return d}function bp(a,b,c){return Zo(a,b[0]+(c||0),b[1])}function cp(a,b,c){for(var d=0;!c||b<c;){var e=Zo(a,b,1);if(!e)break;var f;f=a;var g=b+1,h=e,k="";for(h||(h=-1);h--;){var l=Zo(f,g++,1);if(!l)break;k+=String.fromCharCode(l)}f=k;if(!f)break;b+=1+e;if(d){if(e=Zo(a,b),g=a.A[e])g=g[0],a.yd[g]&&a.yd[g].we[e].push(f)}else c||(a.ig=f);b+=2;d++}}
|
||||
Mo.prototype.wj=function(a,b){var c=null;if(this.yd)for(var d in this.yd){var e=this.yd[d];if(a>=e.ni&&a<=e.Hk){d=a-=e.ni;var f,g;for(g in e.we){var h=e.we[g],k=a-h[0];if(!k){c=this.ig+"!"+h[1];break}b&&0<k&&k<d&&(f=h,d=k)}!c&&f&&(c=this.ig+"!"+f[1]+"+"+v(d));break}}return c||this.jc+"+"+("0x"+t(a))};m=Jo.prototype;m.Hc=function(a,b,c,d){this.ha=d};m.gc=function(a,b){b||!this.wg||this.N||(wb(this,!1),this.load(this.ga,this.V,null,this.yl,this));return!0};m.yl=function(){wb(this,!0)};
|
||||
Mo.prototype.wj=function(a,b){var c=null;if(this.yd)for(var d in this.yd){var e=this.yd[d];if(a>=e.ni&&a<=e.Hk){d=a-=e.ni;var f,g;for(g in e.we){var h=e.we[g],k=a-h[0];if(!k){c=this.ig+"!"+h[1];break}b&&0<k&&k<d&&(f=h,d=k)}!c&&f&&(c=this.ig+"!"+f[1]+"+"+v(d));break}}return c||this.jc+"+"+t(a,8,!0)};m=Jo.prototype;m.Hc=function(a,b,c,d){this.ha=d};m.gc=function(a,b){b||!this.wg||this.N||(wb(this,!1),this.load(this.ga,this.V,null,this.yl,this));return!0};m.yl=function(){wb(this,!0)};
|
||||
m.fc=function(a,b){if(this.N){var c,d=0;if(this.fa&&!Ea("Disk writes are still in progress, shut down anyway?"))return!1;for(;c=dp(this,!1);)if(d=c[0]){this.controller.Na('Unable to save "'+this.ga+'" (error '+d+")");break}b&&this.N&&(c="action=close&volume="+this.V,c+="&machine="+this.controller.hf(),c+="&user="+this.controller.ie(),za(Aa()+"/api/v1/disk?"+c,null,!0),this.N=!1);!d&&a&&this.controller.Na(this.ga+" saved")}return!0};
|
||||
function Lo(a,b,c,d,e,f){a.mode=b;a.Bb=c;a.ub=d;a.lb=e;a.Va=f;a.A=[];if("preload"!=a.mode){b=Array(a.Bb);for(c=0;c<b.length;c++){d=Array(a.ub);for(e=0;e<d.length;e++){f=Array(a.lb);for(var g=1;g<=f.length;g++)f[g-1]=ep(null,c,e,g,a.Va,"local"==a.mode?0:null);d[e]=f}b[c]=d}a.A=b}a.aa=null}
|
||||
m.load=function(a,b,c,d,e){var f=b;if(this.W)return!0;this.ga=a;this.V=b;this.Tg=ha(b);var g=this;this.W=d;this.ka=e||this.controller;if(c){var h=new FileReader;h.onload=function(){var a=h.result,b,c=a?a.byteLength:0,d=ba[c];if(d){g.Bb=d[0];g.ub=d[1];g.lb=d[2];g.Va=512;b=g.Va>>2;var e=d=0,a=new DataView(a,0,c);g.A=Array(g.Bb);for(c=0;c<g.A.length;c++)for(var f=g.A[c]=Array(g.ub),F=0;F<f.length;F++)for(var w=f[F]=Array(g.lb),E=0;E<w.length;E++){for(var H=ep(null,c,F,E+1,g.Va,0),L=H.data,W=0;W<b;W++,
|
||||
|
|
@ -656,14 +657,14 @@ function gq(a,b,c){b.errorCode=4;b.Se&&b.Se.length==b.Hb||(b.Se=Array(b.Hb));b.e
|
|||
m.Je=function(a,b,c){var d=-1,e=null,f=0;if(a.errorCode)return b&&b(d,!1,e,f),d;var g=!1!==c?1:0;if(a.pb&&(f=a.eb,d=a.za.read(a.pb,a.eb),a.eb+=g,0<=d))return e=a.pb,b&&b(d,!1,e,f),d;if(b){if(a.za)return a.za.seek(a.be,a.kb,a.xb+a.qg,!1,function(c,k){(a.pb=c)?(e=c,f=a.eb=0,hq(a),d=a.za.read(a.pb,a.eb),a.eb+=g):a.errorCode=20;b(d,k,e,f)}),d;a.errorCode=20;b(d,!1,e,f)}return d};
|
||||
function $p(a,b){if(a.errorCode)return-1;do{if(a.pb&&a.za.write(a.pb,a.eb++,b))break;a.za&&a.za.seek(a.be,a.kb,a.xb+a.qg,!0,function(b){a.pb=b});if(!a.pb){a.errorCode=20;b=-1;break}a.eb=0;hq(a)}while(1);return b}function hq(a){a.xb++;var b=1-a.qg;a.xb>=a.lb+b&&(a.xb=b,a.kb++,a.kb>=a.ub&&(a.kb=0,a.be++))}m.Mm=function(){var a=this.F.M&255;!(this.F.G>>8)&&128<a&&(this.ka=a-128);return!0};m.Nm=function(){var a;(a=this.F.G>>8||!this.N)||(a=!(this.N.vc[0].Ad&64));return a?!0:!1};
|
||||
var Qp={800:Mp.prototype.Km,801:Mp.prototype.Lm,802:Mp.prototype.Jm},Pp={496:Mp.prototype.hl,497:Mp.prototype.Rl,498:Mp.prototype.Tl,499:Mp.prototype.Ul,500:Mp.prototype.Pl,501:Mp.prototype.Ol,502:Mp.prototype.Ql,503:Mp.prototype.Vl},Sp={800:Mp.prototype.fo,801:Mp.prototype.jo,802:Mp.prototype.io,803:Mp.prototype.ho,807:Mp.prototype.oi,811:Mp.prototype.oi,815:Mp.prototype.oi},Rp={496:Mp.prototype.pn,497:Mp.prototype.un,498:Mp.prototype.sn,499:Mp.prototype.tn,500:Mp.prototype.on,501:Mp.prototype.nn,
|
||||
502:Mp.prototype.qn,503:Mp.prototype.mn,1014:Mp.prototype.rn};Ua(function(){for(var a=rb(document,"pcx86","hdc"),b=0;b<a.length;b++){var c=a[b],d=ob(c),d=new Mp(d);qb(d,c)}});function iq(a){Za.call(this,"Debugger",a,iq);this.pa=this.Ca=this.ea=0;this.va=!1;this.A=-1;this.C=[];this.ya={}}hb(iq);var jq={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
|
||||
502:Mp.prototype.qn,503:Mp.prototype.mn,1014:Mp.prototype.rn};Ua(function(){for(var a=rb(document,"pcx86","hdc"),b=0;b<a.length;b++){var c=a[b],d=ob(c),d=new Mp(d);qb(d,c)}});function iq(a){Za.call(this,"Debugger",a,iq);this.pa=this.Ca=this.ea=0;this.va=!1;this.A=-1;this.C=[];this.ya={}}hb(iq);var jq={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};iq.prototype.nh=function(){return-1};iq.prototype.oh=function(){};
|
||||
iq.prototype.Ok=function(a,b){return a.replace("["+b+"]","unimplemented")};iq.prototype.Mg=function(a,b,c){if(b)if(a){0>this.A&&this.C.length&&(this.A=0);if(0>this.A||a!=this.C[this.A])this.C.splice(0,0,a),this.A=0;this.A--}else this.va?a="end":a=this.C[this.A+1];b=[];if(a){a=a.toLowerCase().replace(/""/g,"'");var d=0,e=null;c=c||";";for(var f=0;f<=a.length;f++){var g=a.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==c&&!e||!g)b.push(pa(a.substring(d,f))),d=f+1}}return b};
|
||||
function kq(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<<e;break;case ">>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f<e?1:0;break;case "<=":d=f<=e?1:0;break;case ">":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break;
|
||||
case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0}iq.prototype.nh=function(){return-1};iq.prototype.oh=function(){};
|
||||
iq.prototype.Mg=function(a,b,c){if(b)if(a){0>this.A&&this.C.length&&(this.A=0);if(0>this.A||a!=this.C[this.A])this.C.splice(0,0,a),this.A=0;this.A--}else this.va?a="end":a=this.C[this.A+1];b=[];if(a){a=a.toLowerCase().replace(/""/g,"'");var d=0,e=null;c=c||";";for(var f=0;f<=a.length;f++){var g=a.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==c&&!e||!g)b.push(pa(a.substring(d,f))),d=f+1}}return b};
|
||||
case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0}
|
||||
function lq(a,b,c){var d;if(b){b=mq(a,b);for(var e=0,f=!1,g=b,h=[],k=[],l=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<l.length;){var n=l[e++],r=n.length,n=pa(n);if(!n){f=!0;break}n=nq(a,n,null,!1===c);if(void 0===n){f=!0;c=!1;break}h.push(n);if(e==l.length)break;var n=l[e++],q=n.length;k.length&&jq[n]<jq[k[k.length-1]]&&kq(h,k,1);k.push(n);b=b.substr(r+q)}kq(h,k)&&1==h.length||(f=!0);f?c&&a.O("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&oq(a,null,
|
||||
d))}return d}iq.prototype.Ok=function(a,b){return a.replace("["+b+"]","unimplemented")};function mq(a,b){for(var c;(c=b.match(/\{(.*?)}/))&&!(0<=c[1].indexOf("{"));){var d=lq(a,c[1]);b=b.replace("{"+c[1]+"}",null!=d?t(d):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=a.Ok(b,c[1]);for(c=b;d=c.match(/\$([a-z]+)/i);){var e=null;switch(d[1].toLowerCase()){case "ops":e=a.pa-a.Ca}if(null==e)break;c=c.replace(d[0],e.toString())}return c}
|
||||
function nq(a,b,c,d){var e;null!=b?(e=a.nh(b),0<=e?e=a.oh(e):(e=a.ya[b],null==e&&(e=ea(b,16))),null!=e||d||a.O("invalid "+(c?c:"value")+": "+b)):d||a.O("missing "+(c||"value"));return e}function oq(a,b,c){var d,e=!1;void 0!==c&&(e=!0,d="0x"+t(c)+" "+c+". ("+ga(c)+")");a.O((null!=b?b+": ":"")+d);return e}function pq(a,b){if(b)return oq(a,b,a.ya[b]);var c=0;for(b in a.ya)oq(a,b,a.ya[b]),c++;return 0<c}
|
||||
function qq(a){iq.call(this,a);this.Ja=4;this.Da=5;this.Ba=1048575;this.aa=rq(this);this.sb=rq(this);this.ua=rq(this);this.N=[];this.B=this.ra=this.fa=[];sq(this);this.Oa=0;tq(this);this.$a={};uq(this,a.messages);this.gb=a.commands;var b=this;window?void 0===window.pcx86&&(window.pcx86=function(a){return vq(b,a)}):void 0===global.pcx86&&(global.pcx86=function(a){return vq(b,a)})}hb(qq,iq);
|
||||
d))}return d}function mq(a,b){for(var c;(c=b.match(/\{(.*?)}/))&&!(0<=c[1].indexOf("{"));){var d=lq(a,c[1]);b=b.replace("{"+c[1]+"}",null!=d?t(d):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=a.Ok(b,c[1]);for(c=b;d=c.match(/\$([a-z]+)/i);){var e=null;switch(d[1].toLowerCase()){case "ops":e=a.pa-a.Ca}if(null==e)break;c=c.replace(d[0],e.toString())}return c}
|
||||
function nq(a,b,c,d){var e;null!=b?(e=a.nh(b),0<=e?e=a.oh(e):(e=a.ya[b],null==e&&(e=ea(b,16))),null!=e||d||a.O("invalid "+(c?c:"value")+": "+b)):d||a.O("missing "+(c||"value"));return e}function oq(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=0,g="";f?11<f&&(f=11):f=d&-65536?11:6;if(null==d||isNaN(d))for(;0<f--;)g="?"+g;else for(;0<f--;)g=String.fromCharCode((d&7)+48)+g,d>>=3;d=t(c,0,!0)+" "+c+". "+("0o"+g)+" "+ga(c,0,!0)}a.O((null!=b?b+": ":"")+d);return e}
|
||||
function pq(a,b){if(b)return oq(a,b,a.ya[b]);var c=0;for(b in a.ya)oq(a,b,a.ya[b]),c++;return 0<c}function qq(a){iq.call(this,a);this.Ja=4;this.Da=5;this.Ba=1048575;this.aa=rq(this);this.sb=rq(this);this.ua=rq(this);this.N=[];this.B=this.ra=this.fa=[];sq(this);this.Oa=0;tq(this);this.$a={};uq(this,a.messages);this.gb=a.commands;var b=this;window?void 0===window.pcx86&&(window.pcx86=function(a){return vq(b,a)}):void 0===global.pcx86&&(global.pcx86=function(a){return vq(b,a)})}hb(qq,iq);
|
||||
var wq={16:262144,19:524288,21:32768,22:65536,28:2048,33:134217728,51:16777216},xq=[26,28,40,42,109],yq={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory",f:"frequencies","g [#]":"go [to #]",h:"halt","i [#]":"input port #","if":"eval expression",k:"stack trace",l:"load sector(s)",ln:"list nearest symbol(s)",m:"messages",mouse:"mouse action","o [#]":"output port #",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",
|
||||
"t [#]":"trace","u [#]":"unassemble",x:"execution options",v:"print version","var":"assign variable"},zq="INVALID AAA AAD AAM AAS ADC ADD AND ARPL AS: BOUND BSF BSR BT BTC BTR BTS CALL CBW CLC CLD CLI CLTS CMC CMP CMPSB CMPSW CS: CWD DAA DAS DEC DIV DS: ENTER ES: ESC FS: GS: HLT IBTS IDIV IMUL IN INC INS INT INT3 INTO IRET JBE JC JCXZ JG JGE JL JLE JMP JA JNC JNO JNP JNS JNZ JO JP JS JZ LAHF LAR LDS LEA LEAVE LES LFS LGDT LGS LIDT LLDT LMSW LOADALL LOCK LODSB LODSW LOOP LOOPNZ LOOPZ LSL LSS LTR MOV MOVSB MOVSW MOVSX MOVZX MUL NEG NOP NOT OR OS: OUT OUTS POP POPA POPF PUSHF PUSHA PUSH RCL RCR REPNZ REPZ RET RETF ROL ROR SAHF SALC SAR SBB SCASB SCASW SETBE SETC SETG SETGE SETL SETLE SETNBE SETNC SETNO SETNP SETNS SETNZ SETO SETP SETS SETZ SGDT SHL SHLD SHR SHRD SIDT SLDT SMSW SS: STC STD STI STOSB STOSW STR SUB TEST VERR VERW WAIT XBTS XCHG XLAT XOR".split(" "),
|
||||
Aq="FLD FST FSTP FXCH FILD FIST FISTP FBLD FBSTP FADD FADDP FIADD FSUB FSUBP FISUB FSUBR FSUBRP FISUBR FMUL FMULP FIMUL FDIV FDIVP FIDIV FDIVR FDIVRP FIDIVR FSQRT FSCALE FPREM FRNDINT FXTRACT FABS FCHS FCOM FCOMP FCOMPP FICOM FICOMP FTST FXAM FPTAN FPATAN F2XM1 FYL2X FYL2XP1 FLDZ FLD1 FLDPI FLDL2T FLDL2E FLDLG2 FLDLN2 FINIT FNINIT FDISI FNDISI FENI FNENI FLDCW FSTCW FNSTCW FSTSW FNSTSW FCLEX FNCLEX FSTENV FNSTENV FLDENV FSAVE FNSAVE FRSTOR FINCSTP FDECSTP FFREE FFREEP FNOP FWAIT FSETPM FSINCOS FSTSWAX".split(" "),
|
||||
|
|
@ -692,7 +693,7 @@ this.ka=null;gf(this.F,104,this.Rm.bind(this));wb(this)};function Tq(a,b,c,d,e,f
|
|||
function Vq(a,b,c,d){var e=a.na(b,2),f=a.na(b,2),g=a.oa(b,4),h=a.oa(b,4),k=rq(a,a.oa(b,4),a.na(b,2));b=rq(a,a.oa(b,4),a.na(b,2));b=Qq(a,b).toUpperCase();var k=Qq(a,k).toUpperCase(),l=(c?"_CODE":"_DATA")+t(e,2);d&&B(a,128)&&a.message((b==k?"":b+"!")+k+" "+(c?"code":"data")+"("+t(e,4)+")="+t(f,4)+":"+t(g)+" len "+t(h));c=Uq(a,k,e);c[k+l]=g;fm(a,k,e,f,g,null,h,c)}function Wq(a,b,c){c=Qq(a,c).toUpperCase();Xq(a,c,b)}
|
||||
m.Pm=function(){var a=this.F;if(null!=this.L&&2752554==a.G){var b=a.M&65535,c=a.K&65535,d=rq(this,J(a)+12,a.ta.Z);switch(this.oa(d)){case 336:Vq(this,rq(this,a.H,b),!c,!!this.L)}}return!0};
|
||||
m.Qm=function(a){var b=this.F,c=b.G&65535,d=b.H&65535,e=b.I&65535,f=b.M&65535,g=b.K&65535,h=b.J&65535,k=b.Xa.Z;if(null==this.L)return 79==c&&hf(b,a,function(a){return function(){62342!=(b.G&65535)?(b.G=b.G&-65536|62342,z(a,"INT 0x41 handling enabled",128),a.L=!0):(z(a,"INT 0x41 monitoring enabled",128),a.L=!1)}}(this)),!0;switch(c){case 79:this.L&&(b.G=b.G&-65536|62342,z(this,"INT 0x41 handling enabled",128));break;case 80:Tq(this,rq(this,h,k),d+1,e,!(g&1),!!this.L);break;case 82:Xq(this,null,d);
|
||||
break;case 127:this.L&&(b.G=b.G&-65536|(this.cb?0:1));break;case 131:this.L&&(a=rq(this,b.M,e),this.rb++?(this.O("TRAPFAULT failed"),Yq(this,this.B,a,!0,!0),this.rb=0,this.Wb()):(this.O("INT 0x41 TRAPFAULT: fault="+v(d)+" error="+("0x"+t(b.K))+" addr="+Zq(a)),this.Rd(this.B,a,!0),tq(this,!0)));break;case 141:this.L&&(b.G=b.G&-65536|1);break;case 336:Vq(this,rq(this,b.H,f),!g,!!this.L);break;case 338:Wq(this,d,rq(this,b.J,f))}this.cb=!1;return!this.L};
|
||||
break;case 127:this.L&&(b.G=b.G&-65536|(this.cb?0:1));break;case 131:this.L&&(a=rq(this,b.M,e),this.rb++?(this.O("TRAPFAULT failed"),Yq(this,this.B,a,!0,!0),this.rb=0,this.Wb()):(this.O("INT 0x41 TRAPFAULT: fault="+v(d)+" error="+t(b.K,8,!0)+" addr="+Zq(a)),this.Rd(this.B,a,!0),tq(this,!0)));break;case 141:this.L&&(b.G=b.G&-65536|1);break;case 336:Vq(this,rq(this,b.H,f),!g,!!this.L);break;case 338:Wq(this,d,rq(this,b.J,f))}this.cb=!1;return!this.L};
|
||||
m.Rm=function(a){var b=this.F,c=b.G&255,d=b.G>>8&255,e=b.H&65535,f=b.I&65535,g=b.M&65535,h=b.J&65535,k=b.Xa.Z;if(null==this.ka){if(67==d){if(609437257==b.oa((b.wa.Z<<4)+10)||1111835735==b.oa((b.wa.Z<<4)+95))return!0;hf(b,a,function(a){return function(){62342!=(b.G&65535)?(b.G=b.G&-65536|62342,z(a,"INT 0x68 handling enabled",128),a.L=a.ka=!0):(z(a,"INT 0x68 monitoring enabled",128),a.ka=!1)}}(this))}return!0}switch(d){case 67:this.ka&&(b.G=b.G&-65536|62342);break;case 68:this.ka&&(a=jd(b.wa,this.ql.bind(this)))&&
|
||||
(b.J=a[0],zd(b,a[1]));break;case 72:Xq(this,null,e);break;case 80:32==c?Tq(this,rq(this,h,k),0,f,!0,!!this.ka):128>c?Tq(this,rq(this,h,k),e+1,c&64?g:f,!(c&1),!!this.ka):Vq(this,rq(this,h,k),!(c&1),!!this.ka),this.ka&&(b.G=b.G&-256|1)}return!this.ka};m.ql=function(){var a=this.F;5==(a.G&255)&&(a.I=a.K=0,a.G=a.G&-256|1);return!1};
|
||||
m.Pb=function(a,b,c){var d=this;switch(b){case "debugInput":return this.Ka=this.qa[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",vq(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.A<d.C.length-1&&(b=d.C[++d.A])):40==a.keyCode&&(0<d.A?b=d.C[--d.A]:(b="",d.A=-1)),null!=b){var g=b.length;c.value=b;c.setSelectionRange(g,g)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.qa[b]=c,Na(c,function(){if(d.Ka){var a=d.Ka.value;
|
||||
|
|
@ -770,7 +771,7 @@ qd=qd+(" %%"+t(be.ml));a.O(qd)}else a.O("unsupported operation")}}else a.O("mis
|
|||
tb-=Eb;0>tb&&(null==tc[tc.length-1].Z?(Eb=tb+Eb,tb=0):tb+=tc.length);var li=[];"call"==Dn&&(de=1E5,li=["CALL"]);for(void 0!==Cn&&a.O(Eb+" instructions earlier:");0<de&&tb!=a.Fa;){var rd=tc[tb++];if(null==rd.Z)break;var Ve=rq(a,rd.Ra,rd.Z,rd.Ea,rd.type,rd.Rb,rd.oc),es=Eb--,Gn=tr(a,Ve,"history",es);(!li.length||0<=Gn.indexOf(li[0]))&&a.O(Gn);Ve.Ue&&(tb+=Ve.Ue,de-=Ve.Ue,Eb-=Ve.Ue);tb>=tc.length&&(tb=0);a.Jb=Eb;Fn++;de--}}Fn||(a.O("no "+En+"history available"),a.Jb=void 0)}else if("di"==ia){P.shift();
|
||||
var mi=P[0];if(mi){var We=nq(a,mi);if(void 0===We||0>We||255<We)a.O("invalid vector: "+mi);else{var Hn="&",In=!!(a.F.Za&1),Jn=!1,qg=a.F.Lc+(We<<(In?3:2)),ni=a.F.na(qg+0),fs=a.F.na(qg+2);In&&(Hn="#",a.F.na(qg+4)&2048&&(Jn=!0,ni|=a.F.na(qg+6)<<16));a.O("dumpIDT("+v(We)+"): "+Hn+t(fs,4)+":"+t(ni,Jn?8:4))}}else a.O("no IDT vector")}else if("dt"==ia)P.shift(),a.O("no information");else{var ee=fr(a,ja);if(ee&&(null!=ee.Z||null!=ee.Ea)){var rg=0;Ha&&("l"==Ha.charAt(0)&&(Ha=Ha.substr(1)||Xa),rg=nq(a,Ha)>>>
|
||||
0,65536<rg&&(rg=65536));for(var sd="",sg="dd"==ia?4:"dw"==ia?2:1,tg=sg*rg||128,gs=tg+15>>4||1;gs--&&0<tg;){var ug=0,oi=0,Xe,Ye="",pi="",ja=Zq(ee);for(Xe=16;0<Xe&&0<tg;Xe--){var vg=a.Qa(ee,1),ug=ug|vg<<(oi++<<3);oi==sg&&(Ye+=t(ug,2*sg),Ye+=1==sg?9==Xe?"-":" ":" ",ug=oi=0);pi+=32<=vg&&128>vg?String.fromCharCode(vg):".";tg--}sd&&(sd+="\n");sd+=ja+" "+Ye+(0==Xe?" "+pi:"")}sd&&a.O(sd);a.sb=ee}}}}}break;case "e":if("else"==g[0])break;var wg=1,Kn=255,Ln=a.Qa,Mn=a.qc;"ew"==g[0]&&(wg=2,Kn=65535,Ln=a.na,
|
||||
Mn=a.jb);var Nn=wg<<1,On=g[1];if(null==On)a.O("edit memory commands:"),a.O("\teb [a] [...] edit bytes at address a"),a.O("\tew [a] [...] edit words at address a");else{var xg=fr(a,On);if(xg)for(var yg=2;yg<g.length;yg++){var Ze=lq(a,g[yg]);if(void 0===Ze){a.O("unrecognized value: "+g[yg]);break}Ze&~Kn&&a.O("warning: "+t(Ze)+" exceeds "+wg+"-byte value");var hs=Ln.call(a,xg);a.O("changing "+Zq(xg)+" from 0x"+t(hs,Nn)+" to 0x"+t(Ze,Nn));Mn.call(a,xg,Ze,wg)}}break;case "f":Er(a,g[1]);break;case "g":a:{var Pn=
|
||||
Mn=a.jb);var Nn=wg<<1,On=g[1];if(null==On)a.O("edit memory commands:"),a.O("\teb [a] [...] edit bytes at address a"),a.O("\tew [a] [...] edit words at address a");else{var xg=fr(a,On);if(xg)for(var yg=2;yg<g.length;yg++){var Ze=lq(a,g[yg]);if(void 0===Ze){a.O("unrecognized value: "+g[yg]);break}Ze&~Kn&&a.O("warning: "+t(Ze)+" exceeds "+wg+"-byte value");var hs=Ln.call(a,xg);a.O("changing "+Zq(xg)+" from "+t(hs,Nn,!0)+" to "+t(Ze,Nn,!0));Mn.call(a,xg,Ze,wg)}}break;case "f":Er(a,g[1]);break;case "g":a:{var Pn=
|
||||
g[1],is=b;"gt"==g[0]&&(a.cb=!0);if(void 0!==Pn){var qi=fr(a,Pn,!0);if(!qi)break a;gr(a,qi,is);a.Rd(a.B,qi,!0)}a.Le(!0)||c||a.O("cpu busy or unavailable, run command ignored")}break;case "h":a:{var ri;if(a.la.Ib)ri="halting",a.Wb();else{if(vb(a,!0))break a;ri="already halted"}c||a.O(ri)}break;case "i":if("if"==g[0]){var si;var $e=b.substr(2),$e=pa($e);lq(a,$e)?(c||a.O("true: "+$e),si=!0):(c||a.O("false: "+$e),si=!1);si||(d=!1);break}if("int"==g[0]){var zg;a:switch(nq(a,g[1])){case 19:ok(a,19,a.F.Ha,
|
||||
!0);a.Ca=a.pa;zg=!0;break a;case 33:ok(a,33,a.F.Ha,!0);a.Ca=a.pa;zg=!0;break a;default:zg=!1}zg||(d=!1);break}var ti=g[1];if(ti&&"?"!=ti){var ui=nq(a,ti);if(void 0!==ui){var js=oc(a.ga,ui,1);a.O(v(ui)+": "+u(js))}}else a.O("input commands:"),a.O("\ti [p]\tread port [p]"),a.O("warning: port accesses can affect hardware state");break;case "k":var ks=g[0];if("?"==g[1])a.O("stack trace commands:"),a.O("\tk\tshow frame addresses"),a.O("\tks\tshow symbol information");else{var vi=0,Qn=a.F.wa.Z,af=rq(a),
|
||||
Vc=rq(a,J(a.F),a.F.ta.Z);for(a.O("stack trace for "+Zq(Vc));10>vi;){for(var uc=null,ls=256;Vc.Ra>>>0<a.F.Rg>>>0;){af.Ra=a.tb(Vc,!0);if(null==Vc.Ea||!ls--)break;af.Z=Qn;if(uc=Jr(a,af))break;af.Z=a.tb(Vc);if(uc=Jr(a,af,!0)){Qn=a.tb(Vc,!0);0<uc.indexOf("INT")&&a.tb(Vc,!0);break}}if(!uc||null==uc)break;var Rn=null;if("ks"==ks){var Sn=uc.match(/[0-9A-F]+$/);Sn&&(Rn=Gr(a,Sn[0]))}uc=oa(uc,50)+" ;"+(Rn||"stack="+Zq(Vc));a.O(uc);vi++}vi||a.O("no return addresses found")}break;case "l":if("ln"==g[0]){Gr(a,
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
(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]},n={Sm:1,Rj:3,Tm: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,vh:66,wh:67,xh:68,E:69,yh:70,zh:71,Ah:72,Bh:73,Ch:74,Dh:75,Eh:76,Fh:77,Hh:78,Jh:79,Lh:80,Q:81,Oh:82,
|
||||
Qh:83,Sh:84,Uh:85,Wh:86,Yh:87,$h:88,bi:89,vf:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Ld:97,ak:98,bk:99,d:100,e:101,lk:102,mk:103,nk:104,pk:105,Al:106,k:107,Bl:108,El:109,n:110,Jl:111,p:112,q:113,r:114,Lm:115,t:116,Om:117,Pm:118,Qm:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126},ca={};ca[186]=n[";"];ca[187]=n["="];ca[188]=n[","];ca[189]=n["-"];ca[190]=n["."];ca[191]=n["/"];ca[192]=n["`"];ca[219]=n["["];ca[220]=n["\\"];ca[221]=n["]"];ca[222]=n["'"];ca[173]=n["-"];var q={};q[n["1"]]=n["!"];
|
||||
q[n["2"]]=n["@"];q[n["3"]]=n["#"];q[n["4"]]=n.$;q[n["5"]]=n["%"];q[n["6"]]=n["^"];q[n["7"]]=n["&"];q[n["8"]]=n["*"];q[n["9"]]=n["("];q[n["0"]]=n[")"];q[186]=n[":"];q[187]=n["+"];q[188]=n["<"];q[189]=n._;q[190]=n[">"];q[191]=n["?"];q[192]=n["~"];q[219]=n["{"];q[220]=n["|"];q[221]=n["}"];q[222]=n['"'];q[173]=n._;q[61]=n["+"];q[59]=n[":"];
|
||||
function ea(a,b){var c;if(a){b||(b=10);if("$"==a.charAt(0))b=16,a=a.substr(1);else if("0x"==a.substr(0,2))b=16,a=a.substr(2);else{var d=a.charAt(a.length-1).toLowerCase();"h"==d?(b=16,d=null):"."==d&&(b=10,d=null);null==d&&(a=a.substr(0,a.length-1))}var e,d=a,f=b;(f&&10!=f?16==f?null!==d.match(/^[0-9a-f]+$/i):2==f&&null!==d.match(/^[01]+$/i):null!==d.match(/^[0-9]+$/))&&!isNaN(e=parseInt(a,b))&&(c=e|0)}return c}
|
||||
function fa(a,b){var c="";void 0===b?b=8:8<b&&(b=8);if(null==a||isNaN(a))for(;0<b--;)c="?"+c;else for(;0<b--;){var d=a&15,d=d+(0<=d&&9>=d?48:55),c=String.fromCharCode(d)+c;a>>=4}return c}function ga(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function ha(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}
|
||||
function ia(a,b){return-1!==a.indexOf(b,a.length-b.length)}var ja={"&":"&","<":"<",">":">",'"':""","'":"'"};function ka(a){return a.replace(/[&<>"']/g,function(a){return ja[a]})}function la(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
|
||||
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?null!==d.match(/^[0-9a-f]+$/i):8==e?null!==d.match(/^[0-7]+$/):
|
||||
2==e&&null!==d.match(/^[01]+$/):null!==d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function fa(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function ga(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}
|
||||
function ha(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ia(a,b){return-1!==a.indexOf(b,a.length-b.length)}var ja={"&":"&","<":"<",">":">",'"':""","'":"'"};function ka(a){return a.replace(/[&<>"']/g,function(a){return ja[a]})}function la(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
|
||||
var ma={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"},na=Date.now||function(){return+new Date};
|
||||
function oa(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}var pa=[31,28,31,30,31,30,31,31,30,31,30,31];function qa(a,b){var c=0,d=1,e;for(e in a){if(d>=arguments.length)break;var f=a[e],g=arguments[d++],c=c&~f.rg|g<<f.shift&f.rg}return c}function ra(a,b){return(b&a.rg)>>a.shift}
|
||||
function sa(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"==
|
||||
|
|
@ -29,7 +29,7 @@ function lb(a,b,c,d){this.A=[a,b,c,d];this.B=null;void 0===a&&(this.A[0]=256*Mat
|
|||
function nb(a,b,c,d){void 0===d&&(d=b>=c>>2);d?(b=new mb(a.x,a.y,a.Fc,a.A*b/c|0),a.y+=b.A,a.A-=b.A):(b=new mb(a.x,a.y,a.Fc*b/c|0,a.A),a.x+=b.Fc,a.Fc-=b.Fc);return b}l=kb.prototype;l.zb=function(a,b,c,d){return this.ba&&this.ba.zb(a,b,c,d)||this.A&&this.A.zb(a,b,c,d)||this.C&&this.C.zb(a,b,c,d)?!0:this.parent.zb.call(this,a,b,c,d)};l.pc=function(a,b,c,d){this.ba=a;this.ia=b;this.A=c;this.Ia=d;this.C=ob(a,"Keyboard")};l.Ub=function(a,b){b||pb();return!0};l.Tb=function(){return!0};
|
||||
l.le=function(a,b){a.button||(this.R=b?0:-1,qb(this,a,b))};l.sg=function(a){qb(this,a)};
|
||||
function qb(a,b,c){var d=1280/null.offsetWidth,e=720/null.offsetHeight,f=null.getBoundingClientRect(),d=(b.clientX-f.left)*d|0;b=(b.clientY-f.top)*e|0;null==c&&(a.R||(a.R=Math.abs(a.H-d)>Math.abs(a.I-b)?1:2),1==a.R?b=a.I:2==a.R&&(d=a.H));a.H=d;a.I=b;if(0<=d&&1280>d&&0<=b&&720>b){a:{c=d;if(960>c&&a.B&&a.B.ee)for(f=0;f<a.B.ee.length;f++)if(e=a.B.ee[f],e.contains(c,b)){c-=e.x;b-=e.y;var d=a.B.Ke[f],g=ra(rb.Bj,a.B.eg[d.qk]),f=g*a.ia.xb,d=(g+d.fd)*a.ia.xb-1;0<b&&(f+=e.Fc*(b-1)*a.ma);f+=c*a.ma;f|=0;f>d&&
|
||||
(f=d);c=f;break a}c=-1}if(-1!==c&&(c&=-16,c!=a.oa)){b=c;if(a.context&&a.W&&a.Y){e=a.W.width;a.Y.fillStyle="black";a.Y.fillRect(0,360,e,360);sb(a,378,a.W,a.Y);a.Z=a.pa.width/24|0;if(null==b)tb(a,"Mouse over memory to dump");else for(tb(a,"0x"+fa(b),null,0,1),f=1;16>=f;f++){d="";for(g=1;8>=g;g++){var h;h=a.ia;var k=b++;h=h.R[(k&h.Fa)>>>h.da].Ed(k&h.B,k);tb(a,fa(h,2),null,1);d+=32<=h&&128>h?String.fromCharCode(h):"."}tb(a,d,null,0,1)}a.context.drawImage(a.W,0,360,e,360,a.La,a.Ta,a.za,a.Ea)}a.oa=c}}}
|
||||
(f=d);c=f;break a}c=-1}if(-1!==c&&(c&=-16,c!=a.oa)){b=c;if(a.context&&a.W&&a.Y){e=a.W.width;a.Y.fillStyle="black";a.Y.fillRect(0,360,e,360);sb(a,378,a.W,a.Y);a.Z=a.pa.width/24|0;if(null==b)tb(a,"Mouse over memory to dump");else for(tb(a,fa(b,8,!0),null,0,1),f=1;16>=f;f++){d="";for(g=1;8>=g;g++){var h;h=a.ia;var k=b++;h=h.R[(k&h.Fa)>>>h.da].Ed(k&h.B,k);tb(a,fa(h,2),null,1);d+=32<=h&&128>h?String.fromCharCode(h):"."}tb(a,d,null,0,1)}a.context.drawImage(a.W,0,360,e,360,a.La,a.Ta,a.za,a.Ea)}a.oa=c}}}
|
||||
l.Zd=function(){};function ub(a,b,c,d){a.B.Ke[a.B.hi++]={qk:b,fd:c,type:d};return qa(rb,b,c,0,d)}function sb(a,b,c,d){var e,f=null.style.color,g=a.xa=10;a.D=g;a.K=b;a.L=a.ka=18;e||(e=a.ha||a.ka+"px Monaco, Lucida Console, Courier New");a.P=a.ha=e;c&&(a.pa=c);d&&(a.G=d,a.qa=f||"white")}
|
||||
function tb(a,b,c,d,e){a.G.font=a.P;a.G.fillStyle=a.qa;a.G.fillText(b,a.D,a.K);a.D+=a.Z;null!=c&&(16!=a.Ja?b=c.toString():(b=8>a.va?"0x":"",b+=fa(c,a.va)),a.G.fillText(b,a.D,a.K),a.D+=a.Z);d&&(a.D+=a.Z*d);e&&(a.D=a.xa,a.K+=(a.L+2)*(e||1))}function pb(){for(var a=!1,b=cb(document,"pcx86","panel"),c=0;c<b.length;c++){var d=b[c],e=$a(d),f=Ya(e.id);f||(a=!0,f=new kb(e));bb(f,d);a&&eb(f)}}Ia(pb);
|
||||
function vb(a,b,c){Ma.call(this,"Bus",a,vb);this.A=b;this.Ia=c;this.D=a.busWidth||20;this.L=Math.pow(2,this.D);this.ba=this.Fa=this.L-1|0;this.da=32==this.D||20>=this.D?12:24>=this.D?14:15;this.xb=1<<this.da;this.ia=this.xb>>2;this.B=this.xb-1;this.H=this.L/this.xb|0;this.C=this.H-1;this.I=[];this.K=[];this.S=[];this.P=[];a=new u;wb(a,this.Ia);this.R=Array(this.H);for(b=0;b<this.H;b++)this.R[b]=a;a=this.A;b=this.R;c=this.da;a.vc=a.R=b;a.da=c;a.xb=1<<a.da;a.pb=a.xb-1;a.pf=b.length;a.$d=a.pf-1;a=this.A;
|
||||
|
|
@ -40,8 +40,8 @@ function Kb(a,b,c){if(!(b&a.B||!c||c&a.B)){for(var d=b>>>a.da;0<c;){var e=a.R[d]
|
|||
function Hb(a,b,c,d,e){for(var f=0,g=b>>>a.da;0<c&&g<a.R.length;){var h=d[f++];if(!h)break;if(void 0!==e){var k=new u(b),m=k,p=e,x=a.Ia;m.id=h.id|1;m.Ge=h.Ge;m.size=h.size;p&&(m.type=p,m.I=p==Lb);hb?(m.R=h.R,m.S=h.S,m.Ka=h.Ka,m.td=h.td,m.V=h.V,Jb(m,Mb?Nb:Ob)):(m.V=h.V,Jb(m,Pb));wb(m,x,h);h=k}a.R[g++]=h;c-=a.xb}}l.Jb=function(a){return this.R[(a&this.Fa)>>>this.da].Wb(a&this.B,a)};
|
||||
l.ga=function(a){var b=a&this.B,c=(a&this.Fa)>>>this.da;return b!=this.B?this.R[c].Ae(b,a):this.R[c++].Wb(b,a)|this.R[c&this.C].Wb(0,a+1)<<8};function Qb(a,b){var c=b&a.B,d=(b&a.Fa)>>>a.da;return c!=a.B?a.R[d].jf(c,b):a.R[d++].Ed(c,b)|a.R[d&a.C].Ed(0,b+1)<<8}l.fa=function(a){var b=a&this.B,c=(a&this.Fa)>>>this.da;if(b<this.B-2)return this.R[c].Fd(b,a);for(var d=0,e=4,f=0,g=4-(b&3);e--;)d|=this.R[c].Wb(b++,a++)<<f,--g||(c=c+1&this.C,b=0),f+=8;return d};
|
||||
l.Mc=function(a,b){this.R[(a&this.Fa)>>>this.da].Yb(a&this.B,b&255,a)};l.bb=function(a,b){var c=a&this.B,d=(a&this.Fa)>>>this.da;c!=this.B?this.R[d].Ie(c,b&65535,a):(this.R[d++].Yb(c,b&255,a),this.R[d&this.C].Yb(0,b>>8&255,a+1))};function Rb(a,b,c){var d=b&a.B,e=(b&a.Fa)>>>a.da;d!=a.B?a.R[e].uh(d,c&65535,b):(a.R[e++].of(d,c&255,b),a.R[e&a.C].of(0,c>>8&255,b+1))}
|
||||
l.Va=function(a,b){var c=a&this.B,d=(a&this.Fa)>>>this.da;if(c<this.B-2)this.R[d].He(c,b);else for(var e=4,f=4-(c&3);e--;)this.R[d].Yb(c++,b&255,a++),--f||(d=d+1&this.C,c=0),b>>>=8};function Sb(a,b,c,d){void 0===d&&(d=0);for(var e in c){var f=a,g=+e+d,h=c[e].bind(b);if(void 0!==h)for(var k=+e+d;k<=g;k++)void 0!==f.I[k]?r("Input port 0x"+fa(k,4)+" already registered"):f.I[k]=[h,!1]}}
|
||||
function Tb(a,b,c,d){for(var e=0,f=0;0<c;){var g=a.I[b],h=a.S[b]||1,k=1==h?255:2==h?65535:-1,m=k;void 0!==g&&g[0]&&(m=g[0](b,d),void 0===m?m=k:m&=k);e|=m<<f;f+=h<<3;b+=h;c-=h}return e}function Ub(a,b,c,d){void 0===d&&(d=0);for(var e in c){var f=a,g=+e+d,h=c[e].bind(b);if(void 0!==h)for(var k=+e+d;k<=g;k++)void 0!==f.K[k]?r("Output port 0x"+fa(k,4)+" already registered"):f.K[k]=[h,!1]}}
|
||||
l.Va=function(a,b){var c=a&this.B,d=(a&this.Fa)>>>this.da;if(c<this.B-2)this.R[d].He(c,b);else for(var e=4,f=4-(c&3);e--;)this.R[d].Yb(c++,b&255,a++),--f||(d=d+1&this.C,c=0),b>>>=8};function Sb(a,b,c,d){void 0===d&&(d=0);for(var e in c){var f=a,g=+e+d,h=c[e].bind(b);if(void 0!==h)for(var k=+e+d;k<=g;k++)void 0!==f.I[k]?r("Input port "+fa(k,4,!0)+" already registered"):f.I[k]=[h,!1]}}
|
||||
function Tb(a,b,c,d){for(var e=0,f=0;0<c;){var g=a.I[b],h=a.S[b]||1,k=1==h?255:2==h?65535:-1,m=k;void 0!==g&&g[0]&&(m=g[0](b,d),void 0===m?m=k:m&=k);e|=m<<f;f+=h<<3;b+=h;c-=h}return e}function Ub(a,b,c,d){void 0===d&&(d=0);for(var e in c){var f=a,g=+e+d,h=c[e].bind(b);if(void 0!==h)for(var k=+e+d;k<=g;k++)void 0!==f.K[k]?r("Output port "+fa(k,4,!0)+" already registered"):f.K[k]=[h,!1]}}
|
||||
function Vb(a,b,c,d,e){for(var f=0;0<c;){var g=a.K[b],h=a.P[b]||1,k=1==h?255:2==h?65535:-1,k=(d>>>=f)&k;if(void 0!==g&&g[0])g[0](b,k,e);f+=h<<3;b+=h;c-=h}}function Eb(a,b,c,d,e){b="Memory block error ("+b+": "+fa(c)+","+fa(d)+")";e?a.Ia?a.Ia.message(b):a.log(b):r(b);return!1}var Wb;if(hb){var Xb=new ArrayBuffer(2);(new DataView(Xb)).setUint16(0,256,!0);Wb=256===(new Uint16Array(Xb))[0]}else Wb=!1;var Mb=Wb;
|
||||
function u(a,b,c,d,e,f){this.id=Yb+=2;this.V=null;this.H=0;this.he=a;this.Ge=b;this.size=c||0;this.type=d||Zb;this.I=d==Lb;this.controller=null;this.A=f;wb(this);this.Ha=this.pi=!1;if(c)if(e)this.controller=e,a=e.ti(a),this.V=a[0],this.H=a[1],Jb(this,e.qg());else if(hb)this.R=new ArrayBuffer(c),this.S=new DataView(this.R,0,c),this.Ka=new Uint8Array(this.R,0,c),this.td=new Uint16Array(this.R,0,c>>1),this.V=new Int32Array(this.R,0,c>>2),Jb(this,Mb?Nb:Ob);else{this.V=Array(c>>2);for(e=0;e<this.V.length;e++)this.V[e]=
|
||||
0;Jb(this,Pb)}else Jb(this)}var Zb=0,Lb=2,ac=["black","blue","green","cyan"],Gb="NONE RAM ROM VIDEO H/W UNPAGED PAGED".split(" "),Yb=0;function bc(a){hb&&!Mb&&(a=a<<24|a<<8&16711680|a>>8&65280|a>>>24);return a}
|
||||
|
|
@ -177,7 +177,7 @@ function nh(a,b,c){if(c){var d=a>>>c-1;a=d>>>1|b<<32-c;H(this,a,-2147483648,d&1)
|
|||
function Kh(a,b){this.Gc=this.Ca.ja;this.ic=this.P.ja;this.ka=this.ra;var c=C(this),d=this.U;null!=Rc(this,a,b,!0)&&(Lc(this,this.Gc,d,2),Lc(this,c,d,d));this.Gc=this.ic=this.ka=-1}function Lh(a,b,c){this.A-=this.B.Yi+(c||0);c=Pc(this);var d=this.Ca.ja,e=C(this);a=this.Ca.wi(a);-1!==a&&(B(this,c),B(this,d),B(this,e),null!=b&&B(this,b),this.fc=-1,he(this,a))}
|
||||
function Mh(a){this.ic=this.P.ja;this.ka=this.ra;var b=w(this),c=w(this);a&&y(this,A(this)+a);Rc(this,b,c,!1)&&(a&&y(this,A(this)+a),Nh.call(this,this.xa),Nh.call(this,this.pa),80386<=this.ca&&(Nh.call(this,this.Ta),Nh.call(this,this.Xa)));2==a&&this.$f&&be(this,this.Y);this.ic=this.ka=-1}function Oh(){8086==this.ca?(this.fc=-1,Lh.call(this,0,null,2)):v.call(this,0,null,2)}function Ne(a,b){this.fc=a;void 0===b&&(b=11);Lh.call(this,a,null,b)}
|
||||
function v(a,b,c,d){var e=!1;this.ea.complete?80186<=this.ca&&(e=!0,0>this.fc?(-1!=this.Gc&&(this.Gc!==this.Ca.ja&&(this.Ca.sb=this.Gc&3,ge(this,this.Gc)),this.Gc=-1),this.Dd!==this.Y&&he(this,this.Dd),-1!=this.ic&&(this.ic!==this.P.ja&&Gc(this,this.ic),this.ic=-1),-1!==this.ka&&(this.ka!==this.ra&&y(this,this.Ob&~this.P.sa|this.ka-this.P.ya),this.ka=-1)):8!=this.fc?(b=0,a=8):(b=0,a=-1,Bd(this),e=d=!1)):he(this,this.Dd);var f=a,g=b,h=Fe(this,this.Y);204!=h||this.xc||(d=!1);this.X&131072&&(6==f&&99==
|
||||
h||13==f&&205==h)&&(d=!1);983040<=this.Y&&1048575>=this.Y&&(d=!1);if(d){var k=this.ea.Nb,f="Fault 0x"+fa(f,2)+(null!=g?" (0x"+fa(g,4)+")":"")+" on opcode "+("0x"+fa(h,2));d&&k&&(f+=" (blocked)");this.Ba(f);rc(this)}if(d&&e)throw-1;if(e)throw this.fc=a,Lh.call(this,a,b,c),this.Dd=this.Y,this.L=1==a?this.L|8192:this.L|4096,a;}function Cd(a,b,c){this.pd=a;a=0;b&&(a|=1);c&&(a|=2);3==this.za&&(a|=4);v.call(this,14,a)}
|
||||
h||13==f&&205==h)&&(d=!1);983040<=this.Y&&1048575>=this.Y&&(d=!1);if(d){var k=this.ea.Nb,f="Fault "+fa(f,2,!0)+(null!=g?" ("+fa(g,4,!0)+")":"")+" on opcode "+fa(h,2,!0);d&&k&&(f+=" (blocked)");this.Ba(f);rc(this)}if(d&&e)throw-1;if(e)throw this.fc=a,Lh.call(this,a,b,c),this.Dd=this.Y,this.L=1==a?this.L|8192:this.L|4096,a;}function Cd(a,b,c){this.pd=a;a=0;b&&(a|=1);c&&(a|=2);3==this.za&&(a|=4);v.call(this,14,a)}
|
||||
function Nh(a){var b=a.lb&7680;a.ja&65528&&(6144==b||7168==b||7168>b&&a.nc<this.za&&a.nc<(a.ja&3))&&a.load(0)}
|
||||
function Hd(a){var b,c;switch((this.W=this.na())&199){case 0:c=I(this,this.D+this.I);this.A-=this.B.Ic;break;case 1:c=I(this,this.D+this.H);this.A-=this.B.Jc;break;case 2:c=K(this,this.K+this.I);this.A-=this.B.Jc;break;case 3:c=K(this,this.K+this.H);this.A-=this.B.Ic;break;case 4:c=I(this,this.I);this.A-=this.B.kc;break;case 5:c=I(this,this.H);this.A-=this.B.kc;break;case 6:c=I(this,P(this));this.A-=this.B.Zc;break;case 7:c=I(this,this.D);this.A-=this.B.kc;break;case 64:c=I(this,this.D+this.I+this.O());
|
||||
this.A-=this.B.Kb;break;case 65:c=I(this,this.D+this.H+this.O());this.A-=this.B.Lb;break;case 66:c=K(this,this.K+this.I+this.O());this.A-=this.B.Lb;break;case 67:c=K(this,this.K+this.H+this.O());this.A-=this.B.Kb;break;case 68:c=I(this,this.I+this.O());this.A-=this.B.Sa;break;case 69:c=I(this,this.H+this.O());this.A-=this.B.Sa;break;case 70:c=K(this,this.K+this.O());this.A-=this.B.Sa;break;case 71:c=I(this,this.D+this.O());this.A-=this.B.Sa;break;case 128:c=I(this,this.D+this.I+P(this));this.A-=this.B.Kb;
|
||||
|
|
@ -278,7 +278,7 @@ function ai(){var a=this.O();me(this)?this.A-=this.B.Na:(G(this,C(this)+a),this.
|
|||
function ei(){var a=this.O();oe(this)||!pe(this)!=!qe(this)?this.A-=this.B.Na:(G(this,C(this)+a),this.A-=this.B.Ma)}function fi(){this.yc.call(this,gi,this.na);this.A-=-1===this.C?1:this.B.Pf}function hi(){this.L|=1;this.Gb.call(this,Hg)}function ii(){this.L|=1;this.qa.call(this,Hg)}function ji(){this.Bb.call(this,Hg)}function ki(){this.Z.call(this,Hg)}function jd(){this.yc.call(this,li,Hh)}function kd(){this.Ja.call(this,2==this.U?mi:ni,Hh)}
|
||||
function oi(){var a=Le(this),b=w(this);G(this,b);a&&y(this,A(this)+a);this.A-=this.B.yj}function pi(){var a=w(this);G(this,a);this.A-=this.B.vj}function ld(){this.ka=this.ra;var a=Le(this),b=this.na()&31;this.A-=11;B(this,this.K);var c=A(this)&this.N;if(0<b){for(this.A-=(b<<2)+(1<b?1:0);--b;)this.K=this.K&~this.N|this.K-this.U&this.N,B(this,Kc(this,this.P,this.K&this.N));B(this,c)}this.K=this.K&~this.N|c;y(this,A(this)&~this.P.sa|A(this)-a&this.P.sa);this.ka=-1}
|
||||
function md(){this.ka=this.ra;y(this,A(this)&~this.P.sa|this.K&this.P.sa);this.K=this.K&~this.N|w(this)&this.N;this.A-=5;this.ka=-1}function qi(){Mh.call(this,Le(this));this.A-=this.B.xj}function ri(){Mh.call(this,0);this.A-=this.B.wj}function si(a){this.Th=a;this.Z.call(this,rg)}function ti(){this.L|=36;this.A-=this.B.Qc}function nd(){sd.call(this)}function Yc(){v.call(this,6)}
|
||||
function sd(){G(this,this.Dd-this.Ca.ya);var a=this.Jb(this.Y);gb(this,"Undefined opcode 0x"+fa(a,2)+" at "+("0x"+fa(this.Y)));rc(this)}
|
||||
function sd(){G(this,this.Dd-this.Ca.ya);var a=this.Jb(this.Y);gb(this,"Undefined opcode "+fa(a,2,!0)+" at "+fa(this.Y,8,!0));rc(this)}
|
||||
var Uc=[function(){this.Gb.call(this,$f)},function(){this.qa.call(this,ag)},function(){this.Bb.call(this,$f)},function(){this.Z.call(this,ag)},function(){this.J=this.J&-256|$f.call(this,this.J&255,this.na());this.A--},function(){this.J=this.J&~this.N|ag.call(this,this.J&this.N,this.Aa());this.A--},function(){Lc(this,this.pa.ja,this.U,2);this.A-=this.B.Vd},function(){this.ka=this.ra;Nc(this,w(this));this.A-=this.B.ec;this.ka=-1},function(){this.Gb.call(this,Mg)},function(){this.qa.call(this,Ng)},function(){this.Bb.call(this,
|
||||
Mg)},function(){this.Z.call(this,Ng)},function(){this.J=this.J&-256|Mg.call(this,this.J&255,this.na());this.A--},function(){this.J=this.J&~this.N|Ng.call(this,this.J&this.N,this.Aa());this.A--},function(){Lc(this,this.Ca.ja,this.U,2);this.A-=this.B.Vd},function(){ge(this,w(this));this.A-=this.B.ec},function(){this.Gb.call(this,Yf)},function(){this.qa.call(this,Zf)},function(){this.Bb.call(this,Yf)},function(){this.Z.call(this,Zf)},function(){this.J=this.J&-256|Yf.call(this,this.J&255,this.na());this.A--},
|
||||
function(){this.J=this.J&~this.N|Zf.call(this,this.J&this.N,this.Aa());this.A--},function(){Lc(this,this.P.ja,this.U,2);this.A-=this.B.Vd},function(){this.ka=this.ra;Gc(this,w(this));this.A-=this.B.ec;this.ka=-1},function(){this.Gb.call(this,Og)},function(){this.qa.call(this,Pg)},function(){this.Bb.call(this,Og)},function(){this.Z.call(this,Pg)},function(){this.J=this.J&-256|Og.call(this,this.J&255,this.na());this.A--},function(){this.J=this.J&~this.N|Pg.call(this,this.J&this.N,this.Aa());this.A--},
|
||||
|
|
@ -407,7 +407,7 @@ function dk(a){Ma.call(this,"ROM",a,dk);this.B=null;this.H=a.addr;this.D=a.size;
|
|||
dk.prototype.Ub=function(){this.K&&(this.Ia&&this.Ia.A(this.id,0,this.H>>>4,0,this.H,this.D,this.K),delete this.K);return!0};dk.prototype.Tb=function(){return!0};
|
||||
function ek(a,b,c,d){if(d)a.Ba("Unable to load system ROM (error "+d+": "+b+")");else{Wa(a.Fe,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var e=eval("("+c+")"),f=e.bytes,g=e.data;if(f)a.B=f;else if(g)for(a.B=Array(4*g.length),d=c=0;c<g.length;c++)a.B[d++]=g[c]&255,a.B[d++]=g[c]>>8&255,a.B[d++]=g[c]>>16&255,a.B[d++]=g[c]>>24&255;else a.B=e;a.K=e.symbols;if(!a.B.length){r("Empty ROM: "+b);return}if(1==a.B.length){r(a.B[0]);return}}catch(h){a.Ba("ROM data error: "+h.message);return}else for(b=c.replace(/\n/gm,
|
||||
" ").replace(/ +$/,"").split(" "),a.B=Array(b.length),e=0;e<b.length;e++)a.B[e]=ea(b[e],16);fk(a)}}
|
||||
function fk(a){if(!fb(a))if(!a.I)eb(a);else if(a.B&&a.ia){a.D||(a.D=a.B.length);if(a.B.length!=a.D)gb(a,"ROM size (0x"+fa(a.B.length)+") does not match specified size ("+("0x"+fa(a.D))+")");else{var b;b=a.H;if(Db(a.ia,b,a.D,Lb)){for(var c=0;c<a.B.length;c++){var d=a.ia,e=b+c;d.R[(e&d.Fa)>>>d.da].of(e&d.B,a.B[c]&255,e)}b=!0}else b=!1;if(b){b=[];"number"==typeof a.G?b.push(a.G):null!=a.G&&a.G.length&&(b=a.G);for(c=0;c<b.length;c++){var d=a,e=b[c],f=Ib(d.ia,d.H,d.D);Hb(d.ia,e,d.D,f)}a.C&&((b=Ya(a.C,
|
||||
function fk(a){if(!fb(a))if(!a.I)eb(a);else if(a.B&&a.ia){a.D||(a.D=a.B.length);if(a.B.length!=a.D)gb(a,"ROM size ("+fa(a.B.length,8,!0)+") does not match specified size ("+fa(a.D,8,!0)+")");else{var b;b=a.H;if(Db(a.ia,b,a.D,Lb)){for(var c=0;c<a.B.length;c++){var d=a.ia,e=b+c;d.R[(e&d.Fa)>>>d.da].of(e&d.B,a.B[c]&255,e)}b=!0}else b=!1;if(b){b=[];"number"==typeof a.G?b.push(a.G):null!=a.G&&a.G.length&&(b=a.G);for(c=0;c<b.length;c++){var d=a,e=b[c],f=Ib(d.ia,d.H,d.D);Hb(d.ia,e,d.D,f)}a.C&&((b=Ya(a.C,
|
||||
a.id))?(c=a.B,d=a.L,5==b.Ra?gk(b,c,d||[12640,8752],8):b.Ra==hk&&gk(b,c,d||[14221,16269],8),eb(b)):a.Ba("Unable to find component: "+a.C));delete a.B}}eb(a)}}Ia(function(){for(var a=cb(document,"pcx86","rom"),b=0;b<a.length;b++){var c=a[b],d=$a(c),d=new dk(d);bb(d,c)}});function ik(a){Ma.call(this,"RAM",a,ik);this.C=a.addr;this.B=a.size;this.H=a.test;this.G=!!this.B;this.D=!1}Ua(ik);l=ik.prototype;l.pc=function(a,b,c,d){this.ia=b;this.A=c;this.Ia=d;this.S=ob(a,"ChipSet");eb(this)};
|
||||
l.Ub=function(a,b){return!b&&(this.reset(),a&&this.controller&&!this.restore(a))?!1:!0};l.Tb=function(a){return a&&this.controller?this.save():!0};
|
||||
l.reset=function(){if(!this.C&&!this.G&&this.S){var a=1024*$i(this.S);this.B&&a!=this.B&&(Kb(this.ia,this.C,this.B),this.D=!1);this.B=a}!this.D&&this.B&&Db(this.ia,this.C,this.B,1)&&(this.D=!0,"ramCPQ"==this.Sd&&(this.controller=new jk(this),Db(this.ia,kk,4,4,this.controller)));if(this.D){if(this.H||Rb(this.ia,1138,4660),"ramCPQ"!=this.Sd&&this.S&&(a=this.S,a.B)){var b=1048576>this.C?21:23,c=a.B[b]|a.B[b+1]<<8,c=c+(this.B>>10);a.B[b]=c&255;a.B[b+1]=c>>8;dj(a)}}else r("No RAM allocated")};
|
||||
|
|
|
|||
Loading…
Reference in a new issue