Ticket #8235: loom-sound-new.diff

File loom-sound-new.diff, 3.7 KB (added by SF/hoenicke, 21 years ago)

This should apply cleanly.

  • scumm/player_v2.cpp

    RCS file: /cvsroot/scummvm/scummvm/scumm/player_v2.cpp,v
    retrieving revision 2.2
    diff -u -r2.2 player_v2.cpp
     
    526526                } else { // opcode < 0xf8
    527527                        for (;;) {
    528528                                int16 note, octave;
    529                                 dest_channel = &channels[opcode >> 5];
    530                                 channel->d.time_left = channel->d.tempo * note_lengths[opcode & 0x1f];
     529                                int is_last_note;
     530                                dest_channel = &channels[(opcode >> 5) & 3];
     531
     532                                if (!(opcode & 0x80)) {
     533
     534                                        int tempo = channel->d.tempo;
     535                                        if (!tempo)
     536                                                tempo = 1;
     537                                        channel->d.time_left = tempo * note_lengths[opcode & 0x1f];
     538
     539                                        note = *script_ptr++;
     540                                        is_last_note = note & 0x80;
     541                                        note &= 0x7f;
     542                                        if (note == 0x7f)
     543                                                goto end;
     544                                } else {
     545
     546                                        channel->d.time_left = ((opcode & 7) << 8) | *script_ptr++;
     547
     548                                        if ((opcode & 0x10))
     549                                                goto end;
     550
     551                                        is_last_note = 0;
     552                                        note = (*script_ptr++) & 0x7f;
     553                                }
     554
     555
    531556                                debug(9, "channels[%d]: @%04x note: %3d+%d len: %2d hull: %d mod: %d/%d/%d %s\n",
    532                                       opcode>>5, script_ptr ? script_ptr - current_data : 0,
    533                                       *script_ptr & 0x7f, (signed short) dest_channel->d.transpose, opcode & 0x1f,
     557                                      dest_channel - channel, script_ptr ? script_ptr - current_data - 2 : 0,
     558                                      note, (signed short) dest_channel->d.transpose, channel->d.time_left,
    534559                                      dest_channel->d.hull_curve, dest_channel->d.freqmod_table,
    535560                                      dest_channel->d.freqmod_incr,dest_channel->d.freqmod_multiplier,
    536                                       *script_ptr & 0x80 ? "last":"");
    537                                 opcode = *script_ptr++;
    538                                 note = opcode & 0x7f;
    539                                 if (note != 0x7f) {
    540                                         uint16 myfreq;
    541                                         dest_channel->d.time_left = channel->d.time_left;
    542                                         dest_channel->d.note_length =
     561                                      is_last_note ? "last":"");
     562
     563
     564                                uint16 myfreq;
     565                                dest_channel->d.time_left = channel->d.time_left;
     566                                dest_channel->d.note_length =
    543567                                        channel->d.time_left - dest_channel->d.inter_note_pause;
    544                                         note += dest_channel->d.transpose;
    545                                         while (note < 0)
    546                                                 note += 12;
    547                                         octave = note / 12;
    548                                         note = note % 12;
    549                                         dest_channel->d.hull_offset = 0;
    550                                         dest_channel->d.hull_counter = 1;
    551                                         if (pcjr && dest_channel == &channels[3]) {
    552                                                 dest_channel->d.hull_curve = 180 + note * 12;
    553                                                 myfreq = 384 - 64 * octave;
    554                                         } else {
    555                                                 myfreq = freqs_table[note] >> octave;
    556                                         }
    557                                         dest_channel->d.freq = dest_channel->d.base_freq = myfreq;
     568                                note += dest_channel->d.transpose;
     569                                while (note < 0)
     570                                        note += 12;
     571                                octave = note / 12;
     572                                note = note % 12;
     573                                dest_channel->d.hull_offset = 0;
     574                                dest_channel->d.hull_counter = 1;
     575                                if (pcjr && dest_channel == &channels[3]) {
     576                                        dest_channel->d.hull_curve = 180 + note * 12;
     577                                        myfreq = 384 - 64 * octave;
     578                                } else {
     579                                        myfreq = freqs_table[note] >> octave;
    558580                                }
    559                                 if ((opcode & 0x80) != 0)
     581                                dest_channel->d.freq = dest_channel->d.base_freq = myfreq;
     582                                if (is_last_note)
    560583                                        goto end;
    561584                                opcode = *script_ptr++;
    562585                        }
  • scumm/scummvm.cpp

    RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
    retrieving revision 2.184
    diff -u -r2.184 scummvm.cpp
     
    611611                _imuseDigital = new IMuseDigital(this);
    612612                _imuse = NULL;
    613613                _playerV2 = NULL;
    614         } else if (_features & GF_OLD_BUNDLE && !(_features & GF_AFTER_V3)) {
     614        } else if (_features & GF_OLD_BUNDLE) {
    615615                _playerV2 = NULL;
    616616                if (!(_features & GF_AMIGA))
    617617                        _playerV2 = new Player_V2();