diff options
-rw-r--r-- | akos.cpp | 10 | ||||
-rw-r--r-- | resource.cpp | 28 | ||||
-rw-r--r-- | script_v2.cpp | 2 | ||||
-rw-r--r-- | scumm.h | 5 | ||||
-rw-r--r-- | vars.cpp | 4 |
5 files changed, 47 insertions, 2 deletions
@@ -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()"); @@ -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); @@ -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; |