Add workaround for script bug in Loom (CD)

svn-id: r21371
This commit is contained in:
Travis Howell 2006-03-19 02:50:51 +00:00
parent cbf3c06c1d
commit 79bd731041
3 changed files with 16 additions and 7 deletions

View File

@ -195,6 +195,8 @@ class ScummEngine_v4 : public ScummEngine_v5 {
public:
ScummEngine_v4(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16], SubstResFileNames subst);
virtual void scummInit();
protected:
virtual void readIndexFile();
virtual void loadCharset(int no);

View File

@ -2306,12 +2306,9 @@ void ScummEngine_v5::o5_stringOps() {
b = getVarOrDirectByte(PARAM_2);
c = getVarOrDirectByte(PARAM_3);
ptr = getResourceAddress(rtString, a);
if (!(_game.id == GID_LOOM && _game.version == 4)) { /* FIXME - LOOM256 */
if (ptr == NULL)
error("String %d does not exist", a);
ptr[b] = c;
}
if (ptr == NULL)
error("String %d does not exist", a);
ptr[b] = c;
break;
case 4: /* get string char */

View File

@ -1543,6 +1543,17 @@ void ScummEngine_v2::scummInit() {
_inventoryOffset = 0;
}
void ScummEngine_v4::scummInit() {
ScummEngine::scummInit();
// WORKAROUND for bug in boot script of Loom (CD)
// The boot script sets the characters of string 21,
// before creating the string.resource.
if (_game.id == GID_LOOM) {
res.createResource(rtString, 21, 12);
}
}
void ScummEngine_v6::scummInit() {
ScummEngine::scummInit();
setDefaultCursor();
@ -1623,7 +1634,6 @@ void ScummEngine_v99he::scummInit() {
int len = resStrLen(basename);
ArrayHeader *ah = defineArray(129, kStringArray, 0, 0, 0, len);
memcpy(ah->data, basename, len);
}
#endif