hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.42k stars 2.19k forks source link

Silent Hill - Shattered Memories - Memory Stick Not Inserted issue #13781

Open alkaris2 opened 3 years ago

alkaris2 commented 3 years ago

What happens?

While playing Silent Hill - Shattered Memories I cannot save the game from the in-game Save Menu, because it's telling me that it can't find the Save Data that I created when I started a new game. It's right there in directory where it first created it, but for some reason the emulator cannot see the data exists for the game to read and save to.

ULUS10450_00000

I can only use Save States to save the game, not the in-game Save option. I tried checking the System settings for Memory Stick Inserted option to check that it is in fact Enabled from the menu. Toggling on and off doesn't seem to change whether if it detects the Save Data that already exists.

I've tried other stuff like creating appropriate directories for SAVEDATA directories like so;

~/.config/ppsspp/PSP/memstick/PSP/SAVEDATA/<GAME_ID_DIR>

~/.config/ppsspp/memstick/PSP/SAVEDATA/<GAME_ID_DIR>

doesn't read or detect any of these directories.

What should happen?

You should be able to save game data from the in-game Save option as normal by reading and saving that data from SAVEDATA in ~/.config/ppsspp/PSP/SAVEDATA directory.

What hardware, operating system, and PPSSPP version? On desktop, GPU matters for graphical issues.

CPU: Intel™ Core® i7-7700K RAM: Trident Z RGB 32Gb GPU: Asus GTX 1070

OS: Manjaro Linux - 5.9.11-3-MANJARO PPSSPP Version: v1.10.3

LunaMoo commented 3 years ago

Probably just a duplicate of #7244

Try restarting emulation and loading the game from in-game save(not using savestates), then try to save. If it does save, then it's the mentioned issues. Games have protection/validation for memstick and abusing savestates can break it by simply loading a savestate made before last in-game savedata was made. This is an user time travel issue which can't really be fixed, but games can usually be easily patched via cheats to disable that memstick protection allowing to save anyway.

alkaris2 commented 3 years ago

@LunaMoo I've tried this, I've tried restarting emulation and it does not work. I created a new test file to test it out, but if you try to load the initial save data that it creates, it says the save data it created is corrupt, when the save file isn't corrupt, the save file is sane.

The game is just simply broken with no way to save the game the properly way from in-game. Because new file shouldn't be read as corrupt if the game created it and put it into the SAVEDATA directory as it would on real PSP hardware. No Save States, just save file of the game itself. -- I don't know of any game codes or cheats for SH: Shattered Memories that could bypass this memstick protection if this game has that. So for the time being the only way of saving the game is through Save States unless there's a patch code for the game or something the emulator can provide for the game to recognise the save data correctly.

unknownbrackets commented 3 years ago

A few suggestions:

That said, this isn't the first time this has been reported: https://forums.ppsspp.org/showthread.php?tid=23072&pid=103356#pid103356

The weird thing is, plenty of people have played the game, reported issues with other things, and not had saving issues. This makes me think it's related to a patched ISO.

-[Unknown]

MiguelCardonaG commented 3 years ago

The same problem also happens on Android, if you make any changes within the Settings section, when saving this problem comes out:

Screenshot_20201227-184839_PPSSPP

I have tried it with a clean ISO and with three different smartphones and in all gives the same problem.

unknownbrackets commented 3 years ago

It happens when you change settings? That means saving works as long as you don't?

What if you go to settings, change nothing, and return to the game?

-[Unknown]

MiguelCardonaG commented 3 years ago

@unknownbrackets If I don't change anything within Settings, and I give Cancel there's no error.

unknownbrackets commented 3 years ago

Interesting. I wonder if it could be checking the mtime of all files on the memory stick, really?

-[Unknown]

MiguelCardonaG commented 3 years ago

Interesting. I wonder if it could be checking the mtime of all files on the memory stick, really?

-[Unknown]

The funny or strange thing is that if you want to save the game later, that error occurs.

Saramagrean commented 1 year ago

Try with v1.16.6 is work fine on PC but still happen on Android.

https://github.com/hrydgard/ppsspp/assets/26355472/8ee9ef60-049d-4cbc-90fd-6039d72b2911

sum2012 commented 1 year ago

Confirm v1.16.6 is work fine on PC but still happen on Android. How to test MemstickFixedFree option in android ? I cannot find compat.ini in android.

hrydgard commented 1 year ago

It's built-in the APK on Android, but you can add an extra compat.ini in memstick/PSP/SYSTEM for quick tests.

sum2012 commented 1 year ago

