Merge branch 'next-release'

This commit is contained in:
Jeff Parsons 2016-12-08 21:36:40 -08:00
commit 18b9ed7529
2 changed files with 22 additions and 16 deletions

View file

@ -242,25 +242,31 @@ SerialPortPDP11.prototype.setBinding = function(sType, sBinding, control, sValue
* brilliant (or rather, the opposite of brilliant), but that's life.
*/
event = event || window.event;
var bASCII = event.which || event.keyCode;
/*
* Perform the same remapping of ALT-ENTER (to LINE-FEED) that our VT100 emulation performs,
* for PCjs-wide consistency; see onKeyDown() in /modules/pc8080/lib/keyboard.js for details.
* Not sure why COMMAND-key combinations are coming through here (on Safari at least),
* but in any case, let's make sure we don't act on them.
*/
if (event.altKey) {
if (bASCII == Keys.ASCII.CTRL_M) {
bASCII = Keys.ASCII.CTRL_J;
if (!event.metaKey) {
var bASCII = event.which || event.keyCode;
/*
* Perform the same remapping of ALT-ENTER (to LINE-FEED) that our VT100 emulation performs,
* for PCjs-wide consistency; see onKeyDown() in /modules/pc8080/lib/keyboard.js for details.
*/
if (event.altKey) {
if (bASCII == Keys.ASCII.CTRL_M) {
bASCII = Keys.ASCII.CTRL_J;
}
}
serial.receiveData(bASCII);
/*
* Since we're going to remove the "readonly" attribute from the <textarea> control
* (so that the soft keyboard activates on iOS), instead of calling preventDefault() for
* selected keys (eg, the SPACE key, whose default behavior is to scroll the page), we must
* now call it for *all* keys, so that the keyCode isn't added to the control immediately,
* on top of whatever the machine is echoing back, resulting in double characters.
*/
if (event.preventDefault) event.preventDefault();
}
serial.receiveData(bASCII);
/*
* Since we're going to remove the "readonly" attribute from the <textarea> control
* (so that the soft keyboard activates on iOS), instead of calling preventDefault() for
* selected keys (eg, the SPACE key, whose default behavior is to scroll the page), we must
* now call it for *all* keys, so that the keyCode isn't added to the control immediately,
* on top of whatever the machine is echoing back, resulting in double characters.
*/
if (event.preventDefault) event.preventDefault();
return true;
};

View file

@ -186,7 +186,7 @@ function Tg(a,b,c,d,e,f){var g=!1,k=!1;if(null==c)for(var l=0;l<b.length-1;){var
b[l++]&255;if(m&255){G(a,"invalid checksum ("+q(m,2,!0)+") for block at offset "+v(n),4096);break}if(C)for(G(a,"loading "+v(C)+" bytes at "+v(t)+"-"+v(t+C),4096);C--;)a.w.Lb(t++,b[u++]&255);else t&1?g=!0:null==d&&(d=t),null!=d&&G(a,"starting address: "+v(d),4096);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e<b.length;e++)a.w.Lb(c+e,b[e]);k=!0}if(k){if(null==d||g)a.b.ea(),f=!1;null!=d&&Rd(a.b,d,f)}return k}
db(function(){for(var a=F(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=E(c),d=new Rg(d);tb(d,c)}});function Ug(a){z.call(this,"Keyboard",a,Ug,1024);J(this)}B(Ug);Ug.prototype.wa=function(){return!1};Ug.prototype.Ia=function(a,b,c,d){this.B=a;this.b=c;this.i=d};db(function(){for(var a=F(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=E(c),d=new Ug(d);tb(d,c)}});
function Vg(a){this.L=a.adapter;this.Y=a.baudReceive||9600;this.ya=a.baudTransmit||9600;this.va=a.upperCase;this.v=this.F=null;this.na=a.tabSize;this.ba=a.charBOL;this.G=0;this.K=!0;z.call(this,"SerialPort",a,Vg,262144);var b=a.binding;if("console"==b)this.F="";else{var c;a=Wg;b&&(void 0===c&&(c="Panel"),(c=sb(c,this.id))&&(b=c.D[b])&&this.wa(null,a,b))}this.A=this.P=this.S=null;this.exports={connect:this.bd,receiveData:this.nc,receiveStatus:this.We}}B(Vg);var Wg="buffer";h=Vg.prototype;
h.wa=function(a,b,c){var d=this;switch(b){case Wg:return this.D[b]=this.v=c,c.onkeydown=function(a){a=a||window.event;var b=0,c=a.keyCode;8==c?b=a.altKey?la.Kc:la.od:46==c?b=la.Kc:a.ctrlKey&&c>=la.Hc&&c<=la.vd&&(b=c-(la.Hc-la.ld));b&&(a.preventDefault&&a.preventDefault(),d.nc(b));return!0},c.onkeypress=function(a){a=a||window.event;var b=a.which||a.keyCode;a.altKey&&b==la.nd&&(b=la.md);d.nc(b);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();
h.wa=function(a,b,c){var d=this;switch(b){case Wg:return this.D[b]=this.v=c,c.onkeydown=function(a){a=a||window.event;var b=0,c=a.keyCode;8==c?b=a.altKey?la.Kc:la.od:46==c?b=la.Kc:a.ctrlKey&&c>=la.Hc&&c<=la.vd&&(b=c-(la.Hc-la.ld));b&&(a.preventDefault&&a.preventDefault(),d.nc(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==la.nd&&(b=la.md);d.nc(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();
a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.nc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};
h.Ia=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d;var e=this;this.ca=Qc(this.b,this.L?-1:48,4,262144);this.qa=Nc(this.b,function(){var a;a=-1;e.I.length&&(a=e.I.shift()&255,G(e,"receiveByte("+q(a,2,!0)+")"),e.va&&97<=a&&122>a&&(a-=32),Pc(e.b,e.qa,1E3/Math.round(e.Y/10)));0<=a&&(e.N=a,e.f&128?e.N|=49152:e.f|=128,e.f&64&&Oc(c,e.ca))});this.T=Qc(this.b,this.L?-1:52,4,262144);this.za=Nc(this.b,function(){e.g|=128;e.g&64&&Oc(c,e.T)});Ob(b,this,Xg,this.L?64832+8*(this.L-1)-65392:0);Qb(b,this.reset.bind(this));
J(this)};h.bd=function(a){if(!this.A){var b=Cd(this.B,"connection");if(b){var c=b.split("->");if(2==c.length){var d=va(c[0]);if(d!=this.rb)return;c=va(c[1]);if(this.A=rb(c)){var e=this.A.exports;if(e){var f=e.connect;f&&f.call(this.A,this.K);if(this.P=e.receiveData){this.K=a;this.S=e.receiveStatus;this.status(this.sb+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};