Ejemplo n.º 1
0
        public void SwitchToXmb()
        {
            Log.WriteLine(Verbosity.Normal, Feature.General, "Instance: switching to game picker");
            _video.Cleanup();
#if XMB
            _xmb.Enable();
#else
            DummyDelegate del = delegate()
            {
                try
                {
                    //this.Stop();
                    _picker = new Noxa.Emulation.Psp.Player.GamePicker.PickerDialog(this);
                    if (_picker.ShowDialog(_host.Player) == System.Windows.Forms.DialogResult.OK)
                    {
                    }
                    _picker = null;
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Debugger.Break();
                    throw ex;
                }
            };
            _host.Player.Invoke(del);
#endif
        }
Ejemplo n.º 2
0
        public void OnStopped()
        {
            DummyDelegate del = delegate
            {
                this.State = DebuggerState.Detached;
                this.OnStateChanged();
            };

            this.Window.Invoke(del);
        }
Ejemplo n.º 3
0
        public void OnStopped()
        {
            DummyDelegate del = delegate
            {
                this.Log.OnStopped();
                this.Statistics.OnStopped();

                this.State = DebuggerState.Detached;
                this.OnStateChanged();
            };

            this.View.Invoke(del);
        }
Ejemplo n.º 4
0
        public void OnContinue(bool steppingForward)
        {
            DummyDelegate del = delegate
            {
                if (steppingForward == false)
                {
                    this.Code.Disable();
                }

                this.State = DebuggerState.Running;
                this.OnStateChanged();
            };

            this.View.Invoke(del);
        }
Ejemplo n.º 5
0
        public void OnStepComplete(uint address)
        {
            DummyDelegate del = delegate
            {
                this.SetStatusText("Step completed, now at 0x{0:X8}", address);

                this.PC = address;
                this.JumpToAddress(NavigationTarget.Code, address, true);

                this.State = DebuggerState.Broken;
                this.OnStateChanged();
            };

            this.Window.Invoke(del);
        }
Ejemplo n.º 6
0
        public void OnStarted(GameInformation game, Stream bootStream)
        {
            // Need to marshal all UI calls to the proper thread
            DummyDelegate del = delegate
            {
                this.State = DebuggerState.Running;
                this.OnStateChanged();

                foreach (DebuggerTool tool in this.Tools)
                {
                    tool.OnStarted();
                }
            };

            this.Window.Invoke(del);
        }
Ejemplo n.º 7
0
        public void OnContinue(bool steppingForward)
        {
            DummyDelegate del = delegate
            {
                if (steppingForward == false)
                {
                    this.DisableAll();
                }

                this.SetStatusText("Running...");

                this.State = DebuggerState.Running;
                this.OnStateChanged();
            };

            this.Window.Invoke(del);
        }
Ejemplo n.º 8
0
        public bool OnError(Error error)
        {
            DummyDelegate del = delegate
            {
                this.SetStatusText("Error hit at 0x{0:X8}: {1}", error.PC, error.Message);

                this.PC = error.PC;
                this.JumpToAddress(NavigationTarget.Code, error.PC, true);

                this.State = DebuggerState.Broken;
                this.OnStateChanged();
            };

            this.Window.Invoke(del);

            return(true);
        }
Ejemplo n.º 9
0
        public void OnModuleLoaded()
        {
            DummyDelegate del = delegate
            {
                try
                {
                    this.CodeCache.Update();
                    this.Breakpoints.Update();
                    this.CodeTool.InvalidateAll();
                }
                catch
                {
                    throw;
                }
            };

            this.Window.Invoke(del);
        }
Ejemplo n.º 10
0
        public void OnBreakpointHit(int id)
        {
            Breakpoint bp = this.Breakpoints[id];

            Debug.Assert(bp != null);
            if (bp == null)
            {
                // Not found?
                this.SetStatusText("Breakpoint hit; ERROR BP NOT FOUND");
                return;
            }

            DummyDelegate del = delegate
            {
                switch (bp.Type)
                {
                case BreakpointType.CodeExecute:
                    this.SetStatusText("Breakpoint hit; now at 0x{0:X8}", bp.Address);
                    this.PC = bp.Address;
                    this.JumpToAddress(NavigationTarget.Code, bp.Address, true);
                    break;

                case BreakpointType.Stepping:
                    this.SetStatusText("Step completed; now at 0x{0:X8}", bp.Address);
                    this.PC = bp.Address;
                    this.JumpToAddress(NavigationTarget.Code, bp.Address, true);
                    break;

                case BreakpointType.MemoryAccess:
                    uint pc = this.DebugHost.CpuHook.GetCoreState(0).ProgramCounter;
                    this.SetStatusText("Breakpoint hit; memory access at 0x{0:X8} of 0x{1:X8}", pc, bp.Address);
                    this.PC = pc;
                    this.JumpToAddress(NavigationTarget.Memory, bp.Address, true);
                    this.JumpToAddress(NavigationTarget.Code, pc, true);
                    break;
                }

                this.State = DebuggerState.Broken;
                this.OnStateChanged();
            };

            this.Window.Invoke(del);
        }
