public static void GetMaps() { for (int i = 0; i < RomData.SceneList.Count; i++) { int f = RomData.SceneList[i].File; RomUtils.CheckCompressed(f); int j = 0; while (true) { byte cmd = RomData.MMFileList[f].Data[j]; if (cmd == 0x04) { byte mapcount = RomData.MMFileList[f].Data[j + 1]; int mapsaddr = (int)ReadWriteUtils.Arr_ReadU32(RomData.MMFileList[f].Data, j + 4) & 0xFFFFFF; for (int k = 0; k < mapcount; k++) { Map m = new Map(); m.File = RomUtils.AddrToFile((int)ReadWriteUtils.Arr_ReadU32(RomData.MMFileList[f].Data, mapsaddr)); RomData.SceneList[i].Maps.Add(m); mapsaddr += 8; } break; } if (cmd == 0x14) { break; } j += 8; } } }
public static void ReadSceneTable() { RomData.SceneList = new List <Scene>(); int f = RomUtils.GetFileIndexForWriting(SCENE_TABLE); int _SceneTable = SCENE_TABLE - RomData.MMFileList[f].Addr; int i = 0; while (true) { Scene s = new Scene(); uint saddr = ReadWriteUtils.Arr_ReadU32(RomData.MMFileList[f].Data, _SceneTable + i); if (saddr > 0x4000000) { break; } if (saddr != 0) { s.File = RomUtils.AddrToFile((int)saddr); s.Number = i >> 4; RomData.SceneList.Add(s); } i += 16; } }