private void preprocessMaps() {
		itemOffs = new ArrayList<Integer>();
		int bankCount = romEntry.getValue("MapBankCount");
		int[] bankMapCounts = romEntry.arrayEntries.get("MapBankSizes");
		int itemBall = romEntry.getValue("ItemBallPic");
		mapNames = new String[bankCount][];
		int mbpsOffset = romEntry.getValue("MapHeaders");
		int mapLabels = romEntry.getValue("MapLabels");
		Map<Integer, String> mapLabelsM = new HashMap<Integer, String>();
		for (int bank = 0; bank < bankCount; bank++) {
			int bankOffset = readPointer(mbpsOffset + bank * 4);
			mapNames[bank] = new String[bankMapCounts[bank]];
			for (int map = 0; map < bankMapCounts[bank]; map++) {
				int mhOffset = readPointer(bankOffset + map * 4);

				// map name
				int mapLabel = rom[mhOffset + 0x14] & 0xFF;
				if (mapLabelsM.containsKey(mapLabel)) {
					mapNames[bank][map] = mapLabelsM.get(mapLabel);
				} else {
					if (romEntry.romType == RomType_FRLG) {
						mapNames[bank][map] = readVariableLengthString(readPointer(mapLabels
								+ (mapLabel - 0x58) * 4));
					} else {
						mapNames[bank][map] = readVariableLengthString(readPointer(mapLabels
								+ mapLabel * 8 + 4));
					}
					mapLabelsM.put(mapLabel, mapNames[bank][map]);
				}

				// events
				int eventOffset = readPointer(mhOffset + 4);

				int pCount = rom[eventOffset] & 0xFF;
				// int wCount = rom[eventOffset + 1] & 0xFF;
				// int scCount = rom[eventOffset + 2] & 0xFF;
				int spCount = rom[eventOffset + 3] & 0xFF;

				if (pCount > 0) {
					int peopleOffset = readPointer(eventOffset + 4);
					for (int p = 0; p < pCount; p++) {
						int pSprite = rom[peopleOffset + p * 24 + 1];
						if (pSprite == itemBall
								&& readPointer(peopleOffset + p * 24 + 16) >= 0) {
							// Get script and look inside
							int scriptOffset = readPointer(peopleOffset + p
									* 24 + 16);
							if (rom[scriptOffset] == 0x1A
									&& rom[scriptOffset + 1] == 0x00
									&& (rom[scriptOffset + 2] & 0xFF) == 0x80
									&& rom[scriptOffset + 5] == 0x1A
									&& rom[scriptOffset + 6] == 0x01
									&& (rom[scriptOffset + 7] & 0xFF) == 0x80
									&& rom[scriptOffset + 10] == 0x09
									&& (rom[scriptOffset + 11] == 0x00 || rom[scriptOffset + 11] == 0x01)) {
								// item ball script
								// int itemHere = readWord(scriptOffset + 3);
								itemOffs.add(scriptOffset + 3);
							}
						}
					}
				}

				if (spCount > 0) {
					int signpostsOffset = readPointer(eventOffset + 16);
					for (int sp = 0; sp < spCount; sp++) {
						int spType = rom[signpostsOffset + sp * 12 + 5];
						if (spType >= 5 && spType <= 7) {
							// hidden item
							int itemHere = readWord(signpostsOffset + sp * 12
									+ 8);
							if (itemHere != 0) {
								// itemid 0 is coins
								itemOffs.add(signpostsOffset + sp * 12 + 8);
							}
						}
					}
				}
			}
		}
	}