Patch 622386: do_command(256) implementation, Sam and Max

svn-id: r5134
This commit is contained in:
James Brown 2002-10-13 05:39:26 +00:00
parent f6c731a0a4
commit 69c7a8b572
2 changed files with 24 additions and 17 deletions

View File

@ -1438,10 +1438,12 @@ int32 IMuseInternal::do_command(int a, int b, int c, int d, int e, int f, int g,
return get_sound_status(b);
case 14:
// Sam and Max: Volume Fader?
for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) {
if (player->_active && player->_id == (uint16)b) {
player->fade_vol(e, f);
return 0;
if (f != 0) {
for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) {
if (player->_active && player->_id == (uint16)b) {
player->fade_vol(e, f);
return 0;
}
}
}
return -1;
@ -1491,7 +1493,6 @@ int32 IMuseInternal::do_command(int a, int b, int c, int d, int e, int f, int g,
warning("IMuseInternal::do_command invalid command %d", cmd);
}
} else if (param == 1) {
if ((1 << cmd) & (0x783FFF)) {
player = get_player_byid(b);
if (!player)
@ -1506,7 +1507,10 @@ int32 IMuseInternal::do_command(int a, int b, int c, int d, int e, int f, int g,
switch (cmd) {
case 0:
return player->get_param(c, d);
if (g_scumm->_features & GID_SAMNMAX)
return player->_def_do_command_trigger;
else
return player->get_param(c, d);
case 1:
if (g_scumm->_features & GID_SAMNMAX) // Jamieson630: Nasty
player->jump (d - 1, (e - 1) * 4 + f, ((g * player->_ticks_per_beat) >> 2) + h);
@ -2137,10 +2141,12 @@ void Player::parse_sysex(byte *p, uint len)
if (_def_do_command_trigger && *p == _def_do_command_trigger) {
_def_do_command_trigger = 0;
_se->do_command (_deferred_do_command [0],
_deferred_do_command [1],
_deferred_do_command [2],
_deferred_do_command [3],
0, 0, 0, 0);
_deferred_do_command [1],
_deferred_do_command [2],
_deferred_do_command [3],
0, 0, 0, 0);
} else {
_def_do_command_trigger = *p;
} // end if
} // end if
break;

View File

@ -45,9 +45,9 @@ int CharsetRenderer::getStringWidth(int arg, byte *text, int pos)
chr = 255;
if (chr == 255) {
chr = text[pos++];
if (chr == 3)
if (chr == 3) // 'WAIT'
break;
if (chr == 8) {
if (chr == 8) { // 'Verb on next line'
if (arg == 1)
break;
while (text[pos] == ' ')
@ -58,7 +58,7 @@ int CharsetRenderer::getStringWidth(int arg, byte *text, int pos)
pos += 2;
continue;
}
if (chr == 9 || chr == 1 || chr == 2)
if (chr == 9 || chr == 1 || chr == 2) // 'Newline'
break;
if (chr == 14) {
int set = text[pos] | (text[pos + 1] << 8);
@ -93,9 +93,9 @@ void CharsetRenderer::addLinebreaks(int a, byte *str, int pos, int maxwidth)
chr = 255;
if (chr == 255) {
chr = str[pos++];
if (chr == 3)
if (chr == 3) // 'Wait'
break;
if (chr == 8) {
if (chr == 8) { // 'Verb on next line'
if (a == 1) {
curw = 1;
} else {
@ -108,11 +108,11 @@ void CharsetRenderer::addLinebreaks(int a, byte *str, int pos, int maxwidth)
pos += 2;
continue;
}
if (chr == 1) {
if (chr == 1) { // 'Newline'
curw = 1;
continue;
}
if (chr == 2)
if (chr == 2) // 'Don't terminate with \n'
break;
if (chr == 14) {
int set = str[pos] | (str[pos + 1] << 8);
@ -746,6 +746,7 @@ while ((ptr[num++] = chr = *msg++) != 0) {
addStringToStack(READ_LE_UINT16(ptr + num));
num += 2;
break;
case 3:
case 9:
//#if defined(DOTT)
case 10: