Rename opcode

svn-id: r15581
This commit is contained in:
Travis Howell 2004-10-17 06:32:58 +00:00
parent eaa65d57dd
commit cb12a2a0a1
6 changed files with 27 additions and 29 deletions

View File

@ -802,7 +802,7 @@ protected:
/* HE version 80 script opcodes */
void o80_unknown45();
void o80_unknown48();
void o80_unknown49();
void o80_getSoundVar();
void o80_localizeArrayToRoom();
void o80_readConfigFile();
void o80_writeConfigFile();

View File

@ -316,7 +316,7 @@ void ScummEngine_v100he::setupOpcodes() {
/* D8 */
OPCODE(o72_unknown5A),
OPCODE(o6_isSoundRunning),
OPCODE(o80_unknown49),
OPCODE(o80_getSoundVar),
OPCODE(o100_unknown25),
/* DC */
OPCODE(o90_sqrt),

View File

@ -412,7 +412,12 @@ void ScummEngine_v70he::o70_startSound() {
_heSndFlags |= 4;
break;
case 23:
debug(1,"o70_startSound: case 29 (%d, %d, %d)", pop(), pop(), pop());
{
int value = pop();
int var = pop();
int snd = pop();
debug(1,"o70_startSound: case 29 (snd %d, var %d, value %d)", snd, var, value);
}
break;
case 56:
_heSndFlags |= 2;

View File

@ -135,7 +135,7 @@ void ScummEngine_v80he::setupOpcodes() {
OPCODE(o6_wordArrayWrite),
/* 48 */
OPCODE(o80_unknown48),
OPCODE(o80_unknown49),
OPCODE(o80_getSoundVar),
OPCODE(o80_localizeArrayToRoom),
OPCODE(o6_wordArrayIndexedWrite),
/* 4C */
@ -378,24 +378,22 @@ const char *ScummEngine_v80he::getOpcodeDesc(byte i) {
}
void ScummEngine_v80he::o80_unknown45() {
// Sound related
// Loads SBNG sound resource
byte subOp = fetchScriptByte();
switch (subOp) {
case 27:
pop();
//loadSBNG(_heSBNGId, pop();
break;
case 217:
//loadSBNG(_heSBNGId, -1);
break;
case 232:
_heSndSoundId = pop();
break;
case 255:
//Case doesn't match disasm.
_sound->addSoundToQueue(_heSndSoundId);
//_heSBNGId = pop();
break;
default:
warning("o80_unknown45: default type %d", subOp);
warning("o80_unknown45: default case %d", subOp);
}
debug(1,"o80_unknown45 stub (%d)",subOp);
}
@ -417,25 +415,14 @@ void ScummEngine_v80he::o80_unknown48() {
push(val);
}
void ScummEngine_v80he::o80_unknown49() {
// Sound related
int result = 0;
int subOp = pop();
void ScummEngine_v80he::o80_getSoundVar() {
// Checks sound variable
int var = pop();
int snd = pop();
switch (subOp) {
case 0:
result = !_sound->isSoundRunning(snd);
break;
case 1:
result = _sound->isSoundRunning(snd);
break;
default:
warning("o80_unknown49: default type %d", subOp);
}
push (result);
debug(1,"o80_unknown49 stub (%d, %d)", subOp, snd);
checkRange(27, 0, var, "Illegal sound variable %d");
push (_rnd.getRandomNumber(3));
debug(1,"o80_getSoundVar stub (snd %d, var %d)", snd, var);
}
void ScummEngine_v80he::o80_localizeArrayToRoom() {

View File

@ -135,7 +135,7 @@ void ScummEngine_v90he::setupOpcodes() {
OPCODE(o6_wordArrayWrite),
/* 48 */
OPCODE(o80_unknown48),
OPCODE(o80_unknown49),
OPCODE(o80_getSoundVar),
OPCODE(o80_localizeArrayToRoom),
OPCODE(o6_wordArrayIndexedWrite),
/* 4C */

View File

@ -270,6 +270,11 @@ void Sound::playSound(int soundID, int heOffset, int heChannel, int heFlags) {
ptr += 8 + READ_BE_UINT32(ptr + 12);
}
if (READ_UINT32(ptr) == MKID('SBNG')) {
ptr += READ_BE_UINT32(ptr + 4);
warning("playSound: Skipped SBNG block");
}
if (READ_UINT32(ptr) != MKID('SDAT')) {
warning("playSound: Invalid sound %d", soundID);
return; // abort
@ -663,6 +668,7 @@ void Sound::startTalkSound(uint32 offset, uint32 b, int mode, PlayingSoundHandle
_sfxFile->seek(offset + 32, SEEK_SET);
if (_sfxFile->readUint32LE() == TO_LE_32(MKID('SBNG'))) {
warning("startTalkSound: Skipped SBNG block");
// Skip the SBNG, so we end up at the SDAT chunk
extra = _sfxFile->readUint32BE();
_sfxFile->seek(extra - 4, SEEK_CUR);