summaryrefslogtreecommitdiff
path: root/firmware/mpeg.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/mpeg.c')
-rw-r--r--firmware/mpeg.c20
1 files changed, 20 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