RCS file: /cvsroot/scummvm/scummvm/scumm/imuse.cpp,v
retrieving revision 1.52
diff -u -r1.52 imuse.cpp
|
|
|
116 | 116 | bool _abort; |
117 | 117 | |
118 | 118 | HookDatas _hook; |
| 119 | byte _def_do_command_trigger; |
| 120 | byte _deferred_do_command [4]; |
119 | 121 | |
120 | 122 | bool _mt32emulate; |
121 | 123 | bool _isGM; |
… |
… |
|
1410 | 1415 | |
1411 | 1416 | int32 IMuseInternal::do_command(int a, int b, int c, int d, int e, int f, int g, int h) |
1412 | 1417 | { |
| 1418 | int i; |
1413 | 1419 | byte cmd = a & 0xFF; |
1414 | 1420 | byte param = a >> 8; |
1415 | 1421 | Player *player = NULL; |
… |
… |
|
1433 | 1440 | return stop_all_sounds(); |
1434 | 1441 | case 13: |
1435 | 1442 | return get_sound_status(b); |
1436 | | case 14:{ // Sam and Max: Volume Fader? |
1437 | | int i; |
1438 | | Player *player; |
1439 | | |
1440 | | for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) { |
1441 | | if (player->_active && player->_id == (uint16)b) { |
1442 | | player->fade_vol(e, f); |
1443 | | return 0; |
1444 | | } |
| 1443 | case 14: |
| 1444 | // Sam and Max: Volume Fader? |
| 1445 | for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) { |
| 1446 | if (player->_active && player->_id == (uint16)b) { |
| 1447 | player->fade_vol(e, f); |
| 1448 | return 0; |
1445 | 1449 | } |
1446 | 1450 | } |
1447 | | case 15:{ // Sam and Max: Unconditional Jump? |
1448 | | int i; // Something to do with position? |
1449 | | Player *player; |
| 1451 | return -1; |
| 1452 | case 15: |
| 1453 | // Sam & Max: Unconditional Jump? |
| 1454 | for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) { |
| 1455 | if (player->_active && player->_id == (uint16)b) { |
| 1456 | player->jump(player->_track_index + 1, 0, 0); |
| 1457 | return 0; |
| 1458 | } |
| 1459 | } |
| 1460 | return -1; |
| 1461 | case 16: |
| 1462 | return set_volchan(b, c); |
| 1463 | case 17: |
| 1464 | if (g_scumm->_features & GID_SAMNMAX) { |
| 1465 | // Sam & Max: ImSetTrigger. |
| 1466 | // Sets a trigger for a particular player and |
| 1467 | // marker ID, along with do_command parameters |
| 1468 | // to invoke at the marker. The marker is |
| 1469 | // represented by MIDI SysEx block 00 xx (F7) |
| 1470 | // where "xx" is the marker ID. |
1450 | 1471 | for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) { |
1451 | 1472 | if (player->_active && player->_id == (uint16)b) { |
1452 | | player->jump(player->_track_index + 1, 0, 0); |
| 1473 | player->_def_do_command_trigger = d; |
| 1474 | player->_deferred_do_command [0] = e; |
| 1475 | player->_deferred_do_command [1] = f; |
| 1476 | player->_deferred_do_command [2] = g; |
| 1477 | player->_deferred_do_command [3] = h; |
1453 | 1478 | return 0; |
1454 | 1479 | } |
1455 | 1480 | } |
| 1481 | return -1; |
1456 | 1482 | } |
1457 | | |
1458 | | case 16: |
1459 | | return set_volchan(b, c); |
1460 | | case 17: |
1461 | | return set_channel_volume(b, c); |
| 1483 | else |
| 1484 | return set_channel_volume(b, c); |
1462 | 1485 | case 18: |
1463 | 1486 | return set_volchan_entry(b, c); |
1464 | 1487 | case 19: |
… |
… |
|
1489 | 1512 | case 0: |
1490 | 1513 | return player->get_param(c, d); |
1491 | 1514 | case 1: |
1492 | | player->set_priority(c); |
| 1515 | if (g_scumm->_features & GID_SAMNMAX) // Jamieson630: Nasty |
| 1516 | player->jump (d - 1, (e - 1) * 4 + f, ((g * player->_ticks_per_beat) >> 2) + h); |
| 1517 | else |
| 1518 | player->set_priority(c); |
1493 | 1519 | return 0; |
1494 | 1520 | case 2: |
1495 | 1521 | return player->set_vol(c); |
… |
… |
|
2107 | 2141 | debug(2, "%d => turning %s part %d", p[1], (p[1] == 2) ? "OFF" : "ON", a); |
2108 | 2142 | part->set_onoff(p[1] != 2); |
2109 | 2143 | } |
| 2144 | } else { |
| 2145 | // Jamieson630: Sam & Max seems to use this as a marker for |
| 2146 | // ImSetTrigger. When a marker is encountered whose sound |
| 2147 | // ID and (presumably) marker ID match what was set by |
| 2148 | // ImSetTrigger, something magical is supposed to happen.... |
| 2149 | if (_def_do_command_trigger && *p == _def_do_command_trigger) { |
| 2150 | _def_do_command_trigger = 0; |
| 2151 | _se->do_command (_deferred_do_command [0], |
| 2152 | _deferred_do_command [1], |
| 2153 | _deferred_do_command [2], |
| 2154 | _deferred_do_command [3], |
| 2155 | 0, 0, 0, 0); |
| 2156 | } // end if |
2110 | 2157 | } // end if |
2111 | | |
2112 | | // Jamieson630: Sam & Max uses this for something entirely different. |
2113 | | // The data is much shorter, hence the len > 2 check above. |
2114 | 2158 | break; |
2115 | 2159 | |
2116 | 2160 | case 1: |