In the current CVS version of DOSBox, it appears that the audio data for the soundblaster and the CD audio component is being drawn straight from the DMA buffers in the DOS memory space. This works fine on machines which share the same endianness as DOS (e.g. x86), but causes significant audio corruption on big endian machines (e.g. PPC Macintoshes). This patch adds four AddSample_16D methods to the mixer class (where D here stands for DOS). These methods will swap the byte order of the incoming samples to native order if necessary for the platform (using the WORDS_BIGENDIAN preprocessor symbol as a flag). The changes to AddSample() are minor, simply adding a new template flag nativeorder. I converted four calls to AddSample in sblaster.cpp, which was then tested against Gabriel Knight I CD, which previously had noticable errors. I also converted one call in cdrom_image.cpp, since similar corruption was occuring there as reported by a friend, so it has not been personally tested. I have not tested this code on an x86 box yet.
A unified patch file for the big endian sound bug
Thanks for working on this, I've used a somewhat different approach using
bigendian-aware memory access functions.
If possible please verify that it's working now in the cvs.
Thank you.
Please verify whether 0.73 is working fine now.