FS#6127 - Bubbles bug when completing game

Attached to Project: Rockbox
Opened by Dave Hooper (stripwax) - Friday, 06 October 2006, 07:44 GMT
Task Type Bugs
Category Games
Status Closed
Assigned To Barry Wardell (barrywardell)
Operating System All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Bubbles has 100 levels. The last level is 100/100. When you complete level 100 the game congratulates you and goes back to the main game screen - however you cannot select level 100 (e.g. if you want to replay the last level). The highest level you can select is level 99 which is one level before the last level. Another off-by-one error.
This task depends upon

Closed by  Barry Wardell (barrywardell)
Wednesday, 18 October 2006, 00:06 GMT
Reason for closing:  Accepted
Additional comments about closing:  Patch committed
Comment by Barry Wardell (barrywardell) - Friday, 06 October 2006, 10:50 GMT
The high level wasn't being saved when you won a game. This has just now been fixed in CVS. Can you please confirm that everything works OK now and I will close this bug.
Comment by Dave Hooper (stripwax) - Wednesday, 11 October 2006, 21:45 GMT
Now, when completing the game, the high level is saved as 101. This lets you then play level 101 (which doesn't exist and is unplayable). Could you amend your fix to include the same kind of fix you made to Star (but additionally with the change that the high level used [and displayed] is max( saved high level, 100 ) so that I get the correct behaviour on my device? - or will I need to hexedit some settings file somewhere to reset that?)
Comment by Barry Wardell (barrywardell) - Sunday, 15 October 2006, 11:48 GMT
Can you please test this patch. I believe it should fix your problem, but I'm not good enough at the game to test fully. Also, note that you can edit the file /.rockbox/rocks/bubbles.score using a hex editor to set your max level available. Changing the first byte to 0x63 will make up to level 100 accessible, while making it 0x62 makes level 99 accessible.
Comment by Dave Hooper (stripwax) - Tuesday, 17 October 2006, 21:15 GMT
interestingly, bubbles.score doesn't seem to be written by Bubbles on the sdl sim (at least on cygwin anyway).
with your patch I still get a high level of 101 saved when completing the game. I will implement a better patch and post it here.
Comment by Dave Hooper (stripwax) - Tuesday, 17 October 2006, 22:32 GMT
Actually I think your patch does work (although with my current bubbles.score I guess my high level is already 101 - your patch doesn't clean that up but seems to do the right thing apart from that). Also, the highscores aren't updated correctly (on completing the game, the level in the highscore table is recorded as level 99 rather than level 100 - similarly, scoring a high score on level 2 is recorded with your patch as level 1 rather than level 2). I should have a patch in a moment that addresses this.
Comment by Dave Hooper (stripwax) - Tuesday, 17 October 2006, 23:08 GMT
I think this patch address all three issues (prevents bogus level selection after completing game; prevents invalid highlevel in saved scorefile (e.g. after scorefile corruption) showing up as a selectable level when loading game; persists high scores correctly when completing game). Would you be able to commit on my behalf pls