// Read all scroll sets from ROM. private void ReadScrollSets(Rom rom) { ScrollSets.Clear(); List <int> addressesPC = new List <int> (); for (int k = 0; k < AreaCount; k++) { foreach (Room r in Rooms[k]) { int roomArea = r.Width * r.Height; int stateCount = r.RoomStates.Count; addressesPC.Clear(); for (int i = 0; i < stateCount; i++) { int address = Tools.LRtoPC(r.RoomStates [i].ScrollSetPtr); if (address != 0) { addressesPC.Add(address); } } Tools.RemoveDuplicates(addressesPC); for (int i = 0; i < addressesPC.Count; i++) { var s = new ScrollSet(); s.SetSize(roomArea); s.ReadFromROM(rom, addressesPC [i]); ScrollSets.Add(s); } } } }
public void Close() { if (!ProjectLoaded) { return; } Rooms.Clear(); DoorSets.Clear(); Doors.Clear(); ScrollSets.Clear(); PlmSets.Clear(); ScrollPlmDatas.Clear(); Backgrounds.Clear(); Fxs.Clear(); SaveStations.Clear(); LevelDatas.Clear(); EnemySets.Clear(); EnemyGfxs.Clear(); ScrollAsms.Clear(); DoorAsms.Clear(); SetupAsms.Clear(); MainAsms.Clear(); TileSets.Clear(); TileTables.Clear(); TileSheets.Clear(); Palettes.Clear(); AreaMaps.Clear(); PlmTypes.Clear(); EnemyTypes.Clear(); CurrentRom = null; ProjectPath = String.Empty; RomFileName = String.Empty; ProjectFileName = String.Empty; RoomTiles.Clear(); MapTiles.Clear(); BackgroundImage = null; ChangesMade = false; ProjectLoaded = false; ProjectClosed?.Invoke(this, null); }