Skip to content

Commit

Permalink
400 pops will replace impose.prx, fix part
Browse files Browse the repository at this point in the history
  • Loading branch information
hrimfaxi committed Jun 28, 2011
1 parent cc96025 commit f350e51
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 30 deletions.
29 changes: 3 additions & 26 deletions popsloader/core/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,9 @@ static int replace_module(int modid, SceSize argsize, void *argp, int *modstatus
imp->attribute = 0x0009;
}

#if 1
if(0 == strcmp(mod->modname, "sceImpose_Driver")) {
// patch sceAudio_driver import flags
// because in 4.xx kernel scePops_Manager doesn't have sceAudio_driver exported
imp = find_import_lib((SceModule*)mod, "sceAudio_driver");
imp->attribute = 0x0009;
}
#endif
sprintf((char*)((SceModule2*)mod)->text_addr + 0x000087B8, "%simpose.rsc", get_module_prefix());
}
}

if(0 == strcmp(mod->modname, "scePaf_Module")) {
Expand Down Expand Up @@ -407,7 +402,6 @@ int custom_start_module(int modid, SceSize argsize, void *argp, int *modstatus,

(void)(mod);

#if 0
if(pops_fw_version == FW_400) {
sprintf(modpath, "%s%s", get_module_prefix(), "impose.prx");
ret = replace_module(modid, argsize, argp, modstatus, opt, "sceImpose_Driver", modpath);
Expand All @@ -416,23 +410,6 @@ int custom_start_module(int modid, SceSize argsize, void *argp, int *modstatus,
return ret;
}
}
#endif

#if 1
mod = (SceModule2*) sceKernelFindModuleByUID(modid);

if(0 == strcmp(mod->modname, "sceImpose_Driver")) {
PspModuleImport *imp;

fix_nid((SceModule*)mod);

// patch sceAudio_driver import flags
if(pops_fw_version == FW_400) {
imp = find_import_lib((SceModule*)mod, "sceAudio_driver");
imp->attribute = 0x0009;
}
}
#endif

return -1;
}
Expand All @@ -449,7 +426,7 @@ static int popsloader_patch_chain(SceModule2 *mod)
{
printk("%s: %s\n", __func__, mod->modname);

if(pops_fw_version <= FW_551) {
if(pops_fw_version >= FW_500 && pops_fw_version <= FW_551) {
if(0 == strcmp(mod->modname, "sceImpose_Driver")) {
SceModule2 *mod_;
u32 sceImposeGetParam_NID = -1;
Expand Down
4 changes: 2 additions & 2 deletions popsloader/core/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#ifndef MAIN_H
#define MAIN_H

//#define USE_PRINTK 1
#undef USE_PRINTK
#define USE_PRINTK 1
//#undef USE_PRINTK

#ifdef USE_PRINTK
#include "printk.h"
Expand Down
11 changes: 9 additions & 2 deletions popsloader/core/nid_400_to_620.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ static nid_entry ModuleMgrForKernel_nid[] = {
static nid_entry LoadExecForKernel_nid[] = {
{ 0x63D88393, 0x29413885, },
// for impose.prx
{ 0x2EAA8A5A, 0x915A8B44, },
{ 0x6274D0D5, 0x2E96EDF8, },
{ 0x2EAA8A5A, 0x63BB2F2C, },
{ 0x6274D0D5, 0xB848CC2C, },
};

static nid_entry sceImpose_driver_nid[] = {
Expand Down Expand Up @@ -175,6 +175,12 @@ static nid_entry KDebugForKernel_nid[] = {
{ 0x59E95C49, 0xD9DB4F02, },
};

static nid_entry InterruptManagerForKernel_nid[] = {
// for impose.prx
{ 0x169FC5A3, 0xC03C8D51, },
{ 0xB940A5BF, 0x3C161DFB, },
};

resolver_config nid_fix_400_to_620[] = {
NID_ENTRY(SysMemForKernel),
NID_ENTRY(ModuleMgrForKernel),
Expand All @@ -193,6 +199,7 @@ resolver_config nid_fix_400_to_620[] = {
NID_ENTRY(sceHprm_driver),
NID_ENTRY(sceDve_driver),
NID_ENTRY(KDebugForKernel),
NID_ENTRY(InterruptManagerForKernel),
};

u32 nid_fix_400_to_620_size = NELEMS(nid_fix_400_to_620);

0 comments on commit f350e51

Please sign in to comment.