Hey,
I've been trying to get the game menu to recache for a while, and I've got it to work at random intervals. Below is the code I use to simulate an ejection and insertion of the memory stick.
Code: Select all
SceUID cbid = -1;
// Hook function (it's called from vshmain so syscall will do fine)
sctrlHENPatchSyscall(FindProc("sceThreadManager", "ThreadManForUser", 0xE81CAF8F), sceKernelCreateCallbackPatched);
// Patched function which stores callback id
int sceKernelCreateCallbackPatched(const char *name, SceKernelCallbackFunction func, void *arg)
{
int res = sceKernelCreateCallback(name, func, arg);
u32 k1 = pspSdkSetK1(0);
if (strcmp(name, "SceVshMediaDetectMS") == 0)
cbid = res;
pspSdkSetK1(k1);
return res;
}
// Simulate an ejection and insertion event
if (sceKernelFindModuleByName("game_plugin_module"))
{
sceKernelNotifyCallback(cbid, 2);
sceKernelNotifyCallback(cbid, 1);
}
I saw this post from Adrahil, which suggests me that it is possible. A different method to recache the game directory would also be greatly appreciated. I can't do a normal stop and unload module on game_plugin_module either, as that causes a crash.
Thanks in advance,
Bubbletune (JumpR)