diff --git a/source/arm11/atp.c b/source/arm11/atp.c index 6a8b53d..6b91f39 100644 --- a/source/arm11/atp.c +++ b/source/arm11/atp.c @@ -200,10 +200,8 @@ static void draw_options( int start_row, int start_idx, int option_cnt, int sele screen_clean(); \ if( idx_top < title_len ) \ { \ - uint8_t* title_data[2]; \ - title_data[0] = (uint8_t*)title; \ - title_data[1] = &title_offset[idx_top]; \ - container_paint( title_paint, (atp_callerdata_t)title_data, title_len-idx_top, idx_top ); \ + uint8_t* title_data[2] = {(uint8_t*)title, title_offset}; \ + container_paint( title_paint, (atp_callerdata_t)title_data, title_len, idx_top ); \ draw_options( title_len - idx_top, 0, cnt, item_sel, provider, data ); \ } \ else draw_options( 0, idx_top - title_len, cnt, item_sel, provider, data ); \ @@ -287,14 +285,10 @@ atp_error_t atp_select( atp_text_t title, atp_counter_t cnt, atp_itemprovider_t else if( sel < 0 ) sel = (int)cnt-1; // 更新idx_top - int top = title_len + sel; + int sel_row = title_len + sel; + int top = sel_row - sel_row % CONTAINER_MAX_LINES; atp_boolean_t full_refresh = 0; - if( top >= idx_top + CONTAINER_MAX_LINES ) - { - idx_top = 1 + top - CONTAINER_MAX_LINES; - full_refresh = 1; - } - else if( top < idx_top ) + if( top != idx_top ) { idx_top = top; full_refresh = 1;