private void LoadFile(string filename) { try { var temp = new Memory(); temp.Load(filename, out var start, out _); Text = $@"C64 Memory Visualizer - {filename}"; Memory = temp; DisplayPointer.FromInt(start.Value); DisassemblyStartAddress.FromInt(start.Value); DisplayMode = DisplayMode.HexRaw; if (Memory != null) { MemOverview = MemOverview.Create( Memory, Height, DisplayMode == DisplayMode.Disassembly ? DisassemblyStartAddress.Value : 0); } RenderScreen(); } catch { MessageBox.Show($@"The file ""{filename}"" could not be loaded.", Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void MainWindow_Resize(object sender, EventArgs e) { _screenPainter.RecalcGridFontSize = true; if (Memory != null && (MemOverview?.NeedsRecreating(Height) ?? false)) { MemOverview = MemOverview.Create(Memory, Height, DisplayMode == DisplayMode.Disassembly ? DisassemblyStartAddress.Value : 0); } Invalidate(); }
private void spriteToolStripMenuItem_Click(object sender, EventArgs e) { foreach (ToolStripMenuItem item in viewToolStripMenuItem.DropDownItems) { item.Checked = false; } spriteToolStripMenuItem.Checked = true; previousByteToolStripMenuItem.Enabled = true; nextByteToolStripMenuItem.Enabled = true; DisplayMode = DisplayMode.Sprite; _screenRenderer = new SpriteScreenRenderer(ScreenCharacterMap.Rows, Characters); MemOverview = MemOverview.Create(Memory, Height, DisplayMode == DisplayMode.Disassembly ? DisassemblyStartAddress.Value : 0); RenderScreen(); }