From 6e1c55fcc8791346aa45150af57723e2af6e5e86 Mon Sep 17 00:00:00 2001 From: Julian R <25588072+julerobb1@users.noreply.github.com> Date: Thu, 8 Jan 2026 20:05:13 -0600 Subject: [PATCH 01/56] Create DiscoveryDevice.cs --- DiscoveryDevice.cs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 DiscoveryDevice.cs diff --git a/DiscoveryDevice.cs b/DiscoveryDevice.cs new file mode 100644 index 00000000..c36f18f9 --- /dev/null +++ b/DiscoveryDevice.cs @@ -0,0 +1,32 @@ +using System; + +namespace ProcessorEmulator +{ + public class DiscoveryDevice : IBusDevice + { + public uint StartAddress => 0x1FC00100; // Just after the Reset Vector + public uint Size => 0x100; + + // A simple table defining the "Universe" of this machine + private readonly uint[] _configTable = new uint[] { + 0x4D495053, // Magic: "MIPS" + 0x10400000, // UART Base + 0x10000000, // Framebuffer Base + 640, // Screen Width + 480, // Screen Height + 0x0002A000 // Chipset ID (BCM7405) + }; + + public uint Read32(uint offset) + { + int index = (int)(offset / 4); + return (index < _configTable.Length) ? _configTable[index] : 0; + } + + public void Write32(uint offset, uint value) { /* Read Only */ } + public void Write16(uint address, ushort value) { /* Read Only */ } + public void Write8(uint address, byte value) { /* Read Only */ } + public ushort Read16(uint address) { return 0; } + public byte Read8(uint address) { return 0; } + } +} From 37414745c0d7c956cfce4f2b92a73b6bb0cbaa55 Mon Sep 17 00:00:00 2001 From: Julian R <25588072+julerobb1@users.noreply.github.com> Date: Thu, 8 Jan 2026 20:05:17 -0600 Subject: [PATCH 02/56] Update PlatformManager.cs --- PlatformManager.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/PlatformManager.cs b/PlatformManager.cs index a4a1a509..4b4e9e51 100644 --- a/PlatformManager.cs +++ b/PlatformManager.cs @@ -12,6 +12,7 @@ public static void ApplyConfiguration(string platform, MipsBus bus, CP0 cp0) bus.AddDevice(new RamDevice(0x00000000, 128 * 1024 * 1024)); // 128MB RAM bus.AddDevice(new BcmUart(0x10400000)); // Standard BCM UART bus.AddDevice(new BcmInterruptController(0x10000000)); + bus.AddDevice(new DiscoveryDevice()); break; case "iguide": From ffffaee7ac9021a27ca3e0b5f2fd35c72839ac6e Mon Sep 17 00:00:00 2001 From: Julian R <25588072+julerobb1@users.noreply.github.com> Date: Thu, 8 Jan 2026 20:12:03 -0600 Subject: [PATCH 03/56] Update EmulatorDisplay.cs --- Emulation/EmulatorDisplay.cs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Emulation/EmulatorDisplay.cs b/Emulation/EmulatorDisplay.cs index 6e5ed576..52e94de4 100644 --- a/Emulation/EmulatorDisplay.cs +++ b/Emulation/EmulatorDisplay.cs @@ -60,6 +60,34 @@ public EmulatorDisplay(GenericFramebuffer vram) _backBuffer = new Bitmap(640, 480, PixelFormat.Format32bppRgb); _screen.Image = _backBuffer; + + InitializeHardwareMonitor(); + } + + private void InitializeHardwareMonitor() + { + // Creating a Windows 7 style 'Property Grid' or 'ListView' + ListView hardwareList = new ListView + { + //View = View.Details, + FullRowSelect = true, + GridLines = true, + Location = new Point(660, 12), + Size = new Size(250, 482), + //BackColor = SystemColors.Window, + //Font = new Font("Segoe UI", 9) // The Windows 7 standard font + }; + + hardwareList.Columns.Add("Component", 100); + hardwareList.Columns.Add("Address", 120); + + hardwareList.Items.Add(new ListViewItem(new[] { "CPU Core", "MIPS32 R2" })); + hardwareList.Items.Add(new ListViewItem(new[] { "UART (Serial)", "0x10400000" })); + hardwareList.Items.Add(new ListViewItem(new[] { "Video RAM", "0x10000000" })); + + this.Controls.Add(hardwareList); + // Expand the window to fit the monitor + this.Width += 270; } public void RenderFrame() From 617b5327cdc89758fbb0ed10ccf7831b72bd3f93 Mon Sep 17 00:00:00 2001 From: Julian R <25588072+julerobb1@users.noreply.github.com> Date: Thu, 8 Jan 2026 20:27:40 -0600 Subject: [PATCH 04/56] Update EmulatorConsole.cs --- EmulatorConsole.cs | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/EmulatorConsole.cs b/EmulatorConsole.cs index e4a3e6c5..02ad71b2 100644 --- a/EmulatorConsole.cs +++ b/EmulatorConsole.cs @@ -1,7 +1,6 @@ using System; using System.Drawing; using System.Windows.Forms; - using System.Linq; namespace ProcessorEmulator @@ -12,9 +11,8 @@ public partial class EmulatorConsole : Form public EmulatorConsole() { - // Set the classic Win32 look this.Text = "MIPS System Console"; - this.BackColor = SystemColors.Control; // Classic Gray + this.BackColor = SystemColors.Control; this.Size = new Size(800, 600); _terminal = new RichTextBox @@ -42,22 +40,16 @@ public void AppendText(string text) _terminal.SelectionStart = _terminal.Text.Length; _terminal.ScrollToCaret(); } - - public void AppendChar(char c) - { - AppendText(c.ToString()); - } + // Intercepts key presses to send to the emulated UART. protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { - // Convert the key to an ASCII character char c = (char)0; if (keyData == Keys.Enter) c = '\r'; else if (keyData == Keys.Back) c = '\b'; else if (keyData >= Keys.A && keyData <= Keys.Z) { - // Handle Shift for uppercase/lowercase bool shift = (ModifierKeys & Keys.Shift) != 0; c = (char)(keyData.ToString()[0]); if (!shift) c = char.ToLower(c); @@ -66,21 +58,16 @@ protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { c = keyData.ToString().Last(); } - // Add more cases for symbols/space as needed... else if (keyData == Keys.Space) c = ' '; - if (c != 0) + // Send the character to the UART if it's a valid one. + if (c != 0 && Program.CurrentUart != null) { - // Access your UART instance and send the key - // Assuming you have a reference to the active UART - if (Program.CurrentUart != null) - { - Program.CurrentUart.SendKey(c); - return true; // Mark as handled - } + Program.CurrentUart.SendKey(c); + return true; } return base.ProcessCmdKey(ref msg, keyData); } } -} +} \ No newline at end of file From f5b494449ea37d966691d42edb081aa12ac6ce3c Mon Sep 17 00:00:00 2001 From: Julian R <25588072+julerobb1@users.noreply.github.com> Date: Thu, 8 Jan 2026 20:29:14 -0600 Subject: [PATCH 05/56] Added Llama proofing do not touch the spaghetti --- MainWindow.xaml | 558 +++--------------------------------------------- 1 file changed, 25 insertions(+), 533 deletions(-) diff --git a/MainWindow.xaml b/MainWindow.xaml index f8477b91..cb596570 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -1,541 +1,33 @@ - - - - + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" + Title="MIPS Universal Emulator - Aero Classic" Height="700" Width="1000"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -