Skip to content

Commit

Permalink
5.00 can work now
Browse files Browse the repository at this point in the history
  • Loading branch information
hrimfaxi committed Jun 26, 2011
1 parent 3d410cc commit be3dfb1
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 27 deletions.
4 changes: 4 additions & 0 deletions popsloader/core/exports.exp
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ PSP_EXPORT_FUNC_HASH(module_start)
PSP_EXPORT_VAR_HASH(module_info)
PSP_EXPORT_END

PSP_EXPORT_START(sceIdMgr_driver, 0x0011, 0x0001)
PSP_EXPORT_FUNC_NID(sceIdMgr_driver_F464F91C, 0xF464F91C)
PSP_EXPORT_END

PSP_END_EXPORTS
32 changes: 8 additions & 24 deletions popsloader/core/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,27 +194,6 @@ static int replace_module(int modid, SceSize argsize, void *argp, int *modstatus
return 0;
}

if(pops_fw_version == FW_500 && 0 == strcmp(modname, "scePops_Manager")) {
SceUID modid;
SceModule2 *mod_;
char path[256];

sprintf(path, "%sidmanager.prx", get_module_prefix());
modid = sceKernelLoadModule(path, 0, NULL);

#ifdef DEBUG
if(modid < 0) {
printk("%s: load module %s -> 0x%08X\n", __func__, path, modid);
sceKernelDelayThread(2000000);
}
#endif

mod_ = (SceModule2*) sceKernelFindModuleByUID(modid);
fix_nid((SceModule*)mod_);

modid = sceKernelStartModule(modid, 0, 0, 0, 0);
}

modid = sceKernelLoadModule(redir_path, 0, NULL);

if(modid < 0) {
Expand Down Expand Up @@ -275,6 +254,7 @@ int custom_start_module(int modid, SceSize argsize, void *argp, int *modstatus,
{
int ret, i;
char modpath[128];
SceModule2 *mod;

for(i=0; i<NELEMS(g_list); ++i) {
sprintf(modpath, "%s%s", get_module_prefix(), g_list[i].path);
Expand All @@ -286,6 +266,12 @@ int custom_start_module(int modid, SceSize argsize, void *argp, int *modstatus,
}
}

mod = (SceModule2*) sceKernelFindModuleByUID(modid);

if(0 == strcmp(mod->modname, "sceImpose_Driver")) {
fix_nid((SceModule*)mod);
}

return -1;
}

Expand Down Expand Up @@ -318,13 +304,11 @@ int test_thread(SceSize args, void *argp)
return 0;
}

#if 0
// for those FW required idmanager.prx
int sceIdMgr_driver_F464F91C(void)
{
return 0;
}
#endif

int module_start(SceSize args, void* argp)
{
Expand All @@ -333,7 +317,7 @@ int module_start(SceSize args, void* argp)
pops_fw_version = FW_639;
psp_fw_version = sceKernelDevkitVersion();
psp_model = sceKernelGetModel();
printk_init();
printk_init("ms0:/core.txt");
mount_memory_stick();

if(-1 == load_config() || g_conf.pops_fw_version == psp_fw_version) {
Expand Down
1 change: 0 additions & 1 deletion popsloader/core/nid_500_to_620.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ static nid_entry SysMemForKernel_nid[] = {
{ 0x5339A163, 0xA4AC3934, },
{ 0x950BCB31, 0xFEB5C72B, },
{ 0xD7E24299, 0xF5780DAA, },
{ 0x4803B7F1, 0x02AEA33F, }, // for idmanager.prx
};

static nid_entry ModuleMgrForKernel_nid[] = {
Expand Down
1 change: 0 additions & 1 deletion popsloader/core/nid_500_to_635.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ static nid_entry SysMemForKernel_nid[] = {
{ 0x5339A163, 0xF2FEAFD5, },
{ 0x950BCB31, 0x52B54B93, },
{ 0xD7E24299, 0x208F4820, },
{ 0x4803B7F1, 0x25A760F0, }, // for idmanager.prx
};

static nid_entry ModuleMgrForKernel_nid[] = {
Expand Down
2 changes: 1 addition & 1 deletion popsloader/popcorn/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ all:

TARGET = popcorn

OBJS = main.o icon.o popcorn_patch_offset.o $(PRO_HOME)/Stargate/analog_patch.o
OBJS = main.o icon.o popcorn_patch_offset.o imports.o $(PRO_HOME)/Stargate/analog_patch.o
OBJS += $(PRO_HOME)/Common/utils.o $(PRO_HOME)/Common/strsafe.o $(PRO_HOME)/Common/libs.o

CFLAGS = -Os -G0 -Wall -I. -I$(PRO_HOME)/Common -I$(PRO_HOME)/include
Expand Down
8 changes: 8 additions & 0 deletions popsloader/popcorn/imports.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.set noreorder

#include "pspstub.s"

STUB_START "SysMemForKernel",0x40000011,0x00020005
STUB_FUNC 0x419DB8F4,sceKernelRegisterGetIdFunc
STUB_FUNC 0x6373995D,sceKernelGetModel
STUB_END
9 changes: 9 additions & 0 deletions popsloader/popcorn/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ struct Hooks {
};

extern void patch_analog_imports(SceModule *mod);
extern int sceKernelRegisterGetIdFunc(int (*)(char *path, u8 *key));

SEConfig conf;

Expand Down Expand Up @@ -931,6 +932,13 @@ static void setup_psx_fw_version(u32 fw_version)
_SysMemUserForUser_315AD3A0(fw_version);
}

static int get_keys(char *filename, u8 *keys)
{
memcpy(keys, g_keys, sizeof(g_keys));

return 0;
}

int module_start(SceSize args, void* argp)
{
char keypath[128];
Expand Down Expand Up @@ -959,6 +967,7 @@ int module_start(SceSize args, void* argp)
if(ret == 0) {
g_keys_bin_found = 1;
printk("keys.bin found\n");
sceKernelRegisterGetIdFunc(&get_keys);
}
}

Expand Down

0 comments on commit be3dfb1

Please sign in to comment.