made execution of brick datablocks automatic and make more sense
This commit is contained in:
parent
74401cd7f6
commit
976b3d823e
@ -1,3 +1,6 @@
|
||||
|
||||
lualogic_require($LuaLogic::Path @ "bricks/gates/diode.cs");
|
||||
|
||||
datablock fxDTSBrickData(LogicGate_NOT_Data : LogicGate_Diode_Data)
|
||||
{
|
||||
uiName = "1x1f NOT";
|
||||
|
@ -1,3 +1,6 @@
|
||||
|
||||
lualogic_require($LuaLogic::Path @ "bricks/gates/OR.cs");
|
||||
|
||||
datablock fxDTSBrickData(LogicGate_XNOR_Data : LogicGate_OR_Data)
|
||||
{
|
||||
uiName = "1x2f XNOR";
|
||||
|
@ -1,3 +1,6 @@
|
||||
|
||||
lualogic_require($LuaLogic::Path @ "bricks/gates/OR.cs");
|
||||
|
||||
datablock fxDTSBrickData(LogicGate_XOR_Data : LogicGate_OR_Data)
|
||||
{
|
||||
uiName = "1x2f XOR";
|
||||
|
@ -1,3 +1,6 @@
|
||||
|
||||
lualogic_require($LuaLogic::Path @ "bricks/gates/verticalDiode.cs");
|
||||
|
||||
datablock fxDTSBrickData(LogicGate_NotUp_Data : LogicGate_DiodeUp_Data)
|
||||
{
|
||||
uiName = "Not Up";
|
||||
|
@ -2,7 +2,7 @@
|
||||
datablock fxDTSBrickData(LogicGate_Button_Data : LogicGate_Switch_Data){
|
||||
category = "Logic Bricks";
|
||||
subCategory = "Inputs";
|
||||
uiName = "Button";
|
||||
uiName = "Logic Button";
|
||||
|
||||
numLogicPorts = 2;
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
|
||||
lualogic_require($LuaLogic::Path @ "bricks/gates/OR.cs");
|
||||
|
||||
datablock fxDTSBrickData(LogicGate_DFlipFlop_Data : LogicGate_OR_Data)
|
||||
{
|
||||
subCategory = "Memory";
|
||||
|
@ -1,3 +1,6 @@
|
||||
|
||||
lualogic_require($LuaLogic::Path @ "bricks/memory/DFlipFlop.cs");
|
||||
|
||||
datablock fxDTSBrickData(LogicGate_SRLatch_Data : LogicGate_DFlipFlop_Data)
|
||||
{
|
||||
subCategory = "Memory";
|
||||
|
@ -1,49 +1,31 @@
|
||||
|
||||
//Wires
|
||||
exec($LuaLogic::Path @ "bricks/wires.cs");
|
||||
deleteVariables("$LuaLogic::BrickData::LoadedFile_*");
|
||||
|
||||
//Gates
|
||||
exec($LuaLogic::Path @ "bricks/gates/diode.cs");
|
||||
exec($LuaLogic::Path @ "bricks/gates/NOT.cs");
|
||||
exec($LuaLogic::Path @ "bricks/gates/OR.cs");
|
||||
exec($LuaLogic::Path @ "bricks/gates/AND.cs");
|
||||
exec($LuaLogic::Path @ "bricks/gates/NOR.cs");
|
||||
exec($LuaLogic::Path @ "bricks/gates/NAND.cs");
|
||||
exec($LuaLogic::Path @ "bricks/gates/XOR.cs");
|
||||
exec($LuaLogic::Path @ "bricks/gates/XNOR.cs");
|
||||
exec($LuaLogic::Path @ "bricks/gates/verticalDiode.cs");
|
||||
exec($LuaLogic::Path @ "bricks/gates/verticalNOT.cs");
|
||||
function lualogic_cleanfilename(%fn){
|
||||
%fn = strReplace(%fn, "\\", "/");
|
||||
%fn = strReplace(%fn, "/", "_");
|
||||
%fn = strReplace(%fn, ".", "_");
|
||||
%fn = strReplace(%fn, "-", "_");
|
||||
return %fn;
|
||||
}
|
||||
|
||||
//Inputs
|
||||
exec($LuaLogic::Path @ "bricks/inputs/switch.cs");
|
||||
exec($LuaLogic::Path @ "bricks/inputs/button.cs");
|
||||
exec($LuaLogic::Path @ "bricks/inputs/keyboard.cs");
|
||||
function lualogic_require(%fn){
|
||||
if(!$LuaLogic::BrickData::LoadedFile_[lualogic_cleanfilename(%fn)]){
|
||||
exec(%fn);
|
||||
$LuaLogic::BrickData::LoadedFile_[lualogic_cleanfilename(%fn)] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
//Outputs
|
||||
exec($LuaLogic::Path @ "bricks/outputs/pixel.cs");
|
||||
exec($LuaLogic::Path @ "bricks/outputs/TextBrick.cs");
|
||||
exec($LuaLogic::Path @ "bricks/outputs/TextBrick2.cs");
|
||||
function lualogic_execallbricks(){
|
||||
%patt = $LuaLogic::Path @ "bricks/*.cs";
|
||||
%fn = findFirstFile(%patt);
|
||||
while(%fn!$=""){
|
||||
lualogic_require(%fn);
|
||||
|
||||
//Math
|
||||
exec($LuaLogic::Path @ "bricks/math/HalfAdder.cs");
|
||||
exec($LuaLogic::Path @ "bricks/math/HalfSubtractor.cs");
|
||||
exec($LuaLogic::Path @ "bricks/math/FullAdder.cs");
|
||||
exec($LuaLogic::Path @ "bricks/math/FullSubtractor.cs");
|
||||
exec($LuaLogic::Path @ "bricks/math/8bitAdder.cs");
|
||||
exec($LuaLogic::Path @ "bricks/math/8bitSubtractor.cs");
|
||||
exec($LuaLogic::Path @ "bricks/math/8bitMultiplier.cs");
|
||||
exec($LuaLogic::Path @ "bricks/math/8bitDivider.cs");
|
||||
%fn = findNextFile(%patt);
|
||||
}
|
||||
}
|
||||
|
||||
//Bus
|
||||
exec($LuaLogic::Path @ "bricks/bus/8BitBuffer.cs");
|
||||
exec($LuaLogic::Path @ "bricks/bus/8BitDFlipFlop.cs");
|
||||
exec($LuaLogic::Path @ "bricks/bus/8BitEnabler.cs");
|
||||
exec($LuaLogic::Path @ "bricks/bus/bus16.cs");
|
||||
lualogic_execallbricks();
|
||||
|
||||
//Memory
|
||||
exec($LuaLogic::Path @ "bricks/memory/DFlipFlop.cs");
|
||||
exec($LuaLogic::Path @ "bricks/memory/SRLatch.cs");
|
||||
exec($LuaLogic::Path @ "bricks/memory/DFlipflopGridMemory2.cs");
|
||||
|
||||
//Special
|
||||
exec($LuaLogic::Path @ "bricks/special/EventGate.cs");
|
||||
deleteVariables("$LuaLogic::BrickData::LoadedFile_*");
|
||||
|
Loading…
x
Reference in New Issue
Block a user