Ticket #8852: kyra_mt32.patch
File kyra_mt32.patch, 18.5 KB (added by , 17 years ago) |
---|
-
engines/kyra/sound.cpp
152 152 _musicParser = _sfxParser = 0; 153 153 _isMusicPlaying = _isSfxPlaying = false; 154 154 _eventFromMusic = false; 155 _isLooping = false; 156 _nextSysEx = 0; 155 157 156 158 _nativeMT32 = _useC55 = false; 157 159 160 _midiFile = 0; 161 _sfxFile = 0; 162 158 163 memset(_channel, 0, sizeof(_channel)); 159 164 memset(_channelVolume, 50, sizeof(_channelVolume)); 160 165 _channelVolume[10] = 100; … … 169 174 SoundMidiPC::~SoundMidiPC() { 170 175 Common::StackLock lock(_mutex); 171 176 177 _driver->setTimerCallback(0, 0); 178 179 _musicParser->unloadMusic(); 180 _sfxParser->unloadMusic(); 181 _musicParser->setMidiDriver(0); 182 _sfxParser->setMidiDriver(0); 172 183 delete _musicParser; 173 184 delete _sfxParser; 185 delete [] _midiFile; 186 delete [] _sfxFile; 174 187 175 _driver->setTimerCallback(0, 0);176 188 close(); 177 189 } 178 190 … … 186 198 _musicParser->setMidiDriver(this); 187 199 _sfxParser->setMidiDriver(this); 188 200 201 if (!_nativeMT32) 202 return true; 203 204 Common::String soundFile; 205 Common::String pakFile; 206 if (_vm->game() == GI_KYRA1) { 207 soundFile = "INTRO"; 208 if (_vm->gameFlags().isTalkie) 209 pakFile = "XMI.PAK"; 210 } else if (_vm->game() == GI_KYRA2) { 211 soundFile = "HOF_SYX"; 212 pakFile = "AUDIO.PAK"; 213 } else { 214 return true; 215 } 216 217 const char * const files[] = { 218 soundFile.c_str(), 0 219 }; 220 221 AudioDataStruct data = { files, 1, 0, 0 }; 222 setSoundList(&data); 223 224 if (!pakFile.empty()) 225 _vm->resource()->loadPakFile(pakFile.c_str()); 226 227 // Kyrandia 2 got special file for SFX 228 if (_vm->game() == GI_KYRA2) { 229 Common::String file = "K2SFX."; 230 file += _useC55 ? "C55" : "XMI"; 231 232 uint32 size = 0; 233 _sfxFile = _vm->resource()->fileData(file.c_str(), &size); 234 if (_sfxParser->loadMusic(_sfxFile, size)) { 235 _sfxParser->setTimerRate(getBaseTempo()); 236 _sfxParser->setTempo(0); 237 _sfxParser->property(MidiParser::mpSmartJump, true); 238 } else { 239 warning("Error parsing sfx track '%s'", file.c_str()); 240 } 241 } 242 243 loadSoundFile(0); 244 playTrack(0); 245 246 if (!pakFile.empty()) 247 _vm->resource()->unloadPakFile(pakFile.c_str()); 248 249 while (_isMusicPlaying) 250 g_system->delayMillis(10); 251 252 setSoundList(0); 253 189 254 return true; 190 255 } 191 256 192 257 void SoundMidiPC::updateVolumeSettings() { 193 _musicVolume = ConfMan.getInt("music_volume");258 uint8 musicVolume = ConfMan.getInt("music_volume"); 194 259 _sfxVolume = ConfMan.getInt("sfx_volume"); 195 260 196 updateChannelVolume(_musicVolume); 261 if (musicVolume != _musicVolume) { 262 _musicVolume = musicVolume; 263 Common::StackLock lock(_mutex); 264 updateChannelVolume(_musicVolume); 265 } 197 266 } 198 267 199 268 void SoundMidiPC::hasNativeMT32(bool nativeMT32) { … … 249 318 if ((b & 0xFFF0) == 0x74B0 && _eventFromMusic) { 250 319 debugC(9, kDebugLevelMain | kDebugLevelSound, "SoundMidiPC: Looping song"); 251 320 _musicParser->property(MidiParser::mpAutoLoop, true); 321 _isLooping = true; 252 322 return; 253 323 } 254 324 … … 297 367 _channel[_virChannel[channel]]->send(b); 298 368 } 299 369 370 void SoundMidiPC::sysEx(const byte *msg, uint16 length) { 371 // Since Kyrandia doesn't have a long enough delay between some SysEx 372 // commands we have to manually add one to allow the MT-32 to process 373 // all data, elsewise we would get some overflow error from the MT-32 374 uint32 curTime = g_system->getMillis(); 375 if (_nextSysEx > curTime) 376 g_system->delayMillis(_nextSysEx - curTime); 377 _nextSysEx = curTime + 50; 378 379 _driver->sysEx(msg, length); 380 } 381 300 382 void SoundMidiPC::metaEvent(byte type, byte *data, uint16 length) { 301 383 switch (type) { 302 384 case 0x2F: // End of Track 303 385 if (_eventFromMusic) { 386 if (!_isLooping) 387 _isMusicPlaying = false; 388 304 389 // remap all channels 305 390 for (int i = 0; i < 16; ++i) 306 391 _virChannel[i] = i; … … 314 399 } 315 400 } 316 401 317 318 struct DeleterArray {319 void operator ()(byte *ptr) {320 delete [] ptr;321 }322 };323 324 402 void SoundMidiPC::loadSoundFile(uint file) { 325 403 Common::StackLock lock(_mutex); 326 404 … … 332 410 _isMusicPlaying = _isSfxPlaying = false; 333 411 _fadeStartTime = 0; 334 412 _fadeMusicOut = false; 413 _isLooping = false; 335 414 updateChannelVolume(_musicVolume); 336 415 _musicParser->setTempo(0); 337 416 _sfxParser->setTempo(0); 338 417 _musicParser->property(MidiParser::mpAutoLoop, false); 339 _sfxParser->property(MidiParser::mpAutoLoop, false);340 418 return; 341 419 } 342 420 … … 348 426 return; 349 427 } 350 428 429 _isMusicPlaying = _isSfxPlaying = false; 430 _fadeStartTime = 0; 431 _fadeMusicOut = false; 432 _isLooping = false; 433 _musicParser->setTimerRate(getBaseTempo()); 434 _musicParser->setTempo(0); 435 _musicParser->property(MidiParser::mpAutoLoop, false); 436 351 437 _currentTrack = filename; 352 438 353 _midiFile = Common::SharedPtr<byte>(data, DeleterArray());354 439 _musicParser->unloadMusic(); 440 if (_vm->game() != GI_KYRA2) 355 441 356 _isMusicPlaying = _isSfxPlaying = false;357 _fadeStartTime = 0;358 _fadeMusicOut = false;359 442 updateChannelVolume(_musicVolume); 360 443 361 if (_musicParser->loadMusic(_midiFile.get(), size)) { 362 _musicParser->setTimerRate(getBaseTempo()); 363 _musicParser->setTempo(0); 364 _musicParser->property(MidiParser::mpAutoLoop, false); 365 } else { 444 if (!_musicParser->loadMusic(data, size)) 366 445 warning("Error parsing music track '%s'", filename.c_str()); 367 }368 446 369 if (_ sfxParser->loadMusic(_midiFile.get(), size)) {447 if (_vm->game() != GI_KYRA2) { 370 448 _sfxParser->setTimerRate(getBaseTempo()); 371 449 _sfxParser->setTempo(0); 372 _sfxParser->property(MidiParser::mpAutoLoop, false); 373 } else { 374 warning("Error parsing sfx track '%s'", filename.c_str()); 450 _sfxParser->property(MidiParser::mpSmartJump, true); 451 _sfxParser->unloadMusic(); 452 if (!_sfxParser->loadMusic(data, size)) 453 warning("Error parsing sfx track '%s'", filename.c_str()); 375 454 } 455 456 delete [] _midiFile; 457 _midiFile = data; 376 458 } 377 459 378 460 void SoundMidiPC::onTimer(void *refCon) { 379 461 SoundMidiPC *sound = (SoundMidiPC *)refCon; 380 462 Common::StackLock lock(sound->_mutex); 381 463 382 // this should be set to the fadeToBlack value 383 static const uint32 musicFadeTime = 2 * 1000; 464 // Kyra2 waits exaclty 60 ticks (a tick is 1/60s) for fadeout, so this 465 // should be correct 466 const uint32 musicFadeTime = 1 * 1000; 384 467 385 468 if (sound->_fadeMusicOut && sound->_fadeStartTime + musicFadeTime > sound->_vm->_system->getMillis()) { 386 469 byte volume = (byte)((musicFadeTime - (sound->_vm->_system->getMillis() - sound->_fadeStartTime)) * sound->_musicVolume / musicFadeTime); … … 416 499 void SoundMidiPC::playTrack(uint8 track) { 417 500 Common::StackLock lock(_mutex); 418 501 419 if (_musicParser && (track != 0 || _nativeMT32) && _musicEnabled ) {502 if (_musicParser && (track != 0 || _nativeMT32) && _musicEnabled && _midiFile) { 420 503 _isMusicPlaying = true; 421 504 _fadeMusicOut = false; 422 505 _fadeStartTime = 0; 506 _isLooping = false; 423 507 updateChannelVolume(_musicVolume); 424 508 _musicParser->setTrack(track); 425 509 _musicParser->jumpToTick(0); … … 435 519 _isMusicPlaying = false; 436 520 _fadeMusicOut = false; 437 521 _fadeStartTime = 0; 522 _isLooping = false; 438 523 updateChannelVolume(_musicVolume); 439 524 _musicParser->setTrack(0); 440 525 _musicParser->jumpToTick(0); … … 443 528 } 444 529 445 530 void SoundMidiPC::playSoundEffect(uint8 track) { 446 if (_sfxParser && _sfxEnabled ) {531 if (_sfxParser && _sfxEnabled && ((_midiFile && _vm->game() != GI_KYRA2) || (_sfxFile && _vm->game() == GI_KYRA2))) { 447 532 _isSfxPlaying = true; 448 533 _sfxParser->setTrack(track); 449 534 _sfxParser->jumpToTick(0); … … 466 551 467 552 _curSfxFile = _curMusicTheme = file; 468 553 _sound->loadSoundFile(_curMusicTheme); 469 _sound->playTrack(track); 554 if (track != -1) 555 _sound->playTrack(track); 470 556 } 471 557 472 558 void KyraEngine::snd_playSoundEffect(int track) { … … 492 578 assert(command*2+1 < _trackMapSize); 493 579 if (_curMusicTheme != _trackMap[command*2]) { 494 580 if (_trackMap[command*2] != -1 && _trackMap[command*2] != -2) 495 snd_playTheme(_trackMap[command*2] );581 snd_playTheme(_trackMap[command*2], -1); 496 582 } 497 583 498 584 if (command != 1) { 499 585 if (_lastMusicCommand != command) { 500 586 _sound->haltTrack(); 587 // Short delay like in the original, 588 // this is probably for MIDI sound. 589 _system->delayMillis(50); 501 590 _sound->playTrack(_trackMap[command*2+1]); 502 591 } 503 592 } else { -
engines/kyra/staticres.cpp
1584 1584 1585 1585 const int KyraEngine_v2::_dosTrackMapSize = ARRAYSIZE(KyraEngine_v2::_dosTrackMap); 1586 1586 1587 const uint8 KyraEngine_v2::_midiMT32SfxMap[] = { 1588 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 1589 0xFF, 0xFF, 0xFF, 0x31, 0x0B, 0x05, 0x24, 0x0D, 1590 0xFF, 0xFF, 0x44, 0x37, 0x25, 0x49, 0x2B, 0x3D, 1591 0x31, 0xFF, 0x38, 0xFF, 0x3E, 0x26, 0xFF, 0xFF, 1592 0x3D, 0xFF, 0xFF, 0x1F, 0x46, 0x02, 0x2D, 0xFF, 1593 0x2D, 0xFF, 0xFF, 0xFF, 0x0A, 0x0E, 0x18, 0x19, 1594 0xFF, 0xFF, 0x3B, 0x09, 0x1A, 0xFF, 0x47, 0x4F, 1595 0x0C, 0x09, 0xFF, 0xFF, 0x3D, 0xFF, 0xFF, 0x41, 1596 0x42, 0x32, 0x1B, 0x18, 0x1D, 0x1D, 0x0F, 0x10, 1597 0x11, 0x12, 0x13, 0x14, 0x15, 0x39, 0xFF, 0xFF, 1598 0x22, 0x03, 0xFF, 0x38, 0x38, 0xFF, 0xFF, 0x32, 1599 0x2B, 0x44, 0x20, 0x21, 0x43, 0x19, 0x3C, 0x28, 1600 0x27, 0x0B, 0x18, 0x02, 0x3C, 0x03, 0x2E, 0x36, 1601 0x01, 0x08, 0xFF, 0xFF, 0x29, 0x2A, 0x25, 0x4A, 1602 0x45, 0x3E, 0x3A, 0x1B, 0xFF, 0xFF, 0xFF, 0xFF, 1603 0x30, 0x04, 0xFF, 0x19, 0x27, 0x28, 0x18, 0x3A, 1604 0x23, 0x04, 0x04, 0x04, 0xFF, 0x32, 0xFF, 0x06, 1605 0x08, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x35, 0x34, 1606 0xFF, 0x3F, 0x2F, 0xFF, 0xFF, 0xFF, 0x35, 0xFF, 1607 0x1D, 0xFF, 0xFF, 0x4F, 0xFF, 0x29, 0x0C, 0xFF, 1608 0xFF, 0xFF, 0x1A, 0xFF, 0x07, 0x1B, 0x48, 0x33, 1609 0x17, 0x33, 0x40, 0xFF, 0xFF, 0xFF, 0x1B, 0x4C, 1610 0x4D, 0x4E, 0x1C, 0x2F, 0xFF, 0xFF, 0x35, 0xFF, 1611 0xFF, 0xFF, 0xFF, 0xFF, 0x02, 0x16, 0xFF, 0x33, 1612 0x3A, 0xFF, 0xFF, 0x1E, 0xFF, 0x4F, 0xFF, 0xFF, 1613 0x16, 0x24, 0x01, 0xFF, 0x0C, 0x01, 0xFF, 0xFF, 1614 0x29, 0xFF, 0x4C, 0x4D, 0x2F 1615 }; 1616 1617 const uint8 KyraEngine_v2::_midiGMSfxMap[] = { 1618 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 1619 0xFF, 0xFF, 0xFF, 0x1F, 0x19, 0x13, 0x0C, 0x04, 1620 0xFF, 0xFF, 0x2E, 0x12, 0xFF, 0x15, 0x0F, 0xFF, 1621 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2F, 0xFF, 1622 0x21, 0xFF, 0x24, 0xFF, 0xFF, 0x17, 0x30, 0xFF, 1623 0x30, 0xFF, 0xFF, 0x31, 0xFF, 0x32, 0x16, 0x18, 1624 0x33, 0xFF, 0x34, 0x14, 0xFF, 0xFF, 0x16, 0x35, 1625 0x03, 0x14, 0x2F, 0x36, 0x21, 0xFF, 0x37, 0x38, 1626 0x39, 0x21, 0xFF, 0x33, 0x3A, 0xFF, 0x05, 0x06, 1627 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x16, 0xFF, 0xFF, 1628 0xFF, 0x18, 0xFF, 0x1A, 0x11, 0xFF, 0xFF, 0x21, 1629 0x0F, 0xFF, 0x17, 0x17, 0xFF, 0x16, 0xFF, 0x17, 1630 0x18, 0x15, 0x16, 0xFF, 0xFF, 0x18, 0x10, 0xFF, 1631 0x01, 0x30, 0xFF, 0xFF, 0x0D, 0x0E, 0xFF, 0x1D, 1632 0x40, 0xFF, 0xFF, 0x19, 0xFF, 0xFF, 0xFF, 0xFF, 1633 0xFF, 0x02, 0x0D, 0x18, 0x17, 0x17, 0x16, 0xFF, 1634 0x3C, 0x02, 0x02, 0x02, 0xFF, 0x21, 0xFF, 0x3D, 1635 0x30, 0x3E, 0xFF, 0x27, 0xFF, 0xFF, 0x1C, 0x3F, 1636 0x21, 0xFF, 0x11, 0xFF, 0x2D, 0x2D, 0x1C, 0x37, 1637 0x22, 0xFF, 0xFF, 0x22, 0x37, 0x0D, 0xFF, 0x2F, 1638 0x36, 0xFF, 0xFF, 0x21, 0x2C, 0x19, 0xFF, 0xFF, 1639 0xFF, 0x20, 0xFF, 0xFF, 0xFF, 0xFF, 0x19, 0x25, 1640 0x25, 0x25, 0x1A, 0x2B, 0xFF, 0x2A, 0x18, 0xFF, 1641 0xFF, 0xFF, 0xFF, 0xFF, 0x17, 0x20, 0xFF, 0x20, 1642 0xFF, 0xFF, 0xFF, 0x1B, 0x29, 0x22, 0xFF, 0x28, 1643 0x20, 0xFF, 0x10, 0x28, 0xFF, 0x10, 0x26, 0x27, 1644 0x0D, 0xFF, 0x25, 0x1C, 0x21 1645 }; 1646 1587 1647 void KyraEngine_v2::initInventoryButtonList() { 1588 1648 delete [] _inventoryButtons; 1589 1649 -
engines/kyra/kyra_v2.h
897 897 void snd_loadSoundFile(int id); 898 898 899 899 void playVoice(int high, int low); 900 901 static const uint8 _midiMT32SfxMap[]; 902 static const uint8 _midiGMSfxMap[]; 900 903 void snd_playSoundEffect(int track); 901 904 902 905 // timer -
engines/kyra/sound.h
320 320 int open(); 321 321 void close(); 322 322 void send(uint32 b); 323 void sysEx(const byte *msg, uint16 length); 323 324 void metaEvent(byte type, byte *data, uint16 length); 324 325 325 326 void setTimerCallback(void *timerParam, void (*timerProc)(void *)) { } … … 353 354 bool _fadeMusicOut; 354 355 355 356 // Midi file related 356 Common::SharedPtr<byte>_midiFile;357 byte *_midiFile; 357 358 Common::String _currentTrack; 358 359 360 byte *_sfxFile; 361 359 362 // Music related 360 363 MidiParser *_musicParser; 361 364 362 365 bool _isMusicPlaying; 363 366 bool _eventFromMusic; 367 bool _isLooping; 364 368 365 369 // Sfx related 366 370 MidiParser *_sfxParser; … … 368 372 bool _isSfxPlaying; 369 373 370 374 // misc 375 uint32 _nextSysEx; 371 376 bool _nativeMT32; 372 377 bool _useC55; 373 378 MidiDriver *_driver; -
engines/kyra/kyra_v1.cpp
185 185 186 186 initStaticResource(); 187 187 188 if (!_sound->init()) 189 error("Couldn't init sound"); 190 188 191 _sound->setSoundList(&_soundData[kMusicIntro]); 189 192 190 193 _trackMap = _dosTrackMap; 191 194 _trackMapSize = _dosTrackMapSize; 192 195 193 if (!_sound->init())194 error("Couldn't init sound");195 196 196 _sound->loadSoundFile(0); 197 197 198 198 setupButtonData(); -
engines/kyra/kyra_v2.cpp
1838 1838 } 1839 1839 1840 1840 int16 vocIndex = (int16)READ_LE_UINT16(&_ingameSoundIndex[track * 2]); 1841 if (vocIndex != -1) 1841 // TODO: Maybe there is a way to let users select whether they want 1842 // voc, midi or adl sfx (even though it makes no sense to choose anything but voc). 1843 // For now this is used as a fallback only (if no voc file exists). 1844 if (vocIndex != -1) { 1842 1845 _sound->voicePlay(_ingameSoundList[vocIndex], true); 1843 else if (_flags.platform == Common::kPlatformPC) 1844 // TODO ?? Maybe there is a way to let users select whether they want 1845 // voc, midi or adl sfx (even though it makes no sense to choose anything but voc). 1846 // For now this is used as a fallback only (if no voc file exists). 1847 KyraEngine::snd_playSoundEffect(track); 1846 } else if (_flags.platform == Common::kPlatformPC) { 1847 if (_sound->getSfxType() == Sound::kAdlib) { 1848 KyraEngine::snd_playSoundEffect(track); 1849 } else if (_sound->getSfxType() == Sound::kMidiMT32) { 1850 if (_midiMT32SfxMap[track] != 0xFF) 1851 KyraEngine::snd_playSoundEffect(_midiMT32SfxMap[track]-1); 1852 } else if (_sound->getSfxType() == Sound::kMidiGM) { 1853 if (_midiGMSfxMap[track] != 0xFF) 1854 KyraEngine::snd_playSoundEffect(_midiGMSfxMap[track]-1); 1855 } 1856 } 1848 1857 } 1849 1858 1850 1859 #pragma mark - -
sound/mididrv.h
216 216 * do NOT include the leading 0xF0 and the trailing 0xF7. 217 217 * 218 218 * Furthermore, the maximal supported length of a SysEx 219 * is 2 54 bytes. Passing longer buffers can lead to219 * is 264 bytes. Passing longer buffers can lead to 220 220 * undefined behavior (most likely, a crash). 221 * Re increased that value since Kyra uses 264 byte SysEx 222 * commands before our maximal length was 254 bytes. 221 223 */ 222 224 virtual void sysEx(const byte *msg, uint16 length) { } 223 225 -
backends/midi/alsa.cpp
196 196 } 197 197 198 198 void MidiDriver_ALSA::sysEx(const byte *msg, uint16 length) { 199 unsigned char buf[2 56];199 unsigned char buf[266]; 200 200 201 assert( length + 2 <= 256);201 assert(uint(length + 2) <= sizeof(buf)); 202 202 203 203 // Add SysEx frame 204 204 buf[0] = 0xF0; -
backends/midi/dmedia.cpp
18 18 * along with this program; if not, write to the Free Software 19 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 20 * 21 * $URL :$21 * $URL$ 22 22 * $Id: dmedia.cpp$ 23 23 */ 24 24 … … 159 159 MDevent event; 160 160 char buf [1024]; 161 161 162 assert(length + 2 <= 256);162 assert(length + 2 <= sizeof(buf)); 163 163 164 164 memcpy(buf, msg, length); 165 165 buf[length] = MD_EOX; -
backends/midi/camd.cpp
114 114 } 115 115 116 116 void MidiDriver_CAMD::sysEx(const byte *msg, uint16 length) { 117 unsigned char buf[2 56];117 unsigned char buf[266]; 118 118 119 assert(length + 2 <= 256);119 assert(length + 2 <= sizeof(buf)); 120 120 121 121 // Add SysEx frame 122 122 buf[0] = 0xF0; -
backends/midi/seq.cpp
149 149 int position = 0; 150 150 const byte *chr = msg; 151 151 152 assert(length + 2 <= 2 56);152 assert(length + 2 <= 266); 153 153 154 154 buf[position++] = SEQ_MIDIPUTC; 155 155 buf[position++] = 0xF0; -
backends/midi/zodiac.cpp
111 111 } 112 112 113 113 void MidiDriver_Zodiac::sysEx(const byte *msg, uint16 length) { 114 unsigned char buf[2 56];114 unsigned char buf[266]; 115 115 116 116 buf[0] = 0xF0; 117 117 memcpy(buf + 1, msg, length); -
backends/midi/coreaudio.cpp
178 178 } 179 179 180 180 void MidiDriver_CORE::sysEx(const byte *msg, uint16 length) { 181 unsigned char buf[2 56];181 unsigned char buf[266]; 182 182 183 assert(length + 2 <= 256);183 assert(length + 2 <= sizeof(buf)); 184 184 assert(_auGraph != NULL); 185 185 186 186 // Add SysEx frame -
backends/midi/windows.cpp
39 39 class MidiDriver_WIN : public MidiDriver_MPU401 { 40 40 private: 41 41 MIDIHDR _streamHeader; 42 byte _streamBuffer[2 56]; // SysEx blocks should be no larger than 256 bytes42 byte _streamBuffer[266]; // SysEx blocks should be no larger than 266 bytes 43 43 HANDLE _streamEvent; 44 44 HMIDIOUT _mo; 45 45 bool _isOpen; … … 103 103 return; 104 104 } 105 105 106 assert(length+2 <= 256);106 assert(length+2 <= sizeof(_streamBuffer)); 107 107 108 108 midiOutUnprepareHeader(_mo, &_streamHeader, sizeof(_streamHeader)); 109 109 -
backends/midi/timidity.cpp
490 490 int position = 0; 491 491 const byte *chr = msg; 492 492 493 assert(length + 2 <= 2 56);493 assert(length + 2 <= 266); 494 494 495 495 buf[position++] = SEQ_MIDIPUTC; 496 496 buf[position++] = 0xF0;