mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-24 13:11:33 +00:00
- Fixed a copy-and-paste error in win32/i_main.cpp for 64-bit mode.
- Tweaked OPL centering a little. SVN r950 (trunk)
This commit is contained in:
parent
de85314234
commit
8040cdd4ff
3 changed files with 21 additions and 10 deletions
|
@ -1,3 +1,7 @@
|
|||
April 29, 2008
|
||||
- Fixed a copy-and-paste error in win32/i_main.cpp for 64-bit mode.
|
||||
- Tweaked OPL centering a little.
|
||||
|
||||
April 28, 2008
|
||||
- Added dynamic recentering for the OPL synth. The chip has four basic
|
||||
waveforms, and three of them are non-negative. This can cause a tendency
|
||||
|
|
|
@ -270,7 +270,7 @@ void OPLmusicBlock::OffsetSamples(float *buff, int count)
|
|||
// data back to around the [-1.0, 1.0] range.
|
||||
|
||||
double max = -1e10, min = 1e10, offset, step;
|
||||
int i, ramp;
|
||||
int i, ramp, largest_at = 0;
|
||||
|
||||
// Find max and min values for this segment of the waveform.
|
||||
for (i = 0; i < count; ++i)
|
||||
|
@ -278,19 +278,18 @@ void OPLmusicBlock::OffsetSamples(float *buff, int count)
|
|||
if (buff[i] > max)
|
||||
{
|
||||
max = buff[i];
|
||||
largest_at = i;
|
||||
}
|
||||
if (buff[i] < min)
|
||||
{
|
||||
min = buff[i];
|
||||
largest_at = i;
|
||||
}
|
||||
}
|
||||
// Don't slide if we don't have to, because doing so introduces noise.
|
||||
// However, if the amplitude is low, we do want to slide so that when
|
||||
// the song ends, the wave will be around 0 and not click when the song
|
||||
// starts over.
|
||||
if (min - LastOffset > -0.5 && max - LastOffset < 0.5 && max - min > 0.5)
|
||||
// Prefer to keep the offset at 0, even if it means a little clipping.
|
||||
if (LastOffset == 0 && min >= -1.1 && max <= 1.1)
|
||||
{
|
||||
offset = LastOffset;
|
||||
offset = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -305,8 +304,16 @@ void OPLmusicBlock::OffsetSamples(float *buff, int count)
|
|||
// Ramp the offset change so there aren't any abrupt clicks in the output.
|
||||
// If the ramp is too short, it can sound scratchy. cblood2.mid is
|
||||
// particularly unforgiving of short ramps.
|
||||
ramp = MIN(512, count);
|
||||
if (count >= 512)
|
||||
{
|
||||
ramp = 512;
|
||||
step = (offset - LastOffset) / 512;
|
||||
}
|
||||
else
|
||||
{
|
||||
ramp = MIN(count, MAX(196, largest_at));
|
||||
step = (offset - LastOffset) / ramp;
|
||||
}
|
||||
offset = LastOffset;
|
||||
i = 0;
|
||||
if (step != 0)
|
||||
|
|
|
@ -1111,7 +1111,7 @@ LONG WINAPI CatchAllExceptions (LPEXCEPTION_POINTERS info)
|
|||
#ifndef _M_X64
|
||||
info->ContextRecord->Eip = (DWORD_PTR)SleepForever;
|
||||
#else
|
||||
info->ContextRecord->Rip = (DWORD_PTR)ExitFatally;
|
||||
info->ContextRecord->Rip = (DWORD_PTR)SleepForever;
|
||||
#endif
|
||||
QueueUserAPC (ExitFatally, MainThread, 0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue