Updated the PDP-11 SerialPort to support ALT-ENTER for LINE-FEED and ALT-DELETE for BACKSPACE, to stay in step with VT100 shortcuts
This commit is contained in:
parent
b1b992b432
commit
469d446ab7
14 changed files with 331 additions and 280 deletions
|
|
@ -29,8 +29,8 @@
|
|||
http://pcjs.org/modules/pc8080/lib/computer.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016
|
||||
*/
|
||||
var l,n={re:1,se:3,te:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,Eb:65,Mc:66,Oc:67,bc:68,E:69,Rc:70,Sc:71,Tc:72,Uc:73,ad:74,bd:75,dc:76,jd:77,kd:78,md:79,nd:80,Q:81,td:82,wd:83,Cd:84,Dd:85,Ed:86,Fd:87,Hd:88,Id:89,Pb:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Jd:97,af:98,bf:99,d:100,e:101,cf:102,df:103,ef:104,ff:105,gf:106,k:107,hf:108,
|
||||
jf:109,n:110,kf:111,p:112,q:113,r:114,lf:115,t:116,nf:117,pf:118,qf:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,ue:127};
|
||||
var l,n={pe:0,se:1,te:2,ue:3,ve:4,we:5,xe:6,ye:7,ze:8,Ae:9,Be:10,Ce:11,De:12,Ee:13,Fe:14,Ge:15,He:16,Ie:17,Je:18,Ke:19,Le:20,Me:21,Ne:22,Oe:23,Pe:24,Qe:25,Re:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,Eb:65,Mc:66,Oc:67,bc:68,E:69,Rc:70,Sc:71,Tc:72,Uc:73,ad:74,bd:75,dc:76,jd:77,kd:78,md:79,nd:80,Q:81,td:82,wd:83,Cd:84,Dd:85,Ed:86,Fd:87,
|
||||
Hd:88,Id:89,Pb:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Jd:97,Af:98,Bf:99,d:100,e:101,Cf:102,Df:103,Ef:104,Ff:105,Gf:106,k:107,Hf:108,If:109,n:110,Jf:111,p:112,q:113,r:114,Kf:115,t:116,Mf:117,Nf:118,Of:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,Se:127};
|
||||
function aa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
|
||||
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function ba(a,b,c){var d="";b?11<b&&(b=11):b=a&-65536?11:6;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;)d=String.fromCharCode((a&7)+48)+d,a>>=3;return(c?"0o":"")+d}function t(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function ca(a){return t(a,2,!0)}
|
||||
function u(a){return t(a,4,!0)}function da(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0<c&&(b=b.substr(0,c));return b}function fa(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ga(){var a=ia();return-1!==a.indexOf("pcjs.org",a.length-8)}var ka={"&":"&","<":"<",">":">",'"':""","'":"'"};function la(a){return a.replace(/[&<>"']/g,function(a){return ka[a]})}
|
||||
|
|
@ -120,7 +120,7 @@ J(this));this.b-=11},function(){this.i=id(this,L(this));this.b-=7},function(){P(
|
|||
40);this.b-=11},function(){fd(this)||(I(this,N(this)),this.b-=6);this.b-=5},function(){var a=N(this);Sc(this,a&255|this.ta&-256);this.i=a>>8;this.b-=10},function(){var a=M(this);fd(this)||I(this,a);this.b-=10},function(){this.ta&=-513;this.b-=4},function(){var a=M(this);fd(this)||(P(this,this.P),I(this,a),this.b-=6);this.b-=11},function(){P(this,Uc(this)&255|this.i<<8);this.b-=11},function(){this.i=ld(this,L(this));this.b-=7},function(){P(this,this.P);I(this,48);this.b-=11},function(){fd(this)&&(I(this,
|
||||
N(this)),this.b-=6);this.b-=5},function(){this.na=J(this)&65535;this.b-=5},function(){var a=M(this);fd(this)&&I(this,a);this.b-=10},function(){this.ta|=512;this.b-=4;Id(this)},function(){var a=M(this);fd(this)&&(P(this,this.P),I(this,a),this.b-=6);this.b-=11},Pd,function(){K(this,L(this));this.b-=7},function(){P(this,this.P);I(this,56);this.b-=11}];
|
||||
function R(a){x.call(this,"ChipSet",a,R,32768);var b=a.model;b&&!Qd[b]&&Qa("Unrecognized ChipSet model: "+b);this.u=Qd[b]||{};a.sound&&(this.ga=null,window&&(this.ga=window.AudioContext||window.webkitAudioContext),this.ga&&new this.ga);F(this)}A(R);
|
||||
var S={Ba:1978.1,Ad:{Ca:0,we:1,Ae:16,He:32,Qe:64,Pe:128,qb:14},Za:{Ca:1,Pc:1,sd:2,od:4,pd:16,qd:32,rd:64,qb:8},Bd:{Ca:2,ve:3,Ye:4,xe:8,Le:16,Me:32,Ne:64,ye:128,qb:0},Ue:{Ca:3},Se:{Ca:2,Ie:7},We:{Ca:3,Ze:1,Ve:2,Oe:4,Fe:8,ze:16,oe:32},Te:{Ca:4},Xe:{Ca:5,Be:1,Ce:2,De:4,Ee:8,$e:16}},T={Ba:100,La:{Ca:66,rc:1,gc:2,ld:4,Ke:8,Je:16,ic:32,hc:64,cc:128},Nc:{Ca:66,INIT:0},Ua:{Ca:194,qe:0,ac:16,ud:32,nc:48,Xc:0,Yc:32},Fb:{Ca:162,Re:0,$c:0,Wc:0,Zc:0,Vc:0},Ma:{Ge:{Ca:98},Ta:{Kc:0,Jc:1,xd:2,Gd:4,Qc:5,vd:6,yd:7},
|
||||
var S={Ba:1978.1,Ad:{Ca:0,Ue:1,Ye:16,ef:32,pf:64,nf:128,qb:14},Za:{Ca:1,Pc:1,sd:2,od:4,pd:16,qd:32,rd:64,qb:8},Bd:{Ca:2,Te:3,xf:4,Ve:8,jf:16,kf:32,lf:64,We:128,qb:0},tf:{Ca:3},rf:{Ca:2,ff:7},vf:{Ca:3,yf:1,uf:2,mf:4,cf:8,Xe:16,oe:32},sf:{Ca:4},wf:{Ca:5,Ze:1,$e:2,af:4,bf:8,zf:16}},T={Ba:100,La:{Ca:66,rc:1,gc:2,ld:4,hf:8,gf:16,ic:32,hc:64,cc:128},Nc:{Ca:66,INIT:0},Ua:{Ca:194,re:0,ac:16,ud:32,nc:48,Xc:0,Yc:32},Fb:{Ca:162,qf:0,$c:0,Wc:0,Zc:0,Vc:0},Ma:{df:{Ca:98},Ta:{Kc:0,Jc:1,xd:2,Gd:4,Qc:5,vd:6,yd:7},
|
||||
Gb:16383}},Qd={SI1978:S,VT100:T};R.prototype.oa=function(){return!1};R.prototype.Qa=function(a,b,c,d){this.w=b;this.b=c;this.H=d;this.A=a;this.I=ub(a,"Keyboard");this.J=ub(a,"SerialPort");this.video=ub(a,"Video");Gb(b,this,this.u.Kb);Ub(b,this,this.u.Lb);if(d){var e=this;Rd(d,16384,function(){for(var a="",b=0;b<e.F.length;b++)a&&(a+=b&&b%10?", ":",\n"),a+=u(e.F[b]);e.H.g(a)})}};R.prototype.Fa=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
R.prototype.Ja=function(a){return a?this.save():!0};S.INIT=[[S.Ad.qb,S.Za.qb,S.Bd.qb,0,0,0,0]];
|
||||
T.INIT=[[T.Nc.INIT,T.La.gc|T.La.ld],[T.Ua.Xc,T.Ua.Yc],[T.Fb.$c,T.Fb.Wc,T.Fb.Zc,T.Fb.Vc],[0,0,0,0,[11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11776,11784,11918,11776,11984,11888,11776,11808,11776,12E3,12E3,11901,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
|
||||
|
|
@ -135,7 +135,7 @@ l.je=function(a,b,c){E(this,a,b,c,"BRIGHTNESS");this.ja=b};l.me=function(a,b,c){
|
|||
l.ke=function(a,b,c){E(this,a,b,c,"DC011");b&T.Ua.ud?(b&=T.Ua.nc,this.N!=b&&(this.N=b,this.video&&(a=this.video,b=this.N==T.Ua.nc?50:60,ib(a,"updateRate("+b+")"),a.vc=b))):(b&=T.Ua.ac,this.L!=b&&(this.L=b,this.video&&(a=this.L==T.Ua.ac?132:80,b=this.video,ib(b,"updateDimensions("+a+","+(80<a&&this.K&T.La.gc?14:24)+")"),b.ba=a,b.qa=b.kc,80<a&&b.qa--,Td(b)&&Ud(b))))};S.Kb={0:R.prototype.Vd,1:R.prototype.Wd,2:R.prototype.Xd,3:R.prototype.Ud};
|
||||
S.Lb={2:R.prototype.ee,3:R.prototype.ge,4:R.prototype.fe,5:R.prototype.he,6:R.prototype.ie};T.Kb={66:R.prototype.Yd};T.Lb={66:R.prototype.je,98:R.prototype.me,162:R.prototype.le,194:R.prototype.ke};Oa(function(){for(var a=D(document,"pc8080","chipset"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new R(d);gb(d,c)}});
|
||||
function Vd(a){x.call(this,"ROM",a,Vd);this.A=null;this.B=a.addr;this.j=a.size;this.F=a.alias;this.u=a.file;this.D=da(this.u);if(this.u){a=this.u;var b=fa(this.D);"json"!=b&&"hex"!=b&&(a=ia()+"/api/v1/dump?file="+this.u+"&format=bytes&decimal=true");var c=this;ta(a,null,!0,function(a,b,f){Wd(c,a,b,f)})}}A(Vd);Vd.prototype.Qa=function(a,b,c,d){this.w=b;this.b=c;this.H=d;Xd(this)};
|
||||
Vd.prototype.Fa=function(){if(this.Da){if(this.H){var a=this.H,b=this.id,c=this.B,d=this.j,e=this.Da,f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var k=h.o,m=h.a;if(void 0!==k){var p=f,k=[k>>>0,g],q=pa(p,k,a.zc);0>q&&p.splice(-(q+1),0,k)}m&&(h.a=m.replace(/''/g,'"'))}a.D.push({mf:b,G:c,$d:d,Da:e,yc:f})}delete this.Da}return!0};Vd.prototype.Ja=function(){return!0};
|
||||
Vd.prototype.Fa=function(){if(this.Da){if(this.H){var a=this.H,b=this.id,c=this.B,d=this.j,e=this.Da,f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var k=h.o,m=h.a;if(void 0!==k){var p=f,k=[k>>>0,g],q=pa(p,k,a.zc);0>q&&p.splice(-(q+1),0,k)}m&&(h.a=m.replace(/''/g,'"'))}a.D.push({Lf:b,G:c,$d:d,Da:e,yc:f})}delete this.Da}return!0};Vd.prototype.Ja=function(){return!0};
|
||||
function Wd(a,b,c,d){if(d)a.ia("Unable to load system ROM (error "+d+": "+b+")");else{cb(a.hb,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var e=eval("("+c+")"),f=e.bytes,g=e.data;if(f)a.A=f;else if(g)for(a.A=Array(4*g.length),d=c=0;c<g.length;c++)a.A[d++]=g[c]&255,a.A[d++]=g[c]>>8&255,a.A[d++]=g[c]>>16&255,a.A[d++]=g[c]>>24&255;else a.A=e;a.Da=e.symbols;if(!a.A.length){w("Empty ROM: "+b);return}if(1==a.A.length){w(a.A[0]);return}}catch(h){a.ia("ROM data error: "+h.message);return}else for(b=c.replace(/\n/gm,
|
||||
" ").replace(/ +$/,"").split(" "),a.A=Array(b.length),e=0;e<b.length;e++)a.A[e]=aa(b[e],16);Xd(a)}}
|
||||
function Xd(a){if(!mb(a))if(!a.u)F(a);else if(a.A&&a.w){a.j||(a.j=a.A.length);if(a.A.length!=a.j)nb(a,"ROM size ("+t(a.A.length,8,!0)+") does not match specified size ("+t(a.j,8,!0)+")");else{var b;b=a.B;if(yb(a.w,b,a.j,bc)){var c;for(c=0;c<a.A.length;c++)Db(a.w,b+c,a.A[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.F?b.push(a.F):null!=a.F&&a.F.length&&(b=a.F);for(c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.w,g=d.j,h=[],k=d.B>>>f.ha;0<g&&k<f.W.length;)h.push(f.W[k++]),g-=f.Ia;f=d.w;d=d.j;g=0;for(e>>>=
|
||||
|
|
@ -147,7 +147,7 @@ m+=String.fromCharCode(q)}ae(a,m);break;default:c=!1}c?Od.call(d):e&&(a.g("\nCP/
|
|||
function be(a){x.call(this,"Keyboard",a,be,65536);(a=a.model)&&!ce[a]&&Qa("Unrecognized Keyboard8080 model: "+a);this.w=ce[a]||{};this.reset();F(this)}A(be);var de={};de[n.Eb]=37;de[n.bc]=39;de[n.dc]=32;
|
||||
var ee={Ba:1978.1,Nb:{},$b:de,tb:{},Ya:{"1p":49,"2p":50,coin:51,left:37,right:39,fire:32}},V={},W={Ba:100,Nb:(V[8]=3,V[n.nd]=5,V[n.md]=6,V[n.Id]=7,V[n.Cd]=8,V[n.Fd]=9,V[n.Q]=10,V[39]=16,V[221]=20,V[219]=21,V[n.Uc]=22,V[n.Dd]=23,V[n.td]=24,V[n.E]=25,V[49]=26,V[37]=32,V[40]=34,V[117]=35,V[19]=35,V[192]=36,V[189]=37,V[57]=38,V[55]=39,V[52]=40,V[51]=41,V[27]=42,V[38]=48,V[114]=49,V[112]=50,V[46]=51,V[187]=52,V[48]=53,V[56]=54,V[54]=55,V[53]=56,V[50]=57,V[9]=58,V[103]=64,V[115]=65,V[113]=66,V[96]=67,V[118]=
|
||||
68,V[220]=69,V[n.dc]=70,V[n.bd]=71,V[n.Sc]=72,V[n.Rc]=73,V[n.Eb]=74,V[104]=80,V[2013]=81,V[98]=82,V[97]=83,V[222]=85,V[186]=86,V[n.ad]=87,V[n.Tc]=88,V[n.bc]=89,V[n.wd]=90,V[110]=96,V[116]=97,V[101]=98,V[100]=99,V[13]=100,V[190]=101,V[188]=102,V[n.kd]=103,V[n.Mc]=104,V[n.Hd]=105,V[119]=106,V[105]=112,V[99]=113,V[102]=114,V[109]=115,V[191]=117,V[n.jd]=118,V[n[" "]]=119,V[n.Ed]=120,V[n.Oc]=121,V[n.Pb]=122,V[120]=123,V[17]=124,V[16]=125,V[20]=126,V),$b:{},tb:{},Ya:{"num-comma":116,"break":117,"line-feed":118,
|
||||
"no-scroll":119,setup:120},Lc:{Ca:130,INIT:127},Na:{Ca:130,gd:1,fd:2,ed:4,dd:8,hd:16,fc:32,ec:63,zd:64,pe:128,INIT:0},cd:127};W.tb={l4:W.Na.gd,l3:W.Na.fd,l2:W.Na.ed,l1:W.Na.dd,locked:W.Na.hd,local:W.Na.fc,online:~W.Na.fc,"caps-lock":512};var ce={SI1978:ee,VT100:W};
|
||||
"no-scroll":119,setup:120},Lc:{Ca:130,INIT:127},Na:{Ca:130,gd:1,fd:2,ed:4,dd:8,hd:16,fc:32,ec:63,zd:64,qe:128,INIT:0},cd:127};W.tb={l4:W.Na.gd,l3:W.Na.fd,l2:W.Na.ed,l1:W.Na.dd,locked:W.Na.hd,local:W.Na.fc,online:~W.Na.fc,"caps-lock":512};var ce={SI1978:ee,VT100:W};
|
||||
be.prototype.oa=function(a,b,c){var d=this,e=a+"-"+b;if(void 0===this.M[e]){if("led"==a&&this.w.tb[b])return this.M[e]=c,!0;switch(b){case "kbd":return c.onkeydown=function(a){return fe(d,a,!0)},c.onkeyup=function(a){return fe(d,a,!1)},c.onkeypress=function(a){a=a.keyCode;a>=n.Eb&&a<=n.Pb?d.u&515||(d.u|=512,ge(d,20,!0),he(d)):a>=n.Jd&&a<=n.z&&d.u&512&&(d.u&=-513,ge(d,20,!1),he(d));return!0},c.onpaste=function(a){a:{if(d.J&&d.J.fb&&(a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(),
|
||||
a=a.clipboardData||window.clipboardData)){ie(d.J,a.getData("Text"));a=!1;break a}a=!0}return a},!0;default:if(this.w.Ya&&void 0!==this.w.Ya[b])return this.M[e]=c,a=function(a,b){return function(c){c.preventDefault();ge(a,b,!0)}}(this,this.w.Ya[b]),b=function(a,b){return function(){ge(a,b,!1)}}(this,this.w.Ya[b]),"ontouchstart"in window?(c.ontouchstart=a,c.ontouchend=b):(c.onmousedown=a,c.onmouseup=c.onmouseout=b),!0}}return!1};
|
||||
be.prototype.Qa=function(a,b,c,d){this.A=a;this.b=c;this.H=d;var e=this;this.O=Kc(this.b,function(){je(e)});this.F=ub(a,"ChipSet");this.J=ub(a,"SerialPort");Gb(b,this,this.w.Kb);Ub(b,this,this.w.Lb)};be.prototype.Fa=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};be.prototype.Ja=function(a){return a?this.save():!0};W.INIT=[[W.Na.INIT,W.Lc.INIT,!1,0,-1]];l=be.prototype;l.reset=function(){this.j=[];this.u=0;this.w.INIT&&!this.restore(this.w.INIT)&&this.ia("reset error")};
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@
|
|||
http://pcjs.org/modules/pc8080/lib/computer.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016
|
||||
*/
|
||||
var l,m={vd:1,wd:3,xd:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,Wa:65,Sb:66,Ub:67,sb:68,E:69,Xb:70,Yb:71,Zb:72,$b:73,gc:74,hc:75,ub:76,oc:77,pc:78,sc:79,tc:80,Q:81,zc:82,Cc:83,Hc:84,Ic:85,Jc:86,Kc:87,Mc:88,Nc:89,kb:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Pc:97,fe:98,ge:99,d:100,e:101,he:102,ie:103,je:104,ke:105,le:106,k:107,me:108,
|
||||
ne:109,n:110,oe:111,p:112,q:113,r:114,pe:115,t:116,qe:117,re:118,se:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,yd:127};
|
||||
var l,m={td:0,wd:1,xd:2,yd:3,zd:4,Ad:5,Bd:6,Cd:7,Dd:8,Ed:9,Fd:10,Gd:11,Hd:12,Id:13,Jd:14,Kd:15,Ld:16,Md:17,Nd:18,Od:19,Pd:20,Qd:21,Rd:22,Sd:23,Td:24,Ud:25,Vd:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,Wa:65,Sb:66,Ub:67,sb:68,E:69,Xb:70,Yb:71,Zb:72,$b:73,gc:74,hc:75,ub:76,oc:77,pc:78,sc:79,tc:80,Q:81,zc:82,Cc:83,Hc:84,Ic:85,Jc:86,Kc:87,
|
||||
Mc:88,Nc:89,kb:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Pc:97,De:98,Ee:99,d:100,e:101,Fe:102,Ge:103,He:104,Ie:105,Je:106,k:107,Ke:108,Le:109,n:110,Me:111,p:112,q:113,r:114,Ne:115,t:116,Oe:117,Pe:118,Qe:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,Wd:127};
|
||||
function aa(a){var b=16,c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==
|
||||
e&&d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function p(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function ca(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0<c&&(b=b.substr(0,c));return b}function da(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}
|
||||
function ea(){var a=fa();return-1!==a.indexOf("pcjs.org",a.length-8)}var ga={"&":"&","<":"<",">":">",'"':""","'":"'"};function ha(a){return a.replace(/[&<>"']/g,function(a){return ga[a]})}function ia(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
|
||||
|
|
@ -109,7 +109,7 @@ function(){var a=Q(this);R(this,H(this));J(this,a);this.a-=18},function(){var a=
|
|||
P(this);Zb(this)&&(R(this,this.m),F(this,a),this.a-=6);this.a-=11},lc,function(){this.b=fc(this,O(this));this.a-=7},function(){R(this,this.m);F(this,40);this.a-=11},function(){this.o&128||(F(this,Q(this)),this.a-=6);this.a-=5},function(){var a=Q(this);Sb(this,a&255|this.B&-256);this.b=a>>8;this.a-=10},function(){var a=P(this);this.o&128||F(this,a);this.a-=10},function(){this.B&=-513;this.a-=4},function(){var a=P(this);this.o&128||(R(this,this.m),F(this,a),this.a-=6);this.a-=11},function(){R(this,
|
||||
Ub(this)&255|this.b<<8);this.a-=11},function(){this.b=dc(this,O(this));this.a-=7},function(){R(this,this.m);F(this,48);this.a-=11},function(){this.o&128&&(F(this,Q(this)),this.a-=6);this.a-=5},function(){this.s=H(this)&65535;this.a-=5},function(){var a=P(this);this.o&128&&F(this,a);this.a-=10},function(){this.B|=512;this.a-=4;gc(this)},function(){var a=P(this);this.o&128&&(R(this,this.m),F(this,a),this.a-=6);this.a-=11},lc,function(){N(this,O(this));this.a-=7},function(){R(this,this.m);F(this,56);
|
||||
this.a-=11}];function U(a){r.call(this,"ChipSet",a,U);var b=a.model;b&&!mc[b]&&Ca("Unrecognized ChipSet model: "+b);this.c=mc[b]||{};a.sound&&(this.I=null,window&&(this.I=window.AudioContext||window.webkitAudioContext),this.I&&new this.I);B(this)}w(U);
|
||||
var V={ba:1978.1,Fc:{ca:0,Ad:1,Ed:16,Ld:32,Ud:64,Td:128,Ka:14},Ca:{ca:1,Vb:1,yc:2,uc:4,vc:16,wc:32,xc:64,Ka:8},Gc:{ca:2,zd:3,ce:4,Bd:8,Pd:16,Qd:32,Rd:64,Cd:128,Ka:0},Yd:{ca:3},Wd:{ca:2,Md:7},$d:{ca:3,de:1,Zd:2,Sd:4,Jd:8,Dd:16,sd:32},Xd:{ca:4},ae:{ca:5,Fd:1,Gd:2,Hd:4,Id:8,ee:16}},X={ba:100,ja:{ca:66,Bb:1,qc:2,rc:4,Od:8,Nd:16,yb:32,xb:64,tb:128},Tb:{ca:66,INIT:0},za:{ca:194,ud:0,rb:16,Ac:32,zb:48,cc:0,dc:32},Xa:{ca:162,Vd:0,fc:0,bc:0,ec:0,ac:0},ma:{Kd:{ca:98},Ga:{Qb:0,Pb:1,Dc:2,Lc:4,Wb:5,Bc:6,be:7},
|
||||
var V={ba:1978.1,Fc:{ca:0,Yd:1,be:16,ie:32,re:64,qe:128,Ka:14},Ca:{ca:1,Vb:1,yc:2,uc:4,vc:16,wc:32,xc:64,Ka:8},Gc:{ca:2,Xd:3,Ae:4,Zd:8,me:16,ne:32,oe:64,$d:128,Ka:0},ve:{ca:3},te:{ca:2,je:7},xe:{ca:3,Be:1,we:2,pe:4,ge:8,ae:16,sd:32},ue:{ca:4},ye:{ca:5,ce:1,de:2,ee:4,fe:8,Ce:16}},X={ba:100,ja:{ca:66,Bb:1,qc:2,rc:4,le:8,ke:16,yb:32,xb:64,tb:128},Tb:{ca:66,INIT:0},za:{ca:194,vd:0,rb:16,Ac:32,zb:48,cc:0,dc:32},Xa:{ca:162,se:0,fc:0,bc:0,ec:0,ac:0},ma:{he:{ca:98},Ga:{Qb:0,Pb:1,Dc:2,Lc:4,Wb:5,Bc:6,ze:7},
|
||||
Za:16383}},mc={SI1978:V,VT100:X};U.prototype.T=function(){return!1};U.prototype.qa=function(a,b,c,d){this.i=b;this.a=c;this.M=d;this.w=a;this.l=C(a,"Keyboard");this.h=C(a,"SerialPort");this.video=C(a,"Video");hb(b,this,this.c.fb);jb(b,this,this.c.gb)};U.prototype.fa=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};U.prototype.ha=function(a){return a?this.save():!0};V.INIT=[[V.Fc.Ka,V.Ca.Ka,V.Gc.Ka,0,0,0,0]];
|
||||
X.INIT=[[X.Tb.INIT,X.ja.qc|X.ja.rc],[X.za.cc,X.za.dc],[X.Xa.fc,X.Xa.bc,X.Xa.ec,X.Xa.ac],[0,0,0,0,[11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11776,11784,11918,11776,11984,11888,11776,11808,11776,12E3,12E3,11901,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
|
||||
[11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11776,11784,11918,11808,11984,11856,11776,11808,11776,12E3,12E3,11881,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]];l=U.prototype;l.reset=function(){this.c.INIT&&!this.restore(this.c.INIT)&&this.K("reset error")};
|
||||
|
|
@ -132,7 +132,7 @@ n+=String.fromCharCode(z)}wc(a,n);break;default:c=!1}c?kc.call(d):e&&(a.da("\nCP
|
|||
function xc(a){r.call(this,"Keyboard",a,xc);(a=a.model)&&!yc[a]&&Ca("Unrecognized Keyboard8080 model: "+a);this.b=yc[a]||{};this.reset();B(this)}w(xc);var zc={};zc[m.Wa]=37;zc[m.sb]=39;zc[m.ub]=32;
|
||||
var Ac={ba:1978.1,jb:{},qb:zc,La:{},Ba:{"1p":49,"2p":50,coin:51,left:37,right:39,fire:32}},Y={},Z={ba:100,jb:(Y[8]=3,Y[m.tc]=5,Y[m.sc]=6,Y[m.Nc]=7,Y[m.Hc]=8,Y[m.Kc]=9,Y[m.Q]=10,Y[39]=16,Y[221]=20,Y[219]=21,Y[m.$b]=22,Y[m.Ic]=23,Y[m.zc]=24,Y[m.E]=25,Y[49]=26,Y[37]=32,Y[40]=34,Y[117]=35,Y[19]=35,Y[192]=36,Y[189]=37,Y[57]=38,Y[55]=39,Y[52]=40,Y[51]=41,Y[27]=42,Y[38]=48,Y[114]=49,Y[112]=50,Y[46]=51,Y[187]=52,Y[48]=53,Y[56]=54,Y[54]=55,Y[53]=56,Y[50]=57,Y[9]=58,Y[103]=64,Y[115]=65,Y[113]=66,Y[96]=67,Y[118]=
|
||||
68,Y[220]=69,Y[m.ub]=70,Y[m.hc]=71,Y[m.Yb]=72,Y[m.Xb]=73,Y[m.Wa]=74,Y[104]=80,Y[2013]=81,Y[98]=82,Y[97]=83,Y[222]=85,Y[186]=86,Y[m.gc]=87,Y[m.Zb]=88,Y[m.sb]=89,Y[m.Cc]=90,Y[110]=96,Y[116]=97,Y[101]=98,Y[100]=99,Y[13]=100,Y[190]=101,Y[188]=102,Y[m.pc]=103,Y[m.Sb]=104,Y[m.Mc]=105,Y[119]=106,Y[105]=112,Y[99]=113,Y[102]=114,Y[109]=115,Y[191]=117,Y[m.oc]=118,Y[m[" "]]=119,Y[m.Jc]=120,Y[m.Ub]=121,Y[m.kb]=122,Y[120]=123,Y[17]=124,Y[16]=125,Y[20]=126,Y),qb:{},La:{},Ba:{"num-comma":116,"break":117,"line-feed":118,
|
||||
"no-scroll":119,setup:120},Rb:{ca:130,INIT:127},ga:{ca:130,mc:1,lc:2,kc:4,jc:8,nc:16,wb:32,vb:63,Ec:64,td:128,INIT:0},ic:127};Z.La={l4:Z.ga.mc,l3:Z.ga.lc,l2:Z.ga.kc,l1:Z.ga.jc,locked:Z.ga.nc,local:Z.ga.wb,online:~Z.ga.wb,"caps-lock":512};var yc={SI1978:Ac,VT100:Z};
|
||||
"no-scroll":119,setup:120},Rb:{ca:130,INIT:127},ga:{ca:130,mc:1,lc:2,kc:4,jc:8,nc:16,wb:32,vb:63,Ec:64,ud:128,INIT:0},ic:127};Z.La={l4:Z.ga.mc,l3:Z.ga.lc,l2:Z.ga.kc,l1:Z.ga.jc,locked:Z.ga.nc,local:Z.ga.wb,online:~Z.ga.wb,"caps-lock":512};var yc={SI1978:Ac,VT100:Z};
|
||||
xc.prototype.T=function(a,b,c){var d=this,e=a+"-"+b;if(void 0===this.v[e]){if("led"==a&&this.b.La[b])return this.v[e]=c,!0;switch(b){case "kbd":return c.onkeydown=function(a){return Cc(d,a,!0)},c.onkeyup=function(a){return Cc(d,a,!1)},c.onkeypress=function(a){a=a.keyCode;a>=m.Wa&&a<=m.kb?d.c&515||(d.c|=512,Dc(d,20,!0),Ec(d)):a>=m.Pc&&a<=m.z&&d.c&512&&(d.c&=-513,Dc(d,20,!1),Ec(d));return!0},c.onpaste=function(a){a:{if(d.h&&d.h.Ea&&(a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(),
|
||||
a=a.clipboardData||window.clipboardData)){Fc(d.h,a.getData("Text"));a=!1;break a}a=!0}return a},!0;default:if(this.b.Ba&&void 0!==this.b.Ba[b])return this.v[e]=c,a=function(a,b){return function(c){c.preventDefault();Dc(a,b,!0)}}(this,this.b.Ba[b]),b=function(a,b){return function(){Dc(a,b,!1)}}(this,this.b.Ba[b]),"ontouchstart"in window?(c.ontouchstart=a,c.ontouchend=b):(c.onmousedown=a,c.onmouseup=c.onmouseout=b),!0}}return!1};
|
||||
xc.prototype.qa=function(a,b,c,d){this.w=a;this.a=c;this.M=d;var e=this;this.u=Jb(this.a,function(){Gc(e)});this.L=C(a,"ChipSet");this.h=C(a,"SerialPort");hb(b,this,this.b.fb);jb(b,this,this.b.gb)};xc.prototype.fa=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};xc.prototype.ha=function(a){return a?this.save():!0};Z.INIT=[[Z.ga.INIT,Z.Rb.INIT,!1,0,-1]];l=xc.prototype;l.reset=function(){this.i=[];this.c=0;this.b.INIT&&!this.restore(this.b.INIT)&&this.K("reset error")};
|
||||
|
|
|
|||
Loading…
Reference in a new issue