From a5af06b580f55f8339d1bf135365993b4db5287c Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Mon, 17 Apr 2006 02:21:08 +0000 Subject: [PATCH] Bubbles adapted to archos recorder & Ondio. Gfx work by Marianne Arnold. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9699 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/SOURCES | 2 - apps/plugins/bitmaps/mono/SOURCES | 4 +- .../bitmaps/mono/bubbles_bubble.112x64x1.bmp | Bin 0 -> 92 bytes apps/plugins/bitmaps/native/SOURCES | 6 +- .../native/bubbles_emblem.112x64x1.bmp | Bin 0 -> 222 bytes apps/plugins/bubbles.c | 273 +++++++++++------- 6 files changed, 171 insertions(+), 114 deletions(-) create mode 100755 apps/plugins/bitmaps/mono/bubbles_bubble.112x64x1.bmp create mode 100755 apps/plugins/bitmaps/native/bubbles_emblem.112x64x1.bmp diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES index 9ca5f89ad1..1f64e9140b 100644 --- a/apps/plugins/SOURCES +++ b/apps/plugins/SOURCES @@ -36,9 +36,7 @@ plasma.c #endif bounce.c -#if ((LCD_WIDTH >= 138) && (LCD_HEIGHT >= 110)) bubbles.c -#endif #if LCD_WIDTH != 128 /* These need adjusting for the iRiver if'p screen */ brickmania.c diff --git a/apps/plugins/bitmaps/mono/SOURCES b/apps/plugins/bitmaps/mono/SOURCES index 0e8abd86f6..0a463c714e 100644 --- a/apps/plugins/bitmaps/mono/SOURCES +++ b/apps/plugins/bitmaps/mono/SOURCES @@ -1,7 +1,9 @@ #ifdef HAVE_LCD_BITMAP /* Bubbles */ -#if (LCD_WIDTH == 160) && (LCD_HEIGHT == 128) +#if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64) +bubbles_bubble.112x64x1.bmp +#elif (LCD_WIDTH == 160) && (LCD_HEIGHT == 128) bubbles_bubble.160x128x1.bmp #elif (LCD_WIDTH == 176) && (LCD_HEIGHT == 132) bubbles_bubble.160x128x1.bmp diff --git a/apps/plugins/bitmaps/mono/bubbles_bubble.112x64x1.bmp b/apps/plugins/bitmaps/mono/bubbles_bubble.112x64x1.bmp new file mode 100755 index 0000000000000000000000000000000000000000..70d3c8451e155b6791df2e291a01f16818feaf4a GIT binary patch literal 92 zcmZ?rjbVTQJ0PV2#2i4(4#bQ=2m*3IEW{1LU;!ZU|Nnn5(*j5y1L7ti2B`+oAU;T( GfdK$7!w0zl literal 0 HcmV?d00001 diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES index dc2b774328..a8d24ee196 100644 --- a/apps/plugins/bitmaps/native/SOURCES +++ b/apps/plugins/bitmaps/native/SOURCES @@ -1,10 +1,12 @@ #ifdef HAVE_LCD_BITMAP /* Bubbles */ -#if (LCD_WIDTH == 160) && (LCD_HEIGHT == 128) && !defined(HAVE_LCD_COLOR) -bubbles_emblem.160x128x2.bmp +#if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64) +bubbles_emblem.112x64x1.bmp #elif (LCD_WIDTH == 138) && (LCD_HEIGHT == 110) bubbles_emblem.138x110x2.bmp +#elif (LCD_WIDTH == 160) && (LCD_HEIGHT == 128) && !defined(HAVE_LCD_COLOR) +bubbles_emblem.160x128x2.bmp #elif (LCD_WIDTH == 160) && (LCD_HEIGHT == 128) && defined(HAVE_LCD_COLOR) bubbles_emblem.160x128x16.bmp bubbles_left.160x128x16.bmp diff --git a/apps/plugins/bitmaps/native/bubbles_emblem.112x64x1.bmp b/apps/plugins/bitmaps/native/bubbles_emblem.112x64x1.bmp new file mode 100755 index 0000000000000000000000000000000000000000..fa882403e70d31813a2f5fa356b15f296e4402d6 GIT binary patch literal 222 zcmZ?ry~h9nc0fu4h}oeuBLgE?VgZm8;)Y-*un2_s|NlS3KOplO5Wj=cApS8R2GJHk rJPC;pQUj6$(J*zpfNYRD5Dn7@qMMNTFtx}u%)V7Xbujxu^5_@lcd_bitmap(bubbles_left, 0, 0, XOFS, LCD_HEIGHT); - rb->lcd_bitmap(bubbles_right, XOFS-1+BB_WIDTH*BUBBLE_SZ, 0, - LCD_WIDTH-(XOFS-1+BB_WIDTH*BUBBLE_SZ), LCD_HEIGHT); + rb->lcd_bitmap(bubbles_right, XOFS-1+BB_WIDTH*BUBBLE_WIDTH, 0, + LCD_WIDTH-(XOFS-1+BB_WIDTH*BUBBLE_WIDTH), LCD_HEIGHT); #endif /* display play board */ @@ -1467,15 +1512,15 @@ static void bubbles_drawboard(struct game_context* bb) { for(j=0; jplayboard[i][j].type >= 0 && !bb->playboard[i][j].delete) { rb->lcd_bitmap_part(bubbles_emblem, - 0, EMBLEM_SZ*bb->playboard[i][j].type, EMBLEM_SZ, - XOFS+indent+BUBBLE_SZ*j+(BUBBLE_SZ-EMBLEM_SZ)/2, - ROW_HEIGHT*i+(BUBBLE_SZ-EMBLEM_SZ)/2+bb->compress*ROW_HEIGHT, - EMBLEM_SZ, EMBLEM_SZ); + 0, EMBLEM_HEIGHT*bb->playboard[i][j].type, EMBLEM_WIDTH, + XOFS+indent+BUBBLE_WIDTH*j+(BUBBLE_WIDTH-EMBLEM_WIDTH)/2, + ROW_HEIGHT*i+(BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2+bb->compress*ROW_HEIGHT, + EMBLEM_WIDTH, EMBLEM_HEIGHT); rb->lcd_set_drawmode(DRMODE_FG); rb->lcd_mono_bitmap((const unsigned char *)bubbles_bubble, - XOFS+indent+BUBBLE_SZ*j, + XOFS+indent+BUBBLE_WIDTH*j, ROW_HEIGHT*i+bb->compress*ROW_HEIGHT, - BUBBLE_SZ, BUBBLE_SZ); + BUBBLE_WIDTH, BUBBLE_HEIGHT); rb->lcd_set_drawmode(DRMODE_SOLID); } } @@ -1483,49 +1528,49 @@ static void bubbles_drawboard(struct game_context* bb) { /* display bubble to be shot */ rb->lcd_bitmap_part(bubbles_emblem, - 0, EMBLEM_SZ*bb->queue[bb->nextinq], EMBLEM_SZ, - SHOTX+(BUBBLE_SZ-EMBLEM_SZ)/2, - SHOTY+(BUBBLE_SZ-EMBLEM_SZ)/2, - EMBLEM_SZ, EMBLEM_SZ); + 0, EMBLEM_HEIGHT*bb->queue[bb->nextinq], EMBLEM_WIDTH, + SHOTX+(BUBBLE_WIDTH-EMBLEM_WIDTH)/2, + SHOTY+(BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2, + EMBLEM_WIDTH, EMBLEM_HEIGHT); rb->lcd_set_drawmode(DRMODE_FG); rb->lcd_mono_bitmap((const unsigned char *)bubbles_bubble, SHOTX, SHOTY, - BUBBLE_SZ, BUBBLE_SZ); + BUBBLE_WIDTH, BUBBLE_HEIGHT); rb->lcd_set_drawmode(DRMODE_SOLID); /* display next bubble to be shot */ rb->lcd_bitmap_part(bubbles_emblem, - 0, EMBLEM_SZ*bb->queue[(bb->nextinq+1)%NUM_QUEUE], EMBLEM_SZ, - XOFS/2-BUBBLE_SZ/2+(BUBBLE_SZ-EMBLEM_SZ)/2, - SHOTY+(BUBBLE_SZ-EMBLEM_SZ)/2, - EMBLEM_SZ, EMBLEM_SZ); + 0, EMBLEM_HEIGHT*bb->queue[(bb->nextinq+1)%NUM_QUEUE], EMBLEM_WIDTH, + XOFS/2-BUBBLE_WIDTH/2+(BUBBLE_WIDTH-EMBLEM_WIDTH)/2, + SHOTY+(BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2, + EMBLEM_WIDTH, EMBLEM_HEIGHT); rb->lcd_set_drawmode(DRMODE_FG); rb->lcd_mono_bitmap((const unsigned char *)bubbles_bubble, - XOFS/2-BUBBLE_SZ/2, SHOTY, - BUBBLE_SZ, BUBBLE_SZ); + XOFS/2-BUBBLE_WIDTH/2, SHOTY, + BUBBLE_WIDTH, BUBBLE_HEIGHT); rb->lcd_set_drawmode(DRMODE_SOLID); /* draw bounding lines */ #ifndef HAVE_LCD_COLOR rb->lcd_vline(XOFS-1, 0, LCD_HEIGHT); - rb->lcd_vline(XOFS+BUBBLE_SZ*BB_WIDTH, 0, LCD_HEIGHT); + rb->lcd_vline(XOFS+BUBBLE_WIDTH*BB_WIDTH, 0, LCD_HEIGHT); #endif - rb->lcd_hline(XOFS, XOFS+BUBBLE_SZ*BB_WIDTH-1, bb->compress*ROW_HEIGHT-1); - rb->lcd_hline(XOFS, XOFS+BUBBLE_SZ*BB_WIDTH-1, - ROW_HEIGHT*(BB_HEIGHT-2)+BUBBLE_SZ); + rb->lcd_hline(XOFS, XOFS+BUBBLE_WIDTH*BB_WIDTH-1, bb->compress*ROW_HEIGHT-1); + rb->lcd_hline(XOFS, XOFS+BUBBLE_WIDTH*BB_WIDTH-1, + ROW_HEIGHT*(BB_HEIGHT-2)+BUBBLE_HEIGHT); /* draw arrow */ - tipx = SHOTX+BUBBLE_SZ/2+(((sin(bb->angle)>>4)*BUBBLE_SZ*3/2)>>10); - tipy = SHOTY+BUBBLE_SZ/2-(((cos(bb->angle)>>4)*BUBBLE_SZ*3/2)>>10); + tipx = SHOTX+BUBBLE_WIDTH/2+(((sin(bb->angle)>>4)*BUBBLE_WIDTH*3/2)>>10); + tipy = SHOTY+BUBBLE_HEIGHT/2-(((cos(bb->angle)>>4)*BUBBLE_HEIGHT*3/2)>>10); - rb->lcd_drawline(SHOTX+BUBBLE_SZ/2+(((sin(bb->angle)>>4)*BUBBLE_SZ/2)>>10), - SHOTY+BUBBLE_SZ/2-(((cos(bb->angle)>>4)*BUBBLE_SZ/2)>>10), + rb->lcd_drawline(SHOTX+BUBBLE_WIDTH/2+(((sin(bb->angle)>>4)*BUBBLE_WIDTH/2)>>10), + SHOTY+BUBBLE_HEIGHT/2-(((cos(bb->angle)>>4)*BUBBLE_HEIGHT/2)>>10), tipx, tipy); xlcd_filltriangle(tipx, tipy, - tipx+(((sin(bb->angle-135)>>4)*BUBBLE_SZ/3)>>10), - tipy-(((cos(bb->angle-135)>>4)*BUBBLE_SZ/3)>>10), - tipx+(((sin(bb->angle+135)>>4)*BUBBLE_SZ/3)>>10), - tipy-(((cos(bb->angle+135)>>4)*BUBBLE_SZ/3)>>10)); + tipx+(((sin(bb->angle-135)>>4)*BUBBLE_WIDTH/3)>>10), + tipy-(((cos(bb->angle-135)>>4)*BUBBLE_HEIGHT/3)>>10), + tipx+(((sin(bb->angle+135)>>4)*BUBBLE_WIDTH/3)>>10), + tipy-(((cos(bb->angle+135)>>4)*BUBBLE_HEIGHT/3)>>10)); /* draw text */ rb->lcd_getstringsize(level, &w, &h); @@ -1570,8 +1615,8 @@ static int bubbles_fire(struct game_context* bb) { /* get current bubble */ bubblecur = bb->queue[bb->nextinq]; - shotxinc = ((sin(bb->angle)>>4)*BUBBLE_SZ)/3; - shotyinc = ((-1*(cos(bb->angle)>>4))*BUBBLE_SZ)/3; + shotxinc = ((sin(bb->angle)>>4)*BUBBLE_WIDTH)/3; + shotyinc = ((-1*(cos(bb->angle)>>4))*BUBBLE_HEIGHT)/3; shotxofs = shotyofs = 0; /* advance the queue */ @@ -1592,9 +1637,9 @@ static int bubbles_fire(struct game_context* bb) { if(SHOTX+(shotxofs>>10) < XOFS) { shotxofs += 2*((XOFS<<10)-(((SHOTX)<<10)+shotxofs)); shotxdirec *= -1; - } else if(SHOTX+(shotxofs>>10) > XOFS+(BB_WIDTH-1)*BUBBLE_SZ) { + } else if(SHOTX+(shotxofs>>10) > XOFS+(BB_WIDTH-1)*BUBBLE_WIDTH) { shotxofs -= 2*((((SHOTX)<<10)+shotxofs)- - ((XOFS<<10)+(((BB_WIDTH-1)*BUBBLE_SZ)<<10))); + ((XOFS<<10)+(((BB_WIDTH-1)*BUBBLE_WIDTH)<<10))); shotxdirec *= -1; } @@ -1603,16 +1648,16 @@ static int bubbles_fire(struct game_context* bb) { /* display shot */ bubbles_drawboard(bb); - rb->lcd_bitmap_part(bubbles_emblem, 0, EMBLEM_SZ*bubblecur, EMBLEM_SZ, - SHOTX+tempxofs+(BUBBLE_SZ-EMBLEM_SZ)/2, - SHOTY+tempyofs+(BUBBLE_SZ-EMBLEM_SZ)/2, - EMBLEM_SZ, EMBLEM_SZ); + rb->lcd_bitmap_part(bubbles_emblem, 0, EMBLEM_HEIGHT*bubblecur, EMBLEM_WIDTH, + SHOTX+tempxofs+(BUBBLE_WIDTH-EMBLEM_WIDTH)/2, + SHOTY+tempyofs+(BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2, + EMBLEM_WIDTH, EMBLEM_HEIGHT); rb->lcd_set_drawmode(DRMODE_FG); rb->lcd_mono_bitmap((const unsigned char *)bubbles_bubble, SHOTX+tempxofs, SHOTY+tempyofs, - BUBBLE_SZ, BUBBLE_SZ); + BUBBLE_WIDTH, BUBBLE_HEIGHT); rb->lcd_set_drawmode(DRMODE_SOLID); - rb->lcd_update_rect(XOFS, 0, BB_WIDTH*BUBBLE_SZ, LCD_HEIGHT); + rb->lcd_update_rect(XOFS, 0, BB_WIDTH*BUBBLE_WIDTH, LCD_HEIGHT); /* find nearest position */ nearrow = ((SHOTY+tempyofs)- @@ -1623,10 +1668,10 @@ static int bubbles_fire(struct game_context* bb) { if(nearrow%2) { /* odd row */ nearcol = ((SHOTX+tempxofs)- (XOFS+ROW_INDENT)+ - (BUBBLE_SZ/2))/BUBBLE_SZ; + (BUBBLE_WIDTH/2))/BUBBLE_WIDTH; if(nearcol >= BB_WIDTH-1) nearcol = BB_WIDTH-2; } else { /* even row */ - nearcol = ((SHOTX+tempxofs)-XOFS+(BUBBLE_SZ/2))/BUBBLE_SZ; + nearcol = ((SHOTX+tempxofs)-XOFS+(BUBBLE_WIDTH/2))/BUBBLE_WIDTH; if(nearcol >= BB_WIDTH) nearcol = BB_WIDTH-1; } if(nearcol < 0) nearcol = 0; @@ -1699,7 +1744,7 @@ static bool bubbles_collision(struct game_context* bb, int y, int x, /* check neighbors */ if(nearcol-1 >= 0) { if(bb->playboard[nearrow][nearcol-1].type >= 0) { - nx = XOFS+(nearrow%2 ? ROW_INDENT : 0)+BUBBLE_SZ*(nearcol-1); + nx = XOFS+(nearrow%2 ? ROW_INDENT : 0)+BUBBLE_WIDTH*(nearcol-1); ny = ROW_HEIGHT*nearrow+bb->compress*ROW_HEIGHT; if((x-nx)*(x-nx)+(y-ny)*(y-ny) < MIN_DISTANCE) return true; } @@ -1709,7 +1754,7 @@ static bool bubbles_collision(struct game_context* bb, int y, int x, if(nearrow-1 >= 0) { if(bb->playboard[nearrow-1][nearcol-1+adj].type >= 0) { nx = XOFS+((nearrow-1)%2 ? ROW_INDENT : 0)+ - BUBBLE_SZ*(nearcol-1+adj); + BUBBLE_WIDTH*(nearcol-1+adj); ny = ROW_HEIGHT*(nearrow-1)+bb->compress*ROW_HEIGHT; if((x-nx)*(x-nx)+(y-ny)*(y-ny) < MIN_DISTANCE) return true; } @@ -1718,7 +1763,7 @@ static bool bubbles_collision(struct game_context* bb, int y, int x, if(nearrow+1 < BB_HEIGHT) { if(bb->playboard[nearrow+1][nearcol-1+adj].type >= 0) { nx = XOFS+((nearrow+1)%2 ? ROW_INDENT : 0)+ - BUBBLE_SZ*(nearcol-1+adj); + BUBBLE_WIDTH*(nearcol-1+adj); ny = ROW_HEIGHT*(nearrow+1)+bb->compress*ROW_HEIGHT; if((x-nx)*(x-nx)+(y-ny)*(y-ny) < MIN_DISTANCE) return true; } @@ -1729,7 +1774,7 @@ static bool bubbles_collision(struct game_context* bb, int y, int x, if(nearrow-1 >= 0) { if(bb->playboard[nearrow-1][nearcol+adj].type >= 0) { nx = XOFS+((nearrow-1)%2 ? ROW_INDENT : 0)+ - BUBBLE_SZ*(nearcol+adj); + BUBBLE_WIDTH*(nearcol+adj); ny = ROW_HEIGHT*(nearrow-1)+bb->compress*ROW_HEIGHT; if((x-nx)*(x-nx)+(y-ny)*(y-ny) < MIN_DISTANCE) return true; } @@ -1738,7 +1783,7 @@ static bool bubbles_collision(struct game_context* bb, int y, int x, if(nearrow+1 < BB_HEIGHT) { if(bb->playboard[nearrow+1][nearcol+adj].type >= 0) { nx = XOFS+((nearrow+1)%2 ? ROW_INDENT : 0)+ - BUBBLE_SZ*(nearcol+adj); + BUBBLE_WIDTH*(nearcol+adj); ny = ROW_HEIGHT*(nearrow+1)+bb->compress*ROW_HEIGHT; if((x-nx)*(x-nx)+(y-ny)*(y-ny) < MIN_DISTANCE) return true; } @@ -1747,7 +1792,7 @@ static bool bubbles_collision(struct game_context* bb, int y, int x, if(nearcol+1 < BB_WIDTH-adj) { if(bb->playboard[nearrow][nearcol+1].type >= 0) { - nx = XOFS+(nearrow%2 ? ROW_INDENT : 0)+BUBBLE_SZ*(nearcol+1); + nx = XOFS+(nearrow%2 ? ROW_INDENT : 0)+BUBBLE_WIDTH*(nearcol+1); ny = ROW_HEIGHT*nearrow+bb->compress*ROW_HEIGHT; if((x-nx)*(x-nx)+(y-ny)*(y-ny) < MIN_DISTANCE) return true; } @@ -2055,9 +2100,9 @@ static int bubbles_fall(struct game_context* bb) { for(j=0; jplayboard[i][j].delete) { indent = (i%2 ? ROW_INDENT : 0); - xofs = ((bb->playboard[i][j].fallx*count)*BUBBLE_SZ)/48; + xofs = ((bb->playboard[i][j].fallx*count)*BUBBLE_WIDTH)/48; yofs = ((count*count - bb->playboard[i][j].fallvel*count)* - BUBBLE_SZ)/20; + BUBBLE_HEIGHT)/20; /* draw bubble if it is still on the screen */ if(ROW_HEIGHT*i+bb->compress*ROW_HEIGHT+yofs @@ -2065,18 +2110,18 @@ static int bubbles_fall(struct game_context* bb) { onscreen = true; rb->lcd_bitmap_part(bubbles_emblem, 0, - EMBLEM_SZ*bb->playboard[i][j].type, EMBLEM_SZ, - XOFS+indent+BUBBLE_SZ*j+ - (BUBBLE_SZ-EMBLEM_SZ)/2+xofs, - ROW_HEIGHT*i+(BUBBLE_SZ-EMBLEM_SZ)/2+ + EMBLEM_HEIGHT*bb->playboard[i][j].type, EMBLEM_WIDTH, + XOFS+indent+BUBBLE_WIDTH*j+ + (BUBBLE_WIDTH-EMBLEM_WIDTH)/2+xofs, + ROW_HEIGHT*i+(BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2+ bb->compress*ROW_HEIGHT+yofs, - EMBLEM_SZ, EMBLEM_SZ); + EMBLEM_WIDTH, EMBLEM_HEIGHT); rb->lcd_set_drawmode(DRMODE_FG); rb->lcd_mono_bitmap( (const unsigned char *)bubbles_bubble, - XOFS+indent+BUBBLE_SZ*j+xofs, + XOFS+indent+BUBBLE_WIDTH*j+xofs, ROW_HEIGHT*i+bb->compress*ROW_HEIGHT+yofs, - BUBBLE_SZ, BUBBLE_SZ); + BUBBLE_WIDTH, BUBBLE_HEIGHT); rb->lcd_set_drawmode(DRMODE_SOLID); } } @@ -2441,25 +2486,35 @@ static int bubbles(struct game_context* bb) { rb->lcd_puts(0, 6, " and show high scores"); rb->lcd_puts(0, 7, "LEFT/RIGHT to aim"); rb->lcd_puts(0, 8, "UP/DOWN to change level"); +#elif CONFIG_KEYPAD == RECORDER_PAD + rb->lcd_puts_scroll(0, 2, "ON to start/pause, " + "F1 to save/resume, " + "OFF to exit, " + "PLAY to fire and show high scores, " + "LEFT/RIGHT to aim, " + "UP/DOWN to change level."); +#elif CONFIG_KEYPAD == ONDIO_PAD + rb->lcd_puts_scroll(0, 2, "MODE to start/pause, " + "DOWN to save/resume, " + "OFF to exit, " + "UP to fire and show high scores, " + "LEFT/RIGHT to aim and to change level."); #endif +#if LCD_WIDTH >= 138 rb->snprintf(str, 28, "Start on level %d of %d", startlevel+1, bb->highlevel+1); - rb->lcd_puts(0, 10, str); -#if LCD_HEIGHT > 110 - rb->lcd_puts(0, 12, "High Score:"); -#else - rb->lcd_puts(0, 11, "High Score:"); +#else + rb->snprintf(str, 28, "Start on lvl %d/%d", startlevel+1, + bb->highlevel+1); #endif + rb->lcd_puts(0, MIN(TEXT_LINES-3,10), str); + rb->lcd_puts(0, MIN(TEXT_LINES-2,12), "High Score:"); rb->snprintf(str, 30, "%d, Lvl %d", bb->highscores[0].score, bb->highscores[0].level); -#if LCD_HEIGHT > 110 - rb->lcd_puts(2, 13, str); -#else - rb->lcd_puts(2, 12, str); -#endif + rb->lcd_puts(2, MIN(TEXT_LINES-1,13), str); } else { /* show high scores */ - rb->snprintf(str, 12, "%s", "High Scores"); + rb->snprintf(str, 12, "High Scores"); rb->lcd_getstringsize(str, &w, &h); rb->lcd_putsxy((LCD_WIDTH-w)/2, 0, str);