[Scummvm-devel] SAGA - found the issue

yotam barnoy yotambarnoy at gmail.com
Wed Nov 25 20:25:57 CET 2009


good idea :) I'd rather do that too.

On Wed, Nov 25, 2009 at 9:22 PM, Johannes Schickel <lordhoto at scummvm.org>wrote:

> yotam barnoy wrote:
>
>> OK Max's strategy paid off!
>>
>> I was able to lock in on the problem using his idea in no time...
>>
>> The culprit is the few lines
>>           // sanity check
>>           if ((resourceData->offset > (uint)context->file->size()) ||
>> (resourceData->size > contextSize)) {
>>               result = false;
>>               break;
>>
>> in saga/resource.cpp, function loadResContext_v1 (and I imagine v2 has the
>> same thing).
>>
>> This is repeated inside a loop that sometimes loops 3000 times and
>> sometimes 1000 times. Size() is an expensive operation for the PSP, and this
>> value should be stored in a variable. I'm guessing that when I run it off
>> the PC it is cached.
>>
>
> Sounds fine to use a variable in the engine for it. Of course if you would
> add a cached value for it in the PSP's file stream implementation it would
> assure that no other engine might have slow downs because of this. But maybe
> that's overkill... :-).
>
> // Johannes
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scummvm.org/pipermail/scummvm-devel/attachments/20091125/20859067/attachment.html>


More information about the Scummvm-devel mailing list