snes9xgit / snes9x

Snes9x - Portable Super Nintendo Entertainment System (TM) emulator
http://www.snes9x.com
Other
2.63k stars 453 forks source link

Super Keiba 2 is broken with libretro #939

Closed jamsilva closed 2 months ago

jamsilva commented 2 months ago

I compiled the libretro and gtk variants of current master branch and Super Keiba 2 is broken on libretro (I wonder if other games may be suffering the same problem). When you get to the main menu, and select the first option, two other options appear - they are incorrect in the libretro version (see screenshot). Selecting either and trying to go into the game results in a freeze on a black screen; the gtk variant works fine.

Weird

bearoso commented 2 months ago

There shouldn't be any emulation differences. You might have to delete the save ram from the retroarch folder or copy over the .srm the Gtk port is using.

jamsilva commented 2 months ago

You are right, it is a SRAM issue. I was hitting the problem mentioned in https://snes.nesdev.org/wiki/Tricky-to-emulate_games. Memory.ClearSRAM() does not get called on the libretro port and thus the SRAM is initialized to all 0s. I deleted the .srm and added a call to Memory.ClearSRAM() right before the return in retro_load_game and that fixes the problem.

bearoso commented 2 months ago

I added that call to ClearSRAM to master.