aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--akos.cpp10
-rw-r--r--resource.cpp28
-rw-r--r--script_v2.cpp2
-rw-r--r--scumm.h5
-rw-r--r--vars.cpp4
5 files changed, 47 insertions, 2 deletions
diff --git a/akos.cpp b/akos.cpp
index b5a444bc43..d8e7cec668 100644
--- a/akos.cpp
+++ b/akos.cpp
@@ -583,7 +583,15 @@ void Scumm::akos_codec1(AkosRenderer * ar)
int step;
/* implement custom scale table */
- ar->v1.scaletable = default_scale_table;
+
+ if(isGlobInMemory(rtString,_vars[VAR_CUSTOMSCALETABLE]))
+ {
+ ar->v1.scaletable = getStringAddressVar(VAR_CUSTOMSCALETABLE);
+ }
+ else
+ {
+ ar->v1.scaletable = default_scale_table;
+ }
/* Setup color decoding variables */
num_colors = getResourceDataSize(ar->akpl);
diff --git a/resource.cpp b/resource.cpp
index 5edf1e1776..2d33eaad13 100644
--- a/resource.cpp
+++ b/resource.cpp
@@ -652,6 +652,22 @@ byte *Scumm::getStringAddress(int i)
return b;
}
+byte *Scumm::getStringAddressVar(int i)
+{
+ byte *addr;
+
+ addr=getResourceAddress(rtString,_vars[i]);
+
+ if(addr==NULL)
+ error("NULL string var %d slot %d",i,_vars[i]);
+
+ if (_features & GF_NEW_OPCODES)
+ return ((ArrayHeader *)addr)->data;
+
+ return(addr);
+
+}
+
void Scumm::setResourceCounter(int type, int idx, byte flag)
{
res.flags[type][idx] &= ~RF_USAGE;
@@ -1149,6 +1165,17 @@ void Scumm::allocateArrays()
allocResTypeData(rtMatrix, MKID('NONE'), 10, "boxes", 0);
}
+
+uint32 Scumm::isGlobInMemory(int type, int index)
+{
+ validateResource("isGlobInMemory",type,index);
+
+ if(res.address[type][index]==NULL)
+ return(0);
+
+ return(1);
+}
+
uint16 newTag2Old(uint32 oldTag)
{
switch (oldTag) {
@@ -1189,3 +1216,4 @@ uint16 newTag2Old(uint32 oldTag)
return (0);
}
}
+
diff --git a/script_v2.cpp b/script_v2.cpp
index 65326c44aa..f4800536c8 100644
--- a/script_v2.cpp
+++ b/script_v2.cpp
@@ -2682,7 +2682,7 @@ void Scumm::o6_miscOps()
case 6:
SmushPlayer localSp;
localSp.sm = this;
- localSp.startVideo(args[1], getStringAddress(_vars[0xf6 / 2]));
+ localSp.startVideo(args[1], getStringAddressVar(VAR_VIDEONAME));
break;
case 7:
warning("o6_miscOps: stub7()");
diff --git a/scumm.h b/scumm.h
index 781a87d98e..9174cdd835 100644
--- a/scumm.h
+++ b/scumm.h
@@ -813,6 +813,7 @@ public:
void nukeResource(int type, int i);
byte *getResourceAddress(int type, int i);
byte *getStringAddress(int i);
+ byte *getStringAddressVar(int i);
void ensureResourceLoaded(int type, int i);
int loadResource(int type, int i);
int getResourceRoomNr(int type, int index);
@@ -827,6 +828,7 @@ public:
void loadRoomObjectsSmall();
void readArrayFromIndexFile();
void readMAXS();
+ uint32 isGlobInMemory(int type, int index);
virtual void readIndexFile();
virtual void loadCharset(int i);
void nukeCharset(int i);
@@ -1696,6 +1698,9 @@ public:
byte VAR_DEFAULT_TALK_DELAY;
byte VAR_CHARSET_MASK;
+ byte VAR_CUSTOMSCALETABLE;
+ byte VAR_VIDEONAME;
+
void launch();
static Scumm *createFromDetector(GameDetector *detector, OSystem *syst);
diff --git a/vars.cpp b/vars.cpp
index 3b7c40e832..eb2c8a88b2 100644
--- a/vars.cpp
+++ b/vars.cpp
@@ -185,6 +185,10 @@ void Scumm::setupScummVarsNew()
VAR_CHARSET_MASK = 119;
+ VAR_VIDEONAME = 0xF6/2;
+
+ VAR_CUSTOMSCALETABLE = 131;
+
//VAR_V5_DRAWFLAGS = 9;
VAR_MI1_TIMER = 14;
VAR_V5_OBJECT_LO = 15;