[Scummvm-tracker] [ScummVM :: Bugs] #15279: SCI: Some Macintosh games are very slow to start

ScummVM :: Bugs trac at scummvm.org
Mon Jul 15 16:34:36 UTC 2024


#15279: SCI: Some Macintosh games are very slow to start
-------------------------+--------------------------
Reporter:  eriktorbjorn  |       Owner:  (none)
    Type:  defect        |      Status:  new
Priority:  normal        |   Component:  Engine: SCI
 Version:                |  Resolution:
Keywords:                |        Game:
-------------------------+--------------------------

Old description:

> I've noticed that the Macintosh versions of Leisure Suit Larry 6 and 7
> take a long time to start in ScummVM. Particularly the first time.
> Subsequent startups are faster, presumably because the operating system
> has cached the files it's reading.
>
> But the first time it was slow enough that I thought for sure that
> ScummVM had locked up somehow.
>
> The problem seems to be `ResourceManager::readResourcePatchesBase36()`,
> where it loops through a bunch of files, patching them somehow. For
> Leisuire Sute Larry 6, it goes through 4,917 files. For Leisure Suit
> Larry 7, it's 3,807. Would it be possible to do this processing on
> demand, rather than all in advance, or something like that?
>
> I have Macintosh versions of Phantasmagoria 1 and Gabriel Knight 2, but I
> don't know how to install those for ScummVM so I haven't tested if
> they're similarly slow to start.
>
> Also, is there any purpose to this part of the function?
>
> {{{
>                                 // Check for SOL as well
>                                 tag = (tag << 16) |
> stream->readUint16BE();
>
>                                 if (tag != MKTAG('S','O','L',0)) {
>                                         delete stream;
>                                         continue;
>                                 }
>
>                                 delete stream;
> }}}
>
> Edit: D'oh! Of course there's a point. The `continue` breaks out of the
> loop, and the loop continues after the `delete`.

New description:

 I've noticed that the Macintosh versions of Leisure Suit Larry 6 and 7
 take a long time to start in ScummVM. Particularly the first time.
 Subsequent startups are faster, presumably because the operating system
 has cached the files it's reading.

 But the first time it was slow enough that I thought for sure that ScummVM
 had locked up somehow.

 The problem seems to be `ResourceManager::readResourcePatchesBase36()`,
 where it loops through a bunch of files, patching them somehow. For
 Leisuire Sute Larry 6, it goes through 4,917 files. For Leisure Suit Larry
 7, it's 3,807. Would it be possible to do this processing on demand,
 rather than all in advance, or something like that?

 I have Macintosh versions of Phantasmagoria 1 and Gabriel Knight 2, but I
 don't know how to install those for ScummVM so I haven't tested if they're
 similarly slow to start.

 Also, is there any purpose to this part of the function?

 {{{
                                 // Check for SOL as well
                                 tag = (tag << 16) |
 stream->readUint16BE();

                                 if (tag != MKTAG('S','O','L',0)) {
                                         delete stream;
                                         continue;
                                 }

                                 delete stream;
 }}}

--
Comment (by m-kiewitz):

 What could be done for this situation is to not look through all audio
 files separately, but go basically: "this is a mac SCI32 version, so for
 these directories, just look through the folders and assume that all of
 these files are in fact audio resources"

 I guess the Sierra interpreter just handled these sub directories like a
 resource.aud file and not as regular patch files.
-- 
Ticket URL: <https://bugs.scummvm.org/ticket/15279#comment:17>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list