Fix slow reset loop

This commit is contained in:
Barry Silverman 2010-09-18 11:42:30 -04:00
parent d5300567d6
commit b9cbe765b2

View File

@ -55,7 +55,7 @@ function initChip(){
recalcNodeList(allNodes());
for(var i=0;i<8;i++){setHigh('clk0'), setLow('clk0');}
setHigh('res');
for(var i=0;i<14;i++){step();}
for(var i=0;i<18;i++){resetStep();}
refresh();
cycle = 0;
trace = Array();
@ -76,6 +76,13 @@ function halfStep(){
refresh();
}
function resetStep(){
var clk = isNodeHigh(nodenames['clk0']);
if (clk) {setLow('clk0'); handleBusRead(); }
else {setHigh('clk0'); handleBusWrite();}
}
function handleBusRead(){
if(isNodeHigh(nodenames['rw'])) writeDataBus(mRead(readAddressBus()));
}