text brick debug prints

This commit is contained in:
Redo
2022-11-09 23:55:19 -06:00
parent d5fb2b33b7
commit d1d324b3ce
2 changed files with 7 additions and 5 deletions

View File

@@ -17,6 +17,7 @@ local function getBit(gate, val)
elseif gatedata.listenState=="terminate" then
if val==1 then
local v = gatedata.valReceived
print("text brick received "..v)
local iscolor = math.floor(v/512)==1 -- first bit
if iscolor then
local printdomain = (math.floor(v/128)%2)==1 and "terminal" or "terminalInv" -- 8th lowest bit
@@ -44,7 +45,7 @@ local function changeTo(gate, val)
local tick = Gate.gettick(gate)
local ticks = tick-gatedata.lastTickChanged
local bits = math.min(ticks, 10)
local bits = math.min(ticks, textbrick2_bitsNeeded+3)
for i = 1, bits do
getBit(gate, val)
end