Ejemplo n.º 1
0
        public void SetPCToSelect(string fileName, int lineNumber)
        {
            if (!this.debugTableReverse.Contains(fileName.ToLower() + ":" + (lineNumber + 1)))
            {
                MessageBox.Show("Unable to set statement here!");
                return;
            }

            string newPC = this.debugTableReverse[fileName.ToLower() + ":" + (lineNumber + 1)].ToString();
            Emulator.Z80_State state = this.emulatorWindow.emulator.GetState();
            Emulator.MEMSTATE memState = this.emulatorWindow.emulator.GetMemState();

            state.PC = UInt16.Parse(newPC.Substring(3, 4), NumberStyles.HexNumber);
            byte page = byte.Parse(newPC.Substring(0, 2), NumberStyles.HexNumber);
            if (this.isAnApp)
            {
                page = (byte)(this.apppage - page);
                memState.page1 = page;
                memState.ram1 = 0;
            }
            else
            {
                memState.page2 = 1;
                memState.ram2 = 1;
            }

            this.removeHighlight();
            this.highlightLine(lineNumber + 1);

            this.emulatorWindow.emulator.SetState(state);
            this.emulatorWindow.emulator.SetMemState(memState);
            GlobalClass.debugPanel.updateRegisters();
        }
Ejemplo n.º 2
0
 private string getPageNum(string address)
 {
     int addressLoc = int.Parse(address, NumberStyles.HexNumber);
     string page = "00";
     Emulator.MEMSTATE memstate = GlobalClass.emulator.GetMemState();
     if (addressLoc < 0x4000) // && memstate.ram0 == 0)
     {
         page = memstate.page0.ToString("X2");
     }
     if (addressLoc >= 0x4000 && addressLoc < 0x8000) // && memstate.ram1 == 0)
     {
         page = ((int)this.apppage - memstate.page1).ToString("X2");
     }
     if (addressLoc >= 0x8000 && addressLoc < 0xC000) // && memstate.ram2 == 0)
     {
         page = memstate.page2.ToString("X2");
     }
     if (addressLoc >= 0xC000 && addressLoc < 0x10000) // && memstate.ram3 == 0)
     {
         page = memstate.page3.ToString("X2");
     }
     return page;
 }