aboutsummaryrefslogtreecommitdiff
path: root/sound/mods/maxtrax.h
diff options
context:
space:
mode:
authorNorbert Lange2009-07-17 01:42:58 +0000
committerNorbert Lange2009-07-17 01:42:58 +0000
commitc0c25d234e7e886462a3663a22b7c88b2e4229db (patch)
treeb665e03ef565035868c8ec223e5092a65665f05c /sound/mods/maxtrax.h
parent1fa1bdc9f650b272801aa2f960a79b6fc44f1bd5 (diff)
downloadscummvm-rg350-c0c25d234e7e886462a3663a22b7c88b2e4229db.tar.gz
scummvm-rg350-c0c25d234e7e886462a3663a22b7c88b2e4229db.tar.bz2
scummvm-rg350-c0c25d234e7e886462a3663a22b7c88b2e4229db.zip
precalculating some more from CalcNote
svn-id: r42556
Diffstat (limited to 'sound/mods/maxtrax.h')
-rw-r--r--sound/mods/maxtrax.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/sound/mods/maxtrax.h b/sound/mods/maxtrax.h
index 7c3f2c337b..cbc4a5b59f 100644
--- a/sound/mods/maxtrax.h
+++ b/sound/mods/maxtrax.h
@@ -152,7 +152,7 @@ public:
uint32 ticksLeft;
int32 portaTicks;
int32 incrVolume;
- int32 periodOffset;
+// int32 periodOffset;
/*ifne FASTSOUND
APTR voice_CurFastIOB ; current fast iob playing
APTR voice_NextFastIOB ; next fast iob to play
@@ -164,8 +164,9 @@ public:
uint16 lastPeriod;
byte baseNote;
byte endNote;
- byte number;
- byte link;
+ byte octave;
+// byte number;
+// byte link;
byte priority;
enum {
kStatusFree,
@@ -203,7 +204,7 @@ public:
static int8 pickvoice(const VoiceContext voice[4], uint pick, int16 pri);
int32 calcVolumeDelta(int32 delta, uint16 time);
- static uint16 calcNote(const VoiceContext &voice, int32 *offset = 0);
+ static uint16 calcNote(const VoiceContext &voice);
int8 noteOn(ChannelContext &channel, byte note, uint16 volume, uint16 pri);
void noteOff(VoiceContext &voice, byte note);
void killVoice(byte num);
@@ -213,8 +214,8 @@ public:
_playerCtx.tickUnit = (int32)(((uint32)(tempo & 0xFFF0) << 8) / (uint16)(5 * _playerCtx.vBlankFreq));
}
- static int32 precalcNote(byte baseNote, int16 tune) {
- return 0x9fd77 + 0x3C000 - ((baseNote << 14) + (tune << 11) / 3) / 3;
+ static int32 precalcNote(byte baseNote, int16 tune, byte octave) {
+ return 0x9fd77 + 0x3C000 + (1 << 16) - ((baseNote << 14) + (tune << 11) / 3) / 3 - (octave << 16);
}
static void outPutEvent(const Event &ev, int num = -1) {