notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(Vita) Disable debug
[pcsx_rearmed.git]
/
plugins
/
dfsound
/
adsr.c
diff --git
a/plugins/dfsound/adsr.c
b/plugins/dfsound/adsr.c
index
69e55bd
..
9e32862
100644
(file)
--- a/
plugins/dfsound/adsr.c
+++ b/
plugins/dfsound/adsr.c
@@
-221,6
+221,7
@@
static int SkipADSR(ADSRInfoEx *adsr, int ns_to)
{
\r
int EnvelopeVol = adsr->EnvelopeVol;
\r
int ns = 0, val, rto, level;
\r
{
\r
int EnvelopeVol = adsr->EnvelopeVol;
\r
int ns = 0, val, rto, level;
\r
+ int64_t v64;
\r
\r
if (adsr->State == ADSR_RELEASE)
\r
{
\r
\r
if (adsr->State == ADSR_RELEASE)
\r
{
\r
@@
-236,8
+237,10
@@
static int SkipADSR(ADSRInfoEx *adsr, int ns_to)
}
\r
else
\r
{
\r
}
\r
else
\r
{
\r
- EnvelopeVol += val * ns_to;
\r
- if (EnvelopeVol > 0)
\r
+ v64 = EnvelopeVol;
\r
+ v64 += (int64_t)val * ns_to;
\r
+ EnvelopeVol = (int)v64;
\r
+ if (v64 > 0)
\r
ns = ns_to;
\r
}
\r
goto done;
\r
ns = ns_to;
\r
}
\r
goto done;
\r
@@
-293,24
+296,21
@@
static int SkipADSR(ADSRInfoEx *adsr, int ns_to)
case ADSR_SUSTAIN: // -> sustain
\r
if (adsr->SustainIncrease)
\r
{
\r
case ADSR_SUSTAIN: // -> sustain
\r
if (adsr->SustainIncrease)
\r
{
\r
+ ns = ns_to;
\r
+
\r
if (EnvelopeVol >= 0x7fff0000)
\r
if (EnvelopeVol >= 0x7fff0000)
\r
- {
\r
- ns = ns_to;
\r
break;
\r
break;
\r
- }
\r
\r
rto = 0;
\r
if (adsr->SustainModeExp && EnvelopeVol >= 0x60000000)
\r
rto = 8;
\r
val = RateTableAdd[adsr->SustainRate + rto];
\r
\r
\r
rto = 0;
\r
if (adsr->SustainModeExp && EnvelopeVol >= 0x60000000)
\r
rto = 8;
\r
val = RateTableAdd[adsr->SustainRate + rto];
\r
\r
- EnvelopeVol += val * (ns_to - ns);
\r
- if ((unsigned int)EnvelopeVol >= 0x7fe00000)
\r
- {
\r
+ v64 = EnvelopeVol;
\r
+ v64 += (int64_t)val * (ns_to - ns);
\r
+ EnvelopeVol = (int)v64;
\r
+ if (v64 >= 0x7fe00000ll)
\r
EnvelopeVol = 0x7fffffff;
\r
EnvelopeVol = 0x7fffffff;
\r
- ns = ns_to;
\r
- break;
\r
- }
\r
}
\r
else
\r
{
\r
}
\r
else
\r
{
\r
@@
-326,8
+326,10
@@
static int SkipADSR(ADSRInfoEx *adsr, int ns_to)
}
\r
else
\r
{
\r
}
\r
else
\r
{
\r
- EnvelopeVol += val * (ns_to - ns);
\r
- if (EnvelopeVol > 0)
\r
+ v64 = EnvelopeVol;
\r
+ v64 += (int64_t)val * (ns_to - ns);
\r
+ EnvelopeVol = (int)v64;
\r
+ if (v64 > 0)
\r
{
\r
ns = ns_to;
\r
break;
\r
{
\r
ns = ns_to;
\r
break;
\r