Skip to content

Commit fc90562

Browse files
committed
fix(scummrp): Make small adjustments to MONKEY1-VGA workarounds (#54, #69)
I'll still mark the latest changes for this as "experimental" for now, but I spent some time investigating this with Claude Fable 5, and it looks like our v4 issue is unrelated to the one I was referencing for ScummPacker. Adjust the behavior, comments and warnings accordingly. Assisted-by: Claude:claude-fable-5
1 parent a161ec6 commit fc90562

1 file changed

Lines changed: 10 additions & 16 deletions

File tree

‎src/ScummRp/toc.cpp‎

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -107,28 +107,22 @@ void TableOfContent::merge(const TableOfContent &t)
107107
{
108108
if (_toc[i].roomId != t._toc[i].roomId)
109109
{
110-
// HACK: Changing some lines in the floppy VGA releases of Monkey Island 1
111-
// (at least the English 1.0 and 1.1 ones) will eventually trigger the
112-
// "different roomIds" exception below, with `t._toc[i].roomId` being equal
113-
// to the "invalid" `(byte)-1` value, for some reason.
110+
// HACK: It appears that MONKEY1-VGA (v4) had bugs in its index packer,
111+
// leaving dead entries not pointing at any block header. For this
112+
// particular case, we need to let the invalidated entry be written back
113+
// to the rebuilt index (as the game never used it anyway).
114114
//
115-
// It is not know whether this is due to MONKEY1-VGA (v4) having known,
116-
// original packing bugs (see for reference how ScummPacker handled this
117-
// in commit 96f34dc6a2b947dea259382387c574329c819efe), and/or if ScummRp
118-
// is doing something wrong for v4.
119-
//
120-
// Moreover, fixing the roomId on the fly here, and doing this at this
121-
// stage, could be wrong and harmful. We'll try to be helpful to users
122-
// and go on, but printing a warning is crucial, become it may corrupt the
123-
// game resources in some ways.
115+
// Note: ScummPacker also had to work around some oddities for this game
116+
// (see its commit 96f34dc6a2b947dea259382387c574329c819efe), but it
117+
// appears to have been related to the "RO" Roland sound resources,
118+
// instead; a quirk which we seem to already handle fine.
124119
//
125120
// See:
126121
// - <https://github.com/dwatteau/scummtr/issues/54>
127122
// - <https://github.com/dwatteau/scummtr/issues/69>
128-
if (t._toc[i].roomId == (byte)-1 && ScummRp::game.id == GID_MONKEY && ScummRp::game.version == 4)
123+
if (t._toc[i].roomId == (byte)-1 && t._toc[i].offset == -1 && ScummRp::game.id == GID_MONKEY && ScummRp::game.version == 4)
129124
{
130-
ScummIO::warning("Original MONKEY1-VGA dodgy room data found during TOC merge; trying to work around it, but unexpected results may happen");
131-
t._toc[i].roomId = _toc[i].roomId;
125+
ScummIO::warning(xsprintf("Original dodgy room data found during TOC merge (%s #%i); ignoring it, but this is still experimental", TableOfContent::typeToStr(_type), i));
132126
}
133127
else
134128
{

0 commit comments

Comments
 (0)