summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKermalis <29823718+Kermalis@users.noreply.github.com>2018-09-29 15:57:39 -0400
committerKermalis <29823718+Kermalis@users.noreply.github.com>2018-09-29 15:57:39 -0400
commit8d551517f6d4484b772fa61a10931a12b97d1d92 (patch)
tree694d8b783e76b76f32498d2fe6a174ed9f9c8cd7
parenta300a9799c01e98182f4c972e64f0ff0669c1866 (diff)
parent6a82bbe973740afa871a488022550711ff37de12 (diff)
Merge branch 'master' of https://github.com/pret/pokeemerald
-rw-r--r--tools/mid2agb/midi.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/tools/mid2agb/midi.cpp b/tools/mid2agb/midi.cpp
index e506fcb09..93600d30e 100644
--- a/tools/mid2agb/midi.cpp
+++ b/tools/mid2agb/midi.cpp
@@ -776,18 +776,12 @@ void CalculateWaits(std::vector<Event>& events)
int CalculateCompressionScore(std::vector<Event>& events, int index)
{
int score = 0;
- std::uint8_t lastParam1 = (std::uint8_t)events[index].type;
+ std::uint8_t lastParam1 = events[index].param1;
std::uint8_t lastVelocity = 0x80u;
EventType lastType = events[index].type;
std::int32_t lastDuration = 0x80000000;
std::uint8_t lastNote = 0x40u;
- if (events[index].type == EventType::Note)
- {
- // Bug reintroduction
- lastParam1 = events[index].note + 0x40;
- }
-
if (events[index].time > 0)
score++;
@@ -846,18 +840,11 @@ int CalculateCompressionScore(std::vector<Event>& events, int index)
}
}
- // BUG: uses type instead of param1
- lastParam1 = (std::uint8_t)events[i].type;
- if (events[i].type == EventType::Note)
- {
- // Bug reintroduction
- lastParam1 = events[i].note + 0x40;
- }
-
+ lastParam1 = events[i].param1;
lastType = events[i].type;
if (events[i].time)
- ++score;
+ score++;
}
return score;