[patch] Volume multiplier bug in

The volume multiplier in SDL_MixAudio_MMX_S8() is formed from the wrong
register.
Patch:

Index: SDL_mixer_MMX.c===================================================================
RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/audio/SDL_mixer_MMX.c,v
retrieving revision 1.3
diff -u -p -r1.3 SDL_mixer_MMX.c
— SDL_mixer_MMX.c 2 Jan 2005 05:05:21 -0000 1.3
+++ SDL_mixer_MMX.c 19 Sep 2005 22:44:18 -0000
@@ -121,7 +121,7 @@ void SDL_MixAudio_MMX_S8(char* dst,char*

" movl %3,%%eax\n" // eax = volume

-" movd %%edx,%%mm0\n"
+" movd %%eax,%%mm0\n"
" movq %%mm0,%%mm1\n"
" psllq $16,%%mm0\n"
" por %%mm1,%%mm0\n"

The volume multiplier in SDL_MixAudio_MMX_S8() is formed from the wrong
register.

Good catch! This is in CVS now.

–ryan.

Evidently, the mechanically-converted MSVC version of the same code suffers
from the same problem (wrong register). Patch follows.

Index: SDL_mixer_MMX_VC.c===================================================================
RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/audio/SDL_mixer_MMX_VC.c,v
retrieving revision 1.3
diff -u -p -r1.3 SDL_mixer_MMX_VC.c
— SDL_mixer_MMX_VC.c 17 Apr 2005 10:27:00 -0000 1.3
+++ SDL_mixer_MMX_VC.c 27 Sep 2005 19:08:47 -0000
@@ -107,7 +107,7 @@ void SDL_MixAudio_MMX_S8_VC(char* dst,ch
mov esi, src //%1,%%esi // esi = src
mov eax, volume //%3,%%eax // eax =
volume

  •   movd	mm0, ebx	//%%ebx,%%mm0
    
  •   movd	mm0, eax	//%%eax,%%mm0
      movq	mm1, mm0	//%%mm0,%%mm1
      psllq	mm0, 16		//$16,%%mm0
      por		mm0, mm1	//%%mm1,%%mm0