From 97371135c624aa4e8a0441bd6310d7dfd204e280 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 27 Apr 2016 23:01:16 +0200 Subject: SCUMM HE: Better names for some WizParams fields --- engines/scumm/he/script_v100he.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'engines/scumm/he/script_v100he.cpp') diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp index afc6633ef6..e69308c067 100644 --- a/engines/scumm/he/script_v100he.cpp +++ b/engines/scumm/he/script_v100he.cpp @@ -1310,36 +1310,36 @@ void ScummEngine_v100he::o100_wizImageOps() { if (_wizParams.img.resNum) _wiz->processWizImage(&_wizParams); break; - case 128: - _wizParams.field_239D = pop(); - _wizParams.field_2399 = pop(); - _wizParams.field_23A5 = pop(); - _wizParams.field_23A1 = pop(); - copyScriptString(_wizParams.string2, sizeof(_wizParams.string2)); + case 128: // Font create _wizParams.processMode = 15; + _wizParams.fontProperties.bgColor = pop(); + _wizParams.fontProperties.fgColor = pop(); + _wizParams.fontProperties.size = pop(); + _wizParams.fontProperties.style = pop(); + copyScriptString(_wizParams.fontProperties.fontName, sizeof(_wizParams.fontProperties.fontName)); break; case 129: _wizParams.processMode = 14; break; - case 130: + case 130: // Font render _wizParams.processMode = 16; - _wizParams.field_23AD = pop(); - _wizParams.field_23A9 = pop(); - copyScriptString(_wizParams.string1, sizeof(_wizParams.string1)); + _wizParams.fontProperties.yPos = pop(); + _wizParams.fontProperties.xPos = pop(); + copyScriptString(_wizParams.fontProperties.string, sizeof(_wizParams.fontProperties.string)); break; case 131: _wizParams.processMode = 13; break; - case 133: + case 133: // Render ellipse _wizParams.processMode = 17; - _wizParams.field_23CD = pop(); - _wizParams.field_23C9 = pop(); - _wizParams.field_23C5 = pop(); - _wizParams.field_23C1 = pop(); - _wizParams.field_23BD = pop(); - _wizParams.field_23B9 = pop(); - _wizParams.field_23B5 = pop(); - _wizParams.field_23B1 = pop(); + _wizParams.ellipseProperties.color = pop(); + _wizParams.ellipseProperties.lod = pop(); + _wizParams.ellipseProperties.ky = pop(); + _wizParams.ellipseProperties.kx = pop(); + _wizParams.ellipseProperties.qy = pop(); + _wizParams.ellipseProperties.qx = pop(); + _wizParams.ellipseProperties.py = pop(); + _wizParams.ellipseProperties.px = pop(); break; case 134: _wizParams.processFlags |= kWPFFillColor | kWPFClipBox2; -- cgit v1.2.3 From f86daf67e38d4d33181899bac97ac01f7461c338 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 7 May 2016 11:16:20 +0200 Subject: SCUMM HE: Added debug output --- engines/scumm/he/script_v100he.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/scumm/he/script_v100he.cpp') diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp index e69308c067..7d56138247 100644 --- a/engines/scumm/he/script_v100he.cpp +++ b/engines/scumm/he/script_v100he.cpp @@ -1997,6 +1997,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { _sprite->setSpriteFlagRemapPalette(spriteId, args[0]); break; default: + warning("Unknown sprite property %d for sprite %d", args[0], spriteId); break; } break; -- cgit v1.2.3 From cc6be145b74171d252e140e5436e99781a2d4fd9 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 14 May 2016 15:29:11 +0200 Subject: SCUMM HE: Fixes and comments to video playback code --- engines/scumm/he/script_v100he.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'engines/scumm/he/script_v100he.cpp') diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp index 7d56138247..1ee46a20b3 100644 --- a/engines/scumm/he/script_v100he.cpp +++ b/engines/scumm/he/script_v100he.cpp @@ -2236,40 +2236,43 @@ void ScummEngine_v100he::o100_videoOps() { byte subOp = fetchScriptByte(); switch (subOp) { - case 0: + case 0: // SO_INIT memset(_videoParams.filename, 0, sizeof(_videoParams.filename)); _videoParams.status = 0; _videoParams.flags = 0; - _videoParams.unk2 = pop(); + _videoParams.number = pop(); _videoParams.wizResNum = 0; + + if (_videoParams.number != 1 && _videoParams.number != -1) + warning("o100_videoOps: number: %d", _videoParams.number); break; - case 19: + case 19: // SO_CLOSE _videoParams.status = 19; break; - case 40: + case 40: // SO_IMAGE _videoParams.wizResNum = pop(); if (_videoParams.wizResNum) _videoParams.flags |= 2; break; - case 47: + case 47: // SO_LOAD copyScriptString(_videoParams.filename, sizeof(_videoParams.filename)); _videoParams.status = 47; break; - case 67: + case 67: // SO_SET_FLAGS _videoParams.flags |= pop(); break; - case 92: - if (_videoParams.status == 47) { + case 92: // SO_END + if (_videoParams.status == 47) { // SO_LOAD // Start video if (_videoParams.flags == 0) _videoParams.flags = 4; - if (_videoParams.flags == 2) { + if (_videoParams.flags & 2) { VAR(119) = _moviePlay->load(convertFilePath(_videoParams.filename), _videoParams.flags, _videoParams.wizResNum); } else { VAR(119) = _moviePlay->load(convertFilePath(_videoParams.filename), _videoParams.flags); } - } else if (_videoParams.status == 19) { + } else if (_videoParams.status == 19) { // SO_CLOSE // Stop video _moviePlay->close(); } -- cgit v1.2.3 From 6d941a359467363d1f1c9de78455e0655b612323 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 14 May 2016 15:58:21 +0200 Subject: SCUMM HE: Marked sprite subopcodes and better field names --- engines/scumm/he/script_v100he.cpp | 62 +++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'engines/scumm/he/script_v100he.cpp') diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp index 1ee46a20b3..59377024de 100644 --- a/engines/scumm/he/script_v100he.cpp +++ b/engines/scumm/he/script_v100he.cpp @@ -1781,14 +1781,14 @@ void ScummEngine_v100he::o100_setSpriteInfo() { byte subOp = fetchScriptByte(); switch (subOp) { - case 0: + case 0: // SO_INIT _curMaxSpriteId = pop(); _curSpriteId = pop(); if (_curSpriteId > _curMaxSpriteId) SWAP(_curSpriteId, _curMaxSpriteId); break; - case 2: + case 2: // SO_ANGLE args[0] = pop(); if (_curSpriteId > _curMaxSpriteId) break; @@ -1799,7 +1799,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { for (; spriteId <= _curMaxSpriteId; spriteId++) _sprite->setSpriteAngle(spriteId, args[0]); break; - case 3: + case 3: // SO_ANIMATION args[0] = pop(); if (_curSpriteId > _curMaxSpriteId) break; @@ -1810,7 +1810,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { for (; spriteId <= _curMaxSpriteId; spriteId++) _sprite->setSpriteFlagAutoAnim(spriteId, args[0]); break; - case 4: + case 4: // SO_ANIMATION_SPEED args[0] = pop(); if (_curSpriteId > _curMaxSpriteId) break; @@ -1821,7 +1821,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { for (; spriteId <= _curMaxSpriteId; spriteId++) _sprite->setSpriteAnimSpeed(spriteId, args[0]); break; - case 6: + case 6: // SO_AT args[1] = pop(); args[0] = pop(); if (_curSpriteId > _curMaxSpriteId) @@ -1833,7 +1833,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { for (; spriteId <= _curMaxSpriteId; spriteId++) _sprite->setSpritePosition(spriteId, args[0], args[1]); break; - case 7: + case 7: // SO_AT_IMAGE args[0] = pop(); if (_curSpriteId > _curMaxSpriteId) break; @@ -1844,7 +1844,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { for (; spriteId <= _curMaxSpriteId; spriteId++) _sprite->setSpriteSourceImage(spriteId, args[0]); break; - case 16: + case 16: // SO_CLASS n = getStackList(args, ARRAYSIZE(args)); if (_curSpriteId != 0 && _curMaxSpriteId != 0 && n != 0) { int *p = &args[n - 1]; @@ -1867,7 +1867,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { } while (--n); } break; - case 32: + case 32: // SO_ERASE args[0] = pop(); if (_curSpriteId > _curMaxSpriteId) break; @@ -1878,7 +1878,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { for (; spriteId <= _curMaxSpriteId; spriteId++) _sprite->setSpriteFlagEraseType(spriteId, args[0]); break; - case 38: + case 38: // SO_GROUP args[0] = pop(); if (_curSpriteId > _curMaxSpriteId) break; @@ -1889,7 +1889,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { for (; spriteId <= _curMaxSpriteId; spriteId++) _sprite->setSpriteGroup(spriteId, args[0]); break; - case 40: + case 40: // SO_IMAGE args[0] = pop(); if (_curSpriteId > _curMaxSpriteId) break; @@ -1900,7 +1900,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { for (; spriteId <= _curMaxSpriteId; spriteId++) _sprite->setSpriteImage(spriteId, args[0]); break; - case 48: + case 48: // SO_MASK args[0] = pop(); if (_curSpriteId > _curMaxSpriteId) break; @@ -1911,7 +1911,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { for (; spriteId <= _curMaxSpriteId; spriteId++) _sprite->setSpriteMaskImage(spriteId, args[0]); break; - case 49: + case 49: // SO_MOVE args[1] = pop(); args[0] = pop(); if (_curSpriteId > _curMaxSpriteId) @@ -1923,10 +1923,10 @@ void ScummEngine_v100he::o100_setSpriteInfo() { for (; spriteId <= _curMaxSpriteId; spriteId++) _sprite->moveSprite(spriteId, args[0], args[1]); break; - case 52: + case 52: // SO_NAME copyScriptString(string, sizeof(string)); break; - case 53: + case 53: // SO_NEW if (_curSpriteId > _curMaxSpriteId) break; spriteId = _curSpriteId; @@ -1936,7 +1936,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { for (; spriteId <= _curMaxSpriteId; spriteId++) _sprite->resetSprite(spriteId); break; - case 54: + case 54: // SO_NEW_GENERAL_PROPERTY args[1] = pop(); args[0] = pop(); if (_curSpriteId > _curMaxSpriteId) @@ -1948,7 +1948,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { for (; spriteId <= _curMaxSpriteId; spriteId++) _sprite->setSpriteGeneralProperty(spriteId, args[0], args[1]); break; - case 57: + case 57: // SO_PALETTE args[0] = pop(); if (_curSpriteId > _curMaxSpriteId) break; @@ -1959,7 +1959,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { for (; spriteId <= _curMaxSpriteId; spriteId++) _sprite->setSpritePalette(spriteId, args[0]); break; - case 59: + case 59: // SO_PRIORITY args[0] = pop(); if (_curSpriteId > _curMaxSpriteId) break; @@ -1970,7 +1970,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { for (; spriteId <= _curMaxSpriteId; spriteId++) _sprite->setSpritePriority(spriteId, args[0]); break; - case 60: + case 60: // SO_PROPERTY args[1] = pop(); args[0] = pop(); if (_curSpriteId > _curMaxSpriteId) @@ -2001,10 +2001,10 @@ void ScummEngine_v100he::o100_setSpriteInfo() { break; } break; - case 61: + case 61: // SO_RESTART _sprite->resetTables(true); break; - case 65: + case 65: // SO_SCALE args[0] = pop(); if (_curSpriteId > _curMaxSpriteId) break; @@ -2015,7 +2015,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { for (; spriteId <= _curMaxSpriteId; spriteId++) _sprite->setSpriteScale(spriteId, args[0]); break; - case 70: + case 70: // SO_SHADOW args[0] = pop(); if (_curSpriteId > _curMaxSpriteId) break; @@ -2026,7 +2026,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { for (; spriteId <= _curMaxSpriteId; spriteId++) _sprite->setSpriteShadow(spriteId, args[0]); break; - case 73: + case 73: // SO_STATE args[0] = pop(); if (_curSpriteId > _curMaxSpriteId) break; @@ -2037,7 +2037,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { for (; spriteId <= _curMaxSpriteId; spriteId++) _sprite->setSpriteImageState(spriteId, args[0]); break; - case 74: + case 74: // SO_STEP_DIST args[1] = pop(); args[0] = pop(); if (_curSpriteId > _curMaxSpriteId) @@ -2049,7 +2049,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { for (; spriteId <= _curMaxSpriteId; spriteId++) _sprite->setSpriteDist(spriteId, args[0], args[1]); break; - case 75: + case 75: // SO_STEP_DIST_X args[0] = pop(); if (_curSpriteId > _curMaxSpriteId) break; @@ -2062,7 +2062,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { _sprite->setSpriteDist(spriteId, args[0], tmp[1]); } break; - case 76: + case 76: // SO_STEP_DIST_Y args[0] = pop(); if (_curSpriteId > _curMaxSpriteId) break; @@ -2075,7 +2075,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { _sprite->setSpriteDist(spriteId, tmp[0], args[0]); } break; - case 82: + case 82: // SO_UPDATE args[0] = pop(); if (_curSpriteId > _curMaxSpriteId) break; @@ -2086,7 +2086,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { for (; spriteId <= _curMaxSpriteId; spriteId++) _sprite->setSpriteFlagUpdateType(spriteId, args[0]); break; - case 83: + case 83: // SO_VARIABLE args[1] = pop(); args[0] = pop(); if (_curSpriteId > _curMaxSpriteId) @@ -2098,7 +2098,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { for (; spriteId <= _curMaxSpriteId; spriteId++) _sprite->setSpriteUserValue(spriteId, args[0], args[1]); break; - case 88: + case 88: // SO_IMAGE_ZCLIP args[0] = pop(); if (_curSpriteId > _curMaxSpriteId) break; @@ -2107,9 +2107,9 @@ void ScummEngine_v100he::o100_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteField84(spriteId, args[0]); + _sprite->setSpriteZBuffer(spriteId, args[0]); break; - case 89: + case 89: // SO_NEVER_ZCLIP if (_curSpriteId > _curMaxSpriteId) break; spriteId = _curSpriteId; @@ -2117,7 +2117,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteField84(spriteId, 0); + _sprite->setSpriteZBuffer(spriteId, 0); break; default: error("o100_setSpriteInfo: Unknown case %d", subOp); -- cgit v1.2.3 From 8d611a061e4e8369d524048123ebaf9d5a010fc5 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 15 May 2016 10:56:12 +0200 Subject: SCUMM HE: Show stub warnings --- engines/scumm/he/script_v100he.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/scumm/he/script_v100he.cpp') diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp index 59377024de..1caa569349 100644 --- a/engines/scumm/he/script_v100he.cpp +++ b/engines/scumm/he/script_v100he.cpp @@ -659,7 +659,7 @@ void ScummEngine_v100he::o100_arrayOps() { default: error("o100_arrayOps: case 132 unknown type %d)", type); } - debug(0, "o100_arrayOps: case 132 type %d", type); + warning("STUB: o100_arrayOps: case 132 type %d", type); break; case 133: b = pop(); @@ -1110,6 +1110,7 @@ void ScummEngine_v100he::o100_resourceRoutines() { break; case 128: // TODO: Clear Heap + warning("STUB: o100_resourceRoutines: clear Heap"); break; case 129: // Dummy case @@ -2472,6 +2473,7 @@ void ScummEngine_v100he::o100_getSpriteGroupInfo() { pop(); pop(); push(0); + warning("STUB: o100_getSpriteGroupInfo, subop 54"); break; case 59: spriteGroupId = pop(); -- cgit v1.2.3 From 384e45424e4b6a0ad9d8bd3dc8cb0b82c591be1d Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 15 May 2016 10:56:42 +0200 Subject: SCUMM HE: Document o100_arrayOps() --- engines/scumm/he/script_v100he.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'engines/scumm/he/script_v100he.cpp') diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp index 1caa569349..4388433c7e 100644 --- a/engines/scumm/he/script_v100he.cpp +++ b/engines/scumm/he/script_v100he.cpp @@ -549,20 +549,20 @@ void ScummEngine_v100he::o100_arrayOps() { debug(9,"o100_arrayOps: array %d case %d", array, subOp); switch (subOp) { - case 35: + case 35: // SO_FORMATTED_STRING decodeScriptString(string); len = resStrLen(string); data = defineArray(array, kStringArray, 0, 0, 0, len); memcpy(data, string, len); break; - case 77: // SO_ASSIGN_STRING + case 77: // SO_STRING copyScriptString(string, sizeof(string)); len = resStrLen(string); data = defineArray(array, kStringArray, 0, 0, 0, len); memcpy(data, string, len); break; - case 128: // SO_ASSIGN_2DIM_LIST + case 128: // SO_ASSIGN_2DIM_LIST len = getStackList(list, ARRAYSIZE(list)); id = readVar(array); if (id == 0) @@ -572,7 +572,7 @@ void ScummEngine_v100he::o100_arrayOps() { writeArray(array, c, len, list[len]); } break; - case 129: // SO_ASSIGN_INT_LIST + case 129: // SO_ASSIGN_INT_LIST b = pop(); c = pop(); id = readVar(array); @@ -583,7 +583,7 @@ void ScummEngine_v100he::o100_arrayOps() { writeArray(array, 0, b + c, pop()); } break; - case 130: + case 130: // len = getStackList(list, ARRAYSIZE(list)); dim1end = pop(); dim1start = pop(); @@ -607,7 +607,7 @@ void ScummEngine_v100he::o100_arrayOps() { dim2start++; } break; - case 131: + case 131: // SO_COMPLEX_ARRAY_COPY_OPERATION { int a2_dim1end = pop(); int a2_dim1start = pop(); @@ -624,7 +624,7 @@ void ScummEngine_v100he::o100_arrayOps() { copyArray(array, a1_dim2start, a1_dim2end, a1_dim1start, a1_dim1end, array2, a2_dim2start, a2_dim2end, a2_dim1start, a2_dim1end); } break; - case 132: + case 132: // SO_COMPLEX_ARRAY_MATH_OPERATION // TODO: Used by room 2 script 2180 in Moonbase Commander fetchScriptWord(); fetchScriptWord(); @@ -661,7 +661,7 @@ void ScummEngine_v100he::o100_arrayOps() { } warning("STUB: o100_arrayOps: case 132 type %d", type); break; - case 133: + case 133: // SO_RANGE_ARRAY_ASSIGNMENT b = pop(); c = pop(); dim1end = pop(); -- cgit v1.2.3 From 1de6a461ab7fd72b4ab112f99299f13d1edc6416 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 16 May 2016 10:34:07 +0200 Subject: SCUMM HE: Clarify comment --- engines/scumm/he/script_v100he.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/scumm/he/script_v100he.cpp') diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp index 4388433c7e..7fe1d88120 100644 --- a/engines/scumm/he/script_v100he.cpp +++ b/engines/scumm/he/script_v100he.cpp @@ -625,7 +625,7 @@ void ScummEngine_v100he::o100_arrayOps() { } break; case 132: // SO_COMPLEX_ARRAY_MATH_OPERATION - // TODO: Used by room 2 script 2180 in Moonbase Commander + // TODO: Used by room 2 script 2180 in Moonbase Commander (modify-line-of-sight) fetchScriptWord(); fetchScriptWord(); type = pop(); -- cgit v1.2.3 From 3aafeee19c6ebe9c5bd1f1840dd6fc809ed6a87d Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 17 May 2016 11:13:30 +0200 Subject: SCUMM HE: Started work on Complex Array Operations --- engines/scumm/he/script_v100he.cpp | 81 ++++++++++++++++++++++---------------- 1 file changed, 47 insertions(+), 34 deletions(-) (limited to 'engines/scumm/he/script_v100he.cpp') diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp index 7fe1d88120..e6d0cdc8c3 100644 --- a/engines/scumm/he/script_v100he.cpp +++ b/engines/scumm/he/script_v100he.cpp @@ -625,42 +625,55 @@ void ScummEngine_v100he::o100_arrayOps() { } break; case 132: // SO_COMPLEX_ARRAY_MATH_OPERATION - // TODO: Used by room 2 script 2180 in Moonbase Commander (modify-line-of-sight) - fetchScriptWord(); - fetchScriptWord(); - type = pop(); - pop(); - pop(); - pop(); - pop(); - pop(); - pop(); - pop(); - pop(); - dim1end = pop(); - dim1start = pop(); - dim2end = pop(); - dim2start = pop(); - id = readVar(array); - if (id == 0) { - defineArray(array, kDwordArray, dim2start, dim2end, dim1start, dim1end); - } - switch (type) { - case 1: - break; - case 2: - break; - case 3: - break; - case 4: - break; - case 5: + { + // TODO: Used by room 2 script 2180 in Moonbase Commander (modify-line-of-sight) + int a2 = fetchScriptWord(); + int a1 = fetchScriptWord(); + type = pop(); + int a1_dim1end = pop(); + int a1_dim1start = pop(); + int a1_dim2end = pop(); + int a1_dim2start = pop(); + int a2_dim1end = pop(); + int a2_dim1start = pop(); + int a2_dim2end = pop(); + int a2_dim2start = pop(); + dim1end = pop(); + dim1start = pop(); + dim2end = pop(); + dim2start = pop(); + + int a12_num = a1_dim2end - a1_dim2start + 1; + int a11_num = a1_dim1end - a1_dim1start + 1; + int a22_num = a2_dim2end - a2_dim2start + 1; + int a21_num = a2_dim1end - a2_dim1start + 1; + int d12_num = dim2end - dim2start + 1; + int d11_num = dim1end - dim1start + 1; + + id = readVar(array); + if (id == 0) { + defineArray(array, kDwordArray, dim2start, dim2end, dim1start, dim1end); + } + if (a12_num != a22_num || a12_num != d12_num || a11_num != a21_num || a11_num != d11_num) { + error("Operation size mismatch (%d vs %d)(%d vs %d)", a12_num, a22_num, a11_num, a21_num); + } + switch (type) { + case 1: // Addition + break; + case 2: // Subtraction + break; + case 3: // Binary AND + break; + case 4: // Binary OR + break; + case 5: // Binary XOR + break; + default: + error("o100_arrayOps: case 132 unknown type %d)", type); + } + warning("STUB: o100_arrayOps: case 132 type %d", type); break; - default: - error("o100_arrayOps: case 132 unknown type %d)", type); } - warning("STUB: o100_arrayOps: case 132 type %d", type); - break; case 133: // SO_RANGE_ARRAY_ASSIGNMENT b = pop(); c = pop(); -- cgit v1.2.3 From b9158fcf50d9047233823c8290ff999f0a248cfd Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 17 May 2016 20:20:34 +0200 Subject: SCUMM HE: Complete Complex Array Operations subopcode. Used in FOW calculations in Moonbase. --- engines/scumm/he/script_v100he.cpp | 51 ++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 16 deletions(-) (limited to 'engines/scumm/he/script_v100he.cpp') diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp index e6d0cdc8c3..254158bd72 100644 --- a/engines/scumm/he/script_v100he.cpp +++ b/engines/scumm/he/script_v100he.cpp @@ -626,9 +626,9 @@ void ScummEngine_v100he::o100_arrayOps() { break; case 132: // SO_COMPLEX_ARRAY_MATH_OPERATION { - // TODO: Used by room 2 script 2180 in Moonbase Commander (modify-line-of-sight) - int a2 = fetchScriptWord(); - int a1 = fetchScriptWord(); + // Used by room 2 script 2180 in Moonbase Commander (modify-line-of-sight) + int array2 = fetchScriptWord(); + int array1 = fetchScriptWord(); type = pop(); int a1_dim1end = pop(); int a1_dim1start = pop(); @@ -657,20 +657,39 @@ void ScummEngine_v100he::o100_arrayOps() { if (a12_num != a22_num || a12_num != d12_num || a11_num != a21_num || a11_num != d11_num) { error("Operation size mismatch (%d vs %d)(%d vs %d)", a12_num, a22_num, a11_num, a21_num); } - switch (type) { - case 1: // Addition - break; - case 2: // Subtraction - break; - case 3: // Binary AND - break; - case 4: // Binary OR - break; - case 5: // Binary XOR - break; - default: - error("o100_arrayOps: case 132 unknown type %d)", type); + + for (; a1_dim2start <= a1_dim2end; ++a1_dim2start, ++a2_dim2start, ++dim2start) { + int a2dim1 = a2_dim1start; + int a1dim1 = a1_dim1start; + int dim1 = dim1start; + for (; a1dim1 <= a1_dim1end; ++a1dim1, ++a2dim1, ++dim1) { + int val1 = readArray(array1, a1_dim2start, a1dim1); + int val2 = readArray(array2, a2_dim2start, a2dim1); + int res; + + switch (type) { + case 1: // Addition + res = val2 + val1; + break; + case 2: // Subtraction + res = val2 - val1; + break; + case 3: // Binary AND + res = val2 & val1; + break; + case 4: // Binary OR + res = val2 | val1; + break; + case 5: // Binary XOR + res = val2 ^ val1; + break; + default: + error("o100_arrayOps: case 132 unknown type %d)", type); + } + writeArray(array, dim2start, dim1, res); + } } + warning("STUB: o100_arrayOps: case 132 type %d", type); break; } -- cgit v1.2.3 From 64d4d02f484f8d0350bf893cd6d35bf9829188cd Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 18 May 2016 17:34:17 +0200 Subject: SCUMM HE: Document sprite group opcodes --- engines/scumm/he/script_v100he.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'engines/scumm/he/script_v100he.cpp') diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp index 254158bd72..053d1bd44b 100644 --- a/engines/scumm/he/script_v100he.cpp +++ b/engines/scumm/he/script_v100he.cpp @@ -2485,50 +2485,52 @@ void ScummEngine_v100he::o100_getSpriteGroupInfo() { byte subOp = fetchScriptByte(); + warning("o100_getSpriteGroupInfo, subop %d", subOp); + switch (subOp) { - case 5: + case 5: // SO_ARRAY spriteGroupId = pop(); if (spriteGroupId) push(getGroupSpriteArray(spriteGroupId)); else push(0); break; - case 40: + case 40: // SO_IMAGE spriteGroupId = pop(); if (spriteGroupId) push(_sprite->getGroupDstResNum(spriteGroupId)); else push(0); break; - case 54: + case 54: // SO_NEW_GENERAL_PROPERTY // TODO: U32 related pop(); pop(); push(0); warning("STUB: o100_getSpriteGroupInfo, subop 54"); break; - case 59: + case 59: // SO_PRIORITY spriteGroupId = pop(); if (spriteGroupId) push(_sprite->getGroupPriority(spriteGroupId)); else push(0); break; - case 60: + case 60: // SO_PROPERTY type = pop(); spriteGroupId = pop(); if (spriteGroupId) { switch (type) { - case 0: + case 0: // SPRGRPPROP_XMUL push(_sprite->getGroupXMul(spriteGroupId)); break; - case 1: + case 1: // SPRGRPPROP_XDIV push(_sprite->getGroupXDiv(spriteGroupId)); break; - case 2: + case 2: // SPRGRPPROP_YMUL push(_sprite->getGroupYMul(spriteGroupId)); break; - case 3: + case 3: // SPRGRPPROP_YDIV push(_sprite->getGroupYDiv(spriteGroupId)); break; default: @@ -2538,7 +2540,7 @@ void ScummEngine_v100he::o100_getSpriteGroupInfo() { push(0); } break; - case 85: + case 85: // SO_XPOS spriteGroupId = pop(); if (spriteGroupId) { _sprite->getGroupPosition(spriteGroupId, tx, ty); @@ -2547,7 +2549,7 @@ void ScummEngine_v100he::o100_getSpriteGroupInfo() { push(0); } break; - case 86: + case 86: // SO_YPOS spriteGroupId = pop(); if (spriteGroupId) { _sprite->getGroupPosition(spriteGroupId, tx, ty); -- cgit v1.2.3 From 4ed193b51e62891fca2c79b2195aacb83c9b65fb Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 19 May 2016 09:53:34 +0200 Subject: SCUMM HE: Documented more opcodes --- engines/scumm/he/script_v100he.cpp | 48 +++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'engines/scumm/he/script_v100he.cpp') diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp index 053d1bd44b..cd807f06b8 100644 --- a/engines/scumm/he/script_v100he.cpp +++ b/engines/scumm/he/script_v100he.cpp @@ -942,10 +942,10 @@ void ScummEngine_v100he::o100_setSpriteGroupInfo() { byte subOp = fetchScriptByte(); switch (subOp) { - case 0: + case 0: // SO_INIT _curSpriteGroupId = pop(); break; - case 6: + case 6: // SO_MOVE value2 = pop(); value1 = pop(); if (!_curSpriteGroupId) @@ -953,7 +953,7 @@ void ScummEngine_v100he::o100_setSpriteGroupInfo() { _sprite->setGroupPosition(_curSpriteGroupId, value1, value2); break; - case 18: + case 18: // SO_CLIPPED value4 = pop(); value3 = pop(); value2 = pop(); @@ -963,10 +963,10 @@ void ScummEngine_v100he::o100_setSpriteGroupInfo() { _sprite->setGroupBounds(_curSpriteGroupId, value1, value2, value3, value4); break; - case 38: + case 38: // SO_GROUP type = pop() - 1; switch (type) { - case 0: + case 0: // SPRGRPOP_MOVE value2 = pop(); value1 = pop(); if (!_curSpriteGroupId) @@ -974,48 +974,48 @@ void ScummEngine_v100he::o100_setSpriteGroupInfo() { _sprite->moveGroupMembers(_curSpriteGroupId, value1, value2); break; - case 1: + case 1: // SPRGRPOP_ORDER value1 = pop(); if (!_curSpriteGroupId) break; _sprite->setGroupMembersPriority(_curSpriteGroupId, value1); break; - case 2: + case 2: // SPRGRPOP_NEW_GROUP value1 = pop(); if (!_curSpriteGroupId) break; _sprite->setGroupMembersGroup(_curSpriteGroupId, value1); break; - case 3: + case 3: // SPRGRPOP_UPDATE_TYPE value1 = pop(); if (!_curSpriteGroupId) break; _sprite->setGroupMembersUpdateType(_curSpriteGroupId, value1); break; - case 4: + case 4: // SPRGRPOP_NEW if (!_curSpriteGroupId) break; _sprite->setGroupMembersResetSprite(_curSpriteGroupId); break; - case 5: + case 5: // SPRGRPOP_ANIMATION_SPEED value1 = pop(); if (!_curSpriteGroupId) break; _sprite->setGroupMembersAnimationSpeed(_curSpriteGroupId, value1); break; - case 6: + case 6: // SPRGRPOP_ANIMATION_TYPE value1 = pop(); if (!_curSpriteGroupId) break; _sprite->setGroupMembersAutoAnimFlag(_curSpriteGroupId, value1); break; - case 7: + case 7: // SPRGRPOP_SHADOW value1 = pop(); if (!_curSpriteGroupId) break; @@ -1026,14 +1026,14 @@ void ScummEngine_v100he::o100_setSpriteGroupInfo() { error("o100_setSpriteGroupInfo subOp 38: Unknown case %d", subOp); } break; - case 40: + case 40: // SO_IMAGE value1 = pop(); if (!_curSpriteGroupId) break; _sprite->setGroupImage(_curSpriteGroupId, value1); break; - case 49: + case 49: // SO_AT value2 = pop(); value1 = pop(); if (!_curSpriteGroupId) @@ -1041,51 +1041,51 @@ void ScummEngine_v100he::o100_setSpriteGroupInfo() { _sprite->moveGroup(_curSpriteGroupId, value1, value2); break; - case 52: + case 52: // SO_NAME copyScriptString(string, sizeof(string)); break; - case 53: + case 53: // SO_NEW if (!_curSpriteGroupId) break; _sprite->resetGroup(_curSpriteGroupId); break; - case 54: + case 54: // SO_NEW_GENERAL_PROPERTY // dummy case pop(); pop(); break; - case 59: + case 59: // SO_PRIORITY value1 = pop(); if (!_curSpriteGroupId) break; _sprite->setGroupPriority(_curSpriteGroupId, value1); break; - case 60: + case 60: // SO_PROPERTY type = pop(); value1 = pop(); if (!_curSpriteGroupId) break; switch (type) { - case 0: + case 0: // SPRGRPPROP_XMUL _sprite->setGroupXMul(_curSpriteGroupId, value1); break; - case 1: + case 1: // SPRGRPPROP_XDIV _sprite->setGroupXDiv(_curSpriteGroupId, value1); break; - case 2: + case 2: // SPRGRPPROP_YMUL _sprite->setGroupYMul(_curSpriteGroupId, value1); break; - case 3: + case 3: // SPRGRPPROP_YDIV _sprite->setGroupYDiv(_curSpriteGroupId, value1); break; default: error("o100_setSpriteGroupInfo subOp 60: Unknown case %d", subOp); } break; - case 89: + case 89: // SO_NEVER_ZCLIP if (!_curSpriteGroupId) break; -- cgit v1.2.3 From b994a02077539c96ddc5423f8b024261b851626a Mon Sep 17 00:00:00 2001 From: Kirben Date: Wed, 25 May 2016 19:51:16 +1000 Subject: SCUMM HE: Document more opcodes. --- engines/scumm/he/script_v100he.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'engines/scumm/he/script_v100he.cpp') diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp index cd807f06b8..2e7b4c4bf5 100644 --- a/engines/scumm/he/script_v100he.cpp +++ b/engines/scumm/he/script_v100he.cpp @@ -356,38 +356,38 @@ void ScummEngine_v100he::o100_actorOps() { // FIXME: check stack parameters debug(0,"o100_actorOps: case 0 UNHANDLED"); break; - case 3: + case 3: // SO_ANIMATION pop(); pop(); pop(); break; - case 4: // SO_ANIMATION_SPEED + case 4: // SO_ANIMATION_SPEED a->setAnimSpeed(pop()); break; - case 6: + case 6: // SO_AT j = pop(); i = pop(); a->putActor(i, j); break; - case 8: + case 8: // SO_BACKGROUND_OFF a->_drawToBackBuf = false; a->_needRedraw = true; a->_needBgReset = true; break; - case 9: + case 9: // SO_BACKGROUND_ON a->drawActorToBackBuf(a->getPos().x, a->getPos().y); break; - case 14: + case 14: // SO_CHARSET a->_charset = pop(); break; - case 18: + case 18: // SO_CLIPPED a->_clipOverride.bottom = pop(); a->_clipOverride.right = pop(); a->_clipOverride.top = pop(); a->_clipOverride.left = pop(); adjustRect(a->_clipOverride); break; - case 22: + case 22: // SO_CONDITION k = getStackList(args, ARRAYSIZE(args)); for (i = 0; i < k; ++i) { a->setUserCondition(args[i] & 0x7F, args[i] & 0x80); @@ -399,7 +399,7 @@ void ScummEngine_v100he::o100_actorOps() { case 27: // SO_DEFAULT a->initActor(0); break; - case 32: + case 32: // SO_ERASE k = pop(); a->setHEFlag(1, k); break; @@ -417,11 +417,11 @@ void ScummEngine_v100he::o100_actorOps() { a->remapActorPaletteColor(i, j); a->_needRedraw = true; break; - case 59: + case 59: // SO_PRIORITY a->_layer = pop(); a->_needRedraw = true; break; - case 63: + case 63: // SO_ROOM_PALETTE a->_hePaletteNum = pop(); a->_needRedraw = true; break; @@ -438,7 +438,7 @@ void ScummEngine_v100he::o100_actorOps() { i = pop(); a->setActorWalkSpeed(i, j); break; - case 78: + case 78: // SO_TALKIE { copyScriptString(string, sizeof(string)); int slot = pop(); @@ -461,7 +461,7 @@ void ScummEngine_v100he::o100_actorOps() { case 89: // SO_NEVER_ZCLIP a->_forceClip = 0; break; - case 128: + case 128: // SO_ACTOR_DEFAULT_CLIPPED _actorClipOverride.bottom = pop(); _actorClipOverride.right = pop(); _actorClipOverride.top = pop(); @@ -517,7 +517,7 @@ void ScummEngine_v100he::o100_actorOps() { case 141: // SO_TALK_COLOR a->_talkColor = pop(); break; - case 142: + case 142: // SO_TALK_CONDITION k = pop(); if (k == 0) k = _rnd.getRandomNumberRng(1, 10); @@ -583,7 +583,7 @@ void ScummEngine_v100he::o100_arrayOps() { writeArray(array, 0, b + c, pop()); } break; - case 130: // + case 130: // SO_COMPLEX_ARRAY_ASSIGNMENT len = getStackList(list, ARRAYSIZE(list)); dim1end = pop(); dim1start = pop(); @@ -1617,13 +1617,13 @@ void ScummEngine_v100he::o100_roomOps() { setPalColor(d, a, b, c); break; - case 129: + case 129: // SO_OBJECT_ORDER b = pop(); a = pop(); swapObjects(a, b); break; - case 130: + case 130: // SO_ROOM_COPY_PALETTE a = pop(); b = pop(); if (_game.features & GF_16BIT_COLOR) @@ -1658,7 +1658,7 @@ void ScummEngine_v100he::o100_roomOps() { setCurrentPalette(a); break; - case 135: + case 135: // SO_ROOM_PALETTE_IN_ROOM b = pop(); a = pop(); setRoomPalette(a, b); @@ -1670,7 +1670,7 @@ void ScummEngine_v100he::o100_roomOps() { _saveLoadFlag = pop(); break; - case 137: + case 137: // SO_ROOM_SAVEGAME_BY_NAME byte buffer[256]; copyScriptString((byte *)buffer, sizeof(buffer)); -- cgit v1.2.3 From 26220269437abc8def270bc2730f56191705fbb1 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 31 May 2016 10:51:49 +0200 Subject: SCUMM HE: Improved debug messages --- engines/scumm/he/script_v100he.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'engines/scumm/he/script_v100he.cpp') diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp index 2e7b4c4bf5..b2dad7ce86 100644 --- a/engines/scumm/he/script_v100he.cpp +++ b/engines/scumm/he/script_v100he.cpp @@ -643,6 +643,11 @@ void ScummEngine_v100he::o100_arrayOps() { dim2end = pop(); dim2start = pop(); + debug(0, "Complex: %d = %d[%d to %d][%d to %d] %c %d[%d to %d][%d to %d]", array, + array1, a1_dim1start, a1_dim2end, a1_dim1start, a1_dim2end, + " +-&|^"[type], + array2, a2_dim1start, a2_dim2end, a2_dim1start, a2_dim2end); + int a12_num = a1_dim2end - a1_dim2start + 1; int a11_num = a1_dim1end - a1_dim1start + 1; int a22_num = a2_dim2end - a2_dim2start + 1; @@ -689,8 +694,6 @@ void ScummEngine_v100he::o100_arrayOps() { writeArray(array, dim2start, dim1, res); } } - - warning("STUB: o100_arrayOps: case 132 type %d", type); break; } case 133: // SO_RANGE_ARRAY_ASSIGNMENT -- cgit v1.2.3 From f1a874df01eb6dbb3ec28ebcd5da59120864d90f Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 2 Jun 2016 07:54:05 +0200 Subject: SCUMM HE: Documented o100_getWizData() --- engines/scumm/he/script_v100he.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'engines/scumm/he/script_v100he.cpp') diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp index b2dad7ce86..4a4c340802 100644 --- a/engines/scumm/he/script_v100he.cpp +++ b/engines/scumm/he/script_v100he.cpp @@ -2575,62 +2575,62 @@ void ScummEngine_v100he::o100_getWizData() { byte subOp = fetchScriptByte(); switch (subOp) { - case 20: + case 20: // SO_COLOR y = pop(); x = pop(); state = pop(); resId = pop(); push(_wiz->getWizPixelColor(resId, state, x, y)); break; - case 26: + case 26: // SO_COUNT resId = pop(); push(_wiz->getWizImageStates(resId)); break; - case 33: + case 33: // SO_FIND y = pop(); x = pop(); state = pop(); resId = pop(); push(_wiz->isWizPixelNonTransparent(resId, state, x, y, 0)); break; - case 39: + case 39: // SO_HEIGHT state = pop(); resId = pop(); _wiz->getWizImageDim(resId, state, w, h); push(h); break; - case 54: + case 54: // SO_NEW_GENERAL_PROPERTY type = pop(); state = pop(); resId = pop(); push(_wiz->getWizImageData(resId, state, type)); break; - case 84: + case 84: // SO_WIDTH state = pop(); resId = pop(); _wiz->getWizImageDim(resId, state, w, h); push(w); break; - case 85: + case 85: // SO_XPOS state = pop(); resId = pop(); _wiz->getWizImageSpot(resId, state, x, y); push(x); break; - case 86: + case 86: // SO_YPOS state = pop(); resId = pop(); _wiz->getWizImageSpot(resId, state, x, y); push(y); break; - case 131: + case 131: // SO_FONT_START pop(); copyScriptString(filename, sizeof(filename)); pop(); push(0); debug(0, "o100_getWizData() case 111 unhandled"); break; - case 132: + case 132: // SO_HISTOGRAM h = pop(); w = pop(); y = pop(); -- cgit v1.2.3 From 6b07163600d6c63acb2c291ee42eaef72dc75cb9 Mon Sep 17 00:00:00 2001 From: Kirben Date: Wed, 22 Jun 2016 11:01:02 +1000 Subject: SCUMM HE: Document sound opcodes. --- engines/scumm/he/script_v100he.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'engines/scumm/he/script_v100he.cpp') diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp index 4a4c340802..d609c069f1 100644 --- a/engines/scumm/he/script_v100he.cpp +++ b/engines/scumm/he/script_v100he.cpp @@ -184,7 +184,7 @@ void ScummEngine_v100he::setupOpcodes() { OPCODE(0x74, o6_delay); OPCODE(0x75, o6_delayMinutes); OPCODE(0x76, o6_delaySeconds); - OPCODE(0x77, o100_startSound); + OPCODE(0x77, o100_soundOps); /* 78 */ OPCODE(0x78, o80_sourceDebug); OPCODE(0x79, o100_setSpriteInfo); @@ -1742,69 +1742,69 @@ void ScummEngine_v100he::o100_setSystemMessage() { } } -void ScummEngine_v100he::o100_startSound() { +void ScummEngine_v100he::o100_soundOps() { byte filename[260]; int var, value; byte subOp = fetchScriptByte(); switch (subOp) { - case 6: + case 6: // SO_AT _heSndFlags |= 16; _heSndOffset = pop(); break; - case 47: + case 47: // SO_LOAD copyScriptString(filename, sizeof(filename)); _heSndSoundId = pop(); if (_heSndSoundId) debug(0, "Load sound %d from file %s\n", _heSndSoundId, filename); break; - case 55: + case 55: // SO_NOW _heSndFlags |= 8; break; - case 83: + case 83: // SO_VARIABLE value = pop(); var = pop(); _heSndSoundId = pop(); ((SoundHE *)_sound)->setSoundVar(_heSndSoundId, var, value); break; - case 92: + case 92: // SO_END _sound->addSoundToQueue(_heSndSoundId, _heSndOffset, _heSndChannel, _heSndFlags); break; - case 128: + case 128: // SO_SOUND_ADD _heSndFlags |= 2; break; - case 129: + case 129: // SO_SOUND_CHANNEL _heSndChannel = pop(); break; - case 130: + case 130: // SO_SOUND_FREQUENCY _heSndFlags |= 64; pop(); break; - case 131: + case 131: // SO_SOUND_LOOPING _heSndFlags |= 1; break; - case 132: // Music - case 134: // Sound + case 132: // SO_SOUND_MODIFY + case 134: // SO_SOUND_START _heSndSoundId = pop(); _heSndOffset = 0; _heSndSoundFreq = 11025; _heSndChannel = VAR(VAR_SOUND_CHANNEL); _heSndFlags = 0; break; - case 133: + case 133: // SO_SOUND_PAN _heSndFlags |= 128; pop(); break; - case 135: + case 135: // SO_SOUND_SOFT _heSndFlags |= 4; break; - case 136: + case 136: // SO_SOUND_VOLUME _heSndFlags |= 32; pop(); break; default: - error("o100_startSound invalid case %d", subOp); + error("o100_soundOps invalid case %d", subOp); } } -- cgit v1.2.3 From 87c5540c2a5b06569545dbc06f81f58e3daafbc6 Mon Sep 17 00:00:00 2001 From: Kirben Date: Wed, 22 Jun 2016 11:45:44 +1000 Subject: SCUMM HE: Update sound flags and queue, for new settings. --- engines/scumm/he/script_v100he.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'engines/scumm/he/script_v100he.cpp') diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp index d609c069f1..714f431188 100644 --- a/engines/scumm/he/script_v100he.cpp +++ b/engines/scumm/he/script_v100he.cpp @@ -1750,7 +1750,7 @@ void ScummEngine_v100he::o100_soundOps() { switch (subOp) { case 6: // SO_AT - _heSndFlags |= 16; + _heSndFlags |= HE_SND_OFFSET; _heSndOffset = pop(); break; case 47: // SO_LOAD @@ -1760,7 +1760,7 @@ void ScummEngine_v100he::o100_soundOps() { debug(0, "Load sound %d from file %s\n", _heSndSoundId, filename); break; case 55: // SO_NOW - _heSndFlags |= 8; + _heSndFlags |= HE_SND_QUICK_START; break; case 83: // SO_VARIABLE value = pop(); @@ -1769,20 +1769,20 @@ void ScummEngine_v100he::o100_soundOps() { ((SoundHE *)_sound)->setSoundVar(_heSndSoundId, var, value); break; case 92: // SO_END - _sound->addSoundToQueue(_heSndSoundId, _heSndOffset, _heSndChannel, _heSndFlags); + _sound->addSoundToQueue(_heSndSoundId, _heSndOffset, _heSndChannel, _heSndFlags, _heSndSoundFreq, _heSndPan, _heSndVol); break; case 128: // SO_SOUND_ADD - _heSndFlags |= 2; + _heSndFlags |= HE_SND_APPEND; break; case 129: // SO_SOUND_CHANNEL _heSndChannel = pop(); break; case 130: // SO_SOUND_FREQUENCY - _heSndFlags |= 64; - pop(); + _heSndFlags |= HE_SND_FREQUENCY; + _heSndSoundFreq = pop(); break; case 131: // SO_SOUND_LOOPING - _heSndFlags |= 1; + _heSndFlags |= HE_SND_LOOP; break; case 132: // SO_SOUND_MODIFY case 134: // SO_SOUND_START @@ -1793,15 +1793,15 @@ void ScummEngine_v100he::o100_soundOps() { _heSndFlags = 0; break; case 133: // SO_SOUND_PAN - _heSndFlags |= 128; - pop(); + _heSndFlags |= HE_SND_PAN; + _heSndPan = pop(); break; case 135: // SO_SOUND_SOFT - _heSndFlags |= 4; + _heSndFlags |= HE_SND_SOFT_SOUND; break; case 136: // SO_SOUND_VOLUME - _heSndFlags |= 32; - pop(); + _heSndFlags |= HE_SND_VOL; + _heSndVol = pop(); break; default: error("o100_soundOps invalid case %d", subOp); -- cgit v1.2.3