SkyTemple / py-desmume

Python Library and GUI for DeSmuME, the Nintendo DS emulator
GNU General Public License v3.0
25 stars 5 forks source link

Advancing emulator to next instruction #29

Open mike8699 opened 1 year ago

mike8699 commented 1 year ago

The desmume.emulator.DeSmuME().cycle() method advances execution by one frame, but there doesn't seem to be a way to advance by one instruction. Does such a capability exist in py-desmume? I wasn't able to find one in the docs.

I tried to do some hacky stuff like setting a breakpoint using register_exec to the next instruction and pausing the emulator there, but this doesn't seem to work when the next instruction is the result of a branch.

Is there a way to accomplish this using py-desmume, and if not, would you be open to a PR that adds it? The latest desmume version seems to have expanded debugging features, so I'd be happy to take a look to see if there's somewhere the interface could hook into to get this into py-desmume. no promises that I would succeed, but I'm willing to try if you're open to it 😄 .

theCapypara commented 1 year ago

Hi! This isn't really something that is supported yet. The functionality would probably be needed to be added to the interface upstream first: https://github.com/TASEmulators/desmume/tree/master/desmume/src/frontend/interface