unlucky, MemstickFixedFree not work PPSSPP v1.16.6-235-g3611b4d94 Windows 64 bit log: (Create a new save, Change option,then save again) https://gist.github.com/sum2012/7ea46cca9f4c3f3079f37d707165c462

Marcost9 commented 1 year ago

Right now, I'm playing: Silent Hill Sharrind Memory on the app. Over the years, I've noticed some changes in the scenery that don't exist in the other version of the console, namely: shadows, detail in the scenery itself. I understood at that moment that there was a limitation of the console, but it was not the console but the application. But I didn't give up, I, being a bit picky, took the courage to fix the problem and it worked. So, checking the option: "software rendering" but another problem appeared, which was a drop in FPS/speed. Perhaps with future updates this graphical problem will appear less. The application has portacia.eu, I intend to study a little programming to solve these problems

blurrred commented 7 months ago

Same problem on Manjaro Linux. Just gonna try the PCSX2 version and see if it works better.

antipirgos commented 4 months ago

Same problem with both versions on Android. Any cheat code save fix for this problem ??? Maybe Synchronize Save cheat. 🤔

sum2012 commented 4 months ago

Maybe relate to #19275

hrydgard commented 4 months ago

Looking at sceUtility output, After LIST, GETSIZE, FILES, WRITEDATASECURE and then LIST again, it gives up on Android while it happily continues on Windows. Must be some filesystem weirdness.. Not sure why it wouldn't recognize its own files in LIST...

Think I'll have to add a bunch of logging to see what's different.

hrydgard commented 4 months ago

Ok, so this fails on macOS and also Linux and iOS as well, and it doesn't look like it's failing writing. So weird that it only works on Windows..

I'm starting to suspect some more memory issues with the savegame encryption (fixed one bug a while ago, there might be more).

hrydgard commented 4 months ago

Got some time to valgrind it, and it indeed warns about a use of an uninitialized value in the encryption code, which could definitely cause this type of issue..

EDIT: Hm, this same valgrind warning also occurs in for example Wipeout, which has no problem saving.

This really is baffling. (though would like to fix the warning regardless)..

=5454== Thread 22 SaveIO:
==5454== Use of uninitialised value of size 8
==5454==    at 0x8E63F2: rijndaelEncrypt (AES.c:962)
==5454==    by 0x8E6807: AES_cbc_encrypt (AES.c:1319)
==5454==    by 0x8E5557: kirk_CMD4.part.0 (kirk_engine.c:327)
==5454==    by 0x40F0C3: kirkSendCmd (sceChnnlsv.cpp:102)
==5454==    by 0x40F0C3: sceSdCreateList_(_pspChnnlsvContext2&, int, int, unsigned char*, unsigned char const*) (sceChnnlsv.cpp:436)
==5454==    by 0x5EE4CF: SavedataParam::EncryptData(unsigned int, unsigned char*, int*, int*, unsigned char*, unsigned char*) (SavedataParam.cpp:949)
==5454==    by 0x5F3D17: SavedataParam::Save(SceUtilitySavedataParam*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) (SavedataParam.cpp:494)
==5454==    by 0x5E9C3F: PSPSaveDialog::ExecuteIOAction() (PSPSaveDialog.cpp:1083)
==5454==    by 0x5E9DE0: DoExecuteIOAction(PSPSaveDialog*) (PSPSaveDialog.cpp:1209)
==5454==    by 0x4C01252: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==5454==    by 0x4EEEAC2: start_thread (pthread_create.c:442)
==5454==    by 0x4F7FA03: clone (clone.S:100)
==5454== 
sum2012 commented 4 months ago

ppsspp v1.17-1-893-gg5c26aa4c96 android version The same problem also happens on Android, if you make any changes within the Settings section, when saving this problem comes out

antipirgos commented 3 months ago

Still can't save game in version build v1.17.1-980 Android Version 😢

hrydgard commented 3 months ago

Yes, this is still unsolved (and quite mysterious). Updates will be posted here if it gets fixed, unless a commit is related to save data or similar, no need to respond with "still not working".

hrydgard commented 1 month ago

I've been messing around some more with this, adding more logging, but the API-surface behavior of the game seems to be pretty much identical between Windows (where it works) and Linux (where it doesn't).. no easily detectable errors. No idea what's going on here.

I first thought it had to be some kind of file system semantic, like case sensitivity, but the filenames contain only numbers, and it has problems both on old-school Android shared storage and on scoped storage. I really don't get it :/

antipirgos commented 1 month ago

This is interesting but won't work for me https://youtu.be/721mNkwJR6Q?si=XJ_eY-oARPpR-FIY https://youtu.be/M4Tn4_JzRnc?si=g0_iSJE-gabazscM