add opcode and machine state info to status panel, add Fetch Execute and State pseudo signals to log tabulation

This commit is contained in:
BigEd 2010-11-22 13:27:26 +00:00
parent cdd837dd0c
commit 398060f56b

View File

@ -28,11 +28,12 @@ var running = false;
var logThese=[]; var logThese=[];
var presetLogLists=[ var presetLogLists=[
['cycle'], ['cycle'],
['ab','db','rw','sync','pc','a','x','y','s','p'], ['ab','db','rw','Fetch','pc','a','x','y','s','p'],
['Execute','State'],
['ir','tcstate','-pd'], ['ir','tcstate','-pd'],
['adl','adh','sb','alu'], ['adl','adh','sb','alu'],
['alucin','alua','alub','alucout','aluvout','dasb'], ['alucin','alua','alub','alucout','aluvout','dasb'],
['plaOutputs'], ['plaOutputs','DPControl'],
['idb','dor'], ['idb','dor'],
['irq','nmi','res'], ['irq','nmi','res'],
]; ];
@ -315,6 +316,7 @@ function readBits(name, n){
function busToString(busname){ function busToString(busname){
// takes a signal name or prefix // takes a signal name or prefix
// returns an appropriate string representation // returns an appropriate string representation
// some 'signal names' are CPU-specific aliases to user-friendly string output
if(busname=='cycle') if(busname=='cycle')
return cycle>>1; return cycle>>1;
if(busname=='pc') if(busname=='pc')
@ -323,6 +325,12 @@ function busToString(busname){
return readPstring(); return readPstring();
if(busname=='tcstate') if(busname=='tcstate')
return ['clock1','clock2','t2','t3','t4','t5'].map(busToHex).join(""); return ['clock1','clock2','t2','t3','t4','t5'].map(busToHex).join("");
if(busname=='State')
return listActiveTCStates();
if(busname=='Execute')
return dis6502[readBits('ir',8)];
if(busname=='Fetch')
return isNodeHigh(nodenames['sync'])?dis6502[readDataBus()]:'';
if(busname=='plaOutputs') if(busname=='plaOutputs')
// PLA outputs are mostly ^op- but some have a prefix too // PLA outputs are mostly ^op- but some have a prefix too
// - we'll allow the x and xx prefix but ignore the # // - we'll allow the x and xx prefix but ignore the #
@ -451,18 +459,14 @@ function chipStatus(){
' Y:' + hexByte(readY()) + ' Y:' + hexByte(readY()) +
' SP:' + hexByte(readSP()) + ' SP:' + hexByte(readSP()) +
' ' + readPstring(); ' ' + readPstring();
var machine3 = ''; var machine3 =
machine3 += 'State: ' + listActiveTCStates() + ' '; 'Hz: ' + estimatedHz().toFixed(1) +
machine3 += 'Execute: ' + dis6502[readBits('ir',8)]; ' Exec: ' + busToString('Execute') + '(' + busToString('State') + ')';
if(isNodeHigh(nodenames['sync'])) if(isNodeHigh(nodenames['sync']))
machine3 += ' (Fetch: ' + dis6502[readDataBus()] + ')'; machine3 += ' (Fetch: ' + busToString('Fetch') + ')';
var chk='';
if(goldenChecksum != undefined) if(goldenChecksum != undefined)
chk=" Chk:" + traceChecksum + ((traceChecksum==goldenChecksum)?" OK":" no match"); machine3 += " Chk:" + traceChecksum + ((traceChecksum==goldenChecksum)?" OK":" no match");
setStatus( setStatus(machine1, machine2, machine3);
machine1, machine2, machine3,
"Hz: " + estimatedHz().toFixed(1) + chk
);
if (loglevel>0) { if (loglevel>0) {
updateLogbox(logThese); updateLogbox(logThese);
} }