private void resetWorldMapToolStripMenuItem_Click(object sender, EventArgs e) { if (MessageBox.Show("You're about to undo all changes to the current world map. Go ahead with reset?", "LAZY SHELL", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } int pointer = Bits.GetShort(Model.ROM, worldMap.Tileset * 2 + 0x3E0014); int offset = 0x3E0000 + pointer + 1; Model.WorldMapTilesets[worldMap.Tileset] = Comp.Decompress(Model.ROM, offset, 0x800); worldMap = new WorldMap(index); RefreshWorldMap(); }
private void openWorldMaps_Click(object sender, EventArgs e) { if (!Comp.LunarCompressExists()) return; AppControl.WorldMaps(); }
private void openMonsters_Click(object sender, EventArgs e) { if (!Comp.LunarCompressExists()) return; AppControl.Monsters(); }
private void openMainTitle_Click(object sender, EventArgs e) { if (!Comp.LunarCompressExists()) return; AppControl.MainTitle(); }
private void openLevels_Click(object sender, System.EventArgs e) { if (!Comp.LunarCompressExists()) return; AppControl.Levels(); }
private void openFormations_Click(object sender, EventArgs e) { if (!Comp.LunarCompressExists()) return; AppControl.Formations(); }
private void openDialogues_Click(object sender, EventArgs e) { if (!Comp.LunarCompressExists()) return; AppControl.Dialogues(); }
private void openBattlefields_Click(object sender, EventArgs e) { if (!Comp.LunarCompressExists()) return; AppControl.Battlefields(); }
// functions private void Initialize() { ProgressBar pBar = new ProgressBar(Model.ROM, "CALCULATING...", 428); pBar.Show(); int bank, index, size, bankIndex; int offset; Color bg; ListViewItem item; bank = 0x160000; // Set bank pointer index = 0; // Set initial index for this bank bankIndex = 0; offset = 0x00DA; // Set initial offset for this bank bg = Color.White; for (; index < 109; index++, bankIndex++) { size = Comp.Compress(Model.Tilemaps[index], null); if (offset + size > 0xFFFF) // Do we pass the bounds of this bank? { bg = Color.Red; } item = new ListViewItem(new string[] { index.ToString(), (bank >> 16).ToString("X2"), (bank + (bankIndex * 2)).ToString("X2"), (bank + offset).ToString("X6"), size.ToString("X"), (0xFFFF - (offset + size + 1)).ToString("X"), }); item.BackColor = bg; tilemapListView.Items.Add(item); pBar.PerformStep("TILE MAP #" + index.ToString("d3")); offset++; offset += size; } bank = 0x170000; // Set bank pointer index = 109; // Set initial index for this bank bankIndex = 0; offset = 0x006C; // Set initial offset for this bank bg = Color.FromArgb(240, 240, 240); for (; index < 163; index++, bankIndex++) { size = Comp.Compress(Model.Tilemaps[index], null); if (offset + size > 0xFFFF) // Do we pass the bounds of this bank? { bg = Color.Red; } item = new ListViewItem(new string[] { index.ToString(), (bank >> 16).ToString("X2"), (bank + (bankIndex * 2)).ToString("X2"), (bank + offset).ToString("X6"), size.ToString("X"), (0xFFFF - (offset + size + 1)).ToString("X"), }); item.BackColor = bg; tilemapListView.Items.Add(item); pBar.PerformStep("TILE MAP #" + index.ToString("d3")); offset++; offset += size; } bank = 0x180000; // Set bank pointer index = 163; // Set initial index for this bank bankIndex = 0; offset = 0x0070; // Set initial offset for this bank bg = Color.FromArgb(224, 224, 224); for (; index < 219; index++, bankIndex++) { size = Comp.Compress(Model.Tilemaps[index], null); if (offset + size > 0xFFFF) // Do we pass the bounds of this bank? { bg = Color.Red; } item = new ListViewItem(new string[] { index.ToString(), (bank >> 16).ToString("X2"), (bank + (bankIndex * 2)).ToString("X2"), (bank + offset).ToString("X6"), size.ToString("X"), (0xFFFF - (offset + size + 1)).ToString("X"), }); item.BackColor = bg; tilemapListView.Items.Add(item); pBar.PerformStep("TILE MAP #" + index.ToString("d3")); offset++; offset += size; } bank = 0x190000; // Set bank pointer index = 219; // Set initial index for this bank bankIndex = 0; offset = 0x0070; // Set initial offset for this bank bg = Color.FromArgb(240, 240, 240); for (; index < 275; index++, bankIndex++) { size = Comp.Compress(Model.Tilemaps[index], null); if (offset + size > 0xFFFF) // Do we pass the bounds of this bank? { bg = Color.Red; } item = new ListViewItem(new string[] { index.ToString(), (bank >> 16).ToString("X2"), (bank + (bankIndex * 2)).ToString("X2"), (bank + offset).ToString("X6"), size.ToString("X"), (0xFFFF - (offset + size + 1)).ToString("X"), }); item.BackColor = bg; tilemapListView.Items.Add(item); pBar.PerformStep("TILE MAP #" + index.ToString("d3")); offset++; offset += size; } bank = 0x1A0000; // Set bank pointer index = 275; // Set initial index for this bank bankIndex = 0; offset = 0x0044; // Set initial offset for this bank bg = Color.FromArgb(255, 255, 255); for (; index < 309; index++, bankIndex++) { size = Comp.Compress(Model.Tilemaps[index], null); if (offset + size > 0xFFFF) // Do we pass the bounds of this bank? { bg = Color.Red; } item = new ListViewItem(new string[] { index.ToString(), (bank >> 16).ToString("X2"), (bank + (bankIndex * 2)).ToString("X2"), (bank + offset).ToString("X6"), size.ToString("X"), (0xFFFF - (offset + size + 1)).ToString("X"), }); item.BackColor = bg; tilemapListView.Items.Add(item); pBar.PerformStep("TILE MAP #" + index.ToString("d3")); offset++; offset += size; } /****PHYSICAL MAPS****/ bank = 0x1B0000; // Set bank pointer index = 0; // Set initial index for this bank bankIndex = 0; offset = 0x00A0; // Set initial offset for this bank bg = Color.White; for (; index < 80; index++, bankIndex++) { size = Comp.Compress(Model.SolidityMaps[index], null); if (offset + size > 0xFFFF) // Do we pass the bounds of this bank? { bg = Color.Red; } item = new ListViewItem(new string[] { index.ToString(), (bank >> 16).ToString("X2"), (bank + (bankIndex * 2)).ToString("X2"), (bank + offset).ToString("X6"), size.ToString("X"), (0xFFFF - (offset + size + 1)).ToString("X"), }); item.BackColor = bg; soliditymapListView.Items.Add(item); pBar.PerformStep("SOLIDITY MAP #" + index.ToString("d3")); offset++; offset += size; } bank = 0x1C0000; // Set bank pointer index = 80; // Set initial index for this bank bankIndex = 0; offset = 0x0050; // Set initial offset for this bank bg = Color.FromArgb(240, 240, 240); for (; index < 120; index++, bankIndex++) { size = Comp.Compress(Model.SolidityMaps[index], null); if (offset + size > 0x7FFF) // Do we pass the bounds of this bank? { bg = Color.Red; } item = new ListViewItem(new string[] { index.ToString(), (bank >> 16).ToString("X2"), (bank + (bankIndex * 2)).ToString("X2"), (bank + offset).ToString("X6"), size.ToString("X"), (0xFFFF - (offset + size + 1)).ToString("X"), }); item.BackColor = bg; soliditymapListView.Items.Add(item); pBar.PerformStep("SOLIDITY MAP #" + index.ToString("d3")); offset++; offset += size; } pBar.Close(); }