add c func and data

This commit is contained in:
Redo
2022-11-05 13:01:07 -06:00
parent f347d1f17d
commit 75299209b8
5 changed files with 14 additions and 9 deletions

View File

@@ -75,10 +75,13 @@ function network_update()
local logic = data[i+5]
local input = data[i+6]
local global = data[i+7]
local numports = tonumber(data[i+8])
local datasize = tonumber(data[i+8])
local logicfuncc = tonumber(data[i+9])
local numports = tonumber(data[i+10])
local ports = {}
i = i + 10
for a = i+9, numports*5+i+8, 5 do
for a = i+1, numports*5+i, 5 do
local portd = {
type = tonumber(data[a]),
position = vectotable(data[a+1]),
@@ -91,10 +94,10 @@ function network_update()
if not portd.direction then print(line) end
end
local definition = GateDefinition.new(objref, name, desc, init, logic, input, global, ports)
local definition = GateDefinition.new(objref, name, desc, init, logic, input, global, ports, datasize, logicfuncc)
Simulation.addgatedefinition(sim, definition)
i = i + 8 + numports*5
i = i + numports*5
elseif data[i] == "SL" then
local wire = Simulation.getwirebyref(sim, tonumber(data[i+1]))
if wire ~= nil then