mirror of
https://gitee.com/anod/open_agb_firm.git
synced 2025-05-07 22:34:12 +08:00
修正了L/R出错的问题
添加了其他几个参数的处理
This commit is contained in:
parent
08c1878867
commit
2447941e6c
@ -231,6 +231,7 @@ static void draw_options( int start_row, int start_idx, int option_cnt, int sele
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define HIT( hit ) ( (hit & key) != 0 )
|
||||||
#define SELECTED_ROW(top, len, sel) (((top) < (len)) ? ((len)-(top)+(sel)) : ((sel)+(len)-(top)))
|
#define SELECTED_ROW(top, len, sel) (((top) < (len)) ? ((len)-(top)+(sel)) : ((sel)+(len)-(top)))
|
||||||
#define REFRESH_PAGE { \
|
#define REFRESH_PAGE { \
|
||||||
set_paging( idx_top, title_len+cnt ); \
|
set_paging( idx_top, title_len+cnt ); \
|
||||||
@ -302,7 +303,7 @@ atp_error_t atp_select( atp_text_t title, atp_counter_t cnt, atp_itemprovider_t
|
|||||||
{
|
{
|
||||||
if( handler == NULL ) continue;
|
if( handler == NULL ) continue;
|
||||||
|
|
||||||
atp_pageopt_t opt = handler( data, item_sel, key&KEY_X, key&KEY_Y, key&KEY_L, key&KEY_R, key&KEY_START, key&KEY_SELECT );
|
atp_pageopt_t opt = handler( data, item_sel, HIT(KEY_X), HIT(KEY_Y), HIT(KEY_L), HIT(KEY_R), HIT(KEY_START), HIT(KEY_SELECT) );
|
||||||
switch( opt )
|
switch( opt )
|
||||||
{
|
{
|
||||||
case ATP_PAGE_REFRESH:
|
case ATP_PAGE_REFRESH:
|
||||||
|
@ -155,25 +155,30 @@ static atp_error_t config_item( atp_callerdata_t data, atp_counter_t index, atp_
|
|||||||
|
|
||||||
static atp_pageopt_t config_adjust( atp_callerdata_t data, atp_counter_t index, atp_boolean_t x, atp_boolean_t y, atp_boolean_t l, atp_boolean_t r, atp_boolean_t start, atp_boolean_t select )
|
static atp_pageopt_t config_adjust( atp_callerdata_t data, atp_counter_t index, atp_boolean_t x, atp_boolean_t y, atp_boolean_t l, atp_boolean_t r, atp_boolean_t start, atp_boolean_t select )
|
||||||
{
|
{
|
||||||
if( index == 0 )
|
if( l || r )
|
||||||
{
|
{
|
||||||
u8 light = g_oafConfig.backlight;
|
|
||||||
if( l || x )
|
if( index == 0 )
|
||||||
{
|
{
|
||||||
light -= 10;
|
u8 light = g_oafConfig.backlight;
|
||||||
if( light % 10 ) light += 10 - light%10;
|
if( l || x )
|
||||||
|
{
|
||||||
|
light -= 10;
|
||||||
|
if( light % 10 ) light += 10 - light%10;
|
||||||
|
}
|
||||||
|
else if( r || y )
|
||||||
|
{
|
||||||
|
light += 10;
|
||||||
|
if( light % 10 ) light -= light % 10;
|
||||||
|
}
|
||||||
|
if( light > LIGHT_MAX ) light = LIGHT_MAX;
|
||||||
|
else if( light < LIGHT_MIN ) light = LIGHT_MIN;
|
||||||
|
g_oafConfig.backlight = light;
|
||||||
}
|
}
|
||||||
else if( r || y )
|
else if( index == 1 ) g_oafConfig.directBoot = !g_oafConfig.directBoot;
|
||||||
{
|
else if( index == 2 ) g_oafConfig.scaler = ( 4 + ( g_oafConfig.scaler+(l?1:-1) ) ) % 4;
|
||||||
light += 10;
|
else if( index == 3 ) g_oafConfig.saveOverride = !g_oafConfig.saveOverride;
|
||||||
if( light % 10 ) light -= light % 10;
|
|
||||||
}
|
|
||||||
else light -= 1;
|
|
||||||
if( light > LIGHT_MAX ) light = LIGHT_MAX;
|
|
||||||
else if( light < LIGHT_MIN ) light = LIGHT_MIN;
|
|
||||||
g_oafConfig.backlight = light;
|
|
||||||
}
|
}
|
||||||
g_oafConfig.saveOverride = !g_oafConfig.saveOverride;
|
|
||||||
return ATP_PAGE_UPDATE;
|
return ATP_PAGE_UPDATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user