mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-28 15:26:12 +00:00
Patch 622386: do_command(256) implementation, Sam and Max
svn-id: r5134
This commit is contained in:
parent
f6c731a0a4
commit
69c7a8b572
@ -1438,12 +1438,14 @@ 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?
|
||||
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;
|
||||
case 15:
|
||||
// Sam & Max: Unconditional Jump?
|
||||
@ -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,6 +1507,9 @@ int32 IMuseInternal::do_command(int a, int b, int c, int d, int e, int f, int g,
|
||||
|
||||
switch (cmd) {
|
||||
case 0:
|
||||
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
|
||||
@ -2141,6 +2145,8 @@ void Player::parse_sysex(byte *p, uint len)
|
||||
_deferred_do_command [2],
|
||||
_deferred_do_command [3],
|
||||
0, 0, 0, 0);
|
||||
} else {
|
||||
_def_do_command_trigger = *p;
|
||||
} // end if
|
||||
} // end if
|
||||
break;
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user