start adding c structs for gates and ports
This commit is contained in:
19
sim/port.lua
19
sim/port.lua
@@ -1,7 +1,7 @@
|
||||
|
||||
PortTypes = {
|
||||
output = 0,
|
||||
input = 1
|
||||
input = 1,
|
||||
}
|
||||
|
||||
PortDirections = {
|
||||
@@ -13,9 +13,20 @@ PortDirections = {
|
||||
[5] = {0, 0, -1}
|
||||
}
|
||||
|
||||
Port = {
|
||||
logictype = 1,
|
||||
}
|
||||
Port = {}
|
||||
|
||||
FFI.cdef[[
|
||||
struct Gate;
|
||||
struct Port {
|
||||
bool state;
|
||||
char type;
|
||||
char direction;
|
||||
bool causeupdate;
|
||||
int position[3];
|
||||
struct Gate* gate;
|
||||
struct Net* group;
|
||||
};
|
||||
]]
|
||||
|
||||
function Port.new(self, type, direction, position, causeupdate, sim)
|
||||
local o = {
|
||||
|
||||
Reference in New Issue
Block a user