private void LoadHexFile(bool ResetMemory) { OpenFileDialog dialog = new OpenFileDialog { Filter = "Hex Filed|*.hex", CheckFileExists = true }; if (dialog.ShowDialog() == DialogResult.OK) { debugWindow.Close(); memoryWindow.Close(); if (ResetMemory) { system = FoenixSystem.Current; AddGPUControl(system.GPU); } system.SetKernel(dialog.FileName); system.ResetCPU(ResetMemory); ShowDebugWindow(); ShowMemoryWindow(); if (tileEditor != null && tileEditor.Visible) { tileEditor.SetMemory(system.MemoryManager); } } }
private void TileEditorToolStripMenuItem_Click(object sender, EventArgs e) { if (tileEditor == null) { tileEditor = new TileEditor(); tileEditor.SetMemory(kernel.MemMgr); tileEditor.SetResourceChecker(kernel.ResCheckerRef); gpu.TileEditorMode = true; // Set Vicky into Tile mode previousGraphicMode = kernel.MemMgr.VICKY.ReadByte(0); kernel.MemMgr.VICKY.WriteByte(0, 0x10); // Enable borders kernel.MemMgr.VICKY.WriteByte(4, 1); CenterForm(tileEditor); tileEditor.Show(); tileEditor.FormClosed += new FormClosedEventHandler(EditorWindowClosed); // coordinate between the tile editor window and the GPU canvas this.TileClicked += new TileClickEvent(tileEditor.TileClicked_Click); } else { tileEditor.BringToFront(); } }
private void TileEditorToolStripMenuItem_Click(object sender, EventArgs e) { if (tileEditor == null) { tileEditor = new TileEditor(); tileEditor.SetMemory(system.MemoryManager); system.GPU.TileEditorMode = true; //// Set Vicky into Tile mode //previousGraphicMode = system.VICKY.ReadByte(0); //system.VICKY.WriteByte(0, 0x10); //// Enable borders //system.VICKY.WriteByte(4, 1); // Set Vicky into Tile mode previousGraphicMode = FoenixSystem.Current.MemoryManager.ReadByte(MemoryMap.VICKY_BASE_ADDR); FoenixSystem.Current.MemoryManager.WriteByte(MemoryMap.VICKY_BASE_ADDR, 0x10); // Enable borders FoenixSystem.Current.MemoryManager.WriteByte(MemoryMap.VICKY_BASE_ADDR + 4, 1); tileEditor.Show(); tileEditor.FormClosed += new FormClosedEventHandler(EditorWindowClosed); // coordinate between the tile editor window and the GPU canvas this.TileClicked += new TileClickEvent(tileEditor.TileClicked_Click); } else { tileEditor.BringToFront(); } }