Esempio n. 1
0
        private void BasicWindow_Load(object sender, EventArgs e)
        {
            system = FoenixSystem.Current;
            AddGPUControl(system.GPU);

            terminal = new SerialTerminal();

            system.UART1.TransmitByte += SerialTransmitByte;
            system.UART2.TransmitByte += SerialTransmitByte;

            system.GPU.StartOfFrame += SOF;
            system.ResetCPU(true);
            ShowDebugWindow();
            //fix
            //ShowMemoryWindow();

            this.Top   = 0;
            this.Left  = 0;
            this.Width = debugWindow.Left;
            if (this.Width > 1200)
            {
                this.Width = 1200;
            }
            this.Height = Convert.ToInt32(this.Width * 0.75);
        }
Esempio n. 2
0
        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);
                }
            }
        }
Esempio n. 3
0
        public void SetKernel(FoenixSystem kernel)
        {
            this.kernel          = kernel;
            MemoryLimit          = kernel.MemMgr.RAM.Length;
            registerDisplay1.CPU = kernel.CPU;
            knl_breakpoints      = kernel.Breakpoints;
            if (knl_breakpoints.Count > 0)
            {
                BPLabel.Text = knl_breakpoints.Count.ToString() + " BP";
                // Update the combo
                foreach (KeyValuePair <int, string> kvp in knl_breakpoints)
                {
                    BPCombo.Items.Add(kvp.Value);
                    UpdateDebugLines(kvp.Key, true);
                }
            }
            else
            {
                BPLabel.Text = "Breakpoint";
            }

            UpdateQueue();
            int       pc   = kernel.CPU.PC;
            DebugLine line = GetExecutionInstruction(pc);

            if (line == null)
            {
                GenerateNextInstruction(pc);
            }
            DebugPanel.Refresh();
        }
Esempio n. 4
0
 public FoeniXmlFile(FoenixSystem kernel, ResourceChecker resources)
 {
     this.kernel      = kernel;
     this.codeList    = kernel.lstFile.Lines;
     this.BreakPoints = kernel.Breakpoints;
     watchList        = kernel.WatchList;
 }
Esempio n. 5
0
        private void BasicWindow_Load(object sender, EventArgs e)
        {
            kernel   = new FoenixSystem(version, defaultKernel);
            terminal = new SerialTerminal();
            ShowDebugWindow();
            ShowMemoryWindow();

            // Now that the kernel is initialized, allocate variables to the GPU
            gpu.StartOfFrame += SOF;
            gpu.StartOfLine  += SOL;
            gpu.GpuUpdated   += Gpu_Update_Cps_Fps;
            gpu.VRAM          = kernel.MemMgr.VIDEO;
            gpu.RAM           = kernel.MemMgr.RAM;
            gpu.VICKY         = kernel.MemMgr.VICKY;
            // This fontset is loaded just in case the kernel doesn't provide one.
            gpu.LoadFontSet("Foenix", @"Resources\Bm437_PhoenixEGA_8x8.bin", 0, CharacterSet.CharTypeCodes.ASCII_PET, CharacterSet.SizeCodes.Size8x8);

            joystickWindow.gabe = kernel.MemMgr.GABE;

            if (disabledIRQs)
            {
                debugWindow.DisableIRQs(true);
            }

            this.Top  = 0;
            this.Left = 0;
            //this.Width = debugWindow.Left;
            if (this.Width > 1200)
            {
                this.Width = 1200;
            }
            this.Height = Convert.ToInt32(this.Width * 0.75);

            SetDipSwitchMemory();
            // Code is tightly coupled with memory manager
            kernel.MemMgr.UART1.TransmitByte     += SerialTransmitByte;
            kernel.MemMgr.UART2.TransmitByte     += SerialTransmitByte;
            kernel.MemMgr.SDCARD.sdCardIRQMethod += SDCardInterrupt;

            int left = this.Left + (this.Width - watchWindow.Width) / 2;
            int top  = this.Top + (this.Height - watchWindow.Height) / 2;

            watchWindow.Location = new Point(left, top);
            watchWindow.SetKernel(kernel);

            DisplayBoardVersion();
            EnableMenuItems();
            ResetSDCard();

            if (autoRun)
            {
                debugWindow.RunButton_Click(null, null);
            }
            autorunEmulatorToolStripMenuItem.Checked = autoRun;
        }
Esempio n. 6
0
        public void WriteKey(FoenixSystem kernel, ScanCode key)
        {
            // Check if the Keyboard interrupt is allowed
            byte mask = kernel.MemMgr.ReadByte(MemoryLocations.MemoryMap.INT_MASK_REG1);

            if ((~mask & (byte)Register1.FNX1_INT00_KBD) == (byte)Register1.FNX1_INT00_KBD)
            {
                kernel.MemMgr.KEYBOARD.WriteByte(0, (byte)key);
                kernel.MemMgr.KEYBOARD.WriteByte(4, 0);
                // Set the Keyboard Interrupt
                byte IRQ1 = kernel.MemMgr.ReadByte(MemoryLocations.MemoryMap.INT_PENDING_REG1);
                IRQ1 |= (byte)Register1.FNX1_INT00_KBD;
                kernel.MemMgr.WriteByte(MemoryLocations.MemoryMap.INT_PENDING_REG1, IRQ1);
                kernel.CPU.Pins.IRQ = true;
            }
        }
