
datablock fxDtsBrickData(LogicGate_Mux5_Data){
	brickFile = $LuaLogic::Path @ "bricks/gen/newbricks/Mux 5 Bit.blb";
	iconName = $LuaLogic::Path @ "bricks/gen/newicons/Mux 5 Bit";
	
	category = "Logic Bricks";
	subCategory = "Mux";
	uiName = "Mux 5 Bit";
	logicUIName = "Mux 5 Bit";
	logicUIDesc = "";
	
	hasPrint = 1;
	printAspectRatio = "Logic";
	
	logicBrickSize = "32 1 1";
	orientationFix = 3;
	
	isLogic = true;
	isLogicGate = true;
	isLogicInput = false;
	
	logicInit = "";
	logicInput = "";
	logicUpdate = 
		"return function(gate) " @
		"	if Gate.getportstate(gate, 38) then " @
		"		local idx = 6 + " @
		"			(bool_to_int[Gate.getportstate(gate, 1)] * 1) + " @
		"			(bool_to_int[Gate.getportstate(gate, 2)] * 2) + " @
		"			(bool_to_int[Gate.getportstate(gate, 3)] * 4) + " @
		"			(bool_to_int[Gate.getportstate(gate, 4)] * 8) + " @
		"			(bool_to_int[Gate.getportstate(gate, 5)] * 16) " @
		"		Gate.setportstate(gate, 39, Gate.getportstate(gate, idx)) " @
		"	else " @
		"		Gate.setportstate(gate, 39, false) " @
		"	end " @
		"end"
	;
	logicGlobal = "";
	
	numLogicPorts = 39;
	
	
	
	logicPortType[0] = 1;
	logicPortPos[0] = "31 0 0";
	logicPortDir[0] = 3;
	logicPortUIName[0] = "Sel0";
	logicPortCauseUpdate[0] = true;
	
	logicPortType[1] = 1;
	logicPortPos[1] = "29 0 0";
	logicPortDir[1] = 3;
	logicPortUIName[1] = "Sel1";
	logicPortCauseUpdate[1] = true;
	
	logicPortType[2] = 1;
	logicPortPos[2] = "27 0 0";
	logicPortDir[2] = 3;
	logicPortUIName[2] = "Sel2";
	logicPortCauseUpdate[2] = true;
	
	logicPortType[3] = 1;
	logicPortPos[3] = "25 0 0";
	logicPortDir[3] = 3;
	logicPortUIName[3] = "Sel3";
	logicPortCauseUpdate[3] = true;
	
	logicPortType[4] = 1;
	logicPortPos[4] = "23 0 0";
	logicPortDir[4] = 3;
	logicPortUIName[4] = "Sel4";
	logicPortCauseUpdate[4] = true;
	
	logicPortType[5] = 1;
	logicPortPos[5] = "31 0 0";
	logicPortDir[5] = 1;
	logicPortUIName[5] = "In0";
	logicPortCauseUpdate[5] = true;
	
	logicPortType[6] = 1;
	logicPortPos[6] = "29 0 0";
	logicPortDir[6] = 1;
	logicPortUIName[6] = "In1";
	logicPortCauseUpdate[6] = true;
	
	logicPortType[7] = 1;
	logicPortPos[7] = "27 0 0";
	logicPortDir[7] = 1;
	logicPortUIName[7] = "In2";
	logicPortCauseUpdate[7] = true;
	
	logicPortType[8] = 1;
	logicPortPos[8] = "25 0 0";
	logicPortDir[8] = 1;
	logicPortUIName[8] = "In3";
	logicPortCauseUpdate[8] = true;
	
	logicPortType[9] = 1;
	logicPortPos[9] = "23 0 0";
	logicPortDir[9] = 1;
	logicPortUIName[9] = "In4";
	logicPortCauseUpdate[9] = true;
	
	logicPortType[10] = 1;
	logicPortPos[10] = "21 0 0";
	logicPortDir[10] = 1;
	logicPortUIName[10] = "In5";
	logicPortCauseUpdate[10] = true;
	
	logicPortType[11] = 1;
	logicPortPos[11] = "19 0 0";
	logicPortDir[11] = 1;
	logicPortUIName[11] = "In6";
	logicPortCauseUpdate[11] = true;
	
	logicPortType[12] = 1;
	logicPortPos[12] = "17 0 0";
	logicPortDir[12] = 1;
	logicPortUIName[12] = "In7";
	logicPortCauseUpdate[12] = true;
	
	logicPortType[13] = 1;
	logicPortPos[13] = "15 0 0";
	logicPortDir[13] = 1;
	logicPortUIName[13] = "In8";
	logicPortCauseUpdate[13] = true;
	
	logicPortType[14] = 1;
	logicPortPos[14] = "13 0 0";
	logicPortDir[14] = 1;
	logicPortUIName[14] = "In9";
	logicPortCauseUpdate[14] = true;
	
	logicPortType[15] = 1;
	logicPortPos[15] = "11 0 0";
	logicPortDir[15] = 1;
	logicPortUIName[15] = "In10";
	logicPortCauseUpdate[15] = true;
	
	logicPortType[16] = 1;
	logicPortPos[16] = "9 0 0";
	logicPortDir[16] = 1;
	logicPortUIName[16] = "In11";
	logicPortCauseUpdate[16] = true;
	
	logicPortType[17] = 1;
	logicPortPos[17] = "7 0 0";
	logicPortDir[17] = 1;
	logicPortUIName[17] = "In12";
	logicPortCauseUpdate[17] = true;
	
	logicPortType[18] = 1;
	logicPortPos[18] = "5 0 0";
	logicPortDir[18] = 1;
	logicPortUIName[18] = "In13";
	logicPortCauseUpdate[18] = true;
	
	logicPortType[19] = 1;
	logicPortPos[19] = "3 0 0";
	logicPortDir[19] = 1;
	logicPortUIName[19] = "In14";
	logicPortCauseUpdate[19] = true;
	
	logicPortType[20] = 1;
	logicPortPos[20] = "1 0 0";
	logicPortDir[20] = 1;
	logicPortUIName[20] = "In15";
	logicPortCauseUpdate[20] = true;
	
	logicPortType[21] = 1;
	logicPortPos[21] = "-1 0 0";
	logicPortDir[21] = 1;
	logicPortUIName[21] = "In16";
	logicPortCauseUpdate[21] = true;
	
	logicPortType[22] = 1;
	logicPortPos[22] = "-3 0 0";
	logicPortDir[22] = 1;
	logicPortUIName[22] = "In17";
	logicPortCauseUpdate[22] = true;
	
	logicPortType[23] = 1;
	logicPortPos[23] = "-5 0 0";
	logicPortDir[23] = 1;
	logicPortUIName[23] = "In18";
	logicPortCauseUpdate[23] = true;
	
	logicPortType[24] = 1;
	logicPortPos[24] = "-7 0 0";
	logicPortDir[24] = 1;
	logicPortUIName[24] = "In19";
	logicPortCauseUpdate[24] = true;
	
	logicPortType[25] = 1;
	logicPortPos[25] = "-9 0 0";
	logicPortDir[25] = 1;
	logicPortUIName[25] = "In20";
	logicPortCauseUpdate[25] = true;
	
	logicPortType[26] = 1;
	logicPortPos[26] = "-11 0 0";
	logicPortDir[26] = 1;
	logicPortUIName[26] = "In21";
	logicPortCauseUpdate[26] = true;
	
	logicPortType[27] = 1;
	logicPortPos[27] = "-13 0 0";
	logicPortDir[27] = 1;
	logicPortUIName[27] = "In22";
	logicPortCauseUpdate[27] = true;
	
	logicPortType[28] = 1;
	logicPortPos[28] = "-15 0 0";
	logicPortDir[28] = 1;
	logicPortUIName[28] = "In23";
	logicPortCauseUpdate[28] = true;
	
	logicPortType[29] = 1;
	logicPortPos[29] = "-17 0 0";
	logicPortDir[29] = 1;
	logicPortUIName[29] = "In24";
	logicPortCauseUpdate[29] = true;
	
	logicPortType[30] = 1;
	logicPortPos[30] = "-19 0 0";
	logicPortDir[30] = 1;
	logicPortUIName[30] = "In25";
	logicPortCauseUpdate[30] = true;
	
	logicPortType[31] = 1;
	logicPortPos[31] = "-21 0 0";
	logicPortDir[31] = 1;
	logicPortUIName[31] = "In26";
	logicPortCauseUpdate[31] = true;
	
	logicPortType[32] = 1;
	logicPortPos[32] = "-23 0 0";
	logicPortDir[32] = 1;
	logicPortUIName[32] = "In27";
	logicPortCauseUpdate[32] = true;
	
	logicPortType[33] = 1;
	logicPortPos[33] = "-25 0 0";
	logicPortDir[33] = 1;
	logicPortUIName[33] = "In28";
	logicPortCauseUpdate[33] = true;
	
	logicPortType[34] = 1;
	logicPortPos[34] = "-27 0 0";
	logicPortDir[34] = 1;
	logicPortUIName[34] = "In29";
	logicPortCauseUpdate[34] = true;
	
	logicPortType[35] = 1;
	logicPortPos[35] = "-29 0 0";
	logicPortDir[35] = 1;
	logicPortUIName[35] = "In30";
	logicPortCauseUpdate[35] = true;
	
	logicPortType[36] = 1;
	logicPortPos[36] = "-31 0 0";
	logicPortDir[36] = 1;
	logicPortUIName[36] = "In31";
	logicPortCauseUpdate[36] = true;
	
	logicPortType[37] = 1;
	logicPortPos[37] = "31 0 0";
	logicPortDir[37] = 2;
	logicPortUIName[37] = "Enable";
	logicPortCauseUpdate[37] = true;
	
	logicPortType[38] = 0;
	logicPortPos[38] = "-31 0 0";
	logicPortDir[38] = 0;
	logicPortUIName[38] = "Out";
	
};
