1436 | | case 14:{ // FIXME: Sam and Max command - Total guess |
1437 | | int i; // Seems to work as a volume fader |
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 | // FIXME: Sam and Max command - Total guess |
| 1445 | // Seems to work as a volume fader |
| 1446 | for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) { |
| 1447 | if (player->_active && player->_id == (uint16)b) { |
| 1448 | player->fade_vol(e, f); |
| 1449 | return 0; |
| 1450 | } |
| 1451 | } |
| 1452 | return -1; |
| 1453 | case 15: |
| 1454 | // FIXME: Sam and Max command - Total guess |
| 1455 | // Something to do with position? |
| 1456 | for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) { |
| 1457 | if (player->_active && player->_id == (uint16)b) { |
| 1458 | player->jump(player->_track_index + 1, 0, 0); |
| 1459 | return 0; |
1447 | | case 15:{ // FIXME: Sam and Max command - Total guess |
1448 | | int i; // Something to do with position? |
1449 | | Player *player; |
| 1462 | return -1; |
| 1463 | case 16: |
| 1464 | return set_volchan(b, c); |
| 1465 | case 17: |
| 1466 | if (g_scumm->_features & GID_SAMNMAX) { |
| 1467 | // Sam & Max: ImSetTrigger. |
| 1468 | // Sets a trigger for a particular player and |
| 1469 | // marker ID, along with do_command parameters |
| 1470 | // to invoke at the marker. The marker is |
| 1471 | // represented by MIDI SysEx block 00 xx (F7) |
| 1472 | // where "xx" is the marker ID. |
2100 | | case 0: /* part on/off? */ |
2101 | | // This seems to do the right thing for Monkey 2, at least. |
2102 | | a = *p++ & 0x0F; |
2103 | | part = get_part(a); |
2104 | | if (part) { |
2105 | | debug(2, "%d => turning %s part %d", p[1], (p[1] == 2) ? "OFF" : "ON", a); |
2106 | | part->set_onoff(p[1] != 2); |
2107 | | } |
| 2130 | case 0: |
| 2131 | if (len > 2) { |
| 2132 | // Part on/off? |
| 2133 | // This seems to do the right thing for Monkey 2, at least. |
| 2134 | a = *p++ & 0x0F; |
| 2135 | part = get_part(a); |
| 2136 | if (part) { |
| 2137 | debug(2, "%d => turning %s part %d", p[1], (p[1] == 2) ? "OFF" : "ON", a); |
| 2138 | part->set_onoff(p[1] != 2); |
| 2139 | } |
| 2140 | } else { |
| 2141 | // Jamieson630: Sam & Max seems to use this as a marker for |
| 2142 | // ImSetTrigger. When a marker is encountered whose sound |
| 2143 | // ID and (presumably) marker ID match what was set by |
| 2144 | // ImSetTrigger, something magical is supposed to happen.... |
| 2145 | if (_def_do_command_trigger && *p == _def_do_command_trigger) { |
| 2146 | _def_do_command_trigger = 0; |
| 2147 | _se->do_command (_deferred_do_command [0], |
| 2148 | _deferred_do_command [1], |
| 2149 | _deferred_do_command [2], |
| 2150 | _deferred_do_command [3], |
| 2151 | 0, 0, 0, 0); |
| 2152 | } // end if |
| 2153 | } // end if |
| 2154 | break; |
| 2155 | |
| 2156 | case 1: |
| 2157 | // This SysEx is used in Sam & Max to provide loop (and |
| 2158 | // possibly marker) information. Presently, only the |
| 2159 | // loop information is implemented. |
| 2160 | if (_scanning) |
| 2161 | break; |
| 2162 | maybe_jump (p[0], p[1] - 1, (read_word (p + 2) - 1) * 4 + p[4], ((p[5] * _ticks_per_beat) >> 2) + p[6]); |