From 2ce025aa78471f93c85b496e468017a8aa42cc8e Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Sun, 19 Oct 2014 09:12:12 -0500 Subject: [PATCH] Debugger messageInt() tweaks --- my_modules/pcjs-client/lib/debugger.js | 15 ++++++++++----- versions/pcjs/1.15.5/pc-dbg.js | 6 +++--- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/my_modules/pcjs-client/lib/debugger.js b/my_modules/pcjs-client/lib/debugger.js index 3f3e2526a..fc8bab5af 100644 --- a/my_modules/pcjs-client/lib/debugger.js +++ b/my_modules/pcjs-client/lib/debugger.js @@ -1033,9 +1033,9 @@ if (DEBUGGER) { 0x13: { 0x00: "disk reset", 0x01: "get status", - 0x02: "read drive DL CH:DH:CL:AL into ES:BX", - 0x03: "write drive DL CH:DH:CL:AL from ES:BX", - 0x04: "verify drive DL CH:DH:CL:AL", + 0x02: "read drive DL (CH:DH:CL:AL) into ES:BX", + 0x03: "write drive DL (CH:DH:CL:AL) from ES:BX", + 0x04: "verify drive DL (CH:DH:CL:AL)", 0x05: "format drive DL using ES:BX", 0x08: "read drive DL parameters into ES:DI", 0x15: "get drive DL DASD type", @@ -1388,7 +1388,7 @@ if (DEBUGGER) { /* * TODO: Filtering of interrupt numbers below should be user-definable; this is very quick-and-dirty. */ - if (nInt < 0x20 && nInt != 0x10 && nInt != 0x15 && nInt != 0x16 && nInt != 0x1C) { + if (nInt < 0x20 && nInt != 0x10 && nInt != 0x15 && nInt != 0x16 && nInt != 0x1A && nInt != 0x1C) { var AH = this.cpu.regAX >> 8; var aFuncs = Debugger.INT_FUNCS[nInt]; var sFunc = (aFuncs && aFuncs[AH]) || ""; @@ -1411,7 +1411,12 @@ if (DEBUGGER) { */ Debugger.prototype.messageIntReturn = function(nInt, nLevel, nCycles, sResult) { - this.message("INT 0x" + str.toHexByte(nInt) + "(" + nLevel + "): C=" + (this.cpu.getCF()? 1 : 0) + (sResult || "") + " (cycles=" + nCycles + ")"); + /* + * TODO: Filtering of interrupt numbers below should be user-definable; this is very quick-and-dirty. + */ + if (nInt < 0x20 && nInt != 0x10 && nInt != 0x15 && nInt != 0x16 && nInt != 0x1A && nInt != 0x1C) { + this.message("INT 0x" + str.toHexByte(nInt) + "(" + nLevel + "): C=" + (this.cpu.getCF()? 1 : 0) + (sResult || "") + " (cycles=" + nCycles + ")"); + } }; /** diff --git a/versions/pcjs/1.15.5/pc-dbg.js b/versions/pcjs/1.15.5/pc-dbg.js index 92c854d6a..8002cd557 100644 --- a/versions/pcjs/1.15.5/pc-dbg.js +++ b/versions/pcjs/1.15.5/pc-dbg.js @@ -650,7 +650,7 @@ Ma:"state"},sm:{La:131072,Ma:"mouse"},mm:{La:262144,Ma:"computer"},nm:{La:524288 12419],1:[206,12419],2:[100,37027,4243],3:[117,37027,4243]},Zk=[[[6,12417,4097],[129,12417,4097],[5,12417,4097],[149,12417,4097],[7,12417,4097],[183,12417,4097],[190,12417,4097],[24,4225,4097]],[[6,12420,4100],[129,12420,4100],[5,12420,4100],[149,12420,4100],[7,12420,4100],[183,12420,4100],[190,12420,4100],[24,4228,4100]],[[6,12420,4098],[129,12420,4098],[5,12420,4098],[149,12420,4098],[7,12420,4098],[183,12420,4098],[190,12420,4098],[24,4228,4098]],[[145,45185,4097],[146,45185,4097],[139,45185,4097], [140,45185,4097],[169,45185,4097],[171,45185,4097],Z,[148,45185,4097]],[[145,45188,4097],[146,45188,4097],[139,45188,4097],[140,45188,4097],[169,45188,4097],[171,45188,4097],Z,[148,45188,4097]],[[145,12417,4113],[146,12417,4113],[139,12417,4113],[140,12417,4113],[169,12417,4113],[171,12417,4113],Z,[148,12417,4113]],[[145,12420,4113],[146,12420,4113],[139,12420,4113],[140,12420,4113],[169,12420,4113],[171,12420,4113],Z,[148,12420,4113]],[[145,12417,4449],[146,12417,4449],[139,12417,4449],[140,12417, 4449],[169,12417,4449],[171,12417,4449],Z,[148,12417,4449]],[[145,12420,4449],[146,12420,4449],[139,12420,4449],[140,12420,4449],[169,12420,4449],[171,12420,4449],Z,[148,12420,4449]],[[184,4225,4097],Z,[128,12417],[126,12417],[125,4225],[73,12417],[32,4225],[72,12417]],[[184,4228,4100],Z,[128,12420],[126,12420],[125,4228],[73,12420],[32,4228],[72,12420]],[[75,12417],[31,12417],Z,Z,Z,Z,Z,Z],[[75,12420],[31,12420],[17,4228],[17,4230],[88,4228],[88,4230],[136,4228],Z],[],[[174,8323],[182,8323],[109, -4227],[119,4227],[185,4227],[186,4227],Z,Z],[[168,8323],[173,8323],[106,4227],[108,4227],[175,8323],Z,[110,4227],Z]],$k={19:{0:"disk reset",1:"get status",2:"read drive DL CH:DH:CL:AL into ES:BX",3:"write drive DL CH:DH:CL:AL from ES:BX",4:"verify drive DL CH:DH:CL:AL",5:"format drive DL using ES:BX",8:"read drive DL parameters into ES:DI",21:"get drive DL DASD type",22:"get drive DL change line status",23:"set drive DL DASD type",24:"set drive DL media type"},21:{128:"open device",129:"close device", +4227],[119,4227],[185,4227],[186,4227],Z,Z],[[168,8323],[173,8323],[106,4227],[108,4227],[175,8323],Z,[110,4227],Z]],$k={19:{0:"disk reset",1:"get status",2:"read drive DL (CH:DH:CL:AL) into ES:BX",3:"write drive DL (CH:DH:CL:AL) from ES:BX",4:"verify drive DL (CH:DH:CL:AL)",5:"format drive DL using ES:BX",8:"read drive DL parameters into ES:DI",21:"get drive DL DASD type",22:"get drive DL change line status",23:"set drive DL DASD type",24:"set drive DL media type"},21:{128:"open device",129:"close device", 130:"program termination",131:"wait CX:DXus for event",132:"joystick support",133:"SYSREQ pressed",134:"wait CX:DXus",135:"move block (CX words)",136:"get extended memory size",137:"processor to virtual mode",144:"device busy loop",145:"interrupt complete flag set"},33:{0:"terminate program",1:"read character (al) from stdin with echo",2:"write character DL to stdout",3:"read character (al) from stdaux",4:"write character DL to stdaux",5:"write character DL to stdprn",6:"direct console output (input if DL=FF)", 7:"direct console input without echo",8:"read character (al) from stdin without echo",9:"write $-terminated string DS:DX to stdout",10:"buffered input (ds:dx)",11:"get stdin status",12:"flush buffer and read stdin",13:"disk reset",14:"select default drive DL",15:"open file using fcb DS:DX",16:"close file using fcb DS:DX",17:"find first matching file using fcb DS:DX",18:"find next matching file using fcb DS:DX",19:"delete file using fcb DS:DX",20:"sequential read from file using fcb DS:DX",21:"sequential write to file using fcb DS:DX", 22:"create or truncate file using fcb DS:DX",23:"rename file using fcb DS:DX",25:"get current default drive (al)",26:"set disk transfer area (dta) DS:DX",27:"get allocation information for default drive",28:"get allocation information for specific drive DL",31:"get drive parameter block for default drive",33:"read random record from file using fcb DS:DX",34:"write random record to file using fcb DS:DX",35:"get file size using fcb DS:DX",36:"set random record number for fcb DS:DX",37:"set address DS:DX of interrupt vector AL", @@ -662,8 +662,8 @@ Ma:"state"},sm:{La:131072,Ma:"mouse"},mm:{La:262144,Ma:"computer"},nm:{La:524288 k.nc=function(a,b,c){this.na=b;this.S=c;this.Da=a;this.Im=C(a,"FDC");this.Ek=C(a,"HDC");this.Gf=Xk;80186<=this.S.Fa&&(this.Gf=Xk.slice(),this.Gf[15]=Z,80286<=this.S.Fa&&(this.Gf[15]=Wk));Cc(this.S,33,this,this.Pn);this.Ta();if(this.Rj){a=al(this,this.Rj);delete this.Rj;for(var d in a)bl(this,a[d])}}; k.xb=function(a,b,c,d){var e=this;switch(c){case "debugInput":return this.Tf=this.sa[c]=d,d.onkeypress=function(a){if(13==a.keyCode){var b=d.value;d.value="";var c=al(e,b,!0);for(b in c)bl(e,c[b]);a.preventDefault&&a.preventDefault()}},!0;case "debugEnter":return this.sa[c]=d,xa(d,function(){if(e.Tf){var a=e.Tf.value;e.Tf.value="";var b=al(e,a,!0);for(a in b)bl(e,b[a]);return!0}return!1}),!0;case "step":return this.sa[c]=d,xa(d,function(a){var b=!1;Qa(e,!0)||(Pa(e,!0),b=e.wf(a?1:0),Pa(e,!1));return b}), !0}return!1};k.Md=function(){this.Tf&&this.Tf.focus()};function Ph(a,b,c,d){d&&(a.bi=[]);d=0;c=al(a,c);for(var e in Y)b[e]=Y[e].La,0<=c.indexOf(Y[e].Ma)&&(d|=Y[e].La,a.ca(Y[e].Ma+" messages enabled"));void 0===a.dc&&(a.dc=0);a.dc|=d}function Qh(a,b,c){for(var d in Y)if(b==Y[d].La){a.bi[d]=c;break}}function E(a,b){return(a.dc&b)===b} -function Ec(a,b,c){if(32>b&&16!=b&&21!=b&&22!=b&&28!=b){var d=a.S.G>>8,e=$k[b];if(e=e&&e[d]||""){var f=a.S;a.jb[X[0]]=r(f.G&255);a.jb[X[1]]=r(f.I&255);a.jb[X[2]]=r(f.J&255);a.jb[X[3]]=r(f.B&255);a.jb[X[4]]=r(f.G>>8);a.jb[X[5]]=r(f.I>>8);a.jb[X[6]]=r(f.J>>8);a.jb[X[7]]=r(f.B>>8);a.jb[X[8]]=u(f.G);a.jb[X[9]]=u(f.I);a.jb[X[10]]=u(f.J);a.jb[X[11]]=u(f.B);a.jb[X[12]]=u(f.Y);a.jb[X[13]]=u(f.H);a.jb[X[14]]=u(f.F);a.jb[X[15]]=u(f.D);a.jb[X[16]]=u(f.Za.oa);a.jb[X[17]]=u(f.ua.oa);a.jb[X[18]]=u(f.wb.oa);a.jb[X[19]]= -u(f.Eb.oa);a.jb[X[20]]=u(f.qa);e=" "+ia(a.jb,e)}a.message("INT 0x"+r(b)+": AH="+r(d)+" at "+da(c-a.S.ua.Ua,a.S.ua.oa)+e)}}function Gc(a,b,c,d,e){a.message("INT 0x"+r(b)+"("+c+"): C="+(Uc(a.S)?1:0)+(e||"")+" (cycles="+d+")")} +function Ec(a,b,c){if(32>b&&16!=b&&21!=b&&22!=b&&26!=b&&28!=b){var d=a.S.G>>8,e=$k[b];if(e=e&&e[d]||""){var f=a.S;a.jb[X[0]]=r(f.G&255);a.jb[X[1]]=r(f.I&255);a.jb[X[2]]=r(f.J&255);a.jb[X[3]]=r(f.B&255);a.jb[X[4]]=r(f.G>>8);a.jb[X[5]]=r(f.I>>8);a.jb[X[6]]=r(f.J>>8);a.jb[X[7]]=r(f.B>>8);a.jb[X[8]]=u(f.G);a.jb[X[9]]=u(f.I);a.jb[X[10]]=u(f.J);a.jb[X[11]]=u(f.B);a.jb[X[12]]=u(f.Y);a.jb[X[13]]=u(f.H);a.jb[X[14]]=u(f.F);a.jb[X[15]]=u(f.D);a.jb[X[16]]=u(f.Za.oa);a.jb[X[17]]=u(f.ua.oa);a.jb[X[18]]=u(f.wb.oa); +a.jb[X[19]]=u(f.Eb.oa);a.jb[X[20]]=u(f.qa);e=" "+ia(a.jb,e)}a.message("INT 0x"+r(b)+": AH="+r(d)+" at "+da(c-a.S.ua.Ua,a.S.ua.oa)+e)}}function Gc(a,b,c,d,e){32>b&&16!=b&&21!=b&&22!=b&&26!=b&&28!=b&&a.message("INT 0x"+r(b)+"("+c+"): C="+(Uc(a.S)?1:0)+(e||"")+" (cycles="+d+")")} k.ba=function(a,b,c,d,e,f,g){f||(f=0);f|=Y.bk.La;if(null==d||(this.dc&f)==f)f=null,null!=d&&(f=this.S.ua.oa,d-=this.S.ua.Ua),this.message(a.sh+"."+(null!=c?"outPort":"inPort")+"(0x"+u(b)+","+(e?e:"unknown")+(null!=c?",0x"+r(c):"")+")"+(null!=g?": 0x"+r(g):"")+(null!=d?" at "+da(d,f):""))};k.message=function(a){this.ca(a);this.S&&(this.dc&Y.qm.La&&this.S.Ab(),a=this.S,a.of=0,a.Oc-=a.A,a.A=0,a.eh())};k.Pn=function(a){E(this,this.pm)&&Ec(this,33,a);return!0};k.Ln=function(){this.ca("Type ? for list of debugger commands")}; function Sk(a){var b;if(jd(a)){if(!a.Ud||!a.Ud.length){a.Ud=Array(1E4);for(b=0;b