Esempio n. 7
0
        public void SetKernel(FoenixSystem kernel)
        {
            this.kernel          = kernel;
            MemoryLimit          = kernel.MemMgr.RAM.Length;
            registerDisplay1.CPU = kernel.CPU;
            knl_breakpoints      = kernel.Breakpoints;
            UpdateQueue();
            int       pc   = kernel.CPU.PC;
            DebugLine line = GetExecutionInstruction(pc);

            if (line == null)
            {
                GenerateNextInstruction(pc);
            }
            DebugPanel.Refresh();
        }
Esempio n. 8
0
        public void WriteKey(FoenixSystem kernel, ScanCode key)
        {
            // Check if the Keyboard interrupt is allowed
            byte mask = FoenixSystem.Current.MemoryManager.ReadByte(MemoryMap.INT_MASK_REG1);

            if ((~mask & 1) == 1)
            {
                FoenixSystem.Current.MemoryManager.WriteByte(MemoryMap.KBD_DATA_BUF, (byte)key);
                FoenixSystem.Current.MemoryManager.WriteByte(MemoryMap.KBD_DATA_BUF + 4, 0);
                // Set the Keyboard Interrupt
                byte IRQ1 = FoenixSystem.Current.MemoryManager.ReadByte(MemoryMap.INT_PENDING_REG1);
                IRQ1 |= 1;
                FoenixSystem.Current.MemoryManager.WriteByte(MemoryMap.INT_PENDING_REG1, IRQ1);
                kernel.CPU.Pins.IRQ = true;
            }
        }
Esempio n. 9
0
        private void BasicWindow_Load(object sender, EventArgs e)
        {
            kernel   = new FoenixSystem(this.gpu, version, defaultKernel);
            terminal = new SerialTerminal();
            ShowDebugWindow();
            ShowMemoryWindow();
            gpu.StartOfFrame      += SOF;
            performanceTimer.Tick += new System.EventHandler(PerformanceTimer_Tick);
            joystickWindow.beatrix = kernel.MemMgr.BEATRIX;

            if (disabledIRQs)
            {
                debugWindow.DisableIRQs(true);
            }

            if (autoRun)
            {
                debugWindow.RunButton_Click(null, null);
            }

            this.Top  = 0;
            this.Left = 0;
            //this.Width = debugWindow.Left;
            if (this.Width > 1200)
            {
                this.Width = 1200;
            }
            this.Height = Convert.ToInt32(this.Width * 0.75);

            SetDipSwitchMemory();
            // Code is tightly coupled with memory manager
            kernel.MemMgr.UART1.TransmitByte     += SerialTransmitByte;
            kernel.MemMgr.UART2.TransmitByte     += SerialTransmitByte;
            kernel.MemMgr.SDCARD.sdCardIRQMethod += SDCardInterrupt;

            int left = this.Left + (this.Width - watchWindow.Width) / 2;
            int top  = this.Top + (this.Height - watchWindow.Height) / 2;

            watchWindow.Location = new Point(left, top);
            watchWindow.SetKernel(kernel);

            DisplayBoardVersion();
            EnableMenuItems();
            ResetSDCard();
        }
Esempio n. 10
0
        /*
         * Read a Foenix XML file
         */
        private void LoadFNXMLFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog
            {
                Title           = "Load Project File",
                Filter          = "Foenix Project File|*.fnxml",
                CheckFileExists = true
            };

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                debugWindow.Close();
                memoryWindow.Close();
                system = FoenixSystem.Current;

                system.Resources   = ResChecker;
                system.Breakpoints = CPUWindow.Instance.breakpoints;

                system.SetKernel(dialog.FileName);
                system.ResetCPU(true);
                ShowDebugWindow();
                ShowMemoryWindow();
            }
        }
Esempio n. 11
0
 public void SetKernel(FoenixSystem kernel)
 {
     this.kernel = kernel;
 }
Esempio n. 12
0
 public Monitor(FoenixSystem NewKernel)
 {
     this.kernel = NewKernel;
 }
Esempio n. 13
0
 public void SetKernel(FoenixSystem kernel)
 {
     this.system          = kernel;
     registerDisplay1.CPU = kernel.CPU;
     UpdateQueue();
 }
Esempio n. 14
0
 public void SetKernel(FoenixSystem krnl)
 {
     kernel_ref               = krnl;
     WatchGrid.RowCount       = kernel_ref.WatchList.Count;
     WatchUpdateTimer.Enabled = true;
 }