mirror of
https://github.com/trebonian/visual6502.git
synced 2024-06-26 22:29:42 +00:00
More forEach
This commit is contained in:
parent
98ec727c50
commit
10787078c8
14
chipsim.js
14
chipsim.js
|
@ -45,7 +45,7 @@ function recalcNodeList(list){
|
|||
console.log('recalcNodeList iteration: ', j, list.length, 'nodes', list);
|
||||
}
|
||||
}
|
||||
for(var i in list) recalcNode(list[i]);
|
||||
list.forEach(recalcNode);
|
||||
list = recalclist;
|
||||
recalclist = new Array();
|
||||
recalcHash = new Array();
|
||||
|
@ -64,16 +64,12 @@ function recalcNode(node){
|
|||
var n = nodes[group[i]];
|
||||
if(n.state==newState)continue; /******Performance********/
|
||||
n.state = newState;
|
||||
n.gates.forEach(
|
||||
function(t){
|
||||
recalcTransistor(t);
|
||||
});
|
||||
if(n.state){
|
||||
n.gates.forEach(turnTransistorOn);
|
||||
} else {
|
||||
n.gates.forEach(turnTransistorOff);
|
||||
}
|
||||
}
|
||||
|
||||
function recalcTransistor(t){
|
||||
if(isNodeHigh(t.gate)) turnTransistorOn(t);
|
||||
else turnTransistorOff(t);
|
||||
}
|
||||
|
||||
function turnTransistorOn(t){
|
||||
|
|
Loading…
Reference in New Issue
Block a user