|
34 | 34 | #include "cart.h" |
35 | 35 | #include "nsf.h" |
36 | 36 | #include "apu.h" |
| 37 | +#include "driver.h" |
37 | 38 |
|
38 | 39 | static uint32 square_mix_table[32]; /* square channel mix table */ |
39 | 40 | static uint32 tnd_mix_table[203]; /* triangle/noise/dmc channel mix table */ |
@@ -880,7 +881,7 @@ static void RDoTriangle(void) { |
880 | 881 | triout = GetOutput(SND_TRIANGLE, TriangleOutput()); |
881 | 882 | triout = (triout << TRINPCM_SHIFT) & (~0xFFFF); |
882 | 883 |
|
883 | | - if ((triangle.length.counter == 0) || (triangle.linearCounter == 0) || triangle.timer.period <= 4) { |
| 884 | + if ((triangle.length.counter == 0) || (triangle.linearCounter == 0) || (FSettings.RemoveTriangleNoise && (triangle.timer.period <= 4))) { |
884 | 885 | /* Counter is halted, but we still need to output. */ |
885 | 886 | for (V = triangle.timer.cvbc; V < SOUNDTS; V++) { |
886 | 887 | WaveHi[V] += triout; |
@@ -926,7 +927,7 @@ static void RDoTriangleNoisePCMLQ(void) { |
926 | 927 |
|
927 | 928 | /* setup triangle params */ |
928 | 929 | freq[0] = (triangle.timer.period + 1) << 17; |
929 | | - if ((triangle.length.counter == 0) || (triangle.linearCounter == 0) || (triangle.timer.period <= 4)) { |
| 930 | + if ((triangle.length.counter == 0) || (triangle.linearCounter == 0) || (FSettings.RemoveTriangleNoise && (triangle.timer.period <= 4))) { |
930 | 931 | inie[0] = 0; |
931 | 932 | } |
932 | 933 |
|
@@ -1248,11 +1249,15 @@ void FCEUI_SetSoundQuality(int quality) { |
1248 | 1249 | } |
1249 | 1250 |
|
1250 | 1251 | void FCEUI_ReduceDmcPopping(int d) { |
1251 | | - FSettings.ReduceDMCPopping = d; |
| 1252 | + FSettings.ReduceDMCPopping = d ? TRUE : FALSE; |
1252 | 1253 | } |
1253 | 1254 |
|
1254 | 1255 | void FCEUI_ReverseDMCBitOrder(int d) { |
1255 | | - FSettings.ReverseDMCBitOrder = d; |
| 1256 | + FSettings.ReverseDMCBitOrder = d ? TRUE : FALSE; |
| 1257 | +} |
| 1258 | + |
| 1259 | +void FCEUI_RemoveTringleNoise(int d) { |
| 1260 | + FSettings.RemoveTriangleNoise = d ? TRUE : FALSE; |
1256 | 1261 | } |
1257 | 1262 |
|
1258 | 1263 | void FCEUI_SetSoundVolume(int channel, int volume) { |
|
0 commit comments