This commit is contained in:
anod 2023-03-11 22:23:51 +08:00
parent 9fe03698b4
commit a2f51eeb15
2 changed files with 4 additions and 3 deletions

View File

@ -179,13 +179,15 @@ static int32_t bin_search( FHandle fd, acl_text_t game )
#define config_type(n) ( (n) & 0xff )
acl_error_t acl_select_game( acl_text_t game, acl_boolean_t filter, acl_count_t *n )
{
extern void log( const char * );
CheatLib *inst = (CheatLib*)&gblcht;
FHandle fd;
log( game );
if( inst->serc == 0 ) return ACHTLIB_NOT_OPEN;
if( strlen(game) != ACL_GBA_CODELEN ) return ACHTLIB_NOT_FOUND;
if( RES_OK != fOpen(&fd, inst->aclfile, FA_OPEN_EXISTING | FA_READ) )
return ACHTLIB_INVALID;
log("search");
int32_t index = bin_search( fd, game );
if( index < 0 )
{

View File

@ -240,6 +240,7 @@ static atp_error_t disp_str( atp_callerdata_t data, atp_counter_t, atp_linecfg_t
cfg->text = (atp_text_t)data;
return ATP_SUCCESS;
}
void log( const char *p ) { atp_show(1, disp_str, p); }
static atp_error_t select_region( atp_callerdata_t, atp_counter_t index, atp_itemcfg_t *config )
{
@ -497,13 +498,11 @@ static atp_pageopt_t serve_on_key( atp_callerdata_t data, atp_counter_t index, a
{
return WAIT_ON_ERRPAGE( display_openlib );
}
atp_show(1, disp_str, "open lib done");
if( ACHTLIB_SUCCESS != acl_select_game( serial, 0, &len ) )
{
acl_close_lib();
return WAIT_ON_ERRPAGE( display_selcht );
}
atp_show(1, disp_str, "done select game");
if( len == 0 )
{
acl_close_lib();