diff --git a/sim/main.lua b/sim/main.lua index f7db532..25fffcc 100644 --- a/sim/main.lua +++ b/sim/main.lua @@ -269,7 +269,14 @@ while 1 do local def = Gate.getdefinition(gate) info = "\\c5" .. def.name .. "
" for i = 1, #gate.ports do - info = info .. (gate.ports[i].state and "\\c2" or "\\c0") .. def.ports[i].name .. (i ~= #gate.ports and " " or "") + local port = gate.ports[i] + local state + if port.type==PortTypes.input then + state = Gate.getportstate(gate, i) + else + state = Port.getstate(port) + end + info = info .. (state and "\\c2" or "\\c0") .. def.ports[i].name .. (i ~= #gate.ports and " " or "") end end