添加一个空的读取hookpoint的函数

This commit is contained in:
anod 2023-03-31 18:23:54 +08:00
parent 01c378e650
commit 82f3bee823
2 changed files with 10 additions and 4 deletions

View File

@ -496,11 +496,11 @@ cheat_error_t apply_cheat( int mode, u32 szrom, hookpoint_analyzer *analyzer, u1
// find hook point // find hook point
CodeLocation hookpoint[MAX_HOOKPOINT]; CodeLocation hookpoint[MAX_HOOKPOINT];
memset( hookpoint, 0, sizeof(hookpoint) ); memset( hookpoint, 0, sizeof(hookpoint) );
int n_hookpoint; int n_hookpoint = 0;
if( analyzer!=NULL && analyzer->provider != NULL ){ if( analyzer!=NULL && analyzer->provider != NULL )
n_hookpoint = analyzer->provider( analyzer->caller_data, hookpoint ); n_hookpoint = analyzer->provider( analyzer->caller_data, hookpoint );
} if( n_hookpoint == 0 )
else n_hookpoint = rom_search_hookpoint( romdata, INSTR_LEN(realend) - 3, hookpoint ); // hook point need at least 3 instructions 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; if( n_hookpoint == 0 ) return CCHT_NO_IRQ;
// find free space to put new code // find free space to put new code

View File

@ -415,6 +415,11 @@ static u32 fixRomPadding(u32 romFileSize)
return romSize; 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) static Result loadGbaRom(const char *const path, u32 *const romSizeOut)
{ {
Result res; Result res;
@ -439,6 +444,7 @@ static Result loadGbaRom(const char *const path, u32 *const romSizeOut)
gamecode[4] = '\0'; gamecode[4] = '\0';
acl_open_lib( "gba.acl" ); acl_open_lib( "gba.acl" );
acl_select_game( gamecode, 0, NULL ); 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 ); apply_cheat( g_oafConfig.cheatMode, fileSize, NULL, g_oafConfig.cheatKeys, CHEAT_INUSE_ADDR, &fileSize );
acl_close_lib(); acl_close_lib();
fini_current_cheat(); fini_current_cheat();