Support for true physical memory aliases
This commit is contained in:
parent
bc153c3016
commit
7085b72fc4
28 changed files with 2185 additions and 2047 deletions
|
|
@ -71,12 +71,12 @@ e.Hc=function(){this.b=this.a[this.d++]+this.k&255;this.c=this.e-this.a[this.b]-
|
|||
e.wg=function(){this.v|=8;this.r[97]=this.be;this.r[101]=this.de;this.r[105]=this.ae;this.r[109]=this.Yd;this.r[113]=this.ce;this.r[117]=this.ee;this.r[121]=this.$d;this.r[125]=this.Zd;this.r[225]=this.rg;this.r[229]=this.tg;this.r[233]=this.qg;this.r[237]=this.ng;this.r[241]=this.sg;this.r[245]=this.ug;this.r[249]=this.pg;this.r[253]=this.og};
|
||||
e.Cc=function(){this.b=(this.a[this.d++]|this.a[this.d++]<<8)+this.n;this.c=this.e-this.a[this.b]-(this.c&256?0:1);this.A=this.e^this.a[this.b];this.s=this.c;this.f=this.g=this.e=this.c&255;this.c^=256};e.pg=function(){this.b=(this.a[this.d++]|this.a[this.d++]<<8)+this.n;this.e=R(this,this.e,this.a[this.b])};
|
||||
e.Bc=function(){this.b=(this.a[this.d++]|this.a[this.d++]<<8)+this.k;this.c=this.e-this.a[this.b]-(this.c&256?0:1);this.A=this.e^this.a[this.b];this.s=this.c;this.f=this.g=this.e=this.c&255;this.c^=256};e.og=function(){this.b=(this.a[this.d++]|this.a[this.d++]<<8)+this.k;this.e=R(this,this.e,this.a[this.b])};e.kf=function(){this.h=(this.a[this.d++]|this.a[this.d++]<<8)+this.k;this.f=this.g=this.a[this.h]=this.a[this.h]+1&255};
|
||||
e.Lg=function(){var a;a=this.a[this.d++];switch(a){case this.xd:this.u("HALT");M(this);break;case this.yd:a=this.d;for(var b="";a<this.a.length;){var c=this.a[a++];if(!c)break;b+=String.fromCharCode(c)}this.d=a;b=b.replace(/%A/g,n(this.e,2)).replace(/%X/g,n(this.k,2)).replace(/%Y/g,n(this.n,2));this.u(b);this.ka=0;this.Y-=this.C;this.C=0;break;default:this.d-=2,this.u("undefined opSim: "+n(a,2)+" at "+n(this.d,4)),M(this)}};
|
||||
e.i=function(){var a=this.a[--this.d];this.u("undefined opcode: "+n(a,2)+" at "+n(this.d,4));M(this)};y(function(){for(var a=I(window.document,"c1pjs","cpu"),b=0;b<a.length;b++){var c=a[b],d=G(c),d=new na(d);H(d,c)}});
|
||||
e.Lg=function(){var a;a=this.a[this.d++];switch(a){case this.xd:this.u("HALT");M(this);break;case this.yd:a=this.d;for(var b="";a<this.a.length;){var c=this.a[a++];if(!c)break;b+=String.fromCharCode(c)}this.d=a;b=b.replace(/%A/g,n(this.e,2)).replace(/%X/g,n(this.k,2)).replace(/%Y/g,n(this.n,2));this.u(b);this.ka=0;this.Y-=this.C;this.C=0;break;default:this.d-=2,this.u("undefined opSim: 0x"+n(a,2)+" at "+("0x"+n(this.d,4))),M(this)}};
|
||||
e.i=function(){var a=this.a[--this.d];this.u("undefined opcode: 0x"+n(a,2)+" at "+("0x"+n(this.d,4)));M(this)};y(function(){for(var a=I(window.document,"c1pjs","cpu"),b=0;b<a.length;b++){var c=a[b],d=G(c),d=new na(d);H(d,c)}});
|
||||
function S(a){B.call(this,"C1PROM",a);this.V=this.a=null;this.ha=a.size;if(this.Aa=a.image){a=this.Aa;var b;b=this.Aa;var c="",d=b.lastIndexOf(".");0<=d&&(c=b.substr(d+1).toLowerCase());b=c;"json"!=b&&"hex"!=b&&(a="http://"+(window?window.location.host:"www.pcjs.org")+"/api/v1/dump?file="+this.Aa+"&format=bytes");r(a,this,this.Jd)}}E(S);
|
||||
S.prototype.Q=function(a,b,c,d){this.a=a;this.wb=b;a=c-b+1;this.ha||(this.ha=a);a!=this.ha?la(this,"computer-specified ROM size ("+n(a,4)+") does not match component-specified size ("+n(this.ha,4)+")"):(d&&(this.t=d,O(d,b,c,this,this.M)),za(this))};S.prototype.T=function(a){a&&!this.m.B&&(this.m.B=!0)};S.prototype.M=function(a,b){if(void 0!==b){var c=a-this.wb;this.a[this.wb+c]=this.V?this.V[c]:0}};
|
||||
S.prototype.Q=function(a,b,c,d){this.a=a;this.wb=b;a=c-b+1;this.ha||(this.ha=a);a!=this.ha?la(this,"computer-specified ROM size (0x"+n(a,4)+") does not match component-specified size ("+("0x"+n(this.ha,4))+")"):(d&&(this.t=d,O(d,b,c,this,this.M)),za(this))};S.prototype.T=function(a){a&&!this.m.B&&(this.m.B=!0)};S.prototype.M=function(a,b){if(void 0!==b){var c=a-this.wb;this.a[this.wb+c]=this.V?this.V[c]:0}};
|
||||
S.prototype.Jd=function(a,b,c){if(c)this.u('Error loading ROM "'+a+'" ('+c+")");else{if("["==b.charAt(0)||"{"==b.charAt(0))try{var d=eval("("+b+")"),f=d.bytes;this.V=f?f:d}catch(g){this.u('Error processing ROM "'+a+'": '+g.message);return}else for(a=b.replace(/\n/gm," ").replace(/ +$/,"").split(" "),this.V=Array(a.length),b=0;b<a.length;b++)this.V[b]=parseInt(a[b],16);za(this)}};
|
||||
function za(a){if(!J(a))if(!a.Aa)a.K();else if(a.V&&a.a){var b=a.V.length;if(b!=a.ha)la(a,"ROM image size ("+n(b,4)+") does not match component-specified size ("+n(a.ha,4)+")");else{for(var c=0;c<b;c++)a.a[a.wb+c]=a.V[c];a.K()}}}y(function(){for(var a=I(window.document,"c1pjs","rom"),b=0;b<a.length;b++){var c=a[b],d=G(c),d=new S(d);H(d,c)}});function Aa(a){B.call(this,"C1PRAM",a)}E(Aa);Aa.prototype.Q=function(a){this.a=a;this.K()};
|
||||
function za(a){if(!J(a))if(!a.Aa)a.K();else if(a.V&&a.a){var b=a.V.length;if(b!=a.ha)la(a,"ROM image size (0x"+n(b,4)+") does not match component-specified size ("+("0x"+n(a.ha,4))+")");else{for(var c=0;c<b;c++)a.a[a.wb+c]=a.V[c];a.K()}}}y(function(){for(var a=I(window.document,"c1pjs","rom"),b=0;b<a.length;b++){var c=a[b],d=G(c),d=new S(d);H(d,c)}});function Aa(a){B.call(this,"C1PRAM",a)}E(Aa);Aa.prototype.Q=function(a){this.a=a;this.K()};
|
||||
y(function(){for(var a=I(window.document,"c1pjs","ram"),b=0;b<a.length;b++){var c=a[b],d=G(c),d=new Aa(d);H(d,c)}});
|
||||
function Ba(a){B.call(this,"C1PKeyboard",a);this.m.B=!1;this.pb=a.model;this.Fb=8;this.gd=9;this.ed=10;this.dd=13;this.fd=16;this.cd=17;this.$c=18;this.ad=20;this.Gb=27;this.bd=91;this.Xc=this.Fb;this.Yc=this.ed;this.Uc=this.dd;this.Ab=this.Gb;this.L=224;this.l=this.fd+this.L;this.Ga=this.cd+this.L;this.$a=this.$c+this.L;this.Bb=this.ad+this.L;this.zb=0+this.L;this.Vc=3;this.Wc=15;this.Fa=1;this.Ea=2;this.Da=4;this.oa=8;this.Ca=64;this.Za=this.Ea|this.Da|this.Ca;this.Qb=0;this.vd=1;this.ud=2;this.wd=
|
||||
3;this.td=4;this.Vd=8192;this.Sd=250;this.Td=100;this.Qd=300;this.ga=[];this.ga["break"]=this.zb;this.ga.esc=this.Ab;this.ga["ctrl-c"]=this.Vc;this.ga["ctrl-o"]=this.Wc;this.j=[];this.j[49]=30464;this.j[33]=30464+this.l;this.j[50]=30208;this.j[34]=30208+this.l;this.j[51]=29952;this.j[35]=29952+this.l;this.j[52]=29696;this.j[36]=29696+this.l;this.j[53]=29440;this.j[37]=29440+this.l;this.j[54]=29184;this.j[38]=29184+this.l;this.j[55]=28928;this.j[39]=28928+this.l;this.j[56]=26368;this.j[40]=26368+this.l;
|
||||
|
|
|
|||
Loading…
Reference in a new issue