<div dir="ltr">good idea :) I'd rather do that too.<br><br><div class="gmail_quote">On Wed, Nov 25, 2009 at 9:22 PM, Johannes Schickel <span dir="ltr"><<a href="mailto:lordhoto@scummvm.org">lordhoto@scummvm.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">yotam barnoy wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
OK Max's strategy paid off!<br>
<br>
I was able to lock in on the problem using his idea in no time...<br>
<br>
The culprit is the few lines<br>
           // sanity check<br>
           if ((resourceData->offset > (uint)context->file->size()) || (resourceData->size > contextSize)) {<br>
               result = false;<br>
               break;<br>
<br>
in saga/resource.cpp, function loadResContext_v1 (and I imagine v2 has the same thing).<br>
<br>
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.<br>


</blockquote>
<br></div>
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... :-).<br>

<font color="#888888">
<br>
// Johannes<br>
</font></blockquote></div><br></div>