make states numbers instead of booleans

This commit is contained in:
Redo0
2021-05-29 13:14:50 -05:00
parent b08c3cd0c4
commit 16c1a9f75f
309 changed files with 2819 additions and 2819 deletions

View File

@@ -18,16 +18,16 @@ datablock fxDTSBrickData(LogicGate_8bitSubtractor_Data)
logicUpdate =
"return function(gate) " @
" local c = bool_to_int[Gate.getportstate(gate, 17)] " @
" local c = Gate.getportstate(gate, 17) " @
" local a = 0 " @
" local b = 0 " @
" for i = 1, 8 do " @
" a = bool_to_int[Gate.getportstate(gate, i )] " @
" b = bool_to_int[Gate.getportstate(gate, i+8)] " @
" Gate.setportstate(gate, i+17, bit.bxor(bit.bxor(a, b), c) == 1) " @
" a = Gate.getportstate(gate, i ) " @
" b = Gate.getportstate(gate, i+8) " @
" Gate.setportstate(gate, i+17, bit.bxor(bit.bxor(a, b), c)) " @
" c = bit.bor(bit.bor(bit.band(bool_to_int[a == 0], b), bit.band(bool_to_int[a == 0], c)), bit.band(b, c)) " @
" end " @
" Gate.setportstate(gate, 26, c == 1) " @
" Gate.setportstate(gate, 26, c) " @
"end"
;