Ticket #3441: mt-32.patch

File mt-32.patch, 2.7 KB (added by SF/tipabu, 17 years ago)

MT-32 Volume Patch

  • sound/softsynth/mt32/i386.cpp

    Common subdirectories: scummvm/sound/softsynth/mt32/.deps and scummvm-mt32-fix/sound/softsynth/mt32/.deps
    diff -Nu scummvm/sound/softsynth/mt32/i386.cpp scummvm-mt32-fix/sound/softsynth/mt32/i386.cpp
    old new  
    227227        return output;
    228228}
    229229
    230 static inline void atti386_produceOutput1(int tmplen, Bit16s myvolume, Bit16s *useBuf, Bit16s *snd) {
     230static inline void atti386_produceOutput1(int tmplen, Bit16u myvolume, Bit16s *useBuf, Bit16s *snd) {
    231231        __asm__ __volatile__(
    232232                "movl %0,  %%ecx      \n" \
    233233                "movw %1,  %%ax       \n" \
     
    804804        return tmplen << 2;
    805805}
    806806
    807 int i386_produceOutput1(Bit16s *useBuf, Bit16s *stream, Bit32u len, Bit16s volume) {
     807int i386_produceOutput1(Bit16s *useBuf, Bit16s *stream, Bit32u len, Bit16u volume) {
    808808        int tmplen = (len >> 1);
    809809        if (tmplen == 0) {
    810810                return 0;
  • sound/softsynth/mt32/i386.h

    diff -Nu scummvm/sound/softsynth/mt32/i386.h scummvm-mt32-fix/sound/softsynth/mt32/i386.h
    old new  
    3939int i386_mixBuffers(Bit16s * buf1, Bit16s *buf2, int len);
    4040int i386_mixBuffersRingMix(Bit16s * buf1, Bit16s *buf2, int len);
    4141int i386_mixBuffersRing(Bit16s * buf1, Bit16s *buf2, int len);
    42 int i386_produceOutput1(Bit16s *useBuf, Bit16s *stream, Bit32u len, Bit16s volume);
     42int i386_produceOutput1(Bit16s *useBuf, Bit16s *stream, Bit32u len, Bit16u volume);
    4343#endif
    4444
    4545#endif
  • sound/softsynth/mt32/synth.cpp

    diff -Nu scummvm/sound/softsynth/mt32/synth.cpp scummvm-mt32-fix/sound/softsynth/mt32/synth.cpp
    old new  
    10401040        rset = mt32ram.system.chanAssign;
    10411041        printDebug(" Part assign:     1=%02d 2=%02d 3=%02d 4=%02d 5=%02d 6=%02d 7=%02d 8=%02d Rhythm=%02d", rset[0], rset[1], rset[2], rset[3], rset[4], rset[5], rset[6], rset[7], rset[8]);
    10421042        printDebug(" Master volume: %d", mt32ram.system.masterVol);
    1043         masterVolume = (Bit16u)(mt32ram.system.masterVol * 32767 / 100);
     1043        masterVolume = (Bit16u)(mt32ram.system.masterVol * 65535 / 100);
    10441044        if (!tables.init(this, pcmWaves, (float)myProp.sampleRate, masterTune)) {
    10451045                report(ReportType_errorSampleRate, NULL);
    10461046                return false;
     
    11031103        return 0;
    11041104}
    11051105
    1106 void ProduceOutput1(Bit16s *useBuf, Bit16s *stream, Bit32u len, Bit16s volume) {
     1106void ProduceOutput1(Bit16s *useBuf, Bit16s *stream, Bit32u len, Bit16u volume) {
    11071107#if MT32EMU_USE_MMX > 2
    11081108        //FIXME:KG: This appears to introduce crackle
    11091109        int donelen = i386_produceOutput1(useBuf, stream, len, volume);