[Scummvm-devel] SAGA - found the issue

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


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.

Would anyone like to change this (in both v1 and v2) or should I?

Yotam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scummvm.org/pipermail/scummvm-devel/attachments/20091125/385c9caa/attachment.html>


More information about the Scummvm-devel mailing list