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

GTA LCS & VCS stucks at loading screen #14216

Closed Panderner closed 3 years ago

Panderner commented 3 years ago

According to https://github.com/hrydgard/ppsspp/pull/13943#issuecomment-783530171 this comment leads that GTA LCS & VCS stucks at loading screen.

anr2me commented 3 years ago

This kinda issue i guess... image image

djdarko commented 3 years ago

Here is a bit of extra information:

Aside from crashing, it also causes the "Loading from Memory Stick" text to be missing from both games:

missing text

Note: Those screens are only shown at startup if save data is present.

The first release with the issue: ppsspp-v1.11.2-52-g5ed594780-windows-amd64

The last release without the issue: ppsspp-v1.11.2-44-g9b13220f4-windows-amd64

hrydgard commented 3 years ago

Yeah, as mentioned in https://github.com/hrydgard/ppsspp/pull/13943#issuecomment-783839963 , the cause is the new handling of the volatile memory, which fixed that NBA game.

We'll either fix or revert.

sum2012 commented 3 years ago

Please note that jpcsp run the game no problem ppsspp v1.11.2-226-g35ad3106f-windows-amd64 log https://gist.github.com/sum2012/51d0f4c849930975254f3adb5b4b151c

unknownbrackets commented 3 years ago

Currently in PPSSPP (ticks):

    0us  59172090 ticks  shutdown start
   98us  59194006 ticks  try lock
 2000us  59616091 ticks  volatile unlock

So it's attempting to unlock after 98us. but we don't unlock for 2000us. After more tests, I see it unlocking BEFORE shutdown finishes, about 27614 cycles (124us.) We probably have some things running too fast, so I'll just make it delayed, but differently delayed.

Edit: except this isn't true for SIZES, which is what GTA uses. Hm.

-[Unknown]

unknownbrackets commented 3 years ago

Correction: for savedata generally, it's indeed tied to thread priority. Both access and graphics threads must run (so the worst of their priorities matter), and they block on SIZES for around 4000us for me. Status does not change until those threads run (i.e. if I block them from running by doing other stuff, the status takes longer to change.)

The graphics thread quits first, then access. Graphics thread gets listed as SceDialogmainGraphics, and has its stack in volatile memory. I can't catch the access thread actually running (but I think it's ScePafJob.)

-[Unknown]