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

simplify transistor calculation

This commit is contained in:
Michael Steil 2010-09-25 19:10:38 +00:00
parent 4413b8e8ef
commit a2f6cca1ba

View File

@ -460,14 +460,14 @@ floatnode(nodenum_t nn)
}
void
recalcTransistor(transnum_t tn)
toggleTransistor(transnum_t tn)
{
/* if the gate is high, the transistor should be on */
#if 0 /* safer version: set it to what the gate says */
BOOL on = isNodeHigh(transistors_gate[tn]);
/* no change? nothing to do! */
if (on == get_transistors_on(tn))
return;
#else /* easier version: toggle it */
BOOL on = !get_transistors_on(tn);
#endif
set_transistors_on(tn, on);
@ -513,7 +513,7 @@ recalcNode(nodenum_t node)
set_nodes_state_floating(nn, newv_floating);
if (needs_recalc)
for (count_t t = 0; t < nodes_gatecount[nn]; t++)
recalcTransistor(nodes_gates[nn][t]);
toggleTransistor(nodes_gates[nn][t]);
}
}