made execution of brick datablocks automatic and make more sense
This commit is contained in:
		| @@ -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); | ||||
| 		 | ||||
| 		%fn = findNextFile(%patt); | ||||
| 	} | ||||
| } | ||||
|  | ||||
| //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"); | ||||
| lualogic_execallbricks(); | ||||
|  | ||||
| //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"); | ||||
|  | ||||
| //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_*"); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Redo
					Redo