[Scummvm-devel] ReadStream::ioFailed/EOF - StdioStream::read

sunmax at libero.it sunmax at libero.it
Sun Feb 22 02:14:53 CET 2009


Hi there ScummVM world!

Couple of questions:

a) how do we handle ReadStream::ioFailed() and eof() there
   [common/stream.h]

   it's deprecated but used by the unzip engine when parsing
   the zipped theme

   -> the very last unzlocal_getShort in unzOpen -succeeds-
      cause it reads the last two bytes of the zip file, but
      then triggers the EOF condition (it's in fin->ioFailed in
      unzlocal_getShort) which on return sets err=UNZ_ERRNO and
      causes the theme not to be used on the PS2 backend :-(

   It sounds as a dumb question but when should the backend
   implementation return EOF? When we read the last byte, right?
   That's what I am doing now, but causes it to fail. I wonder
   if this could be the cause of some games no longer starting
   on PS2 in 0.13.0 too. I will keep investigating.


b) Why are most of StdioStream::read when reading game data 1 (!)
   byte long ?

   This forces us to do quite some trickery with read-ahead and
   cache on PS2.

Looking forward to your suggestions.

Thanks!
 -Max (!Horn)





More information about the Scummvm-devel mailing list