aboutsummaryrefslogtreecommitdiff
path: root/sound/mods/tfmx.h
diff options
context:
space:
mode:
authorNorbert Lange2009-06-25 08:57:15 +0000
committerNorbert Lange2009-06-25 08:57:15 +0000
commit01c3db4d76d079d81dff1aba1afbace94c877b6c (patch)
treed1beefaa0c0621d8f04690542d53c78830be5c3c /sound/mods/tfmx.h
parentc6ba5279b1c144ee44a1f65a962baa46aa0f4803 (diff)
downloadscummvm-rg350-01c3db4d76d079d81dff1aba1afbace94c877b6c.tar.gz
scummvm-rg350-01c3db4d76d079d81dff1aba1afbace94c877b6c.tar.bz2
scummvm-rg350-01c3db4d76d079d81dff1aba1afbace94c877b6c.zip
Fixed restarting of song (hopefully thouroughly)
replaced all modulos with masks swapped Paulas stereo output svn-id: r41856
Diffstat (limited to 'sound/mods/tfmx.h')
-rw-r--r--sound/mods/tfmx.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/sound/mods/tfmx.h b/sound/mods/tfmx.h
index 91ea408834..36e4151ce9 100644
--- a/sound/mods/tfmx.h
+++ b/sound/mods/tfmx.h
@@ -48,12 +48,12 @@ public:
void interrupt();
void stopSong(bool stopAudio = true);
void doSong(int songPos, bool stopAudio = false);
- int doSfx(int sfxIndex, bool unlockChannel = false);
+ int doSfx(uint16 sfxIndex, bool unlockChannel = false);
void doMacro(int note, int macro, int relVol = 0, int finetune = 0, int channelNo = 0);
bool load(Common::SeekableReadStream &musicData, Common::SeekableReadStream &sampleData);
- int getTicks() {return _playerCtx.tickCount;}
- int getSongIndex() {return _playerCtx.song;}
- uint16 getSignal(int index) {return (index < ARRAYSIZE(_playerCtx.signal)) ? _playerCtx.signal[index] : 0xFFFF;}
+ int getTicks() const {return _playerCtx.tickCount;}
+ int getSongIndex() const {return _playerCtx.song;}
+ void setSignalPtr(uint16 *ptr) {_playerCtx.signal = ptr;}
void stopMacroEffect(int channel) {
assert(0 <= channel && channel < kNumVoices);
Common::StackLock lock(_mutex);
@@ -84,7 +84,7 @@ public:
uint32 headerUnknown;
char textField[6 * 40];
- const byte *getSfxPtr(uint8 index = 0) {
+ const byte *getSfxPtr(uint16 index = 0) {
byte *sfxPtr = (byte *)(_mdatData + _sfxTableOffset + index * 8);
boundaryCheck(_mdatData, _mdatLen, sfxPtr, 8);
@@ -223,11 +223,11 @@ public:
int tickCount;
- uint16 signal[4];
+ uint16 *signal;
bool stopWithLastPattern; //!< hack to automatically stop the whole player if no Pattern is running
} _playerCtx;
-
+private:
static void initMacroProgramm(ChannelContext &channel) {
channel.macroStep = 0;
channel.macroWait = 0;
@@ -271,20 +271,18 @@ public:
}
}
- void setNoteMacro(ChannelContext &channel, uint note, int fineTune) {
+ static void setNoteMacro(ChannelContext &channel, uint note, int fineTune) {
const uint16 noteInt = noteIntervalls[note & 0x3F];
const uint16 finetune = (uint16)(fineTune + channel.fineTune + (1 << 8));
channel.refPeriod = ((uint32)noteInt * finetune >> 8);
- if (!channel.portaDelta) {
+ if (!channel.portaDelta)
channel.period = channel.refPeriod;
- //Paula::setChannelPeriod(channel.paulaChannel, channel.period);
- }
}
void effects(ChannelContext &channel);
- FORCEINLINE bool macroStep(ChannelContext &channel);
+ inline bool macroStep(ChannelContext &channel);
void advancePatterns();
- FORCEINLINE bool patternStep(PatternContext &pattern, bool &pendingTrackstep);
+ inline bool patternStep(PatternContext &pattern, bool &pendingTrackstep);
bool trackStep();
void noteCommand(uint8 note, uint8 param1, uint8 param2, uint8 param3);
};