From dfc229fe8b1579b910d961ce0834f28e766abfbf Mon Sep 17 00:00:00 2001 From: anod <182859762@qq.com> Date: Thu, 13 Oct 2022 22:46:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E6=B5=8B=E8=AF=95=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=EF=BC=8C=E8=BF=9B=E8=A1=8C=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/arm11/atp.c | 6 ++++-- source/arm11/filebrowser.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) 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;