Ejemplo n.º 11
0
        public void OnStarted(GameInformation game, Stream bootStream)
        {
            // Need to marshal all UI calls to the proper thread
            DummyDelegate del = delegate
            {
                this.Log.OnStarted();
                this.Statistics.OnStarted();

                this.View.SetStatusText(Verbosity.Normal, "Connection to emulator {0} established.", this.Host.HostString);

                this.State = DebuggerState.Running;
                this.OnStateChanged();
            };

            this.View.Invoke(del);

            // TEST
            Breakpoint bp = new Breakpoint(this.AllocateID(), BreakpointType.CodeExecute, 0x08900334);
            //this.Breakpoints.Add( bp );
        }
Ejemplo n.º 12
0
 public static Delegate CreateDelegate(DummyDelegate d)
 {
     return d;
 }
Ejemplo n.º 13
0
        private void CurrentInstance_StateChanged(object sender, EventArgs e)
        {
            DummyDelegate del = delegate()
            {
                InstanceState state;
                if (_host.CurrentInstance != null)
                {
                    state = _host.CurrentInstance.State;
                }
                else
                {
                    state = InstanceState.Idle;
                }

                this.pauseToolStripButton.Checked = (state == InstanceState.Paused);

                bool invalidate = false;
                switch (state)
                {
                case InstanceState.Idle:
                    this.startToolStripButton.Enabled      = true;
                    this.pauseToolStripButton.Enabled      = false;
                    this.stopToolStripButton.Enabled       = false;
                    this.restartToolStripButton.Enabled    = false;
                    this.screenshotToolStripButton.Enabled = false;
                    this.configureToolStripButton.Enabled  = true;
                    this.debugToolStripButton.Enabled      = true;
                    this.attachToolStripButton.Enabled     = false;
                    this.splashPicture.Visible             = true;
                    invalidate = true;
                    break;

                case InstanceState.Running:
                    this.startToolStripButton.Enabled      = false;
                    this.pauseToolStripButton.Enabled      = true;
                    this.stopToolStripButton.Enabled       = true;
                    this.restartToolStripButton.Enabled    = true;
                    this.screenshotToolStripButton.Enabled = true;
                    this.configureToolStripButton.Enabled  = false;
                    this.debugToolStripButton.Enabled      = false;
                    this.attachToolStripButton.Enabled     = true;
                    this.splashPicture.Visible             = false;
                    break;

                case InstanceState.Paused:
                    this.startToolStripButton.Enabled      = false;
                    this.pauseToolStripButton.Enabled      = true;
                    this.stopToolStripButton.Enabled       = true;
                    this.restartToolStripButton.Enabled    = true;
                    this.screenshotToolStripButton.Enabled = true;
                    this.configureToolStripButton.Enabled  = false;
                    this.debugToolStripButton.Enabled      = false;
                    this.attachToolStripButton.Enabled     = true;
                    this.splashPicture.Visible             = false;
                    break;

                case InstanceState.Ended:
                    this.startToolStripButton.Enabled      = true;
                    this.pauseToolStripButton.Enabled      = false;
                    this.stopToolStripButton.Enabled       = false;
                    this.restartToolStripButton.Enabled    = true;
                    this.screenshotToolStripButton.Enabled = false;
                    this.configureToolStripButton.Enabled  = true;
                    this.debugToolStripButton.Enabled      = true;
                    this.attachToolStripButton.Enabled     = false;
                    this.splashPicture.Visible             = true;
                    invalidate = true;
                    break;

                case InstanceState.Crashed:
                case InstanceState.Debugging:
                default:
                    this.startToolStripButton.Enabled      = false;
                    this.pauseToolStripButton.Enabled      = false;
                    this.stopToolStripButton.Enabled       = false;
                    this.restartToolStripButton.Enabled    = true;
                    this.screenshotToolStripButton.Enabled = false;
                    this.configureToolStripButton.Enabled  = true;
                    this.debugToolStripButton.Enabled      = false;
                    this.attachToolStripButton.Enabled     = true;
                    this.splashPicture.Visible             = true;
                    invalidate = true;
                    break;
                }

                if (invalidate == true)
                {
                    this.BackColor = Color.White;
                    this.Invalidate(true);
                    this.Update();
                }
                this.Text = "PSP Player - " + this.GetStatusText();
            };

            this.Invoke(del);
        }
 /// <summary>
 /// Asserts that the delegate was called.
 /// </summary>
 /// <param name="dummyDelegate">The dummy delegate.</param>
 protected abstract void AssertDelegateWasCalledWithArgument(DummyDelegate dummyDelegate);
