Felk / dolphin

Dolphin is a GameCube / Wii emulator, allowing you to play games for these two platforms on PC with improvements.
https://dolphin-emu.org/
Other
56 stars 10 forks source link

Breakpoints #28

Open TryTwo opened 1 year ago

TryTwo commented 1 year ago

I think there should be an add/remove code breakpoints like there is for memchecks.

Also, it would be nice to specify if any breakpoint should pause on break. For memory breakpoints, specifying read and/or write would also be good.

I could try to add this. Would memory and code breakpoints both go into the same API file? Also not sure the best way to handle the extra args.

fechan commented 1 year ago

+1 for resuming after breakpoints

I tried implementing a function that would resume emulation so I could call it after a breakpoint pauses emulation, but calling it doesn't actually resume emulation for some reason and just causes the Play button in the Dolphin window to break for some reason. I don't know how else to try implementing this.

static PyObject* EmulationResume(PyObject* self)
{
  if (Core::GetState() == Core::State::Paused)
  {
    Core::SetState(Core::State::Running);
  }
  Py_RETURN_NONE;
}

The content of the function is what gets run from MainWindow when you press the play button: https://github.com/dolphin-emu/dolphin/blob/2319210d853899a4d0659c120cfa6162a108daed/Source/Core/DolphinQt/MainWindow.cpp#L794

TryTwo commented 1 year ago

Can you just make a breakpoint without the pause on break flag? That's what I was doing, and the script still stops the game to execute the code.

fechan commented 1 year ago

Ah! I didn't realize you could just set "Write to log" when making a breakpoint. Yeah, that does work.