Patch 622386: do_command(256) implementation, Sam and Max
svn-id: r5134
This commit is contained in:
parent
f6c731a0a4
commit
69c7a8b572
2 changed files with 24 additions and 17 deletions
|
@ -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);
|
return get_sound_status(b);
|
||||||
case 14:
|
case 14:
|
||||||
// Sam and Max: Volume Fader?
|
// Sam and Max: Volume Fader?
|
||||||
for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) {
|
if (f != 0) {
|
||||||
if (player->_active && player->_id == (uint16)b) {
|
for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) {
|
||||||
player->fade_vol(e, f);
|
if (player->_active && player->_id == (uint16)b) {
|
||||||
return 0;
|
player->fade_vol(e, f);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return -1;
|
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);
|
warning("IMuseInternal::do_command invalid command %d", cmd);
|
||||||
}
|
}
|
||||||
} else if (param == 1) {
|
} else if (param == 1) {
|
||||||
|
|
||||||
if ((1 << cmd) & (0x783FFF)) {
|
if ((1 << cmd) & (0x783FFF)) {
|
||||||
player = get_player_byid(b);
|
player = get_player_byid(b);
|
||||||
if (!player)
|
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) {
|
switch (cmd) {
|
||||||
case 0:
|
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:
|
case 1:
|
||||||
if (g_scumm->_features & GID_SAMNMAX) // Jamieson630: Nasty
|
if (g_scumm->_features & GID_SAMNMAX) // Jamieson630: Nasty
|
||||||
player->jump (d - 1, (e - 1) * 4 + f, ((g * player->_ticks_per_beat) >> 2) + h);
|
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) {
|
if (_def_do_command_trigger && *p == _def_do_command_trigger) {
|
||||||
_def_do_command_trigger = 0;
|
_def_do_command_trigger = 0;
|
||||||
_se->do_command (_deferred_do_command [0],
|
_se->do_command (_deferred_do_command [0],
|
||||||
_deferred_do_command [1],
|
_deferred_do_command [1],
|
||||||
_deferred_do_command [2],
|
_deferred_do_command [2],
|
||||||
_deferred_do_command [3],
|
_deferred_do_command [3],
|
||||||
0, 0, 0, 0);
|
0, 0, 0, 0);
|
||||||
|
} else {
|
||||||
|
_def_do_command_trigger = *p;
|
||||||
} // end if
|
} // end if
|
||||||
} // end if
|
} // end if
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -45,9 +45,9 @@ int CharsetRenderer::getStringWidth(int arg, byte *text, int pos)
|
||||||
chr = 255;
|
chr = 255;
|
||||||
if (chr == 255) {
|
if (chr == 255) {
|
||||||
chr = text[pos++];
|
chr = text[pos++];
|
||||||
if (chr == 3)
|
if (chr == 3) // 'WAIT'
|
||||||
break;
|
break;
|
||||||
if (chr == 8) {
|
if (chr == 8) { // 'Verb on next line'
|
||||||
if (arg == 1)
|
if (arg == 1)
|
||||||
break;
|
break;
|
||||||
while (text[pos] == ' ')
|
while (text[pos] == ' ')
|
||||||
|
@ -58,7 +58,7 @@ int CharsetRenderer::getStringWidth(int arg, byte *text, int pos)
|
||||||
pos += 2;
|
pos += 2;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (chr == 9 || chr == 1 || chr == 2)
|
if (chr == 9 || chr == 1 || chr == 2) // 'Newline'
|
||||||
break;
|
break;
|
||||||
if (chr == 14) {
|
if (chr == 14) {
|
||||||
int set = text[pos] | (text[pos + 1] << 8);
|
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;
|
chr = 255;
|
||||||
if (chr == 255) {
|
if (chr == 255) {
|
||||||
chr = str[pos++];
|
chr = str[pos++];
|
||||||
if (chr == 3)
|
if (chr == 3) // 'Wait'
|
||||||
break;
|
break;
|
||||||
if (chr == 8) {
|
if (chr == 8) { // 'Verb on next line'
|
||||||
if (a == 1) {
|
if (a == 1) {
|
||||||
curw = 1;
|
curw = 1;
|
||||||
} else {
|
} else {
|
||||||
|
@ -108,11 +108,11 @@ void CharsetRenderer::addLinebreaks(int a, byte *str, int pos, int maxwidth)
|
||||||
pos += 2;
|
pos += 2;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (chr == 1) {
|
if (chr == 1) { // 'Newline'
|
||||||
curw = 1;
|
curw = 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (chr == 2)
|
if (chr == 2) // 'Don't terminate with \n'
|
||||||
break;
|
break;
|
||||||
if (chr == 14) {
|
if (chr == 14) {
|
||||||
int set = str[pos] | (str[pos + 1] << 8);
|
int set = str[pos] | (str[pos + 1] << 8);
|
||||||
|
@ -746,6 +746,7 @@ while ((ptr[num++] = chr = *msg++) != 0) {
|
||||||
addStringToStack(READ_LE_UINT16(ptr + num));
|
addStringToStack(READ_LE_UINT16(ptr + num));
|
||||||
num += 2;
|
num += 2;
|
||||||
break;
|
break;
|
||||||
|
case 3:
|
||||||
case 9:
|
case 9:
|
||||||
//#if defined(DOTT)
|
//#if defined(DOTT)
|
||||||
case 10:
|
case 10:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue