<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi!<br>
<blockquote cite="mid:ACFD5C43-7730-463D-AFFB-62F15DB7B6EC@quendi.de"
 type="cite">
  <blockquote type="cite">
    <pre wrap="">

Let's take The Dig:

In PS2 ::listSavefiles I get a regex "dig.s*" and the current
PS2 savefiles manager stores them in "mc0:/ScummVM-dig" with
names like: "s00.ucl", "s01.ucl", etc.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Ugh! I wasn't aware of that (I guess nobody on the team but Robert  
was ;-). I wonder why that was done?
  </pre>
</blockquote>
It's because the PS2 Memory Card's filesystem only allows 13 (IIRC)
files per directory, so if I had made a generic scummvm directory, I
quickly would've run out of file slots.<br>
So instead I decided to split the filename up create a directory for
each filename.<br>
e.g. "TENTANCLE.S00" becomes mc0:/ScummVM-Tentacle/s00.ucl<br>
But this also has the advantage that the ps2's bios recognizes these as
separate sets of data, so if the user decides to delete old savegame
data from his memory card, the bios won't only show "ScummVM Savegames"
(and allow you to erase _ALL_ scummvm savegames) but instead you'll
have one entry per game, called "Tentacle Savegames", "ComI savegames"
and so on.<br>
<br>
<br>
<blockquote cite="mid:ACFD5C43-7730-463D-AFFB-62F15DB7B6EC@quendi.de"
 type="cite">
  <pre wrap="">Also, I always wondered why the PS2 port uses ucl instead of zlib. Is  
zlib to slow / uses to much memory? At least in theory, it would be  
nice if the PS2 port would simply use the zlib compression code we  
provide for the "default" SDL port, too. In particular, backends/ 
saves/compressed/compressed-saves.h provides two functions  
wrapInSaveFile() and wrapOutSaveFile() which can be used to  
transparently add zlib support to any port which supports zlib. See  
also DefaultSaveFileManager::openForLoading() and  
DefaultSaveFileManager::openForSaving() in  backends/saves/default/ 
default-saves.cpp for a usage example.
  </pre>
</blockquote>
It's because back in the early days of my port I didn't manage to make
zlib compile for the ps2. Support for zlib was introduced later on.<br>
Actually, I thought I even changed the port later on to save all data
using zlib. Apparently I was wrong and it's only used for SAN sequences
etc. :)<br>
I'm not sure if it's actually much of a difference, it's a royal pain
to copy the savegames from a memory card to the pc, so I suppose that
most users don't care.<br>
<br>
<blockquote cite="mid:ACFD5C43-7730-463D-AFFB-62F15DB7B6EC@quendi.de"
 type="cite">
  <blockquote type="cite">
    <pre wrap="">2) since we are short of time before 0.11.1, without
   changing the current PS2 implementation, I wonder:

   should I just return all the s??.ucl files that are
   stored in the per games folder in the memory card?
   (quick).
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Well, ideally, it should translate the filenames internally, if  
that's possible: I.e. the file "mc0:/ScummVM-dig/s00.ucl" is mapped  
to the savename "dig.s00" and back. I imagine the PS2 port already  
does that anyway. So, if you have that "conversion table" anyway, it  
should be possible to perform pattern matching on that.
  </pre>
</blockquote>
Yes, you should definately do the conversion internally. I don't know
what the api calls for that function look like, but back when I last
worked on the port it always passed patterns like "dig.s*", which are
easy to translate to the memory card's structure and back.<br>
<br>
<blockquote cite="mid:ACFD5C43-7730-463D-AFFB-62F15DB7B6EC@quendi.de"
 type="cite">
  <pre wrap="">However, we already violate that assumption in  
one or two spots, I think (for Indy3 IQ points, for example). So care  
has to be taken to handle the case where no "." is present in the  
pattern. (I wonder whether the current PS2 save code does that?)
  </pre>
</blockquote>
Yes, there's a special case in the code for those files.<br>
I think the IQ points get stored in mc0:/ScummVM-iqpoints/ps2file.ucl<br>
or something similar.<br>
<blockquote cite="mid:ACFD5C43-7730-463D-AFFB-62F15DB7B6EC@quendi.de"
 type="cite">
  <blockquote type="cite">
    <pre wrap="">   Or should I change it to save them in dig.s?? format
   and then regex between those? (less quick)
    </pre>
  </blockquote>
  <pre wrap=""><!---->
On the long run, this *might* be preferable, if being able to  
exchange savestates with a PC is a desirable feature for the PS2  
port. Naively, this seems like an interesting thing, but I have no  
idea whether it would even be possible, so I think the folks who know  
(i.e. you, Robert, PS2 users) should say what they want :-)
  </pre>
</blockquote>
I don't think that actually exchanging the files is an important
feature...<br>
and for the reasons outlined above I suggest keeping the file structure
as-is. (Okay, changing the compression scheme to zlib might be worth a
shot, but even that is not an important change IMHO. UCL is quite quick
and compresses equally well as zlib).<br>
<br>
Keep up the good work<br>
Robert.<br>
<br>
</body>
</html>