Workaroud for homebrew loading modules from flash0:/kd/

This commit is contained in:
Henrik Rydgard 2013-06-11 11:48:45 +02:00
parent 112f1b4901
commit 96a15b893c
2 changed files with 25 additions and 1 deletions

View File

@ -64,6 +64,12 @@ enum {
NID_MODULE_SDK_VERSION = 0x11B97506,
};
// This is a workaround for misbehaving homebrew (like TBL's Suicide Barbie (Final)).
static const char *lieAboutSuccessModules[] = {
"flash0:/kd/audiocodec.prx",
"flash0:/kd/libatrac3plus.prx",
};
static const char *blacklistedModules[] = {
"sceATRAC3plus_Library",
"sceFont_Library",
@ -1001,6 +1007,18 @@ u32 sceKernelLoadModule(const char *name, u32 flags, u32 optionAddr)
return SCE_KERNEL_ERROR_ILLEGAL_ADDR;
}
for (size_t i = 0; i < ARRAY_SIZE(lieAboutSuccessModules); i++) {
if (!strcmp(name, lieAboutSuccessModules[i])) {
INFO_LOG(LOADER, "Tries to load module %s. We return a fake module.", lieAboutSuccessModules[i]);
Module *module = new Module;
kernelObjects.Create(module);
memset(&module->nm, 0, sizeof(module->nm));
module->isFake = true;
return module->GetUID();
}
}
PSPFileInfo info = pspFileSystem.GetFileInfo(name);
std::string error_string;
s64 size = (s64)info.size;

View File

@ -282,6 +282,12 @@ float scePowerGetBusClockFrequencyFloat() {
return (float) busFreq;
}
int scePowerTick() {
DEBUG_LOG(HLE, "scePowerTick()");
// Don't think we need to do anything.
return 0;
}
u32 IsPSPNonFat() {
return PSP_MODEL_FAT;
@ -291,7 +297,7 @@ static const HLEFunction scePower[] = {
{0x04B7766E,&WrapI_II<scePowerRegisterCallback>,"scePowerRegisterCallback"},
{0x2B51FE2F,0,"scePower_2B51FE2F"},
{0x442BFBAC,0,"scePowerGetBacklightMaximum"},
{0xEFD3C963,0,"scePowerTick"},
{0xEFD3C963,&WrapI_V<scePowerTick>,"scePowerTick"},
{0xEDC13FE5,0,"scePowerGetIdleTimer"},
{0x7F30B3B1,0,"scePowerIdleTimerEnable"},
{0x972CE941,0,"scePowerIdleTimerDisable"},