made execution of brick datablocks automatic and make more sense
This commit is contained in:
		| @@ -1,3 +1,6 @@ | |||||||
|  |  | ||||||
|  | lualogic_require($LuaLogic::Path @ "bricks/gates/diode.cs"); | ||||||
|  |  | ||||||
| datablock fxDTSBrickData(LogicGate_NOT_Data : LogicGate_Diode_Data) | datablock fxDTSBrickData(LogicGate_NOT_Data : LogicGate_Diode_Data) | ||||||
| { | { | ||||||
| 	uiName = "1x1f NOT"; | 	uiName = "1x1f NOT"; | ||||||
|   | |||||||
| @@ -1,3 +1,6 @@ | |||||||
|  |  | ||||||
|  | lualogic_require($LuaLogic::Path @ "bricks/gates/OR.cs"); | ||||||
|  |  | ||||||
| datablock fxDTSBrickData(LogicGate_XNOR_Data : LogicGate_OR_Data) | datablock fxDTSBrickData(LogicGate_XNOR_Data : LogicGate_OR_Data) | ||||||
| { | { | ||||||
| 	uiName = "1x2f XNOR"; | 	uiName = "1x2f XNOR"; | ||||||
|   | |||||||
| @@ -1,3 +1,6 @@ | |||||||
|  |  | ||||||
|  | lualogic_require($LuaLogic::Path @ "bricks/gates/OR.cs"); | ||||||
|  |  | ||||||
| datablock fxDTSBrickData(LogicGate_XOR_Data : LogicGate_OR_Data) | datablock fxDTSBrickData(LogicGate_XOR_Data : LogicGate_OR_Data) | ||||||
| { | { | ||||||
| 	uiName = "1x2f XOR"; | 	uiName = "1x2f XOR"; | ||||||
|   | |||||||
| @@ -1,3 +1,6 @@ | |||||||
|  |  | ||||||
|  | lualogic_require($LuaLogic::Path @ "bricks/gates/verticalDiode.cs"); | ||||||
|  |  | ||||||
| datablock fxDTSBrickData(LogicGate_NotUp_Data : LogicGate_DiodeUp_Data) | datablock fxDTSBrickData(LogicGate_NotUp_Data : LogicGate_DiodeUp_Data) | ||||||
| { | { | ||||||
| 	uiName = "Not Up"; | 	uiName = "Not Up"; | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ | |||||||
| datablock fxDTSBrickData(LogicGate_Button_Data : LogicGate_Switch_Data){ | datablock fxDTSBrickData(LogicGate_Button_Data : LogicGate_Switch_Data){ | ||||||
| 	category = "Logic Bricks"; | 	category = "Logic Bricks"; | ||||||
| 	subCategory = "Inputs"; | 	subCategory = "Inputs"; | ||||||
| 	uiName = "Button"; | 	uiName = "Logic Button"; | ||||||
| 	 | 	 | ||||||
| 	numLogicPorts = 2; | 	numLogicPorts = 2; | ||||||
| 	 | 	 | ||||||
|   | |||||||
| @@ -1,3 +1,6 @@ | |||||||
|  |  | ||||||
|  | lualogic_require($LuaLogic::Path @ "bricks/gates/OR.cs"); | ||||||
|  |  | ||||||
| datablock fxDTSBrickData(LogicGate_DFlipFlop_Data : LogicGate_OR_Data) | datablock fxDTSBrickData(LogicGate_DFlipFlop_Data : LogicGate_OR_Data) | ||||||
| { | { | ||||||
| 	subCategory = "Memory"; | 	subCategory = "Memory"; | ||||||
|   | |||||||
| @@ -1,3 +1,6 @@ | |||||||
|  |  | ||||||
|  | lualogic_require($LuaLogic::Path @ "bricks/memory/DFlipFlop.cs"); | ||||||
|  |  | ||||||
| datablock fxDTSBrickData(LogicGate_SRLatch_Data : LogicGate_DFlipFlop_Data) | datablock fxDTSBrickData(LogicGate_SRLatch_Data : LogicGate_DFlipFlop_Data) | ||||||
| { | { | ||||||
| 	subCategory = "Memory"; | 	subCategory = "Memory"; | ||||||
|   | |||||||
| @@ -1,49 +1,31 @@ | |||||||
|  |  | ||||||
| //Wires | deleteVariables("$LuaLogic::BrickData::LoadedFile_*"); | ||||||
| exec($LuaLogic::Path @ "bricks/wires.cs"); |  | ||||||
|  |  | ||||||
| //Gates | function lualogic_cleanfilename(%fn){ | ||||||
| exec($LuaLogic::Path @ "bricks/gates/diode.cs"); | 	%fn = strReplace(%fn, "\\", "/"); | ||||||
| exec($LuaLogic::Path @ "bricks/gates/NOT.cs"); | 	%fn = strReplace(%fn, "/", "_"); | ||||||
| exec($LuaLogic::Path @ "bricks/gates/OR.cs"); | 	%fn = strReplace(%fn, ".", "_"); | ||||||
| exec($LuaLogic::Path @ "bricks/gates/AND.cs"); | 	%fn = strReplace(%fn, "-", "_"); | ||||||
| exec($LuaLogic::Path @ "bricks/gates/NOR.cs"); | 	return %fn; | ||||||
| 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"); |  | ||||||
|  |  | ||||||
| //Inputs | function lualogic_require(%fn){ | ||||||
| exec($LuaLogic::Path @ "bricks/inputs/switch.cs"); | 	if(!$LuaLogic::BrickData::LoadedFile_[lualogic_cleanfilename(%fn)]){ | ||||||
| exec($LuaLogic::Path @ "bricks/inputs/button.cs"); | 		exec(%fn); | ||||||
| exec($LuaLogic::Path @ "bricks/inputs/keyboard.cs"); | 		$LuaLogic::BrickData::LoadedFile_[lualogic_cleanfilename(%fn)] = 1; | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  |  | ||||||
| //Outputs | function lualogic_execallbricks(){ | ||||||
| exec($LuaLogic::Path @ "bricks/outputs/pixel.cs"); | 	%patt = $LuaLogic::Path @ "bricks/*.cs"; | ||||||
| exec($LuaLogic::Path @ "bricks/outputs/TextBrick.cs"); | 	%fn = findFirstFile(%patt); | ||||||
| exec($LuaLogic::Path @ "bricks/outputs/TextBrick2.cs"); | 	while(%fn!$=""){ | ||||||
|  | 		lualogic_require(%fn); | ||||||
|  | 		 | ||||||
|  | 		%fn = findNextFile(%patt); | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  |  | ||||||
| //Math | lualogic_execallbricks(); | ||||||
| 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"); |  | ||||||
|  |  | ||||||
| //Bus | deleteVariables("$LuaLogic::BrickData::LoadedFile_*"); | ||||||
| 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"); |  | ||||||
|  |  | ||||||
| //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"); |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Redo
					Redo