src/audio/SDL_mixer_m68k.c
changeset 5536 05af1b9ff46d
parent 5535 96594ac5fd1a
child 5537 8a66741be632
     1.1 --- a/src/audio/SDL_mixer_m68k.c	Fri Apr 08 13:03:26 2011 -0700
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,140 +0,0 @@
     1.4 -/*
     1.5 -    SDL - Simple DirectMedia Layer
     1.6 -    Copyright (C) 1997-2011 Sam Lantinga
     1.7 -
     1.8 -    This library is free software; you can redistribute it and/or
     1.9 -    modify it under the terms of the GNU Lesser General Public
    1.10 -    License as published by the Free Software Foundation; either
    1.11 -    version 2.1 of the License, or (at your option) any later version.
    1.12 -
    1.13 -    This library is distributed in the hope that it will be useful,
    1.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 -    Lesser General Public License for more details.
    1.17 -
    1.18 -    You should have received a copy of the GNU Lesser General Public
    1.19 -    License along with this library; if not, write to the Free Software
    1.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    1.21 -
    1.22 -    Sam Lantinga
    1.23 -    slouken@libsdl.org
    1.24 -*/
    1.25 -#include "SDL_config.h"
    1.26 -
    1.27 -/*
    1.28 -	m68k assembly mix routines
    1.29 -
    1.30 -	Patrice Mandin
    1.31 -*/
    1.32 -
    1.33 -#if defined(__M68000__) && !defined(__mcoldfire__) && defined(__GNUC__)
    1.34 -void
    1.35 -SDL_MixAudio_m68k_U8(char *dst, char *src, long len, long volume, char *mix8)
    1.36 -{
    1.37 -    __asm__ __volatile__("tstl	%2\n" "	beqs	stoploop_u8\n" "mixloop_u8:\n"
    1.38 -                         /* Mix a sample */
    1.39 -                         "	moveq	#0,%%d0\n" "	moveq	#0,%%d1\n" "	moveb	%1@+,%%d0\n"    /* d0 = *src++ */
    1.40 -                         "	sub	#128,%%d0\n"    /* d0 -= 128 */
    1.41 -                         "	muls	%3,%%d0\n"      /* d0 *= volume (0<=volume<=128) */
    1.42 -                         "	moveb	%0@,%%d1\n"     /* d1 = *dst */
    1.43 -                         "	asr	#7,%%d0\n"      /* d0 /= 128 (SDL_MIX_MAXVOLUME) */
    1.44 -                         "	add	#128,%%d0\n"    /* d0 += 128 */
    1.45 -                         "	add	%%d1,%%d0\n"
    1.46 -                         "	moveb	%4@(%%d0:w),%0@+\n"
    1.47 -                         /* Loop till done */
    1.48 -                         "	subql	#1,%2\n" "	bhis	mixloop_u8\n" "stoploop_u8:\n": /* no return value */
    1.49 -                         :      /* input */
    1.50 -                         "a"(dst), "a"(src), "d"(len), "d"(volume), "a"(mix8):  /* clobbered registers */
    1.51 -                         "d0", "d1", "cc", "memory");
    1.52 -}
    1.53 -
    1.54 -void
    1.55 -SDL_MixAudio_m68k_S8(char *dst, char *src, long len, long volume)
    1.56 -{
    1.57 -    __asm__ __volatile__("tstl	%2\n"
    1.58 -                         "	beqs	stoploop_s8\n"
    1.59 -                         "	moveq	#-128,%%d2\n"
    1.60 -                         "	moveq	#127,%%d3\n" "mixloop_s8:\n"
    1.61 -                         /* Mix a sample */
    1.62 -                         "	moveq	#0,%%d0\n" "	moveq	#0,%%d1\n" "	moveb	%1@+,%%d0\n"    /* d0 = *src++ */
    1.63 -                         "	muls	%3,%%d0\n"      /* d0 *= volume (0<=volume<=128) */
    1.64 -                         "	moveb	%0@,%%d1\n"     /* d1 = *dst */
    1.65 -                         "	asr	#7,%%d0\n"      /* d0 /= 128 (SDL_MIX_MAXVOLUME) */
    1.66 -                         "	add	%%d1,%%d0\n"
    1.67 -                         "	cmp	%%d2,%%d0\n"
    1.68 -                         "	bges	lower_limit_s8\n"
    1.69 -                         "	move	%%d2,%%d0\n"
    1.70 -                         "lower_limit_s8:\n"
    1.71 -                         "	cmp	%%d3,%%d0\n"
    1.72 -                         "	bles	upper_limit_s8\n"
    1.73 -                         "	move	%%d3,%%d0\n"
    1.74 -                         "upper_limit_s8:\n" "	moveb	%%d0,%0@+\n"
    1.75 -                         /* Loop till done */
    1.76 -                         "	subql	#1,%2\n" "	bhis	mixloop_s8\n" "stoploop_s8:\n": /* no return value */
    1.77 -                         :      /* input */
    1.78 -                         "a"(dst), "a"(src), "d"(len), "d"(volume):     /* clobbered registers */
    1.79 -                         "d0", "d1", "d2", "d3", "cc", "memory");
    1.80 -}
    1.81 -
    1.82 -void
    1.83 -SDL_MixAudio_m68k_S16MSB(short *dst, short *src, long len, long volume)
    1.84 -{
    1.85 -    __asm__ __volatile__("tstl	%2\n"
    1.86 -                         "	beqs	stoploop_s16msb\n"
    1.87 -                         "	movel	#-32768,%%d2\n"
    1.88 -                         "	movel	#32767,%%d3\n"
    1.89 -                         "	lsrl	#1,%2\n" "mixloop_s16msb:\n"
    1.90 -                         /* Mix a sample */
    1.91 -                         "	move	%1@+,%%d0\n"    /* d0 = *src++ */
    1.92 -                         "	muls	%3,%%d0\n"      /* d0 *= volume (0<=volume<=128) */
    1.93 -                         "	move	%0@,%%d1\n"     /* d1 = *dst */
    1.94 -                         "	extl	%%d1\n" /* extend d1 to 32 bits */
    1.95 -                         "	asrl	#7,%%d0\n"      /* d0 /= 128 (SDL_MIX_MAXVOLUME) */
    1.96 -                         "	addl	%%d1,%%d0\n"
    1.97 -                         "	cmpl	%%d2,%%d0\n"
    1.98 -                         "	bges	lower_limit_s16msb\n"
    1.99 -                         "	move	%%d2,%%d0\n"
   1.100 -                         "lower_limit_s16msb:\n"
   1.101 -                         "	cmpl	%%d3,%%d0\n"
   1.102 -                         "	bles	upper_limit_s16msb\n"
   1.103 -                         "	move	%%d3,%%d0\n"
   1.104 -                         "upper_limit_s16msb:\n" "	move	%%d0,%0@+\n"
   1.105 -                         /* Loop till done */
   1.106 -                         "	subql	#1,%2\n" "	bhis	mixloop_s16msb\n" "stoploop_s16msb:\n": /* no return value */
   1.107 -                         :      /* input */
   1.108 -                         "a"(dst), "a"(src), "d"(len), "d"(volume):     /* clobbered registers */
   1.109 -                         "d0", "d1", "d2", "d3", "cc", "memory");
   1.110 -}
   1.111 -
   1.112 -void
   1.113 -SDL_MixAudio_m68k_S16LSB(short *dst, short *src, long len, long volume)
   1.114 -{
   1.115 -    __asm__ __volatile__("tstl	%2\n"
   1.116 -                         "	beqs	stoploop_s16lsb\n"
   1.117 -                         "	movel	#-32768,%%d2\n"
   1.118 -                         "	movel	#32767,%%d3\n"
   1.119 -                         "	lsrl	#1,%2\n" "mixloop_s16lsb:\n"
   1.120 -                         /* Mix a sample */
   1.121 -                         "	move	%1@+,%%d0\n"    /* d0 = *src++ */
   1.122 -                         "	rorw	#8,%%d0\n" "	muls	%3,%%d0\n"      /* d0 *= volume (0<=volume<=128) */
   1.123 -                         "	move	%0@,%%d1\n"     /* d1 = *dst */
   1.124 -                         "	rorw	#8,%%d1\n" "	extl	%%d1\n" /* extend d1 to 32 bits */
   1.125 -                         "	asrl	#7,%%d0\n"      /* d0 /= 128 (SDL_MIX_MAXVOLUME) */
   1.126 -                         "	addl	%%d1,%%d0\n"
   1.127 -                         "	cmpl	%%d2,%%d0\n"
   1.128 -                         "	bges	lower_limit_s16lsb\n"
   1.129 -                         "	move	%%d2,%%d0\n"
   1.130 -                         "lower_limit_s16lsb:\n"
   1.131 -                         "	cmpl	%%d3,%%d0\n"
   1.132 -                         "	bles	upper_limit_s16lsb\n"
   1.133 -                         "	move	%%d3,%%d0\n"
   1.134 -                         "upper_limit_s16lsb:\n"
   1.135 -                         "	rorw	#8,%%d0\n" "	move	%%d0,%0@+\n"
   1.136 -                         /* Loop till done */
   1.137 -                         "	subql	#1,%2\n" "	bhis	mixloop_s16lsb\n" "stoploop_s16lsb:\n": /* no return value */
   1.138 -                         :      /* input */
   1.139 -                         "a"(dst), "a"(src), "d"(len), "d"(volume):     /* clobbered registers */
   1.140 -                         "d0", "d1", "d2", "d3", "cc", "memory");
   1.141 -}
   1.142 -#endif
   1.143 -/* vi: set ts=4 sw=4 expandtab: */