diff --git a/source/arm11/atp.c b/source/arm11/atp.c index 416d123..bb830e0 100644 --- a/source/arm11/atp.c +++ b/source/arm11/atp.c @@ -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 REFRESH_PAGE { \ 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; - 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 ) { case ATP_PAGE_REFRESH: diff --git a/source/arm11/open_agb_firm.c b/source/arm11/open_agb_firm.c index cb612aa..ce52c98 100644 --- a/source/arm11/open_agb_firm.c +++ b/source/arm11/open_agb_firm.c @@ -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 ) { - if( index == 0 ) + if( l || r ) { - u8 light = g_oafConfig.backlight; - if( l || x ) + + if( index == 0 ) { - light -= 10; - if( light % 10 ) light += 10 - light%10; + u8 light = g_oafConfig.backlight; + 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 ) - { - light += 10; - 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; + 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; + else if( index == 3 ) g_oafConfig.saveOverride = !g_oafConfig.saveOverride; } - g_oafConfig.saveOverride = !g_oafConfig.saveOverride; return ATP_PAGE_UPDATE; }