From ebc9a7f1083ada00147b5acf8d2c9766088e3b8b Mon Sep 17 00:00:00 2001 From: Redo0 Date: Fri, 28 May 2021 22:15:57 -0500 Subject: [PATCH] fix port info messages --- sim/main.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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