Skip to content

Commit

Permalink
added 352 support
Browse files Browse the repository at this point in the history
  • Loading branch information
hrimfaxi committed Jun 29, 2011
1 parent 0a3ae49 commit f8cb1c2
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 6 deletions.
3 changes: 3 additions & 0 deletions popsloader/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions popsloader/core/replace_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions popsloader/core/resolve_nid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions popsloader/loader/ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, },
Expand Down
5 changes: 5 additions & 0 deletions popsloader/popcorn/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 11 additions & 3 deletions popsloader/popcorn/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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<NELEMS(g_io_hooks); ++i) {
Expand Down
58 changes: 57 additions & 1 deletion popsloader/popcorn/popcorn_patch_offset.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <pspsdk.h>
#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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
}

0 comments on commit f8cb1c2

Please sign in to comment.