Fixup

Posted on Aug 10, 2020

This last week I largely worked my way through my backed up Trello cards, as well as fixing Buildbot failures and various issues with movies in windows.

Some highlights from bug hunting:

  • Director movies contain a Lingo names table (Lnam) which, as the name implies, stores the names of functions, variables, etc. Previously, we were just loading the name table which had the highest ID, and thus should usually be the newest. This worked pretty much all the time. However, one target, Lingo Expo’s Noh Tale, was absolutely full of unnamed functions, and I had long been confused why this was happening. Inexplicably, the highest name table turned out to be the wrong one in this just this single movie, and this was fixed by loading the correct name table specified in the Lingo context (Lctx).
  • Now, Noh Tale seemed to work fine, but it inexplicably still failed in the Buildbot, timing out after 20 seconds. After some testing, it became apparent that the problem was the movie’s use of the “wait for click” tempo, one of the few features implemented with a busy loop. Normally, a movie running in the Buildbot would be killed after the movie was stepped a few times, but this busy loop kept it trapped in the step function forever, waiting for a click which would never come. This also blocked any movies in windows running at the same time, so I had to replace the busy loop.
  • Next was Bingo.dir from Chop Suey, another movie which seemed to work fine but failed in the Buildbot. Here, the problem was that the movie was being terminated in the middle of a script, and then a stopMovie event handler was triggered. It turned out that this event handler relied on the results of the prematurely terminated script, and preventing the stopMovie handler from running in the first place solved this.

After more MacGUI cleanup, windows look even closer to how they did on a real Mac, with proper title rendering, transparency, inactive window coloring, and a desktop background that doesn’t cause ScummVM to lag. Not to mention quite a few other rendering fixes: A screenshot of windowType 9

Over the weekend, I continued work on ProjectorRays, and it can now detect a movie’s Director version, load a movie’s casts, and link scripts to cast members so that they can be identified by name. These features were blocking lots of improvements, and I should be able to make progress on Lingo decompilation much faster now. The code will also be easy to reuse in ScummVM—I just copied over the version detection code today. :)