예제 #1
0
void DSPDebuggerLLE::OnChangeState(wxCommandEvent& event)
{
  if (DSPCore_GetState() == DSPCORE_STOP)
    return;

  switch (event.GetId())
  {
  case ID_RUNTOOL:
    if (DSPCore_GetState() == DSPCORE_RUNNING)
      DSPCore_SetState(DSPCORE_STEPPING);
    else
      DSPCore_SetState(DSPCORE_RUNNING);
    break;

  case ID_STEPTOOL:
    if (DSPCore_GetState() == DSPCORE_STEPPING)
    {
      DSPCore_Step();
      Repopulate();
    }
    break;

  case ID_SHOWPCTOOL:
    FocusOnPC();
    break;
  }

  UpdateState();
  m_mgr.Update();
}
예제 #2
0
// This one has basic idle skipping, and checks breakpoints.
int RunCyclesDebug(int cycles)
{
    // First, let's run a few cycles with no idle skipping so that things can progress a bit.
    for (int i = 0; i < 8; i++)
    {
        if (g_dsp.cr & CR_HALT)
            return 0;
        if (dsp_breakpoints.IsAddressBreakPoint(g_dsp.pc))
        {
            DSPCore_SetState(DSPCORE_STEPPING);
            return cycles;
        }
        Step();
        cycles--;
        if (cycles < 0)
            return 0;
    }

    while (true)
    {
        // Next, let's run a few cycles with idle skipping, so that we can skip
        // idle loops.
        for (int i = 0; i < 8; i++)
        {
            if (g_dsp.cr & CR_HALT)
                return 0;
            if (dsp_breakpoints.IsAddressBreakPoint(g_dsp.pc))
            {
                DSPCore_SetState(DSPCORE_STEPPING);
                return cycles;
            }
            // Idle skipping.
            if (DSPAnalyzer::code_flags[g_dsp.pc] & DSPAnalyzer::CODE_IDLE_SKIP)
                return 0;
            Step();
            cycles--;
            if (cycles < 0)
                return 0;
        }

        // Now, lets run some more without idle skipping.
        for (int i = 0; i < 200; i++)
        {
            if (dsp_breakpoints.IsAddressBreakPoint(g_dsp.pc))
            {
                DSPCore_SetState(DSPCORE_STEPPING);
                return cycles;
            }
            Step();
            cycles--;
            if (cycles < 0)
                return 0;
            // We don't bother directly supporting pause - if the main emu pauses,
            // it just won't call this function anymore.
        }
    }
}