diff --git a/source/arm11/atp.c b/source/arm11/atp.c index 93a7ad6..a6b8ed7 100644 --- a/source/arm11/atp.c +++ b/source/arm11/atp.c @@ -242,12 +242,12 @@ atp_error_t atp_select( atp_text_t title, atp_counter_t cnt, atp_itemprovider_t atp_error_t result = provider(data, item_sel, &config); if( ATP_SUCCESS == result ) { - *res = config.value; + if( res != NULL ) *res = config.value; return ATP_SUCCESS; } else { - *res = result; + if( res != NULL ) *res = result; return ATP_INVALID_VALUE; } } @@ -258,6 +258,8 @@ atp_error_t atp_select( atp_text_t title, atp_counter_t cnt, atp_itemprovider_t } else if( key & (KEY_X | KEY_Y | KEY_SELECT | KEY_START) ) { + if( handler == NULL ) continue; + atp_pageopt_t opt = handler( data, key&KEY_X, key&KEY_Y, key&KEY_START, key&KEY_SELECT ); switch( opt ) { diff --git a/source/arm11/filebrowser.c b/source/arm11/filebrowser.c index c74532e..c9e11d9 100644 --- a/source/arm11/filebrowser.c +++ b/source/arm11/filebrowser.c @@ -90,7 +90,7 @@ static const char *page[] = { "女儿情长埋葬" }; -static atp_error_t test_show( atp_callerdata_t , atp_counter_t idx, atp_linecfg_t *pcfg ) +static atp_error_t test_show( atp_callerdata_t , atp_counter_t idx, atp_itemcfg_t *pcfg ) { if( idx < sizeof(page) ) { @@ -300,7 +300,7 @@ Result browseFiles(const char *const basePath, char selected[512]) if( kDown & KEY_X ) { atp_tips(curDir, "B键返回"); - if( atp_show( 22, test_show, NULL ) == ATP_POWER_OFF ) + if( atp_select( "我的第一个职业愿望是做足球运动员,这个梦想小学就被封杀了,因为我的体格太瘦小", 4, test_show, NULL, NULL, NULL ) == ATP_POWER_OFF ) { screenClean(); res = RES_INVALID_ARG;