Skip to content

Commit

Permalink
Merge pull request #14731 from unknownbrackets/savedata-start
Browse files Browse the repository at this point in the history
Dialog: Lock volatile when the access thread runs
  • Loading branch information
hrydgard committed Aug 15, 2021
2 parents f01d4d6 + 04828e8 commit 92e7534
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Core/HLE/sceUtility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,15 @@ void __UtilityShutdown() {
void UtilityDialogInitialize(UtilityDialogType type, int delayUs, int priority) {
int partDelay = delayUs / 4;
const u32_le insts[] = {
// Make sure we don't discard/deadbeef 'em.
// Make sure we don't discard/deadbeef a0.
(u32_le)MIPS_MAKE_ORI(MIPS_REG_S0, MIPS_REG_A0, 0),

(u32_le)MIPS_MAKE_ORI(MIPS_REG_A0, MIPS_REG_ZERO, 0),
(u32_le)MIPS_MAKE_ORI(MIPS_REG_A1, MIPS_REG_ZERO, 0),
(u32_le)MIPS_MAKE_ORI(MIPS_REG_A2, MIPS_REG_ZERO, 0),
(u32_le)MIPS_MAKE_SYSCALL("sceSuspendForUser", "sceKernelVolatileMemLock"),

(u32_le)MIPS_MAKE_ORI(MIPS_REG_A0, MIPS_REG_S0, 0),
(u32_le)MIPS_MAKE_SYSCALL("sceUtility", "__UtilityWorkUs"),
(u32_le)MIPS_MAKE_ORI(MIPS_REG_A0, MIPS_REG_S0, 0),
(u32_le)MIPS_MAKE_SYSCALL("sceUtility", "__UtilityWorkUs"),
Expand All @@ -286,12 +293,6 @@ void UtilityDialogInitialize(UtilityDialogType type, int delayUs, int priority)
(u32_le)MIPS_MAKE_ORI(MIPS_REG_A0, MIPS_REG_S0, 0),
(u32_le)MIPS_MAKE_SYSCALL("sceUtility", "__UtilityWorkUs"),

// Now actually lock the volatile memory. Maybe this should be earlier...
(u32_le)MIPS_MAKE_ORI(MIPS_REG_A0, MIPS_REG_ZERO, 0),
(u32_le)MIPS_MAKE_ORI(MIPS_REG_A1, MIPS_REG_ZERO, 0),
(u32_le)MIPS_MAKE_ORI(MIPS_REG_A2, MIPS_REG_ZERO, 0),
(u32_le)MIPS_MAKE_SYSCALL("sceSuspendForUser", "sceKernelVolatileMemLock"),

(u32_le)MIPS_MAKE_ORI(MIPS_REG_A0, MIPS_REG_ZERO, (int)type),
(u32_le)MIPS_MAKE_JR_RA(),
(u32_le)MIPS_MAKE_SYSCALL("sceUtility", "__UtilityInitDialog"),
Expand Down

0 comments on commit 92e7534

Please sign in to comment.