RCS file: /cvsroot/scummvm/scummvm/scumm/imuse.cpp,v
retrieving revision 1.45
diff -u -r1.45 imuse.cpp
|
|
|
130 | 130 | void key_on(uint8 chan, byte data, byte velocity); |
131 | 131 | void part_set_transpose(uint8 chan, byte relative, int8 b); |
132 | 132 | void parse_sysex(byte *p, uint len); |
133 | | void maybe_jump(byte *data); |
| 133 | void maybe_jump (byte cmd, uint track, uint beat, uint tick); |
134 | 134 | void maybe_set_transpose(byte *data); |
135 | 135 | void maybe_part_onoff(byte *data); |
136 | 136 | void maybe_set_volume(byte *data); |
… |
… |
|
2098 | 2103 | |
2099 | 2104 | switch (code = *p++) { |
2100 | 2105 | 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 | | } |
| 2106 | if (len > 2) { |
| 2107 | // This seems to do the right thing for Monkey 2, at least. |
| 2108 | a = *p++ & 0x0F; |
| 2109 | part = get_part(a); |
| 2110 | if (part) { |
| 2111 | debug(2, "%d => turning %s part %d", p[1], (p[1] == 2) ? "OFF" : "ON", a); |
| 2112 | part->set_onoff(p[1] != 2); |
| 2113 | } |
| 2114 | } else { |
| 2115 | // Sam & Max uses this as a track switch. |
| 2116 | if (_scanning) |
| 2117 | break; |
| 2118 | debug (0, "Switching to track %d", (int)((*p) - 1)); |
| 2119 | if (jump ((*p) - 1, 0, 0) == false) |
| 2120 | debug (0, " Failed!"); |
| 2121 | } // end if |
| 2122 | break; |
| 2123 | |
| 2124 | case 1: |
| 2125 | // This SysEx is used in Sam & Max to provide loop (and |
| 2126 | // possibly marker) information. Presently, only the |
| 2127 | // loop information is implemented. |
| 2128 | if (_scanning) |
| 2129 | break; |
| 2130 | maybe_jump (p[0], p[1] - 1, (read_word (p + 2) - 1) * 4 + p[4], ((p[5] * _ticks_per_beat) >> 2) + p[6]); |
2108 | 2131 | break; |
2109 | 2132 | |
2110 | 2133 | case 16: /* set instrument in part */ |
… |
… |
|
2140 | 2163 | if (_scanning) |
2141 | 2164 | break; |
2142 | 2165 | decode_sysex_bytes(p + 1, buf, len - 2); |
2143 | | maybe_jump(buf); |
| 2166 | maybe_jump (buf[0], read_word (buf + 1), read_word (buf + 3), read_word (buf + 5)); |
2144 | 2167 | break; |
2145 | 2168 | |
2146 | 2169 | case 49: /* hook - global transpose */ |
… |
… |
|
2212 | 2235 | } |
2213 | 2236 | } |
2214 | 2237 | |
2215 | | void Player::maybe_jump(byte *data) |
| 2238 | void Player::maybe_jump (byte cmd, uint track, uint beat, uint tick) |
2216 | 2239 | { |
2217 | | byte cmd; |
2218 | | |
2219 | | cmd = data[0]; |
2220 | | |
2221 | 2240 | /* is this the hook i'm waiting for? */ |
2222 | 2241 | if (cmd && _hook._jump != cmd) |
2223 | 2242 | return; |
… |
… |
|
2226 | 2245 | if (cmd != 0 && cmd < 0x80) |
2227 | 2246 | _hook._jump = 0; |
2228 | 2247 | |
2229 | | jump(read_word(data + 1), read_word(data + 3), read_word(data + 5)); |
| 2248 | jump (track, beat, tick); |
2230 | 2249 | } |
2231 | 2250 | |
2232 | 2251 | void Player::maybe_set_transpose(byte *data) |