dwatteau / scummtr

Fan translation tools for LucasArts SCUMM games
MIT License
24 stars 4 forks source link

Missing opcode causes fatal error in MANIAC-V2-EN #12

Open dwatteau opened 3 years ago

dwatteau commented 3 years ago

ScummTR fails on MANIAC-PC-V2-EN (which can be bought on GOG, or extracted from the DOTT Remaster which is also on GOG), probably because of a script error:

$ scummtr -cw -l en -gp maniacv2 . -of tmp.txt

ERROR: Script error at 0x2449 in 07.LFL (roomOps) [007:SCv2#0059]

MANIAC-PC-V1-EN and MANIAC-PC-V2-FR don't have this problem.

descumm (from ScummVM-tools) also has troubles with this script:

$ descumm -2 ./DUMP/LFv2_0007/SCv2_0059

ERROR: do_room_ops_old: unknown subop 12!

Indeed, here's how the script is interpreted on MANIAC-PC-V1-EN:

[00EF] (62) stopScript(0);
[00F1] (49) faceActor(116,VAR_KEYPRESS);
ERROR: do_room_ops_old: unknown subop 12!

while MANIAC-PC-V1-FR looks correct:

[0115] (62) stopScript(0);
[0117] (D8) printEgo("Il est déjà plein."); 
[0128] (A0) stopObjectCode();

It looks like the erroneous script missed a D8 (printEgo()) opcode, and directly used a 49 byte (which is interpreted as as bogus faceActor() opcode) instead of the intended D849... sequence (starting a call to printEgo("I)...). It seems that adding the missing D8 byte would fix this, but then offsets & all must be fixed.

dwatteau commented 3 years ago

PR https://github.com/dwatteau/scummtr/pull/13 is a tentative fix for this.