diff options
author | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-08-31 19:19:49 +0000 |
---|---|---|
committer | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-08-31 19:19:49 +0000 |
commit | 13cbade08a07296d92e7a7d3e20475de0032cba1 (patch) | |
tree | 731a1a4a99d86632a719ae49e3b3d2a12e764a3a /apps/codecs/libgme/nes_apu.c | |
parent | d089e104034fdf5562bea125d2cacf4ee486782a (diff) | |
download | rockbox-13cbade08a07296d92e7a7d3e20475de0032cba1.tar.gz rockbox-13cbade08a07296d92e7a7d3e20475de0032cba1.zip |
Update libgme to Blargg's Game_Music_Emu 0.6-pre.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30397 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libgme/nes_apu.c')
-rw-r--r-- | apps/codecs/libgme/nes_apu.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/apps/codecs/libgme/nes_apu.c b/apps/codecs/libgme/nes_apu.c index 7d2814b3d8..630e71f450 100644 --- a/apps/codecs/libgme/nes_apu.c +++ b/apps/codecs/libgme/nes_apu.c | |||
@@ -39,19 +39,19 @@ void Apu_init( struct Nes_Apu* this ) | |||
39 | this->oscs [4] = &this->dmc.osc; | 39 | this->oscs [4] = &this->dmc.osc; |
40 | 40 | ||
41 | Apu_output( this, NULL ); | 41 | Apu_output( this, NULL ); |
42 | this->dmc.nonlinear = false; | ||
42 | Apu_volume( this, (int)FP_ONE_VOLUME ); | 43 | Apu_volume( this, (int)FP_ONE_VOLUME ); |
43 | Apu_reset( this, false, 0 ); | 44 | Apu_reset( this, false, 0 ); |
44 | } | 45 | } |
45 | 46 | ||
46 | void Apu_enable_nonlinear( struct Nes_Apu* this, int v ) | 47 | void Apu_enable_nonlinear_( struct Nes_Apu* this, double sq, double tnd ) |
47 | { | 48 | { |
48 | this->dmc.nonlinear = true; | 49 | this->dmc.nonlinear = true; |
49 | Synth_volume( &this->square_synth, (int)((long long)(1.3 * 0.25751258 / 0.742467605 * 0.25 * FP_ONE_VOLUME) / amp_range * v) ); | 50 | Synth_volume( &this->square_synth, (int)((long long)(sq * FP_ONE_VOLUME) / amp_range) ); |
50 | 51 | ||
51 | const int tnd = (int)(0.48 / 202 * 0.75 * FP_ONE_VOLUME); | 52 | Synth_volume( &this->triangle.synth, tnd * 2.752 ); |
52 | Synth_volume( &this->triangle.synth, 3 * tnd ); | 53 | Synth_volume( &this->noise.synth , tnd * 1.849 ); |
53 | Synth_volume( &this->noise.synth, 2 * tnd ); | 54 | Synth_volume( &this->dmc.synth , tnd ); |
54 | Synth_volume( &this->dmc.synth, tnd ); | ||
55 | 55 | ||
56 | this->square1 .osc.last_amp = 0; | 56 | this->square1 .osc.last_amp = 0; |
57 | this->square2 .osc.last_amp = 0; | 57 | this->square2 .osc.last_amp = 0; |
@@ -62,11 +62,13 @@ void Apu_enable_nonlinear( struct Nes_Apu* this, int v ) | |||
62 | 62 | ||
63 | void Apu_volume( struct Nes_Apu* this, int v ) | 63 | void Apu_volume( struct Nes_Apu* this, int v ) |
64 | { | 64 | { |
65 | this->dmc.nonlinear = false; | 65 | if ( !this->dmc.nonlinear ) |
66 | Synth_volume( &this->square_synth, (int)((long long)(0.1128 *FP_ONE_VOLUME) * v / amp_range / FP_ONE_VOLUME) ); | 66 | { |
67 | Synth_volume( &this->triangle.synth,(int)((long long)(0.12765*FP_ONE_VOLUME) * v / amp_range / FP_ONE_VOLUME) ); | 67 | Synth_volume( &this->square_synth, (int)((long long)((0.125 * (1.0 /1.11)) * FP_ONE_VOLUME) * v / amp_range / FP_ONE_VOLUME) ); // was 0.1128 1.108 |
68 | Synth_volume( &this->noise.synth, (int)((long long)(0.0741 *FP_ONE_VOLUME) * v / amp_range / FP_ONE_VOLUME) ); | 68 | Synth_volume( &this->triangle.synth,(int)((long long)((0.150 * (1.0 /1.11)) * FP_ONE_VOLUME) * v / amp_range / FP_ONE_VOLUME) ); // was 0.12765 1.175 |
69 | Synth_volume( &this->dmc.synth, (int)((long long)(0.42545*FP_ONE_VOLUME) * v / 127 / FP_ONE_VOLUME) ); | 69 | Synth_volume( &this->noise.synth, (int)((long long)((0.095 * (1.0 /1.11)) * FP_ONE_VOLUME) * v / amp_range / FP_ONE_VOLUME) ); // was 0.0741 1.282 |
70 | Synth_volume( &this->dmc.synth, (int)((long long)((0.450 * (1.0 /1.11)) * FP_ONE_VOLUME) * v / 2048 / FP_ONE_VOLUME) ); // was 0.42545 1.058 | ||
71 | } | ||
70 | } | 72 | } |
71 | 73 | ||
72 | void Apu_output( struct Nes_Apu* this, struct Blip_Buffer* buffer ) | 74 | void Apu_output( struct Nes_Apu* this, struct Blip_Buffer* buffer ) |