void SoundFx::play() { _curPos = 0; _curOrder = 0; _ticks = 0; setInterruptFreqUnscaled(_delay); startPaula(); }
void Rjp1::startSong(int song) { if (song == 0 || song >= _vars.subsongsCount) { warning("Invalid subsong number %d, defaulting to 1", song); song = 1; } const uint8 *p = _vars.songData[2] + (song & 0x3F) * 4; for (int i = 0; i < 4; ++i) { uint8 seq = *p++; if (seq) { startSequence(i, seq); } } // "start" Paula audiostream startPaula(); }
bool Infogrames::load(Common::SeekableReadStream &dum) { int subSong = 0; int i; uint32 size; size = dum.size(); if (size < 20) return false; _data = new uint8[size]; dum.seek(0); dum.read(_data, size); Common::MemoryReadStream dataStr(_data, size); dataStr.seek(subSong * 2); dataStr.seek(dataStr.readUint16BE()); _subSong = _data + dataStr.pos(); if (_subSong > (_data + size)) return false; _speedCounter = dataStr.readUint16BE(); _speed = _speedCounter; _volSlideBlocks = _subSong + dataStr.readUint16BE(); _periodSlideBlocks = _subSong + dataStr.readUint16BE(); for (i = 0; i < 4; i++) { _chn[i].cmdBlockIndices = _subSong + dataStr.readUint16BE(); _chn[i].flags = 0x81; } _cmdBlocks = _data + dataStr.pos() + 2; if ((_volSlideBlocks > (_data + size)) || (_periodSlideBlocks > (_data + size)) || (_chn[0].cmdBlockIndices > (_data + size)) || (_chn[1].cmdBlockIndices > (_data + size)) || (_chn[2].cmdBlockIndices > (_data + size)) || (_chn[3].cmdBlockIndices > (_data + size)) || (_cmdBlocks > (_data + size))) return false; startPaula(); return true; }