Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#211 Soundblaster/CD Audio fix for Big Endian Machines

open
nobody
None
5
2012-09-07
2008-06-10
Brian Chin
No

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.

Discussion

  • Brian Chin
    Brian Chin
    2008-06-10

    A unified patch file for the big endian sound bug

     
    Attachments
  • c2woody
    c2woody
    2009-03-24

    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.

     
  • c2woody
    c2woody
    2009-06-07

    Please verify whether 0.73 is working fine now.