diff --git a/source/arm11/atp.c b/source/arm11/atp.c index 7ae2e90..9d0e3e4 100644 --- a/source/arm11/atp.c +++ b/source/arm11/atp.c @@ -78,7 +78,7 @@ const char *acf_put_text(int x, int y, int width, int height, int maxwidth, u8 c static void screen_clean() { - memset(consoleGet()->frameBuffer, 0, WINDOW_WIDTH*WINDOW_HEIGHT*sizeof(uint16_t)); + memset(consoleGet()->frameBuffer, 0xff, WINDOW_WIDTH*WINDOW_HEIGHT*sizeof(uint16_t)); if( ta[0] ) acf_put_text( 5, 215, WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_WIDTH-10, ATP_COLOR_CYAN, ATP_PLACEMENT_LEFT, ta ); if( tb[0] ) acf_put_text( 5, 215, WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_WIDTH-10, ATP_COLOR_CYAN, ATP_PLACEMENT_RIGHT, tb ); } @@ -183,14 +183,16 @@ static atp_error_t title_paint( atp_callerdata_t datain, atp_counter_t idx, atp_ return ATP_SUCCESS; } +#define PAGING_BUFSIZE 32 static void set_paging( int top, int len ) { screen_clean(); - + unsigned total = (len+CONTAINER_MAX_LINES-1) / CONTAINER_MAX_LINES; unsigned current = top / CONTAINER_MAX_LINES; - char buf[TIPS_MAX]; - ee_snprintf( buf, TIPS_MAX-1, "页码:%d/%d", current+1, total ); + char buf[PAGING_BUFSIZE]; + ee_snprintf( buf, PAGING_BUFSIZE-1, "页码:%d/%d", top, len ); + buf[PAGING_BUFSIZE] = '\0'; atp_tips( buf, NULL ); }