few small changes to prepare for multi-chip capability

This commit is contained in:
BigEd 2011-04-01 11:17:34 +00:00
parent 15b25491b9
commit 1d21f5ae8b
2 changed files with 9 additions and 7 deletions

View File

@ -96,7 +96,7 @@ function setup_part3(){
// which saves a lot of memory and allows us to run on small systems // which saves a lot of memory and allows us to run on small systems
updateChipLayoutVisibility(true); updateChipLayoutVisibility(true);
} }
setStatus('resetting 6502...'); setStatus('resetting ' + chipname + '...');
setTimeout(setup_part4, 0); setTimeout(setup_part4, 0);
} }
@ -195,9 +195,9 @@ function setupParams(){
} else } else
// setup input pin events, breakpoints, watchpoints // setup input pin events, breakpoints, watchpoints
if(name=="reset0" && parseInt(value)!=NaN){ if(name=="reset0" && parseInt(value)!=NaN){
clockTriggers[value]=[clockTriggers[value],"setLow('res');"].join(""); clockTriggers[value]=[clockTriggers[value],"setLow(nodenamereset);"].join("");
} else if(name=="reset1" && parseInt(value)!=NaN){ } else if(name=="reset1" && parseInt(value)!=NaN){
clockTriggers[value]=[clockTriggers[value],"setHigh('res');"].join(""); clockTriggers[value]=[clockTriggers[value],"setHigh(nodenamereset);"].join("");
} else if(name=="irq0" && parseInt(value)!=NaN){ } else if(name=="irq0" && parseInt(value)!=NaN){
clockTriggers[value]=[clockTriggers[value],"setLow('irq');"].join(""); clockTriggers[value]=[clockTriggers[value],"setLow('irq');"].join("");
} else if(name=="irq1" && parseInt(value)!=NaN){ } else if(name=="irq1" && parseInt(value)!=NaN){

View File

@ -26,6 +26,8 @@ var trace = Array();
var logstream = Array(); var logstream = Array();
var running = false; var running = false;
var logThese=[]; var logThese=[];
var chipname='6502';
var nodenamereset='res';
var presetLogLists=[ var presetLogLists=[
['cycle'], ['cycle'],
['ab','db','rw','Fetch','pc','a','x','y','s','p'], ['ab','db','rw','Fetch','pc','a','x','y','s','p'],
@ -35,7 +37,7 @@ var presetLogLists=[
['alucin','alua','alub','alucout','aluvout','dasb'], ['alucin','alua','alub','alucout','aluvout','dasb'],
['plaOutputs','DPControl'], ['plaOutputs','DPControl'],
['idb','dor'], ['idb','dor'],
['irq','nmi','res'], ['irq','nmi',nodenamereset],
]; ];
function loadProgram(){ function loadProgram(){
@ -147,13 +149,13 @@ function initChip(){
nodes[npwr].state = true; nodes[npwr].state = true;
nodes[npwr].float = false; nodes[npwr].float = false;
for(var tn in transistors) transistors[tn].on = false; for(var tn in transistors) transistors[tn].on = false;
setLow('res'); setLow(nodenamereset);
setLow('clk0'); setLow('clk0');
setHigh('rdy'); setLow('so'); setHigh('rdy'); setLow('so');
setHigh('irq'); setHigh('nmi'); setHigh('irq'); setHigh('nmi');
recalcNodeList(allNodes()); recalcNodeList(allNodes());
for(var i=0;i<8;i++){setHigh('clk0'), setLow('clk0');} for(var i=0;i<8;i++){setHigh('clk0'), setLow('clk0');}
setHigh('res'); setHigh(nodenamereset);
for(var i=0;i<18;i++){halfStep();} // avoid updating graphics and trace buffer before user code for(var i=0;i<18;i++){halfStep();} // avoid updating graphics and trace buffer before user code
refresh(); refresh();
cycle = 0; cycle = 0;
@ -424,7 +426,7 @@ function stopChip(){
function resetChip(){ function resetChip(){
stopChip(); stopChip();
setStatus('resetting 6502...'); setStatus('resetting ' + chipname + '...');
setTimeout(initChip,0); setTimeout(initChip,0);
} }