text: (function(){/*
   https://www.pcjs.org/modules/defs.js (C) 2012-2021 Jeff Parsons
   https://www.pcjs.org/modules/numio.js (C) 2012-2021 Jeff Parsons
   https://www.pcjs.org/modules/stdio.js (C) 2012-2021 Jeff Parsons
   https://www.pcjs.org/modules/webio.js (C) 2012-2021 Jeff Parsons
   https://www.pcjs.org/modules/device.js (C) 2012-2021 Jeff Parsons
   https://www.pcjs.org/modules/input.js (C) 2012-2021 Jeff Parsons
   https://www.pcjs.org/modules/led.js (C) 2012-2021 Jeff Parsons
   https://www.pcjs.org/modules/monitor.js (C) 2012-2021 Jeff Parsons
   https://www.pcjs.org/modules/time.js (C) 2012-2021 Jeff Parsons
   https://www.pcjs.org/modules/bus.js (C) 2012-2021 Jeff Parsons
   https://www.pcjs.org/modules/memory.js (C) 2012-2021 Jeff Parsons
   https://www.pcjs.org/modules/ram.js (C) 2012-2021 Jeff Parsons
   https://www.pcjs.org/modules/rom.js (C) 2012-2021 Jeff Parsons
   https://www.pcjs.org/modules/cpu.js (C) 2012-2021 Jeff Parsons
   https://www.pcjs.org/modules/debugger.js (C) 2012-2021 Jeff Parsons
   https://www.pcjs.org/modules/cpu68k.js (C) 2012-2021 Jeff Parsons
   https://www.pcjs.org/modules/dbg68k.js (C) 2012-2021 Jeff Parsons
   https://www.pcjs.org/modules/eamodes.js (C) 2012-2021 Jeff Parsons
   https://www.pcjs.org/modules/ioregs.js (C) 2012-2021 Jeff Parsons
   https://www.pcjs.org/modules/video.js (C) 2012-2021 Jeff Parsons
   https://www.pcjs.org/modules/machine.js (C) 2012-2021 Jeff Parsons
  */
  var h;function aa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}function ba(a){if(!(a instanceof Array)){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];a=b?b.call(a):{next:aa(a)};for(var c=[];!(b=a.next()).done;)c.push(b.value);a=c}return a}
  var ca="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},da="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};
  function ea(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");}var fa=ea(this);function q(a,b){if(b)a:{var c=fa;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))break a;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&da(c,a,{configurable:!0,writable:!0,value:b})}}var ha;
  if("function"==typeof Object.setPrototypeOf)ha=Object.setPrototypeOf;else{var ia;a:{var ja={a:!0},ka={};try{ka.__proto__=ja;ia=ka.a;break a}catch(a){}ia=!1}ha=ia?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var la=ha;
  function t(a,b){a.prototype=ca(b.prototype);a.prototype.constructor=a;if(la)la(a,b);else for(var c in b)if("prototype"!=c)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.Yg=b.prototype}function ma(){for(var a=Number(this),b=[],c=a;c<arguments.length;c++)b[c-a]=arguments[c];return b}
  q("Math.trunc",function(a){return a?a:function(b){b=Number(b);if(isNaN(b)||Infinity===b||-Infinity===b||0===b)return b;var c=Math.floor(Math.abs(b));return 0>b?-c:c}});q("Math.log2",function(a){return a?a:function(b){return Math.log(b)/Math.LN2}});
  function na(a,b,c){if(null==a)throw new TypeError("The 'this' value for String.prototype."+c+" must not be null or undefined");if(b instanceof RegExp)throw new TypeError("First argument to String.prototype."+c+" must not be a regular expression");return a+""}q("String.prototype.repeat",function(a){return a?a:function(b){var c=na(this,null,"repeat");if(0>b||1342177279<b)throw new RangeError("Invalid count value");b|=0;for(var d="";b;)if(b&1&&(d+=c),b>>>=1)c+=c;return d}});
  q("Symbol",function(a){function b(f){if(this instanceof b)throw new TypeError("Symbol is not a constructor");return new c(d+(f||"")+"_"+e++,f)}function c(f,g){this.g=f;da(this,"description",{configurable:!0,writable:!0,value:g})}if(a)return a;c.prototype.toString=function(){return this.g};var d="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",e=0;return b});
  q("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;c<b.length;c++){var d=fa[b[c]];"function"===typeof d&&"function"!=typeof d.prototype[a]&&da(d.prototype,a,{configurable:!0,writable:!0,value:function(){return oa(aa(this))}})}return a});function oa(a){a={next:a};a[Symbol.iterator]=function(){return this};return a}
  function pa(a,b){a instanceof String&&(a+="");var c=0,d=!1,e={next:function(){if(!d&&c<a.length){var f=c++;return{value:b(f,a[f]),done:!1}}d=!0;return{done:!0,value:void 0}}};e[Symbol.iterator]=function(){return e};return e}q("Array.prototype.keys",function(a){return a?a:function(){return pa(this,function(b){return b})}});
  q("Array.prototype.fill",function(a){return a?a:function(b,c,d){var e=this.length||0;0>c&&(c=Math.max(0,e+c));if(null==d||d>e)d=e;d=Number(d);0>d&&(d=Math.max(0,e+d));for(c=Number(c||0);c<d;c++)this[c]=b;return this}});function qa(a){return a?a:Array.prototype.fill}q("Int8Array.prototype.fill",qa);q("Uint8Array.prototype.fill",qa);q("Uint8ClampedArray.prototype.fill",qa);q("Int16Array.prototype.fill",qa);q("Uint16Array.prototype.fill",qa);q("Int32Array.prototype.fill",qa);
  q("Uint32Array.prototype.fill",qa);q("Float32Array.prototype.fill",qa);q("Float64Array.prototype.fill",qa);q("Number.parseInt",function(a){return a||parseInt});q("Array.prototype.values",function(a){return a?a:function(){return pa(this,function(b,c){return c})}});q("String.prototype.endsWith",function(a){return a?a:function(b,c){var d=na(this,b,"endsWith");void 0===c&&(c=d.length);c=Math.max(0,Math.min(c|0,d.length));for(var e=b.length;0<e&&0<c;)if(d[--c]!=b[--e])return!1;return 0>=e}});
  q("String.prototype.startsWith",function(a){return a?a:function(b,c){var d=na(this,b,"startsWith"),e=d.length,f=b.length;c=Math.max(0,Math.min(c|0,d.length));for(var g=0;g<f&&c<e;)if(d[c++]!=b[g++])return!1;return g>=f}});function ra(){}var sa,ta=new ArrayBuffer(2);(new DataView(ta)).setUint16(0,256,!0);sa=256===(new Uint16Array(ta))[0];var u={sc:0xffffffffffff,NONE:0,Cd:0,hb:0x800000000000},w={};w.Defs=ra;function ua(){}t(ua,ra);
  function va(a,b){if(a){b||(b=10);var c,d=0<a.indexOf(",");d&&(a=a.replace(/,/g,""));var e=c=a.charAt(0);"#"==c?(b=8,c=""):"$"==c&&(b=16,c="");e!=c?a=a.substr(1):(e=c=a.substr(0,2),"0b"==c&&d||"^B"==c?(b=2,c=""):"0o"==c||"^O"==c?(b=8,c=""):"^D"==c?(b=10,c=""):"0x"==c&&(b=16,c=""),e!=c&&(a=a.substr(2)));e=c=a.slice(-1);"Y"==c||"y"==c?(b=2,c=""):"."==c?(b=10,c=""):"H"==c||"h"==c?(b=16,c=""):"K"==c?c="000":"M"==c?c="000000":"G"==c&&(c="000000000");e!=c&&(a=a.slice(0,-1)+c);var f;e=0;10>=b&&(c=a.match(/(-?[0-9]+)B([0-9]*)$/))&&
  (a=c[1],e=35-((c[2]||35)&255));if((b&&10!=b?16==b?null!==a.match(/^-?[0-9a-f]+$/i):8==b?null!==a.match(/^-?[0-7]+$/):2==b&&null!==a.match(/^-?[01]+$/):null!==a.match(/^[+-]?[0-9]+$/))&&!isNaN(f=parseInt(a,b))){e&&(0>f&&(f+=Math.pow(2,36)),f=0<e?f*Math.pow(2,e):Math.trunc(f/Math.pow(2,-e)));var g=f}}return g}
  function wa(a,b,c,d,e){d=void 0===d?0:d;var f=void 0===f?0:f;var g="",l="",k=-1;c||(c=a.wa||10);d&&(k=Math.ceil(d/Math.log2(c)));if(void 0==e)switch(c){case 8:e="0o";break;case 16:e="0x";break;case 10:l=".";default:e=""}isNaN(b)||"number"!=typeof b?(b=void 0,e=l=""):(0>b&&-1<b&&(b=-1),d&&(0>b&&(b+=Math.pow(2,d)),b>=Math.pow(2,d)&&(k=Math.ceil(Math.log(b)/Math.log(c)))));for(a=f||-1;k--;){a||(g=","+g,a=f);if(void 0==b){if(g="?"+g,0>k)break}else if(d=b%c,b=Math.trunc(b/c),d+=0<=d&&9>=d?48:55,g=String.fromCharCode(d)+
  g,!b&&0>k)break;a--}return e+g+l}function xa(a,b){var c=a/x|0,d=b/x|0;return(a&b)==(b|0)&&(c&d)==d}var x=Math.pow(2,32);w.NumIO=ua;function ya(){this.$a={};for(var a=0;22>a;a++)this.$a["ACDFHGMNSTWYbdfjcsoXx%"[a]]=null}t(ya,ua);function za(a,b,c){a.$a[b]||(a.$a[b]=c)}h=ya.prototype;h.flush=function(){var a=Aa;Aa="";this.Sa(a)};function Ba(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0<c&&(b=b.substr(0,c));c=b.lastIndexOf(".");0<c&&(b=b.substring(0,c));return b}
  h.We=function(){var a=ma.apply(0,arguments);if(void 0===a[0])a=new Date(Date.now());else if("string"===typeof a[0]){var b=a[0];0>b.indexOf(":")?b+=" "+(a[1]||"00:00:00 UTC"):b.match(/^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]$/)&&(a[1]||(b+=" UTC"));a=new Date(b)}else a=void 0===a[1]?new Date(a[0]):new Date(Date.UTC.apply(Date,ba(a)));return a};
  h.Sa=function(a,b){var c=a.lastIndexOf("\n");b?0<=c&&(b=Date.now(),Ca||(Ca=b),a=((b-Ca)/1E3).toFixed(3)+": "+a):(0<=c&&(console.log(Aa+a.substr(0,c)),Aa="",a=a.substr(c+1)),Ca=null);Aa+=a;return a.length};function A(a,b,c){a.Sa(b+"\n",c)}h.aa=function(a){return this.Sa(this.O.apply(this,[a].concat(ba(ma.apply(1,arguments)))))};
  h.O=function(a){var b=ma.apply(1,arguments);if(!b||!b.length)return a;var c="",d=a.split(/%([-+ 0#]*)([0-9]*|\*)(\.[0-9]+|)([bwhlL]?)([A-Za-z%])/),e=0,f;for(f=0;f<d.length-6;f+=6){c+=d[f];var g=d[f+5];if(void 0===this.$a[g])c+="%"+d[f+1]+d[f+2]+d[f+3]+d[f+4]+g;else{if(e<b.length){var l=b[e];"%"!=g&&e++}else l=b[b.length-1];var k=d[f+1],m=0<=k.indexOf("#"),p=0<=k.indexOf("0"),n=d[f+2];"*"==n?(n=l,l=e<b.length?b[e++]:b[b.length-1]):n=+n||0;var r=d[f+3];r=r?+r.substr(1):-1;var B=d[f+4],y=null,z=0,C=
  "";var v=0<="ACDFHGMNSTWY".indexOf(g)&&"object"!=typeof l?this.We(l):l;switch(g){case "C":l=m?"#":"";c+=isNaN(v.getTime())?void 0:this.O(this.O("%%%sW, %%%sF %%%sD, %%%sY",l),v);continue;case "D":l=m?v.getUTCDate():v.getDate();g="d";break;case "A":case "G":case "H":l=m?v.getUTCHours():v.getHours();"A"==g?(l=12>l?"am":"pm",g="s"):("G"==g&&(l=l?12<l?l-12:l:12),g="d");break;case "F":case "M":l=m?v.getUTCMonth():v.getMonth();"F"==g?(l=Da[l],g="s"):(l++,g="d");break;case "N":l=m?v.getUTCMinutes():v.getMinutes();
  g="d";break;case "S":l=m?v.getUTCSeconds():v.getSeconds();g="d";break;case "T":l=m?"#":"";c+=isNaN(v.getTime())?void 0:this.O(this.O("%%%sY-%%%s02M-%%%s02D %%%s02H:%%%s02N:%%%s02S",l),v);continue;case "W":l=Ea[m?v.getUTCDay():v.getDay()];g="s";break;case "Y":l=m?v.getUTCFullYear():v.getFullYear(),0<r&&(l%=Math.pow(10,r),r=-1),g="d"}switch(g){case "b":c+=l?"true":"false";break;case "d":l=Math.trunc(l),0<=r&&(p=!0,n<r&&(n=r),r=-1);case "f":l=+l;v=l+"";0<=r&&(v=l.toFixed(r));v.length<n&&(p?(0>l&&(n--,
  v=v.substr(1)),v=("0".repeat(n)+v).slice(-n),0>l&&(v="-"+v)):v=(" ".repeat(n)+v).slice(-n));c+=v;break;case "j":c+=JSON.stringify(l,null,n||void 0);break;case "c":l="string"==typeof l?l[0]:String.fromCharCode(l);case "s":if(void 0!=l)for("string"!=typeof l&&(l=l.toString()),0<=r&&(l=l.substr(0,r));l.length<n;)l=0<=k.indexOf("-")?l+" ":" "+l;c+=l;break;case "o":z=8,m&&(C="0");case "X":y=Fa;case "x":v="";z||(z=16);!C&&m&&(C="0x");y||(y=Ga);l=Math.trunc(l);0<=r&&(p=!0,n<r&&(n=r));p&&!n&&("b"==B?n=2:
  "h"==B||"w"==B?n=4:"l"==B?n=8:(n=Math.abs(l),n=255>=n?2:65535>=n?4:4294967295>=n?8:9),n+=C.length);n-=C.length;do m=l&z-1,l>>>=16==z?4:3,p||!v||m||l?v=y[m]+v:(C&&(v=C+v,C=""),0<n&&(v=" "+v));while(0<--n||l);c+=C+v;break;case "%":c+="%";break;default:c=this.$a[g]?c+this.$a[g](g,k,n,r,l):c+("(unimplemented sprintf type: %"+g+")")}}}return c+=d[f]};var Aa="",Ca=null,Ga="0123456789abcdef",Fa="0123456789ABCDEF",Ea="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),Da="January February March April May June July August September October November December".split(" ");
  w.StdIO=ya;function Ha(a){ya.call(this);this.ra={};this.Fa=0;this.da=this;a&&(this.da.Fa=0,this.da.Ra=[],this.da.Oa=0,this.da.tb={},this.da.ib=!1)}var Ia;t(Ha,ya);h=Ha.prototype;h.Ya=function(a,b){var c=this,d=this;switch(a){case Ja.wd:b.onclick=function(){var e=c.Ua(Ja.vb,!0);e&&(e.value="")};break;case Ja.vb:Ka(b),b.addEventListener("keydown",function(e){La(d,e,!0)}),b.addEventListener("keypress",function(e){La(d,e)})}};
  function Ma(a,b){var c=Na.xc;a.da.tb[c]||(a.da.tb[c]=[]);a.da.tb[c].push(b)}function Ka(a){a.setAttribute("autocapitalize","off");a.setAttribute("autocomplete","off");a.setAttribute("autocorrect","off");a.setAttribute("spellcheck","false");a.value=""}h.error=function(a,b){b=this.O.apply(this,[a].concat(ba(b)));var c="%s";a=!1;"boolean"==typeof c&&(a=c,c=b.shift());if(b=this.O.apply(this,[c].concat(ba(b))))A(this,b),a||alert(b)};h.Ua=function(a){return this.ra[a]};
  function Oa(a,b,c){if(a){do{for(var d=0;d<Pa.length;d++){var e=Pa[d];if(c){if(e+=c,b+e in a)return e}else if(e=e?e+b[0].toUpperCase():b[0],e+=b.substr(1),e in a)return e}if(0>b.indexOf("screen"))break;b=b.replace("screen","Screen")}while(1)}return null}function Qa(a,b){return a.M.bindings&&a.M.bindings[b]}function Ra(a){if(a=a.ra[Sa])var b=a.textContent;return b}function Ta(a,b,c){a=+a||0;a<b&&(a=b);a>c&&(a=c);return a}
  function D(a,b,c,d){a=a.M[b];void 0===a?a=c:(d&&void 0!==d[a]&&(a=d[a]),d=typeof c,typeof a!=d&&("boolean"==d?a=!!a:"number"==typeof c&&(a=+a)));return a}
  function Ua(a,b){var c=0,d=null,e=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");e.onreadystatechange=function(){4!==e.readyState?b(a,d,e.readyState,c):(d=e.responseText,200==e.status||!e.status&&d.length&&"file:"==(window?window.location.protocol:"file:")||(c=e.status||-1),b(a,d,e.readyState,c))};e.open("GET",a,!0);e.send()}
  function Va(){var a,b=Ia;if(!b){b={};if(window){a||(a=window.location.search.substr(1));for(var c,d=/\+/g,e=/([^&=]+)=?([^&]*)/g;c=e.exec(a);)b[decodeURIComponent(c[1].replace(d," ")).trim()]=decodeURIComponent(c[2].replace(d," ")).trim()}Ia=b}return b}function Wa(a){if(void 0===Xa.Mb){var b=!1;if(window)try{window.localStorage.setItem(Xa.nb,Xa.nb),b=window.localStorage.getItem(Xa.nb)==Xa.nb,window.localStorage.removeItem(Xa.nb)}catch(c){A(a,c.message),b=!1}Xa.Mb=b}return!!Xa.Mb}
  function Ya(a,b){b=void 0===b?0:b;1<b&&b%2&&b--;b=b||a.Fa;return-1==(b|1)||xa(a.da.Fa,b)?!0:!1}function Za(a){if(window){var b=window.navigator.userAgent;return"iOS"==a&&(!!b.match(/(iPod|iPhone|iPad)/)||"MacIntel"===window.navigator.platform&&1<window.navigator.maxTouchPoints)||"MSIE"==a&&!!b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)}return!1}function $a(a){var b=null;if(Wa(a)){var c;if(window)try{(c=window.localStorage.getItem(a.ha))&&(b=JSON.parse(c))}catch(d){A(a,d.message)}}return b}
  function La(a,b,c){b=b||window.event;var d=b.which||b.keyCode;if(d){var e=a.da,f=b.target;if(c){a=!1;var g;c=f.value;var l=c.lastIndexOf("\n");d==E.uc&&f.selectionStart<=l+1&&(a=!0);d==E.ze?(a=!0,0<e.Oa&&(g=e.Ra[--e.Oa])):d==E.Ed&&(a=!0,e.Oa<e.Ra.length&&(g=e.Ra[++e.Oa]||""));a&&b.preventDefault();void 0!=g&&(f.value=c.substr(0,l+1)+g)}else d=String.fromCharCode(d),g=f.value,c=g.lastIndexOf("\n"),f.selectionStart<=c&&f.setSelectionRange(g.length,g.length),b.stopPropagation(),"@"==d&&0<e.Oa&&c+1==
  g.length&&(f.value+=e.Ra[--e.Oa],d="\r"),"\r"==d&&(b.preventDefault(),g=f.value+="\n",f.blur(),f.focus(),(b=ab(a,g.slice(g.lastIndexOf("\n",g.length-2)+1,-1)||""))&&A(a,b.replace(/\n$/,""),!1))}}function bb(a){if(window){var b=window.onresize;window.onresize="function"!==typeof b?a:function(){b&&b();a()}}}function cb(a){return"true"==a||"on"==a?!0:"false"==a||"off"==a?!1:void 0}
  function db(a,b){if(void 0!=b){var c=a.da;try{if(b=b.trim())c.Oa<c.Ra.length&&b==c.Ra[c.Oa]?c.Oa++:(c.Ra.push(b),c.Oa=c.Ra.length);var d=b.split(" "),e=d[0],f=a.da.tb[Na.xc];switch(e[0]){case "m":if("?"==e[1]){var g="";eb.forEach(function(n){g+=n+"\n"});g&&(g="message commands:\n"+g);break}g="";var l=void 0;e=d[d.length-1].toLowerCase();var k=cb(e);void 0!=k&&d.pop();1>=d.length&&(void 0!=k&&(l=k,k=void 0),d[1]="all");"all"==d[1]&&(d=Object.keys(F));for(f=1;f<d.length;f++){e=d[f];var m=F[e];if(!m){g+=
  "unrecognized message: "+e+"\n";break}void 0!=k&&fb(a,m,k);if(void 0==l||l==Ya(a,m))g+=a.O("%8s: %b\n",e,Ya(a,m))}Ya(a,u.hb)&&(g+="all messages will be buffered until buffer is turned off\n");g||(g="no messages\n");break;case "?":g="",gb.forEach(function(n){g+=n+"\n"}),g&&(g="default commands:\n"+g);default:if(d.unshift(b),f)for(a=0;a<f.length;a++){var p=f[a](d);if(void 0!=p){g=g?g+p:p;break}}}}catch(n){g="error: "+n.message+"\n"}}return g}
  function ab(a,b){b=void 0===b?"?":b;if(b){var c="";b=b.split(/(?:\n|;\s*)/);for(var d=0;d<b.length;d++)c+=db(a,b[d])}return c}h.Sa=function(a,b){void 0==b&&(b=Ya(this,u.hb));if(!b){var c=this.Ua(Ja.vb,!0);if(c)return c.value.substr(-a.length)!=a&&(c.value+=a,8192<c.value.length&&(c.value=c.value.substr(c.value.length-4096)),c.scrollTop=c.scrollHeight,Za("iOS")||c.setSelectionRange(c.value.length,c.value.length)),a.length}return ya.prototype.Sa.call(this,a,b)};
  h.aa=function(a){var b=ma.apply(1,arguments),c=0;"number"==typeof a&&(c=a,a=b.shift());return Ya(this,c)?ya.prototype.aa.call.apply(ya.prototype.aa,[this,a].concat(ba(b))):0};function hb(a,b){if(Wa(a)){b=JSON.stringify(b);try{window.localStorage.setItem(a.ha,b)}catch(c){A(a,c.message)}}}function ib(a,b,c){(a=a.ra[b])&&a.textContent!=c&&(a.textContent=c)}
  function fb(a,b,c){var d=!1;c?(c=a.da.Fa,a.da.Fa=(c|b)+(c/x|0|b/x|0)*x):(d=xa(a.da.Fa,u.hb)&&xa(b,u.hb),c=a.da.Fa,a.da.Fa=(c&~b)+((c/x|0)&~(b/x|0))*x);d&&a.flush()}
  var Ja={wd:"clear",vb:"print"},gb=["\u2191 \u2193\t\trecall commands","@\t\trepeat last command","m?\t\tmessage commands"],eb=["m\t\tdisplay all messages","m on\t\tdisplay all active messages","m off\t\tdisplay all inactive messages","m all [on|off]\tturn all messages on or off","m ... [on|off]\tturn selected messages on or off"],F={all:u.sc,buffer:u.hb},Na={xc:"command"},jb={yc:13,Lb:65,tc:66,vc:67,zc:68,E:69,Bc:70,Dc:71,Ec:72,Fc:73,Gc:74,Pc:75,Rc:76,Tc:77,Uc:78,Vc:79,Wc:80,Q:81,Xc:82,$c:83,bd:84,
  cd:85,dd:86,fd:87,gd:88,hd:89,Wb:90,a:97,b:98,c:99,d:100,e:101,f:102,Pg:103,Qg:104,Rg:105,Sg:106,k:107,Tg:108,Ug:109,n:110,Vg:111,p:112,q:113,r:114,Wg:115,t:116,Zg:117,$g:118,w:119,x:120,y:121,z:122},E={uc:8,te:9,Xd:10,yc:13,qe:16,Ad:17,td:18,Bg:19,Nb:20,Df:27,se:32,Eg:33,Dg:34,Cf:35,Yf:36,Sc:37,ze:38,Sb:39,Vf:39,Ed:40,Sf:44,Fg:44,Zf:45,Bf:46,Uf:46,Xf:47,ZERO:48,ONE:49,ye:50,ue:51,Pd:52,Od:53,re:54,pe:55,Fd:56,be:57,Md:59,Ld:61,Lb:65,tc:66,vc:67,zc:68,E:69,Bc:70,Dc:71,Ec:72,Fc:73,Gc:74,Pc:75,Rc:76,
  Tc:77,Uc:78,Vc:79,Wc:80,Q:81,Xc:82,$c:83,bd:84,cd:85,dd:86,fd:87,gd:88,hd:89,Wb:90,wc:91,Tf:91,Rf:92,Ig:93,Wf:93,cg:96,tg:96,Qf:96,dg:97,rg:97,eg:98,qg:98,fg:99,wg:99,gg:100,ug:100,hg:101,ng:101,ig:102,yg:102,jg:103,sg:103,kg:104,Ag:104,lg:105,xg:105,vg:106,mg:107,zg:109,og:110,pg:111,Ef:112,If:113,Jf:114,Kf:115,Lf:116,Mf:117,Nf:118,Of:119,Pf:120,Ff:121,Gf:122,Hf:123,ce:144,me:145,Kd:173,ne:186,Gd:187,zf:188,Bd:189,Cg:190,Kg:191,xf:192,$f:219,yf:220,Hg:221,Gg:222,Jd:224,ag:901,ed:1E3},kb={},lb=(kb[E.Md]=
  E.ne,kb[E.Ld]=E.Gd,kb[E.Kd]=E.Bd,kb[E.Jd]=E.wc,kb),mb={Sc:1,Sb:2,bg:3},G={},nb=(G[E.uc]="\b",G[E.te]="\t",G[E.Xd]="\n",G[E.yc]="\r",G[E.se]=" ",G[E.ZERO]="0",G[E.ONE]="1",G[E.ye]="2",G[E.ue]="3",G[E.Pd]="4",G[E.Od]="5",G[E.re]="6",G[E.pe]="7",G[E.Fd]="8",G[E.be]="9",G[E.Lb]="A",G[E.tc]="B",G[E.vc]="C",G[E.zc]="D",G[E.E]="E",G[E.Bc]="F",G[E.Dc]="G",G[E.Ec]="H",G[E.Fc]="I",G[E.Gc]="J",G[E.Pc]="K",G[E.Rc]="L",G[E.Tc]="M",G[E.Uc]="N",G[E.Vc]="O",G[E.Wc]="P",G[E.Q]="Q",G[E.Xc]="R",G[E.$c]="S",G[E.bd]=
  "T",G[E.cd]="U",G[E.dd]="V",G[E.fd]="W",G[E.gd]="X",G[E.hd]="Y",G[E.Wb]="Z",G[E.Sc]="Left",G[E.Sb]="Right",G),Pa=["","moz","ms","webkit"],ob={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",
  crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",
  forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",
  lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",
  moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",
  seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},Xa={Mb:void 0,nb:"PCjs.localStorage"};w.WebIO=Ha;
  function H(a,b,c,d){a=void 0===a?"default":a;b=void 0===b?a:b;c=void 0===c?{}:c;d=void 0===d?[]:d;Ha.call(this,a==b);this.ha=a;this.ja=b;pb[this.ha]||(pb[this.ha]={});pb[this.ha][this.ja]&&this.aa("warning: machine configuration contains multiple '%s' devices\n",this.ja);pb[this.ha][this.ja]=this;this.id=this.ha==this.ja?this.ha:this.ha+"."+this.ja;qb.push(this);this.da=rb(this,this.ha);this.ready=!0;sb(this,c,d);this.jb={};this.Zc=[]}t(H,Ha);h=H.prototype;h.Xb=function(){};h.Yb=function(){};
  function sb(a,b,c){c=b.overrides||c;if(c.length){var d=Va();for(l in d)if(0<=c.indexOf(l)){var e=d[l],f=va(e,10);void 0==f&&("true"==e?f=!0:"false"==e?f=!1:(f=e,e='"'+e+'"'));b[l]=f;A(a,"overriding "+a.ja+" property '"+l+"' with "+e)}}a.M=b;c=b.bindings;c=void 0===c?{}:c;if("undefined"!=typeof document){a.M.ra||(a.M.ra=c);(d=Array.isArray(c))?0>c.indexOf("container")&&c.push("container"):c.container||(c.container=a.ja);for(var g in c){e=c[g];if(d)g=e;else if(e.match(/^[0-9]+$/)){var l=+e;a.ra[g]=
  [];do{e=g+l++;e=document.getElementById(e);if(!e)break;a.ra[g].push(e)}while(1);continue}if(l=document.getElementById(e))a.ra[g]=l,a.Ya(g,l)}}b=void 0===b?{}:b;a.version=2;if(a.version){g="";var k;a.ha!=a.ja&&(k=rb(a,a.ha).version)&&k!=a.version&&(g="Machine");g||(k=b.version)&&k>a.version&&(g="Config");g&&(k=a.O("%s Device version (%3.2f) incompatible with %s version (%3.2f)",b.Mg,a.version,g,k),a.error("%s\n\nClearing your browser's cache may resolve the issue.",k))}}
  function I(a,b,c,d){a.jb[b]={get:c.bind(a),set:d?d.bind(a):null}}function tb(a,b){var c;try{var d=pb[a.ha];if(d)for(c in d){var e=d[c];if(e.ja!=e.ha&&!b(e))return!1}return!0}catch(f){a.aa("error while enumerating device '%s': %s\n",c,f.message)}return!1}h.Ua=function(a,b){b=void 0===b?!1:b;if(a){var c=Ha.prototype.Ua.call(this,a,b);if(void 0===c&&b){b=pb[this.ha];for(var d in b)if(c=b[d].ra[a])break;c||(c=null);this.ra[a]=c}}return c};
  function rb(a,b,c){var d=b,e=a.ha,f=e.indexOf(".");0<f&&(e=e.substr(0,f),b=b.substr(f+1));b=(f=pb[e])&&f[b]||null;if(!b){for(f=0;f<qb.length;f++)if(qb[f].id===d){b=qb[f];break}if(!b&&(void 0===c||c))throw Error(a.O('no "%s" device',d));}return b}function J(a,b,c){var d=null,e=pb[a.ha];if(e)for(var f in e)if(e[f].M["class"]==b){if(d){d=null;break}d=e[f]}if(!d&&(void 0===c||c))throw Error(a.O("no %s device",b));return d}function ub(a,b){var c=rb(a,a.ha);return c&&c.M&&c.M[b]||a.M[b]}
  function vb(a,b){return(a=a.jb[b])&&a.get()}function wb(a){return a==a.da&&a.ready?tb(a,function(b){return wb(b)}):a.ready}function xb(a,b){b=void 0===b?a.ready:b;a.ready=b;if(wb(a)){for(;b=a.Zc.pop();)b();a!=a.da&&xb(a.da)}}function yb(a,b){if(wb(a))return b(),!0;a.Zc.push(b);return!1}h.pd=function(){};
  h.aa=function(a){var b=ma.apply(1,arguments);return"number"==typeof a&&Ya(this,a)&&(void 0===this.I&&(this.I=J(this,"Debugger",!1)),this.I&&this.I.pd(a),this.da.Fa&u.rc&&(void 0===this.g&&(this.g=J(this,"CPU")),this.g))?(a=b.shift(),Ha.prototype.aa.call(this,"%#06x: %s.%s\n",this.g.Va,this.ja,this.O.apply(this,[a].concat(ba(b))).trim())):Ha.prototype.aa.call.apply(Ha.prototype.aa,[this,a].concat(ba(b)))};function zb(a,b){(a=pb[a.ha])&&delete a[b]}function Ab(a,b,c){(a=a.jb[b])&&a.set&&a.set(c)}
  "undefined"!=typeof window&&(window.PCjs||(window.PCjs={}),window.PCjs.Machines||(window.PCjs.Machines={}),window.PCjs.Components||(window.PCjs.Components=[]));var pb="undefined"!=typeof window?window.PCjs.Machines:{},qb="undefined"!=typeof window?window.PCjs.Components:[];u.rc=1;u.ud=2;u.Id=4;u.Yd=8;u.he=16;u.vd=32;u.Vd=64;u.oe=128;u.Zd=256;u.zd=512;u.$d=1024;u.INT=2048;u.xe=4096;u.Be=8192;u.ub=16384;u.le=32768;u.Dd=65536;u.Nd=131072;u.wb=262144;u.ve=524288;u.Ac=1048576;u.Pa=2097152;u.Qc=4194304;
  u.ae=8388608;u.we=16777216;u.Rd=33554432;u.xb=67108864;u.Hd=134217728;u.Qd=268435456;u.Af=4294967296;F.addr=u.rc;F.bus=u.ud;F.fault=u.Id;F.memory=u.Yd;F.ports=u.he;F.chips=u.vd;F.kbd=u.Vd;F.serial=u.oe;F.misc=u.Zd;F.cpu=u.zd;F.mmu=u.$d;F["int"]=u.INT;F.trap=u.xe;F.video=u.Be;F.monitor=u.ub;F.screen=u.le;F.disk=u.Dd;F.file=u.Nd;F.time=u.wb;F.timer=u.ve;F.event=u.Ac;F.input=u.Pa;F.key=u.Qc;F.mouse=u.ae;F.touch=u.we;F.info=u.Rd;F.warn=u.xb;F.error=u.Hd;F.halt=u.Qd;w.Device=H;
  function Bb(a,b,c){H.call(this,a,b,c);this.Fa=u.Pa;this.W=this.N=null;this.time=J(this,"Time");this.da=J(this,"Machine");this.ca=D(this,"drag",!1);this.U=D(this,"scroll",!1);this.ba=D(this,"hexagonal",!1);this.m=D(this,"releaseDelay",0,void 0);this.o=!1;a=this.M.map;this.i=this.l=null;if(a)if(a.length)this.i=a;else{this.l={};b=Object.keys(a);for(var d=0;d<b.length;d++){var e=[],f=b[d],g=a[f];"string"==typeof g?g=[g]:void 0==g.length&&(e=g.grid,g=g.keys,"string"==typeof g&&(g=[g]));this.l[f]={keys:g,
  grid:e,state:0}}}this.R=[];this.S=[];this.v=!1;this.j=this.H=null;(a=this.ra[Cb])&&Db(this,a,this.Ua(c.focusBinding,!0),this.M.location);this.Ea()}t(Bb,H);function Eb(a,b){a.N=b}function Fb(a,b,c){for(var d=0;d<a.R.length;d++){var e=a.R[d];e.id===b&&e.Ab(b,c)}}
  function Db(a,b,c,d){d=void 0===d?[]:d;if(d.length||a.i||a.l){var e={};e.vf=d[0]||0;e.wf=d[1]||0;e.pb=d[2]||b.clientWidth;e.yb=d[3]||b.clientHeight;e.Bb=d[4]||1;e.Ib=d[5]||1;e.Oe=d[6]||b.naturalWidth||e.pb;e.Qe=d[7]||b.naturalHeight||e.yb;e.qd=d[8]||0;e.rd=d[9]||0;e.Ne=d[10]||0;e.Pe=d[11]||0;a.i?(e.Eb=a.i.length,e.qb=a.i[0].length):(e.qb=e.Bb,e.Eb=e.Ib,e.Bb=e.Ib=0);e.kd=e.pb/(e.qb+e.qb*e.Bb)|0;e.ld=e.yb/(e.Eb+e.Eb*e.Ib)|0;e.Me=e.kd*e.Bb|0;e.md=e.ld*e.Ib|0;e.sb=e.Kb=-1;Gb(a,b,e);Hb(a,b,e);a.time&&
  a.m&&(a.Z=Ib(a.time,"timerInputRelease",function(){0>e.sb&&0>e.Kb&&Jb(a,-1,-1)}))}if(a.i||a.l)a.time&&a.m&&(a.ea=Ib(a.time,"timerKeyRelease",function(){Kb(a)})),a.u=0,a.L="",a.J=[],d=b,c&&(d=c,a.j||"BUTTON"!=c.nodeName||(d=document,a.j=c,Lb(a,b),a.H=b)),Lb(a,d),a.j||(a.j=d)}function Mb(a){a.m?Nb(a.time,a.ea,a.m):Kb(a)}
  function Lb(a,b){function c(e,f,g){var l=document.activeElement;a.aa(u.Qc+u.Ac,"%s.onKey%s(%d): %5.2f (%s)\n",l.id||l.nodeName,e,f,Date.now()/1E3%60,void 0!=g?g?"used":"unused":"ignored")}function d(e,f){e=document.activeElement;return a.j&&e!=a.j&&e!=a.H?null:f||window.event}b.addEventListener("keydown",function(e){if(e=d(this,e)){var f=e.which||e.keyCode,g=Ob(a,f,!0,e);c("Down",f,g);g&&e.preventDefault()}});b.addEventListener("keypress",function(e){if(e=d(this,e)){var f=e.which||e.charCode,g=Ob(a,
  f);c("Press",f,g);g&&e.preventDefault()}});b.addEventListener("keyup",function(e){if(e=d(this,e)){var f=e.which||e.keyCode,g=Ob(a,f,!1,e);c("Up",f);g&&e.preventDefault();"TEXTAREA"==b.nodeName&&(b.value="")}})}
  function Gb(a,b,c){b.addEventListener("mousedown",function(d){if(!a.o){var e=a.v?a.H:a.j;if(e){var f=window.scrollX,g=window.scrollY;e.focus();window.scrollTo(f,g)}d.button||Pb(a,b,Qb,d,c)}});b.addEventListener("mousemove",function(d){a.o||Pb(a,b,Rb,d,c)});b.addEventListener("mouseup",function(d){a.o||d.button||Pb(a,b,Sb,d,c)});b.addEventListener("mouseout",function(d){a.o||(0>c.sb?Pb(a,b,Rb,d,c):Pb(a,b,Sb,d,c))})}
  function Hb(a,b,c){b.addEventListener("touchstart",function(d){a.U&&(a.o=!0);Pb(a,b,Qb,d,c)});b.addEventListener("touchmove",function(d){Pb(a,b,Rb,d,c)});b.addEventListener("touchend",function(d){Pb(a,b,Sb,d,c)})}
  function Ob(a,b,c,d){if(void 0!=c){var e=lb[b]||b;var f=nb[b];var g=Tb[e];d=d&&d.location==mb.Sb;g&Ub&&d&&(g>>=1);g&&(g&Vb&&(c=!(a.h&g)),a.h=c?a.h|g:a.h&~g,Fb(a,e,c))}else f=String.fromCharCode(b).toUpperCase(),b>=jb.Lb&&b<=jb.Wb?a.h&(Wb|Xb)||(a.h|=Xb,Fb(a,E.Nb,!0)):b>=jb.a&&b<=jb.z&&a.h&Xb&&(a.h&=~Xb,Fb(a,E.Nb,!1));if(a.i){if(void 0!=c)return!1;for(e=0;e<a.i.length;e++)for(g=a.i[e],d=0;d<g.length;d++)if(0<=g[d].split("|").indexOf(f))return a.u?16>a.J.length&&a.J.push(b):(a.u=1,a.L=f,Jb(a,d,e),Fb(a,
  f,!0),Mb(a)),!0}if(a.l){if(void 0==c)return!0;b=Object.keys(a.l);for(e=0;e<b.length;e++)if(g=b[e],0<=a.l[g].keys.indexOf(f))return Fb(a,g,c),a.l[g].state=c?1:0,!0}return!1}function Kb(a){1==a.u?(a.u++,Fb(a,a.L,!1),a.L="",Jb(a,-1,-1),Mb(a)):(a.u=0,a.J.length&&Ob(a,a.J.shift()))}Bb.prototype.Ea=function(){this.h=0;this.T=this.Y=-1};
  function Pb(a,b,c,d,e){var f=-1,g=-1,l=!1,k=-1,m=-1;if(c<Sb){d=d||window.event;d.targetTouches&&d.targetTouches.length?(k=d.targetTouches[0].clientX,m=d.targetTouches[0].clientY,l=1<d.targetTouches.length):(k=d.clientX,m=d.clientY);var p=d.target.getBoundingClientRect();k-=p.left;m-=p.top;k=e.Oe/b.offsetWidth*k|0;m=e.Qe/b.offsetHeight*m|0;var n=k-e.vf;var r=m-e.wf;var B=p=!1;var y=k>=e.qd&&k<e.qd+e.Ne&&m>=e.rd&&m<e.rd+e.Pe;if(0<=n&&n<e.pb&&0<=r+e.md||y)if(l||a.U||d.preventDefault(),0<=n&&n<e.pb&&
  0<=r&&r<e.yb){B=!0;d=e.pb/e.qb|0;var z=e.yb/e.Eb|0,C=n/d|0,v=r/z|0;!a.ba||v&1||(n-=d>>1,C=n/d|0,C==e.qb-1&&(n=-1));z=v*z+(e.md>>1);n-=C*d+(e.Me>>1);r-=z;0<=n&&n<e.kd&&0<=r&&r<e.ld&&(f=C,g=v,p=!0)}}n=n||0;r=r||0;d=b.offsetWidth;b=b.offsetHeight;if(c==Qb||c==Sb)for(C=0;C<a.S.length;C++)v=a.S[C],c==Sb?v.Ab(v.id,!1):(z=r/(b/v.Og|0)|0,(n/(d/v.Ng|0)|0)==v.ah&&z==v.bh&&v.Ab(v.id,!0));if(!l)if(c==Qb)e.sb=k,e.Kb=m,B?(Jb(a,f,g),p&&a.m&&Nb(a.time,a.Z,a.m,!0)):y&&a.da.Ga();else if(c==Rb)0<=e.sb&&0<=e.Kb&&a.ca?
  Jb(a,f,g):a.N&&a.N(f,g);else if(c==Sb){if(c=a.m)c=a.time,f=a.Z,c=c.h&&0<f&&f<=c.i.length?0<=c.i[f-1].Ka:!1;c||Jb(a,-1,-1);e.sb=e.Kb=-1}else A(a,"unrecognized action: "+c)}function Yb(a){var b=a.v?a.H:a.j;b&&wb(a.da)&&(a.aa(u.Pa,'setFocus("%s")\n',b.id||b.nodeName),b.focus(),b.scrollIntoView())}function Jb(a,b,c){if(b!=a.T||c!=a.Y)a.T=b,a.Y=c,a.W&&a.W(b,c)}
  var Qb=1,Rb=2,Sb=3,Cb="surface",Wb=3,Ub=170,Xb=512,Vb=3584,Zb={},Tb=(Zb[E.qe]=2,Zb[E.Ad]=8,Zb[E.td]=32,Zb[E.wc]=128,Zb[E.Nb]=Xb,Zb[E.ce]=1024,Zb[E.me]=2048,Zb);w.Input=Bb;
  function $b(a,b,c){H.call(this,a,b,c,["color","backgroundColor"]);a=this.ra[ac];if(!a)throw Error("LED "+this.M.ra[ac]+" binding for '"+ac+"' missing");b=document.createElement("canvas");if(!b||!b.getContext)throw a.innerHTML="LED device requires HTML5 canvas support",Error("LED device requires HTML5 canvas support");this.Aa=Qa(this,ac)+".canvas";b.setAttribute("id",this.Aa);this.type=Ta(D(this,"type",bc,cc),dc,ec);this.l=fc[this.type][0];this.v=fc[this.type][1];this.width=D(this,"width",this.l,void 0);
  this.height=D(this,"height",this.v,void 0);this.m=D(this,"cols",1,void 0);this.N=this.m+D(this,"colsExtra",0,void 0);this.ba=D(this,"rows",1,void 0);this.T=this.ba+D(this,"rowsExtra",0,void 0);this.ea=this.width*this.m;this.W=this.height*this.ba;this.u=gc("black",0);this.j=hc(this.M.color)||this.u;this.na=gc(this.j,1,.25);this.ma=gc(this.j,1,2);this.o=hc(this.M.backgroundColor);this.ta=D(this,"fixed",!1);this.ta||(b.style.width="100%",b.style.height="auto");this.la=D(this,"hexagonal",!1);this.za=
  D(this,"highlight",!0);this.U=D(this,"persistent",this.type<ec);b.setAttribute("width",this.ea.toString());b.setAttribute("height",this.W.toString());b.style.backgroundColor=this.u;a.appendChild(b);this.fa=b.getContext("2d");if(this.H=document.createElement("canvas"))this.H.width=this.ca=this.l*this.m,this.H.height=this.J=this.v*this.ba,this.i=this.H.getContext("2d");this.Ba=(this.T+1)*this.N*4;this.h=Array(this.Ba);this.Da=this.m<this.N?4*(this.N-this.m):0;this.R=this.S=!1;this.L=this.Z=0;this.Y=
  -1;var d=this;this.time=J(this,"Time");ic(this.time,function(e){jc(d,!1,e)});kc(d)}t($b,H);function kc(a){for(var b=a.h,c=0;c<b.length;c+=4){var d=a,e=b,f=c;e[f]=d.type<ec?lc:" ";e[f+1]=d.j==d.u?null:d.j;e[f+2]=0;e[f+3]=mc}a.R=a.S=!0;jc(a,!0)}function nc(a){a.o?(a.i.fillStyle=a.o,a.i.fillRect(0,0,a.ca,a.J)):a.i.clearRect(0,0,a.ca,a.J)}
  function jc(a,b,c){b=void 0===b?!1:b;c=void 0===c?0:c;if(a.R||b){if(a.type<ec){var d=0;if(!a.U||b)nc(a);else if(a.L){d=a.m-a.L;var e=a.l*d;a.i.drawImage(a.H,a.l*a.L,0,e,a.J,0,0,e,a.J)}for(var f=e=0;f<a.T;f++){for(var g=0;g<a.m;g++){var l=a.h[e],k=a.h[e+1]||a.u,m=a.za&&e==a.Y;if(a.h[e+3]&mc||m||b){if(g>=d)a:{var p=a,n=l;l=k;var r=g;k=f;var B=m;r=void 0===r?0:r;k=void 0===k?0:k;B=void 0===B?!1:B;var y=0;if(p.la&&!(k&1)&&(y=p.l>>1,r==p.m-1))break a;if(l&&l!=p.j){B=B?gc(l,1,2):l;var z=gc(l,1,.25)}else B=
  B?p.ma:p.j,z=p.na;l=!1;n=n?B:z;B==p.u&&(n=p.o,l=!0);B=r*p.l+y;z=k*p.v;p.U&&(r=r*p.l+y,k*=p.v,p.o?(p.i.fillStyle=p.o,p.i.fillRect(r,k,p.l,p.v)):p.i.clearRect(r,k,p.l,p.v));p.i.fillStyle=n;k=oc[p.type];3==k.length?(p.i.beginPath(),p.i.arc(B+k[0],z+k[1],k[2],0,2*Math.PI),l?(p.i.globalCompositeOperation="destination-out",p.i.fill(),p.i.globalCompositeOperation="source-over"):p.i.fill()):p.i.fillRect(B+k[0],z+k[1],k[2],k[3])}a.h[e+3]=m?a.h[e+3]|mc:a.h[e+3]&~mc}e+=4}e+=a.Da}a.L=0}else{b="";for(d=0;d<a.h.length;d+=
  4)b+=a.h[d]||" ",a.h[d+3]&pc&&(b+=".");nc(a);for(f=e=d=0;d<b.length;d++){k=b[d];"."==k&&e&&e--;g=a;m=e;p=f;m=void 0===m?0:m;p=void 0===p?0:p;if(k=qc[k])for(l=0;l<k.length;l++)if(r=g,y=rc[k[l]]){n=(void 0===m?0:m)*r.l;B=(void 0===p?0:p)*r.v;r.i.fillStyle=r.j;r.i.beginPath();if(3==y.length)r.i.arc(n+y[0],B+y[1],y[2],0,2*Math.PI);else for(z=0;z<y.length;z+=2)z?r.i.lineTo(n+y[z],B+y[z+1]):r.i.moveTo(n+y[z],B+y[z+1]);r.i.closePath();r.i.fill()}if(++e==a.m&&(e=0,++f==a.T))break}}a.fa.globalCompositeOperation=
  a.o&&a.j!=a.u?"source-over":"copy";a.fa.drawImage(a.H,0,0,a.ca,a.J,0,0,a.ea,a.W);a.R=!1;a.Y=-1}else a.U||a.S||(!c||!a.Z||c-a.Z>=(1E3/60|0))&&kc(a);a.S=!1;c&&(a.Z=c)}function hc(a){return(a=a||void 0)&&ob[a]||a}
  function gc(a,b,c){b=void 0===b?1:b;c=void 0===c?1:c;if(a){var d=[];a=ob[a]||a;var e=16;var f=a.match(/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);f||(e=10,f=a.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,?\s*(\d+|)\)$/i));if(f){var g;for(g=1;g<f.length;g++)d[g-1]=Number.parseInt(f[g],e);d.length=g-1;e=!0}else e=!1;if(e){a="rgba(";for(e=0;3>e;e++)f=Math.round(d[e]*c),f=0>f?0:255<f?255:f,a+=f+",";a+=(e<d.length?d[e]:b)+")"}}return a}
  $b.prototype.Ja=function(a){var b=a.shift(),c=a.shift();a=a.shift();if(b==this.j&&c==this.o&&a&&a.length==this.h.length){this.h=a;for(b=0;b<=this.h.length-4;b+=4)this.h[b+1]==this.u&&(this.h[b+1]=null);jc(this,!0);return!0}return!1};$b.prototype.La=function(a){this.h&&(a.push(this.j),a.push(this.o),a.push(this.h))};
  var dc=0,bc=1,ec=3,cc={small:dc,round:bc,square:2,digit:ec},ac="container",lc=0,pc=1,mc=128,sc={},oc=(sc[dc]=[4,4,4],sc[bc]=[16,16,14],sc[2]=[2,2,28,28],sc),fc=[[8,8],[32,32],[32,32],[96,128]],rc={A:[30,8,79,8,67,19,37,19],B:[83,10,77,52,67,46,70,22],C:[77,59,71,100,61,89,64,64],D:[28,91,58,91,69,104,15,104],E:[18,59,28,64,25,88,12,100],F:[24,10,34,21,31,47,18,52],G:[24,56,34,50,60,50,71,56,61,61,33,61],P:[80,102,8]},qc={" ":[],0:"ABCDEF".split(""),1:["B","C"],2:["A","B","D","E","G"],3:["A","B","C",
  "D","G"],4:["B","C","F","G"],5:["A","C","D","F","G"],6:"ACDEFG".split(""),7:["A","B","C"],8:"ABCDEFG".split(""),9:"ABCDFG".split(""),A:"ABCEFG".split(""),B:["C","D","E","F","G"],C:["A","D","E","F"],D:["B","C","D","E","G"],E:["A","D","E","F","G"],F:["A","E","F","G"],"-":["G"],".":["P"]};w.LED=$b;
  function tc(a,b,c){H.call(this,a,b,c);var d=this;this.sd=this.M.touchType;this.Ub=this.M.diagnostics;this.Y=this.M.monitorWidth||640;this.R=this.M.monitorHeight||480;this.l=this.ra[uc.ub];if(!this.l)throw Error("unable to find binding: "+uc.ub);this.h=this.Ua(uc.yd)||this.l;b=this.ra[uc.ad];if(!b){b=document.createElement("canvas");if(a=Qa(this,uc.ad))this.ra[a]=b,b.setAttribute("id",a);b.setAttribute("class","pcjs-surface");b.setAttribute("width",this.M.monitorWidth);b.setAttribute("height",this.M.monitorHeight);
  b.style.backgroundColor=this.M.monitorColor||"black";this.l.appendChild(b)}this.m=b;this.H=a=b.getContext("2d");Za("MSIE")&&(this.l.onresize=function(g,l,k,m){return function(){l.style.height=(g.clientWidth*m/k|0)+"px"}}(this.l,b,this.M.monitorWidth,this.M.monitorHeight),this.l.onresize());(c=+(this.M.aspect||Va().aspect))&&.3<=c&&3.33>=c&&(bb(function(g,l,k){return function(){l.style.height=(g.clientWidth/k|0)+"px"}}(this.l,b,c)),window.onresize());this.la=this.fa=this.da.ib=!1;if(c=this.ra[uc.Cc])if(b=
  Oa(this.h,"requestFullscreen")){this.h.zb=this.h[b];this.la=!0;this.fa=document.fullscreenEnabled||Za("Edge/");if(b=Oa(document,"on","fullscreenchange")){var e=Oa(document,"fullscreenElement");document.addEventListener(b,function(){vc(d,null!=document[e])},!1)}(b=Oa(document,"on","fullscreenerror"))&&document.addEventListener(b,function(){vc(d)},!1)}else this.aa("Full-screen API not available\n"),c.parentNode.removeChild(c);if(this.sd||this.Ub||this.la&&!Za("iOS")){var f=document.createElement("textarea");
  if(b=Qa(this,uc.de))this.ra[b]=f,f.setAttribute("id",b);f.setAttribute("class","pcjs-overlay");Za("iOS")&&(Ka(f),f.style.fontSize="16px");this.l.appendChild(f)}(this.u=J(this,"Input",!1))&&Db(this.u,f||this.l,this.Ua(this.M.focusBinding,!0));f=this.M.smoothing;(b=Va().smoothing)&&(f="true"==b);this.ma=f;this.Ia=Oa(a,"imageSmoothingEnabled");if(this.j=this.M.monitorRotate)this.j=this.j%360,0<this.j&&(this.j-=360),-90!=this.j?(this.aa("unsupported monitor rotation: %d\n",this.j),this.j=0):(a.translate(0,
  this.R),a.rotate(this.j*Math.PI/180),a.scale(this.R/this.Y,this.Y/this.R))}t(tc,H);tc.prototype.Ya=function(a,b){var c=this;switch(a){case uc.Cc:b.onclick=function(){c.da.ib=1>=window.outerHeight-window.innerHeight;c.da.ib||c.zb()}}H.prototype.Ya.call(this,a,b)};function wc(a){a.H&&(a.H.fillStyle="black",a.H.fillRect(0,0,a.m.width,a.m.height))}
  tc.prototype.zb=function(){var a=!1;if(this.h&&this.h.zb){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.Y/this.R;b>c&&(a=Math.round(c/b*100)+"%")}this.fa?(this.m.style.width=a,this.m.style.height="auto",this.m.style.display="block",this.m.style.margin="auto"):(this.h.style.width=a,this.h.style.height="auto");this.Ba=this.h.style.backgroundColor;this.h.style.backgroundColor="black";this.h.zb();this.u&&(a=this.u,a.v=!0,Yb(a));a=!0}return a};
  function vc(a,b){a.da.ib=!0;b||(a.h&&(a.fa?a.m.style.width=a.m.style.height="":a.h.style.width=a.h.style.height="",a.Ba&&(a.h.style.backgroundColor=a.Ba)),a.da.ib=!1);a.u&&!b&&(a=a.u,a.v=!1,Yb(a))}tc.prototype.Ga=function(a){a?(xc(this),yc(this)):wc(this)};tc.prototype.Ea=function(){wc(this)};var uc={yd:"container",ad:"surface",ub:"monitor",de:"overlay",Cc:"fullScreen"};w.Monitor=tc;
  function zc(a,b,c){H.call(this,a,b,c);this.na=D(this,"cyclesMinimum",1E5,void 0);this.Ba=D(this,"cyclesMaximum",1E9,void 0);this.ca=Ta(D(this,"cyclesPerSecond",1E6,void 0),this.na,this.Ba);this.W=1E3/60;this.Da=D(this,"updatesPerSecond",2,void 0)||2;this.bb=1E3/this.Da;this.Aa=0;this.cb=D(this,"timeLock",!0);this.ma=this.N=0;this.la=this.m=1;this.za=this.u=this.ca/1E4/100;this.ea=[];this.J=[];this.i=[];this.T=[];this.ta=this.h=this.U=this.H=!1;this.L=this.l=0;a=Oa(window,"requestAnimationFrame");
  if(!a){a="setTimeout";var d=this.W}this.Ia=window[a].bind(window,this.jf.bind(this),d);this.Ta=window[Oa(window,"cancelAnimationFrame")||"clearTimeout"].bind(window);this.Z=this.Y=this.o=this.j=this.ba=0;Ac(this)||Bc(this,this.la)}t(zc,H);function ic(a,b){a.ea.push(b)}h=zc.prototype;
  h.Ya=function(a,b){var c=this;switch(a){case Cc:b.onclick=function(){Dc(c)&&(c.h?Ec(c):c.start())};break;case Fc:b.onclick=function(){Bc(c,c.m<<1);Gc(c,Hc(c.u))};break;case Ic:b.onclick=function(){Jc(c)};break;case Kc:b.addEventListener("mousedown",function(){c.H=!0}),b.addEventListener("mouseup",function(){Ac(c);c.H=!1}),b.addEventListener("mousemove",function(){c.H&&Ac(c)}),b.addEventListener("change",function(){c.H=!0;Ac(c);c.H=!1})}H.prototype.Ya.call(this,a,b)};
  function Ib(a,b,c){var d=void 0===d?-1:d;var e=a.i.length+1;a.i.push({id:b,Ge:c,Db:d,Ka:-1});0<=d&&Nb(a,e,d);return e}
  function Lc(a,b,c,d){var e=0,f=a.u,g=1E6*f;b&&c&&(f=b/(10*c)/100,a.aa(u.wb,"calcSpeed(%d cycles, %5.3fms): %5.3fMhz\n",b,c,f),d>a.W&&(1<a.m&&(a.m>>=1,a.aa(u.xb,"warning: frame time (%5.3fms) exceeded maximum (%5.3fms), target multiplier now %d\n",d,a.W,a.m)),e=d));a.N=f;a.ma=f/a.za;b=a.ma/a.m;a.ba=g/b/60+1E-8;a.aa(u.wb,"nCyclesDepositPerFrame(%5.3f) = nCyclesPerSecond(%d) / nDivisor(%5.3f) / nFramesPerSecond(%d)\n",a.ba,g,b,60);return e}
  function Mc(a,b){a.Y=a.o=b;if(!a.J.length)return a.o=0,a.Y;for(var c=0;0<a.o;){if(c<a.J.length){var d=a.J[c++];b=d.kf.call(d,b)||1}else c=b=0;a.o-=b}return a.Y-a.o}function Nc(a,b){b=void 0===b?a.Y-a.o:b;if(!a.h){if(a.j)for(var c=0;c<a.J.length;c++){var d=a.J[c];d.lf.call(d)}a.j=b}a.j-=b;1>a.j&&(a.U=!0);a.Z+=b;a.Y=a.o=0;a.h||(a.Z=0);return b}
  function Oc(a,b){b=void 0===b?0:b;if(b){var c=b;a.j+=b}else for(c=a.j,1>c&&(c=a.j+=a.ba),0>c&&(a.aa(u.xb,"warning: cycle count dropped below zero: %f\n",c),c=a.j=0),c|=0,b=a.i.length;0<b;b--){var d=a.i[b-1];!(0>d.Ka)&&c>d.Ka&&(c=d.Ka)}return c}function Hc(a){1<=a?a=a.toFixed(2)+"Mhz":(a=Math.round(1E6*a),a=999>=a?a+"Hz":Math.ceil(a/1E3)+"Khz");return a}function Qc(a){a.aa(u.wb,"getSpeedCurrent(%5.3fhz)\n",1E6*a.N);return a.h&&a.N?Hc(a.N):"Stopped"}
  function Dc(a){return a.ta?!0:(A(a,"not powered"),!1)}function Rc(a,b){if(1<=b)for(var c=a.i.length;0<c;c--){var d=a.i[c-1];0>d.Ka||(d.Ka-=b,0>=d.Ka&&(d.Ka=-1,d.Ge(),0<=d.Db&&Nb(a,c,d.Db)))}}h.Ga=function(a){this.ta=a;void 0===this.I&&(this.I=J(this,"Debugger",!1))&&this.I.Xb(this,"time","dump time state",this.Ue)};function Jc(a,b){Dc(a)&&(a.h?A(a,"already running"):a.l?Ec(a):Sc(a,b))}
  h.jf=function(a){a=void 0===a?Date.now():a;this.L=0;if(this.h){var b=Date.now();if(this.R){var c=b-this.S-this.W;c>this.W&&(this.v+=c,this.aa(u.xb,"warning: browser throttling detected, compensating by %5.3fms\n",c))}this.S=b;this.v||(this.v=b);this.fa=0;try{this.U=!1;do Rc(this,Nc(this,Mc(this,Oc(this))));while(this.h&&!this.U)}catch(d){A(this,d.message),Ec(this)}this.R=Date.now();this.fa&&(this.v+=this.fa,this.S+=this.fa);this.S+=Lc(this,this.Z,this.R-this.v,this.R-this.S);this.R-this.Aa>=this.bb&&
  this.update();for(b=0;b<this.ea.length;b++)this.ea[b](a);this.L=this.Ia()}};function Bc(a,b){if(void 0!==b){if(1>b||!a.H&&0<a.N&&a.N<.9*a.u)b=a.la;a.m=b;b=a.za*a.m;a.u!=b&&(a.u=b,Gc(a,Hc(a.u)))}a.v=a.R=0;a.j=a.Z=0;Lc(a);for(b=a.i.length;0<b;b--){var c=a.i[b-1];0<=c.Db&&Nb(a,b,c.Db,!0)}}function Ac(a){var b=a.ra[Kc];return b?(Bc(a,Math.floor((b.value-b.min)/(b.max-b.min)*(a.Ba-a.na)+a.na)/a.ca|0),!0):!1}
  function Nb(a,b,c,d){0<b&&b<=a.i.length&&(b=a.i[b-1],d||0>b.Ka)&&(c=Math.ceil(a.ca*(a.cb?a.la:a.ma)/1E3*(void 0===c?1E3:c)),a.h&&(c+=Nc(a)),b.Ka=c)}h.start=function(){if(this.h||this.l)return!1;this.h=!0;this.v=this.R=0;this.update(!0);this.L=this.Ia();return!0};function Sc(a,b){b=void 0===b?1:b;a.h||(b&&!a.l&&(a.l=b),a.l&&(a.l--,Rc(a,Nc(a,Mc(a,Oc(a,1)))),a.update(!1),a.l&&setTimeout(function(){Sc(a,0)},0)))}
  function Ec(a){return a.h?(a.h=!1,Nc(a),a.L&&(a.Ta(a.L),a.L=0),a.update(!0),!0):a.l?(a.l=0,a.update(!0),!0):!1}h.update=function(a){a&&A(this,this.h?"started with "+Hc(this.u)+" target":"stopped");ib(this,Cc,this.h?"Halt":"Run");ib(this,Ic,this.l?"Stop":"Step");this.H||Gc(this,Qc(this));for(var b=0;b<this.T.length;b++){var c=this.T[b];c.bc.call(c,void 0!=a)}this.Aa=Date.now();this.U=!0};function Gc(a,b){ib(a,Tc,b);ib(a,Fc,b)}
  h.Ue=function(){var a=this.O("nCyclesPerSecond: %f\n",this.ca);a+=this.O("nUpdatesPerSecond: %f\n",this.Da);a+=this.O("nTargetMultiplier: %f\n",this.m);return a+=this.O("nCyclesDepositPerFrame: %f\n",this.ba)};var Cc="run",Fc="setSpeed",Tc="speed",Ic="step",Kc="throttle";w.Time=zc;
  function Uc(a,b,c){H.call(this,a,b,c);this.type="static"==this.M.type?Vc:Wc;this.ua=this.M.addrWidth||16;this.v=Math.pow(2,this.ua);this.m=this.v-1|0;this.blockSize=this.M.blockSize||(16<this.ua?4096:1024);this.blockSize>this.v&&(this.blockSize=this.v);this.N=this.v/this.blockSize|0;this.j=Math.log2(this.blockSize)|0;this.i=(1<<this.j)-1;this.l=this.M.dataWidth||8;this.J=Math.pow(2,this.l)-1;this.u=this.l<<1;this.L=Math.pow(2,this.u)-1;this.o=!1!==this.M.littleEndian;this.h=Array(this.N);this.H=0;
  a=new Xc(a,b+"[NONE]",{size:this.blockSize,bus:this.ja});for(b=0;b<this.v;b+=this.blockSize)Yc(this,b,this.blockSize,K.NONE,a);Zc(this,this.type)}t(Uc,H);
  function Yc(a,b,c,d,e){for(var f=b>>>a.j;0<c&&f<a.h.length;){var g=f*a.blockSize,l=a.blockSize-(b-g);l>c&&(l=c);var k=a.h[f];if(b!=g||l!=a.blockSize||k&&k.type!=K.NONE)return!1;k=a.ja+"["+wa(a,b,16,a.ua)+"]";b=e?e.size==a.blockSize?e:new Xc(a.ha,k,{type:d,qa:b,size:l,bus:a.ja}):new Xc(a.ha,k,{type:d,qa:b,size:l,bus:a.ja});a.h[f]=b;b=g+a.blockSize;c-=l;f++}return!0}function $c(a,b){for(var c=K.ke,d=0,e=0;e<a.h.length;e++){var f=a.h[e];f&&f.type&c&&(b(f),d++)}return d}h=Uc.prototype;
  h.Ga=function(){void 0===this.I&&(this.I=J(this,"Debugger",!1))};h.Ea=function(){};h.Fb=function(a){return a&&this.Ja(a)?!0:!1};h.fb=function(a){this.La(a)};h.Ja=function(a){for(var b=0;b<this.h.length;b++){var c=this.h[b];if((this.type==Wc||c.type&K.Xa)&&c.Ja){var d=a.shift();if(!c.Ja(d))return!1}}return!0};h.La=function(a){for(var b=0;b<this.h.length;b++){var c=this.h[b];if((this.type==Wc||c.type&K.Xa)&&c.La){var d=[];c.La(d);a.push(d)}}};h.cc=function(a){return this.h[a>>>this.j].cc(a&this.i)};
  h.Sd=function(a){return this.h[a>>>this.j].Ca(a&this.i)};h.jc=function(a,b){this.h[a>>>this.j].jc(a&this.i,b)};h.Na=function(a,b){this.h[a>>>this.j].ya(a&this.i,b)};h.Hc=function(a){return a&1?this.Ca(a+1&this.m)|this.Ca(a)<<this.l:this.h[a>>>this.j].sa(a&this.i)};h.Jc=function(a){return a&3?this.sa(a+2&this.m)|this.sa(a)<<this.u:this.h[a>>>this.j].Ha(a&this.i)};h.Ic=function(a){return a&1?this.Ca(a)|this.Ca(a+1&this.m)<<this.l:this.h[a>>>this.j].sa(a&this.i)};
  h.Kc=function(a){return a&3?this.sa(a)|this.sa(a+2&this.m)<<this.u:this.h[a>>>this.j].Ha(a&this.i)};h.Xe=function(a){return(a&this.i)==this.i?this.o?this.Ic(a):this.Hc(a):this.h[a>>>this.j].sa(a&this.i)};h.$e=function(a){return(a&this.i)+3>this.i?this.o?this.Kc(a):this.Jc(a):this.h[a>>>this.j].Ha(a&this.i)};h.Lc=function(a,b){a&1?(this.ya(a,b>>this.l),this.ya(a+1&this.m,b&this.J)):this.h[a>>>this.j].ka(a&this.i,b)};
  h.Nc=function(a,b){a&3?(this.ka(a,b>>this.u),this.ka(a+2&this.m,b&this.L)):this.h[a>>>this.j].xa(a&this.i,b)};h.Mc=function(a,b){a&1?(this.ya(a,b&this.J),this.ya(a+1&this.m,b>>this.l)):this.h[a>>>this.j].ka(a&this.i,b)};h.Oc=function(a,b){a&3?(this.ka(a,b&this.L),this.ya(a+2&this.m,b>>this.u)):this.h[a>>>this.j].xa(a&this.i,b)};h.mf=function(a,b){(a&this.i)==this.i?this.o?this.Mc(a,b):this.Lc(a,b):this.h[a>>>this.j].ka(a&this.i,b)};
  h.qf=function(a,b){(a&this.i)+3>this.i?this.o?this.Oc(a,b):this.Nc(a,b):this.h[a>>>this.j].xa(a&this.i,b)};function Zc(a,b){var c=a.H;a.H+=b;c&&a.H||(a.Ca=a.Sd,a.ya=a.Na,a.type==Wc?(a.sa=a.Xe,a.Ha=a.$e,a.ka=a.mf,a.xa=a.qf):a.o?(a.sa=a.Ic,a.Ha=a.Kc,a.ka=a.Mc,a.xa=a.Oc):(a.sa=a.Hc,a.Ha=a.Jc,a.ka=a.Lc,a.xa=a.Nc))}h.Gb=function(a,b){return this.h[a>>>this.j].Gb(b)?(Zc(this,1),!0):!1};h.fc=function(a,b){return this.h[a>>>this.j].fc(b)?(Zc(this,1),!0):!1};
  h.Hb=function(a,b){return this.h[a>>>this.j].Hb(b)?(Zc(this,-1),!0):!1};h.ic=function(a,b){return this.h[a>>>this.j].ic(b)?(Zc(this,-1),!0):!1};var Vc=0,Wc=1;w.Bus=Uc;
  function Xc(a,b,c){H.call(this,a,b,c);this.qa=this.M.addr;this.size=this.M.size;this.type=this.M.type||K.NONE;this.J=(a=this.M.bus)?rb(this,a):J(this,a="Bus");if(!this.J)throw Error(this.O("unable to find bus '%s'",a));this.j=this.J.l;this.N=Math.pow(2,this.j)-1;this.m=this.j<<1;this.Y=Math.pow(2,this.m)-1;this.U=this.ma=!1;this.h=!1!==this.J.o;this.values=this.ea=this.fa=this.L=this.T=null;a=this.ab;b=this.Na;c=this.h?this.Ze:this.Ye;var d=this.h?this.pf:this.nf,e=this.h?this.bf:this.af,f=this.h?
  this.sf:this.rf;this.J.type==Vc&&(b=this.kc,c=this.h?this.Pb:this.Ob,e=this.h?this.Ud:this.Td,d=this.nc,f=this.qc,8==this.j&&!1!==ub(this,"ArrayBuffer")&&(this.ma=!0,c=this.h==sa?this.ef:this.ff,e=this.h==sa?this.gf:this.hf));switch(this.type){case K.NONE:this.Ca=this.cf;this.ya=this.Jb;this.sa=this.rb;this.ka=this.tf;this.Ha=this.df;this.xa=this.uf;break;case K.Yc:this.Ca=a;this.ya=this.Jb;this.sa=c;this.ka=this.Jb;this.Ha=e;this.xa=this.Jb;break;case K.Xa:this.Ca=a,this.ya=b,this.sa=c,this.ka=d,
  this.Ha=e,this.xa=f}this.W=this.i=0;this.ca=this.H=this.ba=this.v=this.Z=this.S=this.o=this.u=null;ad(this,this.M.values);bd(this)}t(Xc,H);function ad(a,b){"string"==typeof b?(xb(a,!1),Ua(b,function(c,d,e,f){if(4==e)if(!f&&d){try{var g=JSON.parse(d);ad(a,g.values)}catch(l){a.aa("error (%s) parsing resource: %s\n",l.message,c)}xb(a,!0)}else a.aa("error (%d) loading resource: %s\n",f,c)})):a.M.values=b}
  function bd(a,b){if(a.type>K.NONE&&(a.ma?(a.L=new ArrayBuffer(a.size),a.T=new DataView(a.L,0,a.size),a.values=new Uint8Array(a.L,0,a.size),a.ea=new Uint16Array(a.L,0,a.size>>1),a.fa=new Int32Array(a.L,0,a.size>>2)):a.values=Array(a.size).fill(0),b))for(var c=0;c<b.length;c++)a.values[c]=b[c]}h=Xc.prototype;
  h.Ea=function(){if(this.M.values)a:{var a=this.J,b=this.qa,c=this.size,d=this.M.values,e=0,f=b&a.i;b>>>=a.j;c>d.length&&(c=d.length);for(;0<c&&b<a.h.length;){var g=a.h[b++];if(!g)break a;for(;0<c&&f<g.size;)g.Na(f++,d[e++]),c--;f=0}}else this.type&K.Xa&&this.values&&this.values.fill(0)};h.cf=function(){return this.N};h.rb=function(){return this.N|this.N<<this.j};h.df=function(a){return this.h?this.rb(a)|this.rb(a+2)<<this.m:this.rb(a+2)|this.rb(a)<<this.m};
  h.cc=function(a){return this.values?this.values[a]:0};h.ab=function(a){return this.values[a]};h.Ob=function(a){return this.values[a+1]|this.values[a]<<this.j};h.Td=function(a){return this.Ob(a+2)|this.Ob(a)<<this.m};h.Pb=function(a){return this.values[a]|this.values[a+1]<<this.j};h.Ud=function(a){return this.Pb(a)|this.Pb(a+2)<<this.m};h.ef=function(a){return this.ea[a>>>1]};h.gf=function(a){return this.fa[a>>>2]};h.ff=function(a){return this.T.getUint16(a,this.h)};
  h.hf=function(a){return this.T.getInt32(a,this.h)};h.Ye=function(a){return this.ab(a+1)|this.ab(a)<<this.j};h.af=function(a){return this.sa(a+2)|this.sa(a)<<this.m};h.Ze=function(a){return this.ab(a)|this.ab(a+1)<<this.j};h.bf=function(a){return this.sa(a)|this.sa(a+2)<<this.m};h.Jb=function(){};h.tf=function(){};h.uf=function(){};h.jc=function(a,b){this.values&&(this.values[a]=b)};h.Na=function(a,b){this.values[a]=b};h.kc=function(a,b){this.values[a]=b;this.U=!0;this.i?this.S=this.Na:this.ya=this.Na};
  h.kb=function(a,b){this.values[a]=b>>this.j;this.values[a+1]=b&this.N};h.Qb=function(a,b){this.kb(a,b>>this.m);this.kb(a+2,b&this.Y)};h.lb=function(a,b){this.values[a]=b&this.N;this.values[a+1]=b>>this.j};h.Rb=function(a,b){this.lb(a,b&this.Y);this.lb(a+2,b>>this.m)};h.lc=function(a,b){this.ea[a>>>1]=b};h.oc=function(a,b){this.fa[a>>>2]=b};h.mc=function(a,b){this.T.setUint16(a,b,this.h)};h.pc=function(a,b){this.T.setInt32(a,b,this.h)};h.nf=function(a,b){this.Na(a,b>>this.j);this.Na(a+1,b&this.N)};
  h.rf=function(a,b){this.ka(a,b>>this.m);this.ka(a+2,b&this.Y)};h.pf=function(a,b){this.Na(a,b&this.N);this.Na(a+1,b>>this.j)};h.sf=function(a,b){this.ka(a,b&this.Y);this.ka(a+2,b>>this.m)};h.nc=function(a,b){this.L?this.h==sa?(this.lc(a,b),this.i?this.v=this.lc:this.ka=this.lc):(this.mc(a,b),this.i?this.v=this.mc:this.ka=this.mc):this.h?(this.lb(a,b),this.i?this.v=this.lb:this.ka=this.lb):(this.kb(a,b),this.i?this.v=this.kb:this.ka=this.kb)};
  h.qc=function(a,b){this.L?this.h==sa?(this.oc(a,b),this.i?this.H=this.oc:this.xa=this.oc):(this.pc(a,b),this.i?this.H=this.pc:this.xa=this.pc):this.h?(this.Rb(a,b),this.i?this.H=this.Rb:this.xa=this.Rb):(this.Qb(a,b),this.i?this.H=this.Qb:this.xa=this.Qb)};
  h.Gb=function(a){if(!this.W){var b=this;this.W++;this.o=a;this.Z=this.Ca;this.ba=this.sa;this.ca=this.Ha;this.Ca=function(c){var d=b.Z(c);b.o(b.qa,c,d);return d};this.sa=function(c){var d=b.ba(c);b.o(b.qa,c,d);b.o(b.qa,c+1,d);return d};this.Ha=function(c){var d=b.ca(c);b.o(b.qa,c,d);b.o(b.qa,c+1,d);b.o(b.qa,c+2,d);b.o(b.qa,c+3,d);return d};return!0}return this.o==a?(this.W++,!0):!1};
  h.fc=function(a){if(!this.i){var b=this;this.i++;this.u=a;this.S=this.ya;this.v=this.ka;this.H=this.xa;this.ya=function(c,d){b.u(b.qa,c,d);b.S(c,d)};this.ka=function(c,d){b.u(b.qa,c,d);b.u(b.qa,c+1,d);b.v(c,d)};this.xa=function(c,d){b.u(b.qa,c,d);b.u(b.qa,c+1,d);b.u(b.qa,c+2,d);b.u(b.qa,c+3,d);b.H(c,d)};return!0}return this.u==a?(this.i++,!0):!1};h.Hb=function(a){return this.W&&this.o==a?(--this.W||(this.Ca=this.Z,this.sa=this.ba,this.Ha=this.ca,this.Z=this.ba=this.ca=this.o=null),!0):!1};
  h.ic=function(a){return this.i&&this.u==a?(--this.i||(this.ya=this.S,this.ka=this.v,this.xa=this.H,this.S=this.v=this.H=this.u=null),!0):!1};h.Ja=function(a){var b=a.shift();if(this.ja==b){this.U=a.shift();a.shift();if(a=a.shift()){var c=this.size;c=void 0===c?0:c;if(a.length!=c){b=0;c=c?Array(c):[];for(var d=0;d<a.length-1;)for(var e=a[d++],f=a[d++];e--;)c[b++]=f;a=c}bd(this,a)}return!0}return!1};
  h.La=function(a){a.push(this.ja);a.push(this.U);a.push(!1);if(this.values){var b=this.values;for(var c=0,d=0,e=[];c<b.length;){for(var f=b[c],g=c+1;g<b.length&&b[g]===f;)g++;e[d++]=g-c;e[d++]=f;c=g}b=e.length>=b.length?b:e}else b=this.values;a.push(b)};var K={NONE:1,Yc:2,Xa:4,ke:14,Lg:12};w.Memory=Xc;function cd(a,b,c){c.type=K.NONE;Xc.call(this,a,b,c);Yc(this.J,this.M.addr,this.M.size,K.Xa);yb(this,this.Ea.bind(this))}t(cd,Xc);w.RAM=cd;
  function dd(a,b,c){c.type=K.Yc;Xc.call(this,a,b,c);Yc(this.J,this.M.addr,this.M.size,this.M.type,this);yb(this,this.Ea.bind(this));this.g=this.I=void 0;if(w.LED&&this.ra[ed]){var d=this;this.R=Math.pow(2,Math.ceil(Math.log2(this.values.length)/2));this.la=this.values.length/this.R|0;this.l=new $b(a,b+"LEDs",{"class":"LED",bindings:{container:Qa(this,ed)},type:bc,cols:this.R,rows:this.la,color:D(this,"colorROM","green"),backgroundColor:D(this,"backgroundColorROM","black"),persistent:!0}),kc(this.l);
  this.na=new Bb(a,b+"Input",{"class":"Input",location:[0,0,this.l.ea,this.l.W,this.R,this.la],bindings:{surface:Qa(this,ed)}});this.ta=Ra(this)||"";Eb(this.na,function(e,f){if(d.g){var g=d.ta;0<=e&&0<=f&&(e=f*d.R+e,f=d.g,g=f.I&&fd(f.I,d.qa+e,1)||"");ib(d,Sa,g)}})}}t(dd,Xc);
  dd.prototype.Ja=function(a){var b=!0,c=a.shift();if(c&&this.l){var d=c.length;this.l.h.length==d?(this.l.h=c,jc(this.l,!0)):(this.aa("inconsistent saved LED state (%d), unable to load\n",d),b=!1)}a.length&&(d=(a=a.shift())&&a.length||-1,this.values.length==d?this.values=a:(this.aa("inconsistent saved ROM state (%d), unable to load\n",d),b=!1));return b};dd.prototype.Ga=function(){void 0===this.g&&(this.g=J(this,"CPU"));void 0===this.I&&(this.I=J(this,"Debugger",!1))&&this.I.Yb&&this.I.Yb(this.M.symbols)};
  dd.prototype.ab=function(a){if(this.l){var b=this.l,c=mc;c=(void 0===c?0:c)&129;var d=4*((a/this.R|0)*b.N+a%this.R);if(d<=b.h.length-4){if(1!==b.h[d]||(b.h[d+3]&129)!==c)b.h[d]=1,b.h[d+3]=b.h[d+3]&-130|c|mc,b.R=!0;b.Y=d;b.S=!0;b.L=0}}return this.values[a]};dd.prototype.La=function(a){this.l&&(a.push(this.l.h),a.push(this.values))};var ed="array",Sa="cellDesc";w.ROM=dd;
  function gd(a,b,c){c["class"]="CPU";H.call(this,a,b,c);this.I=void 0;this.u=this.Va=0;this.Ub=this.M.addrReset||0;this.time=J(this,"Time");this.time.J.push(this);this.time.T.push(this);this.ta=this.ea=0}t(gd,H);gd.prototype.abort=function(a){this.u=this.Va;A(this,a.message);Ec(this.time)};function hd(a,b){a.I=b;return a.jb}gd.prototype.od=function(){};gd.prototype.kf=function(a){this.ta=this.ea=a=void 0===a?0:a;try{this.od(a)}catch(b){this.abort(b)}return this.ta-this.ea};
  gd.prototype.lf=function(){this.ta-=this.ea;this.ea=0};
  function id(a,b,c){c["class"]="Debugger";H.call(this,a,b,c);var d=this;this.wa=this.M.defaultRadix||16;this.ma=1;this.Z=["(",")"];za(this,"a",function(f,g,l,k,m){return wa(d,m.ia,d.wa,l)});za(this,"n",function(f,g,l,k,m){return wa(d,m,d.wa,l,0>g.indexOf("#")?"":void 0)});this.N=0;this.na=u.NONE;this.S={};this.ta=[];this.Ia=[];this.g=J(this,"CPU");this.jb=hd(this.g,this);this.za=J(this,"Input",!1);if(a=this.g.M.busMemory||this.M.busMemory){this.j=rb(this,a);if(a=this.g.M.busIO||this.M.busIO)this.o=
  rb(this,a,!1);this.o||(this.o=this.j)}else this.j=this.o=J(this,"Bus");this.R=this.j.ua;this.Da=Math.pow(2,this.R)-1|0;this.J=this.fa=0;this.H=[];for(var e in L)this.H[L[e]]=[];this.v=[];this.v[L.Ma]=this.j;this.v[L.ob]=this.j;this.v[L.Pa]=this.o;this.v[L.mb]=this.o;this.u=[];this.u[L.Ma]=this.Je.bind(this);this.u[L.ob]=this.Ke.bind(this);this.u[L.Pa]=this.He.bind(this);this.u[L.mb]=this.Ie.bind(this);this.m=[];this.T=void 0;this.Y=null;this.ba=0;this.time=J(this,"Time");this.time.T.push(this);this.ca=
  0;this.L=[];this.W="";this.Xb(this,"state","dump machine state",this.Te);this.ea=jd();this.Aa=jd();this.la=!1;this.U=0;this.l=[];Ma(this,this.Ve.bind(this));(e=ub(this,"commands"))&&ab(this,e)}t(id,H);h=id.prototype;h.Xb=function(a,b,c,d){this.L.push({Se:a,name:b,Re:c,Ab:d})};function kd(a,b,c){for(var d,e=0;e<a.L.length;e++){var f=a.L[e];if(f.name==b){d=f.Ab.call(f.Se,c);break}}return d}
  h.Yb=function(a){if(a&&a.length)for(var b=0;b<a.length-2;b+=3){var c=ld(this,a[b]);if(c){var d=md[a[b+1]];if(d){c={eb:c,type:d,name:a[b+2]};d=this.ta;var e=c,f=nd(d,e,this.jd);0>f&&d.splice(-(f+1),0,e);d=this.Ia;e=nd(d,c,this.Le);0>e&&d.splice(-(e+1),0,c)}}}};function nd(a,b,c){var d=0,e=a.length,f=0;for(void 0===c&&(c=function(k,m){return k>m?1:k<m?-1:0});d<e;){var g=d+e>>1,l=void 0;l=c(b,a[g]);0<l?d=g+1:(e=g,f=!l)}return f?d:~d}h.jd=function(a,b){return a.name>b.name?1:a.name<b.name?-1:0};
  h.Le=function(a,b){return a.eb.ia>b.eb.ia?1:a.eb.ia<b.eb.ia?-1:0};function od(a,b,c,d){d=void 0===d?a.j:d;b.ia=b.ia+c&d.m}function jd(a){a=void 0===a?0:a;var b=pd.ge;return"number"==typeof a?{ia:a,dc:-1,type:b}:{ia:a.ia,dc:a.dc,type:a.type}}
  function ld(a,b,c){if(b){var d=jd();var e=0,f=b.charAt(e);switch(f){case "&":e++;break;case "#":e++;d.type=pd.ie;break;case "%":e++,f=b.charAt(e),"%"==f?e++:d.type=pd.ed}f=b.indexOf(":",e);if(0<=f){var g=qd(a,b.substring(e,f),c);void 0==g?d=null:(d.dc=g,e=f+1)}d&&(b=qd(a,b.substring(e),c),void 0==b?d=null:d.ia=b&a.Da)}return d}function rd(a,b,c,d){d=void 0===d?a.j:d;a.J++;var e=d.cc(b.ia);c&&od(a,b,c,d);a.J--;return e}
  function sd(a,b,c){if(32>=a.R)return b&c;b=M(a,b,0,!0);c=M(a,c,0,!0);return((b/x|0)&(c/x|0))*x+((b&c)>>>0)}function td(a,b,c){if(32>=a.R)return b^c;b=M(a,b,0,!0);c=M(a,c,0,!0);return((b/x|0)^(c/x|0))*x+((b^c)>>>0)}
  function ud(a,b,c,d){for(d=void 0===d?-1:d;d--&&c.length;){var e=c.pop();if(2>b.length)return!1;var f=b.pop();var g=b.pop();switch(e){case "*":g*=f;break;case "/":if(!f)return!1;g=Math.trunc(g/f);break;case "^/":if(!f)return!1;g%=f;break;case "+":g+=f;break;case "-":g-=f;break;case "<<":g<<=f;break;case ">>":g>>=f;break;case ">>>":g>>>=f;break;case "<":g=g<f?1:0;break;case "<=":g=g<=f?1:0;break;case ">":g=g>f?1:0;break;case ">=":g=g>=f?1:0;break;case "==":g=g==f?1:0;break;case "!=":g=g!=f?1:0;break;
  case "&":g=sd(a,g,f);break;case "!":case "|":e=g;32>=a.R?g=e|f:(e=M(a,e,0,!0),f=M(a,f,0,!0),g=(e/x|0|f/x|0)*x+((e|f)>>>0));break;case "^!":g=td(a,g,f);break;case "&&":g=g&&f?1:0;break;case "||":g=g||f?1:0;break;case ",,":g=M(a,g,18,!0)*Math.pow(2,18)+M(a,f,18,!0);break;case "_":case "^_":"^_"==e&&(f=35-(f&255));f&&(g=M(a,g,0,!0),g=0<f?g*Math.pow(2,f):Math.trunc(g/Math.pow(2,-f)));break;default:return!1}b.push(M(a,g))}return!0}
  function vd(a,b,c,d,e,f){var g,l=!1,k=0,m=[],p=[],n=a.wa;for(a.wa=e;c<d;){var r=b[c++].trim();var B=c<d?b[c++]:"";if(r){var y=void 0;var z=a;var C=r,v=f;k=void 0===k?0:k;if(void 0!=C){y=vb(z,C.toUpperCase());if(void 0==y){y=void 0;var W=z,S=nd(W.ta,{eb:null,type:0,name:C},W.jd);0<=S&&(y=W.ta[S].eb.ia);if(void 0==y)if(y=C,z.S[y]?y=z.S[y].value:(y=y.substr(0,6),y=z.S[y]&&z.S[y].value),void 0==y)y=va(C,1<C.length||10<z.wa?z.wa:10);else if(C=z.S[C]&&z.S[C].Xg)v?v.push(C):(v=qd(z,C,v),void 0!==v?y+=v:
  y=void 0)}void 0!=y&&(y=M(z,wd(z,y,k)))}z=y}else if("{"==B){r=1;for(z=c;c<d;)if(c++,B=c<b.length?b[c++]:"","{"==B)r++;else if("}"==B&&!--r)break;z=vd(a,b,z,c-1,a.wa,f);null!=z&&k&&(z=wd(a,z,k));r=c<d?b[c++].trim():"";B=c<d?b[c++]:""}else{if(" "==B)continue;if("^B"==B){a.wa=2;continue}if("^O"==B){a.wa=8;continue}if("^D"==B){a.wa=10;continue}if(!(k&-1073741824)){if("+"==B)continue;if("-"==B){k=k<<2|1;continue}if("~"==B||"^-"==B){k=k<<2|2;continue}if("^L"==B){k=k<<2|3;continue}}l=!0;break}if(void 0===
  z)if(f)f.push(r),z=0;else{l=!0;break}m.push(M(a,z));if(" "==B)if(c<b.length-1&&!b[c])c++,B=b[c++];else{l=!0;break}if(!B)break;z="<"==a.Z[0]?xd:yd;if(!z[B]){l=!0;break}p.length&&z[B]<=z[p[p.length-1]]&&ud(a,m,p,1);p.push(B);a.wa="^_"==B?10:e;k=0}if(l||!ud(a,m,p)||1!=m.length)l=!0;l?f||a.aa("parse error (%s)\n",r||B):g=m.pop();a.wa=n;return g}
  function zd(a,b,c,d){for(var e,f=a.R/d|0;0<=(e=b.indexOf(c));){for(var g=0,l=e+1,k=f;l<b.length;){var m=b[l++];if(m==c){k=-1;break}if(!k)break;k--;m=m.charCodeAt(0);6==d&&(m-=32);m&=(1<<d)-1;g=M(a,g*Math.pow(2,d)+m,d*f,!0)}if(0<=k){a.aa("parse error (%c%s%c)\n",c,b,c);return}b=b.substr(0,e)+wa(a,g)+b.substr(l)}return b}
  function qd(a,b,c){if(b){"{"!=a.Z[0]&&(b=b.split(a.Z[0]).join("{").split(a.Z[1]).join("}"));b=zd(a,b,'"',8);if(!b)return d;b=zd(a,b,"'",6);if(!b)return d;16!=a.wa&&(b=b.replace(/(^|[^A-Z0-9$%.])([0-9]+)B/,"$1$2^_").replace(/\s+/g," "));b=b.split(/({|}|\|\||&&|\||\^!|\^B|\^O|\^D|\^L|\^-|~|\^_|_|&|!=|!|==|>=|>>>|>>|>|<=|<<|<|-|\+|\^\/|\/|\*|,,| )/);var d=vd(a,b,0,b.length,a.wa,c)}return d}
  function wd(a,b,c){for(;c;){var d;switch(c&3){case 1:b=-M(a,b);break;case 2:b=td(a,b,-1);break;case 3:for(d=35;0<=d&&!sd(a,b,Math.pow(2,d));)d--;b=35-d}c>>>=2}return b}function M(a,b,c,d){var e=b;c=c||a.R;if(d)if(32==c)e=b>>>0;else if(32>c)e=b&(1<<c)-1;else{if(a=Math.pow(2,c),0>b||b>=a)e=b%a,0>e&&(e+=a)}else 32>=c?e=b<<32-c>>32-c:(a=Math.pow(2,c-1),b>=a?(e=b%a,(b/a|0)&1&&(e-=a)):b<-a&&(e=b%a,((-b-1)/a|0)&1?e&&(e+=a):e||(e-=a)));b!=e&&(b=e);return b}
  h.Zb=function(a){function b(l){for(var k=0;k<l.length;k++)if(void 0!=l[k])return!1;return!0}if(-1>a)return Ad(this,this.Zb);var c="";if(0<=a){var d=this.m[a];if(void 0!=d){c=d>>8;d&=255;var e=this.v[c];if(e){var f=this.H[c],g=f[d];(c&1?e.ic(g.ia,this.u[c]):e.Hb(g.ia,this.u[c]))?(f[d]=void 0,this.m[a]=void 0,b(f)&&(f.length=0,b(this.m)&&(this.m.length=0)),c=this.O("%2d: %s %*a cleared\n",a,Bd[c],e.ua,g),--this.fa||this.la||(c+=Cd(this,!1))):c=this.O("invalid break address: %*a\n",e.ua,g)}else c="invalid bus"}else c=
  this.O("invalid break index: %d\n",a)}else c="missing break index\n";return c};function Dd(a,b){if(a.Y&&(void 0==b||a.Y.ia==b)){var c=void 0===c?L.Ma:c;b=-1;var d=Ed(a.Y,a.H[c]);if(0<=d)for(var e=0;e<a.m.length;e++){var f=a.m[e];if(void 0!=f&&c==f>>8&&d==(f&255)){b=e;break}}c=b;0<=c&&a.Zb(c);a.Y=null}}
  h.ac=function(a,b){b=void 0===b?!1:b;if(-1>a)return Ad(this,this.ac,b);if(0<=a){var c=this.m[a];if(void 0!=c){var d=c>>8;c=this.H[d][c&255];if(void 0!=c){var e=b?"enabled":"disabled",f=this.v[d];!c.disabled==!b?(c.disabled=!b,a=this.O("%2d: %s %*a %s\n",a,Bd[d],f.ua,c,e)):a=this.O("%2d: %s %*a already %s\n",a,Bd[d],f.ua,c,e)}else a=this.O("no break address at index: %d\n",a)}else a=this.O("invalid break index: %d\n",a)}else a="missing break index\n";return a};
  function Ad(a,b,c){for(var d="",e=0;e<a.m.length;e++)void 0!=a.m[e]&&(d+=b.call(a,e,c));d||(d="no break addresses found");return d}function Fd(a,b,c){c=void 0===c?L.Ma:c;a=a.H[c];for(c=0;c<a.length;c++){var d=a[c];if(d.ia==b)return d}}function Ed(a,b){for(var c=0;c<b.length;c++)if(b[c].ia==a.ia)return c;return-1}
  function Gd(a,b){b=void 0===b?!1:b;for(var c="",d=0;d<a.m.length;d++){var e=a.m[d];if(void 0!=e){var f=e>>8;e=a.H[f][e&255];f=a.O("%s %*a",Bd[f],a.v[f].ua,e);b?(c&&(c+=";"),c+=f,e.disabled&&(c+=";bd "+d)):c+=a.O("%2d: %s %s\n",d,f,e.disabled?"disabled":"enabled")}}c||b||(c="no break addresses found\n");return c}
  function Hd(a,b,c){c=void 0===c?L.Ma:c;if(b){var d=a.v[c];if(d){var e=a.H[c];var f=Ed(b,e);if(0<=f)f=-(f+1);else{for(f=0;f<e.length&&void 0!=e[f];f++);e[f]=b}e=f;if(0<=e)if(f=c&1?d.fc(b.ia,a.u[c]):d.Gb(b.ia,a.u[c])){for(f=0;f<a.m.length&&void 0!=a.m[f];f++);a.m[f]=c<<8|e;b=a.O("%2d: %s %*a set\n",f,Bd[c],d.ua,b);a.fa++||a.l.length||(b+=Cd(a,!0))}else b=a.O("invalid break address: %*a\n",d.ua,b),a.H[c][e]=void 0;else b=a.O("%s %*a already set\n",Bd[c],d.ua,b)}else b="invalid bus"}else b="missing break address\n";
  return b}function Id(a,b){0<=b&&(a.N=b);var c="instruction break count: "+(0<a.N?a.N:"disabled")+"\n";0<b&&(a.l.length||(c+=Cd(a,!0)),a.la=!0);return c}function Jd(a,b){var c;if(b){var d=cb(b);void 0!=d?a.na=d?u.sc:u.NONE:c=a.O("unrecognized message option: %s\n",b)}c||(c=a.O("break on message: %b\n",!!a.na));return c}h.He=function(a,b){this.J||(void 0==a?Kd(this,"break on unknown input %#0x: %#0x",b):(a=Fd(this,a+b,L.Pa))&&!a.disabled&&Kd(this,"break on input %*a: %#0x",this.o.ua))};
  h.Ie=function(a,b){this.J||(void 0==a?Kd(this,"break on unknown output %#0x: %#0x",b):(a=Fd(this,a+b,L.mb))&&!a.disabled&&Kd(this,"break on output %*a: %#0x",this.o.ua))};
  h.Je=function(a,b){this.J||(void 0==a?Kd(this,"break on unknown read %#0x: %#0x",b):(a+=b,this.l.length&&a==this.g.Va&&(this.ba++,0<this.N&&(--this.N||Kd(this,"break on instruction count")),this.l[this.U++]=a,this.U==this.l.length&&(this.U=0)),(b=Fd(this,a,L.Ma))&&!b.disabled&&(Kd(this,"break on read %*a: %#0x",this.j.ua),Dd(this,a))))};h.Ke=function(a,b){this.J||(void 0==a?Kd(this,"break on unknown write %#0x: %#0x",b):(a=Fd(this,a+b,L.ob))&&!a.disabled&&Kd(this,"break on write %*a: %#0x",this.j.ua))};
  function Kd(a,b,c){b=a.O.apply(a,[b].concat(ba(c)));A(a,b);Ec(a.time)}function Ld(a,b,c){c=void 0===c?a.j:c;return wa(a,b.ia,a.wa,c.ua,"")}function Md(a,b,c){c=void 0===c?10:c;var d="";if(a.l.length){var e,f=[];c>a.l.length&&(c=a.l.length);0>b&&(b=c);var g=a.U-b;for(0>g&&(g+=a.l.length);0<=g&&g<a.l.length&&0<c;){var l=a.l[g++];if(void 0==l)break;g==a.l.length&&(g=0);e?e.ia=l:e=jd(l);for(l=0;l<a.ma;l++)f[l]=rd(a,e,1);od(a,e,-f.length);d+=a.hc(e,f,a.O("[%6d]",b--));c--}}return d||"no history"}
  function fd(a,b,c){var d=[],e="";for(b="number"==typeof b?jd(b):b;c--;){for(od(a,b,d.length);d.length<a.ma;)d.push(rd(a,b,1));od(a,b,-d.length);e+=a.hc(b,d)}return e}
  function Nd(a,b,c,d,e,f){var g="";f=f?a.o:a.j;c||(c=f.l);var l=c>>3;d||(d=128);var k=0,m=d+15>>4||1,p=4==l?16:a.wa;"y"==e&&(p=l,m=d,k=8*l);b||(b=a.Aa);for(;m--&&0<d;){var n=e=0,r,B="",y="",z=Ld(a,b,f);for(r=p;0<r&&0<d;r--){var C=rd(a,b,1,f);e|=C<<(n++<<3);n==l&&(B+=wa(a,e,0,c,""),B+=1==l?9==r?"-":" ":" ",k&&(y+=wa(a,e,2,c,"")),e=n=0);k||(y+=32<=C&&127>C?String.fromCharCode(C):".");d--}g&&(g+="\n");g+=z+"  "+B+" "+y}a.Aa=b;return g}
  h.Te=function(){var a=[];tb(this,function(b){b.fb&&b.fb(a);return!0});return JSON.stringify(a,null,2)};function Od(a,b,c,d){var e=0,f="";d=d?a.o:a.j;for(var g=0;void 0!=b&&g<c.length;g++){var l=rd(a,b,0,d);if(void 0==l)break;var k=a,m=b,p=c[g],n=d;n=void 0===n?k.j:n;k.J++;n.jc(m.ia,p);k.J--;f+=a.O("%*a: %#*n changed to %#*n\n",a.j.ua,b,a.j.l,l,a.j.l,c[g]);od(a,b,1,d);e++}e||(f+=a.O("%d locations updated\n",e));a.time.update();return f}
  function Cd(a,b){var c="";void 0!=b&&b==!a.l.length&&$c(a.j,function(d){b?a.j.Gb(d.qa,a.u[L.Ma]):a.j.Hb(d.qa,a.u[L.Ma])})&&(b?(a.U=0,a.l=Array(Pd)):a.l=[]);return c+=a.O("instruction history %s\n",a.l.length?"enabled":"disabled")}h.Ja=function(a){var b=a.shift();return this.ja==b?(ab(this,a.shift()),this.da.Fa=a.shift(),!0):!1};h.pd=function(a){xa(this.na,a)?Kd(this,"break on message"):this.time.U=!0};
  h.Ve=function(a){var b=a[1],c=a[2],d=[],e=[],f=!1,g="";this.T=void 0;if("*"==c)var l=-2;else{l=va(c);void 0==l&&(l=-1);var k=ld(this,c,e);if(null===k)return}var m=0;a[3]&&(m=va(a[3].substr("l"==a[3][0]?1:0))||8);for(var p=3;p<a.length;p++)d.push(va(a[p],16));if("d"==b){p=kd(this,c,d);if(void 0!=p)return p;b=this.W||b}if("s"!=b[0]&&e.length)return"unrecognized symbol(s): "+e;switch(b[0]){case "b":"c"==b[1]?g=this.Zb(l):"d"==b[1]?g=this.ac(l):"e"==b[1]?g=this.ac(l,!0):"i"==b[1]?g=Hd(this,k,L.Pa):"l"==
  b[1]?g=Gd(this):"m"==b[1]?g=Jd(this,c):"n"==b[1]?g=Id(this,l):"o"==b[1]?g=Hd(this,k,L.mb):"r"==b[1]?g=Hd(this,k,L.Ma):"w"==b[1]?g=Hd(this,k,L.ob):"?"==b[1]?(g="break commands:\n",Qd.forEach(function(n){g+=n+"\n"})):b[1]&&(g=void 0);break;case "d":this.W=b;if("b"!=b[1]&&b[1])if("w"==b[1])c=16;else if("d"==b[1])c=32;else if("i"==b[1]){if(!this.o){g="invalid bus";break}c=this.o.l;m=m||1;f=!0}else{if("h"==b[1])this.W="",g=Md(this,l,m);else if("?"==b[1]){if(this.W="",g="dump commands:\n",Rd.forEach(function(n){g+=
  n+"\n"}),this.L.length)for(g+="dump extensions:\n",b=0;b<this.L.length;b++)k=this.L[b],g+=this.O("d   %-12s%s\n",k.name,k.Re)}else this.W="",g=void 0;break}else c=8;g=Nd(this,k,c,m,b[2],f);break;case "e":if("o"==b[1]){if(!this.o){g="invalid bus";break}f=!0}else if(b[1]){g=void 0;break}g=Od(this,k,d,f);break;case "g":if(this.time.start()){if(void 0!=k){Dd(this);g=Hd(this,k);if(2!=g.indexOf(":"))break;this.Y=k;g=""}break}g="already started\n";break;case "h":Ec(this.time)||(g="already stopped\n");break;
  case "p":a.shift();a.shift();b=a.join(" ");g+=this.O("%s = %s\n",b,wa(this,qd(this,b)));break;case "r":if(b=b.substr(1).toUpperCase()){if(void 0==vb(this.g,b)){g+=this.O("unrecognized register: %s\n",b);break}void 0!=k&&Ab(this.g,b,k.ia)}this.ea.ia=this.g.u;g+=this.g.toString();break;case "s":k=cb(c);if("h"==b[1]){if(this.fa||0<this.N)k=void 0;g=Cd(this,k);void 0!=k&&(this.la=k)}else"p"==b[1]?0<l?(Bc(this.time,l),g="target speed:  "+Hc(this.time.u)):g="current speed: "+Qc(this.time):"s"==b[1]&&this.Ba?
  (l=this.Ba.indexOf(c),0<=l&&(this.style=this.Ba[l]),g="style: "+this.style):"?"==b[1]?(g="set commands:\n",Sd.forEach(function(n){g+=n+"\n"})):g=void 0;break;case "t":m=va(c,10)||1;this.T=!0;if(b[1]){if("r"!=b[1]){g=void 0;break}this.T=!1}Jc(this.time,m);break;case "u":if(b[1]){g=void 0;break}m||(m=8);k||(k=this.ea);g+=fd(this,k,m);this.ea=k;break;case "?":g="debugger commands:\n";Td.forEach(function(n){g+=n+"\n"});break;default:g=void 0}void 0==g&&a[0]&&(g="unrecognized command '"+a[0]+"' (try '?')\n");
  return g};h.Fb=function(a){return a&&this.Ja(a[0])?(a.shift(),!0):!1};h.fb=function(a){var b=[];this.La(b);a.push(b);this.ca=0};h.bc=function(a){a&&(this.time.h?this.ca&&this.za&&Yb(this.za):this.T?this.Sa(fd(this,this.g.u,1)):(this.ba&&(A(this.g,this.ba+" instructions executed"),this.ba=0),this.g.Sa(this.g.toString()),void 0==this.T&&this.ca&&(a=this.Ua(Ja.vb,!0))&&a.focus()),this.ca++)};h.La=function(a){a.push(this.ja);a.push(Gd(this,!0));a.push(this.da.Fa)};
  h.hc=function(a,b,c){var d=this.O,e=Ld(this,a);b=b.shift();od(this,a,1);return d.call(this,"%s %02x       unsupported       ; %s\n",e,b,c||"")};
  var Td="b?\t\tbreak commands;d?\t\tdump commands;e[o] [addr] ...\tedit memory/ports;g    [addr]\trun (to addr);h\t\thalt;p    [expr]\tparse expression;r?   [value]\tdisplay/set registers;s?\t\tset commands;t[r] [n]\tstep (n instructions);u    [addr] [n]\tunassemble (at addr)".split(";"),Qd="bc [n|*]\tclear break address;bd [n|*]\tdisable break address;be [n|*]\tenable break address;bl [n]\t\tlist break addresses;bi [addr]\tbreak on input;bo [addr]\tbreak on output;br [addr]\tbreak on read;bw [addr]\tbreak on write;bm [on|off]\tbreak on message;bn [count]\tbreak on instruction count".split(";"),Rd=
  "db  [addr]\tdump bytes (8 bits);dw  [addr]\tdump words (16 bits);dd  [addr]\tdump dwords (32 bits);di  [addr]\tdump input ports;d*y [addr]\tdump values in binary;dh  [n] [l]\tdump instruction history buffer;ds\t\tdump machine state".split(";"),Sd=["sh [on|off]\tset instruction history","sp [n]\t\tset speed multiplier","ss\t\tset debugger style"],pd={ed:1,ge:0,ie:2,Jg:0},L={Ma:0,ob:1,Pa:2,mb:3},Ud={},Bd=(Ud[L.Ma]="br",Ud[L.ob]="bw",Ud[L.Pa]="bi",Ud[L.mb]="bo",Ud),Vd={fe:"PC"},Wd={BYTE:1,ee:2,je:4,
  Wd:5,xd:6,Ae:7},md={"=":Wd.Ae,1:Wd.BYTE,2:Wd.ee,4:Wd.je,"@":Wd.Wd,";":Wd.xd},Pd=1E5,yd={"||":5,"&&":6,"!":7,"|":7,"^!":8,"&":9,"!=":10,"==":10,">=":11,">":11,"<=":11,"<":11,">>>":12,">>":12,"<<":12,"-":13,"+":13,"^/":14,"/":14,"*":14,_:19,"^_":19,"{":20,"}":20},xd={",,":1,"||":5,"&&":6,"!=":10,"==":10,">=":11,">":11,"<=":11,"<":11,">>>":12,">>":12,"<<":12,"-":13,"+":13,"^/":14,"/":14,"*":14,"!":15,"|":15,"^!":15,"&":15,_:19,"^_":19,"{":20,"}":20};
  function Xd(a,b,c){gd.call(this,a,b,c);Yd(this);this.la=rb(this,this.M.busMemory);this.bb=J(this,"Input",!1)}t(Xd,gd);h=Xd.prototype;
  h.od=function(a){var b=this.i;for(this.ea=a;0<this.ea;){this.Va=this.u;var c=N(this);var d=0;a=c&7;var e=c>>9&7;a:switch(c>>12&15){case 0:d=O;switch(c>>8&15){case 0:var f=b[(c>>6&3)+Zd];this.j=f.K(0);if(60!=(c&63)){var g=b[this.L[c&255]];this.h=g.K(a);P(g,this.h|this.j);Q(this,8+g.pa-g.va)}else 0==(c&192)?($d(this,ae(this)|this.j),Q(this,20)):64==(c&192)&&(0!=(this.flags&be)&&ce(this,ae(this)|this.j),Q(this,20));break a;case 2:f=b[(c>>6&3)+Zd];this.j=f.K(0);60!=(c&63)?(g=b[this.L[c&255]],this.h=g.K(a),
  P(g,this.h&this.j),Q(this,8+g.pa-g.va-g.$b)):0==(c&192)?($d(this,ae(this)&this.j),Q(this,20)):64==(c&192)&&(0!=(this.flags&be)&&ce(this,ae(this)&this.j),Q(this,20));break a;case 4:f=b[(c>>6&3)+Zd];this.j=f.K(0);g=b[this.L[c&255]];this.h=g.K(a);de(g,this.h-this.j);Q(this,8+g.pa-g.va);break a;case 6:f=b[(c>>6&3)+Zd];this.j=f.K(0);g=b[this.L[c&255]];this.h=g.K(a);ee(g,this.h+this.j);Q(this,8+g.pa-g.va);break a;case 8:d=fe;e=0;break;case 10:f=b[(c>>6&3)+Zd];this.j=f.K(0);60!=(c&63)?(g=b[this.L[c&255]],
  this.h=g.K(a),P(g,this.h^this.j),Q(this,8+g.pa-g.va)):0==(c&192)?($d(this,ae(this)^this.j),Q(this,20)):64==(c&192)&&(0!=(this.flags&be)&&ce(this,ae(this)^this.j),Q(this,20));break a;case 12:f=b[(c>>6&3)+Zd];this.j=f.K(0);g=b[this.L[c&255]];this.h=g.K(a);ge(g,this.h-this.j);Q(this,4+g.$b);break a;case 14:break a;case 1:e=0;break;case 3:e=1;break;case 5:e=2;break;case 7:e=3;break;case 9:e=4;break;case 11:e=5;break;case 13:e=6;break;case 15:e=7}if(8==(c&56))Q(this,16+2*this.ba.pa);else switch(f=b[d],
  this.j=f.K(e),0==(c&56)?(this.j=1<<(this.j&31),g=this.ba):(this.j=1<<(this.j&7),g=0==(c&192)?b[this.Ba[c&63]]:b[this.L[c&63]]),this.h=g.K(a),c>>6&3){case 0:g.V(this.h&this.j);Q(this,4+(d==O?0:4)+g.Qa);break;case 1:g.setData(this.h^this.j);g.V(this.h&this.j);Q(this,8+(d==O?0:4));break;case 2:g.setData(this.h&~this.j);g.V(this.h&this.j);Q(this,8+(d==O?0:4)+g.Qa);break;case 3:g.setData(this.h|this.j),g.V(this.h&this.j),Q(this,8+(d==O?0:4))}break a;case 2:d+=64;case 3:d+=64;case 1:f=b[this.R[d+(c&63)]];
  this.j=f.K(a);64!=(c&448)?(g=b[this.Ta[d+(c>>6&63)]],g.gb(e,this.j)):this.l[e]=this.j;Q(this,4);break a;case 4:switch(c>>8&15){case 0:192!=(c&192)?(this.h=0,g=b[this.L[c&255]],this.j=g.K(a)-he(this),this.na=this.m,de(g,-this.j),0==this.m&&(this.m=this.na),Q(this,8+g.pa-g.va-g.Za)):(g=b[this.L[(c&63)+64]],g.ec(a,ae(this)),Q(this,8-g.oa));break a;case 2:192!=(c&192)?(g=b[this.L[c&255]],g.gb(a,0),Q(this,8+g.pa-g.va-g.Za)):(g=b[this.L[(c&63)+64]],g.ec(a,ae(this)&ie),Q(this,8-g.oa));break a;case 4:192!=
  (c&192)?(this.h=0,g=b[this.L[c&255]],this.j=g.K(a),de(g,-this.j),Q(this,8+g.pa-g.va-g.Za)):(f=b[this.N[(c&63)+64]],$d(this,f.K(a)),Q(this,12));break a;case 6:192!=(c&192)?(g=b[this.L[c&255]],this.h=g.K(a),P(g,~this.h),Q(this,8+g.pa-g.va-g.Za)):(f=b[this.N[(c&63)+64]],ce(this,f.K(a)),Q(this,12));break a;case 8:switch(c>>6&3){case 0:Q(this,8-g.oa);break a;case 1:0==(c&56)?(g=this.ba,this.h=g.K(a),P(g,this.h>>>16|(this.h&65535)<<16)):(f=b[this.ca[(c&63)+128]],this.j=f.X(a),je(this,this.j));Q(this,4);
  break a;case 2:if(0==(c&56)){g=b[ke];this.h=g.K(a);P(g,this.h<<24>>24);Q(this,4);break a}case 3:if(0==(c&56)){g=this.ba;this.h=g.K(a);P(g,this.h<<16>>16);Q(this,4);break a}}d=N(this);g=b[this.Ia[c-64&255]];e=0;var l=this.l[a];g.X(a);var k=1;if(32==(c&56)){for(c=7;0<=c;c--,k<<=1)0!=(d&k)&&(0!=e++&&(l=this.l[a],g.ga(a)),c!=a&&(l=this.l[c]),g.setData(l));for(c=7;0<=c;c--,k<<=1)0!=(d&k)&&(0!=e++&&g.ga(a),g.setData(this.o[c]));0==e&&(this.l[a]=l)}else{for(c=0;7>=c;c++,k<<=1)0!=(d&k)&&(0!=e++&&g.ga(a),
  g.setData(this.o[c]));for(c=0;7>=c;c++,k<<=1)0!=(d&k)&&(0!=e++&&g.ga(a),g.setData(this.l[c]))}Q(this,(4+g.pa)*e);break a;case 10:192!=(c&192)?(g=b[this.R[c&255]],le(g,g.K(a)),Q(this,4)):60!=(c&63)&&(g=b[this.L[c&63]],this.h=g.K(a),le(g,this.j),g.setData(this.j|128),Q(this,14-5*g.oa));break a;case 12:var m=N(this);d=c&56;f=b[this.Da[c-64&255]];e=0;l=this.l[a];f.X(a);k=1;for(c=0;7>=c;c++,k<<=1)0!=(m&k)&&(0!=e++&&f.ga(a),this.o[c]=f.getData());for(c=0;7>=c;c++,k<<=1)if(0!=(m&k)){0!=e++&&f.ga(a);var p=
  f.getData();if(24!=d||c!=a)this.l[c]=p}0==e&&(this.l[a]=l);Q(this,4+(4+g.pa)*e);break a;case 14:switch(c>>4&15){case 4:if(a=this.I)a=!1;if(a){this.u=this.Va;this.S|=me;return}a=(c&15)+32;c=R(this,ne+4*a);0==(this.flags&be)&&(this.za=this.l[7],this.l[7]=this.cb);je(this,this.u);this.l[7]-=2;oe(this,this.l[7],ae(this));this.flags|=be;this.flags&=~pe;this.u=c;if(a==qe||a==re)oe(this,this.l[7]-=2,0),je(this,this.Tb),oe(this,this.l[7]-=2,0);Q(this,34);break a;case 5:0==(c&8)?(je(this,this.l[a]),this.l[a]=
  this.l[7],this.l[7]+=N(this),Q(this,16)):(this.l[7]=this.l[a],this.l[a]=se(this),Q(this,12));break a;case 6:if(0==(this.flags&be))break a;0==(c&8)?this.za=this.l[a]:this.l[a]=this.za;Q(this,4);break a;case 7:switch(c&15){case 0:Q(this,132);break a;case 1:Q(this,4);break a;case 2:if(0==(this.flags&be))break a;p=N(this)&65535;p<(te&65535)?ce(this,p):(this.l[7]=this.u,this.u=se(this),p==(te&65535)?this.S|=ue:p==(ve&65535)&&(this.S|=we));this.S|=xe;Q(this,4);break a;case 3:0!=(this.flags&be)&&(ce(this,
  T(this,this.l[7])),this.l[7]+=2,this.u=se(this),0==(this.flags&be)&&(this.cb=this.l[7],this.l[7]=this.za));Q(this,20);break a;case 5:this.u=se(this);Q(this,16);break a;case 6:if(0!=ye(this)){Q(this,34);break a}Q(this,4);break a;case 7:$d(this,b[ze].K(7));this.u=se(this);Q(this,20);break a}case 8:case 9:case 10:case 11:f=b[this.ca[(c&63)+128]];this.j=f.X(a);je(this,this.u);this.u=this.j;Q(this,6);break a;case 12:case 13:case 14:case 15:f=b[this.ca[(c&63)+128]];this.u=f.X(a);break a}break a;case 1:e=
  0;break;case 3:e=1;break;case 5:e=2;break;case 7:e=3;break;case 9:if(192==(c&248)){g=this.ba;this.h=g.K(a);P(g,this.h<<24>>24);Q(this,4);break a}e=4;break;case 11:e=5;break;case 13:e=6;break;case 15:e=7}128==(c&192)?(f=b[this.N[(c&63)+64]],this.j=f.K(a),this.h=this.o[e]<<16>>16,0>this.h?(this.U=-1,Q(this,40)):this.h>this.j?(this.U=0,Q(this,40)):Q(this,10)):(f=b[this.ca[(c&63)+128]],this.l[e]=f.X(a));break a;case 5:if(192!=(c&192))this.j=Ae[e],m=c&248,72==m||136==m?(this.l[a]=0==(c&256)?this.l[a]+
  this.j:this.l[a]-this.j,Q(this,8)):(g=b[this.Aa[c&255]],this.h=g.K(a),0==(c&256)?(ee(g,this.h+this.j),Q(this,8+g.pa-g.va)):(de(g,this.h-this.j),Q(this,8+g.pa-g.va+g.nd)));else if(8!=(c&56)){g=b[this.L[c&63]];g.X(a);p=0;switch(c>>8&15){case 0:p=-1;break;case 1:p=0;break;case 2:p=Be(this);break;case 3:p=~Be(this);break;case 4:p=~Ce(this);break;case 5:p=Ce(this);break;case 6:p=~De(this);break;case 7:p=De(this);break;case 8:p=~ye(this);break;case 9:p=ye(this);break;case 10:p=~Ee(this);break;case 11:p=
  Ee(this);break;case 12:p=Fe(this);break;case 13:p=Ge(this);break;case 14:p=He(this);break;case 15:p=Ie(this)}g.setData(p);Q(this,8-g.oa-(0==p?g.oa:0))}else{d=-1;switch(c>>8&15){case 1:d=0;break;case 2:d=Be(this);break;case 3:d=Be(this)+1;break;case 4:d=Ce(this)+1;break;case 5:d=Ce(this);break;case 6:d=De(this)+1;break;case 7:d=De(this);break;case 8:d=ye(this)+1;break;case 9:d=ye(this);break;case 10:d=Ee(this)+1;break;case 11:d=Ee(this);break;case 12:d=Fe(this);break;case 13:d=Ge(this);break;case 14:d=
  He(this);break;case 15:d=Ie(this)}this.j=N(this)-2;0==d?(this.h=(this.o[a]<<16>>16)-1,this.o[a]=this.o[a]&-65536|this.h&65535,-1!=this.h?(this.u+=this.j,Q(this,10)):Q(this,14)):Q(this,12)}break;case 6:a=-1;this.j=c<<24>>24;p=0;0==this.j&&(this.j=N(this)-2,p=4);switch(c>>8&15){case 1:je(this,this.u);this.u+=this.j;Q(this,18);break a;case 2:a=Be(this);break;case 3:a=Be(this)+1;break;case 4:a=Ce(this)+1;break;case 5:a=Ce(this);break;case 6:a=De(this)+1;break;case 7:a=De(this);break;case 8:a=ye(this)+
  1;break;case 9:a=ye(this);break;case 10:a=Ee(this)+1;break;case 11:a=Ee(this);break;case 12:a=Fe(this);break;case 13:a=Ge(this);break;case 14:a=He(this);break;case 15:a=Ie(this)}0!=a?(this.u+=this.j,Q(this,10)):Q(this,8+p);break a;case 7:this.ba.gb(e,c<<24>>24);Q(this,4);break a;case 8:if(256==(c&496)){0==(c&8)&&Q(this,6);break a}if(192==(c&448)){f=b[this.N[(c&63)+64]];this.j=f.K(a)&65535;0==this.j?Q(this,38):(g=this.ba,this.h=g.K(e),c=this.h>>>0,a=c/this.j|0,c=c%this.j|0,0!=(a&4294901760)?Je(this,
  -1):(g.setData(a&65535|c<<16),le(g,a)),Q(this,140));break a}if(448==(c&448)){f=b[this.N[(c&63)+64]];this.j=f.K(a);0==this.j?Q(this,38):(g=this.ba,this.h=g.K(e),a=this.h/this.j|0,c=this.h%this.j|0,0!=(a&4294901760)&&4294901760!=(a&4294901760)?Je(this,-1):(g.setData(a&65535|c<<16),le(g,a)),Q(this,158));break a}0==(c&256)?(f=b[this.N[c&255]],this.j=f.K(a),g=b[(c>>6&3)+U],this.h=g.K(e),P(g,this.h|this.j),Q(this,4+f.Qa+f.oa)):(f=b[(c>>6&3)+U],this.j=f.K(e),g=b[this.Z[c&255]],this.h=g.K(a),P(g,this.h|this.j),
  Q(this,8+g.pa));break a;case 9:if(192==(c&192)){f=b[this.R[(c>>2&64)+64|c&63]];this.j=f.K(a);this.l[e]-=this.j;Q(this,8-f.Qa+f.oa);break a}if(0==(c&256)){f=b[this.R[c&255]];this.j=f.K(a);g=b[(c>>6&3)+U];this.h=g.K(e);de(g,this.h-this.j);Q(this,4+f.Qa+f.oa);break a}0!=(c&48)?(f=b[(c>>6&3)+U],this.j=f.K(e),g=b[this.Z[c&255]],this.h=g.K(a),de(g,this.h-this.j),Q(this,8+g.pa)):(f=b[this.Y[c>>5&6|c>>3&1]],this.j=f.K(a)-he(this),g=f,this.h=g.K(e),this.na=this.m,de(g,this.h-this.j),0==this.m&&(this.m=this.na),
  0==(c&8)&&Q(this,4+g.pa));break a;case 11:if(192==(c&192)){f=b[this.R[(c>>2&64)+64|c&63]];this.j=f.K(a);g=b[Ke];this.h=g.K(e);ge(g,this.h-this.j);Q(this,6);break a}if(0==(c&256)){f=b[this.R[c&255]];this.j=f.K(a);g=b[(c>>6&3)+U];this.h=g.K(e);ge(g,this.h-this.j);Q(this,4+f.Qa);break a}8!=(c&56)?(f=b[(c>>6&3)+U],this.j=f.K(e),g=b[this.L[c&255]],this.h=g.K(a),P(g,this.h^this.j),Q(this,8+g.pa-g.va)):(f=b[(c>>6&3)+Le],this.j=f.K(a),g=f,this.h=g.K(e),ge(g,this.h-this.j));break a;case 12:p=c>>6&7;switch(p){case 0:case 1:case 2:f=
  b[this.N[c&255]];this.j=f.K(a);g=b[(c>>6&3)+U];this.h=g.K(e);P(g,this.h&this.j);Q(this,4+f.Qa+f.oa);break a;case 3:f=b[this.N[(c&63)+64]];this.j=f.K(a)&65535;g=this.ba;this.h=g.K(e)&65535;P(g,this.h*this.j);Q(this,70);break a;case 4:case 5:case 6:if(0!=(c&48)){f=b[(c>>6&3)+U];this.j=f.K(e);g=b[this.Z[c&255]];this.h=g.K(a);P(g,this.h&this.j);Q(this,8+g.pa);break a}switch(p){case 4:f=b[this.Y[c>>3&1]];this.j=f.K(a);g=f;this.h=g.K(e);a=(this.j&15)+(this.h&15)-he(this);a+=9<a?6:0;a+=(this.j&240)+(this.h&
  240);144>=a?(g.setData(a),Me(this,0)):(a+=96,g.setData(a),Me(this,-1));0!=(a&255)&&(this.m=a<<24>>24);this.J=this.j<<24>>24;this.v=this.h<<24>>24;this.U=this.H=a<<24>>24;0==(c&8)&&Q(this,6);break a;case 5:0==(c&8)?(p=this.o[e],this.o[e]=this.o[a],this.o[a]=p):(p=this.l[e],this.l[e]=this.l[a],this.l[a]=p);Q(this,6);break a;case 6:0!=(c&8)&&(p=this.o[e],this.o[e]=this.l[a],this.l[a]=p,Q(this,6))}break;case 7:f=b[this.N[(c&63)+64]],this.j=f.K(a),g=this.ba,this.h=g.K(e)<<16>>16,P(g,this.h*this.j),Q(this,
  70)}break;case 13:if(192==(c&192)){f=b[this.R[(c>>2&64)+64|c&63]];this.j=f.K(a);this.l[e]+=this.j;Q(this,8-f.Qa+f.oa);break a}if(0==(c&256)){f=b[this.R[c&255]];this.j=f.K(a);g=b[(c>>6&3)+U];this.h=g.K(e);ee(g,this.h+this.j);Q(this,4+f.Qa+f.oa);break a}0!=(c&48)?(f=b[(c>>6&3)+U],this.j=f.K(e),g=b[this.Z[c&255]],this.h=g.K(a),ee(g,this.h+this.j),Q(this,8+g.pa)):(f=b[this.Y[c>>5&6|c>>3&1]],this.j=f.K(a)-he(this),g=f,this.h=g.K(e),this.na=this.m,ee(g,this.j+this.h),0==this.m&&(this.m=this.na),0==(c&8)&&
  Q(this,4+g.pa));break a;case 14:192!=(c&192)?(d=0==(c&32)?Ae[e]:this.o[e]&63,p=c>>2&6|c>>8&1,g=b[Ne+(c>>6&3)]):(d=1,p=c>>8,g=b[this.Z[(c&63)+64]]);this.h=g.K(a);Q(this,8+g.Za+(g.oa-1)*d);switch(p&7){case 0:d>=g.width&&(this.h>>=1,d=g.width-1);P(g,this.h>>d);0!=d&&Me(this,this.h>>d-1&1);break a;case 1:c=0;d>=g.width&&((this.h&g.sign)!=(this.h&g.sign>>>1)&&(c=1),this.h<<=1,d=g.width-1);P(g,this.h<<d);0!=d&&(Me(this,this.h<<d-1&g.sign),0==c&&(c=g.Cb,c=c<<g.width-d-1&c,c=(this.h&c)!=c&&0!=(this.h&c)?
  1:0),0!=c&&Je(this,-1));break a;case 2:this.h&=g.Cb;d>=g.width&&(this.h>>>=1,d=g.width-1);P(g,this.h>>>d);0!=d&&Me(this,this.h>>>d-1&1);break a;case 3:d>=g.width&&(this.h<<=1,d=g.width-1);P(g,this.h<<d);0!=d&&Me(this,this.h<<d-1&g.sign);break a;case 4:for(this.h&=g.Cb;0!=d--;)a=this.h>>>1|he(this)&g.sign,Oe(this,this.h&1),this.h=a;P(g,this.h);Pe(this,he(this));break a;case 5:for(;0!=d--;)a=this.h<<1|he(this)&1,Oe(this,this.h&g.sign),this.h=a;P(g,this.h);Pe(this,he(this));break a;case 6:if(0==d){P(g,
  this.h);break a}for(this.h&=g.Cb;0!=d--;)a=this.h>>>1|(this.h&1)<<g.width-1,Pe(this,this.h&1),this.h=a;Qe(g,this.h);break a;case 7:if(0==d)P(g,this.h);else{for(;0!=d--;)a=this.h<<1|(this.h&g.sign)>>>g.width-1,Pe(this,this.h&g.sign),this.h=a;Qe(g,this.h)}}break;case 15:if(a=this.I&&(c&Re)==Se)a=!1;if(a){this.u=this.Va;this.S|=me;return}}if(0!=(this.S&Te)&&(this.S&(Te|Ue))!=(Ve|Ue))break}};
  function Yd(a){We(a);Xe(a);I(a,"A0",function(){return a.l[0]},function(b){return a.l[0]=b});I(a,"A1",function(){return a.l[1]},function(b){return a.l[1]=b});I(a,"A2",function(){return a.l[2]},function(b){return a.l[2]=b});I(a,"A3",function(){return a.l[3]},function(b){return a.l[3]=b});I(a,"A4",function(){return a.l[4]},function(b){return a.l[4]=b});I(a,"A5",function(){return a.l[5]},function(b){return a.l[5]=b});I(a,"A6",function(){return a.l[6]},function(b){return a.l[6]=b});I(a,"A7",function(){return a.l[7]},
  function(b){return a.l[7]=b});I(a,"D0",function(){return a.o[0]},function(b){return a.o[0]=b});I(a,"D1",function(){return a.o[1]},function(b){return a.o[1]=b});I(a,"D2",function(){return a.o[2]},function(b){return a.o[2]=b});I(a,"D3",function(){return a.o[3]},function(b){return a.o[3]=b});I(a,"D4",function(){return a.o[4]},function(b){return a.o[4]=b});I(a,"D5",function(){return a.o[5]},function(b){return a.o[5]=b});I(a,"D6",function(){return a.o[6]},function(b){return a.o[6]=b});I(a,"D7",function(){return a.o[7]},
  function(b){return a.o[7]=b});I(a,"C",function(){return Ce(a)?1:0},function(b){return Pe(a,b)});I(a,"V",function(){return ye(a)?1:0},function(b){return Je(a,b)});I(a,"Z",function(){return De(a)?1:0},function(b){a.m=0==b?-1:0});I(a,"N",function(){return Ee(a)?1:0},function(b){a.U=0!=b?-1:0});I(a,"X",function(){return he(a)?1:0},function(b){return Oe(a,b)});I(a,Vd.fe,function(){return a.u},function(b){return a.u=b})}
  function Xe(a){var b=0;a.i=Array(Ye*Ze+1);a.i[b++]=new $e(a);a.i[b++]=new af(a);a.i[b++]=a.ba=new bf(a);a.i[b++]=new cf(a);a.i[b++]=new df(a);a.i[b++]=new ef(a);a.i[b++]=new ff(a);a.i[b++]=new gf(a);a.i[b++]=new hf(a);a.i[b++]=new jf(a);a.i[b++]=new kf(a);a.i[b++]=new lf(a);a.i[b++]=new mf(a);a.i[b++]=new nf(a);a.i[b++]=new of(a);a.i[b++]=new pf(a);a.i[b++]=new qf(a);a.i[b++]=new rf(a);a.i[b++]=new sf(a);a.i[b++]=new tf(a);a.i[b++]=new uf(a);a.i[b++]=new vf(a);a.i[b++]=new wf(a);a.i[b++]=new xf(a);
  a.i[b++]=new yf(a);a.i[b++]=new zf(a);a.i[b++]=new Af(a);a.i[b++]=new Bf(a);a.i[b++]=new Cf(a);a.i[b++]=new Df(a);a.i[b++]=new Ef(a);a.i[b++]=new Ff(a);a.i[b++]=new Gf(a);a.i[b++]=new Hf(a);a.i[b++]=new If(a);a.i[b++]=new Jf(a);a.i[b++]=new cf(a);a.R=Array(256);Kf(a.R,0);a.Aa=Array(256);Kf(a.Aa,7);a.N=Array(256);Kf(a.N,1024);a.Ba=Array(256);Kf(a.Ba,1025);a.L=Array(256);Kf(a.L,1031);a.Z=Array(256);Kf(a.Z,3079);a.Da=Array(256);Kf(a.Da,3201);a.Ia=Array(256);Kf(a.Ia,3335);a.ca=Array(256);Kf(a.ca,3457);
  a.Ta=Array(256);b=a.Ta;for(var c=0,d=0;d<Ye&&c<b.length;d++){var e,f;for(e=0;8>e;e++){for(f=0;7>f;f++)0!=(1024&2048>>f)?b[c++]=Lf:b[c++]=f*Ye+d;5<=e?b[c++]=Lf:0!=(1024&16>>e)?b[c++]=Lf:b[c++]=(f+e)*Ye+d}}a.Y=Array(6);a.Y[0]=Ne;a.Y[1]=Mf;a.Y[2]=ke;a.Y[3]=Nf;a.Y[4]=O;a.Y[5]=Of}function Kf(a,b){for(var c=0,d=0;d<Ye&&c<a.length;d++){var e,f;for(e=0;7>e;e++)for(f=0;8>f;f++)0!=(b&2048>>e)?a[c++]=Lf:a[c++]=e*Ye+d;for(f=0;5>f;f++)0!=(b&16>>f)?a[c++]=Lf:a[c++]=(e+f)*Ye+d;for(;8>f;f++)a[c++]=Lf}}
  h.Ja=function(a){if(!a||!a.length)return A(this,"invalid saved state"),!1;var b=a.shift(),c=a.shift();if(b!=this.ja||2!==(c|0))return this.aa("CPU state mismatch (%s %3.2f)\n",b,c),!1;try{this.l=a.shift(),this.o=a.shift()}catch(d){return A(this,"CPU state error: "+d.message),!1}return!0};h.La=function(a){a.push(this.ja);a.push(2);a.push(this.l);a.push(this.o)};h.Fb=function(a){return a&&this.Ja(a[0])?(a.shift(),!0):!1};h.Ga=function(a){a?(this.time.start(),this.bb&&Yb(this.bb)):Ec(this.time)};
  h.Ea=function(){A(this,"reset");Pf(this);this.time.h||this.Sa(this.toString())};h.fb=function(a){var b=[];this.La(b);a.push(b)};h.bc=function(){};function ae(a){var b=a.flags&~(Qf|Rf|Sf|Tf|Uf);0==a.m&&(b|=Sf);0>a.U&&(b|=Rf);a.T>>>0>a.W>>>0&&(b|=Uf);a.fa>>>0>a.ma>>>0&&(b|=Qf);0>a.H!=0>a.v&&0>a.J!=0>a.v&&(b|=Tf);return b}function Ce(a){return a.T>>>0>a.W>>>0?-1:0}function ye(a){return 0>a.H!=0>a.v&&0>a.J!=0>a.v?-1:0}function De(a){return 0==a.m?-1:0}function Ee(a){return 0>a.U?-1:0}
  function he(a){return a.fa>>>0>a.ma>>>0?-1:0}function Be(a){return a.T>>>0<=a.W>>>0&&0!=a.m?-1:0}function Fe(a){var b=0!=Ee(a);a=0!=ye(a);return b&&a||!b&&!a?-1:0}function Ge(a){var b=0!=Ee(a);a=0!=ye(a);return b&&!a||!b&&a?-1:0}function He(a){var b=0!=De(a),c=0!=Ee(a);a=0!=ye(a);return c&&a&&!b||!c&&!a&&!b?-1:0}function Ie(a){var b=0!=Ee(a),c=0!=ye(a);return 0!=De(a)||b&&!c||!b&&c?-1:0}
  function $d(a,b){a.U=0;a.T=a.W=0;a.H=a.v=0;a.fa=a.ma=0;a.m=a.na=0;0==(b&Sf)&&(a.m=-1);0!=(b&Rf)&&(a.U=-1);0!=(b&Uf)&&(a.T=-1);0!=(b&Qf)&&(a.fa=-1);0!=(b&Tf)&&(a.H=a.J=-1)}function ce(a,b){(b&Vf)<(a.flags&Vf)&&(a.S|=Wf);a.flags&=ie;a.flags|=b&~ie;$d(a,b)}function Pe(a,b){a.T=a.W=0;0!=b&&(a.T=-1)}function Je(a,b){a.H=a.v=0;0!=b&&(a.H=a.J=-1)}function Oe(a,b){a.fa=a.ma=0;0!=b&&(a.fa=-1)}function Me(a,b){a.T=a.W=0;a.fa=a.ma=0;0!=b&&(a.T=a.fa=-1)}
  function We(a){a.S=0;a.u=0;a.Va=0;a.cb=0;a.za=0;a.o=[0,0,0,0,0,0,0,0];a.l=[0,0,0,0,0,0,0,0];a.j=a.h=0;Pf(a)}function Pf(a){ce(a,be);a.S&=~Xf;for(var b=0;b<a.o.length;b++)a.o[b]=0;for(b=0;b<a.l.length;b++)a.l[b]=0;a.u=a.Va=a.Ub;a.Tb=0}function Q(a,b){a.ea-=b}function V(a,b){return a.la.Ca(b)|0}function T(a,b){return a.la.sa(b)}function R(a,b){return a.la.Ha(b)}function Yf(a,b,c){a.la.ya(b,c&255)}function oe(a,b,c){a.la.ka(b,c&65535)}function Zf(a,b,c){a.la.xa(b,c&4294967295)}
  function N(a){var b=T(a,a.u);a.u+=2;return b}function $f(a){var b=R(a,a.u);a.u+=4;return b}function se(a){var b=R(a,a.l[7]);a.l[7]+=4;return b}function je(a,b){Zf(a,a.l[7]-=4,b)}
  h.toString=function(){return this.O("D0=%08x D1=%08x D2=%08x D3=%08x\nD4=%08x D5=%08x D6=%08x D7=%08x\nA0=%08x A1=%08x A2=%08x A3=%08x\nA4=%08x A5=%08x A6=%08x A7=%08x SR=%04x\n",this.o[0],this.o[1],this.o[2],this.o[3],this.o[4],this.o[5],this.o[6],this.o[7],this.l[0],this.l[1],this.l[2],this.l[3],this.l[4],this.l[5],this.l[6],this.l[7],ae(this))};
  var qe=2,re=3,te=1316159485,ve=1316159486,Se=61443,Re=65535,ne=0,Ve=64,Ue=128,xe=256,me=2048,Wf=8192,ue=32768,we=65536,Xf=xe|1536|me|4096|Wf|16384|ue|we|131072,Te=56|xe|Ve|me|Wf|16384,ag=[1,1,1,1,1,1,1,2],Ae=[8,1,2,3,4,5,6,7],Ye=3,Ze=12,U=0,Ne=0,ke=1,O=2,Lf=3,Ke=5,Le=9,ze=10,Mf=12,Nf=13,Of=14,Zd=33,fe=34,Uf=1,Tf=2,Sf=4,Rf=8,Qf=16,ie=31,Vf=1792,be=8192,pe=32768;w.CPU68K=Xd;
  function bg(a,b,c){id.call(this,a,b,c);this.ma=6;a=0;this.i=[];this.i[a++]=new cg(this);this.i[a++]=new dg(this);this.i[a++]=new eg(this);this.i[a++]=new fg(this);this.i[a++]=new gg(this);this.i[a++]=new hg(this);this.i[a++]=new ig(this);this.i[a++]=new jg(this);this.i[a++]=new kg(this);this.i[a++]=new lg(this);this.i[a++]=new mg(this);this.i[a++]=new ng(this);this.i[a++]=new og(this);this.i[a++]=new pg(this);this.i[a++]=new qg(this);this.i[a++]=new rg(this);this.i[a++]=new sg(this);this.i[a++]=new tg(this);
  this.i[a++]=new ug(this);this.i[a++]=new vg(this);this.i[a++]=new wg(this);this.i[a++]=new xg(this);this.i[a++]=new yg(this);this.i[a++]=new zg(this);this.i[a++]=new Ag(this);this.i[a++]=new Bg(this);this.i[a++]=new Cg(this);this.i[a++]=new Dg(this);this.i[a++]=new Eg(this);this.i[a++]=new Fg(this);this.i[a++]=new Gg(this);this.i[a++]=new Hg(this);this.i[a++]=new Ig(this);this.i[a++]=new Jg(this);this.i[a++]=new Kg(this);this.i[a++]=new Lg(this);this.i[a++]=new fg(this)}t(bg,id);
  bg.prototype.hc=function(a){var b=null,c=null,d=null,e=null,f=0,g,l=!1,k=null,m=null;try{this.h=a;f=T(this.g,this.h);this.h+=2;var p=0;var n=f&7;var r=f>>9&7;a:switch(f>>12&15){case 0:var B=O;switch(f>>8&15){case 0:c="ORI";k=this.i[(f>>6&3)+Zd];d=k.s(0);60!=(f&63)?(m=this.i[this.g.L[f&255]],e=m.s(n)):0==(f&192)?e="CCR":64==(f&192)&&(e="SR");break a;case 2:c="ANDI";k=this.i[(f>>6&3)+Zd];d=k.s(0);60!=(f&63)?(m=this.i[this.g.L[f&255]],e=m.s(n)):0==(f&192)?e="CCR":64==(f&192)&&(e="SR");break a;case 4:c=
  "SUBI";k=this.i[(f>>6&3)+Zd];d=k.s(0);m=this.i[this.g.L[f&255]];e=m.s(n);break a;case 6:c="ADDI";k=this.i[(f>>6&3)+Zd];d=k.s(0);m=this.i[this.g.L[f&255]];e=m.s(n);break a;case 8:B=fe;r=0;break;case 10:c="EORI";k=this.i[(f>>6&3)+Zd];d=k.s(0);60!=(f&63)?(m=this.i[this.g.L[f&255]],e=m.s(n)):0==(f&192)?e="CCR":64==(f&192)&&(e="SR");break a;case 12:c="CMPI";k=this.i[(f>>6&3)+Zd];d=k.s(0);m=this.i[this.g.L[f&255]];e=m.s(n);break a;case 14:break a;case 1:r=0;break;case 3:r=1;break;case 5:r=2;break;case 7:r=
  3;break;case 9:r=4;break;case 11:r=5;break;case 13:r=6;break;case 15:r=7}if(8==(f&56))c="MOVEP",d="???";else switch(k=this.i[B],d=k.s(r),m=0==(f&56)?this.i[O]:0==(f&192)?this.i[this.g.Ba[f&63]]:this.i[this.g.L[f&63]],e=m.s(n),f>>6&3){case 0:c="BTST";break;case 1:c="BCHG";break;case 2:c="BCLR";break;case 3:c="BSET"}break a;case 2:p++;case 3:p++;case 1:p<<=6;64!=(f&448)?(c="MOVE",k=this.i[this.g.R[p+(f&63)]],d=k.s(n),m=this.i[this.g.Ta[p+(f>>6&63)]]):(c="MOVEA",k=this.i[this.g.R[p+(f&63)]],d=k.s(n),
  m=this.i[Ke]);e=m.s(r);break a;case 4:switch(f>>8&15){case 0:192!=(f&192)?(c="NEGX",m=this.i[this.g.L[f&255]],d=m.s(n)):(c="MOVE",d="SR",m=this.i[this.g.L[(f&63)+64]],e=m.s(n));break a;case 2:192!=(f&192)?(c="CLR",m=this.i[this.g.L[f&255]]):(c="MOVE",d="CCR",m=this.i[this.g.L[(f&63)+64]]);e=m.s(n);break a;case 4:192!=(f&192)?(c="NEG",m=this.i[this.g.L[f&255]],d=m.s(n)):(c="MOVE",e="CCR",k=this.i[this.g.N[(f&63)+64]],d=k.s(n));break a;case 6:192!=(f&192)?(c="NOT",m=this.i[this.g.L[f&255]],e=m.s(n)):
  (c="MOVE",e="SR",k=this.i[this.g.N[(f&63)+64]],d=k.s(n));break a;case 8:switch(f>>6&3){case 0:c="NBCD";d="???";break a;case 1:0==(f&56)?(c="SWAP",m=this.i[O],e=m.s(n)):(c="PEA",k=this.i[this.g.ca[(f&63)+128]],d=k.s(n),d.endsWith(".l")&&(d=d.substring(0,d.length-2)));break a;case 2:if(0==(f&56)){c="EXT";m=this.i[ke];e=m.s(n);break a}case 3:if(0==(f&56)){c="EXT";m=this.i[O];e=m.s(n);break a}}c="MOVEM";B=T(this.g,this.h);this.h+=2;d="{";if(32==(f&56)){var y=1;for(g=7;0<=g;g--,y<<=1)0!=(B&y)&&(1<d.length&&
  (d+=","),d=d+"A"+g);for(g=7;0<=g;g--,y<<=1)0!=(B&y)&&(1<d.length&&(d+=","),d=d+"D"+g)}else{y=1;for(g=0;7>=g;g++,y<<=1)0!=(B&y)&&(1<d.length&&(d+=","),d=d+"D"+g);for(g=0;7>=g;g++,y<<=1)0!=(B&y)&&(1<d.length&&(d+=","),d=d+"A"+g)}d+="}";e=this.i[this.g.Ia[f-64&255]].s(n);break a;case 10:192!=(f&192)?(c="TST",m=this.i[this.g.R[f&255]],e=m.s(n)):60!=(f&63)?(c="TAS",m=this.i[this.g.L[f&63]],e=m.s(n)):c="ILLEGAL";break a;case 12:c="MOVEM";g=T(this.g,this.h);this.h+=2;d=this.i[this.g.Da[f-64&255]].s(n);e=
  "{";y=1;for(n=0;7>=n;n++,y<<=1)0!=(g&y)&&(1<e.length&&(e+=","),e=e+"D"+n);for(n=0;7>=n;n++,y<<=1)0!=(g&y)&&(1<e.length&&(e+=","),e=e+"A"+n);e+="}";break a;case 14:switch(f>>4&15){case 4:c="TRAP";var z=f&15;15!=z?d=this.O("%x",z):(T(this.g,this.h),this.h+=2,d="API");break a;case 5:0==(f&8)?(c="LINK",d="A"+n,e=this.i[fe].s(0)):(c="UNLK",d="A"+n);break a;case 6:c="MOVE";0==(f&8)?(d="A"+n,e="USP"):(d="USP",e="A"+n);break a;case 7:switch(f&15){case 0:c="RESET";break a;case 1:c="NOP";break a;case 2:c="STOP";
  d="#"+Mg(T(this.g,this.h)&65535);this.h+=2;break a;case 3:c="RTE";break a;case 5:c="RTS";break a;case 6:c="TRAPV";break a;case 7:c="RTR";break a}case 8:case 9:case 10:case 11:c="JSR";k=this.i[this.g.ca[(f&63)+128]];d=k.s(n);d.endsWith(".l")&&(d=d.substring(0,d.length-2));break a;case 12:case 13:case 14:case 15:c="JMP";k=this.i[this.g.ca[(f&63)+128]];d=k.s(n);d.endsWith(".l")&&(d=d.substring(0,d.length-2));break a}break a;case 1:r=0;break;case 3:r=1;break;case 5:r=2;break;case 7:r=3;break;case 9:if(192==
  (f&248)){c="EXT";m=this.i[O];e=m.s(n);break a}r=4;break;case 11:r=5;break;case 13:r=6;break;case 15:r=7}128==(f&192)?(c="CHK",k=this.i[this.g.N[(f&63)+64]],d=k.s(n),d.endsWith(".w")&&(d=d.substring(0,d.length-2)),e="D"+r):(c="LEA",k=this.i[this.g.ca[(f&63)+128]],d=k.s(n),d.endsWith(".l")&&(d=d.substring(0,d.length-2)),e="A"+r);break a;case 5:if(192!=(f&192))d="#"+Ae[r],m=this.i[this.g.Aa[f&255]],e=m.s(n),c=0==(f&256)?"ADDQ":"SUBQ";else if(8!=(f&56))switch(m=this.i[this.g.L[f&63]],e=m.s(n),f>>8&15){case 0:c=
  "ST";break a;case 1:c="SF";break a;case 2:c="SHI";break a;case 3:c="SLS";break a;case 4:c="SCC";break a;case 5:c="SCS";break a;case 6:c="SNE";break a;case 7:c="SEQ";break a;case 8:c="SVC";break a;case 9:c="SVS";break a;case 10:c="SPL";break a;case 11:c="SMI";break a;case 12:c="SGE";break a;case 13:c="SLT";break a;case 14:c="SGT";break a;case 15:c="SLE"}else{switch(f>>8&15){case 0:c="DBT";break;case 1:c="DBRA";break;case 2:c="DBHI";break;case 3:c="DBLS";break;case 4:c="DBCC";break;case 5:c="DBCS";
  break;case 6:c="DBNE";break;case 7:c="DBEQ";break;case 8:c="DBVC";break;case 9:c="DBVS";break;case 10:c="DBPL";break;case 11:c="DBMI";break;case 12:c="DBGE";break;case 13:c="DBLT";break;case 14:c="DBGT";break;case 15:c="DBLE"}d="D"+n;e=this.O("%x",this.h+T(this.g,this.h));this.h+=2}break;case 6:switch(f>>8&15){case 0:c="BRA";break;case 1:c="BSR";break;case 2:c="BHI";break;case 3:c="BLS";break;case 4:c="BCC";break;case 5:c="BCS";break;case 6:c="BNE";break;case 7:c="BEQ";break;case 8:c="BVC";break;
  case 9:c="BVS";break;case 10:c="BPL";break;case 11:c="BMI";break;case 12:c="BGE";break;case 13:c="BLT";break;case 14:c="BGT";break;case 15:c="BLE"}f&255?d=this.O("%x",this.h+(f<<24>>24)):(d=this.O("%x",this.h+T(this.g,this.h)),this.h+=2);break a;case 7:c="MOVEQ";d="#"+(f<<24>>24);e=this.i[O].s(r);break a;case 8:if(256==(f&496)){c="SBCD";d="???";break a}if(192==(f&448)){c="DIVU";k=this.i[this.g.N[(f&63)+64]];d=k.s(n);m=this.i[O];e=m.s(r);break a}if(448==(f&448)){c="DIVS";k=this.i[this.g.N[(f&63)+64]];
  d=k.s(n);m=this.i[O];e=m.s(r);break a}0==(f&256)?(c="OR",k=this.i[this.g.N[f&255]],d=k.s(n),m=this.i[(f>>6&3)+U],e=m.s(r)):(c="OR",k=this.i[(f>>6&3)+U],d=k.s(r),m=this.i[this.g.Z[f&255]],e=m.s(n));break a;case 9:if(192==(f&192)){c="SUBA";k=this.i[this.g.R[(f>>2&64)+64|f&63]];d=k.s(n);m=this.i[(f>>8&1)+4];e=m.s(r);break a}if(0==(f&256)){c="SUB";k=this.i[this.g.R[f&255]];d=k.s(n);m=this.i[(f>>6&3)+U];e=m.s(r);break a}0!=(f&48)?(c="SUB",k=this.i[(f>>6&3)+U],d=k.s(r),m=this.i[this.g.Z[f&255]],e=m.s(n)):
  (c="SUBX",k=this.i[this.g.Y[f>>5&6|f>>3&1]],d=k.s(n),m=k,e=m.s(r));break a;case 11:if(192==(f&192)){c="CMPA";k=this.i[this.g.R[(f>>2&64)+64|f&63]];d=k.s(n);m=this.i[(f>>8&1)+4];e=m.s(r);break a}if(0==(f&256)){c="CMP";k=this.i[this.g.R[f&255]];d=k.s(n);m=this.i[(f>>6&3)+U];e=m.s(r);break a}8!=(f&56)?(c="EOR",k=this.i[(f>>6&3)+U],d=k.s(r),m=this.i[this.g.L[f&255]],e=m.s(n)):(c="CMPM",k=this.i[(f>>6&3)+Le],d=k.s(n),m=k,e=m.s(r));break a;case 12:z=f>>6&7;switch(z){case 0:case 1:case 2:c="AND";k=this.i[this.g.N[f&
  255]];d=k.s(n);m=this.i[(f>>6&3)+U];e=m.s(r);break a;case 3:c="MULU";k=this.i[this.g.N[(f&63)+64]];d=k.s(n);m=this.i[O];e=m.s(r);break a;case 4:case 5:case 6:if(0!=(f&48)){c="AND";k=this.i[(f>>6&3)+U];d=k.s(r);m=this.i[this.g.Z[f&255]];e=m.s(n);break a}switch(z){case 4:c="ABCD";k=this.i[this.g.Y[f>>3&1]];d=k.s(n);m=k;e=m.s(r);break a;case 5:0==(f&8)?(c="EXG",d="D"+r,e="D"+n):(c="EXG",d="A"+r,e="A"+n);break a;case 6:0!=(f&8)&&(c="EXG",d="D"+r,e="A"+n)}break;case 7:c="MULS",k=this.i[this.g.N[(f&63)+
  64]],d=k.s(n),m=this.i[O],e=m.s(r)}break;case 13:if(192==(f&192)){c="ADDA";k=this.i[this.g.R[(f>>2&64)+64|f&63]];d=k.s(n);m=this.i[(f>>8&1)+4];e=m.s(r);break a}if(0==(f&256)){c="ADD";k=this.i[this.g.R[f&255]];d=k.s(n);m=this.i[(f>>6&3)+U];e=m.s(r);break a}0!=(f&48)?(c="ADD",k=this.i[(f>>6&3)+U],d=k.s(r),m=this.i[this.g.Z[f&255]],e=m.s(n)):(c="ADDX",k=this.i[this.g.Y[f>>5&6|f>>3&1]],d=k.s(n),m=k,e=m.s(r));break a;case 14:switch(192!=(f&192)?(d=0==(f&32)?"#"+Ae[r]:"D"+r,z=f>>2&6|f>>8&1,m=this.i[Ne+
  (f>>6&3)]):(d="1",z=f>>8,m=this.i[this.g.Z[(f&63)+64]]),e=m.s(n),z&7){case 0:c="ASR";break a;case 1:c="ASL";break a;case 2:c="LSR";break a;case 3:c="LSL";break a;case 4:c="ROXR";break a;case 5:c="ROXL";break a;case 6:c="ROR";break a;case 7:c="ROL"}}null==c&&(c="???");if(null!=d&&null!=e){var C=d.length,v=e.length;2<=C&&2<=v&&("."==d.charAt(C-2)&&"."==e.charAt(v-2)&&d.charAt(C-1)==e.charAt(v-1)?(C-=2,v-=2,c+=d.substring(C),d=d.substring(0,C),e=e.substring(0,v)):"#"!=d.charAt(0)&&"{"!=d.charAt(0)||
  "."!=e.charAt(v-2)?"."==d.charAt(C-2)&&"{"==e.charAt(0)&&(C-=2,c+=d.substring(C),d=d.substring(0,C)):(v-=2,c+=e.substring(v),e=e.substring(0,v)));d=d+","+e}else if(null==d&&(d=e),null!=d){var W=d.length;2<=W&&"."==d.charAt(W-2)&&(W-=2,c+=d.substring(W),d=d.substring(0,W))}b="";for(e=0;6>e&&!(a+e>>>1>=this.h>>>1);e+=2)b=b+this.O("%04x",T(this.g,a+e)&65535)+" "}catch(S){b="error",l=!0}if(l)try{if(a==R(this.g,188)){b=null;c="INSIDE";try{R(this.g,this.g.l[7]+2),d="API"}catch(S){d="???"}}}catch(S){}if(null!=
  d&&(20218==f||20154==f)){f=k;if(null==f||f.Wa.startsWith("#"))f=m;if(null!=f&&!f.Wa.startsWith("#")){d=d+"  ["+f.Wa;if("LEA"!=c&&"PEA"!=c&&"JMP"!=c&&"JSR"!=c)try{d=d+"="+this.O("%x",f.getData())}catch(S){d+="=???"}d+="]"}}return this.O("%08x: %-15s %-8s %-40s;",a,b,c,d)};function Mg(a){a=a.toString(16);return"-"!=a.charAt(0)?"0x"+a:"-0x"+a.substring(1)}
  function Ng(a,b){var c=T(a.g,a.h),d=(c&28672)>>12,e=c<<24>>24;return 0!=(c&2048)?0!=(c&32768)?b+a.g.l[d]+e:b+a.g.o[d]+e:0!=(c&32768)?b+(a.g.l[d]<<16>>16)+e:b+(a.g.o[d]<<16>>16)+e}function Og(a,b){var c=T(a.g,a.h);a.h+=2;a=c>>12&7;var d=c<<24>>24;return"("+(0!=d?Mg(d)+",":"")+(0>b?"PC":"A"+b)+(0!=(c&32768)?",A":",D")+a+(0!=(c&2048)?".l":".w")+")"}function X(a,b){this.I=a;this.Wa=b||"";this.g=a.g;this.h=0}X.prototype.s=function(){return""};X.prototype.getData=function(){return 0};
  function fg(){X.apply(this,arguments)}t(fg,X);fg.prototype.s=function(){return"???"};fg.prototype.getData=function(){return 0};function cg(a){X.call(this,a,"D")}t(cg,X);cg.prototype.s=function(a){this.h=a;return this.Wa+this.h+".b"};cg.prototype.getData=function(){return this.g.o[this.h]&255};function dg(a){X.call(this,a,"D")}t(dg,X);dg.prototype.s=function(a){this.h=a;return this.Wa+this.h+".w"};dg.prototype.getData=function(){return this.g.o[this.h]&65535};function eg(a){X.call(this,a,"D")}
  t(eg,X);eg.prototype.s=function(a){this.h=a;return this.Wa+this.h+".l"};eg.prototype.getData=function(){return this.g.o[this.h]};function gg(a){X.call(this,a,"A")}t(gg,X);gg.prototype.s=function(a){this.h=a;return this.Wa+this.h+".w"};gg.prototype.getData=function(){return this.g.l[this.h]&65535};function hg(a){X.call(this,a,"A")}t(hg,X);hg.prototype.s=function(a){this.h=a;return this.Wa+this.h+".l"};hg.prototype.getData=function(){return this.g.l[this.h]};function ig(){X.apply(this,arguments)}
  t(ig,X);ig.prototype.s=function(a){this.h=this.g.l[a];return"(A"+a+").b"};ig.prototype.getData=function(){return V(this.g,this.h)&255};function jg(){X.apply(this,arguments)}t(jg,X);jg.prototype.s=function(a){this.h=this.g.l[a];return"(A"+a+").w"};jg.prototype.getData=function(){return T(this.g,this.h)&65535};function kg(){X.apply(this,arguments)}t(kg,X);kg.prototype.s=function(a){this.h=this.g.l[a];return"(A"+a+").l"};kg.prototype.getData=function(){return R(this.g,this.h)};
  function lg(){X.apply(this,arguments)}t(lg,X);lg.prototype.s=function(a){this.h=this.g.l[a];return"(A"+a+")+.b"};lg.prototype.getData=function(){return V(this.g,this.h)&255};function mg(){X.apply(this,arguments)}t(mg,X);mg.prototype.s=function(a){this.h=this.g.l[a];return"(A"+a+")+.w"};mg.prototype.getData=function(){return T(this.g,this.h)&65535};function ng(){X.apply(this,arguments)}t(ng,X);ng.prototype.s=function(a){this.h=this.g.l[a];return"(A"+a+")+.l"};
  ng.prototype.getData=function(){return R(this.g,this.h)};function og(){X.apply(this,arguments)}t(og,X);og.prototype.s=function(a){this.h=this.g.l[a]-ag[a];return"-(A"+a+").b"};og.prototype.getData=function(){return V(this.g,this.h)&255};function pg(){X.apply(this,arguments)}t(pg,X);pg.prototype.s=function(a){this.h=this.g.l[a]-2;return"-(A"+a+").w"};pg.prototype.getData=function(){return T(this.g,this.h)&65535};function qg(){X.apply(this,arguments)}t(qg,X);
  qg.prototype.s=function(a){this.h=this.g.l[a]-4;return"-(A"+a+").l"};qg.prototype.getData=function(){return R(this.g,this.h)};function rg(){X.apply(this,arguments)}t(rg,X);rg.prototype.s=function(a){var b=T(this.g,this.I.h);this.I.h+=2;this.h=this.g.l[a]+b;return(0!=b?Mg(b):"")+"(A"+a+").b"};rg.prototype.getData=function(){return V(this.g,this.h)&255};function sg(){X.apply(this,arguments)}t(sg,X);
  sg.prototype.s=function(a){var b=T(this.g,this.I.h);this.I.h+=2;this.h=this.g.l[a]+b;return(0!=b?Mg(b):"")+"(A"+a+").w"};sg.prototype.getData=function(){return T(this.g,this.h)&65535};function tg(){X.apply(this,arguments)}t(tg,X);tg.prototype.s=function(a){var b=T(this.g,this.I.h);this.I.h+=2;this.h=this.g.l[a]+b;return(0!=b?Mg(b):"")+"(A"+a+").l"};tg.prototype.getData=function(){return R(this.g,this.h)};function ug(){X.apply(this,arguments)}t(ug,X);
  ug.prototype.s=function(a){this.h=Ng(this.I,this.g.l[a]);return Og(this.I,a)+".b"};ug.prototype.getData=function(){return V(this.g,this.h)&255};function vg(){X.apply(this,arguments)}t(vg,X);vg.prototype.s=function(a){this.h=Ng(this.I,this.g.l[a]);return Og(this.I,a)+".w"};vg.prototype.getData=function(){return T(this.g,this.h)&65535};function wg(){X.apply(this,arguments)}t(wg,X);wg.prototype.s=function(a){this.h=Ng(this.I,this.g.l[a]);return Og(this.I,a)+".l"};
  wg.prototype.getData=function(){return R(this.g,this.h)};function xg(){X.apply(this,arguments)}t(xg,X);xg.prototype.s=function(){this.h=T(this.g,this.I.h);this.I.h+=2;return this.I.O("(%x).b",this.h)};xg.prototype.getData=function(){return V(this.g,this.h)&255};function yg(){X.apply(this,arguments)}t(yg,X);yg.prototype.s=function(){this.h=T(this.g,this.I.h);this.I.h+=2;return this.I.O("(%x).w",this.h)};yg.prototype.getData=function(){return T(this.g,this.h)&65535};
  function zg(){X.apply(this,arguments)}t(zg,X);zg.prototype.s=function(){this.h=T(this.g,this.I.h);this.I.h+=2;return this.I.O("(%x).l",this.h)};zg.prototype.getData=function(){return R(this.g,this.h)};function Ag(){X.apply(this,arguments)}t(Ag,X);Ag.prototype.s=function(){this.h=R(this.g,this.I.h);this.I.h+=4;return this.I.O("(%x).b",this.h)};Ag.prototype.getData=function(){return V(this.g,this.h)&255};function Bg(){X.apply(this,arguments)}t(Bg,X);
  Bg.prototype.s=function(){this.h=R(this.g,this.I.h);this.I.h+=4;return this.I.O("(%x).w",this.h)};Bg.prototype.getData=function(){return T(this.g,this.h)&65535};function Cg(){X.apply(this,arguments)}t(Cg,X);Cg.prototype.s=function(){this.h=R(this.g,this.I.h);this.I.h+=4;return this.I.O("(%x).l",this.h)};Cg.prototype.getData=function(){return R(this.g,this.h)};function Dg(){X.apply(this,arguments)}t(Dg,X);
  Dg.prototype.s=function(){var a=T(this.g,this.I.h);this.h=this.I.h+a;this.I.h+=2;return(a?Mg(a):"")+"(PC).b"};Dg.prototype.getData=function(){return V(this.g,this.h)&255};function Eg(){X.apply(this,arguments)}t(Eg,X);Eg.prototype.s=function(){var a=T(this.g,this.I.h);this.h=this.I.h+a;this.I.h+=2;return(a?Mg(a):"")+"(PC).w"};Eg.prototype.getData=function(){return T(this.g,this.h)&65535};function Fg(){X.apply(this,arguments)}t(Fg,X);
  Fg.prototype.s=function(){var a=T(this.g,this.I.h);this.h=this.I.h+a;this.I.h+=2;return(a?Mg(a):"")+"(PC).l"};Fg.prototype.getData=function(){return R(this.g,this.h)};function Gg(){X.apply(this,arguments)}t(Gg,X);Gg.prototype.s=function(){this.h=Ng(this.I,this.I.h);return Og(this.I,-1)+".b"};Gg.prototype.getData=function(){return V(this.g,this.h)&255};function Hg(){X.apply(this,arguments)}t(Hg,X);Hg.prototype.s=function(){this.h=Ng(this.I,this.I.h);return Og(this.I,-1)+".w"};
  Hg.prototype.getData=function(){return T(this.g,this.h)&65535};function Ig(){X.apply(this,arguments)}t(Ig,X);Ig.prototype.s=function(){this.h=Ng(this.I,this.I.h);return Og(this.I,-1)+".l"};Ig.prototype.getData=function(){return R(this.g,this.h)};function Jg(a){X.call(this,a,"#")}t(Jg,X);Jg.prototype.s=function(){this.h=this.I.h+1;this.I.h+=2;return"#"+Mg(V(this.g,this.h))};Jg.prototype.getData=function(){return V(this.g,this.h)&255};function Kg(a){X.call(this,a,"#")}t(Kg,X);
  Kg.prototype.s=function(){this.h=this.I.h;this.I.h+=2;return"#"+Mg(T(this.g,this.h))};Kg.prototype.getData=function(){return T(this.g,this.h)&65535};function Lg(a){X.call(this,a,"#")}t(Lg,X);Lg.prototype.s=function(){this.h=this.I.h;this.I.h+=4;return"#"+Mg(R(this.g,this.h))};Lg.prototype.getData=function(){return R(this.g,this.h)};w.Dbg68K=bg;function Y(a,b,c,d,e){this.g=a;this.h=0;this.Cb=b;this.sign=c;this.width=d;this.Qa=2*e;this.pa=4*e;this.oa=this.$b=this.nd=this.va=this.Za=0}h=Y.prototype;
  h.X=function(a){return this.h=a};h.getData=function(){return 0};h.setData=function(){};h.V=function(){};h.$=function(){};h.ga=function(a){var b=this.g.Vb;this.X(a);this.g.Vb=b};h.K=function(a){this.X(a);return this.getData()};h.ec=function(a,b){this.X(a);this.setData(b)};function le(a,b){a.V(b);a.g.U=a.g.m;a.g.H=a.g.v=0;a.g.T=a.g.W=0}function Qe(a,b){a.setData(b);a.V(b);a.g.U=a.g.m;a.g.v=0;a.g.H=0}function P(a,b){a.setData(b);a.V(b);a.g.U=a.g.m;a.g.H=a.g.v=0;a.g.T=a.g.W=0}
  h.gb=function(a,b){this.X(a);this.setData(b);this.V(b);this.g.U=this.g.m;this.g.H=this.g.v=0;this.g.T=this.g.W=0};function Pg(a,b){a.V(b);a.g.U=a.g.m;a.$();a.g.T=a.g.fa=a.g.J;a.g.W=a.g.ma=a.g.v}function ge(a,b){a.V(b);a.g.U=a.g.m;a.$();a.g.T=a.g.J;a.g.W=a.g.v}function de(a,b){a.setData(b);Pg(a,b)}function ee(a,b){a.setData(b);Pg(a,b);a.g.J=~a.g.J;a.g.W=a.g.ma=~a.g.W}
  function Qg(a,b){var c=N(a.g),d=(c&28672)>>12;return 0!=(c&2048)?0!=(c&32768)?b+a.g.l[d]+(c<<24>>24):b+a.g.o[d]+(c<<24>>24):0!=(c&32768)?b+(a.g.l[d]<<16>>16)+(c<<24>>24):b+(a.g.o[d]<<16>>16)+(c<<24>>24)}function cf(a){Y.call(this,a,0,0,0,0)}t(cf,Y);h=cf.prototype;h.X=function(){return 0};h.getData=function(){return 0};h.setData=function(){};h.V=function(){};h.$=function(){};function $e(a){Y.call(this,a,255,128,8,0);this.oa=2;this.va=4}t($e,Y);h=$e.prototype;
  h.getData=function(){return this.g.o[this.h]<<24>>24};h.K=function(a){return this.g.o[this.h=a]<<24>>24};h.setData=function(a){this.g.o[this.h]=this.g.o[this.h]&-256|a&255};h.V=function(a){this.g.m=a<<24>>24};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h;this.g.J=this.g.j};h.gb=function(a,b){this.h=a;this.g.o[this.h]=this.g.o[this.h]&-256|b&255;this.g.m=b<<24>>24;this.g.U=this.g.m;this.g.H=this.g.v=0;this.g.T=this.g.W=0};function af(a){Y.call(this,a,65535,32768,16,0);this.oa=2;this.va=4}
  t(af,Y);h=af.prototype;h.getData=function(){return this.g.o[this.h]<<16>>16};h.K=function(a){return this.g.o[this.h=a]<<16>>16};h.setData=function(a){this.g.o[this.h]=this.g.o[this.h]&-65536|a&65535};h.V=function(a){this.g.m=a<<16>>16};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h<<16>>16;this.g.J=this.g.j<<16>>16};h.gb=function(a,b){this.h=a;this.g.o[this.h]=this.g.o[this.h]&-65536|b&65535;this.g.m=b<<16>>16;this.g.U=this.g.m;this.g.H=this.g.v=0;this.g.T=this.g.W=0};
  function bf(a){Y.call(this,a,4294967295,2147483648,32,1);this.$b=this.oa=this.Za=2;this.va=4}t(bf,Y);h=bf.prototype;h.getData=function(){return this.g.o[this.h]};h.K=function(a){return this.g.o[this.h=a]};h.setData=function(a){this.g.o[this.h]=a};h.V=function(a){this.g.m=a};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h;this.g.J=this.g.j};h.gb=function(a,b){this.h=a;this.g.o[this.h]=b;this.g.m=b;this.g.U=this.g.m;this.g.H=this.g.v=0;this.g.T=this.g.W=0};
  function df(a){Y.call(this,a,65535,32768,16,0);this.oa=2;this.nd=this.va=4}t(df,Y);df.prototype.getData=function(){return this.g.l[this.h]<<16>>16};df.prototype.setData=function(a){this.g.l[this.h]=a};df.prototype.V=function(a){this.g.m=a<<16>>16};df.prototype.$=function(){this.g.H=this.g.m;this.g.v=this.g.h<<16>>16;this.g.J=this.g.j<<16>>16};function ef(a){Y.call(this,a,4294967295,2147483648,32,1);this.oa=this.Za=2;this.va=4}t(ef,Y);h=ef.prototype;h.getData=function(){return this.g.l[this.h]};
  h.setData=function(a){this.g.l[this.h]=a};h.V=function(a){this.g.m=a};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h;this.g.J=this.g.j};h.ec=function(a,b){this.g.l[this.h=a]=b};function ff(a){Y.call(this,a,255,128,8,0)}t(ff,Y);h=ff.prototype;h.X=function(a){Q(this.g,4);return this.h=this.g.l[a]};h.ga=function(){this.h+=1};h.getData=function(){return V(this.g,this.h)};h.setData=function(a){Yf(this.g,this.h,a)};h.V=function(a){this.g.m=a<<24>>24};
  h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h<<24>>24;this.g.J=this.g.j<<24>>24};function gf(a){Y.call(this,a,65535,32768,16,0)}t(gf,Y);h=gf.prototype;h.X=function(a){Q(this.g,4);return this.h=this.g.l[a]};h.ga=function(){this.h+=2};h.getData=function(){return T(this.g,this.h)};h.setData=function(a){oe(this.g,this.h,a)};h.V=function(a){this.g.m=a<<16>>16};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h<<16>>16;this.g.J=this.g.j<<16>>16};
  function hf(a){Y.call(this,a,4294967295,2147483648,32,1)}t(hf,Y);h=hf.prototype;h.X=function(a){Q(this.g,8);return this.h=this.g.l[a]};h.ga=function(){this.h+=4};h.getData=function(){return R(this.g,this.h)};h.setData=function(a){Zf(this.g,this.h,a)};h.V=function(a){this.g.m=a};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h;this.g.J=this.g.j};function jf(a){Y.call(this,a,255,128,8,0)}t(jf,Y);h=jf.prototype;h.X=function(a){Q(this.g,4);this.h=this.g.l[a];this.g.l[a]+=ag[a];return this.h};
  h.getData=function(){return V(this.g,this.h)};h.setData=function(a){Yf(this.g,this.h,a)};h.V=function(a){this.g.m=a<<24>>24};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h<<24>>24;this.g.J=this.g.j<<24>>24};function kf(a){Y.call(this,a,65535,32768,16,0)}t(kf,Y);h=kf.prototype;h.X=function(a){Q(this.g,4);this.h=this.g.l[a];this.g.l[a]+=2;return this.h};h.getData=function(){return T(this.g,this.h)};h.setData=function(a){oe(this.g,this.h,a)};h.V=function(a){this.g.m=a<<16>>16};
  h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h<<16>>16;this.g.J=this.g.j<<16>>16};function lf(a){Y.call(this,a,4294967295,2147483648,32,1)}t(lf,Y);h=lf.prototype;h.X=function(a){Q(this.g,8);this.h=this.g.l[a];this.g.l[a]+=4;return this.h};h.getData=function(){return R(this.g,this.h)};h.setData=function(a){Zf(this.g,this.h,a)};h.V=function(a){this.g.m=a};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h;this.g.J=this.g.j};function mf(a){Y.call(this,a,255,128,8,0)}t(mf,Y);h=mf.prototype;
  h.X=function(a){Q(this.g,4);this.g.l[a]-=ag[a];return this.h=this.g.l[a]};h.getData=function(){return V(this.g,this.h)};h.setData=function(a){Yf(this.g,this.h,a)};h.V=function(a){this.g.m=a<<24>>24};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h<<24>>24;this.g.J=this.g.j<<24>>24};function nf(a){Y.call(this,a,65535,32768,16,0)}t(nf,Y);h=nf.prototype;h.X=function(a){Q(this.g,4);this.g.l[a]-=2;return this.h=this.g.l[a]};h.getData=function(){return T(this.g,this.h)};
  h.setData=function(a){oe(this.g,this.h,a)};h.V=function(a){this.g.m=a<<16>>16};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h<<16>>16;this.g.J=this.g.j<<16>>16};function of(a){Y.call(this,a,4294967295,2147483648,32,1)}t(of,Y);h=of.prototype;h.X=function(a){Q(this.g,8);this.g.l[a]-=4;return this.h=this.g.l[a]};h.getData=function(){return R(this.g,this.h)};h.setData=function(a){Zf(this.g,this.h,a)};h.V=function(a){this.g.m=a};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h;this.g.J=this.g.j};
  function pf(a){Y.call(this,a,255,128,8,0)}t(pf,Y);h=pf.prototype;h.X=function(a){Q(this.g,8);return this.h=this.g.l[a]+N(this.g)};h.ga=function(){this.h+=1};h.getData=function(){return V(this.g,this.h)};h.setData=function(a){Yf(this.g,this.h,a)};h.V=function(a){this.g.m=a<<24>>24};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h<<24>>24;this.g.J=this.g.j<<24>>24};function qf(a){Y.call(this,a,65535,32768,16,0)}t(qf,Y);h=qf.prototype;h.X=function(a){Q(this.g,8);return this.h=this.g.l[a]+N(this.g)};
  h.ga=function(){this.h+=2};h.getData=function(){return T(this.g,this.h)};h.setData=function(a){oe(this.g,this.h,a)};h.V=function(a){this.g.m=a<<16>>16};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h<<16>>16;this.g.J=this.g.j<<16>>16};function rf(a){Y.call(this,a,4294967295,2147483648,32,1)}t(rf,Y);h=rf.prototype;h.X=function(a){Q(this.g,12);return this.h=this.g.l[a]+N(this.g)};h.ga=function(){this.h+=4};h.getData=function(){return R(this.g,this.h)};h.setData=function(a){Zf(this.g,this.h,a)};
  h.V=function(a){this.g.m=a};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h;this.g.J=this.g.j};function sf(a){Y.call(this,a,255,128,8,0)}t(sf,Y);h=sf.prototype;h.X=function(a){Q(this.g,10);return this.h=Qg(this,this.g.l[a])};h.ga=function(){this.h+=1};h.getData=function(){return V(this.g,this.h)};h.setData=function(a){Yf(this.g,this.h,a)};h.V=function(a){this.g.m=a<<24>>24};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h<<24>>24;this.g.J=this.g.j<<24>>24};
  function tf(a){Y.call(this,a,65535,32768,16,0)}t(tf,Y);h=tf.prototype;h.X=function(a){Q(this.g,10);return this.h=Qg(this,this.g.l[a])};h.ga=function(){this.h+=2};h.getData=function(){return T(this.g,this.h)};h.setData=function(a){oe(this.g,this.h,a)};h.V=function(a){this.g.m=a<<16>>16};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h<<16>>16;this.g.J=this.g.j<<16>>16};function uf(a){Y.call(this,a,4294967295,2147483648,32,1)}t(uf,Y);h=uf.prototype;
  h.X=function(a){Q(this.g,14);return this.h=Qg(this,this.g.l[a])};h.ga=function(){this.h+=4};h.getData=function(){return R(this.g,this.h)};h.setData=function(a){Zf(this.g,this.h,a)};h.V=function(a){this.g.m=a};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h;this.g.J=this.g.j};function vf(a){Y.call(this,a,255,128,8,0)}t(vf,Y);h=vf.prototype;h.X=function(){Q(this.g,8);return this.h=N(this.g)};h.ga=function(){this.h+=1};h.getData=function(){return V(this.g,this.h)};
  h.setData=function(a){Yf(this.g,this.h,a)};h.V=function(a){this.g.m=a<<24>>24};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h<<24>>24;this.g.J=this.g.j<<24>>24};function wf(a){Y.call(this,a,65535,32768,16,0)}t(wf,Y);h=wf.prototype;h.X=function(){Q(this.g,8);return this.h=N(this.g)};h.ga=function(){this.h+=2};h.getData=function(){return T(this.g,this.h)};h.setData=function(a){oe(this.g,this.h,a)};h.V=function(a){this.g.m=a<<16>>16};
  h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h<<16>>16;this.g.J=this.g.j<<16>>16};function xf(a){Y.call(this,a,4294967295,2147483648,32,1)}t(xf,Y);h=xf.prototype;h.X=function(){Q(this.g,12);return this.h=N(this.g)};h.ga=function(){this.h+=4};h.getData=function(){return R(this.g,this.h)};h.setData=function(a){Zf(this.g,this.h,a)};h.V=function(a){this.g.m=a};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h;this.g.J=this.g.j};function yf(a){Y.call(this,a,255,128,8,0)}t(yf,Y);h=yf.prototype;
  h.X=function(){Q(this.g,12);return this.h=$f(this.g)};h.ga=function(){this.h+=1};h.getData=function(){return V(this.g,this.h)};h.setData=function(a){Yf(this.g,this.h,a)};h.V=function(a){this.g.m=a<<24>>24};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h<<24>>24;this.g.J=this.g.j<<24>>24};function zf(a){Y.call(this,a,65535,32768,16,0)}t(zf,Y);h=zf.prototype;h.X=function(){Q(this.g,12);return this.h=$f(this.g)};h.ga=function(){this.h+=2};h.getData=function(){return T(this.g,this.h)};
  h.setData=function(a){oe(this.g,this.h,a)};h.V=function(a){this.g.m=a<<16>>16};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h<<16>>16;this.g.J=this.g.j<<16>>16};function Af(a){Y.call(this,a,4294967295,2147483648,32,1)}t(Af,Y);h=Af.prototype;h.X=function(){Q(this.g,16);return this.h=$f(this.g)};h.ga=function(){this.h+=4};h.getData=function(){return R(this.g,this.h)};h.setData=function(a){Zf(this.g,this.h,a)};h.V=function(a){this.g.m=a};
  h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h;this.g.J=this.g.j};function Bf(a){Y.call(this,a,255,128,8,0)}t(Bf,Y);h=Bf.prototype;h.X=function(){Q(this.g,8);return this.h=this.g.u+N(this.g)};h.ga=function(){this.h+=1};h.getData=function(){return V(this.g,this.h)};h.setData=function(a){Yf(this.g,this.h,a)};h.V=function(a){this.g.m=a<<24>>24};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h<<24>>24;this.g.J=this.g.j<<24>>24};function Cf(a){Y.call(this,a,65535,32768,16,0)}t(Cf,Y);h=Cf.prototype;
  h.X=function(){Q(this.g,8);return this.h=this.g.u+N(this.g)};h.ga=function(){this.h+=2};h.getData=function(){return T(this.g,this.h)};h.setData=function(a){oe(this.g,this.h,a)};h.V=function(a){this.g.m=a<<16>>16};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h<<16>>16;this.g.J=this.g.j<<16>>16};function Df(a){Y.call(this,a,4294967295,2147483648,32,1)}t(Df,Y);h=Df.prototype;h.X=function(){Q(this.g,12);return this.h=this.g.u+N(this.g)};h.ga=function(){this.h+=4};
  h.getData=function(){return R(this.g,this.h)};h.setData=function(a){Zf(this.g,this.h,a)};h.V=function(a){this.g.m=a};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h;this.g.J=this.g.j};function Ef(a){Y.call(this,a,255,128,8,0)}t(Ef,Y);h=Ef.prototype;h.X=function(){Q(this.g,10);return this.h=Qg(this,this.g.u)};h.ga=function(){this.h+=1};h.getData=function(){return V(this.g,this.h)};h.setData=function(a){Yf(this.g,this.h,a)};h.V=function(a){this.g.m=a<<24>>24};
  h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h<<24>>24;this.g.J=this.g.j<<24>>24};function Ff(a){Y.call(this,a,65535,32768,16,0)}t(Ff,Y);h=Ff.prototype;h.X=function(){Q(this.g,10);return this.h=Qg(this,this.g.u)};h.ga=function(){this.h+=2};h.getData=function(){return T(this.g,this.h)};h.setData=function(a){oe(this.g,this.h,a)};h.V=function(a){this.g.m=a<<16>>16};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h<<16>>16;this.g.J=this.g.j<<16>>16};
  function Gf(a){Y.call(this,a,4294967295,2147483648,32,1)}t(Gf,Y);h=Gf.prototype;h.X=function(){Q(this.g,14);return this.h=Qg(this,this.g.u)};h.ga=function(){this.h+=4};h.getData=function(){return R(this.g,this.h)};h.setData=function(a){Zf(this.g,this.h,a)};h.V=function(a){this.g.m=a};h.$=function(){this.g.H=this.g.m;this.g.v=this.g.h;this.g.J=this.g.j};function Hf(a){Y.call(this,a,255,128,8,0);this.oa=2}t(Hf,Y);h=Hf.prototype;h.X=function(){Q(this.g,4);this.h=this.g.u+1;this.g.u+=2;return this.h};
  h.getData=function(){return V(this.g,this.h)};h.K=function(){Q(this.g,4);this.h=this.g.u+1;return N(this.g)<<24>>24};h.setData=function(){};h.V=function(){};h.$=function(){};function If(a){Y.call(this,a,65535,32768,16,0);this.oa=2}t(If,Y);h=If.prototype;h.X=function(){Q(this.g,4);this.h=this.g.u;this.g.u+=2;return this.h};h.getData=function(){return T(this.g,this.h)};h.K=function(){Q(this.g,4);this.h=this.g.u;return N(this.g)};h.setData=function(){};h.V=function(){};h.$=function(){};
  function Jf(a){Y.call(this,a,4294967295,2147483648,32,1);this.oa=2}t(Jf,Y);h=Jf.prototype;h.X=function(){Q(this.g,8);this.h=this.g.u;this.g.u+=4;return this.h};h.getData=function(){return R(this.g,this.h)};h.K=function(){Q(this.g,8);this.h=this.g.u;return $f(this.g)};h.setData=function(){};h.V=function(){};h.$=function(){};function Rg(a,b,c){Xc.call(this,a,b,c);J(this,"Input");this.l=rb(this,this.M.bus);Yc(this.l,Sg,Tg,K.Xa,this);this.Ea()}t(Rg,Xc);h=Rg.prototype;
  h.Ja=function(a){return a&&(a=a.shift(),this.ja==a)?!0:!1};h.La=function(a){a.push(this.ja)};h.Ea=function(){for(var a in Ug)this.aa("reset byte I/O register 0x%08x to 0x%02x\n",Sg+a,Ug[a])};h.Ca=function(a){this.aa("PilotIO.readData(0x%08x): 0x%02x\n",Sg+a,0);return 0};h.ya=function(a,b){this.aa("PilotIO.writeData(0x%08x, 0x%02x)\n",Sg+a,b)};
  var Sg=4294963200,Tg=4096,Z={},Ug=(Z[519]=31,Z[1050]=255,Z[1058]=128,Z[1059]=128,Z[1066]=255,Z[1067]=255,Z[1074]=255,Z[1075]=255,Z[1090]=63,Z[1091]=63,Z[1098]=255,Z[1099]=2,Z[5]=10,Z[31]=127,Z[39]=64,Z[41]=10,Z[43]=63,Z[49]=185,Z);w.PilotIO=Rg;
  function Vg(a,b,c){tc.call(this,a,b,c);this.ca=this.M.bufferAddr;this.Vb=this.M.bufferRAM;this.De=this.M.bufferWidth;this.Ee=this.M.bufferHeight;this.cb=this.M.cellWidth||1;this.Tb=this.M.cellHeight||1;this.Z=this.M.bufferBits||1;this.Ce=this.M.bufferLeft||0;if(this.i=this.M.bufferRotate)this.i=this.i%360,0<this.i&&(this.i-=360),-90!=this.i&&(this.aa("unsupported buffer rotation: %d\n",this.i),this.i=0);this.ba=this.M.interruptRate;this.Da=this.M.refreshRate||60;this.J=rb(this,this.M.bus);this.o=
  this.De*this.cb;this.N=this.Ee*this.Tb;a=this.o;b=this.N;this.i&&(a=this.N,b=this.o);this.T=(this.o*this.Z>>3)*this.N;if(this.Vb||Yc(this.J,this.ca,this.T,K.Xa))this.W=this.J.l,this.na=this.H.createImageData(a,b),this.za=Math.trunc(this.W/this.Z),xc(this,Math.ceil(this.T/(this.W>>3))),this.v=document.createElement("canvas"),this.v.width=a,this.v.height=b,this.bb=this.v.getContext("2d"),this.S=1<<this.Z,this.L=Array(this.S+Wg),this.L[0]=[0,0,0,255],this.L[1]=[255,255,255,255],this.L[this.S+Xg]=[255,
  255,0,255],this.L[this.S+Yg]=[0,255,0,255],this.Ia&&(this.H[this.Ia]=null==this.ma?!1:this.ma);this.g=J(this,"CPU");this.time=J(this,"Time");this.Ta=Ib(this.time,this.ja,this.Fe.bind(this));this.time.T.push(this);Nb(this.time,this.Ta,1E3/Math.max(this.Da,this.ba));this.Aa=0}t(Vg,tc);Vg.prototype.bc=function(){this.time.h||yc(this)};function xc(a,b){a.ea=!1;b&&(a.ta=b,void 0===a.U||a.U.length!=a.ta)&&(a.U=Array(a.ta))}
  Vg.prototype.Fe=function(a){var b=!0;if(!a){this.ba&&120==this.ba&&this.Aa&1&&(b=!1);if(b&&this.ea&&this.T){a=this.J;var c=this.ca,d=this.T,e=!0,f=c>>>a.j;for(c=a.blockSize-(c&a.i);0<d&&f<a.h.length;){var g=a.h[f];g.U?(g.U=!1,g.J.type==Vc&&(g.i?(g.S=g.kc,g.v=g.nc,g.H=g.qc):(g.ya=g.kc,g.ka=g.nc,g.xa=g.qc)),g=!0):g=!1;g&&(e=!1);d-=c;c=a.blockSize;f++}e&&(b=!1)}Nb(this.time,this.Ta,1E3/Math.max(this.Da,this.ba));this.Aa++;if(!b)return}yc(this)};
  function yc(a){var b=a.ca,c=b+a.T,d=0,e=0,f=0,g=a.o,l=0,k=a.N,m=0,p=0,n=a.Z,r=(1<<n)-1;a.Ce&&(n=-n,p=a.W+n);for(var B=a.W/a.J.l|0;b<c;){var y=a.J.Ca(b);if(a.ea&&y===a.U[d])e+=a.za;else{a.U[d]=y;var z=p;z&&(y=y>>8|(y&255)<<8);e<g&&(g=e);for(var C=a.za;C--;){var v=y>>z&r,W=a.na,S=e++,Pc=v;v=a.i?(W.height-S-1)*W.width+f:S+f*W.width;Pc&&(208<=S&&236>S?Pc=a.S+Xg:28<=S&&72>S&&(Pc=a.S+Yg));S=a.L[Pc];v*=S.length;W.data[v]=S[0];W.data[v+1]=S[1];W.data[v+2]=S[2];W.data[v+3]=S[3];z+=n}e>l&&(l=e);f<k&&(k=f);
  f>=m&&(m=f+1)}b+=B;d++;if(e>=a.o&&(e=0,f++,f>a.N))break}a.ea=!0;g<a.o&&(b=l-g,m-=k,a.i&&(c=g,d=b,g=k,b=m,k=a.o-(c+d),m=d),a.bb.putImageData(a.na,0,0,g,k,b,m),a.H.drawImage(a.v,0,0,a.v.width,a.v.height,0,0,a.Y,a.R))}var Xg=0,Yg=1,Wg=2;w.PilotVideo=Vg;
  function Zg(a,b,c){H.call(this,a,a);var d=this;this.j=!1;this.u=c;this.i="";this.o=this.m=!1;xb(this,!1);this.Fa=u.Cd;b=b.trim();"{"==b[0]?$g(this,b):(this.i=b,Ua(this.i,function(e,f,g,l){4==g&&(!l&&f?($g(d,f),ah(d)):d.aa("error (%d) loading configuration: %s\n",l,e))}));window.addEventListener("load",function(){d.o=!0;ah(d)});window.addEventListener(Za("iOS")?"pagehide":Za("Opera")?"unload":"beforeunload",function(){bh(d)});window.addEventListener("pageshow",function(){d.j||d.Ga(!0)})}t(Zg,H);
  Zg.prototype.Ya=function(a,b){var c=this;switch(a){case ch:b.onclick=function(){c.Ga()};break;case dh:b.onclick=function(){c.Ea()}}H.prototype.Ya.call(this,a,b)};
  function ah(a){var b=!0;if(a.m&&a.o){for(var c in a.h){var d=void 0,e=a.h[c];try{d=e["class"],w[d]?"Machine"==d?(a.aa("PCjs %s v%3.2f\n%s\n",e.name,2,"Copyright \u00a9 2012-2022 Jeff Parsons <Jeff@pcjs.org>"),a.i&&a.aa("Configuration: %s\n",a.i)):new w[d](a.ha,c,e):a.aa('unrecognized %s device "%s"\n',d,c)}catch(g){e.optional||(a.aa('error initializing %s device "%s": %s\n',d,c,g.message),b=!1),zb(a,c)}}if(a.l){var f=$a(a);tb(a,function(g){return g.Fb&&!g.Fb(f)?(g.aa('unable to restore state for device "%s"\n',
  g.ja),!1):!0})}xb(a,!0);yb(a,a.Ga.bind(a,b))||a.aa("machine %s not ready to power, waiting for device(s)\n",a.ha)}}
  function $g(a,b){try{a.h=JSON.parse(b);var c=a.h[a.ha];if(!c){c=a.h[Ba(a.i)];if(!c)throw Error("configuration missing machine ID");a.h[a.ha]=c}sb(a,c,["autoSave","autoStart"]);a.l=!1!==a.M.autoSave;a.v=!1!==a.M.autoStart;if(a.u){var d=eval("("+a.u+")"),e;for(e in d)a.M[e]=d[e]}a.m=!0}catch(f){c=f.message,(d=c.match(/position ([0-9]+)/))&&(c+=" ('"+b.substr(+d[1],40).replace(/\s+/g," ")+"...')"),A(a,"machine '"+a.ha+"' initialization error: "+c)}}
  Zg.prototype.Ga=function(a){a=void 0===a?!this.j:a;if(wb(this)){var b=this;a&&A(this,"power on");tb(this,function(c){c.Ga&&c!=b&&("CPU"!=c.M["class"]||b.v||wb(b)?c.Ga(a):c.time.update(!0));return!0});(this.j=a)||A(this,"power off")}};Zg.prototype.Ea=function(){if(wb(this)){var a=this;tb(this,function(b){b.Ea&&b!=a&&b.Ea();return!0});A(this,"reset")}};function bh(a){if(a.l){var b=[];tb(a,function(c){c.fb&&c.fb(b);return!0});hb(a,b)}a.Ga(!1)}var ch="power",dh="reset";
  window.Pilot=function(a,b,c){var d=new Zg(a,b,c);window.command=function(e){return ab(d,e)};return d};w.Machine=Zg;})()
  
  //# sourceMappingURL=palm-pilot.js.map
  