From 1752701323825b7a4b1234a632f2081f37b44ce5 Mon Sep 17 00:00:00 2001 From: anod <182859762@qq.com> Date: Sun, 16 Oct 2022 10:06:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=9A=84=E9=A1=B5=E7=A0=81?= =?UTF-8?q?=E6=9C=89=E9=97=AE=E9=A2=98=EF=BC=8C=E6=B7=BB=E5=8A=A0=E6=8E=A2?= =?UTF-8?q?=E6=B5=8B=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/arm11/atp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 ); }