
datablock fxDtsBrickData(LogicGate_Rom64x16x64_Data){
	brickFile = $LuaLogic::Path @ "bricks/gen/newbricks/ROM 64x16x64.blb";
	iconName = $LuaLogic::Path @ "bricks/gen/newicons/ROM 64x16x64";
	
	category = "Logic Bricks";
	subCategory = "ROM";
	uiName = "ROM 64x16x64";
	logicUIName = "ROM 64x16x64";
	logicUIDesc = "";
	
	hasPrint = 1;
	printAspectRatio = "Logic";
	
	logicBrickSize = "64 16 1";
	orientationFix = 3;
	
	isLogic = true;
	isLogicGate = true;
	isLogicInput = false;
	
	logicInit = 
		"return function(gate) " @
		"	gate.romdata = {} " @
		"	for i = 0, 65535 do " @
		"		gate.romdata[i] = 0 " @
		"	end " @
		"end"
	;
	logicInput = 
		"return function(gate, args) " @
		"	local data = args[1] " @
		"	for i = 1, #data do " @
		"		local c = data:sub(i, i) " @
		"		gate.romdata[i-1] = (c==\"1\") and 1 or 0 " @
		"	end " @
		"	Gate.queue(gate, 0) " @
		"end"
	;
	logicUpdate = 
		"return function(gate) " @
		"	if Gate.getportstate(gate, 75)~=0 then " @
		"		local addr = ( " @
		"			(Gate.getportstate(gate, 1)) " @
		"			+ (Gate.getportstate(gate, 2) * 2) " @
		"			+ (Gate.getportstate(gate, 3) * 4) " @
		"			+ (Gate.getportstate(gate, 4) * 8) " @
		"			+ (Gate.getportstate(gate, 5) * 16) " @
		"			+ (Gate.getportstate(gate, 6) * 32) " @
		"			+ (Gate.getportstate(gate, 7) * 64) " @
		"			+ (Gate.getportstate(gate, 8) * 128) " @
		"			+ (Gate.getportstate(gate, 9) * 256) " @
		"			+ (Gate.getportstate(gate, 10) * 512) " @
		"		) " @
		"		for i = 0, 63 do " @
		"			Gate.setportstate(gate, 11+i, gate.romdata[addr+1024*i]) " @
		"		end " @
		"	else " @
		"		for i = 11, 74 do " @
		"			Gate.setportstate(gate, i, 0) " @
		"		end " @
		"	end " @
		"end"
	;
	logicGlobal = "";
	
	numLogicPorts = 75;
	
	isLogicRom = true;
	logicRomY = 16;
	logicRomZ = 64;
	logicRomX = 64;
	
	logicPortType[0] = 1;
	logicPortPos[0] = "63 -15 0";
	logicPortDir[0] = 3;
	logicPortUIName[0] = "A0";
	
	logicPortType[1] = 1;
	logicPortPos[1] = "61 -15 0";
	logicPortDir[1] = 3;
	logicPortUIName[1] = "A1";
	
	logicPortType[2] = 1;
	logicPortPos[2] = "59 -15 0";
	logicPortDir[2] = 3;
	logicPortUIName[2] = "A2";
	
	logicPortType[3] = 1;
	logicPortPos[3] = "57 -15 0";
	logicPortDir[3] = 3;
	logicPortUIName[3] = "A3";
	
	logicPortType[4] = 1;
	logicPortPos[4] = "55 -15 0";
	logicPortDir[4] = 3;
	logicPortUIName[4] = "A4";
	
	logicPortType[5] = 1;
	logicPortPos[5] = "53 -15 0";
	logicPortDir[5] = 3;
	logicPortUIName[5] = "A5";
	
	logicPortType[6] = 1;
	logicPortPos[6] = "51 -15 0";
	logicPortDir[6] = 3;
	logicPortUIName[6] = "A6";
	
	logicPortType[7] = 1;
	logicPortPos[7] = "49 -15 0";
	logicPortDir[7] = 3;
	logicPortUIName[7] = "A7";
	
	logicPortType[8] = 1;
	logicPortPos[8] = "47 -15 0";
	logicPortDir[8] = 3;
	logicPortUIName[8] = "A8";
	
	logicPortType[9] = 1;
	logicPortPos[9] = "45 -15 0";
	logicPortDir[9] = 3;
	logicPortUIName[9] = "A9";
	
	logicPortType[10] = 0;
	logicPortPos[10] = "63 15 0";
	logicPortDir[10] = 1;
	logicPortUIName[10] = "O0";
	
	logicPortType[11] = 0;
	logicPortPos[11] = "61 15 0";
	logicPortDir[11] = 1;
	logicPortUIName[11] = "O1";
	
	logicPortType[12] = 0;
	logicPortPos[12] = "59 15 0";
	logicPortDir[12] = 1;
	logicPortUIName[12] = "O2";
	
	logicPortType[13] = 0;
	logicPortPos[13] = "57 15 0";
	logicPortDir[13] = 1;
	logicPortUIName[13] = "O3";
	
	logicPortType[14] = 0;
	logicPortPos[14] = "55 15 0";
	logicPortDir[14] = 1;
	logicPortUIName[14] = "O4";
	
	logicPortType[15] = 0;
	logicPortPos[15] = "53 15 0";
	logicPortDir[15] = 1;
	logicPortUIName[15] = "O5";
	
	logicPortType[16] = 0;
	logicPortPos[16] = "51 15 0";
	logicPortDir[16] = 1;
	logicPortUIName[16] = "O6";
	
	logicPortType[17] = 0;
	logicPortPos[17] = "49 15 0";
	logicPortDir[17] = 1;
	logicPortUIName[17] = "O7";
	
	logicPortType[18] = 0;
	logicPortPos[18] = "47 15 0";
	logicPortDir[18] = 1;
	logicPortUIName[18] = "O8";
	
	logicPortType[19] = 0;
	logicPortPos[19] = "45 15 0";
	logicPortDir[19] = 1;
	logicPortUIName[19] = "O9";
	
	logicPortType[20] = 0;
	logicPortPos[20] = "43 15 0";
	logicPortDir[20] = 1;
	logicPortUIName[20] = "O10";
	
	logicPortType[21] = 0;
	logicPortPos[21] = "41 15 0";
	logicPortDir[21] = 1;
	logicPortUIName[21] = "O11";
	
	logicPortType[22] = 0;
	logicPortPos[22] = "39 15 0";
	logicPortDir[22] = 1;
	logicPortUIName[22] = "O12";
	
	logicPortType[23] = 0;
	logicPortPos[23] = "37 15 0";
	logicPortDir[23] = 1;
	logicPortUIName[23] = "O13";
	
	logicPortType[24] = 0;
	logicPortPos[24] = "35 15 0";
	logicPortDir[24] = 1;
	logicPortUIName[24] = "O14";
	
	logicPortType[25] = 0;
	logicPortPos[25] = "33 15 0";
	logicPortDir[25] = 1;
	logicPortUIName[25] = "O15";
	
	logicPortType[26] = 0;
	logicPortPos[26] = "31 15 0";
	logicPortDir[26] = 1;
	logicPortUIName[26] = "O16";
	
	logicPortType[27] = 0;
	logicPortPos[27] = "29 15 0";
	logicPortDir[27] = 1;
	logicPortUIName[27] = "O17";
	
	logicPortType[28] = 0;
	logicPortPos[28] = "27 15 0";
	logicPortDir[28] = 1;
	logicPortUIName[28] = "O18";
	
	logicPortType[29] = 0;
	logicPortPos[29] = "25 15 0";
	logicPortDir[29] = 1;
	logicPortUIName[29] = "O19";
	
	logicPortType[30] = 0;
	logicPortPos[30] = "23 15 0";
	logicPortDir[30] = 1;
	logicPortUIName[30] = "O20";
	
	logicPortType[31] = 0;
	logicPortPos[31] = "21 15 0";
	logicPortDir[31] = 1;
	logicPortUIName[31] = "O21";
	
	logicPortType[32] = 0;
	logicPortPos[32] = "19 15 0";
	logicPortDir[32] = 1;
	logicPortUIName[32] = "O22";
	
	logicPortType[33] = 0;
	logicPortPos[33] = "17 15 0";
	logicPortDir[33] = 1;
	logicPortUIName[33] = "O23";
	
	logicPortType[34] = 0;
	logicPortPos[34] = "15 15 0";
	logicPortDir[34] = 1;
	logicPortUIName[34] = "O24";
	
	logicPortType[35] = 0;
	logicPortPos[35] = "13 15 0";
	logicPortDir[35] = 1;
	logicPortUIName[35] = "O25";
	
	logicPortType[36] = 0;
	logicPortPos[36] = "11 15 0";
	logicPortDir[36] = 1;
	logicPortUIName[36] = "O26";
	
	logicPortType[37] = 0;
	logicPortPos[37] = "9 15 0";
	logicPortDir[37] = 1;
	logicPortUIName[37] = "O27";
	
	logicPortType[38] = 0;
	logicPortPos[38] = "7 15 0";
	logicPortDir[38] = 1;
	logicPortUIName[38] = "O28";
	
	logicPortType[39] = 0;
	logicPortPos[39] = "5 15 0";
	logicPortDir[39] = 1;
	logicPortUIName[39] = "O29";
	
	logicPortType[40] = 0;
	logicPortPos[40] = "3 15 0";
	logicPortDir[40] = 1;
	logicPortUIName[40] = "O30";
	
	logicPortType[41] = 0;
	logicPortPos[41] = "1 15 0";
	logicPortDir[41] = 1;
	logicPortUIName[41] = "O31";
	
	logicPortType[42] = 0;
	logicPortPos[42] = "-1 15 0";
	logicPortDir[42] = 1;
	logicPortUIName[42] = "O32";
	
	logicPortType[43] = 0;
	logicPortPos[43] = "-3 15 0";
	logicPortDir[43] = 1;
	logicPortUIName[43] = "O33";
	
	logicPortType[44] = 0;
	logicPortPos[44] = "-5 15 0";
	logicPortDir[44] = 1;
	logicPortUIName[44] = "O34";
	
	logicPortType[45] = 0;
	logicPortPos[45] = "-7 15 0";
	logicPortDir[45] = 1;
	logicPortUIName[45] = "O35";
	
	logicPortType[46] = 0;
	logicPortPos[46] = "-9 15 0";
	logicPortDir[46] = 1;
	logicPortUIName[46] = "O36";
	
	logicPortType[47] = 0;
	logicPortPos[47] = "-11 15 0";
	logicPortDir[47] = 1;
	logicPortUIName[47] = "O37";
	
	logicPortType[48] = 0;
	logicPortPos[48] = "-13 15 0";
	logicPortDir[48] = 1;
	logicPortUIName[48] = "O38";
	
	logicPortType[49] = 0;
	logicPortPos[49] = "-15 15 0";
	logicPortDir[49] = 1;
	logicPortUIName[49] = "O39";
	
	logicPortType[50] = 0;
	logicPortPos[50] = "-17 15 0";
	logicPortDir[50] = 1;
	logicPortUIName[50] = "O40";
	
	logicPortType[51] = 0;
	logicPortPos[51] = "-19 15 0";
	logicPortDir[51] = 1;
	logicPortUIName[51] = "O41";
	
	logicPortType[52] = 0;
	logicPortPos[52] = "-21 15 0";
	logicPortDir[52] = 1;
	logicPortUIName[52] = "O42";
	
	logicPortType[53] = 0;
	logicPortPos[53] = "-23 15 0";
	logicPortDir[53] = 1;
	logicPortUIName[53] = "O43";
	
	logicPortType[54] = 0;
	logicPortPos[54] = "-25 15 0";
	logicPortDir[54] = 1;
	logicPortUIName[54] = "O44";
	
	logicPortType[55] = 0;
	logicPortPos[55] = "-27 15 0";
	logicPortDir[55] = 1;
	logicPortUIName[55] = "O45";
	
	logicPortType[56] = 0;
	logicPortPos[56] = "-29 15 0";
	logicPortDir[56] = 1;
	logicPortUIName[56] = "O46";
	
	logicPortType[57] = 0;
	logicPortPos[57] = "-31 15 0";
	logicPortDir[57] = 1;
	logicPortUIName[57] = "O47";
	
	logicPortType[58] = 0;
	logicPortPos[58] = "-33 15 0";
	logicPortDir[58] = 1;
	logicPortUIName[58] = "O48";
	
	logicPortType[59] = 0;
	logicPortPos[59] = "-35 15 0";
	logicPortDir[59] = 1;
	logicPortUIName[59] = "O49";
	
	logicPortType[60] = 0;
	logicPortPos[60] = "-37 15 0";
	logicPortDir[60] = 1;
	logicPortUIName[60] = "O50";
	
	logicPortType[61] = 0;
	logicPortPos[61] = "-39 15 0";
	logicPortDir[61] = 1;
	logicPortUIName[61] = "O51";
	
	logicPortType[62] = 0;
	logicPortPos[62] = "-41 15 0";
	logicPortDir[62] = 1;
	logicPortUIName[62] = "O52";
	
	logicPortType[63] = 0;
	logicPortPos[63] = "-43 15 0";
	logicPortDir[63] = 1;
	logicPortUIName[63] = "O53";
	
	logicPortType[64] = 0;
	logicPortPos[64] = "-45 15 0";
	logicPortDir[64] = 1;
	logicPortUIName[64] = "O54";
	
	logicPortType[65] = 0;
	logicPortPos[65] = "-47 15 0";
	logicPortDir[65] = 1;
	logicPortUIName[65] = "O55";
	
	logicPortType[66] = 0;
	logicPortPos[66] = "-49 15 0";
	logicPortDir[66] = 1;
	logicPortUIName[66] = "O56";
	
	logicPortType[67] = 0;
	logicPortPos[67] = "-51 15 0";
	logicPortDir[67] = 1;
	logicPortUIName[67] = "O57";
	
	logicPortType[68] = 0;
	logicPortPos[68] = "-53 15 0";
	logicPortDir[68] = 1;
	logicPortUIName[68] = "O58";
	
	logicPortType[69] = 0;
	logicPortPos[69] = "-55 15 0";
	logicPortDir[69] = 1;
	logicPortUIName[69] = "O59";
	
	logicPortType[70] = 0;
	logicPortPos[70] = "-57 15 0";
	logicPortDir[70] = 1;
	logicPortUIName[70] = "O60";
	
	logicPortType[71] = 0;
	logicPortPos[71] = "-59 15 0";
	logicPortDir[71] = 1;
	logicPortUIName[71] = "O61";
	
	logicPortType[72] = 0;
	logicPortPos[72] = "-61 15 0";
	logicPortDir[72] = 1;
	logicPortUIName[72] = "O62";
	
	logicPortType[73] = 0;
	logicPortPos[73] = "-63 15 0";
	logicPortDir[73] = 1;
	logicPortUIName[73] = "O63";
	
	logicPortType[74] = 1;
	logicPortPos[74] = "63 -15 0";
	logicPortDir[74] = 2;
	logicPortUIName[74] = "Clock";
	logicPortCauseUpdate[74] = true;
	
};
