Skip to content

Commit

Permalink
add nid for 500
Browse files Browse the repository at this point in the history
  • Loading branch information
hrimfaxi committed Jun 25, 2011
1 parent 6f4e2c6 commit a2d7d64
Show file tree
Hide file tree
Showing 6 changed files with 282 additions and 2 deletions.
5 changes: 3 additions & 2 deletions popsloader/core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ OBJS = main.o resolve_nid.o ../common/utils.o ../common/libs.o ../common/vsnprin

OBJS += nid_635_to_620.o \
nid_635_to_639.o \
nid_620_to_635.o
# nid_500_to_635.o
nid_620_to_635.o \
nid_500_to_635.o \
nid_500_to_620.o

#PRO_HOME = d:/PSP/635PRO

Expand Down
29 changes: 29 additions & 0 deletions popsloader/core/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ static SceUID _sceKernelLoadModule(const char *path, int flags, SceKernelLMOptio

if(modid < 0) {
printk("%s: load module -> 0x%08X\n", __func__, modid);

#ifdef DEBUG
sceKernelDelayThread(2000000);
#endif
}

return modid;
Expand Down Expand Up @@ -190,6 +194,23 @@ 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;
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

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

modid = sceKernelLoadModule(redir_path, 0, NULL);

if(modid < 0) {
Expand Down Expand Up @@ -293,6 +314,14 @@ 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)
{
int thid;
Expand Down
4 changes: 4 additions & 0 deletions popsloader/core/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ extern resolver_config nid_fix_635_to_639[];
extern u32 nid_fix_635_to_639_size;
extern resolver_config nid_fix_620_to_635[];
extern u32 nid_fix_620_to_635_size;
extern resolver_config nid_fix_500_to_635[];
extern u32 nid_fix_500_to_635_size;
extern resolver_config nid_fix_500_to_620[];
extern u32 nid_fix_500_to_620_size;

void fix_nid(SceModule* mod);
void setup_nid_resolver(void);
Expand Down
118 changes: 118 additions & 0 deletions popsloader/core/nid_500_to_620.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
/*
* This file is part of PRO CFW.
* PRO CFW is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* PRO CFW is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PRO CFW. If not, see <http://www.gnu.org/licenses/ .
*/

#include <pspkernel.h>
#include <pspreg.h>
#include <stdio.h>
#include <string.h>
#include <systemctrl.h>
#include <systemctrl_se.h>
#include <pspsysmem_kernel.h>
#include <pspiofilemgr_kernel.h>
#include <psprtc.h>
#include "utils.h"
#include "libs.h"
#include "strsafe.h"
#include "systemctrl.h"
#include "main.h"

static nid_entry SysMemForKernel_nid[] = {
{ 0x2CFF6F90, 0xB9796F69, },
{ 0x5339A163, 0xA4AC3934, },
{ 0x950BCB31, 0xFEB5C72B, },
{ 0xD7E24299, 0xF5780DAA, },
};

static nid_entry ModuleMgrForKernel_nid[] = {
{ 0xBB8C8FDF, 0xDF8FFFAB, },
{ 0xC5A281C5, 0xE3CCC6EA, },
};

static nid_entry LoadExecForKernel_nid[] = {
{ 0x9C9BB2D8, 0x29413885, },
};

static nid_entry sceImpose_driver_nid[] = {
{ 0x0BBCA0BF, 0x55864BD7, },
{ 0x4B02F047, 0xC94AC8E2, },
{ 0xA516434B, 0x4D849B71, },
{ 0xDA315C59, 0x25011AAB , },
};

static nid_entry sceSysreg_driver_nid[] = {
{ 0x08E0EE7E, 0xEF64EFDD, },
{ 0x0E6301D0, 0x314A489C, },
{ 0x20C9E2C4, 0x2D858336, },
{ 0x410C74F7, 0x314A489C, },
{ 0x461B8077, 0x4643F826, },
{ 0x48869494, 0x47966D28, },
{ 0x5F190A4E, 0x5D3DD0B3, },
{ 0x663D5471, 0x119647A7, },
{ 0x7A154A45, 0x97EA6913, },
{ 0x823FFD7A, 0x9EBB3C43, },
{ 0x923509A1, 0xB733A263, },
{ 0xC7FC7669, 0xE7849809, },
{ 0xE46A0890, 0x94914740, },
};

static nid_entry sceSyscon_driver_nid[] = {
{ 0x48728250, 0xF7E9487A, },
};

static nid_entry sceClockgen_driver_nid[] = {
{ 0xD1A8E10E, 0xACC30ECE, },
};

static nid_entry sceGe_driver_nid[] = {
{ 0x0C9C3686, 0x7E2381D2, },
{ 0x1F226BA9, 0xD4D665C9, },
{ 0x6663F1BD, 0xF489E74B, },
{ 0x6849A0B0, 0x23E9F5FA, },
};

static nid_entry sceDisplay_driver_nid[] = {
{ 0x10B1710B, 0xF4B7B531, }, // not very exactly
};

static nid_entry sceHprm_driver_nid[] = {
{ 0xF5DBC7AA, 0x62CDFB12, },
};

static nid_entry sceDve_driver_nid[] = {
{ 0x0CC96C20, 0xA1401BA2, },
};

static nid_entry sceCodec_driver_nid[] = {
{ 0xA48DE786, 0x794EE731, },
};

resolver_config nid_fix_500_to_620[] = {
NID_ENTRY(SysMemForKernel),
NID_ENTRY(ModuleMgrForKernel),
NID_ENTRY(LoadExecForKernel),
NID_ENTRY(sceImpose_driver),
NID_ENTRY(sceSysreg_driver),
NID_ENTRY(sceSyscon_driver),
NID_ENTRY(sceClockgen_driver),
NID_ENTRY(sceGe_driver),
NID_ENTRY(sceDisplay_driver),
NID_ENTRY(sceHprm_driver),
NID_ENTRY(sceDve_driver),
NID_ENTRY(sceCodec_driver),
};

u32 nid_fix_500_to_620_size = NELEMS(nid_fix_500_to_620);
118 changes: 118 additions & 0 deletions popsloader/core/nid_500_to_635.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
/*
* This file is part of PRO CFW.
* PRO CFW is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* PRO CFW is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PRO CFW. If not, see <http://www.gnu.org/licenses/ .
*/

#include <pspkernel.h>
#include <pspreg.h>
#include <stdio.h>
#include <string.h>
#include <systemctrl.h>
#include <systemctrl_se.h>
#include <pspsysmem_kernel.h>
#include <pspiofilemgr_kernel.h>
#include <psprtc.h>
#include "utils.h"
#include "libs.h"
#include "strsafe.h"
#include "systemctrl.h"
#include "main.h"

static nid_entry SysMemForKernel_nid[] = {
{ 0x2CFF6F90, 0xF0E0AB7A, },
{ 0x5339A163, 0xF2FEAFD5, },
{ 0x950BCB31, 0x52B54B93, },
{ 0xD7E24299, 0x208F4820, },
};

static nid_entry ModuleMgrForKernel_nid[] = {
{ 0xBB8C8FDF, 0xE6BF3960, },
{ 0xC5A281C5, 0xFFB9B760, },
};

static nid_entry LoadExecForKernel_nid[] = {
{ 0x9C9BB2D8, 0xFCD765C9, },
};

static nid_entry sceImpose_driver_nid[] = {
{ 0x0BBCA0BF, 0x44F17A7A, },
{ 0x4B02F047, 0x4C4DF719, },
{ 0xA516434B, 0xEBC850AC, },
{ 0xDA315C59, 0x027F21C6 , },
};

static nid_entry sceSysreg_driver_nid[] = {
{ 0x08E0EE7E, 0xD74D9041, },
{ 0x0E6301D0, 0x0CFD5A8A, },
{ 0x20C9E2C4, 0xE2606FCB, },
{ 0x410C74F7, 0x0CFD5A8A, },
{ 0x461B8077, 0x45596E3F, },
{ 0x48869494, 0x9E80B4E2, },
{ 0x5F190A4E, 0xD1999F94, },
{ 0x663D5471, 0x86FFE348, },
{ 0x7A154A45, 0xB70793D7, },
{ 0x823FFD7A, 0x3A98CABB, },
{ 0x923509A1, 0x8E9E76AE, },
{ 0xC7FC7669, 0x789597AB, },
{ 0xE46A0890, 0x9984A972, },
};

static nid_entry sceSyscon_driver_nid[] = {
{ 0x48728250, 0xC4931159, },
};

static nid_entry sceClockgen_driver_nid[] = {
{ 0xD1A8E10E, 0xA02BB1D3, },
};

static nid_entry sceGe_driver_nid[] = {
{ 0x0C9C3686, 0xD8A53104, },
{ 0x1F226BA9, 0x2444EC4D, },
{ 0x6663F1BD, 0x670F15ED, },
{ 0x6849A0B0, 0xFEEC36F7, },
};

static nid_entry sceDisplay_driver_nid[] = {
{ 0x10B1710B, 0x8930B3A9, }, // not very exactly
};

static nid_entry sceHprm_driver_nid[] = {
{ 0xF5DBC7AA, 0xADE4B1F4, },
};

static nid_entry sceDve_driver_nid[] = {
{ 0x0CC96C20, 0xAA085C2A, },
};

static nid_entry sceCodec_driver_nid[] = {
{ 0xA48DE786, 0xB2EF6B19, },
};

resolver_config nid_fix_500_to_635[] = {
NID_ENTRY(SysMemForKernel),
NID_ENTRY(ModuleMgrForKernel),
NID_ENTRY(LoadExecForKernel),
NID_ENTRY(sceImpose_driver),
NID_ENTRY(sceSysreg_driver),
NID_ENTRY(sceSyscon_driver),
NID_ENTRY(sceClockgen_driver),
NID_ENTRY(sceGe_driver),
NID_ENTRY(sceDisplay_driver),
NID_ENTRY(sceHprm_driver),
NID_ENTRY(sceDve_driver),
NID_ENTRY(sceCodec_driver),
};

u32 nid_fix_500_to_635_size = NELEMS(nid_fix_500_to_635);
10 changes: 10 additions & 0 deletions popsloader/core/resolve_nid.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,23 @@ void setup_nid_resolver(void)
nid_fix_size = nid_fix_635_to_620_size;
nid_fix = nid_fix_635_to_620;
}

if(pops_fw_version == FW_500) {
nid_fix_size = nid_fix_500_to_620_size;
nid_fix = nid_fix_500_to_620;
}
}

if(psp_fw_version == FW_635 || psp_fw_version == FW_639) {
if(pops_fw_version == FW_600 || pops_fw_version == FW_610 || pops_fw_version == FW_620) {
nid_fix_size = nid_fix_620_to_635_size;
nid_fix = nid_fix_620_to_635;
}

if(pops_fw_version == FW_500) {
nid_fix_size = nid_fix_500_to_635_size;
nid_fix = nid_fix_500_to_635;
}
}
}

Expand Down

0 comments on commit a2d7d64

Please sign in to comment.