mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-01 03:57:17 +01:00
Savestate: Keep MipsCall actions of type 0
Action type IDs start at 0, and the first one registered is ActionAfterMipsCall, but MipsCall::DoState used 0 to mean no action. So every call made with __KernelCallAddress lost its action chain on load: the thread's wait state was never restored when the call returned, and chained actions never ran. Version 2 of the section marks a missing action with -1. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
e77f0e46b8
commit
210be3b311
1 file changed
+6
-3
@@ -599,7 +599,7 @@ PSPAction *__KernelCreateAction(int actionType) {
|
||||
|
||||
void MipsCall::DoState(PointerWrap &p)
|
||||
{
|
||||
auto s = p.Section("MipsCall", 1);
|
||||
auto s = p.Section("MipsCall", 1, 2);
|
||||
if (!s)
|
||||
return;
|
||||
|
||||
@@ -624,11 +624,14 @@ void MipsCall::DoState(PointerWrap &p)
|
||||
Do(p, savedId);
|
||||
Do(p, reschedAfter);
|
||||
|
||||
int actionTypeID = 0;
|
||||
// Action type 0 is a real type (ActionAfterMipsCall, the first one registered), so version 1 lost
|
||||
// those actions. Version 2 marks "no action" with -1.
|
||||
const int noAction = s >= 2 ? -1 : 0;
|
||||
int actionTypeID = noAction;
|
||||
if (doAfter != NULL)
|
||||
actionTypeID = doAfter->actionTypeID;
|
||||
Do(p, actionTypeID);
|
||||
if (actionTypeID != 0)
|
||||
if (actionTypeID != noAction)
|
||||
{
|
||||
if (p.mode == p.MODE_READ)
|
||||
doAfter = __KernelCreateAction(actionTypeID);
|
||||
|
||||
Reference in new issue
Block a user