From f8cb1c2902374c47323875e89b0d5c42fc0e68b9 Mon Sep 17 00:00:00 2001 From: hrimfaxi Date: Wed, 29 Jun 2011 20:48:49 +0800 Subject: [PATCH] added 352 support --- popsloader/Makefile | 3 ++ popsloader/core/replace_module.c | 2 + popsloader/core/resolve_nid.c | 4 +- popsloader/loader/ui.c | 1 + popsloader/popcorn/Makefile | 5 ++ popsloader/popcorn/main.c | 14 ++++-- popsloader/popcorn/popcorn_patch_offset.c | 58 ++++++++++++++++++++++- 7 files changed, 81 insertions(+), 6 deletions(-) diff --git a/popsloader/Makefile b/popsloader/Makefile index 5c40a55..c484477 100644 --- a/popsloader/Makefile +++ b/popsloader/Makefile @@ -12,6 +12,9 @@ all: @cp -f core/popscore.prx dist @cp -rf modules dist make $(EXTRA_OPTIONS) clean -C popcorn + make $(EXTRA_OPTIONS) CONFIG_352=1 -C popcorn + @cp -f popcorn/popcorn.prx dist/modules/352/ + make $(EXTRA_OPTIONS) clean -C popcorn make $(EXTRA_OPTIONS) CONFIG_371=1 -C popcorn @cp -f popcorn/popcorn.prx dist/modules/371/ make $(EXTRA_OPTIONS) clean -C popcorn diff --git a/popsloader/core/replace_module.c b/popsloader/core/replace_module.c index 6b9099e..2ed6640 100644 --- a/popsloader/core/replace_module.c +++ b/popsloader/core/replace_module.c @@ -120,6 +120,8 @@ const char *get_module_prefix(void) sprintf(buf, "%s%s%s/", is_ef0() ? "ef" : "ms", MODULE_PATH, "373"); } else if(pops_fw_version == FW_371) { sprintf(buf, "%s%s%s/", is_ef0() ? "ef" : "ms", MODULE_PATH, "371"); + } else if(pops_fw_version == FW_352) { + sprintf(buf, "%s%s%s/", is_ef0() ? "ef" : "ms", MODULE_PATH, "352"); } else { printk("%s: Unknown version: 0x%08X\n", __func__, pops_fw_version); asm("break"); diff --git a/popsloader/core/resolve_nid.c b/popsloader/core/resolve_nid.c index e36b3f5..5d0d282 100644 --- a/popsloader/core/resolve_nid.c +++ b/popsloader/core/resolve_nid.c @@ -51,7 +51,7 @@ void setup_nid_resolver(void) nid_fix = nid_fix_400_to_620; } - if(pops_fw_version >= FW_371 && pops_fw_version <= FW_373) { + if(pops_fw_version <= FW_373) { nid_fix_size = nid_fix_373_to_620_size; nid_fix = nid_fix_373_to_620; } @@ -73,7 +73,7 @@ void setup_nid_resolver(void) nid_fix = nid_fix_400_to_635; } - if(pops_fw_version >= FW_371 && pops_fw_version <= FW_373) { + if(pops_fw_version <= FW_373) { nid_fix_size = nid_fix_373_to_635_size; nid_fix = nid_fix_373_to_635; } diff --git a/popsloader/loader/ui.c b/popsloader/loader/ui.c index 3756f25..d07c070 100644 --- a/popsloader/loader/ui.c +++ b/popsloader/loader/ui.c @@ -167,6 +167,7 @@ int menu_ctrl(struct Menu *menu) } struct MenuItem main_menu_items[] = { + { "3.52 pops", FW_352, }, { "3.71 pops", FW_371, }, { "3.73 pops", FW_373, }, { "4.00 pops", FW_400, }, diff --git a/popsloader/popcorn/Makefile b/popsloader/popcorn/Makefile index ad7a3e6..2159410 100644 --- a/popsloader/popcorn/Makefile +++ b/popsloader/popcorn/Makefile @@ -14,6 +14,11 @@ OBJS += $(PRO_HOME)/Common/printk.o else endif +ifeq ($(CONFIG_352), 1) +CFLAGS += -DCONFIG_352=1 +PSP_FW_VERSION = 352 +endif + ifeq ($(CONFIG_371), 1) CFLAGS += -DCONFIG_371=1 PSP_FW_VERSION = 371 diff --git a/popsloader/popcorn/main.c b/popsloader/popcorn/main.c index 1d13507..89718b1 100644 --- a/popsloader/popcorn/main.c +++ b/popsloader/popcorn/main.c @@ -832,7 +832,9 @@ static void patch_icon0_size(u32 text_addr) patch_addr = text_addr + g_offs->pops_patch.ICON0SizeOffset[psp_model]; - if(psp_fw_version <= FW_373) { + if(psp_fw_version <= FW_352) { + _sw(0x24030000 | (sizeof(g_icon_png) & 0xFFFF), patch_addr); + } else if(psp_fw_version <= FW_373) { _sw(0x24090000 | (sizeof(g_icon_png) & 0xFFFF), patch_addr); } else { _sw(0x24050000 | (sizeof(g_icon_png) & 0xFFFF), patch_addr); @@ -873,8 +875,14 @@ static int popcorn_patch_chain(SceModule2 *mod) patch_icon0_size(text_addr); } - sceMeAudio_67CD7972 = (void*)sctrlHENFindFunction("scePops_Manager", "sceMeAudio", g_offs->pops_patch.sceMeAudio_67CD7972_NID); - hook_import_bynid((SceModule*)mod, "sceMeAudio", g_offs->pops_patch.sceMeAudio_67CD7972_NID, _sceMeAudio_67CD7972, 1); + if(psp_fw_version <= FW_352) { + sceMeAudio_67CD7972 = (void*)sctrlHENFindFunction("scePops_Manager", "scePopsMan", g_offs->pops_patch.sceMeAudio_67CD7972_NID); + hook_import_bynid((SceModule*)mod, "scePopsMan", g_offs->pops_patch.sceMeAudio_67CD7972_NID, _sceMeAudio_67CD7972, 1); + } else { + sceMeAudio_67CD7972 = (void*)sctrlHENFindFunction("scePops_Manager", "sceMeAudio", g_offs->pops_patch.sceMeAudio_67CD7972_NID); + hook_import_bynid((SceModule*)mod, "sceMeAudio", g_offs->pops_patch.sceMeAudio_67CD7972_NID, _sceMeAudio_67CD7972, 1); + } + _sw(0x24020001, text_addr + g_offs->pops_patch.manualNameCheck[psp_model]); for(i=0; i #include "popcorn_patch_offset.h" -#if !defined(CONFIG_635) && !defined(CONFIG_620) && !defined(CONFIG_639) && !defined(CONFIG_610) && !defined(CONFIG_600) && !defined(CONFIG_551) && !defined(CONFIG_550) && !defined(CONFIG_503) && !defined(CONFIG_501) && !defined(CONFIG_500) && !defined(CONFIG_400) && !defined(CONFIG_373) && !defined(CONFIG_371) +#if !defined(CONFIG_635) && !defined(CONFIG_620) && !defined(CONFIG_639) && !defined(CONFIG_610) && !defined(CONFIG_600) && !defined(CONFIG_551) && !defined(CONFIG_550) && !defined(CONFIG_503) && !defined(CONFIG_501) && !defined(CONFIG_500) && !defined(CONFIG_400) && !defined(CONFIG_373) && !defined(CONFIG_371) && !defined(CONFIG_352) #error You have to define one of CONFIG_FW_VERSION #endif @@ -672,6 +672,56 @@ PatchOffset g_371_offsets = { }; #endif +#ifdef CONFIG_352 +PatchOffset g_352_offsets = { + .fw_version = FW_352, + .popsman_patch = { + .get_rif_path = 0xDEADBEEF, + .get_rif_path_call1 = 0xDEADBEEF, + .get_rif_path_call2 = 0xDEADBEEF, + .sceNpDrmGetVersionKeyCall = 0xDEADBEEF, + .scePspNpDrm_driver_9A34AC9F_Call = 0xDEADBEEF, + .scePopsManLoadModuleCheck = 0x00000240, + }, + .pops_patch = { + .decomp = { + { 0x0002BD20, 0x00013E50 }, // 01G + { 0x0002BD20, 0x00013E50 }, // 02G + { 0x0002BD20, 0x00013E50 }, // 03G + { 0x0002BD20, 0x00013E50 }, // 04G + { 0x0002BD20, 0x00013E50 }, // 05G + { 0x0002BD20, 0x00013E50 }, // unused + { 0x0002BD20, 0x00013E50 }, // unused + { 0x0002BD20, 0x00013E50 }, // unused + { 0x0002BD20, 0x00013E50 }, // unused + }, + .ICON0SizeOffset = { + 0x00025080, // 01G + 0x00025080, // 02G + 0x00025080, // 03G + 0x00025080, // 04G + 0x00025080, // 05G + 0x00025080, // unused + 0x00025080, // unused + 0x00025080, // unused + 0x00025080, // unused + }, + .manualNameCheck = { + 0x0001AF18, // 01G + 0x0001AF18, // 02G + 0x0001AF18, // 03G + 0x0001AF18, // 04G + 0x0001AF18, // 05G + 0x0001AF18, // unused + 0x0001AF18, // unused + 0x0001AF18, // unused + 0x0001AF18, // unused + }, + .sceMeAudio_67CD7972_NID = 0xFC56480E, + }, +}; +#endif + PatchOffset *g_offs = NULL; void setup_patch_offset_table(u32 fw_version) @@ -753,4 +803,10 @@ void setup_patch_offset_table(u32 fw_version) g_offs = &g_371_offsets; } #endif + +#ifdef CONFIG_352 + if(fw_version == g_352_offsets.fw_version) { + g_offs = &g_352_offsets; + } +#endif }