private static void loadROMInfo() {
		roms = new ArrayList<RomEntry>();
		RomEntry current = null;
		try {
			Scanner sc = new Scanner(
					FileFunctions.openConfig("gen2_offsets.ini"), "UTF-8");
			while (sc.hasNextLine()) {
				String q = sc.nextLine().trim();
				if (q.contains("//")) {
					q = q.substring(0, q.indexOf("//")).trim();
				}
				if (!q.isEmpty()) {
					if (q.startsWith("[") && q.endsWith("]")) {
						// New rom
						current = new RomEntry();
						current.name = q.substring(1, q.length() - 1);
						roms.add(current);
					} else {
						String[] r = q.split("=", 2);
						if (r.length == 1) {
							System.err.println("invalid entry " + q);
							continue;
						}
						if (r[1].endsWith("\r\n")) {
							r[1] = r[1].substring(0, r[1].length() - 2);
						}
						r[1] = r[1].trim();
						r[0] = r[0].trim();
						// Static Pokemon?
						if (r[0].equals("StaticPokemonGameCorner[]")) {
							String[] offsets = r[1].substring(1,
									r[1].length() - 1).split(",");
							if (offsets.length != 2) {
								continue;
							}
							int[] offs = new int[offsets.length];
							int c = 0;
							for (String off : offsets) {
								offs[c++] = parseRIInt(off);
							}
							current.staticPokemonGameCorner.put(offs[0],
									offs[1]);
						} else if (r[0].equals("StaticPokemonCopy[]")) {
							String[] offsets = r[1].substring(1,
									r[1].length() - 1).split(",");
							if (offsets.length != 2) {
								continue;
							}
							int[] offs = new int[offsets.length];
							int c = 0;
							for (String off : offsets) {
								offs[c++] = parseRIInt(off);
							}
							current.staticPokemonCopy.put(offs[0], offs[1]);
						} else if (r[0].equals("TMText[]")) {
							if (r[1].startsWith("[") && r[1].endsWith("]")) {
								String[] parts = r[1].substring(1,
										r[1].length() - 1).split(",", 3);
								TMTextEntry tte = new TMTextEntry();
								tte.number = parseRIInt(parts[0]);
								tte.offset = parseRIInt(parts[1]);
								tte.template = parts[2];
								current.tmTexts.add(tte);
							}
						} else if (r[0].equals("Game")) {
							current.romCode = r[1];
						} else if (r[0].equals("Version")) {
							current.version = parseRIInt(r[1]);
						} else if (r[0].equals("NonJapanese")) {
							current.nonJapanese = parseRIInt(r[1]);
						} else if (r[0].equals("Type")) {
							if (r[1].equalsIgnoreCase("Crystal")) {
								current.isCrystal = true;
							} else {
								current.isCrystal = false;
							}
						} else if (r[0].equals("ExtraTableFile")) {
							current.extraTableFile = r[1];
						} else if (r[0].equals("CRCInHeader")) {
							current.crcInHeader = parseRIInt(r[1]);
						} else if (r[0].endsWith("Tweak")) {
							current.codeTweaks.put(r[0], r[1]);
						} else if (r[0].equals("CopyFrom")) {
							for (RomEntry otherEntry : roms) {
								if (r[1].equalsIgnoreCase(otherEntry.name)) {
									// copy from here
									boolean cSP = (current
											.getValue("CopyStaticPokemon") == 1);
									boolean cTT = (current
											.getValue("CopyTMText") == 1);
									current.arrayEntries
											.putAll(otherEntry.arrayEntries);
									current.entries.putAll(otherEntry.entries);
									if (cSP) {
										current.staticPokemonSingle
												.addAll(otherEntry.staticPokemonSingle);
										current.staticPokemonGameCorner
												.putAll(otherEntry.staticPokemonGameCorner);
										current.staticPokemonCopy
												.putAll(otherEntry.staticPokemonCopy);
										current.entries.put(
												"StaticPokemonSupport", 1);
									} else {
										current.entries.put(
												"StaticPokemonSupport", 0);
									}
									if (cTT) {
										current.tmTexts
												.addAll(otherEntry.tmTexts);
									}
									current.extraTableFile = otherEntry.extraTableFile;
								}
							}
						} else {
							if (r[1].startsWith("[") && r[1].endsWith("]")) {
								String[] offsets = r[1].substring(1,
										r[1].length() - 1).split(",");
								if (offsets.length == 1
										&& offsets[0].trim().isEmpty()) {
									current.arrayEntries.put(r[0], new int[0]);
								} else {
									int[] offs = new int[offsets.length];
									int c = 0;
									for (String off : offsets) {
										offs[c++] = parseRIInt(off);
									}
									if (r[0].startsWith("StaticPokemon")) {
										for (int off : offs) {
											current.staticPokemonSingle
													.add(off);
										}
									} else {
										current.arrayEntries.put(r[0], offs);
									}
								}
							} else {
								int offs = parseRIInt(r[1]);
								current.entries.put(r[0], offs);
							}
						}
					}
				}
			}
			sc.close();
		} catch (FileNotFoundException e) {
		}

	}