diff options
Diffstat (limited to 'sound/mods')
-rw-r--r-- | sound/mods/tfmx.cpp | 30 | ||||
-rw-r--r-- | sound/mods/tfmx.h | 50 |
2 files changed, 40 insertions, 40 deletions
diff --git a/sound/mods/tfmx.cpp b/sound/mods/tfmx.cpp index c3d7288990..b0761efa62 100644 --- a/sound/mods/tfmx.cpp +++ b/sound/mods/tfmx.cpp @@ -787,8 +787,8 @@ void Tfmx::noteCommand(const uint8 note, const uint8 param1, const uint8 param2, bool Tfmx::load(Common::SeekableReadStream &musicData, Common::SeekableReadStream &sampleData) { bool res; - assert(0 == _resource._mdatData); - assert(0 == _resource._sampleData); + assert(0 == _resource.mdatData); + assert(0 == _resource.sampleData); // TODO: Sanity checks if we have a valid TFMX-Module // TODO: check for Stream-Errors (other than using asserts) @@ -825,7 +825,7 @@ bool Tfmx::load(Common::SeekableReadStream &musicData, Common::SeekableReadStrea uint32 offTrackstep = musicData.readUint32BE(); uint32 offPatternP = musicData.readUint32BE(); uint32 offMacroP = musicData.readUint32BE(); - _resource._sfxTableOffset = 0x200; + _resource.sfxTableOffset = 0x200; bool getSfxIndex = false; // This is how MI`s TFMX-Player tests for unpacked Modules. @@ -834,10 +834,10 @@ bool Tfmx::load(Common::SeekableReadStream &musicData, Common::SeekableReadStrea offPatternP = 0x200 + 0x200; offMacroP = 0x400 + 0x200; getSfxIndex = true; - _resource._sfxTableOffset = 0x5FC; + _resource.sfxTableOffset = 0x5FC; } - _resource._trackstepOffset = offTrackstep; + _resource.trackstepOffset = offTrackstep; // Read in pattern starting offsets musicData.seek(offPatternP); @@ -848,7 +848,7 @@ bool Tfmx::load(Common::SeekableReadStream &musicData, Common::SeekableReadStrea assert(!res); if (getSfxIndex) - _resource._sfxTableOffset = _patternOffset[127]; + _resource.sfxTableOffset = _patternOffset[127]; // Read in macro starting offsets musicData.seek(offMacroP); @@ -863,11 +863,11 @@ bool Tfmx::load(Common::SeekableReadStream &musicData, Common::SeekableReadStrea assert(size != -1); // TODO: special routine if size = -1? - _resource._mdatData = new byte[size]; - assert(_resource._mdatData); - _resource._mdatLen = size; + _resource.mdatData = new byte[size]; + assert(_resource.mdatData); + _resource.mdatLen = size; musicData.seek(0); - musicData.read(_resource._mdatData, size); + musicData.read(_resource.mdatData, size); res = musicData.err(); assert(!res); @@ -888,13 +888,13 @@ bool Tfmx::load(Common::SeekableReadStream &musicData, Common::SeekableReadStrea assert(size != -1); // TODO: special routine if size = -1? - _resource._sampleData = new byte[size]; - assert(_resource._sampleData); - _resource._sampleLen = size; + _resource.sampleData = new byte[size]; + assert(_resource.sampleData); + _resource.sampleLen = size; sampleData.seek(0); - sampleData.read(_resource._sampleData, size); + sampleData.read(_resource.sampleData, size); for (int i = 0; i < 4; ++i) - _resource._sampleData[i] = 0; + _resource.sampleData[i] = 0; res = sampleData.err(); assert(!res); diff --git a/sound/mods/tfmx.h b/sound/mods/tfmx.h index fccdf0aa01..e06be89759 100644 --- a/sound/mods/tfmx.h +++ b/sound/mods/tfmx.h @@ -51,9 +51,9 @@ public: 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() const {return _playerCtx.tickCount;} - int getSongIndex() const {return _playerCtx.song;} - void setSignalPtr(uint16 *ptr) {_playerCtx.signal = ptr;} + 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); @@ -64,20 +64,20 @@ public: // Note: everythings public so the debug-Routines work. // private: - enum {kPalDefaultCiaVal = 11822, kNtscDefaultCiaVal = 14320, kCiaBaseInterval = 0x1B51F8}; - enum {kNumVoices = 4, kNumChannels = 8, kNumSubsongs = 32, kMaxPatternOffsets = 128, kMaxMacroOffsets = 128}; + enum { kPalDefaultCiaVal = 11822, kNtscDefaultCiaVal = 14320, kCiaBaseInterval = 0x1B51F8 }; + enum { kNumVoices = 4, kNumChannels = 8, kNumSubsongs = 32, kMaxPatternOffsets = 128, kMaxMacroOffsets = 128 }; static const uint16 noteIntervalls[64]; struct Resource { - uint32 _trackstepOffset; //!< Offset in mdat - uint32 _sfxTableOffset; + uint32 trackstepOffset; //!< Offset in mdat + uint32 sfxTableOffset; - byte *_mdatData; //!< Currently the whole mdat-File - byte *_sampleData; //!< Currently the whole sample-File + byte *mdatData; //!< Currently the whole mdat-File + byte *sampleData; //!< Currently the whole sample-File - uint32 _mdatLen; - uint32 _sampleLen; + uint32 mdatLen; + uint32 sampleLen; byte header[10]; uint16 headerFlags; @@ -85,44 +85,44 @@ public: char textField[6 * 40]; const byte *getSfxPtr(uint16 index = 0) { - byte *sfxPtr = (byte *)(_mdatData + _sfxTableOffset + index * 8); + byte *sfxPtr = (byte *)(mdatData + sfxTableOffset + index * 8); - boundaryCheck(_mdatData, _mdatLen, sfxPtr, 8); + boundaryCheck(mdatData, mdatLen, sfxPtr, 8); return sfxPtr; } const uint16 *getTrackPtr(uint16 trackstep = 0) { - uint16 *trackData = (uint16 *)(_mdatData + _trackstepOffset + 16 * trackstep); + uint16 *trackData = (uint16 *)(mdatData + trackstepOffset + 16 * trackstep); - boundaryCheck(_mdatData, _mdatLen, trackData, 16); + boundaryCheck(mdatData, mdatLen, trackData, 16); return trackData; } const uint32 *getPatternPtr(uint32 offset) { - uint32 *pattData = (uint32 *)(_mdatData + offset); + uint32 *pattData = (uint32 *)(mdatData + offset); - boundaryCheck(_mdatData, _mdatLen, pattData, 4); + boundaryCheck(mdatData, mdatLen, pattData, 4); return pattData; } const uint32 *getMacroPtr(uint32 offset) { - uint32 *macroData = (uint32 *)(_mdatData + offset); + uint32 *macroData = (uint32 *)(mdatData + offset); - boundaryCheck(_mdatData, _mdatLen, macroData, 4); + boundaryCheck(mdatData, mdatLen, macroData, 4); return macroData; } const int8 *getSamplePtr(const uint32 offset) { - int8 *sampleData = (int8 *)(_sampleData + offset); + int8 *sample = (int8 *)(sampleData + offset); - boundaryCheck(_sampleData, _sampleLen, sampleData, 2); - return sampleData; + boundaryCheck(sampleData, sampleLen, sample, 2); + return sample; } - Resource() : _mdatData(), _mdatLen(), _sampleData(), _sampleLen() {} + Resource() : mdatData(), mdatLen(), sampleData(), sampleLen() {} ~Resource() { - delete[] _mdatData; - delete[] _sampleData; + delete[] mdatData; + delete[] sampleData; } } _resource; |