aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorNorbert Lange2009-07-09 16:18:35 +0000
committerNorbert Lange2009-07-09 16:18:35 +0000
commitc16d276f993c643f82c27ae3d6f0bf81a1d8fe34 (patch)
tree974cc9bfbaf9203872317e7d77046b9f6c51d3db /sound
parent84e96bc513f1e17709312fb74d4faa46c6a741ca (diff)
downloadscummvm-rg350-c16d276f993c643f82c27ae3d6f0bf81a1d8fe34.tar.gz
scummvm-rg350-c16d276f993c643f82c27ae3d6f0bf81a1d8fe34.tar.bz2
scummvm-rg350-c16d276f993c643f82c27ae3d6f0bf81a1d8fe34.zip
fixed some mismatched new[]/delete
fixed 2 bugs in the calcnote function svn-id: r42304
Diffstat (limited to 'sound')
-rw-r--r--sound/mods/maxtrax.cpp12
1 files 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;