[Scummvm-devel] ScummVM PS2 backend - to be or not to be... a directory
sunmax at libero.it
sunmax at libero.it
Thu Feb 21 07:12:23 CET 2008
Hi Robert!
Either is me going to bed very late, or you waking up really early,
but I read you in real time ;-)
Yes, you spread some light. Thanks!
That's definetely the bug. I made it out in an empirical way:
I counted the delta between two successful 'open' fd, and counted
the number of failed 'dopen' in-between. Tada! If you try to dopen
a non-directory item, you lose one fd. So that ruled out my first
solution to check whether a file was a dir ot not with 'dopen'.
I extended asyncio to have a "chdir" and an "extended open" (e.g.
one that let you specify: path + iomode (or flags) + mode (e.g.
FIO_S_IFDIR) methods, which works, but as usual on the PS2 it
-kinda- works. It works for pfs0: which returns EISDIR when you
try to open a dir... but not on mass: ... and cdfs: :-( ...
...which takes us back to the other issue, the one in the device
drivers likely causing the different behaviour of the different
media, I read the code of the relative IRX and their semantics
change, e.g. cdfs: returns ENOENT (insted of EISDIR) if you try
to open a dir, mass: just succeeds! (very kind of it)
So I got it working (e.g. inherit + kyra + ihnm, which all heavily
rely on isDirectory + exists magic) but only for the games started
from hd. It works for some from CD (dig, ihnm). It fails for most
of the games from USB (but the oldest supported like mi 1/2).
>> By the way, the AsyncFio class is limited to 32 handles for
>> a reason
Now i know ;-)
>> that bug should be fixed in the current ps2sdk.
I wish it was. It's still there in svn 1460. I tried to revert
to 1420 (which uLE guys claim to be the last stable one) but
it's there anyway. As I told you I coded a workaround for pfs0,
and started to implement multiple path depending on the media,
but of course the cleaner solutions is to fix in the IRXs.
>> if you are using an outdated release of ps2link
I am using the one the comes with the last ps2dev (1460) which
I assume to be the last one. I will try anyway to copy ScummVM
to the USB and start it from ToxicOS.
Anyaway I was able to detect & play all the games I had from HD:
- dig (CD / talkie)
- comi
- mi2
- kyra (yeah, now it goes!)
- inherit (demo + full)
- bs2 demo
- sam&max
- dott
- ihnm
I think I still have a few lying around (e.g. Gob & Elvira IIRC),
but I am working now to finish the savegame thingie. Man, I am
sorry for the delay but the files detection part was trickier
than expected. Anyway now it's fully 0.11.x compatible for all
the games started from HD, which is already a good start ;-)
I will have the patch ready sometime Friday, who am I supposed
to send it too? Anybody interested into a binary drop?
Ciao,
-max
More information about the Scummvm-devel
mailing list