Two improvements for RIFF loading: size and alignment
A RIFF elements header: FourCC and size (4 bytes each) are not included
in the size. Offset + 12 then size - 4.
'DIB ' resources were found to always lead with two zero bytes.
Tested with: Fujitsu fmTOWNS SUPER TECHNOLOGY DEMO 1993.
Other resources such as 'SND ' do need alignment.
Tested with: SpaceWarlock Win. Intro movie lacked sound without
alignment. (WARNING: SNDDecoder: Bad format: 17408!)
Handle loadStream returning false when the pic doesn't confirm.
In this case a 'DIB ' with a headersize not matching 40.
Observed happening in:
- Fujitsu fm TOWNS Super TECHNOLOGY DEMO
- KUZIRA.MMM from PINGU
This workaround was originally meant to address the case in which derefActor was called with
an id == 0. Originally, a value of 0 triggered a range error. As a matter of fact, we (correctly) accept
actors id == 0 now, so this workaround is never being triggered.
This one was added more than 20 years ago, but I can't reproduce the
issue anymore with the DOS, Macintosh, or Amiga versions, and it
appears that it was already OK back in 2008.
I couldn't reproduce any lock-up with the original DOS version in
DOSBox either.
We are probably closer to the behavior of the original interpreters
now, because I can't reproduce this ScummVM problem anymore with any
demo, Passport to Adventure, EGA or Amiga version.
Bisecting a bit with the Amiga demo, this has effectively been fixed
by commit d719e83783.
20 years ago this was needed because it was assumed that actor 0 was an invalid actor, but that
simply isn't true. In the original this particular call failed because actor 0 wasn't in the current room,
and this is exactly what happens now on our end, when removing this workaround.
Widget is an XObject used in Alice: An Interactive Museum.
The assumption is that getPro returns the drive letter as
the return value of getPro is assigned to a variable called drv.
Resolves the following errors from: https://bugs.scummvm.org/ticket/13204
- WARNING: BUILDBOT: Uncaught Lingo error: Call to undefined handler 'Widget'. Dropping 1 stack items!
- WARNING: varFetch: global variable drv not defined!
Required to get Wrath of the Gods to play, because due the existing code, when given `30AM1`, it was only checking `30AM1` and `AM1.MMM` but not `30AM1.MMM` (which is what the file is called)
Don't map the same fromFont twice.
CloneRanger mapped one fromFont twice, resulting in a memory leak on
descruction since the pointer to the first fontMap was lost.
Now the log() function writes to a file, as
the AGI engine did.
It appears that ScummVM doesn't have any "append" functionality.
As a result, I made this implementation create a new file each time
a message is logged. Note that the file is only created if the
log() function is called. The file name includes the game name
and the current time, ensuring that logs won't be overwritten.
The format is: agi.<gameid>.<currentime>.log and will be logged to
the working directory.
Last week I first implemented the log() function. In that commit
I just had it log to the console. In this commit we start
writing to a file.