summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Everton <dan@iocaine.org>2007-10-13 23:18:30 +0000
committerDan Everton <dan@iocaine.org>2007-10-13 23:18:30 +0000
commita537114d0298b20e83209af6c252129ef841cf8a (patch)
tree3597061853c37fea667ea6ed41beb1d24d377375
parent003a4a11c4f4a9d8c4e16a29665064ebbb365e34 (diff)
downloadrockbox-a537114d0298b20e83209af6c252129ef841cf8a.tar.gz
rockbox-a537114d0298b20e83209af6c252129ef841cf8a.tar.bz2
rockbox-a537114d0298b20e83209af6c252129ef841cf8a.zip
Fix broken sims by defining default volume min and max.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15101 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/sound.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/firmware/sound.c b/firmware/sound.c
index 701b008fc3..fc1b6e025c 100644
--- a/firmware/sound.c
+++ b/firmware/sound.c
@@ -35,6 +35,17 @@
#endif
#endif
+#if CONFIG_CODEC == MAS3507D /* volume/balance/treble/bass interdependency */
+#define VOLUME_MIN -780
+#define VOLUME_MAX 180
+#else
+#define VOLUME_MIN -400
+#define VOLUME_MAX 600
+#endif
+
+/* volume/balance/treble/bass interdependency main part */
+#define VOLUME_RANGE (VOLUME_MAX - VOLUME_MIN)
+
#ifndef SIMULATOR
extern bool audio_is_initialized;
@@ -179,8 +190,6 @@ void sound_set_dsp_callback(int (*func)(int, intptr_t))
#ifndef SIMULATOR
#if CONFIG_CODEC == MAS3507D /* volume/balance/treble/bass interdependency */
-#define VOLUME_MIN -780
-#define VOLUME_MAX 180
static const unsigned int bass_table[] =
{
@@ -286,8 +295,6 @@ static int tenthdb2reg(int db)
|| defined HAVE_WM8975 || defined HAVE_WM8758 || defined(HAVE_WM8731) \
|| defined(HAVE_WM8721) || defined(HAVE_TLV320) || defined(HAVE_WM8751) \
|| defined(HAVE_AS3514)
- /* volume/balance/treble/bass interdependency main part */
-#define VOLUME_RANGE (VOLUME_MAX - VOLUME_MIN)
/* all values in tenth of dB MAS3507D UDA1380 */
int current_volume = 0; /* -780..+180 -840.. 0 */
@@ -667,7 +674,7 @@ int sim_volume;
void sound_set_volume(int value)
{
/* 128 is SDL_MIX_MAXVOLUME */
- sim_volume = 128 * (value - VOLUME_MIN / 10) / ((VOLUME_MAX - VOLUME_MIN) / 10);
+ sim_volume = 128 * (value - VOLUME_MIN / 10) / (VOLUME_RANGE / 10);
}
void sound_set_balance(int value)