Skip to content

Commit

Permalink
log module names
Browse files Browse the repository at this point in the history
  • Loading branch information
Kethen committed Dec 30, 2024
1 parent 9bd8db9 commit f32577b
Showing 1 changed file with 8 additions and 21 deletions.
29 changes: 8 additions & 21 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,22 +187,6 @@ int sceCtrlReadBufferPositivePatched(SceCtrlData *pad_data, int count){
return res;
}

static void log_modules(){
SceUID modules[32];
SceKernelModuleInfo info;
int i, count = 0;

if (sceKernelGetModuleIdList(modules, sizeof(modules), &count) >= 0) {
for (i = 0; i < count; ++i) {
info.size = sizeof(SceKernelModuleInfo);
if (sceKernelQueryModuleInfo(modules[i], &info) < 0) {
continue;
}
LOG("module #%d: %s", i+1, info.name);
}
}
}

int set_offsets(char *disc_id, char *disc_version){
LOG("game_base_addr: 0x%lx", game_base_addr);
// EU and US v2.00
Expand Down Expand Up @@ -487,10 +471,6 @@ int init(){
return -1;
}

if(is_emulator){
log_modules();
}

if(is_emulator){
adjacent_axes = 1;
outer_deadzone = 124;
Expand Down Expand Up @@ -519,7 +499,11 @@ int init(){
}

int StartPSP(SceModule2 *mod) {
char modname_buf[sizeof(mod->modname) + 1] = {0};
memcpy(modname_buf, mod->modname, sizeof(mod->modname));
LOG("PSP module %s", modname_buf);
if(strcmp(mod->modname, GAME_MODULE_NAME) == 0){
LOG("GTPSP module %s found", modname_buf);
game_base_addr = mod->text_addr;
// XXX oh no
game_base_addr = game_base_addr + 0x28;
Expand All @@ -544,10 +528,13 @@ static void StartPPSSPP() {
if (sceKernelQueryModuleInfo(modules[i], &info) < 0) {
continue;
}
char namebuf[sizeof(info.name) + 1] = {0};
memcpy(namebuf, info.name, sizeof(info.name));
LOG("PPSSPP module %s", namebuf);
if(strcmp(info.name, GAME_MODULE_NAME) == 0){
LOG("GTPSP module %s found", namebuf);
game_base_addr = info.text_addr;
init();
break;
}
}
}
Expand Down

0 comments on commit f32577b

Please sign in to comment.