[ scummvm-Patches-2834677 ] Wave/ADPCM Endianness Fixes (WIP)

SourceForge.net noreply at sourceforge.net
Mon Aug 10 02:59:04 CEST 2009


Patches item #2834677, was opened at 2009-08-09 19:59
Message generated for change (Tracker Item Submitted) made by mthreepwood
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=2834677&group_id=37116

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: clone2727 (mthreepwood)
Assigned to: Nobody/Anonymous (nobody)
Summary: Wave/ADPCM Endianness Fixes (WIP)

Initial Comment:
As the mixer states, an audio stream should be in the platform's native endianness. Considering that, several of the ADPCM decoders use the TO_LE_16 macro and then engines (such as AGOS and SCUMM) read all of the data out of the AudioStream returned and use it in a LinearMemoryStream (via Mixer::playRaw()). This would be fine for LE systems, but breaks sounds on BE systems. This patch changes the ADPCM decoders to not use TO_LE_16 and changes the calls in both AGOS and SCUMM (HE) to adapt to this as well as makeWAVStream(). AGOS uses the streams directly and SCUMM still reads out the data, but sets the Little Endian flag if on an LE system. As a bonus, the WAV code now supports looping so the AGOS code that originally was used for that has been removed. The Feeble Files' DXA sound problem on BE systems is fixed by this patch.

As of the other engines which use loadWAVFromStream(), I converted both sword1 and Tucker to use makeWAVStream(), but I have not tested them. I did not modify SAGA, Sword2 or Gob - they are more complicated than the other engines. They may even work without any changes if the sound is raw, but I do not know.

This patch is against the 1.0.0 branch. I will also upload a patch for the trunk (my trunk was modified at the time of writing, and it was easier to code for the branch).

dhewg tested the patch on both Linux and Wii with the Feeble Files DXA. I tested on my Mac (x86) with football2002. I did not test sword1 or tucker (I don't have Tucker and I only have the PSX version of sword1).

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=2834677&group_id=37116




More information about the Scummvm-tracker mailing list