diff --git a/source/arm11/cheat.c b/source/arm11/cheat.c index 2965248..355b3b2 100644 --- a/source/arm11/cheat.c +++ b/source/arm11/cheat.c @@ -496,11 +496,11 @@ cheat_error_t apply_cheat( int mode, u32 szrom, hookpoint_analyzer *analyzer, u1 // find hook point CodeLocation hookpoint[MAX_HOOKPOINT]; memset( hookpoint, 0, sizeof(hookpoint) ); - int n_hookpoint; - if( analyzer!=NULL && analyzer->provider != NULL ){ + int n_hookpoint = 0; + if( analyzer!=NULL && analyzer->provider != NULL ) n_hookpoint = analyzer->provider( analyzer->caller_data, hookpoint ); - } - else n_hookpoint = rom_search_hookpoint( romdata, INSTR_LEN(realend) - 3, hookpoint ); // hook point need at least 3 instructions + if( n_hookpoint == 0 ) + n_hookpoint = rom_search_hookpoint( romdata, INSTR_LEN(realend) - 3, hookpoint ); // hook point need at least 3 instructions if( n_hookpoint == 0 ) return CCHT_NO_IRQ; // find free space to put new code diff --git a/source/arm11/open_agb_firm.c b/source/arm11/open_agb_firm.c index 9806793..49b922f 100644 --- a/source/arm11/open_agb_firm.c +++ b/source/arm11/open_agb_firm.c @@ -415,6 +415,11 @@ static u32 fixRomPadding(u32 romFileSize) return romSize; } +static u32 read_hookpoint_file( const void *path, u32 hookpoint[MAX_HOOKPOINT] ) +{ + return 0; +} + static Result loadGbaRom(const char *const path, u32 *const romSizeOut) { Result res; @@ -439,6 +444,7 @@ static Result loadGbaRom(const char *const path, u32 *const romSizeOut) gamecode[4] = '\0'; acl_open_lib( "gba.acl" ); acl_select_game( gamecode, 0, NULL ); + hookpoint_analyzer ha = {read_hookpoint_file, path}; apply_cheat( g_oafConfig.cheatMode, fileSize, NULL, g_oafConfig.cheatKeys, CHEAT_INUSE_ADDR, &fileSize ); acl_close_lib(); fini_current_cheat();