mrehkopf / sd2snes

SD card based multi-purpose cartridge for the SNES
http://sd2snes.de
GNU General Public License v2.0
590 stars 114 forks source link

FX Pak Pro Savestates not working with Shadowrun ROM. #175

Open pecodeguile opened 2 years ago

pecodeguile commented 2 years ago

The game seems to save the state just fine, but then freezes when I try to load the state. The game utilizes all of the buttons, so with Start, Select, L, or R you are bringing up some sort of menu engagement.

I also tried this game with savestate2snes and that didn't work either.

If there's any more info I can provide, I'd be more than happy to!

pecodeguile commented 2 years ago

Does this mean that with the latest update it will work? or still a work in progress? Either way, thank you for your effort!

mrehkopf commented 1 year ago

Can you try with v1.11.0? I fixed a general issue with freezing when loading a state. If it doesn't, there's a chance it can be fixed with an entry in the savestate_fixes.yml file that I can figure out for you.

pecodeguile commented 1 year ago

Hello! And thank you for your work on this!

In Shadowrun, the START button brings up a menu, while the SELECT button brings up your stats. With the original savestate button mapping (START + R), the game would freeze when trying to exit the menu after loading a savestate (START + L).

I altered the config.yml file so that saving a state would be SELECT + R and loading would be SELECT + L. This seemed to work at first! I would save a state, and then load a state, exit out of the status menu and all looked well! However, the game then froze whenever combat was initiated. I could run around in safe areas for seemingly however long I wanted to, but the second that I got near an enemy, the game would freeze.

Hope this helps! Thank you again for your effort, and please let me know if I can be of any further assistance!

-peco

On Sun, Jan 29, 2023 at 7:40 PM mrehkopf @.***> wrote:

Can you try with v1.11.0? I fixed a general issue with freezing when loading a state. If it doesn't, there's a chance it can be fixed with an entry in the savestate_fixes.yml file that I can figure out for you.

— Reply to this email directly, view it on GitHub https://github.com/mrehkopf/sd2snes/issues/175#issuecomment-1407861493, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQX3NHHIJHHSWCSKJ23X5NDWU4LZPANCNFSM5WQY2HZA . You are receiving this because you authored the thread.Message ID: @.***>

redacted173 commented 1 year ago

Try adding the following line to sd2snes/savestate_fixes.yml on the SD card:

F834: 001D00,2140 # Shadowrun (US)

pecodeguile commented 1 year ago

We are definitely getting closer! This time the game went into combat just fine! In fact, I played for 10 minutes and was still able to load an early and late savestate. However, when I used L+R+Select+Start to reset the game and then load a new game, it would no longer load the previous savestate.

It would show the loaded savestate for a brief second, then go completely black screen and unresponsive. It was unplayable after that.

Thank you for your continued effort on this!

On Sat, Feb 4, 2023 at 10:24 AM redacted173 @.***> wrote:

Try adding the following line to sd2snes/savestate_fixes.yml on the SD card:

F834: 001D00,2140 # Shadowrun (US)

— Reply to this email directly, view it on GitHub https://github.com/mrehkopf/sd2snes/issues/175#issuecomment-1416793499, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQX3NHG5IFDCZ2GHQCYXDT3WVZ7DPANCNFSM5WQY2HZA . You are receiving this because you authored the thread.Message ID: @.***>

redacted173 commented 1 year ago

I'm not able to reproduce it. I suggest:

Try using it more and seeing where it fails and where it doesn't consistently. Ikari may have other ideas since he knows the implementation better.

mrehkopf commented 1 year ago

About overlap: Is it really necessary to allow the non-exclusive button combinations (i.e. allow other buttons to be pressed) for the save state features? It compromises a lot of the other button commands...

mrehkopf commented 1 year ago

And yes, the handler will still attempt to load an uninitialized save state, so that can be either just zeros or an existing save state of a game played earlier. Both will lead to undesired behavior :) But in this case I think it could be the overlap - since the "reset game" combination also contains the "save state" combination it might attempt saving a state while the microcontroller is already in the process of resetting the SNES. I'm planning to overhaul the save state handling for v1.11.2, with more assistance by the FPGA also to save CPU cycles and prevent the FF6 menu (and likely other things) from glitching again.

redacted173 commented 1 year ago

Complete overlap may be functional. The suggestions are trying to eliminate some possible races with button presses.

It certainly could lead to an undesirable situation where the state is saved over when someone tries to reset. It all depends on how strict the button checking is done and the order the buttons are pressed. I typically disable in-game buttons and reset using the console buttons.

redacted173 commented 1 year ago

Would it possible to only perform one check per interrupt and have a jump table or self modifying code to change what is checked each time? Seems like that could help eliminate the complexity of the offload and also reduce overhead. Not sure it's necessary to check all conditions on every interrupt.

mrehkopf commented 1 year ago

Sure but I intend to to it using the FPGA instead of 65816 code to save cycles. The current in-game hook implementation (except the save state handler, which is my TODO) uses the FPGA to make decisions about branching and inject branch offsets. Doing everything in 65816 consumed too many cycles which led to compatibility problems with some games. A current issue is the FF6 menus flickering again when in-game save states are enabled for that reason. That's a problem I had earlier before optimizing the hook flow, even without save states :)

pecodeguile commented 1 year ago

Hello!

I remapped the savestate button commands to BR and BL and it works! I was able to turn off the console, remove the fxpak, then start the game over and load a savestate directly where I had last saved it!

Great job! Well done! And thank you ever so much for all of your work on this!

On Tue, Feb 7, 2023 at 2:52 AM mrehkopf @.***> wrote:

Sure but I intend to to it using the FPGA instead of 65816 code to save cycles. The current in-game hook implementation (except the save state handler, which is my TODO) uses the FPGA to make decisions about branching and inject branch offsets. Doing everything in 65816 consumed too many cycles which led to compatibility problems with some games.

— Reply to this email directly, view it on GitHub https://github.com/mrehkopf/sd2snes/issues/175#issuecomment-1420407874, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQX3NHGFE6YEC6MLFPH2RPDWWIELXANCNFSM5WQY2HZA . You are receiving this because you authored the thread.Message ID: @.***>