[Scummvm-devel] Pajama Sam: Games To Play On Any Day

Travis Howell kirben at optusnet.com.au
Tue Jul 22 03:23:11 CEST 2014


On 22/07/2014 8:58 AM, Willem Jan Palenstijn wrote:
> On Mon, Jul 21, 2014 at 10:50:30PM +1000, Travis Howell wrote:
>> I suspected this bug was holding back your release of Pajama Sam: Games
>> to play on Any Day, and I have looked into the bug several times, but
>> without any luck.
>>
>> The bug is caused by an infinite loop occurs in one script (room 2
>> script 2070), specifically this section:
>> [0019] (84) localvar0 = getRandomNumberRange(0,63)
>> [0021] (36) unless (((roomarray24[localvar0][4] &&
>> (roomarray24[localvar0][5] != 3)) &&
>> (getSpriteInfo.getFlagAutoAnim(roomarray24[localvar0][4]) != 1))) jump 19
>>
>> The problem is the AutoAnim flag for the sprites is always set at this
>> stage, and I can find no code differences for how the AutoAnim is
>> handled in original code, that would fix this bug either.
>>
>> Unfortunately the real cause of the bug seems to be elsewhere (arrays?,
>> script handling?), but it isn't clear where that could be. I would
>> rather not add a hack to work around that issue either.
>
> Could there be a problem with resetting this flag? Soon before the hang, it sets AutoAnim on spriteId 49 - 77, but the spriteIds checked in the infinite loop are 25 - 48. (The 48 vs 49 sounds suspiciously close.)
>
> Just thinking out loud here, since I'm not too familiar with HE rendering, but since I don't see a tracker item for this, I don't know how much you already figured out.

There is a code difference in setImage which can set the sprites flags 
to zero, and effects sprites 25 - 48. But there is also a code 
difference in resetSprite, which always enables the AutoAnim flag, which 
effects sprites  25 - 48 too.

That was what I meant by the code differences not helping, I have 
committed these difference to ScummVM GiT though.




More information about the Scummvm-devel mailing list