diff -u -r patch_rockbox/apps/plugins/brickmania.c changed_rockbox/apps/plugins/brickmania.c --- patch_rockbox/apps/plugins/brickmania.c 2009-03-22 19:40:08.000000000 +0100 +++ changed_rockbox/apps/plugins/brickmania.c 2009-03-22 19:37:45.000000000 +0100 @@ -20,27 +20,24 @@ ****************************************************************************/ #include "plugin.h" -#include "lib/configfile.h" /* Part of libplugin */ +#include "lib/configfile.h" #include "lib/helper.h" #include "lib/playback_control.h" +#include "lib/highscore.h" PLUGIN_HEADER - -#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD) - +#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ + (CONFIG_KEYPAD == IRIVER_H300_PAD) #define QUIT BUTTON_OFF #define LEFT BUTTON_LEFT #define RIGHT BUTTON_RIGHT #define SELECT BUTTON_SELECT #define UP BUTTON_UP #define DOWN BUTTON_DOWN - #define RC_QUIT BUTTON_RC_STOP - #elif CONFIG_KEYPAD == ONDIO_PAD - #define QUIT BUTTON_OFF #define LEFT BUTTON_LEFT #define RIGHT BUTTON_RIGHT @@ -48,9 +45,7 @@ #define UP BUTTON_UP #define DOWN BUTTON_DOWN - #elif CONFIG_KEYPAD == RECORDER_PAD - #define QUIT BUTTON_OFF #define LEFT BUTTON_LEFT #define RIGHT BUTTON_RIGHT @@ -58,9 +53,7 @@ #define UP BUTTON_UP #define DOWN BUTTON_DOWN - #elif CONFIG_KEYPAD == ARCHOS_AV300_PAD - #define QUIT BUTTON_OFF #define LEFT BUTTON_LEFT #define RIGHT BUTTON_RIGHT @@ -68,24 +61,19 @@ #define UP BUTTON_UP #define DOWN BUTTON_DOWN - #elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \ (CONFIG_KEYPAD == IPOD_3G_PAD) || \ (CONFIG_KEYPAD == IPOD_1G2G_PAD) - #define QUIT BUTTON_MENU #define LEFT BUTTON_LEFT #define RIGHT BUTTON_RIGHT #define SELECT BUTTON_SELECT #define UP BUTTON_SCROLL_BACK #define DOWN BUTTON_SCROLL_FWD - #define SCROLL_FWD(x) ((x) & BUTTON_SCROLL_FWD) #define SCROLL_BACK(x) ((x) & BUTTON_SCROLL_BACK) - #elif (CONFIG_KEYPAD == GIGABEAT_PAD) - #define QUIT BUTTON_POWER #define LEFT BUTTON_LEFT #define RIGHT BUTTON_RIGHT @@ -93,9 +81,7 @@ #define UP BUTTON_UP #define DOWN BUTTON_DOWN - #elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD - #define QUIT BUTTON_POWER #define LEFT BUTTON_LEFT #define RIGHT BUTTON_RIGHT @@ -103,25 +89,19 @@ #define UP BUTTON_UP #define DOWN BUTTON_DOWN - #elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \ (CONFIG_KEYPAD == SANSA_FUZE_PAD) - -#define QUIT BUTTON_POWER -#define LEFT BUTTON_LEFT -#define RIGHT BUTTON_RIGHT -#define SELECT BUTTON_SELECT -#define UP BUTTON_SCROLL_BACK -#define DOWN BUTTON_SCROLL_FWD - +#define QUIT BUTTON_POWER +#define LEFT BUTTON_LEFT +#define RIGHT BUTTON_RIGHT +#define SELECT BUTTON_SELECT +#define UP BUTTON_UP +#define DOWN BUTTON_DOWN #define SCROLL_FWD(x) ((x) & BUTTON_SCROLL_FWD) #define SCROLL_BACK(x) ((x) & BUTTON_SCROLL_BACK) - -#elif CONFIG_KEYPAD == SANSA_C200_PAD || \ -CONFIG_KEYPAD == SANSA_CLIP_PAD || \ -CONFIG_KEYPAD == SANSA_M200_PAD - +#elif (CONFIG_KEYPAD == SANSA_C200_PAD) || \ + (CONFIG_KEYPAD == SANSA_M200_PAD) #define QUIT BUTTON_POWER #define LEFT BUTTON_LEFT #define RIGHT BUTTON_RIGHT @@ -131,9 +111,15 @@ #define UP BUTTON_UP #define DOWN BUTTON_DOWN +#elif CONFIG_KEYPAD == SANSA_CLIP_PAD +#define QUIT BUTTON_POWER +#define LEFT BUTTON_LEFT +#define RIGHT BUTTON_RIGHT +#define SELECT BUTTON_SELECT +#define UP BUTTON_UP +#define DOWN BUTTON_DOWN #elif CONFIG_KEYPAD == IRIVER_H10_PAD - #define QUIT BUTTON_POWER #define LEFT BUTTON_LEFT #define RIGHT BUTTON_RIGHT @@ -142,7 +128,6 @@ #define DOWN BUTTON_SCROLL_DOWN #elif CONFIG_KEYPAD == GIGABEAT_S_PAD - #define QUIT BUTTON_BACK #define LEFT BUTTON_LEFT #define RIGHT BUTTON_RIGHT @@ -151,7 +136,6 @@ #define DOWN BUTTON_DOWN #elif (CONFIG_KEYPAD == MROBE100_PAD) - #define QUIT BUTTON_POWER #define LEFT BUTTON_LEFT #define RIGHT BUTTON_RIGHT @@ -160,21 +144,18 @@ #define DOWN BUTTON_DOWN #elif CONFIG_KEYPAD == IAUDIO_M3_PAD - #define QUIT BUTTON_RC_REC #define LEFT BUTTON_RC_REW #define RIGHT BUTTON_RC_FF #define SELECT BUTTON_RC_PLAY #define UP BUTTON_RC_VOL_UP #define DOWN BUTTON_RC_VOL_DOWN - #define RC_QUIT BUTTON_REC #elif CONFIG_KEYPAD == COWOND2_PAD #define QUIT BUTTON_POWER #elif CONFIG_KEYPAD == CREATIVEZVM_PAD - #define QUIT BUTTON_BACK #define LEFT BUTTON_LEFT #define RIGHT BUTTON_RIGHT @@ -183,7 +164,6 @@ #define DOWN BUTTON_DOWN #elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD - #define QUIT BUTTON_POWER #define LEFT BUTTON_LEFT #define RIGHT BUTTON_RIGHT @@ -196,6 +176,9 @@ #endif #ifdef HAVE_TOUCHSCREEN +#ifndef QUIT +#define QUIT BUTTON_TOUCHSCREEN +#endif #ifndef LEFT #define LEFT BUTTON_MIDLEFT #endif @@ -218,24 +201,6 @@ #define SCROLL_BACK(x) (0) #endif - -enum menu_items { - BM_START, - BM_RESUME, - BM_HELP, - BM_HIGHSCORE, - BM_PLAYBACK_CONTROL, - BM_QUIT -}; - -MENUITEM_STRINGLIST (main_menu, "Brickmania", NULL, - "Start", - "Resume", - "Help", - "High Score", - "Playback Control", - "Quit"); - #include "pluginbitmaps/brickmania_pads.h" #include "pluginbitmaps/brickmania_bricks.h" #include "pluginbitmaps/brickmania_powerups.h" @@ -743,9 +708,13 @@ int pad_type; int score=0,vscore=0; bool flip_sides=false; -int cur_level=0; +int level=0; int brick_on_board=0; int used_balls=1; +int difficult=0; +bool saved_game=false; +int l_score=0; +int highscore; typedef struct cube { int powertop; @@ -776,15 +745,22 @@ } sfire; sfire fire[30]; +#define config_file "brickmania.cfg" -int highscore; -#define MAX_POINTS 200000 /* i dont think it needs to be more */ -static struct configdata config[] = -{ - {TYPE_INT, 0, MAX_POINTS, { .int_p = &highscore }, "highscore", NULL} +static struct configdata config[] = { + {TYPE_INT, 0, 1, { .int_p = &difficult }, "difficult", NULL}, + {TYPE_BOOL, 0, 1, { .bool_p = &saved_game }, "saved_game", NULL}, + {TYPE_INT, 0, 40000, { .int_p = &l_score }, "l_score", NULL}, + {TYPE_INT, 0, 29, { .int_p = &level }, "level", NULL}, + {TYPE_INT, 0, 30, { .int_p = &life }, "life", NULL}, }; -void int_game(int new_game) +#define HIGH_SCORE PLUGIN_GAMES_DIR "/brickmania.score" +#define MAX_HIGH_SCORES 5 + +struct highscore Highest[MAX_HIGH_SCORES]; + +static void brickmania_int_game(int new_game) { int i,j; @@ -807,27 +783,30 @@ flip_sides=false; - if (new_game==1) + if (new_game==1) { brick_on_board=0; - + /* add one life per achieved level */ + if (difficult==0 && life<2) + life++; + } for(i=0;i<=7;i++) { for(j=0;j<=9;j++) { - brick[i*10+j].poweruse=(levels[cur_level][i][j]==0?0:1); + brick[i*10+j].poweruse=(levels[level][i][j]==0?0:1); if (i*10+j<=30) fire[i*10+j].top=-8; if (new_game==1) { brick[i*10+j].power=rb->rand()%25; /* +8 make the game with less powerups */ - brick[i*10+j].hits=levels[cur_level][i][j]>=10? - levels[cur_level][i][j]/16-1:0; + brick[i*10+j].hits=levels[level][i][j]>=10? + levels[level][i][j]/16-1:0; brick[i*10+j].hiteffect=0; brick[i*10+j].powertop=TOPMARGIN+i*BRICK_HEIGHT+BRICK_HEIGHT; - brick[i*10+j].used=(levels[cur_level][i][j]==0?0:1); - brick[i*10+j].color=(levels[cur_level][i][j]>=10? - levels[cur_level][i][j]%16: - levels[cur_level][i][j])-1; - if (levels[cur_level][i][j]!=0) + brick[i*10+j].used=(levels[level][i][j]==0?0:1); + brick[i*10+j].color=(levels[level][i][j]>=10? + levels[level][i][j]%16: + levels[level][i][j])-1; + if (levels[level][i][j]!=0) brick_on_board++; } } @@ -836,8 +815,8 @@ int sw,i,w; -/* sleep timer counting the score */ -void sleep (int secs) +/* brickmania_sleep timer counting the score */ +static void brickmania_sleep(int secs) { bool done=false; char s[20]; @@ -866,72 +845,188 @@ } -/* forward declaration, used in game_menu */ -int help(int when); - -#define HIGH_SCORE "brickmania.score" -int game_menu(int when) +/* display a highscore*/ +static void brickmania_show_highscores(int p) { - /* clear any previous button presses (especially when coming from - * game over, but it doesn't hurt to do it always) - */ rb->button_clear_queue(); + int w; + int h; +#ifdef HAVE_LCD_COLOR + rb->lcd_set_background(LCD_BLACK); + rb->lcd_clear_display(); + rb->lcd_set_background(LCD_BLACK); + rb->lcd_set_foreground(LCD_WHITE); +#else + rb->lcd_clear_display(); +#endif + char str[25]; + int i; + rb->lcd_getstringsize("Highscore", &w, &h); + rb->lcd_putsxy(LCD_WIDTH/2-w/2, 5, "Highscore"); + + rb->lcd_putsxy(30,2*(h+2), "Score"); + rb->lcd_putsxy(80,2*(h+2), "Level"); + + + for (i = 1; i<=MAX_HIGH_SCORES; i++) + { + rb->snprintf (str, sizeof (str), "%d)", i); + rb->lcd_putsxy (5,3*(h+2)+ 10 * (i-1), str); + rb->snprintf (str, sizeof (str), "%d", Highest[i-1].score); + rb->lcd_putsxy (30,3*(h+2)+ 10 * (MAX_HIGH_SCORES-i), str); + rb->snprintf (str, sizeof (str), "%d", (Highest[i-1].level)+1); + rb->lcd_putsxy (80,3*(h+2)+ 10 * (MAX_HIGH_SCORES-i), str); + } - int choice = 0; +#ifdef HAVE_LCD_COLOR + rb->lcd_set_foreground(LCD_RGBPACK(245,0,0)); + rb->snprintf (str, sizeof (str), "%d)", MAX_HIGH_SCORES-p+1); + rb->lcd_putsxy (5,3*(h+2)+ 10 * (MAX_HIGH_SCORES-p), str); + rb->snprintf (str, sizeof (str), "%d", Highest[p-1].score); + rb->lcd_putsxy (30,3*(h+2)+ 10 * (MAX_HIGH_SCORES-p), str); + rb->snprintf (str, sizeof (str), "%d", Highest[p-1].level+1); + rb->lcd_putsxy (80,3*(h+2)+ 10 * (MAX_HIGH_SCORES-p), str); + rb->lcd_set_foreground(LCD_WHITE); +#endif + rb->lcd_update(); + rb->button_get(true); +} - while (1) { - choice = rb->do_menu(&main_menu, &choice, NULL, false); - switch (choice) { - case BM_START: - score=0; - vscore=0; - life=2; - cur_level=0; - int_game(1); - return choice; - - case BM_RESUME: - /* resume if we can */ - if (when==1) - return choice; - else - rb->splash(HZ/2, "Nothing to resume!"); - break; +/* forward declaration, used in brickmania_game_menu */ +static int brickmania_help(void); +static int brickmania_choose_difficult(void); - case BM_HELP: - if (help(when)==1) - return BM_QUIT; - else - return choice; +static int brickmania_game_menu(int when) +{ + rb->button_clear_queue(); + int choice = 0; - case BM_HIGHSCORE: - rb->splashf(HZ*2, "High Score: %d", highscore); - break; + if (when==1) { + MENUITEM_STRINGLIST (main_menu, "Brickmania Menu", NULL, + "Resume Game", + "Restart Game", + "Difficulty", + "Help", + "High Score", + "Playback Control", + "Quit"); + + while (1) { + choice = rb->do_menu(&main_menu, &choice, NULL, false); + switch (choice) { + case 0: + if (saved_game) { + vscore=l_score-1; + score=l_score; + brickmania_int_game(1); + } + else { + con_game=1; + } + return 0; + case 1: + score=0; + vscore=0; + life=2; + level=0; + brickmania_int_game(1); + return 0; + case 2: + brickmania_choose_difficult(); + break; + case 3: + brickmania_help(); + break; + case 4: + brickmania_show_highscores(MAX_HIGH_SCORES); + break; + case 5: + playback_control(NULL); + break; + case 6: + if (level>0) { + saved_game=true; + } + else { + saved_game=false; + } + configfile_save(config_file,config,5,0); + return 1; + case MENU_ATTACHED_USB: + return 1; + default: + break; + } + } + } + else { + MENUITEM_STRINGLIST (main_menu, "Brickmania Menu", NULL, + "Start New Game", + "Difficulty", + "Help", + "High Score", + "Playback Control", + "Quit"); + + while (1) { + choice = rb->do_menu(&main_menu, &choice, NULL, false); + switch (choice) { + case 0: + score=0; + vscore=0; + life=2; + level=0; + brickmania_int_game(1); + return 0; + case 1: + brickmania_choose_difficult(); + break; + case 2: + brickmania_help(); + break; + case 3: + brickmania_show_highscores(MAX_HIGH_SCORES); + break; + case 4: + playback_control(NULL); + break; + case 5: + configfile_save(config_file,config,1,0); + return 1; + case MENU_ATTACHED_USB: + return 1; + default: + break; + } + } + } +} - case BM_PLAYBACK_CONTROL: - playback_control(NULL); +/* submenu to choose difficult */ +static int brickmania_choose_difficult(void) +{ + rb->button_clear_queue(); + int choice = difficult; + MENUITEM_STRINGLIST (main_menu, "Brickmania Difficulty", NULL, + "Easy", + "Hard",); + choice = rb->do_menu(&main_menu, &choice, NULL, false); + switch (choice) { + case 0: + difficult=0; + break; + case 1: + difficult=1; break; - - case BM_QUIT: - case MENU_ATTACHED_USB: - return BM_QUIT; - - case GO_TO_ROOT: - case GO_TO_PREVIOUS: - /* Resume if we can resume, otherwise quit */ - if (when==1) - return BM_RESUME; - else - return BM_QUIT; - default: break; } - } + rb->button_clear_queue(); + return 0; } -int help(int when) +static int brickmania_help(void) { int w,h; int button; @@ -942,7 +1037,7 @@ int maxY=180; int maxX=215; - while(true) { + while(1) { #ifdef HAVE_LCD_COLOR rb->lcd_set_background(LCD_BLACK); rb->lcd_clear_display(); @@ -1019,36 +1114,23 @@ #ifdef RC_QUIT case RC_QUIT: #endif -#ifdef HAVE_TOUCHSCREEN - case BUTTON_TOUCHSCREEN: -#endif case QUIT: - switch (game_menu(when)) { - case BM_RESUME: - con_game=1; - break; - case BM_QUIT: - return 1; - default: - break; - } return 0; - break; - case LEFT: - case LEFT | BUTTON_REPEAT: #ifdef ALTLEFT case ALTLEFT: case ALTLEFT | BUTTON_REPEAT: #endif + case LEFT: + case LEFT | BUTTON_REPEAT: if( xoffset<0) xoffset+=2; break; - case RIGHT: - case RIGHT | BUTTON_REPEAT: #ifdef ALTRIGHT case ALTRIGHT: case ALTRIGHT | BUTTON_REPEAT: #endif + case RIGHT: + case RIGHT | BUTTON_REPEAT: if(xoffset+maxX > LCD_WIDTH) xoffset-=2; break; @@ -1062,19 +1144,16 @@ if(yoffset+maxY > LCD_HEIGHT) yoffset-=2; break; - default: if(rb->default_event_handler(button) == SYS_USB_CONNECTED) return 1; break; } - rb->yield(); } - return 0; } -int pad_check(int ballxc, int mode, int pon ,int ballnum) +static int brickmania_pad_check(int ballxc, int mode, int pon ,int ballnum) { /* pon: positive(1) or negative(0) */ @@ -1091,7 +1170,7 @@ } } -int fire_space(void) +static int brickmania_fire_space(void) { int t; for(t=0;t<=30;t++) @@ -1101,28 +1180,30 @@ return 0; } -int game_loop(void) +static int brickmania_game_loop(void) { int j,i,k,bricky,brickx; char s[30]; int sec_count=0,num_count=10; int end; + int position; + + configfile_load(config_file,config,5,0); rb->srand( *rb->current_tick ); - - configfile_load(HIGH_SCORE,config,1,0); - - switch(game_menu(0)) { - case BM_RESUME: - con_game=1; - break; - case BM_QUIT: + if (saved_game) { + + if (brickmania_game_menu(1)!=0) { + return 1; + } + } + else { + if (brickmania_game_menu(0)!=0) { return 1; - default: - break; + } } - while(true) { + while(1) { /* Convert CYCLETIME (in ms) to HZ */ end = *rb->current_tick + (CYCLETIME * HZ) / 1000; @@ -1165,11 +1246,11 @@ #endif #if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64) - rb->snprintf(s, sizeof(s), "L%d", cur_level+1); + rb->snprintf(s, sizeof(s), "L%d", level+1); rb->lcd_getstringsize(s, &sw, NULL); rb->lcd_putsxy(LCD_WIDTH-sw, 0, s); #else - rb->snprintf(s, sizeof(s), "Level %d", cur_level+1); + rb->snprintf(s, sizeof(s), "Level %d", level+1); rb->lcd_getstringsize(s, &sw, NULL); rb->lcd_putsxy(LCD_WIDTH-sw-2, 2, s); #endif @@ -1249,8 +1330,8 @@ case 1: life--; if (life>=0) { - int_game(0); - sleep(2); + brickmania_int_game(0); + brickmania_sleep(2); } break; case 2: @@ -1533,8 +1614,8 @@ } else { life--; if (life>=0) { - int_game(0); - sleep(2); + brickmania_int_game(0); + brickmania_sleep(2); } } } @@ -1561,7 +1642,7 @@ ball[k].y = -2; if (ball[k].pos_x != 0 && ball[k].pos_x+BALL!=LCD_WIDTH) - ball[k].x = pad_check(6,0,ball[k].pos_x+2<= + ball[k].x = brickmania_pad_check(6,0,ball[k].pos_x+2<= pad_pos_x+(PAD_WIDTH/2)? 0:1,k); @@ -1578,7 +1659,7 @@ ball[k].y = -3; if (ball[k].pos_x != 0 && ball[k].pos_x+BALL!=LCD_WIDTH) - ball[k].x = pad_check(4,0,ball[k].pos_x+2<= + ball[k].x = brickmania_pad_check(4,0,ball[k].pos_x+2<= pad_pos_x+(PAD_WIDTH/2)? 0:1,k); @@ -1595,7 +1676,7 @@ ball[k].y = -4; if (ball[k].pos_x != 0 && ball[k].pos_x+BALL!=LCD_WIDTH) - ball[k].x = pad_check(3,0,ball[k].pos_x+2<= + ball[k].x = brickmania_pad_check(3,0,ball[k].pos_x+2<= pad_pos_x+(PAD_WIDTH/2)? 0:1,k); @@ -1611,7 +1692,7 @@ ball[k].y = -4; if (ball[k].pos_x != 0 && ball[k].pos_x+BALL!=LCD_WIDTH) - ball[k].x = pad_check(2,1,0,k); + ball[k].x = brickmania_pad_check(2,1,0,k); } else { @@ -1640,11 +1721,13 @@ rb->lcd_update(); if (brick_on_board < 0) { - if (cur_level+1lcd_getstringsize("Congratulations!", &sw, NULL); @@ -1663,22 +1746,23 @@ vscore=score; rb->lcd_update(); if (score>highscore) { - sleep(2); + brickmania_sleep(2); highscore=score; - rb->splash(HZ*2, "New High Score"); + position=highscore_update(score,level,Highest,MAX_HIGH_SCORES); + if (position==MAX_HIGH_SCORES) { + rb->splash(HZ*2, "New High Score"); + } + else { + rb->splash(HZ*2, "Top Five"); + } + brickmania_show_highscores(position); } else { - sleep(3); + brickmania_sleep(3); } - switch(game_menu(0)) { - case BM_RESUME: - con_game=1; - break; - case BM_QUIT: - return 1; - default: - break; + if (brickmania_game_menu(0)!=0) { + return 1; } } } @@ -1790,10 +1874,10 @@ } } else if (pad_type==2 && con_game!=1) { int tfire; - tfire=fire_space(); + tfire=brickmania_fire_space(); fire[tfire].top=PAD_POS_Y-7; fire[tfire].left=pad_pos_x+1; - tfire=fire_space(); + tfire=brickmania_fire_space(); fire[tfire].top=PAD_POS_Y-7; fire[tfire].left=pad_pos_x+PAD_WIDTH-1; } else if (con_game==1 && start_game!=1) { @@ -1808,16 +1892,8 @@ case RC_QUIT: #endif case QUIT: - switch(game_menu(1)) { - case BM_RESUME: - for(k=0;klcd_update(); if (score>highscore) { - sleep(2); + brickmania_sleep(2); highscore=score; - rb->splash(HZ*2, "New High Score"); + position=highscore_update(score,level,Highest,MAX_HIGH_SCORES); + if (position==MAX_HIGH_SCORES) { + rb->splash(HZ*2, "New High Score"); + } + else { + rb->splash(HZ*2, "Top Five"); + } + brickmania_show_highscores(position); } else { - sleep(3); + brickmania_sleep(3); } for(k=0;k *rb->current_tick) @@ -1884,6 +1961,8 @@ { (void)parameter; + highscore_load(HIGH_SCORE,Highest,MAX_HIGH_SCORES); + rb->lcd_setfont(FONT_SYSFIXED); #if LCD_DEPTH > 1 rb->lcd_set_backdrop(NULL); @@ -1892,10 +1971,9 @@ backlight_force_on(); /* backlight control in lib/helper.c */ /* now go ahead and have fun! */ - while (game_loop()!=1); - - configfile_save(HIGH_SCORE,config,1,0); + brickmania_game_loop(); + highscore_save(HIGH_SCORE,Highest,MAX_HIGH_SCORES); /* Restore user's original backlight setting */ rb->lcd_setfont(FONT_UI); /* Turn on backlight timeout (revert to settings) */ diff -u -r patch_rockbox/apps/plugins/lib/highscore.c changed_rockbox/apps/plugins/lib/highscore.c --- patch_rockbox/apps/plugins/lib/highscore.c 2009-03-22 19:37:00.000000000 +0100 +++ changed_rockbox/apps/plugins/lib/highscore.c 2009-03-22 17:52:24.000000000 +0100 @@ -115,7 +115,7 @@ scores[i].score = score; scores[i].level = level; /* Need to sort out entering a name... maybe old three letter arcade style */ - new = 1; + new = i+1; break; } }