[Scummvm-devel] kyra.dat

sunmax at libero.it sunmax at libero.it
Sun Jul 12 22:11:18 CEST 2009


Hi Johannes,

> Currently there's no API in Kyra to do that. 

> why don't you create a cache in your backend?

We are already re-placing fopen and fclose in PS2 and we have
both read and write cache. Still cache is deallocated on close
(because on an embedded system with limited resources) we don't
want to overcache.

I would not mind keeping the FD open on close on a LRU base,
but the FD slots are limited on PS2, and I just need to keep
-one- file open: kyra.dat.

The fact is we have this issue only with kyra.dat which is
the only file (in a few engines I tried) that keeps getting
opened/closed. To implement a smarter cache is possible but
would be an overkill to fix a single file case in a single
engine...

So I thought it could be simpler to just keep it opened in
kyra. I just had a quick look to the code:

bool StaticResource::loadStaticResourceFile() {
    Resource *res = _vm->resource();

    if (res->isInCacheList(staticDataFilename()))
        return true;

Is this the only place where kyra.dat is loaded ?

I see there is a "isInCacheList" check on KYRA.DAT,
what do we need on PS2 backend to make it succeed,
so the we skip loadPakFile ?

Please note, I just had a very quick glimpse so it's
possible I am missing quite a few things... ;-)

Thanks!
 -max





More information about the Scummvm-devel mailing list