Rockbox

Tasklist

FS#5077 - wormlet runs out of food

Attached to Project: Rockbox
Opened by Ewan Davies (drspoon) - Sunday, 09 April 2006, 16:31 GMT
Last edited by Dave Chapman (linuxstb) - Saturday, 20 May 2006, 08:50 GMT
Task Type Bugs
Category Games
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version
Due in Version Version 3.0
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

When playing the wormlet game sometimes eating food does not force creation of new food, thus food runs out. The game also starts with varying amounts of food. The non-creation of food might be something to do with eating food when already growing, though I couldn't find a way of reproducing the bug every time.
This task depends upon

Closed by  Zakk Roberts (midkay)
Monday, 22 May 2006, 07:00 GMT
Reason for closing:  Accepted
Additional comments about closing:  Just committed this. Thanks for the report+patch. :)
Comment by Ewan Davies (drspoon) - Sunday, 09 April 2006, 20:20 GMT
happens on h300s on target and sim, not on ipod-video
Comment by Ewan Davies (drspoon) - Sunday, 09 April 2006, 22:11 GMT
it's a strange bug - but i've noticed 2 quirks in the code.

foodx, foody, arghx and arghy are chars - and in init_wormlet the food and arghs are not always created

make_food and make_argh return ints, but aren't used in assignment anywhere.

I've included a so far as I can see working version but the debug code is a quick hack and still in. I'll clean it up for tomorrow
   wormlet.c (62.2 KiB)
Comment by Ewan Davies (drspoon) - Monday, 10 April 2006, 08:40 GMT
A guess, but it might be something to do with a char's bit length. On the ipod-video there are no problems, but in the ipod-video sim there are problems. My fixed version works in the sims, untested on target.
Comment by Daniel Stenberg (bagder) - Monday, 10 April 2006, 08:43 GMT
chars are the same size, but are you possible assuming them to be unsigned without specificly saying so?
Comment by Ewan Davies (drspoon) - Monday, 10 April 2006, 09:04 GMT
Wormlet isnt my code, I know nothing about chars. My int change works on the actual h300 and in the h300 and ipod-video sims. Here's the cleaned version.
Comment by Ewan Davies (drspoon) - Monday, 10 April 2006, 09:04 GMT
ok here's the file...
   wormlet.c (61.8 KiB)
Comment by Ewan Davies (drspoon) - Thursday, 13 April 2006, 20:00 GMT
http://www.rockbox.org/tracker/task/1510 also contains very old wormlet changes. I've tried to bring it up to date and include it in my changes. Some of the code is strange though i'd appreciate a 2nd opinion.
Comment by Zakk Roberts (midkay) - Saturday, 22 April 2006, 09:46 GMT
You're right, the chars should be a problem for the larger LCDs. I had a look at your most recent patch and I'm glad to see MT's update with the adjustables menu (haven't used it in years!). :) After I finish a few touch-ups with JdGordon's viewer update and commit that, I'll test and check this out more thoroughly and probably commit it (definitely at least the fixes).

Thanks. :)

Loading...