z80 icon indicating copy to clipboard operation
z80 copied to clipboard

Make transistors to store their states, not nodes

Open kosarev opened this issue 1 year ago • 0 comments

The original https://github.com/trebonian/visual6502 code maintains separate states for nodes and transistors. 48a84a6a changed that to store transistors' states in their gate nodes, because these were always supposed to be the same. However, making nodes stateless and gates themselves be storing their states might be better idea.

Firstly, not all nodes are tied to gates. This means we waste time updating them. When a node 'state' is needed, we should be able to compute it on demand without having to store anything.

Secondly, storing gate states in nodes means there is no way for several gates connected to the same node to have different states, which we need to simulate various possible orders of switching transistor states (#51).

kosarev avatar Jun 14 '23 16:06 kosarev