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