Ticket #9070: tfmx.patch
File tfmx.patch, 2.0 KB (added by , 16 years ago) |
---|
-
sound/mods/tfmx.cpp
619 619 for (;;) { 620 620 const uint16 *const trackData = getTrackPtr(_trackCtx.posInd); 621 621 622 if (trackData[0] != FROM_BE_16(0xEFFE)) {622 if (trackData[0] != CONSTANT_BE_16(0xEFFE)) { 623 623 // 8 commands for Patterns 624 624 for (int i = 0; i < 8; ++i) { 625 625 const uint8 *patCmd = (const uint8 *)&trackData[i]; … … 637 637 638 638 } else { 639 639 // 16 byte Trackstep Command 640 switch ( READ_BE_UINT16(&trackData[1])) {641 case 0: // Stop Player. No Parameters640 switch (trackData[1]) { 641 case CONSTANT_BE_16(0): // Stop Player. No Parameters 642 642 stopPaula(); 643 643 return false; 644 644 645 case 1: // Branch/Loop section of tracksteps. Parameters: branch target, loopcount645 case CONSTANT_BE_16(1): // Branch/Loop section of tracksteps. Parameters: branch target, loopcount 646 646 if (_trackCtx.loopCount != 0) { 647 647 if (_trackCtx.loopCount < 0) 648 648 _trackCtx.loopCount = READ_BE_UINT16(&trackData[3]); … … 652 652 --_trackCtx.loopCount; 653 653 break; 654 654 655 case 2: { // Set Tempo. Parameters: tempo, divisor655 case CONSTANT_BE_16(2): { // Set Tempo. Parameters: tempo, divisor 656 656 _playerCtx.patternCount = _playerCtx.patternSkip = READ_BE_UINT16(&trackData[2]); // tempo 657 657 const uint16 temp = READ_BE_UINT16(&trackData[3]); // divisor 658 658 … … 660 660 setInterruptFreqUnscaled(temp & 0x1FF); 661 661 break; 662 662 } 663 case 4: // Fade. Parameters: tempo, endVol663 case CONSTANT_BE_16(4): // Fade. Parameters: tempo, endVol 664 664 // load the LSB of the 16bit words 665 665 initFadeCommand(((const uint8 *)&trackData[2])[1], ((const int8 *)&trackData[3])[1]); 666 666 break; 667 667 668 case 3: // Unknown, stops player aswell668 case CONSTANT_BE_16(3): // Unknown, stops player aswell 669 669 default: 670 670 debug(3, "Tfmx: Unknown Trackstep Command: %02X", READ_BE_UINT16(&trackData[1])); 671 671 // MI-Player handles this by stopping the player, we just continue