[Scummvm-tracker] [ScummVM :: Bugs] #13417: AGS: Can't start a games on BIG-Endian/AmigaOS4 : Unalbe to load the room file 'room74.crm'.
ScummVM :: Bugs
trac at scummvm.org
Mon Oct 3 14:23:16 UTC 2022
#13417: AGS: Can't start a games on BIG-Endian/AmigaOS4 : Unalbe to load the room
file 'room74.crm'.
--------------------------------+----------------------------
Reporter: kas1e | Owner: (none)
Type: defect | Status: new
Priority: high | Component: Engine: AGS
Version: | Resolution:
Keywords: big endian, BE, AGS | Game: Space Quest 5
--------------------------------+----------------------------
Comment (by dwatteau):
I gave a look at that savegame problem on my big-endian G4 system.
It looks like the savegames created on big-endian systems are missing some
(required) RICH_GAME_MEDIA_HEADER fields.
This part calls WriteArrayOfInt16():
<https://github.com/scummvm/scummvm/blob/8def4f72455675bb712a125b447a04532cf34ad2/engines/ags/engine/ac/rich_game_media.cpp#L51-L54>
but the WriteArrayOfIntXX() functions behave differently on big-endian
systems:
<https://github.com/scummvm/scummvm/blob/8def4f72455675bb712a125b447a04532cf34ad2/engines/ags/shared/util/data_stream.h#L60-L73>
There, WriteAndConvertArrayOfIntXX() is called, instead:
https://github.com/scummvm/scummvm/blob/8def4f72455675bb712a125b447a04532cf34ad2/engines/ags/shared/util/data_stream.cpp#L96-L120
but playing a bit with GDB, it looks like the loop immediately stops when
writing these fields, since the condition is:
{{{
for (elem = 0; elem < count && !EOS(); ++elem, ++buffer)
^^^^^^^^^
}}}
but EOS() immediately returns true in this case, so that's why the fields
are never written in the savegames.
If I completely remove the `&& !EOS()` checks from the
WriteAndConvertArrayOfIntXX() functions, big-endian savegames now work,
but maybe there was a good reason why these checks were there...
--
Ticket URL: <https://bugs.scummvm.org/ticket/13417#comment:5>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM
More information about the Scummvm-tracker
mailing list