for (int i = 0; i < spData.length; i++) { if (! isSpriteDataLoaded(i)) loadSpriteData(rom,i); } }
int spPtrsAddress = HackModule.toRegPointer(rom.readMulti(spAsmPointer,3)); int ptr = rom.readMulti(spPtrsAddress + (areaNum * 2), 2); spData[areaNum] = new ArrayList(); if (ptr > 0) { int[] data = rom.read( spDataBase + ptr, (rom.read(spDataBase + ptr) * 4) + 2); for (int j = 0; j < data[0]; j++) { short tpt = (short) (data[2 + (j * 4)] + (data[3 + (j * 4)] * 0x100)); TPTEditor.TPTEntry tptEntry; try { tptEntry = TPTEditor.tptEntries[tpt]; } catch (java.lang.ArrayIndexOutOfBoundsException e) { System.out.println("Sprite entry #" + j + " of area #" + areaNum + " has a bad tpt value (0x" + Integer.toHexString(tpt) + ")"); tpt = 0; tptEntry = TPTEditor.tptEntries[tpt]; }  SpriteEditor.SpriteInfoBlock sib = SpriteEditor.sib[tptEntry.getSprite()]; short spriteX = (short) (data[5 + (j * 4)] - (sib.width * 4)); short spriteY = (short) (data[4 + (j * 4)] - (sib.height * 6)); spData[areaNum].add(new SpriteLocation( tpt, spriteX, spriteY)); } } }
        public static void loadSpriteData(AbstractRom rom)        {        	for (int i = 0; i < spData.length; i++)        	{ 			        		if (! isSpriteDataLoaded(i))        			loadSpriteData(rom,i);        	}        }