mirror of
https://github.com/mist64/perfect6502.git
synced 2024-06-26 12:29:29 +00:00
simplify transistor calculation
This commit is contained in:
parent
4413b8e8ef
commit
a2f6cca1ba
|
@ -460,14 +460,14 @@ floatnode(nodenum_t nn)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
recalcTransistor(transnum_t tn)
|
toggleTransistor(transnum_t tn)
|
||||||
{
|
{
|
||||||
/* if the gate is high, the transistor should be on */
|
/* 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]);
|
BOOL on = isNodeHigh(transistors_gate[tn]);
|
||||||
|
#else /* easier version: toggle it */
|
||||||
/* no change? nothing to do! */
|
BOOL on = !get_transistors_on(tn);
|
||||||
if (on == get_transistors_on(tn))
|
#endif
|
||||||
return;
|
|
||||||
|
|
||||||
set_transistors_on(tn, on);
|
set_transistors_on(tn, on);
|
||||||
|
|
||||||
|
@ -513,7 +513,7 @@ recalcNode(nodenum_t node)
|
||||||
set_nodes_state_floating(nn, newv_floating);
|
set_nodes_state_floating(nn, newv_floating);
|
||||||
if (needs_recalc)
|
if (needs_recalc)
|
||||||
for (count_t t = 0; t < nodes_gatecount[nn]; t++)
|
for (count_t t = 0; t < nodes_gatecount[nn]; t++)
|
||||||
recalcTransistor(nodes_gates[nn][t]);
|
toggleTransistor(nodes_gates[nn][t]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user