diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2010-08-28 21:46:45 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2010-08-28 21:46:45 +0000 |
commit | ab9fd1840b8025336081bd72fb9dbaea7b9909dd (patch) | |
tree | 4c410bffcf1a9de2ce55a59bef45e3ecfa183a62 | |
parent | 8418a2c94a97da1d6f42f21dc348aadd1e177d77 (diff) | |
download | rockbox-ab9fd1840b8025336081bd72fb9dbaea7b9909dd.tar.gz rockbox-ab9fd1840b8025336081bd72fb9dbaea7b9909dd.zip |
plugins: use lcd_putsf/lcd_putsxyf
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27926 a1c6a512-1295-4272-9138-f99709370657
52 files changed, 173 insertions, 412 deletions
diff --git a/apps/plugins/bench_mem_jpeg.c b/apps/plugins/bench_mem_jpeg.c index 4e24f2a405..184eb0f1c8 100644 --- a/apps/plugins/bench_mem_jpeg.c +++ b/apps/plugins/bench_mem_jpeg.c | |||
@@ -54,14 +54,12 @@ const struct custom_format format_null = { | |||
54 | .get_size = get_size_null | 54 | .get_size = get_size_null |
55 | }; | 55 | }; |
56 | 56 | ||
57 | static char output_buf[256]; | ||
58 | static int output_y = 0; | 57 | static int output_y = 0; |
59 | static int font_h; | 58 | static int font_h; |
60 | 59 | ||
61 | #define lcd_printf(...) \ | 60 | #define lcd_printf(...) \ |
62 | do { \ | 61 | do { \ |
63 | rb->snprintf(output_buf, sizeof(output_buf), __VA_ARGS__); \ | 62 | rb->lcd_putsxyf(0, output_y, __VA_ARGS__); \ |
64 | rb->lcd_putsxy(0, output_y, output_buf); \ | ||
65 | rb->lcd_update_rect(0, output_y, LCD_WIDTH, font_h); \ | 63 | rb->lcd_update_rect(0, output_y, LCD_WIDTH, font_h); \ |
66 | output_y += font_h; \ | 64 | output_y += font_h; \ |
67 | } while (0) | 65 | } while (0) |
diff --git a/apps/plugins/bench_scaler.c b/apps/plugins/bench_scaler.c index 5db2987ec7..dc794e67f2 100644 --- a/apps/plugins/bench_scaler.c +++ b/apps/plugins/bench_scaler.c | |||
@@ -29,7 +29,6 @@ static unsigned char output; | |||
29 | static int output_y = 0; | 29 | static int output_y = 0; |
30 | static int font_h; | 30 | static int font_h; |
31 | static unsigned char *plugin_buf; | 31 | static unsigned char *plugin_buf; |
32 | char output_buf[256]; | ||
33 | struct img_part part; | 32 | struct img_part part; |
34 | 33 | ||
35 | /* a null output plugin to save memory and better isolate scale cost */ | 34 | /* a null output plugin to save memory and better isolate scale cost */ |
@@ -77,8 +76,7 @@ const struct custom_format format_null = { | |||
77 | 76 | ||
78 | #define lcd_printf(...) \ | 77 | #define lcd_printf(...) \ |
79 | do { \ | 78 | do { \ |
80 | rb->snprintf(output_buf, sizeof(output_buf), __VA_ARGS__); \ | 79 | rb->lcd_putsxyf(0, output_y, __VA_ARGS__); \ |
81 | rb->lcd_putsxy(0, output_y, output_buf); \ | ||
82 | rb->lcd_update_rect(0, output_y, LCD_WIDTH, font_h); \ | 80 | rb->lcd_update_rect(0, output_y, LCD_WIDTH, font_h); \ |
83 | output_y += font_h; \ | 81 | output_y += font_h; \ |
84 | } while (0) | 82 | } while (0) |
diff --git a/apps/plugins/blackjack.c b/apps/plugins/blackjack.c index 8b28b815b8..42f73ff47c 100644 --- a/apps/plugins/blackjack.c +++ b/apps/plugins/blackjack.c | |||
@@ -946,7 +946,6 @@ static signed int blackjack_get_amount(char message[20], signed int lower_limit, | |||
946 | signed int upper_limit, | 946 | signed int upper_limit, |
947 | signed int start) { | 947 | signed int start) { |
948 | int button; | 948 | int button; |
949 | char str[9]; | ||
950 | bool breakout = false, changed = false; | 949 | bool breakout = false, changed = false; |
951 | unsigned int w, h; | 950 | unsigned int w, h; |
952 | signed int amount; | 951 | signed int amount; |
@@ -968,8 +967,7 @@ static signed int blackjack_get_amount(char message[20], signed int lower_limit, | |||
968 | #if LCD_HEIGHT <= 64 | 967 | #if LCD_HEIGHT <= 64 |
969 | rb->lcd_clear_display(); | 968 | rb->lcd_clear_display(); |
970 | rb->lcd_puts(0, 1, message); | 969 | rb->lcd_puts(0, 1, message); |
971 | rb->snprintf(str, 9, "$%d", amount); | 970 | rb->lcd_putsf(0, 2, "$%d", amount); |
972 | rb->lcd_puts(0, 2, str); | ||
973 | rb->lcd_puts(0, 3, "RIGHT: +1"); | 971 | rb->lcd_puts(0, 3, "RIGHT: +1"); |
974 | rb->lcd_puts(0, 4, "LEFT: -1"); | 972 | rb->lcd_puts(0, 4, "LEFT: -1"); |
975 | rb->lcd_puts(0, 5, "UP: +10"); | 973 | rb->lcd_puts(0, 5, "UP: +10"); |
@@ -983,8 +981,7 @@ static signed int blackjack_get_amount(char message[20], signed int lower_limit, | |||
983 | rb->lcd_drawrect(LCD_WIDTH/2 - 9*w - 1, LCD_HEIGHT/2 - 4*h - 3, | 981 | rb->lcd_drawrect(LCD_WIDTH/2 - 9*w - 1, LCD_HEIGHT/2 - 4*h - 3, |
984 | 37*w / 2, 8*h -3); | 982 | 37*w / 2, 8*h -3); |
985 | rb->lcd_putsxy(LCD_WIDTH/2 - 9*w, LCD_HEIGHT/2 - 4*h - 1, message); | 983 | rb->lcd_putsxy(LCD_WIDTH/2 - 9*w, LCD_HEIGHT/2 - 4*h - 1, message); |
986 | rb->snprintf(str, 9, "$%d", amount); | 984 | rb->lcd_putsxyf(LCD_WIDTH/2 - 9*w, LCD_HEIGHT/2 - 3*h, "$%d", amount); |
987 | rb->lcd_putsxy(LCD_WIDTH/2 - 9*w, LCD_HEIGHT/2 - 3*h, str); | ||
988 | #if (CONFIG_KEYPAD == IPOD_4G_PAD) || \ | 985 | #if (CONFIG_KEYPAD == IPOD_4G_PAD) || \ |
989 | (CONFIG_KEYPAD == IPOD_3G_PAD) || \ | 986 | (CONFIG_KEYPAD == IPOD_3G_PAD) || \ |
990 | (CONFIG_KEYPAD == IPOD_1G2G_PAD) || \ | 987 | (CONFIG_KEYPAD == IPOD_1G2G_PAD) || \ |
@@ -1063,15 +1060,14 @@ static signed int blackjack_get_amount(char message[20], signed int lower_limit, | |||
1063 | } | 1060 | } |
1064 | 1061 | ||
1065 | if(changed) { | 1062 | if(changed) { |
1066 | rb->snprintf(str, 9, "$%d", amount); | ||
1067 | #if LCD_HEIGHT <= 64 | 1063 | #if LCD_HEIGHT <= 64 |
1068 | rb->lcd_puts(0, 2, str); | 1064 | rb->lcd_putsf(0, 2, "$%d", amount); |
1069 | rb->lcd_update(); | 1065 | rb->lcd_update(); |
1070 | #else | 1066 | #else |
1071 | rb->lcd_set_drawmode(DRMODE_BG+DRMODE_INVERSEVID); | 1067 | rb->lcd_set_drawmode(DRMODE_BG+DRMODE_INVERSEVID); |
1072 | rb->lcd_fillrect(LCD_WIDTH/2 - 9*w, LCD_HEIGHT/2 - 3*h, 5*w, h); | 1068 | rb->lcd_fillrect(LCD_WIDTH/2 - 9*w, LCD_HEIGHT/2 - 3*h, 5*w, h); |
1073 | rb->lcd_set_drawmode(DRMODE_SOLID); | 1069 | rb->lcd_set_drawmode(DRMODE_SOLID); |
1074 | rb->lcd_putsxy(LCD_WIDTH/2 - 9*w, LCD_HEIGHT/2 - 3*h, str); | 1070 | rb->lcd_putsxyf(LCD_WIDTH/2 - 9*w, LCD_HEIGHT/2 - 3*h, "$%d", amount); |
1075 | rb->lcd_update_rect(LCD_WIDTH/2 - 9*w, LCD_HEIGHT/2 - 3*h, 5*w, h); | 1071 | rb->lcd_update_rect(LCD_WIDTH/2 - 9*w, LCD_HEIGHT/2 - 3*h, 5*w, h); |
1076 | #endif | 1072 | #endif |
1077 | changed = false; | 1073 | changed = false; |
diff --git a/apps/plugins/bounce.c b/apps/plugins/bounce.c index 1ee5b1eaeb..abc551ff0a 100644 --- a/apps/plugins/bounce.c +++ b/apps/plugins/bounce.c | |||
@@ -582,7 +582,6 @@ static int loopit(void) | |||
582 | 582 | ||
583 | int show=0; | 583 | int show=0; |
584 | int timeout=0; | 584 | int timeout=0; |
585 | char buffer[30]; | ||
586 | 585 | ||
587 | rb->lcd_clear_display(); | 586 | rb->lcd_clear_display(); |
588 | while(1) | 587 | while(1) |
@@ -628,9 +627,8 @@ static int loopit(void) | |||
628 | show=NUM_LAST-1; | 627 | show=NUM_LAST-1; |
629 | break; | 628 | break; |
630 | } | 629 | } |
631 | rb->snprintf(buffer, 30, "%s: %d", | 630 | rb->lcd_putsxyf(0, LCD_HEIGHT - 8, "%s: %d", |
632 | values[show].what, values[show].num); | 631 | values[show].what, values[show].num); |
633 | rb->lcd_putsxy(0, LCD_HEIGHT - 8, (unsigned char *)buffer); | ||
634 | timeout--; | 632 | timeout--; |
635 | } | 633 | } |
636 | for(i=0, yy=y, xx=x; | 634 | for(i=0, yy=y, xx=x; |
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c index 50ceaa7557..2a025d750b 100644 --- a/apps/plugins/brickmania.c +++ b/apps/plugins/brickmania.c | |||
@@ -1573,11 +1573,11 @@ static int brickmania_game_loop(void) | |||
1573 | 1573 | ||
1574 | /* write life num */ | 1574 | /* write life num */ |
1575 | #if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64) | 1575 | #if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64) |
1576 | rb->snprintf(s, sizeof(s), "L:%d", life); | 1576 | #define LIFE_STR "L:%d" |
1577 | #else | 1577 | #else |
1578 | rb->snprintf(s, sizeof(s), "Life: %d", life); | 1578 | #define LIFE_STR "Life: %d" |
1579 | #endif | 1579 | #endif |
1580 | rb->lcd_putsxy(0, 0, s); | 1580 | rb->lcd_putsxyf(0, 0, LIFE_STR, life); |
1581 | 1581 | ||
1582 | #if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64) | 1582 | #if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64) |
1583 | rb->snprintf(s, sizeof(s), "L%d", level+1); | 1583 | rb->snprintf(s, sizeof(s), "L%d", level+1); |
diff --git a/apps/plugins/calendar.c b/apps/plugins/calendar.c index 32d4501920..8f25a7adc7 100644 --- a/apps/plugins/calendar.c +++ b/apps/plugins/calendar.c | |||
@@ -451,7 +451,6 @@ static void draw_calendar(struct shown *shown) | |||
451 | int w, h; | 451 | int w, h; |
452 | int x, y, pos, days_per_month, j; | 452 | int x, y, pos, days_per_month, j; |
453 | int wday; | 453 | int wday; |
454 | char buffer[12]; | ||
455 | const char *monthname[] = { | 454 | const char *monthname[] = { |
456 | "Jan", "Feb", "Mar", "Apr", "May", "Jun", | 455 | "Jan", "Feb", "Mar", "Apr", "May", "Jun", |
457 | "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" | 456 | "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" |
@@ -472,10 +471,6 @@ static void draw_calendar(struct shown *shown) | |||
472 | y = Y_OFFSET + h; | 471 | y = Y_OFFSET + h; |
473 | for (j = 1; j <= days_per_month; j++) | 472 | for (j = 1; j <= days_per_month; j++) |
474 | { | 473 | { |
475 | if ( (day_has_memo[j]) || (wday_has_memo[wday]) ) | ||
476 | rb->snprintf(buffer, 4, "%02d.", j); | ||
477 | else | ||
478 | rb->snprintf(buffer, 4, "%02d", j); | ||
479 | if (shown->mday == j) | 474 | if (shown->mday == j) |
480 | { | 475 | { |
481 | rb->lcd_set_drawmode(DRMODE_SOLID); | 476 | rb->lcd_set_drawmode(DRMODE_SOLID); |
@@ -487,7 +482,10 @@ static void draw_calendar(struct shown *shown) | |||
487 | { | 482 | { |
488 | rb->lcd_set_drawmode(DRMODE_SOLID); | 483 | rb->lcd_set_drawmode(DRMODE_SOLID); |
489 | } | 484 | } |
490 | rb->lcd_putsxy(x, y, buffer); | 485 | if ( (day_has_memo[j]) || (wday_has_memo[wday]) ) |
486 | rb->lcd_putsxyf(x, y, "%02d.", j); | ||
487 | else | ||
488 | rb->lcd_putsxyf(x, y, "%02d", j); | ||
491 | x += CELL_WIDTH; | 489 | x += CELL_WIDTH; |
492 | wday++; | 490 | wday++; |
493 | if (wday >= 7) | 491 | if (wday >= 7) |
@@ -504,9 +502,8 @@ static void draw_calendar(struct shown *shown) | |||
504 | rb->lcd_set_drawmode(DRMODE_SOLID); | 502 | rb->lcd_set_drawmode(DRMODE_SOLID); |
505 | rb->lcd_vline(LCD_WIDTH-w*8-10, LCD_HEIGHT-h-3, LCD_HEIGHT-1); | 503 | rb->lcd_vline(LCD_WIDTH-w*8-10, LCD_HEIGHT-h-3, LCD_HEIGHT-1); |
506 | rb->lcd_hline(LCD_WIDTH-w*8-10, LCD_WIDTH-1, LCD_HEIGHT-h-3); | 504 | rb->lcd_hline(LCD_WIDTH-w*8-10, LCD_WIDTH-1, LCD_HEIGHT-h-3); |
507 | rb->snprintf(buffer, sizeof(buffer), "%s %04d", | 505 | rb->lcd_putsxyf(LCD_WIDTH-w*8-8, LCD_HEIGHT-h-1, "%s %04d", |
508 | monthname[shown->mon-1], shown->year); | 506 | monthname[shown->mon-1], shown->year); |
509 | rb->lcd_putsxy(LCD_WIDTH-w*8-8, LCD_HEIGHT-h-1, buffer); | ||
510 | rb->lcd_update(); | 507 | rb->lcd_update(); |
511 | } | 508 | } |
512 | 509 | ||
diff --git a/apps/plugins/clix.c b/apps/plugins/clix.c index 0bdf693f54..9eda97a1d9 100644 --- a/apps/plugins/clix.c +++ b/apps/plugins/clix.c | |||
@@ -408,23 +408,19 @@ static void clix_draw_cell(struct clix_game_state_t* state, const int x, const i | |||
408 | static void clix_draw(struct clix_game_state_t* state) | 408 | static void clix_draw(struct clix_game_state_t* state) |
409 | { | 409 | { |
410 | int i,j; | 410 | int i,j; |
411 | char str[30]; | ||
412 | 411 | ||
413 | /* Clear screen */ | 412 | /* Clear screen */ |
414 | rb->lcd_clear_display(); | 413 | rb->lcd_clear_display(); |
415 | rb->lcd_set_foreground( LCD_WHITE); | 414 | rb->lcd_set_foreground( LCD_WHITE); |
416 | 415 | ||
417 | rb->lcd_putsxy( MARGIN, MARGIN, "Score:"); | 416 | rb->lcd_putsxy( MARGIN, MARGIN, "Score:"); |
418 | rb->snprintf( str, sizeof(str), "%d", state->score); | 417 | rb->lcd_putsxyf( 43, MARGIN, "%d", state->score); |
419 | rb->lcd_putsxy( 43, MARGIN, str); | ||
420 | #if LCD_WIDTH <= 100 | 418 | #if LCD_WIDTH <= 100 |
421 | rb->lcd_putsxy( 75, MARGIN, "L:"); | 419 | rb->lcd_putsxy( 75, MARGIN, "L:"); |
422 | rb->snprintf( str, sizeof(str), "%d", state->level); | 420 | rb->lcd_putsxyf( 90, MARGIN, "%d", state->level); |
423 | rb->lcd_putsxy( 90, MARGIN, str); | ||
424 | #else | 421 | #else |
425 | rb->lcd_putsxy( 75, MARGIN, "Level:"); | 422 | rb->lcd_putsxy( 75, MARGIN, "Level:"); |
426 | rb->snprintf( str, sizeof(str), "%d", state->level); | 423 | rb->lcd_putsxyf( 113, MARGIN, "%d", state->level); |
427 | rb->lcd_putsxy( 113, MARGIN, str); | ||
428 | #endif | 424 | #endif |
429 | for( i = 0; i < BOARD_WIDTH; ++i) | 425 | for( i = 0; i < BOARD_WIDTH; ++i) |
430 | { | 426 | { |
diff --git a/apps/plugins/codebuster.c b/apps/plugins/codebuster.c index 1169f265c3..ca36d5d01b 100644 --- a/apps/plugins/codebuster.c +++ b/apps/plugins/codebuster.c | |||
@@ -174,7 +174,7 @@ static void draw_piece(int x, int y, int w, int h, int color_id, bool emph) { | |||
174 | 174 | ||
175 | if (settings.labeling && color_id >= 0) { | 175 | if (settings.labeling && color_id >= 0) { |
176 | char text[2]; | 176 | char text[2]; |
177 | rb->snprintf(text, 2, "%d", color_id); | 177 | rb->snprintf(text, sizeof(text), "%d", color_id); |
178 | 178 | ||
179 | int fw, fh; rb->font_getstringsize(text, &fw, &fh, FONT_SYSFIXED); | 179 | int fw, fh; rb->font_getstringsize(text, &fw, &fh, FONT_SYSFIXED); |
180 | rb->lcd_putsxy(x + get_margin(fw, w), y + get_margin(fh, h), text); | 180 | rb->lcd_putsxy(x + get_margin(fw, w), y + get_margin(fh, h), text); |
diff --git a/apps/plugins/credits.c b/apps/plugins/credits.c index a05b44c20d..8f86c7626b 100644 --- a/apps/plugins/credits.c +++ b/apps/plugins/credits.c | |||
@@ -331,10 +331,8 @@ static void roll_credits(void) | |||
331 | rb->lcd_putsxy(CREDITS_TARGETPOS, 0, elapsednames); | 331 | rb->lcd_putsxy(CREDITS_TARGETPOS, 0, elapsednames); |
332 | 332 | ||
333 | for(i=0; i<NUM_VISIBLE_LINES; i++) | 333 | for(i=0; i<NUM_VISIBLE_LINES; i++) |
334 | { | 334 | rb->lcd_putsxyf(0, font_h*(i+1), "%s", credits[j+i]); |
335 | rb->snprintf(name, sizeof(name), "%s", credits[j+i]); | 335 | |
336 | rb->lcd_putsxy(0, font_h*(i+1), name); | ||
337 | } | ||
338 | rb->lcd_update(); | 336 | rb->lcd_update(); |
339 | 337 | ||
340 | rb->yield(); | 338 | rb->yield(); |
diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c index 7dec822d56..88036ed661 100644 --- a/apps/plugins/cube.c +++ b/apps/plugins/cube.c | |||
@@ -701,10 +701,9 @@ enum plugin_status plugin_start(const void* parameter) | |||
701 | if (t_disp == DISP_TIME) | 701 | if (t_disp == DISP_TIME) |
702 | { | 702 | { |
703 | rb->lcd_puts(5, 0, axes[curr].label); | 703 | rb->lcd_puts(5, 0, axes[curr].label); |
704 | rb->snprintf(buffer, sizeof(buffer), "%d %c", | 704 | rb->lcd_putsf(5, 1, "%d %c", |
705 | paused ? axes[curr].angle : axes[curr].speed, | 705 | paused ? axes[curr].angle : axes[curr].speed, |
706 | highspeed ? 'H' : ' '); | 706 | highspeed ? 'H' : ' '); |
707 | rb->lcd_puts(5, 1, buffer); | ||
708 | } | 707 | } |
709 | t_disp--; | 708 | t_disp--; |
710 | if (t_disp == 0) | 709 | if (t_disp == 0) |
diff --git a/apps/plugins/disktidy.c b/apps/plugins/disktidy.c index d83ecf4312..cc883fea9c 100644 --- a/apps/plugins/disktidy.c +++ b/apps/plugins/disktidy.c | |||
@@ -160,15 +160,12 @@ bool tidy_remove_item(char *item, int attr) | |||
160 | 160 | ||
161 | void tidy_lcd_status(const char *name, int *removed) | 161 | void tidy_lcd_status(const char *name, int *removed) |
162 | { | 162 | { |
163 | char text[24]; /* "Cleaned up nnnnn items" */ | ||
164 | |||
165 | /* display status text */ | 163 | /* display status text */ |
166 | rb->lcd_clear_display(); | 164 | rb->lcd_clear_display(); |
167 | rb->lcd_puts(0, 0, "Working ..."); | 165 | rb->lcd_puts(0, 0, "Working ..."); |
168 | rb->lcd_puts(0, 1, name); | 166 | rb->lcd_puts(0, 1, name); |
169 | rb->snprintf(text, 24, "Cleaned up %d items", *removed); | ||
170 | #ifdef HAVE_LCD_BITMAP | 167 | #ifdef HAVE_LCD_BITMAP |
171 | rb->lcd_puts(0, 2, text); | 168 | rb->lcd_putsf(0, 2, "Cleaned up %d items", *removed); |
172 | #endif | 169 | #endif |
173 | rb->lcd_update(); | 170 | rb->lcd_update(); |
174 | } | 171 | } |
diff --git a/apps/plugins/firmware_flash.c b/apps/plugins/firmware_flash.c index 02c4098ec1..5c310e028d 100644 --- a/apps/plugins/firmware_flash.c +++ b/apps/plugins/firmware_flash.c | |||
@@ -556,8 +556,6 @@ int WaitForButton(void) | |||
556 | /* helper for DoUserDialog() */ | 556 | /* helper for DoUserDialog() */ |
557 | void ShowFlashInfo(tFlashInfo* pInfo) | 557 | void ShowFlashInfo(tFlashInfo* pInfo) |
558 | { | 558 | { |
559 | char buf[32]; | ||
560 | |||
561 | if (!pInfo->manufacturer) | 559 | if (!pInfo->manufacturer) |
562 | { | 560 | { |
563 | rb->lcd_puts(0, 0, "Flash: M=?? D=??"); | 561 | rb->lcd_puts(0, 0, "Flash: M=?? D=??"); |
@@ -565,16 +563,14 @@ void ShowFlashInfo(tFlashInfo* pInfo) | |||
565 | } | 563 | } |
566 | else | 564 | else |
567 | { | 565 | { |
568 | rb->snprintf(buf, sizeof(buf), "Flash: M=%02x D=%02x", | 566 | rb->lcd_putsf(0, 0, "Flash: M=%02x D=%02x", |
569 | pInfo->manufacturer, pInfo->id); | 567 | pInfo->manufacturer, pInfo->id); |
570 | rb->lcd_puts(0, 0, buf); | ||
571 | 568 | ||
572 | 569 | ||
573 | if (pInfo->size) | 570 | if (pInfo->size) |
574 | { | 571 | { |
575 | rb->lcd_puts(0, 1, pInfo->name); | 572 | rb->lcd_puts(0, 1, pInfo->name); |
576 | rb->snprintf(buf, sizeof(buf), "Size: %d KB", pInfo->size / 1024); | 573 | rb->lcd_puts(0, 2, "Size: %d KB", pInfo->size / 1024); |
577 | rb->lcd_puts(0, 2, buf); | ||
578 | } | 574 | } |
579 | else | 575 | else |
580 | { | 576 | { |
@@ -591,7 +587,6 @@ void ShowFlashInfo(tFlashInfo* pInfo) | |||
591 | void DoUserDialog(char* filename) | 587 | void DoUserDialog(char* filename) |
592 | { | 588 | { |
593 | tFlashInfo FlashInfo; | 589 | tFlashInfo FlashInfo; |
594 | char buf[32]; | ||
595 | char default_filename[32]; | 590 | char default_filename[32]; |
596 | int button; | 591 | int button; |
597 | int rc; /* generic return code */ | 592 | int rc; /* generic return code */ |
@@ -761,8 +756,7 @@ void DoUserDialog(char* filename) | |||
761 | rb->lcd_clear_display(); | 756 | rb->lcd_clear_display(); |
762 | rb->lcd_puts(0, 0, "Panic:"); | 757 | rb->lcd_puts(0, 0, "Panic:"); |
763 | rb->lcd_puts(0, 1, "Programming fail!"); | 758 | rb->lcd_puts(0, 1, "Programming fail!"); |
764 | rb->snprintf(buf, sizeof(buf), "%d errors", rc); | 759 | rb->lcd_putsf(0, 2, "%d errors", rc); |
765 | rb->lcd_puts(0, 2, buf); | ||
766 | rb->lcd_update(); | 760 | rb->lcd_update(); |
767 | button = WaitForButton(); | 761 | button = WaitForButton(); |
768 | } | 762 | } |
@@ -782,8 +776,7 @@ void DoUserDialog(char* filename) | |||
782 | { | 776 | { |
783 | rb->lcd_puts(0, 0, "Panic:"); | 777 | rb->lcd_puts(0, 0, "Panic:"); |
784 | rb->lcd_puts(0, 1, "Verify fail!"); | 778 | rb->lcd_puts(0, 1, "Verify fail!"); |
785 | rb->snprintf(buf, sizeof(buf), "%d errors", rc); | 779 | rb->lcd_putsf(0, 2, "%d errors", rc); |
786 | rb->lcd_puts(0, 2, buf); | ||
787 | } | 780 | } |
788 | rb->lcd_puts(0, 7, "Any key to exit"); | 781 | rb->lcd_puts(0, 7, "Any key to exit"); |
789 | rb->lcd_update(); | 782 | rb->lcd_update(); |
diff --git a/apps/plugins/flipit.c b/apps/plugins/flipit.c index 44ad011a64..2bc4a1ff97 100644 --- a/apps/plugins/flipit.c +++ b/apps/plugins/flipit.c | |||
@@ -496,11 +496,8 @@ static void draw_cursor(void) | |||
496 | /* draw the info panel ... duh */ | 496 | /* draw the info panel ... duh */ |
497 | static void draw_info_panel(void) | 497 | static void draw_info_panel(void) |
498 | { | 498 | { |
499 | char s[16]; | ||
500 | |||
501 | rb->lcd_puts( 6, 0, "Flips" ); | 499 | rb->lcd_puts( 6, 0, "Flips" ); |
502 | rb->snprintf( s, sizeof(s), "%d", moves ); | 500 | rb->lcd_putsf( 6, 1, "%d", moves ); |
503 | rb->lcd_puts( 6, 1, s ); | ||
504 | } | 501 | } |
505 | 502 | ||
506 | #endif /* LCD */ | 503 | #endif /* LCD */ |
diff --git a/apps/plugins/greyscale.c b/apps/plugins/greyscale.c index 33254439b6..00699715f7 100644 --- a/apps/plugins/greyscale.c +++ b/apps/plugins/greyscale.c | |||
@@ -120,7 +120,6 @@ | |||
120 | /******************************* Globals ***********************************/ | 120 | /******************************* Globals ***********************************/ |
121 | 121 | ||
122 | GREY_INFO_STRUCT | 122 | GREY_INFO_STRUCT |
123 | static char pbuf[32]; /* global printf buffer */ | ||
124 | static unsigned char *gbuf; | 123 | static unsigned char *gbuf; |
125 | static size_t gbuf_size = 0; | 124 | static size_t gbuf_size = 0; |
126 | 125 | ||
@@ -298,9 +297,7 @@ int main(void) | |||
298 | 297 | ||
299 | time = *rb->current_tick - time; /* end time measurement */ | 298 | time = *rb->current_tick - time; /* end time measurement */ |
300 | 299 | ||
301 | rb->snprintf(pbuf, sizeof(pbuf), "Shades: 129, %d.%02ds", | 300 | rb->lcd_putsf(0, 0, "Shades: 129, %d.%02ds", time / 100, time % 100); |
302 | time / 100, time % 100); | ||
303 | rb->lcd_puts(0, 0, pbuf); | ||
304 | grey_deferred_lcd_update(); /* schedule an lcd_update() */ | 301 | grey_deferred_lcd_update(); /* schedule an lcd_update() */ |
305 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 302 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
306 | rb->cpu_boost(false); | 303 | rb->cpu_boost(false); |
diff --git a/apps/plugins/imageviewer/bmp/bmp.c b/apps/plugins/imageviewer/bmp/bmp.c index 6b5c4b1759..b96577dbed 100644 --- a/apps/plugins/imageviewer/bmp/bmp.c +++ b/apps/plugins/imageviewer/bmp/bmp.c | |||
@@ -209,11 +209,8 @@ int load_image(char *filename, struct image_info *info, | |||
209 | if (!running_slideshow) | 209 | if (!running_slideshow) |
210 | { | 210 | { |
211 | rb->lcd_puts(0, 0, rb->strrchr(filename,'/')+1); | 211 | rb->lcd_puts(0, 0, rb->strrchr(filename,'/')+1); |
212 | rb->lcd_update(); | 212 | rb->lcd_putsf(0, 1, "loading %dx%d%s", |
213 | |||
214 | rb->snprintf(print, sizeof(print), "loading %dx%d%s", | ||
215 | bmp.width, bmp.height, ds == 1?"":"(resize on load)"); | 213 | bmp.width, bmp.height, ds == 1?"":"(resize on load)"); |
216 | rb->lcd_puts(0, 1, print); | ||
217 | rb->lcd_update(); | 214 | rb->lcd_update(); |
218 | } | 215 | } |
219 | 216 | ||
@@ -260,8 +257,7 @@ int load_image(char *filename, struct image_info *info, | |||
260 | 257 | ||
261 | if (!running_slideshow) | 258 | if (!running_slideshow) |
262 | { | 259 | { |
263 | rb->snprintf(print, sizeof(print), "image %dx%d", bmp.width, bmp.height); | 260 | rb->lcd_putsf(0, 2, "image %dx%d", bmp.width, bmp.height); |
264 | rb->lcd_puts(0, 2, print); | ||
265 | rb->lcd_update(); | 261 | rb->lcd_update(); |
266 | } | 262 | } |
267 | 263 | ||
@@ -308,9 +304,7 @@ int get_image(struct image_info *info, int ds) | |||
308 | 304 | ||
309 | if (!running_slideshow) | 305 | if (!running_slideshow) |
310 | { | 306 | { |
311 | rb->snprintf(print, sizeof(print), "resizing %d*%d", | 307 | rb->lcd_putsf(0, 3, "resizing %d*%d", info->width, info->height); |
312 | info->width, info->height); | ||
313 | rb->lcd_puts(0, 3, print); | ||
314 | rb->lcd_update(); | 308 | rb->lcd_update(); |
315 | } | 309 | } |
316 | 310 | ||
diff --git a/apps/plugins/imageviewer/imageviewer.c b/apps/plugins/imageviewer/imageviewer.c index e581407290..eb1ce498a1 100644 --- a/apps/plugins/imageviewer/imageviewer.c +++ b/apps/plugins/imageviewer/imageviewer.c | |||
@@ -97,7 +97,6 @@ static fb_data rgb_linebuf[LCD_WIDTH]; /* Line buffer for scrolling when | |||
97 | #endif | 97 | #endif |
98 | 98 | ||
99 | /* my memory pool (from the mp3 buffer) */ | 99 | /* my memory pool (from the mp3 buffer) */ |
100 | static char print[32]; /* use a common snprintf() buffer */ | ||
101 | /* the remaining free part of the buffer for loaded+resized images */ | 100 | /* the remaining free part of the buffer for loaded+resized images */ |
102 | static unsigned char* buf; | 101 | static unsigned char* buf; |
103 | static size_t buf_size; | 102 | static size_t buf_size; |
@@ -777,9 +776,7 @@ static int load_and_show(char* filename, struct image_info *info) | |||
777 | 776 | ||
778 | if(!running_slideshow) | 777 | if(!running_slideshow) |
779 | { | 778 | { |
780 | rb->snprintf(print, sizeof(print), "showing %dx%d", | 779 | rb->lcd_putsf(0, 3, "showing %dx%d", info->width, info->height); |
781 | info->width, info->height); | ||
782 | rb->lcd_puts(0, 3, print); | ||
783 | rb->lcd_update(); | 780 | rb->lcd_update(); |
784 | } | 781 | } |
785 | 782 | ||
diff --git a/apps/plugins/imageviewer/jpeg/jpeg.c b/apps/plugins/imageviewer/jpeg/jpeg.c index 95e493e7ee..5f69cc7f51 100644 --- a/apps/plugins/imageviewer/jpeg/jpeg.c +++ b/apps/plugins/imageviewer/jpeg/jpeg.c | |||
@@ -157,10 +157,7 @@ int load_image(char *filename, struct image_info *info, | |||
157 | if(!running_slideshow) | 157 | if(!running_slideshow) |
158 | { | 158 | { |
159 | rb->lcd_puts(0, 0, rb->strrchr(filename,'/')+1); | 159 | rb->lcd_puts(0, 0, rb->strrchr(filename,'/')+1); |
160 | rb->lcd_update(); | 160 | rb->lcd_putsf(0, 1, "loading %d bytes", filesize); |
161 | |||
162 | rb->snprintf(print, sizeof(print), "loading %d bytes", filesize); | ||
163 | rb->lcd_puts(0, 1, print); | ||
164 | rb->lcd_update(); | 161 | rb->lcd_update(); |
165 | } | 162 | } |
166 | 163 | ||
@@ -195,9 +192,7 @@ int load_image(char *filename, struct image_info *info, | |||
195 | 192 | ||
196 | if(!running_slideshow) | 193 | if(!running_slideshow) |
197 | { | 194 | { |
198 | rb->snprintf(print, sizeof(print), "image %dx%d", | 195 | rb->lcd_putsf(0, 2, "image %dx%d", p_jpg->x_size, p_jpg->y_size); |
199 | p_jpg->x_size, p_jpg->y_size); | ||
200 | rb->lcd_puts(0, 2, print); | ||
201 | rb->lcd_update(); | 196 | rb->lcd_update(); |
202 | } | 197 | } |
203 | 198 | ||
@@ -269,9 +264,7 @@ int get_image(struct image_info *info, int ds) | |||
269 | 264 | ||
270 | if(!running_slideshow) | 265 | if(!running_slideshow) |
271 | { | 266 | { |
272 | rb->snprintf(print, sizeof(print), "decoding %d*%d", | 267 | rb->lcd_putsf(0, 3, "decoding %d*%d", info->width, info->height); |
273 | info->width, info->height); | ||
274 | rb->lcd_puts(0, 3, print); | ||
275 | rb->lcd_update(); | 268 | rb->lcd_update(); |
276 | } | 269 | } |
277 | 270 | ||
diff --git a/apps/plugins/imageviewer/png/png.c b/apps/plugins/imageviewer/png/png.c index 8bd1b241f3..46430607ea 100644 --- a/apps/plugins/imageviewer/png/png.c +++ b/apps/plugins/imageviewer/png/png.c | |||
@@ -1359,8 +1359,7 @@ int load_image(char *filename, struct image_info *info, | |||
1359 | 1359 | ||
1360 | } else { | 1360 | } else { |
1361 | if (!running_slideshow) { | 1361 | if (!running_slideshow) { |
1362 | rb->snprintf(print, sizeof(print), "loading %lu bytes", (unsigned long)image_size); | 1362 | rb->lcd_putsf(0, 1, "loading %zu bytes", image_size); |
1363 | rb->lcd_puts(0, 1, print); | ||
1364 | rb->lcd_update(); | 1363 | rb->lcd_update(); |
1365 | } | 1364 | } |
1366 | 1365 | ||
@@ -1388,14 +1387,10 @@ int load_image(char *filename, struct image_info *info, | |||
1388 | if (!decoder->error) { | 1387 | if (!decoder->error) { |
1389 | 1388 | ||
1390 | if (!running_slideshow) { | 1389 | if (!running_slideshow) { |
1391 | rb->snprintf(print, sizeof(print), "image %dx%d", | 1390 | rb->lcd_putsf(0, 2, "image %dx%d", |
1392 | decoder->infoPng.width, decoder->infoPng.height); | 1391 | decoder->infoPng.width, decoder->infoPng.height); |
1393 | rb->lcd_puts(0, 2, print); | 1392 | rb->lcd_putsf(0, 3, "decoding %d*%d", |
1394 | rb->lcd_update(); | ||
1395 | |||
1396 | rb->snprintf(print, sizeof(print), "decoding %d*%d", | ||
1397 | decoder->infoPng.width, decoder->infoPng.height); | 1393 | decoder->infoPng.width, decoder->infoPng.height); |
1398 | rb->lcd_puts(0, 3, print); | ||
1399 | rb->lcd_update(); | 1394 | rb->lcd_update(); |
1400 | } | 1395 | } |
1401 | 1396 | ||
@@ -1481,9 +1476,7 @@ int get_image(struct image_info *info, int ds) | |||
1481 | if (ds > 1) { | 1476 | if (ds > 1) { |
1482 | if (!running_slideshow) | 1477 | if (!running_slideshow) |
1483 | { | 1478 | { |
1484 | rb->snprintf(print, sizeof(print), "resizing %d*%d", | 1479 | rb->lcd_putsf(0, 3, "resizing %d*%d", info->width, info->height); |
1485 | info->width, info->height); | ||
1486 | rb->lcd_puts(0, 3, print); | ||
1487 | rb->lcd_update(); | 1480 | rb->lcd_update(); |
1488 | } | 1481 | } |
1489 | struct bitmap bmp_src, bmp_dst; | 1482 | struct bitmap bmp_src, bmp_dst; |
diff --git a/apps/plugins/iriver_flash.c b/apps/plugins/iriver_flash.c index b744eac70f..67ea090cf2 100644 --- a/apps/plugins/iriver_flash.c +++ b/apps/plugins/iriver_flash.c | |||
@@ -187,8 +187,6 @@ int wait_for_button(void) | |||
187 | /* helper for DoUserDialog() */ | 187 | /* helper for DoUserDialog() */ |
188 | void ShowFlashInfo(struct flash_info* pInfo) | 188 | void ShowFlashInfo(struct flash_info* pInfo) |
189 | { | 189 | { |
190 | char buf[32]; | ||
191 | |||
192 | if (!pInfo->manufacturer) | 190 | if (!pInfo->manufacturer) |
193 | { | 191 | { |
194 | rb->lcd_puts(0, 0, "Flash: M=?? D=??"); | 192 | rb->lcd_puts(0, 0, "Flash: M=?? D=??"); |
@@ -196,16 +194,14 @@ void ShowFlashInfo(struct flash_info* pInfo) | |||
196 | } | 194 | } |
197 | else | 195 | else |
198 | { | 196 | { |
199 | rb->snprintf(buf, sizeof(buf), "Flash: M=%02x D=%02x", | 197 | rb->lcd_putsf(0, 0, "Flash: M=%02x D=%02x", |
200 | pInfo->manufacturer, pInfo->id); | 198 | pInfo->manufacturer, pInfo->id); |
201 | rb->lcd_puts(0, 0, buf); | ||
202 | 199 | ||
203 | 200 | ||
204 | if (pInfo->size) | 201 | if (pInfo->size) |
205 | { | 202 | { |
206 | rb->lcd_puts(0, 1, pInfo->name); | 203 | rb->lcd_puts(0, 1, pInfo->name); |
207 | rb->snprintf(buf, sizeof(buf), "Size: %d KB", pInfo->size / 1024); | 204 | rb->lcd_putsf(0, 2, "Size: %d KB", pInfo->size / 1024); |
208 | rb->lcd_puts(0, 2, buf); | ||
209 | } | 205 | } |
210 | else | 206 | else |
211 | { | 207 | { |
@@ -235,11 +231,9 @@ bool show_info(void) | |||
235 | 231 | ||
236 | bool confirm(const char *msg) | 232 | bool confirm(const char *msg) |
237 | { | 233 | { |
238 | char buf[128]; | ||
239 | bool ret; | 234 | bool ret; |
240 | 235 | ||
241 | rb->snprintf(buf, sizeof buf, "%s ([PLAY] to CONFIRM)", msg); | 236 | rb->splashf(0, "%s ([PLAY] to CONFIRM)", msg); |
242 | rb->splash(0, buf); | ||
243 | 237 | ||
244 | ret = (wait_for_button() == BUTTON_ON); | 238 | ret = (wait_for_button() == BUTTON_ON); |
245 | show_info(); | 239 | show_info(); |
@@ -338,7 +332,6 @@ static int get_section_address(int section) | |||
338 | int flash_rockbox(const char *filename, int section) | 332 | int flash_rockbox(const char *filename, int section) |
339 | { | 333 | { |
340 | struct flash_header hdr; | 334 | struct flash_header hdr; |
341 | char buf[64]; | ||
342 | int pos, i, len, rc; | 335 | int pos, i, len, rc; |
343 | unsigned long checksum, sum; | 336 | unsigned long checksum, sum; |
344 | unsigned char *p8; | 337 | unsigned char *p8; |
@@ -378,9 +371,8 @@ int flash_rockbox(const char *filename, int section) | |||
378 | 371 | ||
379 | if (pos+sizeof(struct flash_header) != *p32) | 372 | if (pos+sizeof(struct flash_header) != *p32) |
380 | { | 373 | { |
381 | rb->snprintf(buf, sizeof(buf), "Incorrect relocation: 0x%08lx/0x%08lx", | 374 | rb->splashf(HZ*10, "Incorrect relocation: 0x%08lx/0x%08lx", |
382 | *p32, pos+sizeof(struct flash_header)); | 375 | *p32, pos+sizeof(struct flash_header)); |
383 | rb->splash(HZ*10, buf); | ||
384 | return -1; | 376 | return -1; |
385 | } | 377 | } |
386 | 378 | ||
@@ -393,9 +385,7 @@ int flash_rockbox(const char *filename, int section) | |||
393 | if (i + pos < SEC_SIZE) | 385 | if (i + pos < SEC_SIZE) |
394 | return -1; | 386 | return -1; |
395 | 387 | ||
396 | rb->snprintf(buf, sizeof(buf), "Erasing... %d%%", | 388 | rb->lcd_putsf(0, 3, "Erasing... %d%%", (i+SEC_SIZE)*100/len); |
397 | (i+SEC_SIZE)*100/len); | ||
398 | rb->lcd_puts(0, 3, buf); | ||
399 | rb->lcd_update(); | 389 | rb->lcd_update(); |
400 | 390 | ||
401 | rc = cfi_erase_sector(FB + (i + pos)/2); | 391 | rc = cfi_erase_sector(FB + (i + pos)/2); |
@@ -408,8 +398,7 @@ int flash_rockbox(const char *filename, int section) | |||
408 | // rb->strncpy(hdr.version, rb->rbversion , sizeof(hdr.version)-1); | 398 | // rb->strncpy(hdr.version, rb->rbversion , sizeof(hdr.version)-1); |
409 | p16 = (uint16_t *)&hdr; | 399 | p16 = (uint16_t *)&hdr; |
410 | 400 | ||
411 | rb->snprintf(buf, sizeof(buf), "Programming..."); | 401 | rb->lcd_puts(0, 4, "Programming..."); |
412 | rb->lcd_puts(0, 4, buf); | ||
413 | rb->lcd_update(); | 402 | rb->lcd_update(); |
414 | 403 | ||
415 | pos = get_section_address(section)/2; | 404 | pos = get_section_address(section)/2; |
@@ -424,9 +413,7 @@ int flash_rockbox(const char *filename, int section) | |||
424 | { | 413 | { |
425 | if (i % SEC_SIZE == 0) | 414 | if (i % SEC_SIZE == 0) |
426 | { | 415 | { |
427 | rb->snprintf(buf, sizeof(buf), "Programming... %d%%", | 416 | rb->lcd_putsf(0, 4, "Programming... %d%%", (i+1)*100/(len/2)); |
428 | (i+1)*100/(len/2)); | ||
429 | rb->lcd_puts(0, 4, buf); | ||
430 | rb->lcd_update(); | 417 | rb->lcd_update(); |
431 | } | 418 | } |
432 | 419 | ||
@@ -434,8 +421,7 @@ int flash_rockbox(const char *filename, int section) | |||
434 | } | 421 | } |
435 | 422 | ||
436 | /* Verify */ | 423 | /* Verify */ |
437 | rb->snprintf(buf, sizeof(buf), "Verifying"); | 424 | rb->lcd_puts(0, 5, "Verifying"); |
438 | rb->lcd_puts(0, 5, buf); | ||
439 | rb->lcd_update(); | 425 | rb->lcd_update(); |
440 | 426 | ||
441 | p8 = (char *)get_section_address(section); | 427 | p8 = (char *)get_section_address(section); |
@@ -560,13 +546,10 @@ int flash_bootloader(const char *filename) | |||
560 | int flash_original_fw(int len) | 546 | int flash_original_fw(int len) |
561 | { | 547 | { |
562 | unsigned char reset_vector[8]; | 548 | unsigned char reset_vector[8]; |
563 | char buf[32]; | ||
564 | int pos, i, rc; | 549 | int pos, i, rc; |
565 | unsigned char *p8; | 550 | unsigned char *p8; |
566 | uint16_t *p16; | 551 | uint16_t *p16; |
567 | 552 | ||
568 | (void)buf; | ||
569 | |||
570 | rb->lcd_puts(0, 3, "Critical section..."); | 553 | rb->lcd_puts(0, 3, "Critical section..."); |
571 | rb->lcd_update(); | 554 | rb->lcd_update(); |
572 | 555 | ||
@@ -586,13 +569,11 @@ int flash_original_fw(int len) | |||
586 | for (i = 1; i < BOOTLOADER_ERASEGUARD && (i-1)*4096 < len; i++) | 569 | for (i = 1; i < BOOTLOADER_ERASEGUARD && (i-1)*4096 < len; i++) |
587 | { | 570 | { |
588 | rc = cfi_erase_sector(FB + (SEC_SIZE/2) * i); | 571 | rc = cfi_erase_sector(FB + (SEC_SIZE/2) * i); |
589 | rb->snprintf(buf, sizeof(buf), "Erase: 0x%03x (%d)", i, rc); | 572 | rb->lcd_putsf(0, 5, "Erase: 0x%03x (%d)", i, rc); |
590 | rb->lcd_puts(0, 5, buf); | ||
591 | rb->lcd_update(); | 573 | rb->lcd_update(); |
592 | } | 574 | } |
593 | 575 | ||
594 | rb->snprintf(buf, sizeof(buf), "Programming"); | 576 | rb->lcd_puts(0, 6, "Programming"); |
595 | rb->lcd_puts(0, 6, buf); | ||
596 | rb->lcd_update(); | 577 | rb->lcd_update(); |
597 | 578 | ||
598 | pos = 0x00000008/2; | 579 | pos = 0x00000008/2; |
@@ -600,8 +581,7 @@ int flash_original_fw(int len) | |||
600 | for (i = 0; i < len/2 && pos + i < (BOOTLOADER_ENTRYPOINT/2); i++) | 581 | for (i = 0; i < len/2 && pos + i < (BOOTLOADER_ENTRYPOINT/2); i++) |
601 | cfi_program_word(FB + pos + i, p16[i]); | 582 | cfi_program_word(FB + pos + i, p16[i]); |
602 | 583 | ||
603 | rb->snprintf(buf, sizeof(buf), "Verifying"); | 584 | rb->lcd_puts(0, 7, "Verifying"); |
604 | rb->lcd_puts(0, 7, buf); | ||
605 | rb->lcd_update(); | 585 | rb->lcd_update(); |
606 | 586 | ||
607 | /* Verify reset vectors. */ | 587 | /* Verify reset vectors. */ |
@@ -623,8 +603,7 @@ int flash_original_fw(int len) | |||
623 | if (p8[i] != audiobuf[i]) | 603 | if (p8[i] != audiobuf[i]) |
624 | { | 604 | { |
625 | rb->splash(HZ*3, "Verify failed!"); | 605 | rb->splash(HZ*3, "Verify failed!"); |
626 | rb->snprintf(buf, sizeof buf, "at: 0x%08x", i); | 606 | rb->splashf(HZ*10, "at: 0x%08x", i); |
627 | rb->splash(HZ*10, buf); | ||
628 | return -5; | 607 | return -5; |
629 | } | 608 | } |
630 | } | 609 | } |
diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c index c636619b43..fc20c674aa 100644 --- a/apps/plugins/jewels.c +++ b/apps/plugins/jewels.c | |||
@@ -629,8 +629,7 @@ static void jewels_drawboard(struct game_context* bj) { | |||
629 | #endif | 629 | #endif |
630 | 630 | ||
631 | /* print text */ | 631 | /* print text */ |
632 | rb->snprintf(str, 10, "%s %d", title, bj->level); | 632 | rb->lcd_putsxyf(1, LCD_HEIGHT-10, "%s %d", title, bj->level); |
633 | rb->lcd_putsxy(1, LCD_HEIGHT-10, str); | ||
634 | 633 | ||
635 | if (bj->type == GAME_TYPE_NORMAL) { | 634 | if (bj->type == GAME_TYPE_NORMAL) { |
636 | rb->snprintf(str, 6, "%d", (bj->level-1)*LEVEL_PTS+bj->score); | 635 | rb->snprintf(str, 6, "%d", (bj->level-1)*LEVEL_PTS+bj->score); |
@@ -671,8 +670,8 @@ static void jewels_drawboard(struct game_context* bj) { | |||
671 | #endif | 670 | #endif |
672 | 671 | ||
673 | /* print text */ | 672 | /* print text */ |
674 | rb->snprintf(str, 10, "%s %d", title, bj->level); | 673 | rb->lcd_putsxyf(1, LCD_HEIGHT-(LCD_HEIGHT-(8*TILE_HEIGHT+YOFS))/2-3,"%s %d", |
675 | rb->lcd_putsxy(1, LCD_HEIGHT-(LCD_HEIGHT-(8*TILE_HEIGHT+YOFS))/2-3, str); | 674 | title, bj->level); |
676 | 675 | ||
677 | if (bj->type == GAME_TYPE_NORMAL) { | 676 | if (bj->type == GAME_TYPE_NORMAL) { |
678 | rb->snprintf(str, 6, "%d", (bj->level-1)*LEVEL_PTS+bj->score); | 677 | rb->snprintf(str, 6, "%d", (bj->level-1)*LEVEL_PTS+bj->score); |
diff --git a/apps/plugins/lib/highscore.c b/apps/plugins/lib/highscore.c index 185930202a..ff7a166222 100644 --- a/apps/plugins/lib/highscore.c +++ b/apps/plugins/lib/highscore.c | |||
@@ -125,7 +125,6 @@ void highscore_show(int position, struct highscore *scores, int num_scores, | |||
125 | bool show_level) | 125 | bool show_level) |
126 | { | 126 | { |
127 | int i, w, h; | 127 | int i, w, h; |
128 | char str[30]; | ||
129 | #ifdef HAVE_LCD_COLOR | 128 | #ifdef HAVE_LCD_COLOR |
130 | unsigned bgcolor = rb->lcd_get_background(); | 129 | unsigned bgcolor = rb->lcd_get_background(); |
131 | unsigned fgcolor = rb->lcd_get_foreground(); | 130 | unsigned fgcolor = rb->lcd_get_foreground(); |
@@ -155,14 +154,11 @@ void highscore_show(int position, struct highscore *scores, int num_scores, | |||
155 | rb->lcd_set_foreground(LCD_RGBPACK(245,0,0)); | 154 | rb->lcd_set_foreground(LCD_RGBPACK(245,0,0)); |
156 | } | 155 | } |
157 | #endif | 156 | #endif |
158 | rb->snprintf (str, sizeof (str), "%d)", i+1); | 157 | rb->lcd_putsxyf (MARGIN,3*h + h*i, "%d)", i+1); |
159 | rb->lcd_putsxy (MARGIN,3*h + h*i, str); | 158 | rb->lcd_putsxyf (LCD_WIDTH/4-w/4,3*h + h*i, "%d", scores[i].score); |
160 | rb->snprintf (str, sizeof (str), "%d", scores[i].score); | ||
161 | rb->lcd_putsxy (LCD_WIDTH/4-w/4,3*h + h*i, str); | ||
162 | 159 | ||
163 | if(show_level) { | 160 | if(show_level) { |
164 | rb->snprintf (str, sizeof (str), "%d", scores[i].level); | 161 | rb->lcd_putsxyf (LCD_WIDTH*3/4-w/4,3*h + h*i, "%d", scores[i].level); |
165 | rb->lcd_putsxy (LCD_WIDTH*3/4-w/4,3*h + h*i, str); | ||
166 | } | 162 | } |
167 | 163 | ||
168 | if(i == position) { | 164 | if(i == position) { |
diff --git a/apps/plugins/mp3_encoder.c b/apps/plugins/mp3_encoder.c index 06d28a344a..d26500819b 100644 --- a/apps/plugins/mp3_encoder.c +++ b/apps/plugins/mp3_encoder.c | |||
@@ -2137,15 +2137,13 @@ void set_scale_facs(int *mdct_freq) | |||
2137 | void compress(void) | 2137 | void compress(void) |
2138 | { | 2138 | { |
2139 | int i, gr, gr_cnt; | 2139 | int i, gr, gr_cnt; |
2140 | char stg[20]; | ||
2141 | uint32_t max; | 2140 | uint32_t max; |
2142 | 2141 | ||
2143 | while(1) | 2142 | while(1) |
2144 | { | 2143 | { |
2145 | if((frames & 7) == 0) | 2144 | if((frames & 7) == 0) |
2146 | { rb->lcd_clear_display(); | 2145 | { rb->lcd_clear_display(); |
2147 | rb->snprintf(stg, 20, "Frame %d / %d", frames, wav_size/SAMPL2/8); | 2146 | rb->lcd_putsxyf(4, 20, "Frame %d / %d", frames, wav_size/SAMPL2/8); |
2148 | rb->lcd_putsxy(4, 20, stg); | ||
2149 | rb->lcd_update(); | 2147 | rb->lcd_update(); |
2150 | } | 2148 | } |
2151 | /* encode one mp3 frame in this loop */ | 2149 | /* encode one mp3 frame in this loop */ |
@@ -2496,7 +2494,6 @@ enum plugin_status plugin_start(const void* parameter) | |||
2496 | int rat, srat, nrat; /* for rate selection */ | 2494 | int rat, srat, nrat; /* for rate selection */ |
2497 | int cont = 1, butt; | 2495 | int cont = 1, butt; |
2498 | long tim = 0; | 2496 | long tim = 0; |
2499 | char stg[40]; | ||
2500 | static const char* bstrg[] = { | 2497 | static const char* bstrg[] = { |
2501 | "64", "80", "96", "112", "128", "160", "192", "224", "256", "320" | 2498 | "64", "80", "96", "112", "128", "160", "192", "224", "256", "320" |
2502 | }; | 2499 | }; |
@@ -2568,18 +2565,15 @@ enum plugin_status plugin_start(const void* parameter) | |||
2568 | else | 2565 | else |
2569 | { | 2566 | { |
2570 | rb->close(wavfile); | 2567 | rb->close(wavfile); |
2571 | rb->snprintf(stg, 20, "WaveOpen failed %d", wave_open()); | 2568 | rb->lcd_putsxyf(0, 20, "WaveOpen failed %d", wave_open()); |
2572 | rb->lcd_putsxy(0, 20, stg); | ||
2573 | rb->lcd_update(); | 2569 | rb->lcd_update(); |
2574 | rb->sleep(5*HZ); | 2570 | rb->sleep(5*HZ); |
2575 | } | 2571 | } |
2576 | 2572 | ||
2577 | rb->lcd_clear_display(); | 2573 | rb->lcd_clear_display(); |
2578 | rb->snprintf(stg, 30, " Conversion: %ld.%02lds ", tim/100, tim%100); | 2574 | rb->lcd_putsxyf(0, 30, " Conversion: %ld.%02lds ", tim/100, tim%100); |
2579 | rb->lcd_putsxy(0, 30, stg); | ||
2580 | tim = frames * SAMP_PER_FRAME * 100 / 44100; /* unit=.01s */ | 2575 | tim = frames * SAMP_PER_FRAME * 100 / 44100; /* unit=.01s */ |
2581 | rb->snprintf(stg, 30, " WAV-Length: %ld.%02lds ", tim/100, tim%100); | 2576 | rb->lcd_putsxyf(0, 20, " WAV-Length: %ld.%02lds ", tim/100, tim%100); |
2582 | rb->lcd_putsxy(0, 20, stg); | ||
2583 | rb->lcd_update(); | 2577 | rb->lcd_update(); |
2584 | rb->sleep(5*HZ); | 2578 | rb->sleep(5*HZ); |
2585 | } | 2579 | } |
diff --git a/apps/plugins/nim.c b/apps/plugins/nim.c index 3a3a870dad..70cf8dcec4 100644 --- a/apps/plugins/nim.c +++ b/apps/plugins/nim.c | |||
@@ -56,7 +56,6 @@ static unsigned char pattern3[]={0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15}; /*3 | |||
56 | static unsigned char pattern2[]={0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14}; /*2 parts*/ | 56 | static unsigned char pattern2[]={0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14}; /*2 parts*/ |
57 | static unsigned char pattern1[]={0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10}; /*1 part*/ | 57 | static unsigned char pattern1[]={0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10}; /*1 part*/ |
58 | 58 | ||
59 | static unsigned char str[12]; /*String use to display the first line*/ | ||
60 | static unsigned long hsmile,hcry,h1,h2; /*Handle for the new pattern*/ | 59 | static unsigned long hsmile,hcry,h1,h2; /*Handle for the new pattern*/ |
61 | 60 | ||
62 | static bool end; /*If true game is finished*/ | 61 | static bool end; /*If true game is finished*/ |
@@ -101,8 +100,7 @@ static void display_first_line(int x) | |||
101 | { | 100 | { |
102 | int i; | 101 | int i; |
103 | 102 | ||
104 | rb->snprintf(str,sizeof(str)," =%d",x); | 103 | rb->lcd_putsf(0,0," =%d",x); |
105 | rb->lcd_puts(0,0,str); | ||
106 | 104 | ||
107 | rb->lcd_define_pattern(h1,pattern3); | 105 | rb->lcd_define_pattern(h1,pattern3); |
108 | for (i=0;i<x/3;i++) | 106 | for (i=0;i<x/3;i++) |
@@ -179,8 +177,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
179 | y=1; | 177 | y=1; |
180 | display_first_line(x); | 178 | display_first_line(x); |
181 | 179 | ||
182 | rb->snprintf(str,sizeof(str),"[%d..%d]?=%d",min,v,y); | 180 | rb->lcd_putsf(0,1,"[%d..%d]?=%d",min,v,y); |
183 | rb->lcd_puts(0,1,str); | ||
184 | rb->lcd_update(); | 181 | rb->lcd_update(); |
185 | 182 | ||
186 | go=false; | 183 | go=false; |
@@ -215,8 +212,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
215 | break; | 212 | break; |
216 | } | 213 | } |
217 | display_first_line(x); | 214 | display_first_line(x); |
218 | rb->snprintf(str,sizeof(str),"[%d..%d]?=%d",min,v,y); | 215 | rb->lcd_putsf(0,1,"[%d..%d]?=%d",min,v,y); |
219 | rb->lcd_puts(0,1,str); | ||
220 | rb->lcd_update(); | 216 | rb->lcd_update(); |
221 | } | 217 | } |
222 | 218 | ||
@@ -276,8 +272,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
276 | } | 272 | } |
277 | v=y*2; | 273 | v=y*2; |
278 | x-=y; | 274 | x-=y; |
279 | rb->snprintf(str,sizeof(str),"I take=%d",y); | 275 | rb->lcd_putsf(0,1,"I take=%d",y); |
280 | rb->lcd_puts(0,1,str); | ||
281 | rb->lcd_update(); | 276 | rb->lcd_update(); |
282 | rb->sleep(HZ); | 277 | rb->sleep(HZ); |
283 | } | 278 | } |
diff --git a/apps/plugins/pacbox/pacbox.c b/apps/plugins/pacbox/pacbox.c index db25b1c0f1..e942841a19 100644 --- a/apps/plugins/pacbox/pacbox.c +++ b/apps/plugins/pacbox/pacbox.c | |||
@@ -367,7 +367,6 @@ static void stop_sound(void) | |||
367 | static int gameProc( void ) | 367 | static int gameProc( void ) |
368 | { | 368 | { |
369 | int fps; | 369 | int fps; |
370 | char str[80]; | ||
371 | int status; | 370 | int status; |
372 | long end_time; | 371 | long end_time; |
373 | int frame_counter = 0; | 372 | int frame_counter = 0; |
@@ -469,9 +468,7 @@ static int gameProc( void ) | |||
469 | 468 | ||
470 | if (settings.showfps) { | 469 | if (settings.showfps) { |
471 | fps = (video_frames*HZ*100) / (*rb->current_tick-start_time); | 470 | fps = (video_frames*HZ*100) / (*rb->current_tick-start_time); |
472 | rb->snprintf(str,sizeof(str),"%d.%02d / %d fps ", | 471 | rb->lcd_putsxyf(0,0,"%d.%02d / %d fps ",fps/100,fps%100,FPS); |
473 | fps/100,fps%100,FPS); | ||
474 | rb->lcd_putsxy(0,0,str); | ||
475 | } | 472 | } |
476 | 473 | ||
477 | #if !defined(HAVE_LCD_MODES) || \ | 474 | #if !defined(HAVE_LCD_MODES) || \ |
diff --git a/apps/plugins/pegbox.c b/apps/plugins/pegbox.c index a953c6804b..1c4b2fcb6e 100644 --- a/apps/plugins/pegbox.c +++ b/apps/plugins/pegbox.c | |||
@@ -773,7 +773,6 @@ static void pegbox_draw_board(struct game_context* pb) | |||
773 | { | 773 | { |
774 | unsigned int r, c, type; | 774 | unsigned int r, c, type; |
775 | pb->num_left = 0; | 775 | pb->num_left = 0; |
776 | char str[5]; | ||
777 | 776 | ||
778 | rb->lcd_clear_display(); | 777 | rb->lcd_clear_display(); |
779 | #ifdef WIDE_LAYOUT | 778 | #ifdef WIDE_LAYOUT |
@@ -819,15 +818,11 @@ static void pegbox_draw_board(struct game_context* pb) | |||
819 | } | 818 | } |
820 | 819 | ||
821 | #ifdef WIDE_LAYOUT | 820 | #ifdef WIDE_LAYOUT |
822 | rb->snprintf(str, 3, "%d", pb->level); | 821 | rb->lcd_putsxyf(TEXT_X, LEVEL_TEXT_Y, "%d", pb->level); |
823 | rb->lcd_putsxy(TEXT_X, LEVEL_TEXT_Y, str); | 822 | rb->lcd_putsxyf(TEXT_X, PEGS_TEXT_Y, "%d", pb->num_left); |
824 | rb->snprintf(str, 3, "%d", pb->num_left); | ||
825 | rb->lcd_putsxy(TEXT_X, PEGS_TEXT_Y, str); | ||
826 | #else | 823 | #else |
827 | rb->snprintf(str, 3, "%d", pb->level); | 824 | rb->lcd_putsxyf(LEVEL_TEXT_X, TEXT_Y, "%d", pb->level); |
828 | rb->lcd_putsxy(LEVEL_TEXT_X, TEXT_Y, str); | 825 | rb->lcd_putsxyf(PEGS_TEXT_X, TEXT_Y, "%d", pb->num_left); |
829 | rb->snprintf(str, 3, "%d", pb->num_left); | ||
830 | rb->lcd_putsxy(PEGS_TEXT_X, TEXT_Y, str); | ||
831 | #endif /*WIDE_LAYOUT*/ | 826 | #endif /*WIDE_LAYOUT*/ |
832 | 827 | ||
833 | #ifdef HAVE_LCD_COLOR | 828 | #ifdef HAVE_LCD_COLOR |
diff --git a/apps/plugins/reversi/reversi-gui.c b/apps/plugins/reversi/reversi-gui.c index 5188986e84..6f5d53da58 100644 --- a/apps/plugins/reversi/reversi-gui.c +++ b/apps/plugins/reversi/reversi-gui.c | |||
@@ -613,7 +613,6 @@ enum plugin_status plugin_start(const void *parameter) { | |||
613 | int lastbutton = BUTTON_NONE; | 613 | int lastbutton = BUTTON_NONE; |
614 | int row, col; | 614 | int row, col; |
615 | int w_cnt, b_cnt; | 615 | int w_cnt, b_cnt; |
616 | char msg_buf[30]; | ||
617 | 616 | ||
618 | /* Initialize Font Width and height */ | 617 | /* Initialize Font Width and height */ |
619 | rb->lcd_getstringsize("0", &font_width, &font_height); | 618 | rb->lcd_getstringsize("0", &font_width, &font_height); |
@@ -671,10 +670,8 @@ enum plugin_status plugin_start(const void *parameter) { | |||
671 | /* TODO: Don't duplicate end of game check */ | 670 | /* TODO: Don't duplicate end of game check */ |
672 | if (reversi_game_is_finished(&game, cur_player)) { | 671 | if (reversi_game_is_finished(&game, cur_player)) { |
673 | reversi_count_occupied_cells(&game, &w_cnt, &b_cnt); | 672 | reversi_count_occupied_cells(&game, &w_cnt, &b_cnt); |
674 | rb->snprintf(msg_buf, sizeof(msg_buf), | 673 | rb->splashf(HZ*2, "Game over. %s won.", |
675 | "Game over. %s won.", | ||
676 | (w_cnt>b_cnt?"WHITE":"BLACK")); | 674 | (w_cnt>b_cnt?"WHITE":"BLACK")); |
677 | rb->splash(HZ*2, msg_buf); | ||
678 | draw_screen = true; /* Must update screen after splash */ | 675 | draw_screen = true; /* Must update screen after splash */ |
679 | game_finished = true; | 676 | game_finished = true; |
680 | } | 677 | } |
@@ -743,10 +740,8 @@ enum plugin_status plugin_start(const void *parameter) { | |||
743 | cur_player = reversi_flipped_color(cur_player); | 740 | cur_player = reversi_flipped_color(cur_player); |
744 | if (reversi_game_is_finished(&game, cur_player)) { | 741 | if (reversi_game_is_finished(&game, cur_player)) { |
745 | reversi_count_occupied_cells(&game, &w_cnt, &b_cnt); | 742 | reversi_count_occupied_cells(&game, &w_cnt, &b_cnt); |
746 | rb->snprintf(msg_buf, sizeof(msg_buf), | 743 | rb->splashf(HZ*2, "Game over. %s won.", |
747 | "Game over. %s won.", | ||
748 | (w_cnt>b_cnt?"WHITE":"BLACK")); | 744 | (w_cnt>b_cnt?"WHITE":"BLACK")); |
749 | rb->splash(HZ*2, msg_buf); | ||
750 | draw_screen = true; /* Must update screen after splash */ | 745 | draw_screen = true; /* Must update screen after splash */ |
751 | game_finished = true; | 746 | game_finished = true; |
752 | } | 747 | } |
diff --git a/apps/plugins/robotfindskitten.c b/apps/plugins/robotfindskitten.c index 003087b5c3..8426f35850 100644 --- a/apps/plugins/robotfindskitten.c +++ b/apps/plugins/robotfindskitten.c | |||
@@ -598,11 +598,9 @@ int screen[X_MAX + 1][Y_MAX + 1]; | |||
598 | * | 598 | * |
599 | *****************************************************************************/ | 599 | *****************************************************************************/ |
600 | 600 | ||
601 | static void drawchar(int x, int y, char c) | 601 | static inline void drawchar(int x, int y, char c) |
602 | { | 602 | { |
603 | char str[2]; | 603 | rb->lcd_putsxyf(x*SYSFONT_WIDTH, y*SYSFONT_HEIGHT, "%c", c); |
604 | rb->snprintf(str, sizeof(str), "%c", c); | ||
605 | rb->lcd_putsxy(x*SYSFONT_WIDTH, y*SYSFONT_HEIGHT, str); | ||
606 | } | 604 | } |
607 | 605 | ||
608 | static void draw(struct screen_object o) | 606 | static void draw(struct screen_object o) |
diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c index 90df401ef9..44d637d8fa 100644 --- a/apps/plugins/rockblox.c +++ b/apps/plugins/rockblox.c | |||
@@ -810,25 +810,18 @@ static void init_board (void) | |||
810 | /* show the score, level and lines */ | 810 | /* show the score, level and lines */ |
811 | static void show_details (void) | 811 | static void show_details (void) |
812 | { | 812 | { |
813 | char str[25]; /* for strings */ | ||
814 | |||
815 | #ifdef HAVE_LCD_BITMAP | 813 | #ifdef HAVE_LCD_BITMAP |
816 | #if LCD_DEPTH >= 2 | 814 | #if LCD_DEPTH >= 2 |
817 | rb->lcd_set_foreground (LCD_BLACK); | 815 | rb->lcd_set_foreground (LCD_BLACK); |
818 | rb->lcd_set_background (LCD_WHITE); | 816 | rb->lcd_set_background (LCD_WHITE); |
819 | #endif | 817 | #endif |
820 | rb->snprintf (str, sizeof (str), "%d", rockblox_status.score); | 818 | rb->lcd_putsxyf (LABEL_X, SCORE_Y, "%d", rockblox_status.score); |
821 | rb->lcd_putsxy (LABEL_X, SCORE_Y, str); | 819 | rb->lcd_putsxyf (LEVEL_X, LEVEL_Y, "%d", rockblox_status.level); |
822 | rb->snprintf (str, sizeof (str), "%d", rockblox_status.level); | 820 | rb->lcd_putsxyf (LINES_X, LINES_Y, "%d", rockblox_status.lines); |
823 | rb->lcd_putsxy (LEVEL_X, LEVEL_Y, str); | ||
824 | rb->snprintf (str, sizeof (str), "%d", rockblox_status.lines); | ||
825 | rb->lcd_putsxy (LINES_X, LINES_Y, str); | ||
826 | #else /* HAVE_LCD_CHARCELLS */ | 821 | #else /* HAVE_LCD_CHARCELLS */ |
827 | rb->snprintf (str, sizeof (str), "L%d/%d", rockblox_status.level, | 822 | rb->lcd_putsf (5, 0, "L%d/%d", rockblox_status.level, |
828 | rockblox_status.lines); | 823 | rockblox_status.lines); |
829 | rb->lcd_puts (5, 0, str); | 824 | rb->lcd_putsf (5, 1, "S%d", rockblox_status.score); |
830 | rb->snprintf (str, sizeof (str), "S%d", rockblox_status.score); | ||
831 | rb->lcd_puts (5, 1, str); | ||
832 | #endif | 825 | #endif |
833 | } | 826 | } |
834 | 827 | ||
@@ -836,14 +829,10 @@ static void show_details (void) | |||
836 | static void show_highscores (void) | 829 | static void show_highscores (void) |
837 | { | 830 | { |
838 | int i; | 831 | int i; |
839 | char str[25]; /* for strings */ | ||
840 | 832 | ||
841 | for (i = 0; i<NUM_SCORES; i++) | 833 | for (i = 0; i<NUM_SCORES; i++) |
842 | { | 834 | rb->lcd_putsxyf (HIGH_LABEL_X, HIGH_SCORE_Y + (10 * i), |
843 | rb->snprintf (str, sizeof (str), "%06d" _SPACE "L%1d", | 835 | "%06d" _SPACE "L%1d", highscores[i].score, highscores[i].level); |
844 | highscores[i].score, highscores[i].level); | ||
845 | rb->lcd_putsxy (HIGH_LABEL_X, HIGH_SCORE_Y + (10 * i), str); | ||
846 | } | ||
847 | } | 836 | } |
848 | #endif | 837 | #endif |
849 | 838 | ||
diff --git a/apps/plugins/rockblox1d.c b/apps/plugins/rockblox1d.c index 6a175e5bb5..96937bbae9 100644 --- a/apps/plugins/rockblox1d.c +++ b/apps/plugins/rockblox1d.c | |||
@@ -206,7 +206,6 @@ enum plugin_status plugin_start(const void* parameter) | |||
206 | int type_next_brick = 0; | 206 | int type_next_brick = 0; |
207 | 207 | ||
208 | unsigned long int score = 34126; | 208 | unsigned long int score = 34126; |
209 | char score_buf[10]; | ||
210 | 209 | ||
211 | (void)parameter; | 210 | (void)parameter; |
212 | 211 | ||
@@ -278,8 +277,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
278 | } | 277 | } |
279 | 278 | ||
280 | /* Score box */ | 279 | /* Score box */ |
281 | rb->snprintf(score_buf, sizeof(score_buf), "%8ld0", score); | 280 | rb->lcd_putsxyf(score_x, SCORE_Y, "%8ld0", score); |
282 | rb->lcd_putsxy(score_x, SCORE_Y, score_buf); | ||
283 | 281 | ||
284 | rb->lcd_update(); | 282 | rb->lcd_update(); |
285 | 283 | ||
diff --git a/apps/plugins/rockbox_flash.c b/apps/plugins/rockbox_flash.c index 9da3f63c8b..09ee96997c 100644 --- a/apps/plugins/rockbox_flash.c +++ b/apps/plugins/rockbox_flash.c | |||
@@ -559,7 +559,6 @@ static void DoUserDialog(char* filename) | |||
559 | { | 559 | { |
560 | tImageHeader ImageHeader; | 560 | tImageHeader ImageHeader; |
561 | tFlashInfo FlashInfo; | 561 | tFlashInfo FlashInfo; |
562 | static char buf[MAX_PATH]; | ||
563 | int button; | 562 | int button; |
564 | int rc; /* generic return code */ | 563 | int rc; /* generic return code */ |
565 | UINT32 space, aligned_size, true_size; | 564 | UINT32 space, aligned_size, true_size; |
@@ -612,8 +611,7 @@ static void DoUserDialog(char* filename) | |||
612 | bl_version = BootloaderVersion(); | 611 | bl_version = BootloaderVersion(); |
613 | if (bl_version < LATEST_BOOTLOADER_VERSION) | 612 | if (bl_version < LATEST_BOOTLOADER_VERSION) |
614 | { | 613 | { |
615 | rb->snprintf(buf, sizeof(buf), "Bootloader V%d", bl_version); | 614 | rb->lcd_putsf(0, 0, "Bootloader V%d", bl_version); |
616 | rb->lcd_puts(0, 0, buf); | ||
617 | rb->lcd_puts(0, 1, "Hint: You're not "); | 615 | rb->lcd_puts(0, 1, "Hint: You're not "); |
618 | rb->lcd_puts(0, 2, "using the latest "); | 616 | rb->lcd_puts(0, 2, "using the latest "); |
619 | rb->lcd_puts(0, 3, "bootloader. "); | 617 | rb->lcd_puts(0, 3, "bootloader. "); |
@@ -722,10 +720,9 @@ static void DoUserDialog(char* filename) | |||
722 | if (rc) | 720 | if (rc) |
723 | { /* errors */ | 721 | { /* errors */ |
724 | rb->lcd_clear_display(); | 722 | rb->lcd_clear_display(); |
725 | rb->snprintf(buf, sizeof(buf), "%d errors", rc); | ||
726 | rb->lcd_puts(0, 0, "Error:"); | 723 | rb->lcd_puts(0, 0, "Error:"); |
727 | rb->lcd_puts(0, 1, "Programming fail!"); | 724 | rb->lcd_puts(0, 1, "Programming fail!"); |
728 | rb->lcd_puts(0, 2, buf); | 725 | rb->lcd_putsf(0, 2, "%d errors", rc); |
729 | rb->lcd_update(); | 726 | rb->lcd_update(); |
730 | button = WaitForButton(); | 727 | button = WaitForButton(); |
731 | } | 728 | } |
@@ -743,10 +740,9 @@ static void DoUserDialog(char* filename) | |||
743 | } | 740 | } |
744 | else | 741 | else |
745 | { | 742 | { |
746 | rb->snprintf(buf, sizeof(buf), "%d errors", rc); | ||
747 | rb->lcd_puts(0, 0, "Error:"); | 743 | rb->lcd_puts(0, 0, "Error:"); |
748 | rb->lcd_puts(0, 1, "Verify fail!"); | 744 | rb->lcd_puts(0, 1, "Verify fail!"); |
749 | rb->lcd_puts(0, 2, buf); | 745 | rb->lcd_putsf(0, 2, "%d errors", rc); |
750 | rb->lcd_puts(0, 3, "Use safe image"); | 746 | rb->lcd_puts(0, 3, "Use safe image"); |
751 | rb->lcd_puts(0, 4, "if booting hangs:"); | 747 | rb->lcd_puts(0, 4, "if booting hangs:"); |
752 | rb->lcd_puts(0, 5, "F1 during power-on"); | 748 | rb->lcd_puts(0, 5, "F1 during power-on"); |
diff --git a/apps/plugins/rockboy/debug.c b/apps/plugins/rockboy/debug.c index a829b98799..8dc7320035 100644 --- a/apps/plugins/rockboy/debug.c +++ b/apps/plugins/rockboy/debug.c | |||
@@ -571,7 +571,7 @@ void debug_disassemble(addr a, int c) | |||
571 | static int opaddr; | 571 | static int opaddr; |
572 | static char mnemonic[256]; | 572 | static char mnemonic[256]; |
573 | static char *pattern; | 573 | static char *pattern; |
574 | char meow[500],buf[300]; | 574 | char ops_str[300]; |
575 | if(!debug_trace) return; | 575 | if(!debug_trace) return; |
576 | 576 | ||
577 | while (c > 0) | 577 | while (c > 0) |
@@ -600,8 +600,7 @@ void debug_disassemble(addr a, int c) | |||
600 | case 'B': | 600 | case 'B': |
601 | case 'b': | 601 | case 'b': |
602 | ops[k] = readb(a); a++; | 602 | ops[k] = readb(a); a++; |
603 | j += snprintf(mnemonic + j,255-j, | 603 | j += snprintf(mnemonic + j,255-j, "%02Xh", ops[k++]); |
604 | "%02Xh", ops[k++]); | ||
605 | break; | 604 | break; |
606 | case 'W': | 605 | case 'W': |
607 | case 'w': | 606 | case 'w': |
@@ -614,8 +613,7 @@ void debug_disassemble(addr a, int c) | |||
614 | case 'O': | 613 | case 'O': |
615 | case 'o': | 614 | case 'o': |
616 | ops[k] = readb(a); a++; | 615 | ops[k] = readb(a); a++; |
617 | j += snprintf(mnemonic + j, 255-j,"%+d", | 616 | j += snprintf(mnemonic + j, 255-j,"%+d", (n8)(ops[k++])); |
618 | (n8)(ops[k++])); | ||
619 | break; | 617 | break; |
620 | } | 618 | } |
621 | i++; | 619 | i++; |
@@ -626,52 +624,19 @@ void debug_disassemble(addr a, int c) | |||
626 | } | 624 | } |
627 | } | 625 | } |
628 | mnemonic[j] = 0; | 626 | mnemonic[j] = 0; |
629 | snprintf(buf,299,"%04X ", opaddr); | ||
630 | strcpy(meow,buf); | ||
631 | switch (operand_count[ops[0]]) { | 627 | switch (operand_count[ops[0]]) { |
632 | case 1: | 628 | case 1: |
633 | snprintf(buf,299,"%02X ", ops[0]); | 629 | snprintf(ops_str,sizeof(ops_str),"%02X ", ops[0]); |
634 | strcat(meow,buf); | ||
635 | break; | 630 | break; |
636 | case 2: | 631 | case 2: |
637 | snprintf(buf,299,"%02X %02X ", ops[0], ops[1]); | 632 | snprintf(ops_str,sizeof(ops_str),"%02X %02X ", ops[0], ops[1]); |
638 | strcat(meow,buf); | ||
639 | break; | 633 | break; |
640 | case 3: | 634 | case 3: |
641 | snprintf(buf,299,"%02X %02X %02X ", ops[0], ops[1], ops[2]); | 635 | snprintf(ops_str,sizeof(ops_str),"%02X %02X %02X", ops[0], ops[1], ops[2]); |
642 | strcat(meow,buf); | ||
643 | break; | 636 | break; |
644 | } | 637 | } |
645 | snprintf(buf,"%-16.16s", mnemonic); | 638 | rb->lcd_putsxyf(0,0,"%04X %s %-16.16s", opaddr, ops_str, mnemonic); |
646 | strcat(meow,buf); | ||
647 | rb->lcd_putsxy(0,0,meow); | ||
648 | rb->lcd_update(); | 639 | rb->lcd_update(); |
649 | c--; | 640 | c--; |
650 | } | 641 | } |
651 | } | 642 | } |
652 | |||
653 | |||
654 | |||
655 | |||
656 | |||
657 | |||
658 | |||
659 | |||
660 | |||
661 | |||
662 | |||
663 | |||
664 | |||
665 | |||
666 | |||
667 | |||
668 | |||
669 | |||
670 | |||
671 | |||
672 | |||
673 | |||
674 | |||
675 | |||
676 | |||
677 | |||
diff --git a/apps/plugins/rockboy/lcd.c b/apps/plugins/rockboy/lcd.c index 0da9fc7e9d..22f8864889 100644 --- a/apps/plugins/rockboy/lcd.c +++ b/apps/plugins/rockboy/lcd.c | |||
@@ -1009,10 +1009,6 @@ void setvidmode(void) | |||
1009 | 1009 | ||
1010 | void lcd_refreshline(void) | 1010 | void lcd_refreshline(void) |
1011 | { | 1011 | { |
1012 | #ifdef HAVE_LCD_COLOR | ||
1013 | char frameout[30]; | ||
1014 | #endif | ||
1015 | |||
1016 | if (!(R_LCDC & 0x80)) | 1012 | if (!(R_LCDC & 0x80)) |
1017 | return; /* should not happen... */ | 1013 | return; /* should not happen... */ |
1018 | 1014 | ||
@@ -1112,8 +1108,8 @@ void lcd_refreshline(void) | |||
1112 | { | 1108 | { |
1113 | if(options.showstats) | 1109 | if(options.showstats) |
1114 | { | 1110 | { |
1115 | snprintf(frameout,sizeof(frameout),"FPS: %d Frameskip: %d ",options.fps, options.frameskip); | 1111 | rb->lcd_putsxyf(0,LCD_HEIGHT-10,"FPS: %d Frameskip: %d ", |
1116 | rb->lcd_putsxy(0,LCD_HEIGHT-10,frameout); | 1112 | options.fps, options.frameskip); |
1117 | rb->lcd_update_rect(0,LCD_HEIGHT-10, LCD_WIDTH, 10); | 1113 | rb->lcd_update_rect(0,LCD_HEIGHT-10, LCD_WIDTH, 10); |
1118 | } | 1114 | } |
1119 | 1115 | ||
diff --git a/apps/plugins/rockboy/menu.c b/apps/plugins/rockboy/menu.c index 6e8df5c0ea..242518c01e 100644 --- a/apps/plugins/rockboy/menu.c +++ b/apps/plugins/rockboy/menu.c | |||
@@ -171,7 +171,7 @@ static void build_slot_path(char *buf, size_t bufsiz, int slot_id) { | |||
171 | * | 171 | * |
172 | */ | 172 | */ |
173 | static bool do_file(char *path, char *desc, bool is_load) { | 173 | static bool do_file(char *path, char *desc, bool is_load) { |
174 | char buf[200], desc_buf[20]; | 174 | char desc_buf[20]; |
175 | int fd, file_mode; | 175 | int fd, file_mode; |
176 | 176 | ||
177 | /* set file mode */ | 177 | /* set file mode */ |
@@ -191,8 +191,7 @@ static bool do_file(char *path, char *desc, bool is_load) { | |||
191 | loadstate(fd); | 191 | loadstate(fd); |
192 | 192 | ||
193 | /* print out a status message so the user knows the state loaded */ | 193 | /* print out a status message so the user knows the state loaded */ |
194 | snprintf(buf, 200, "Loaded state from \"%s\"", path); | 194 | rb->splashf(HZ * 1, "Loaded state from \"%s\"", path); |
195 | rb->splash(HZ * 1, buf); | ||
196 | } | 195 | } |
197 | else | 196 | else |
198 | { | 197 | { |
diff --git a/apps/plugins/rocklife.c b/apps/plugins/rocklife.c index afe442f989..8ae5cdb120 100644 --- a/apps/plugins/rocklife.c +++ b/apps/plugins/rocklife.c | |||
@@ -90,7 +90,6 @@ unsigned char grid_b[GRID_W][GRID_H]; | |||
90 | int generation = 0; | 90 | int generation = 0; |
91 | int population = 0; | 91 | int population = 0; |
92 | int status_line = 0; | 92 | int status_line = 0; |
93 | char buf[30]; | ||
94 | 93 | ||
95 | 94 | ||
96 | static inline bool is_valid_cell(int x, int y) { | 95 | static inline bool is_valid_cell(int x, int y) { |
@@ -308,11 +307,10 @@ static void show_grid(char *pgrid){ | |||
308 | } | 307 | } |
309 | } | 308 | } |
310 | if(status_line){ | 309 | if(status_line){ |
311 | rb->snprintf(buf, sizeof(buf), "g:%d p:%d", generation, population); | ||
312 | #if LCD_DEPTH > 1 | 310 | #if LCD_DEPTH > 1 |
313 | rb->lcd_set_foreground( LCD_BLACK ); | 311 | rb->lcd_set_foreground( LCD_BLACK ); |
314 | #endif | 312 | #endif |
315 | rb->lcd_puts(0, 0, buf); | 313 | rb->lcd_putsf(0, 0, "g:%d p:%d", generation, population); |
316 | } | 314 | } |
317 | rb->lcd_update(); | 315 | rb->lcd_update(); |
318 | } | 316 | } |
diff --git a/apps/plugins/rockpaint.c b/apps/plugins/rockpaint.c index 7032a8e793..557c84d8ea 100644 --- a/apps/plugins/rockpaint.c +++ b/apps/plugins/rockpaint.c | |||
@@ -977,8 +977,6 @@ static unsigned int color_chooser( unsigned int color ) | |||
977 | enum BaseColor current = Red; | 977 | enum BaseColor current = Red; |
978 | bool has_changed; | 978 | bool has_changed; |
979 | 979 | ||
980 | char str[6] = ""; | ||
981 | |||
982 | restore_screen(); | 980 | restore_screen(); |
983 | 981 | ||
984 | rgb2hsv( red, green, blue, &hue, &saturation, &value ); | 982 | rgb2hsv( red, green, blue, &hue, &saturation, &value ); |
@@ -1028,18 +1026,14 @@ static unsigned int color_chooser( unsigned int color ) | |||
1028 | #undef POSITION | 1026 | #undef POSITION |
1029 | rb->lcd_set_background(COLOR_LIGHTGRAY); | 1027 | rb->lcd_set_background(COLOR_LIGHTGRAY); |
1030 | rb->lcd_setfont( FONT_SYSFIXED ); | 1028 | rb->lcd_setfont( FONT_SYSFIXED ); |
1031 | rb->snprintf( str, 6, "%d", hue/10 ); | 1029 | rb->lcd_putsxyf( left + 117, top + 20, "%d", hue/10 ); |
1032 | rb->lcd_putsxy( left + 117, top + 20, str ); | 1030 | rb->lcd_putsxyf( left + 117, top + 30, "%d.%d", |
1033 | rb->snprintf( str, 6, "%d.%d", saturation/255, ((saturation*100)/255)%100 ); | 1031 | saturation/255, ((saturation*100)/255)%100 ); |
1034 | rb->lcd_putsxy( left + 117, top + 30, str ); | 1032 | rb->lcd_putsxyf( left + 117, top + 40, "%d.%d", |
1035 | rb->snprintf( str, 6, "%d.%d", value/255, ((value*100)/255)%100 ); | 1033 | value/255, ((value*100)/255)%100 ); |
1036 | rb->lcd_putsxy( left + 117, top + 40, str ); | 1034 | rb->lcd_putsxyf( left + 117, top + 50, "%d", red ); |
1037 | rb->snprintf( str, 6, "%d", red ); | 1035 | rb->lcd_putsxyf( left + 117, top + 60, "%d", green ); |
1038 | rb->lcd_putsxy( left + 117, top + 50, str ); | 1036 | rb->lcd_putsxyf( left + 117, top + 70, "%d", blue ); |
1039 | rb->snprintf( str, 6, "%d", green ); | ||
1040 | rb->lcd_putsxy( left + 117, top + 60, str ); | ||
1041 | rb->snprintf( str, 6, "%d", blue ); | ||
1042 | rb->lcd_putsxy( left + 117, top + 70, str ); | ||
1043 | rb->lcd_setfont( FONT_UI ); | 1037 | rb->lcd_setfont( FONT_UI ); |
1044 | 1038 | ||
1045 | #define CURSOR( l ) \ | 1039 | #define CURSOR( l ) \ |
diff --git a/apps/plugins/sliding_puzzle.c b/apps/plugins/sliding_puzzle.c index 6ea04d5057..517a3a1690 100644 --- a/apps/plugins/sliding_puzzle.c +++ b/apps/plugins/sliding_puzzle.c | |||
@@ -489,8 +489,7 @@ static void move_spot(int x, int y) | |||
489 | moves_y, s); | 489 | moves_y, s); |
490 | #else | 490 | #else |
491 | (void)w; | 491 | (void)w; |
492 | rb->snprintf(s, sizeof(s), "Moves: %d", moves); | 492 | rb->lcd_putsxyf(3, moves_y, "Moves: %d", moves); |
493 | rb->lcd_putsxy(3, moves_y, s); | ||
494 | #endif | 493 | #endif |
495 | for(i=1;i<=4;i++) | 494 | for(i=1;i<=4;i++) |
496 | { | 495 | { |
@@ -532,8 +531,7 @@ static void draw_playfield(void) | |||
532 | #else | 531 | #else |
533 | (void)w; | 532 | (void)w; |
534 | rb->lcd_hline(0, LCD_WIDTH-1, IMAGE_HEIGHT); | 533 | rb->lcd_hline(0, LCD_WIDTH-1, IMAGE_HEIGHT); |
535 | rb->snprintf(s, sizeof(s), "Moves: %d", moves); | 534 | rb->lcd_putsxyf(3, moves_y, "Moves: %d", moves); |
536 | rb->lcd_putsxy(3, moves_y, s); | ||
537 | #endif | 535 | #endif |
538 | 536 | ||
539 | /* draw spots to the lcd */ | 537 | /* draw spots to the lcd */ |
diff --git a/apps/plugins/snake.c b/apps/plugins/snake.c index 5ae941a655..eb2b311fc9 100644 --- a/apps/plugins/snake.c +++ b/apps/plugins/snake.c | |||
@@ -260,18 +260,14 @@ static struct configdata config[] = { | |||
260 | 260 | ||
261 | static void snake_die (void) | 261 | static void snake_die (void) |
262 | { | 262 | { |
263 | char pscore[17]; | ||
264 | rb->lcd_clear_display(); | 263 | rb->lcd_clear_display(); |
265 | rb->snprintf(pscore,sizeof(pscore),"Your score: %d",score); | ||
266 | rb->lcd_puts(0,0,"Oops..."); | 264 | rb->lcd_puts(0,0,"Oops..."); |
267 | rb->lcd_puts(0,1, pscore); | 265 | rb->lcd_putsf(0,1,"Your score: %d",score); |
268 | if (highscore_update(score, level, "", highscores, NUM_SCORES) == 0) { | 266 | if (highscore_update(score, level, "", highscores, NUM_SCORES) == 0) { |
269 | rb->lcd_puts(0,2,"New High Score!"); | 267 | rb->lcd_puts(0,2,"New High Score!"); |
270 | } | 268 | } |
271 | else { | 269 | else { |
272 | rb->snprintf(pscore, sizeof(pscore), | 270 | rb->lcd_putsf(0,2,"High Score: %d", highscores[0].score); |
273 | "High Score: %d", highscores[0].score); | ||
274 | rb->lcd_puts(0,2,pscore); | ||
275 | } | 271 | } |
276 | rb->lcd_update(); | 272 | rb->lcd_update(); |
277 | rb->sleep(3*HZ); | 273 | rb->sleep(3*HZ); |
diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c index 6e94519803..1159402bac 100644 --- a/apps/plugins/sokoban.c +++ b/apps/plugins/sokoban.c | |||
@@ -982,14 +982,11 @@ static void update_screen(void) | |||
982 | #define BOARD_WIDTH LCD_WIDTH | 982 | #define BOARD_WIDTH LCD_WIDTH |
983 | #define BOARD_HEIGHT (LCD_HEIGHT - STAT_HEIGHT) | 983 | #define BOARD_HEIGHT (LCD_HEIGHT - STAT_HEIGHT) |
984 | rb->lcd_putsxy(STAT_X + 4, STAT_Y + 4, "Level"); | 984 | rb->lcd_putsxy(STAT_X + 4, STAT_Y + 4, "Level"); |
985 | rb->snprintf(buf, sizeof(buf), "%d", current_info.level.index + 1); | 985 | rb->lcd_putsxyf(STAT_X + 7, STAT_Y + 14, "%d", current_info.level.index + 1); |
986 | rb->lcd_putsxy(STAT_X + 7, STAT_Y + 14, buf); | ||
987 | rb->lcd_putsxy(STAT_X + 41, STAT_Y + 4, "Moves"); | 986 | rb->lcd_putsxy(STAT_X + 41, STAT_Y + 4, "Moves"); |
988 | rb->snprintf(buf, sizeof(buf), "%d", current_info.level.moves); | 987 | rb->lcd_putsxyf(STAT_X + 44, STAT_Y + 14, "%d", current_info.level.moves); |
989 | rb->lcd_putsxy(STAT_X + 44, STAT_Y + 14, buf); | ||
990 | rb->lcd_putsxy(STAT_X + 79, STAT_Y + 4, "Pushes"); | 988 | rb->lcd_putsxy(STAT_X + 79, STAT_Y + 4, "Pushes"); |
991 | rb->snprintf(buf, sizeof(buf), "%d", current_info.level.pushes); | 989 | rb->lcd_putsxyf(STAT_X + 82, STAT_Y + 14, "%d", current_info.level.pushes); |
992 | rb->lcd_putsxy(STAT_X + 82, STAT_Y + 14, buf); | ||
993 | 990 | ||
994 | rb->lcd_drawrect(STAT_X, STAT_Y, 38, STAT_HEIGHT); | 991 | rb->lcd_drawrect(STAT_X, STAT_Y, 38, STAT_HEIGHT); |
995 | rb->lcd_drawrect(STAT_X + 37, STAT_Y, 39, STAT_HEIGHT); | 992 | rb->lcd_drawrect(STAT_X + 37, STAT_Y, 39, STAT_HEIGHT); |
@@ -1005,18 +1002,15 @@ static void update_screen(void) | |||
1005 | #define BOARD_WIDTH (LCD_WIDTH - STAT_WIDTH) | 1002 | #define BOARD_WIDTH (LCD_WIDTH - STAT_WIDTH) |
1006 | #define BOARD_HEIGHT LCD_HEIGHT | 1003 | #define BOARD_HEIGHT LCD_HEIGHT |
1007 | rb->lcd_putsxy(STAT_X + 1, STAT_Y + 2, "Level"); | 1004 | rb->lcd_putsxy(STAT_X + 1, STAT_Y + 2, "Level"); |
1008 | rb->snprintf(buf, sizeof(buf), "%d", current_info.level.index + 1); | 1005 | rb->lcd_putsxyf(STAT_X + 4, STAT_Y + 12, "%d", current_info.level.index + 1); |
1009 | rb->lcd_putsxy(STAT_X + 4, STAT_Y + 12, buf); | ||
1010 | rb->lcd_putsxy(STAT_X + 1, STAT_Y + 23, "Moves"); | 1006 | rb->lcd_putsxy(STAT_X + 1, STAT_Y + 23, "Moves"); |
1011 | rb->snprintf(buf, sizeof(buf), "%d", current_info.level.moves); | 1007 | rb->lcd_putsxyf(STAT_X + 4, STAT_Y + 33, "%d", current_info.level.moves); |
1012 | rb->lcd_putsxy(STAT_X + 4, STAT_Y + 33, buf); | ||
1013 | #if STAT_WIDTH < 38 | 1008 | #if STAT_WIDTH < 38 |
1014 | rb->lcd_putsxy(STAT_X + 1, STAT_Y + 44, "Push"); | 1009 | rb->lcd_putsxy(STAT_X + 1, STAT_Y + 44, "Push"); |
1015 | #else | 1010 | #else |
1016 | rb->lcd_putsxy(STAT_X + 1, STAT_Y + 44, "Pushes"); | 1011 | rb->lcd_putsxy(STAT_X + 1, STAT_Y + 44, "Pushes"); |
1017 | #endif | 1012 | #endif |
1018 | rb->snprintf(buf, sizeof(buf), "%d", current_info.level.pushes); | 1013 | rb->lcd_putsxyf(STAT_X + 4, STAT_Y + 54, "%d", current_info.level.pushes); |
1019 | rb->lcd_putsxy(STAT_X + 4, STAT_Y + 54, buf); | ||
1020 | 1014 | ||
1021 | rb->lcd_drawrect(STAT_X, STAT_Y + 0, STAT_WIDTH, 64); | 1015 | rb->lcd_drawrect(STAT_X, STAT_Y + 0, STAT_WIDTH, 64); |
1022 | rb->lcd_hline(STAT_X, LCD_WIDTH - 1, STAT_Y + 21); | 1016 | rb->lcd_hline(STAT_X, LCD_WIDTH - 1, STAT_Y + 21); |
diff --git a/apps/plugins/spacerocks.c b/apps/plugins/spacerocks.c index 2e7ccc0743..206d52aed8 100644 --- a/apps/plugins/spacerocks.c +++ b/apps/plugins/spacerocks.c | |||
@@ -1826,7 +1826,6 @@ static int spacerocks_menu(void) | |||
1826 | 1826 | ||
1827 | static int spacerocks_game_loop(void) | 1827 | static int spacerocks_game_loop(void) |
1828 | { | 1828 | { |
1829 | char str[20]; | ||
1830 | int button; | 1829 | int button; |
1831 | int end; | 1830 | int end; |
1832 | int position; | 1831 | int position; |
@@ -1861,8 +1860,7 @@ static int spacerocks_game_loop(void) | |||
1861 | break; | 1860 | break; |
1862 | 1861 | ||
1863 | case PAUSE_MODE: | 1862 | case PAUSE_MODE: |
1864 | rb->snprintf(str, sizeof(str), "score %d ", current_score); | 1863 | rb->lcd_putsxyf(1,LCD_HEIGHT-8, "score %d ", current_score); |
1865 | rb->lcd_putsxy(1,LCD_HEIGHT-8, str); | ||
1866 | rb->lcd_putsxy(CENTER_LCD_X - 15, | 1864 | rb->lcd_putsxy(CENTER_LCD_X - 15, |
1867 | CENTER_LCD_Y + CENTER_LCD_Y/2 - 4, "pause"); | 1865 | CENTER_LCD_Y + CENTER_LCD_Y/2 - 4, "pause"); |
1868 | draw_and_move_missiles(); | 1866 | draw_and_move_missiles(); |
@@ -1871,8 +1869,7 @@ static int spacerocks_game_loop(void) | |||
1871 | break; | 1869 | break; |
1872 | 1870 | ||
1873 | case PLAY_MODE: | 1871 | case PLAY_MODE: |
1874 | rb->snprintf(str, sizeof(str), "score %d ", current_score); | 1872 | rb->lcd_putsxyf(1, LCD_HEIGHT-8, "score %d ", current_score); |
1875 | rb->lcd_putsxy(1, LCD_HEIGHT-8, str); | ||
1876 | draw_and_move_missiles(); | 1873 | draw_and_move_missiles(); |
1877 | draw_lives(); | 1874 | draw_lives(); |
1878 | check_collisions(); | 1875 | check_collisions(); |
@@ -1880,11 +1877,10 @@ static int spacerocks_game_loop(void) | |||
1880 | break; | 1877 | break; |
1881 | 1878 | ||
1882 | case SHOW_LEVEL: | 1879 | case SHOW_LEVEL: |
1883 | rb->snprintf(str, sizeof(str), "score %d ", current_score); | 1880 | rb->lcd_putsxyf(1, LCD_HEIGHT-8, "score %d ", current_score); |
1884 | rb->lcd_putsxy(1, LCD_HEIGHT-8, str); | 1881 | rb->lcd_putsxyf(CENTER_LCD_X - 20, |
1885 | rb->snprintf(str, sizeof(str), "stage %d ", current_level); | 1882 | CENTER_LCD_Y + CENTER_LCD_Y/2 - 4, |
1886 | rb->lcd_putsxy(CENTER_LCD_X - 20, | 1883 | "stage %d ", current_level); |
1887 | CENTER_LCD_Y + CENTER_LCD_Y/2 - 4, str); | ||
1888 | draw_lives(); | 1884 | draw_lives(); |
1889 | draw_and_move_ship(); | 1885 | draw_and_move_ship(); |
1890 | show_level_timeout--; | 1886 | show_level_timeout--; |
diff --git a/apps/plugins/star.c b/apps/plugins/star.c index e5d8259d88..a653bdb4a9 100644 --- a/apps/plugins/star.c +++ b/apps/plugins/star.c | |||
@@ -759,7 +759,6 @@ static void star_transition_update(void) | |||
759 | static void star_display_board_info(int current_level) | 759 | static void star_display_board_info(int current_level) |
760 | { | 760 | { |
761 | int label_pos_y, tile_pos_y; | 761 | int label_pos_y, tile_pos_y; |
762 | char str_info[32]; | ||
763 | 762 | ||
764 | if (TILE_HEIGHT > char_height) | 763 | if (TILE_HEIGHT > char_height) |
765 | { | 764 | { |
@@ -772,10 +771,9 @@ static void star_display_board_info(int current_level) | |||
772 | tile_pos_y = label_pos_y + (char_height - TILE_HEIGHT) / 2; | 771 | tile_pos_y = label_pos_y + (char_height - TILE_HEIGHT) / 2; |
773 | } | 772 | } |
774 | 773 | ||
775 | rb->snprintf(str_info, sizeof(str_info), "L:%02d", current_level + 1); | 774 | rb->lcd_putsxyf(STAR_OFFSET_X, label_pos_y, "L:%02d", current_level + 1); |
776 | rb->lcd_putsxy(STAR_OFFSET_X, label_pos_y, str_info); | 775 | rb->lcd_putsxyf(LCD_WIDTH/2 - 2 * char_width, label_pos_y, "S:%02d", |
777 | rb->snprintf(str_info, sizeof(str_info), "S:%02d", star_count); | 776 | star_count); |
778 | rb->lcd_putsxy(LCD_WIDTH/2 - 2 * char_width, label_pos_y, str_info); | ||
779 | rb->lcd_putsxy(STAR_OFFSET_X + (STAR_WIDTH-1) * TILE_WIDTH - 2 * char_width, | 777 | rb->lcd_putsxy(STAR_OFFSET_X + (STAR_WIDTH-1) * TILE_WIDTH - 2 * char_width, |
780 | label_pos_y, "C:"); | 778 | label_pos_y, "C:"); |
781 | 779 | ||
diff --git a/apps/plugins/starfield.c b/apps/plugins/starfield.c index 7f17970a84..6ddc268285 100644 --- a/apps/plugins/starfield.c +++ b/apps/plugins/starfield.c | |||
@@ -377,7 +377,6 @@ static struct starfield starfield; | |||
377 | 377 | ||
378 | int plugin_main(void) | 378 | int plugin_main(void) |
379 | { | 379 | { |
380 | char str_buffer[40]; | ||
381 | int button, avg_peak, t_disp=0; | 380 | int button, avg_peak, t_disp=0; |
382 | int font_h, font_w; | 381 | int font_h, font_w; |
383 | bool pulse=true; | 382 | bool pulse=true; |
@@ -449,14 +448,11 @@ int plugin_main(void) | |||
449 | if (t_disp > 0) | 448 | if (t_disp > 0) |
450 | { | 449 | { |
451 | --t_disp; | 450 | --t_disp; |
452 | rb->snprintf(str_buffer, sizeof(str_buffer), | ||
453 | "star:%d speed:%d", | ||
454 | starfield.nb_stars, | ||
455 | starfield.z_move); | ||
456 | #ifdef HAVE_LCD_COLOR | 451 | #ifdef HAVE_LCD_COLOR |
457 | rb->lcd_set_foreground(LCD_WHITE); | 452 | rb->lcd_set_foreground(LCD_WHITE); |
458 | #endif | 453 | #endif |
459 | rb->lcd_putsxy(0, LCD_HEIGHT-font_h, str_buffer); | 454 | rb->lcd_putsxyf(0, LCD_HEIGHT-font_h, "star:%d speed:%d", |
455 | starfield.nb_stars, starfield.z_move); | ||
460 | } | 456 | } |
461 | rb->lcd_update(); | 457 | rb->lcd_update(); |
462 | 458 | ||
diff --git a/apps/plugins/superdom.c b/apps/plugins/superdom.c index 5ded7f9f12..ad54c565b2 100644 --- a/apps/plugins/superdom.c +++ b/apps/plugins/superdom.c | |||
@@ -500,13 +500,9 @@ void update_score(void) { | |||
500 | rb->lcd_fillrect(5,LCD_HEIGHT-20,105,20); | 500 | rb->lcd_fillrect(5,LCD_HEIGHT-20,105,20); |
501 | rb->lcd_set_drawmode(DRMODE_SOLID); | 501 | rb->lcd_set_drawmode(DRMODE_SOLID); |
502 | strength = calc_strength(COLOUR_LIGHT, cursor.x, cursor.y); | 502 | strength = calc_strength(COLOUR_LIGHT, cursor.x, cursor.y); |
503 | rb->snprintf(buf, sizeof(buf), "Your power: %d.%d", | 503 | rb->lcd_putsxyf(5,LCD_HEIGHT-20,"Your power: %d.%d",strength/10,strength%10); |
504 | strength/10, strength%10); | ||
505 | rb->lcd_putsxy(5,LCD_HEIGHT-20, buf); | ||
506 | strength = calc_strength(COLOUR_DARK, cursor.x, cursor.y); | 504 | strength = calc_strength(COLOUR_DARK, cursor.x, cursor.y); |
507 | rb->snprintf(buf, sizeof(buf), "Comp power: %d.%d", | 505 | rb->lcd_putsxyf(5,LCD_HEIGHT-10,"Comp power: %d.%d",strength/10,strength%10); |
508 | strength/10, strength%10); | ||
509 | rb->lcd_putsxy(5,LCD_HEIGHT-10, buf); | ||
510 | rb->lcd_setfont(FONT_UI); | 506 | rb->lcd_setfont(FONT_UI); |
511 | } | 507 | } |
512 | 508 | ||
@@ -733,8 +729,7 @@ int get_number(char* param, int* value, int max) { | |||
733 | button_labels[i][j]); | 729 | button_labels[i][j]); |
734 | } | 730 | } |
735 | } | 731 | } |
736 | rb->snprintf(buf,sizeof(buf), "%d", *value); | 732 | rb->lcd_putsxyf(NUM_MARGIN_X+10, NUM_MARGIN_Y+4*NUM_BOX_HEIGHT+10,"%d",*value); |
737 | rb->lcd_putsxy(NUM_MARGIN_X+10, NUM_MARGIN_Y+4*NUM_BOX_HEIGHT+10, buf); | ||
738 | rb->lcd_getstringsize(param, &width, &height); | 733 | rb->lcd_getstringsize(param, &width, &height); |
739 | if(width < LCD_WIDTH) | 734 | if(width < LCD_WIDTH) |
740 | rb->lcd_putsxy((LCD_WIDTH-width)/2, (NUM_MARGIN_Y-height)/2, param); | 735 | rb->lcd_putsxy((LCD_WIDTH-width)/2, (NUM_MARGIN_Y-height)/2, param); |
@@ -772,9 +767,8 @@ int get_number(char* param, int* value, int max) { | |||
772 | rb->lcd_fillrect(0, NUM_MARGIN_Y+4*NUM_BOX_HEIGHT+10, | 767 | rb->lcd_fillrect(0, NUM_MARGIN_Y+4*NUM_BOX_HEIGHT+10, |
773 | LCD_WIDTH, 30); | 768 | LCD_WIDTH, 30); |
774 | rb->lcd_set_drawmode(DRMODE_SOLID); | 769 | rb->lcd_set_drawmode(DRMODE_SOLID); |
775 | rb->snprintf(buf,sizeof(buf), "%d", *value); | 770 | rb->lcd_putsxyf(NUM_MARGIN_X+10,NUM_MARGIN_Y+4*NUM_BOX_HEIGHT+10, |
776 | rb->lcd_putsxy(NUM_MARGIN_X+10, | 771 | "%d", *value); |
777 | NUM_MARGIN_Y+4*NUM_BOX_HEIGHT+10, buf); | ||
778 | break; | 772 | break; |
779 | case SUPERDOM_CANCEL: | 773 | case SUPERDOM_CANCEL: |
780 | *value = 0; | 774 | *value = 0; |
@@ -1404,10 +1398,8 @@ int select_square(void) { | |||
1404 | update_score(); | 1398 | update_score(); |
1405 | #if LCD_WIDTH >= 220 | 1399 | #if LCD_WIDTH >= 220 |
1406 | rb->lcd_setfont(FONT_SYSFIXED); | 1400 | rb->lcd_setfont(FONT_SYSFIXED); |
1407 | rb->snprintf(buf, sizeof(buf), "Cash: %d", humanres.cash); | 1401 | rb->lcd_putsxyf(125, LCD_HEIGHT-20,"Cash: %d", humanres.cash); |
1408 | rb->lcd_putsxy(125, LCD_HEIGHT-20, buf); | 1402 | rb->lcd_putsxyf(125, LCD_HEIGHT-10,"Food: %d", humanres.food); |
1409 | rb->snprintf(buf, sizeof(buf), "Food: %d", humanres.food); | ||
1410 | rb->lcd_putsxy(125, LCD_HEIGHT-10, buf); | ||
1411 | rb->lcd_setfont(FONT_UI); | 1403 | rb->lcd_setfont(FONT_UI); |
1412 | #endif | 1404 | #endif |
1413 | rb->lcd_update(); | 1405 | rb->lcd_update(); |
diff --git a/apps/plugins/test_scanrate.c b/apps/plugins/test_scanrate.c index d29544fb33..f22beb87ff 100644 --- a/apps/plugins/test_scanrate.c +++ b/apps/plugins/test_scanrate.c | |||
@@ -152,7 +152,6 @@ static void timer_isr(void) | |||
152 | 152 | ||
153 | int plugin_main(void) | 153 | int plugin_main(void) |
154 | { | 154 | { |
155 | unsigned char buf[32]; | ||
156 | int button; | 155 | int button; |
157 | bool done = false; | 156 | bool done = false; |
158 | bool change = true; | 157 | bool change = true; |
@@ -186,9 +185,8 @@ int plugin_main(void) | |||
186 | { | 185 | { |
187 | /* The actual frequency is twice the displayed value */ | 186 | /* The actual frequency is twice the displayed value */ |
188 | rb->timer_set_period(TIMER_FREQ * 5 / scan_rate); | 187 | rb->timer_set_period(TIMER_FREQ * 5 / scan_rate); |
189 | rb->snprintf(buf, sizeof(buf), "f: %d.%d Hz", scan_rate / 10, | 188 | rb->lcd_putsxyf(TEXT_X, TEXT_Y, "f: %d.%d Hz", scan_rate / 10, |
190 | scan_rate % 10); | 189 | scan_rate % 10); |
191 | rb->lcd_putsxy(TEXT_X, TEXT_Y, buf); | ||
192 | need_refresh = true; | 190 | need_refresh = true; |
193 | change = false; | 191 | change = false; |
194 | } | 192 | } |
diff --git a/apps/plugins/vbrfix.c b/apps/plugins/vbrfix.c index 71c502bc67..98ca15b6a8 100644 --- a/apps/plugins/vbrfix.c +++ b/apps/plugins/vbrfix.c | |||
@@ -29,10 +29,7 @@ char tmpname[MAX_PATH]; | |||
29 | 29 | ||
30 | static void xingupdate(int percent) | 30 | static void xingupdate(int percent) |
31 | { | 31 | { |
32 | char buf[32]; | 32 | rb->lcd_putsf(0, 1, "%d%%", percent); |
33 | |||
34 | rb->snprintf(buf, 32, "%d%%", percent); | ||
35 | rb->lcd_puts(0, 1, buf); | ||
36 | rb->lcd_update(); | 33 | rb->lcd_update(); |
37 | } | 34 | } |
38 | 35 | ||
diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c index 6dc69d1d4e..f9ecf8ef33 100644 --- a/apps/plugins/vu_meter.c +++ b/apps/plugins/vu_meter.c | |||
@@ -465,7 +465,6 @@ void save_settings(void) { | |||
465 | } | 465 | } |
466 | 466 | ||
467 | void change_volume(int delta) { | 467 | void change_volume(int delta) { |
468 | char curr_vol[5]; | ||
469 | int minvol = rb->sound_min(SOUND_VOLUME); | 468 | int minvol = rb->sound_min(SOUND_VOLUME); |
470 | int maxvol = rb->sound_max(SOUND_VOLUME); | 469 | int maxvol = rb->sound_max(SOUND_VOLUME); |
471 | int vol = rb->global_settings->volume + delta; | 470 | int vol = rb->global_settings->volume + delta; |
@@ -475,8 +474,7 @@ void change_volume(int delta) { | |||
475 | if (vol != rb->global_settings->volume) { | 474 | if (vol != rb->global_settings->volume) { |
476 | rb->sound_set(SOUND_VOLUME, vol); | 475 | rb->sound_set(SOUND_VOLUME, vol); |
477 | rb->global_settings->volume = vol; | 476 | rb->global_settings->volume = vol; |
478 | rb->snprintf(curr_vol, sizeof(curr_vol), "%d", vol); | 477 | rb->lcd_putsxyf(0,0, "%d", vol); |
479 | rb->lcd_putsxy(0,0, curr_vol); | ||
480 | rb->lcd_update(); | 478 | rb->lcd_update(); |
481 | rb->sleep(HZ/12); | 479 | rb->sleep(HZ/12); |
482 | } | 480 | } |
diff --git a/apps/plugins/wav2wv.c b/apps/plugins/wav2wv.c index 98b4c0fe4f..e2db398ef7 100644 --- a/apps/plugins/wav2wv.c +++ b/apps/plugins/wav2wv.c | |||
@@ -58,7 +58,6 @@ static void wvupdate (int32_t start_tick, | |||
58 | { | 58 | { |
59 | int32_t elapsed_ticks = *rb->current_tick - start_tick; | 59 | int32_t elapsed_ticks = *rb->current_tick - start_tick; |
60 | int compression = 0, progress = 0, realtime = 0; | 60 | int compression = 0, progress = 0, realtime = 0; |
61 | char buf[32]; | ||
62 | 61 | ||
63 | if (total_samples) | 62 | if (total_samples) |
64 | progress = (int)(((int64_t) samples_converted * 100 + | 63 | progress = (int)(((int64_t) samples_converted * 100 + |
@@ -72,18 +71,11 @@ static void wvupdate (int32_t start_tick, | |||
72 | compression = (int)(((int64_t)(bytes_read - bytes_written) * 100 + | 71 | compression = (int)(((int64_t)(bytes_read - bytes_written) * 100 + |
73 | (bytes_read/2)) / bytes_read); | 72 | (bytes_read/2)) / bytes_read); |
74 | 73 | ||
75 | rb->snprintf(buf, 32, "elapsed time: %ld secs", | 74 | rb->lcd_putsf(0, 2, "elapsed time: %ld secs", |
76 | (long)(elapsed_ticks + (HZ/2)) / HZ); | 75 | (long)(elapsed_ticks + (HZ/2)) / HZ); |
77 | rb->lcd_puts(0, 2, (unsigned char *)buf); | 76 | rb->lcd_putsf(0, 4, "progress: %d%%", progress); |
78 | 77 | rb->lcd_putsf(0, 6, "realtime: %d%% ", realtime); | |
79 | rb->snprintf(buf, 32, "progress: %d%%", progress); | 78 | rb->lcd_putsf(0, 8, "compression: %d%% ", compression); |
80 | rb->lcd_puts(0, 4, (unsigned char *)buf); | ||
81 | |||
82 | rb->snprintf(buf, 32, "realtime: %d%% ", realtime); | ||
83 | rb->lcd_puts(0, 6, (unsigned char *)buf); | ||
84 | |||
85 | rb->snprintf(buf, 32, "compression: %d%% ", compression); | ||
86 | rb->lcd_puts(0, 8, (unsigned char *)buf); | ||
87 | 79 | ||
88 | #ifdef HAVE_LCD_BITMAP | 80 | #ifdef HAVE_LCD_BITMAP |
89 | rb->lcd_update(); | 81 | rb->lcd_update(); |
diff --git a/apps/plugins/wavplay.c b/apps/plugins/wavplay.c index cbd4dfbeda..887c5cdd55 100644 --- a/apps/plugins/wavplay.c +++ b/apps/plugins/wavplay.c | |||
@@ -3454,7 +3454,6 @@ void cleanup(void *fd) | |||
3454 | 3454 | ||
3455 | int play_file(char* filename) | 3455 | int play_file(char* filename) |
3456 | { | 3456 | { |
3457 | char buf[32]; | ||
3458 | int button; | 3457 | int button; |
3459 | int fd; | 3458 | int fd; |
3460 | int wanted, got; | 3459 | int wanted, got; |
@@ -3540,11 +3539,9 @@ int play_file(char* filename) | |||
3540 | time = bytes / (samplerate * 2 * channels); | 3539 | time = bytes / (samplerate * 2 * channels); |
3541 | 3540 | ||
3542 | rb->lcd_puts(0, 0, "Playing WAV file"); | 3541 | rb->lcd_puts(0, 0, "Playing WAV file"); |
3543 | rb->snprintf(buf, sizeof(buf), "%dHz %s", samplerate, | 3542 | rb->lcd_putsf(0, 1, "%dHz %s", samplerate, |
3544 | (channels == 1) ? "mono" : "stereo"); | 3543 | (channels == 1) ? "mono" : "stereo"); |
3545 | rb->lcd_puts(0, 1, buf); | 3544 | rb->lcd_putsf(0, 2, "Length: %d:%02d", time / 60, time % 60); |
3546 | rb->snprintf(buf, sizeof(buf), "Length: %d:%02d", time / 60, time % 60); | ||
3547 | rb->lcd_puts(0, 2, buf); | ||
3548 | rb->lcd_update(); | 3545 | rb->lcd_update(); |
3549 | 3546 | ||
3550 | rb->sound_set_pitch(PITCH_SPEED_100); /* reset pitch */ | 3547 | rb->sound_set_pitch(PITCH_SPEED_100); /* reset pitch */ |
diff --git a/apps/plugins/wavrecord.c b/apps/plugins/wavrecord.c index 375642ec4b..91ce9c92f6 100644 --- a/apps/plugins/wavrecord.c +++ b/apps/plugins/wavrecord.c | |||
@@ -3480,7 +3480,6 @@ static bool update_wav_header(char *filename, int sample_rate, | |||
3480 | static int record_file(char *filename) | 3480 | static int record_file(char *filename) |
3481 | { | 3481 | { |
3482 | bool recording, saving; | 3482 | bool recording, saving; |
3483 | char buf[32]; | ||
3484 | int fd, low_water, i; | 3483 | int fd, low_water, i; |
3485 | int bytes_written; | 3484 | int bytes_written; |
3486 | int button; | 3485 | int button; |
@@ -3514,8 +3513,6 @@ static int record_file(char *filename) | |||
3514 | 3513 | ||
3515 | rb->lcd_clear_display(); | 3514 | rb->lcd_clear_display(); |
3516 | rb->lcd_puts(0, 0, filename); | 3515 | rb->lcd_puts(0, 0, filename); |
3517 | rb->snprintf(buf, sizeof(buf), "%sHz 16bit %s", | ||
3518 | samplerate_str[reccfg.samplerate], channel_str[reccfg.channels]); | ||
3519 | 3516 | ||
3520 | switch (reccfg.source) | 3517 | switch (reccfg.source) |
3521 | { | 3518 | { |
@@ -3535,12 +3532,18 @@ static int record_file(char *filename) | |||
3535 | #ifdef HAVE_SPDIF_REC | 3532 | #ifdef HAVE_SPDIF_REC |
3536 | case WAV_SRC_SPDIF: | 3533 | case WAV_SRC_SPDIF: |
3537 | rb->mas_codec_writereg(0, 0x01); | 3534 | rb->mas_codec_writereg(0, 0x01); |
3538 | rb->snprintf(buf, sizeof(buf), "16bit %s", | ||
3539 | channel_str[reccfg.channels]); | ||
3540 | break; | 3535 | break; |
3541 | #endif | 3536 | #endif |
3542 | } | 3537 | } |
3543 | rb->lcd_puts(0, 1, buf); | 3538 | |
3539 | #ifdef HAVE_SPDIF_REC | ||
3540 | if (reccfg.source == WAV_SRC_SPDIF) | ||
3541 | rb->lcd_putsf(0, 1, "16bit %s", channel_str[reccfg.channels]); | ||
3542 | else | ||
3543 | #endif | ||
3544 | rb->lcd_putsf(0, 1, "%sHz 16bit %s", | ||
3545 | samplerate_str[reccfg.samplerate], channel_str[reccfg.channels]); | ||
3546 | |||
3544 | rb->lcd_update(); | 3547 | rb->lcd_update(); |
3545 | 3548 | ||
3546 | mas = 0x0060 /* no framing, little endian */ | 3549 | mas = 0x0060 /* no framing, little endian */ |
@@ -3649,8 +3652,7 @@ static int record_file(char *filename) | |||
3649 | recording = false; | 3652 | recording = false; |
3650 | saving = true; | 3653 | saving = true; |
3651 | } | 3654 | } |
3652 | rb->snprintf(buf, sizeof(buf), "Bytes: %d", num_rec_bytes); | 3655 | rb->lcd_puts(0, 2, "Bytes: %d", num_rec_bytes); |
3653 | rb->lcd_puts(0, 2, buf); | ||
3654 | rb->lcd_update(); | 3656 | rb->lcd_update(); |
3655 | } | 3657 | } |
3656 | /* read sample rate from MAS */ | 3658 | /* read sample rate from MAS */ |
diff --git a/apps/plugins/wavview.c b/apps/plugins/wavview.c index ddf72e10af..25afa40901 100644 --- a/apps/plugins/wavview.c +++ b/apps/plugins/wavview.c | |||
@@ -109,7 +109,6 @@ static int readwavpeaks(const char *filename) | |||
109 | 109 | ||
110 | int file; | 110 | int file; |
111 | uint32_t total_bytes_read = 0; | 111 | uint32_t total_bytes_read = 0; |
112 | char tstr[128]; | ||
113 | int hours; | 112 | int hours; |
114 | int minutes; | 113 | int minutes; |
115 | int seconds; | 114 | int seconds; |
@@ -156,25 +155,20 @@ static int readwavpeaks(const char *filename) | |||
156 | rb->lcd_puts_scroll(0, 1, (unsigned char *)filename); | 155 | rb->lcd_puts_scroll(0, 1, (unsigned char *)filename); |
157 | rb->lcd_update(); | 156 | rb->lcd_update(); |
158 | 157 | ||
159 | rb->snprintf(tstr,127, "Channels: %s", | 158 | rb->lcd_putsf(0, 2, "Channels: %s", |
160 | header.numchannels == 1 ? "mono" : "stereo"); | 159 | header.numchannels == 1 ? "mono" : "stereo"); |
161 | rb->lcd_puts(0, 2, tstr); | 160 | rb->lcd_putsf(0, 3, "Bits/sample: %d", header.bitspersample); |
162 | 161 | rb->lcd_putsf(0, 4, "Samplerate: %"PRIu32" Hz", header.samplerate); | |
163 | rb->snprintf(tstr,127, "Bits/sample: %d", header.bitspersample); | ||
164 | rb->lcd_puts(0, 3, tstr); | ||
165 | |||
166 | rb->snprintf(tstr,127, "Samplerate: %d Hz", (int)(header.samplerate)); | ||
167 | rb->lcd_puts(0, 4, tstr); | ||
168 | 162 | ||
169 | seconds = header.datachunksize / header.byterate; | 163 | seconds = header.datachunksize / header.byterate; |
170 | hours = seconds / 3600; | 164 | hours = seconds / 3600; |
171 | seconds -= hours * 3600; | 165 | seconds -= hours * 3600; |
172 | minutes = seconds / 60; | 166 | minutes = seconds / 60; |
173 | seconds -= minutes * 60; | 167 | seconds -= minutes * 60; |
174 | rb->snprintf(tstr,127, "Length (hh:mm:ss): %02d:%02d:%02d", hours, | 168 | |
175 | minutes, | 169 | rb->lcd_putsf(0, 5, "Length (hh:mm:ss): %02d:%02d:%02d", hours, |
176 | seconds); | 170 | minutes, |
177 | rb->lcd_puts(0, 5, tstr); | 171 | seconds); |
178 | rb->lcd_puts(0, 6, "Searching for peaks... "); | 172 | rb->lcd_puts(0, 6, "Searching for peaks... "); |
179 | rb->lcd_update(); | 173 | rb->lcd_update(); |
180 | 174 | ||
@@ -246,10 +240,9 @@ static int readwavpeaks(const char *filename) | |||
246 | } | 240 | } |
247 | 241 | ||
248 | /* update progress */ | 242 | /* update progress */ |
249 | rb->snprintf(tstr,127, "Searching for peaks... %d%%",(int) | 243 | rb->lcd_putsf(0, 6, "Searching for peaks... %"PRIu32"%%", |
250 | (total_bytes_read / ((header.datachunksize + | 244 | (total_bytes_read / ((header.datachunksize + |
251 | sizeof(struct wav_header)) / 100))); | 245 | sizeof(struct wav_header)) / 100))); |
252 | rb->lcd_puts(0, 6, tstr); | ||
253 | rb->lcd_update(); | 246 | rb->lcd_update(); |
254 | 247 | ||
255 | /* allow user to abort */ | 248 | /* allow user to abort */ |
diff --git a/apps/plugins/xobox.c b/apps/plugins/xobox.c index 871cb2bdf5..e93a820b71 100644 --- a/apps/plugins/xobox.c +++ b/apps/plugins/xobox.c | |||
@@ -549,7 +549,7 @@ static int percentage (void) | |||
549 | static void refresh_board (void) | 549 | static void refresh_board (void) |
550 | { | 550 | { |
551 | int i, j; | 551 | int i, j; |
552 | char str[25]; | 552 | int x; |
553 | 553 | ||
554 | #if LCD_DEPTH>=2 | 554 | #if LCD_DEPTH>=2 |
555 | rb->lcd_set_background (LCD_BLACK); | 555 | rb->lcd_set_background (LCD_BLACK); |
@@ -590,21 +590,18 @@ static void refresh_board (void) | |||
590 | #else | 590 | #else |
591 | rb->lcd_set_drawmode (DRMODE_COMPLEMENT); | 591 | rb->lcd_set_drawmode (DRMODE_COMPLEMENT); |
592 | #endif | 592 | #endif |
593 | rb->snprintf (str, sizeof (str), "Level %d", player.level + 1); | 593 | rb->lcd_putsxyf (BOARD_X, BOARD_Y, "Level %d", player.level + 1); |
594 | rb->lcd_putsxy (BOARD_X, BOARD_Y, str); | 594 | rb->lcd_putsxyf (BOARD_X + CUBE_SIZE * BOARD_W - 24, BOARD_Y, "%d%%", |
595 | rb->snprintf (str, sizeof (str), "%d%%", percentage_cache); | 595 | percentage_cache); |
596 | rb->lcd_putsxy (BOARD_X + CUBE_SIZE * BOARD_W - 24, BOARD_Y, str); | 596 | rb->lcd_putsxyf (BOARD_X, BOARD_Y + CUBE_SIZE * BOARD_H - 8, "Score: %d", |
597 | rb->snprintf (str, sizeof (str), "Score: %d", player.score); | 597 | player.score); |
598 | rb->lcd_putsxy (BOARD_X, BOARD_Y + CUBE_SIZE * BOARD_H - 8, str); | ||
599 | rb->snprintf (str, sizeof (str), | ||
600 | (player.lives != 1) ? "%d Lives" : "%d Life", player.lives); | ||
601 | #if LCD_DEPTH>=2 | 598 | #if LCD_DEPTH>=2 |
602 | rb->lcd_putsxy (BOARD_X + CUBE_SIZE * BOARD_W - 60, | 599 | x = BOARD_X + CUBE_SIZE * BOARD_W - 60; |
603 | BOARD_Y + CUBE_SIZE * BOARD_H - 8, str); | ||
604 | #else | 600 | #else |
605 | rb->lcd_putsxy (BOARD_X + CUBE_SIZE * BOARD_W - 40, | 601 | x = BOARD_X + CUBE_SIZE * BOARD_W - 40; |
606 | BOARD_Y + CUBE_SIZE * BOARD_H - 8, str); | ||
607 | #endif | 602 | #endif |
603 | rb->lcd_putsxyf (x, BOARD_Y + CUBE_SIZE * BOARD_H - 8, | ||
604 | (player.lives != 1) ? "%d Lives" : "%d Life", player.lives); | ||
608 | 605 | ||
609 | #if LCD_DEPTH>=2 | 606 | #if LCD_DEPTH>=2 |
610 | rb->lcd_set_foreground (PLR_COL); | 607 | rb->lcd_set_foreground (PLR_COL); |
diff --git a/apps/plugins/zxbox/zxvid_16bpp.c b/apps/plugins/zxbox/zxvid_16bpp.c index 4a05c69f97..f213afe307 100644 --- a/apps/plugins/zxbox/zxvid_16bpp.c +++ b/apps/plugins/zxbox/zxvid_16bpp.c | |||
@@ -49,7 +49,6 @@ void init_spect_scr(void) | |||
49 | 49 | ||
50 | void update_screen(void) | 50 | void update_screen(void) |
51 | { | 51 | { |
52 | char str[80]; | ||
53 | fb_data *frameb; | 52 | fb_data *frameb; |
54 | 53 | ||
55 | int y=0; | 54 | int y=0; |
@@ -88,10 +87,7 @@ void update_screen(void) | |||
88 | int TPF = HZ/50;/* ticks per frame */ | 87 | int TPF = HZ/50;/* ticks per frame */ |
89 | if ((*rb->current_tick-start_time) > TPF ) | 88 | if ((*rb->current_tick-start_time) > TPF ) |
90 | percent = 100*video_frames/((*rb->current_tick-start_time)/TPF); | 89 | percent = 100*video_frames/((*rb->current_tick-start_time)/TPF); |
91 | rb->snprintf(str,sizeof(str),"%d %%",percent); | 90 | rb->lcd_putsxyf(0,0,"%d %%",percent); |
92 | rb->lcd_putsxy(0,0,str); | ||
93 | } | 91 | } |
94 | rb -> lcd_update(); | 92 | rb -> lcd_update(); |
95 | } | 93 | } |
96 | |||
97 | |||
diff --git a/apps/plugins/zxbox/zxvid_2bpp.c b/apps/plugins/zxbox/zxvid_2bpp.c index 0a4519e0ac..9f98ab4cfb 100644 --- a/apps/plugins/zxbox/zxvid_2bpp.c +++ b/apps/plugins/zxbox/zxvid_2bpp.c | |||
@@ -41,8 +41,6 @@ void init_spect_scr(void) | |||
41 | } | 41 | } |
42 | void update_screen(void) | 42 | void update_screen(void) |
43 | { | 43 | { |
44 | char str[80]; | ||
45 | |||
46 | fb_data *frameb; | 44 | fb_data *frameb; |
47 | int y=0; | 45 | int y=0; |
48 | int x=0; | 46 | int x=0; |
@@ -106,8 +104,7 @@ void update_screen(void) | |||
106 | int TPF = HZ/50;/* ticks per frame */ | 104 | int TPF = HZ/50;/* ticks per frame */ |
107 | if ((*rb->current_tick-start_time) > TPF ) | 105 | if ((*rb->current_tick-start_time) > TPF ) |
108 | percent = 100*video_frames/((*rb->current_tick-start_time)/TPF); | 106 | percent = 100*video_frames/((*rb->current_tick-start_time)/TPF); |
109 | rb->snprintf(str,sizeof(str),"%d %%",percent); | 107 | rb->lcd_putsxyf(0,0,"%d %%",percent); |
110 | rb->lcd_putsxy(0,0,str); | ||
111 | } | 108 | } |
112 | 109 | ||
113 | 110 | ||