From f23cf81ace8456ddf8a3d5aff223ffdaabe2680c Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Sun, 30 Jan 2005 05:34:04 +0000 Subject: [PATCH] HE100 difference svn-id: r16703 --- scumm/intern.h | 2 ++ scumm/script_v100he.cpp | 63 +++++++++++++++++++++++++++++++++++++++-- scumm/sound.cpp | 2 +- 3 files changed, 64 insertions(+), 3 deletions(-) diff --git a/scumm/intern.h b/scumm/intern.h index de77eb84cdb..10c96718206 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -940,9 +940,11 @@ protected: void o100_quitPauseRestart(); void o100_cursorCommand(); void o100_wait(); + void o100_writeFile(); void o100_getResourceSize(); void o100_unknown27(); void o100_getPaletteData(); + void o100_readFile(); void o100_unknown25(); void o100_unknown29(); }; diff --git a/scumm/script_v100he.cpp b/scumm/script_v100he.cpp index 8dc314472a7..8fa632a0425 100644 --- a/scumm/script_v100he.cpp +++ b/scumm/script_v100he.cpp @@ -221,7 +221,7 @@ void ScummEngine_v100he::setupOpcodes() { OPCODE(o6_walkActorToObj), OPCODE(o6_walkActorTo), /* 90 */ - OPCODE(o72_writeFile), + OPCODE(o100_writeFile), OPCODE(o72_writeINI), OPCODE(o80_writeConfigFile), OPCODE(o6_abs), @@ -304,7 +304,7 @@ void ScummEngine_v100he::setupOpcodes() { OPCODE(o6_getRandomNumber), OPCODE(o6_getRandomNumberRange), OPCODE(o6_invalid), - OPCODE(o72_readFile), + OPCODE(o100_readFile), /* D4 */ OPCODE(o72_readINI), OPCODE(o80_readConfigFile), @@ -1525,6 +1525,31 @@ void ScummEngine_v100he::o100_wait() { o6_breakHere(); } +void ScummEngine_v100he::o100_writeFile() { + int16 resID = pop(); + int slot = pop(); + byte subOp = fetchScriptByte(); + + switch (subOp) { + case 5: + fetchScriptByte(); + writeFileFromArray(slot, resID); + break; + case 42: + _hFileTable[slot].writeUint16LE(resID); + break; + case 43: + _hFileTable[slot].writeUint32LE(resID); + break; + case 45: + _hFileTable[slot].writeByte(resID); + break; + default: + error("o100_writeFile: default case %d", subOp); + } + debug(1, "o100_writeFile: slot %d, subOp %d", slot, subOp); +} + void ScummEngine_v100he::o100_getResourceSize() { int size = 0, type; @@ -1714,6 +1739,40 @@ void ScummEngine_v100he::o100_getPaletteData() { debug(1,"o100_getPaletteData stub (%d)", subOp); } +void ScummEngine_v100he::o100_readFile() { + int slot, val; + int32 size; + byte subOp = fetchScriptByte(); + + switch (subOp) { + case 5: + fetchScriptByte(); + size = pop(); + slot = pop(); + val = readFileToArray(slot, size); + push(val); + break; + case 42: + slot = pop(); + val = _hFileTable[slot].readUint16LE(); + push(val); + break; + case 43: + slot = pop(); + val = _hFileTable[slot].readUint32LE(); + push(val); + break; + case 45: + slot = pop(); + val = _hFileTable[slot].readByte(); + push(val); + break; + default: + error("o100_readFile: default case %d", subOp); + } + debug(1, "o100_readFile: slot %d, subOp %d val %d", slot, subOp, val); +} + void ScummEngine_v100he::o100_unknown25() { int args[16]; diff --git a/scumm/sound.cpp b/scumm/sound.cpp index 427f411f9bc..cadeb610983 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -277,7 +277,7 @@ void Sound::playSound(int soundID, int heOffset, int heChannel, int heFlags) { if (READ_UINT32(ptr) == MKID('SBNG')) { ptr += READ_BE_UINT32(ptr + 4); - warning("playSound: Skipped SBNG block"); + debug(2, "playSound: Skipped SBNG block"); } if (READ_UINT32(ptr) != MKID('SDAT')) {