summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/mpeg.c20
-rw-r--r--firmware/mpeg.h3
2 files changed, 23 insertions, 0 deletions
diff --git a/firmware/mpeg.c b/firmware/mpeg.c
index 365099129e..ca3ac69692 100644
--- a/firmware/mpeg.c
+++ b/firmware/mpeg.c
@@ -1787,6 +1787,26 @@ void mpeg_sound_channel_config(int configuration)
1787#endif 1787#endif
1788} 1788}
1789 1789
1790#ifdef HAVE_MAS3587F
1791/* This function works by telling the decoder that we have another
1792 crystal frequency than we actually have. It will adjust its internal
1793 parameters and the result is that the audio is played at another pitch */
1794void mpeg_set_pitch(int percent)
1795{
1796 unsigned long val;
1797
1798 /* Calculate the new (bogus) frequency */
1799 val = 18432 + (18432*percent/100);
1800
1801 mas_writemem(MAS_BANK_D0,0x7f3,&val,1);
1802
1803 /* We must tell the MAS that the frequency has changed.
1804 This will unfortunately cause a short silence. */
1805 val = 0x25;
1806 mas_writemem(MAS_BANK_D0,0x7f1,&val,1);
1807}
1808#endif
1809
1790void mpeg_init(int volume, int bass, int treble, int balance, int loudness, int bass_boost, int avc) 1810void mpeg_init(int volume, int bass, int treble, int balance, int loudness, int bass_boost, int avc)
1791{ 1811{
1792#ifdef SIMULATOR 1812#ifdef SIMULATOR
diff --git a/firmware/mpeg.h b/firmware/mpeg.h
index f1451227d0..f2a2b38c6c 100644
--- a/firmware/mpeg.h
+++ b/firmware/mpeg.h
@@ -41,6 +41,9 @@ char *mpeg_sound_unit(int setting);
41int mpeg_sound_numdecimals(int setting); 41int mpeg_sound_numdecimals(int setting);
42struct mp3entry* mpeg_current_track(void); 42struct mp3entry* mpeg_current_track(void);
43bool mpeg_has_changed_track(void); 43bool mpeg_has_changed_track(void);
44#ifdef HAVE_MAS3587F
45void mpeg_set_pitch(int percent);
46#endif
44 47
45#define SOUND_VOLUME 0 48#define SOUND_VOLUME 0
46#define SOUND_BASS 1 49#define SOUND_BASS 1