aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scumm/intern.h2
-rw-r--r--scumm/script_v72he.cpp38
-rw-r--r--scumm/script_v80he.cpp2
-rw-r--r--scumm/script_v90he.cpp2
4 files changed, 36 insertions, 8 deletions
diff --git a/scumm/intern.h b/scumm/intern.h
index d22af623f6..292f03e403 100644
--- a/scumm/intern.h
+++ b/scumm/intern.h
@@ -773,7 +773,7 @@ protected:
void o72_unknownF4();
void o72_unknownF5();
void o72_unknownF6();
- void o72_unknownF8();
+ void o72_getResourceSize();
void o72_setFilePath();
void o72_unknownFA();
};
diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp
index 7f6c4df301..a31c8ae089 100644
--- a/scumm/script_v72he.cpp
+++ b/scumm/script_v72he.cpp
@@ -355,7 +355,7 @@ void ScummEngine_v72he::setupOpcodes() {
OPCODE(o72_unknownF6),
OPCODE(o6_invalid),
/* F8 */
- OPCODE(o72_unknownF8),
+ OPCODE(o72_getResourceSize),
OPCODE(o72_setFilePath),
OPCODE(o72_unknownFA),
OPCODE(o70_polygonOps),
@@ -2411,12 +2411,40 @@ void ScummEngine_v72he::o72_unknownF6() {
debug(1,"stub o72_unknownF6");
}
-void ScummEngine_v72he::o72_unknownF8() {
- int id = pop();
+void ScummEngine_v72he::o72_getResourceSize() {
+ int size, type;
+
+ int idx = pop();
byte subOp = fetchScriptByte();
- push(10);
- debug(1,"stub o72_unknownF8: subOp %d, id %d", subOp, id);
+ switch (subOp) {
+ case 13:
+ if (idx > _numSounds) {
+ // TODO Music resource size
+ push(100);
+ return;
+ }
+ type = rtSound;
+ break;
+ case 14:
+ type = rtRoomImage;
+ break;
+ case 15:
+ type = rtImage;
+ break;
+ case 16:
+ type = rtCostume;
+ break;
+ case 17:
+ type = rtScript;
+ break;
+ default:
+ error("o72_getResourceSize: default type %d", subOp);
+ }
+
+ const byte *ptr = getResourceAddress(type, idx);
+ size = READ_BE_UINT32(ptr + 4) - 8;
+ push(size);
}
void ScummEngine_v72he::o72_setFilePath() {
diff --git a/scumm/script_v80he.cpp b/scumm/script_v80he.cpp
index 11ad121930..6c83c124b5 100644
--- a/scumm/script_v80he.cpp
+++ b/scumm/script_v80he.cpp
@@ -354,7 +354,7 @@ void ScummEngine_v80he::setupOpcodes() {
OPCODE(o72_unknownF6),
OPCODE(o6_invalid),
/* F8 */
- OPCODE(o72_unknownF8),
+ OPCODE(o72_getResourceSize),
OPCODE(o72_setFilePath),
OPCODE(o72_unknownFA),
OPCODE(o70_polygonOps),
diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp
index 9fdba4b9f2..6557a04897 100644
--- a/scumm/script_v90he.cpp
+++ b/scumm/script_v90he.cpp
@@ -354,7 +354,7 @@ void ScummEngine_v90he::setupOpcodes() {
OPCODE(o72_unknownF6),
OPCODE(o6_invalid),
/* F8 */
- OPCODE(o72_unknownF8),
+ OPCODE(o72_getResourceSize),
OPCODE(o72_setFilePath),
OPCODE(o72_unknownFA),
OPCODE(o70_polygonOps),