1
0
mirror of https://github.com/mist64/perfect6502.git synced 2024-12-29 17:30:49 +00:00

don't recalc transistors if gate value has not changed - 2x speedup!

This commit is contained in:
Michael Steil 2010-09-25 18:02:16 +00:00
parent c8c2038b6c
commit 80a13b5f7a

View File

@ -508,10 +508,12 @@ recalcNode(nodenum_t node)
*/
for (count_t i = 0; i < group_count(); i++) {
nodenum_t nn = group_get(i);
BOOL needs_recalc = get_nodes_state_value(nn) != newv_value;
set_nodes_state_value(nn, newv_value);
set_nodes_state_floating(nn, newv_floating);
for (count_t t = 0; t < nodes_gatecount[nn]; t++)
recalcTransistor(nodes_gates[nn][t]);
if (needs_recalc)
for (count_t t = 0; t < nodes_gatecount[nn]; t++)
recalcTransistor(nodes_gates[nn][t]);
}
}