remove gate ffi struct

This commit is contained in:
Redo
2022-11-04 15:04:49 -06:00
parent 5438de0adf
commit a9056df54d
5 changed files with 17 additions and 29 deletions

View File

@@ -244,11 +244,11 @@ end
function Simulation.queuegate(sim, gate)
sim.gatequeue[sim.num_gatequeue+1] = gate
sim.num_gatequeue = sim.num_gatequeue + 1
gate.c.in_queue = 1
gate.in_queue = 1
end
function Simulation.queuegate_safe(sim, gate)
if gate.c.in_queue==0 then
if gate.in_queue==0 then
Simulation.queuegate(sim, gate)
end
end
@@ -296,10 +296,10 @@ function Simulation.dequeuegroup(sim, group)
end
function Simulation.dequeuegate(sim, gate)
if gate.c.in_queue~=0 then
if gate.in_queue~=0 then
array_remove(sim.gatequeue, gate, true)
sim.num_gatequeue = sim.num_gatequeue - 1
gate.c.in_queue = 0
gate.in_queue = 0
end
if sim.inputqueue~=nil then sim.inputqueue[gate] = nil end
if sim.initqueue ~=nil then sim.initqueue [gate] = nil end
@@ -330,7 +330,7 @@ function Simulation.ticklogic(sim)
if sim.tickqueue[sim.current_tick] ~= nil then
for i, gate in pairs(sim.tickqueue[sim.current_tick]) do
if gate.c.in_queue==0 then
if gate.in_queue==0 then
Simulation.queuegate(sim, gate)
end
end
@@ -340,7 +340,7 @@ function Simulation.ticklogic(sim)
for i = 1, sim.num_gatequeue do
local gate = sim.gatequeue[i]
gate.logic(gate)
gate.c.in_queue = 0
gate.in_queue = 0
sim.gatequeue[i] = nil
end
--sim.gatequeue = {}