From c16d276f993c643f82c27ae3d6f0bf81a1d8fe34 Mon Sep 17 00:00:00 2001 From: Norbert Lange Date: Thu, 9 Jul 2009 16:18:35 +0000 Subject: fixed some mismatched new[]/delete fixed 2 bugs in the calcnote function svn-id: r42304 --- sound/mods/maxtrax.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/mods/maxtrax.cpp b/sound/mods/maxtrax.cpp index 371fe952b5..517ee6d135 100644 --- a/sound/mods/maxtrax.cpp +++ b/sound/mods/maxtrax.cpp @@ -199,7 +199,7 @@ void MaxTrax::killVoice(byte num) { Paula::setChannelVolume(num, 0); } -int MaxTrax::calcNote(VoiceContext &voice) { +int MaxTrax::calcNote(VoiceContext &voice) { // 0x39e16 Winuae ChannelContext &channel = *voice.channel; voice.lastPeriod = 0; @@ -239,12 +239,12 @@ int MaxTrax::calcNote(VoiceContext &voice) { voice.periodOffset += 1 << 16; octave++; } + } else tone -= voice.periodOffset; - } - if (tone < PERIOD_LIMIT) + if (tone >= PERIOD_LIMIT) // we need to scale with log(2) voice.lastPeriod = (uint16)exp((float)tone * (float)(0.69314718055994530942 / 65536)); - + // 0x39EC8 jump -> 0x3a484 WinUAE return octave; } @@ -370,8 +370,8 @@ void MaxTrax::noteOff(ChannelContext &channel, const byte note) { void MaxTrax::freeScores() { if (_scores) { for (int i = 0; i < _numScores; ++i) - delete _scores[i].events; - delete _scores; + delete[] _scores[i].events; + delete[] _scores; _scores = 0; } _numScores = 0; -- cgit v1.2.3