aboutsummaryrefslogtreecommitdiff
path: root/sound/mods
diff options
context:
space:
mode:
Diffstat (limited to 'sound/mods')
-rw-r--r--sound/mods/maxtrax.cpp13
-rw-r--r--sound/mods/maxtrax.h3
2 files changed, 14 insertions, 2 deletions
diff --git a/sound/mods/maxtrax.cpp b/sound/mods/maxtrax.cpp
index 16631b09b0..5908314536 100644
--- a/sound/mods/maxtrax.cpp
+++ b/sound/mods/maxtrax.cpp
@@ -314,8 +314,7 @@ bool MaxTrax::doSong(int songIndex, int advance) {
_playerCtx.musicLoop = false;
setTempo(_playerCtx.tempoInitial << 4);
- _playerCtx.nextEvent = _scores[songIndex].events;
- _playerCtx.nextEventTime = _playerCtx.nextEvent->startTime;
+ _playerCtx.tempoTime = 0;
_playerCtx.scoreIndex = songIndex;
_playerCtx.ticks = 0;
@@ -324,6 +323,16 @@ bool MaxTrax::doSong(int songIndex, int advance) {
for (int i = 0; i < kNumChannels; ++i)
resetChannel(_channelCtx[i], (i & 1) != 0);
+ const Event *cev = _scores[songIndex].events;
+ // Songs are special markers in the score
+ for (; advance > 0; --advance) {
+ // TODO - check for boundaries
+ for(; cev->command != 0xFF && (cev->command != 0xA0 || (cev->stopTime >> 8) != 0x00); ++cev)
+ ;
+ }
+ _playerCtx.nextEvent = cev;
+ _playerCtx.nextEventTime = cev->startTime;
+
_playerCtx.musicPlaying = true;
Paula::startPaula();
return true;
diff --git a/sound/mods/maxtrax.h b/sound/mods/maxtrax.h
index cbc4a5b59f..9fef3e68f0 100644
--- a/sound/mods/maxtrax.h
+++ b/sound/mods/maxtrax.h
@@ -210,6 +210,9 @@ public:
void killVoice(byte num);
int playNote(byte note, byte patch, uint16 duration, uint16 volume, bool rightSide);
+ void setVolume(const byte volume) {
+ _playerCtx.volume = volume;
+ }
void setTempo(const uint16 tempo) {
_playerCtx.tickUnit = (int32)(((uint32)(tempo & 0xFFF0) << 8) / (uint16)(5 * _playerCtx.vBlankFreq));
}