Ejemplo n.º 15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DummyClass"/> class.
 /// </summary>
 /// <param name="dummyService">The dummy service.</param>
 /// <param name="dummyDelegate">The dummy delegate</param>
 public DummyClass(IDummyService dummyService, DummyDelegate dummyDelegate)
 {
     this.DummyService = dummyService;
     this.DummyDelegate = dummyDelegate;
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Asserts that the delegate was called.
 /// </summary>
 /// <param name="dummyDelegate">The dummy delegate.</param>
 protected abstract void AssertDelegateWasCalledWithArgument(DummyDelegate dummyDelegate);
Ejemplo n.º 17
0
 /// <summary>
 /// Asserts that the delegate was called.
 /// </summary>
 /// <param name="dummyDelegate">The dummy delegate.</param>
 protected override void AssertDelegateWasCalledWithArgument(DummyDelegate dummyDelegate)
 {
     dummyDelegate.AssertWasCalled(s => s("argument"));
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Asserts that the delegate was called.
 /// </summary>
 /// <param name="dummyDelegate">The dummy delegate.</param>
 protected override void AssertDelegateWasCalledWithArgument(DummyDelegate dummyDelegate)
 {
     A.CallTo(() => dummyDelegate("argument")).MustHaveHappened();
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Asserts that the delegate was called.
 /// </summary>
 /// <param name="dummyDelegate">The dummy delegate.</param>
 protected override void AssertDelegateWasCalledWithArgument(DummyDelegate dummyDelegate)
 {
     Mock.Get(dummyDelegate).Verify(d => d("argument"));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DummyClass"/> class.
 /// </summary>
 /// <param name="dummyService">The dummy service.</param>
 /// <param name="dummyDelegate">The dummy delegate</param>
 public DummyClass(IDummyService dummyService, DummyDelegate dummyDelegate)
 {
     this.DummyService  = dummyService;
     this.DummyDelegate = dummyDelegate;
 }
 /// <summary>
 /// Asserts that the delegate was called.
 /// </summary>
 /// <param name="dummyDelegate">The dummy delegate.</param>
 protected override void AssertDelegateWasCalledWithArgument(DummyDelegate dummyDelegate)
 {
     dummyDelegate.AssertWasCalled(s => s("argument"));
 }
 /// <summary>
 /// Asserts that the delegate was called.
 /// </summary>
 /// <param name="dummyDelegate">The dummy delegate.</param>
 protected override void AssertDelegateWasCalledWithArgument(DummyDelegate dummyDelegate)
 {
     A.CallTo(() => dummyDelegate("argument")).MustHaveHappened();
 }
Ejemplo n.º 23
0
 /// <summary>
 /// Asserts that the delegate was called.
 /// </summary>
 /// <param name="dummyDelegate">The dummy delegate.</param>
 protected override void AssertDelegateWasCalledWithArgument(DummyDelegate dummyDelegate)
 {
     dummyDelegate.Received()("argument");
 }
 /// <summary>
 /// Asserts that the delegate was called.
 /// </summary>
 /// <param name="dummyDelegate">The dummy delegate.</param>
 protected override void AssertDelegateWasCalledWithArgument(DummyDelegate dummyDelegate)
 {
     dummyDelegate.Received()("argument");
 }
 /// <summary>
 /// Asserts that the delegate was called.
 /// </summary>
 /// <param name="dummyDelegate">The dummy delegate.</param>
 protected override void AssertDelegateWasCalledWithArgument(DummyDelegate dummyDelegate)
 {
     Mock.Get(dummyDelegate).Verify(d => d("argument"));
 }