bsnes-emu / bsnes

bsnes is a Super Nintendo (SNES) emulator focused on performance, features, and ease of use.
Other
1.71k stars 160 forks source link

Implement soft-patching for libretro core #157

Open fox140cv opened 3 years ago

fox140cv commented 3 years ago

Is it possible to add this function again ?, shortly after Byuu left the project the soft patch stopped working in the libretro core.

Screwtapello commented 3 years ago

I don't know about the various bsnes-based cores libretro has used in the past, but as of right now the current libretro core has a commented-out call to apply a soft-patch:

https://github.com/bsnes-emu/bsnes/blob/6b38388a673512963bd3fe9e004c17765cdd1a18/bsnes/target-libretro/program.cpp#L483

The equivalent code in the standalone bsnes UI tries soft-patching both IPS and BPS:

https://github.com/bsnes-emu/bsnes/blob/0ab0ab69572a88be6dcc633662d5e2cda807ea45/bsnes/target-bsnes/program/game.cpp#L127-L128

Uncommenting the call in the libretro target won't work, since the applyPatchIPS function only exists in the standalone UI right now - I assume that commented-out call is leftover from when the libretro core was created. It may be as easy as copying the applyPatchIPS and applyPatchBPS functions across and calling them in the right place.. or maybe it's more complex than that. Either way, this should probably be done sooner or later.