Finishing up

Last week was the last official week in the GSoC work period. I plan to submit my final evaluation after I post this. There you will be able to see some of the highlights from my time with ScummVM this summer.

In the past week, though, I didn’t start work on any new features. I spent a while understanding the data path location mechanism that the Mac version of Journeyman Project 2: Buried in Time used, and I ultimately discovered some buried XFCNs. (As @djsrv helpfully explained, XFCNs are external functions from (HyperCard)[https://en.wikipedia.org/wiki/HyperCard] that can often be called as regular Lingo.) One of these just looped through all the volume names on the system, looking for the proper CD name. This Journeyman Project is split across three CDs, so some more additions will be needed.

I also fixed an obscure issue decoding the hex format strings for our Macintosh text implementation. Now, the main screen of Majestic looks almost perfect – with proper cursors, which I also patched to load properly – and consistent text formatting.

[]

Additionally, I investigated and fixed several bugs with my good old friends the widgets. Now Chop Suey also looks very accurate, and there is no more flashing cursor or cut-off text boxes. Text borders are now (almost) working properly again, which makes the Lingo Dictionary movies more pleasant to look at.

[]

For being the rendering guy this summer I haven’t posted nearly enough pictures, so I put those two here for you to enjoy. I’ve enjoyed working with ScummVM, and I plan to start contributing again once I get comfortable in my university schedule.

A short week

Last week, I finished implementing the direct-copy mode for our Macintosh window manager. Now, with the Director engine, there is no intermediate blitting onto a screen surface that is then copied to the physical screen. This restored transition speed and avoided duplicate work on every frame. Here’s the opening of Spaceship Warlock with the new interface and transitions:

For a while I was stuck on implementing border transparency without an intermediate surface, but @sev helpfully reminded me of g_system->lockScreen(), which no longer has performance issues on some systems.

I also looked at several long-standing bugs this week. As @djsrv probably noted, in investigating one we discovered that the goto Lingo should not run the exitFrame event. In the opening scene of Majestic, the two middle bitmap text channels previously held the mouse-over highlighting for “Restore Old Game” and “Exit” in the main menu. Clicking “Start New Game” went to the correct place, but not before the main menu’s exitFrame event disabled visibility of those channels again. Now, though, everything looks right:

Tomorrow, it will be time to figure out why the cursor implementation I made doesn’t work with Majestic… and also why the bitmap cursor in Chop Suey still has a strange flashing behaviour.

On the right path

Hey there!

Last week, I added palette support for Director 3 movies, so several more games had their colouring issues on their opening movies resolved. Then, I spent much of Tuesday and Wednesday fixing issues with our path-loading code that prevented several of @trembyle’s testing titles from running – no less than 7 when you account for Windows and Mac versions. Lingo provides several ways to interact with the filesystem. Some games asked you for a drive letter and would just loop endlessly if they would not find the file they wanted. Others were a bit smarter – on Windows, for instance, they would look for a hardcoded file name on all the drive letters and crash if there was no match.

In some cases, our file finder was not trying all the possible Director movie extensions on Macintosh, and others had filenames improperly converted from Macintosh long file names to the FAT 8.3 format. I actually just now saw that @trembyle notated several new titles with path/file errors, so I will probably look at those once I finish my current set of tasks:

Before @djsrv implemented the desktop mode, the Director transition drawing code was taking direct control of the screen (via copyRectToScreen). In the desktop mode, however, this would pay no respect to window layering or positioning. So I am working on improving screen access through the window manager. Currently the WM keep a copy of the screen as a surface, but I am exploring how to avoid this extra copying. This can cause performance issues, even in non-desktop mode, since the surfaces must be copied twice – from the Director sprite, onto the _screen, and from _screen onto the display device. Fixing this duplication will help the effort to support QuickTime video from Director movies.

In the last part of the week, I got distracted by my starting in earnest my first from-scratch RE of another engine. This is not for GSoC, just to satisfy my own curiosity. It’s the engine used by the one title in the Living Books series (D. W. the Picky Eater) that doesn’t use Mohawk. I understand the file format fairly well, and so the next task is extracting resources and then working toward the script bytecode. See my repo for more information.

Have a great week!

Fresh air

Hello!

This will be short, as last week was rather slow. I mostly finished shoring up all the areas where Director palettes can be tested and set – in the frame palette channel, with the puppetPalette command, with the movie-wide default palette, and also with the palette of cast Lingo. As I look back at my commit log, I realize that this took me many more commits than I expected. There are still some issues that some of our new test targets, including the 1991 title The Riddle of the Maze, recently revealed. As of this morning, though, this game’s elegant artwork has been restored:

Apparently, before Director 4, palette castmembers were forced into the same order that they are stored. If you reorganize them in the cast window, they will actually revert to a default position on save – and this position seems to be in the order of palette creation. Also, Director 3 Macintosh format has a slightly different way of storing palette channel information in the frame. (I have still to push the patches for titles that have this variation.)

I also finally got some of the titles that @trembyle had mentioned on the Director wiki, including the aforementioned Maze. @trembyle has done some immense work testing many new titles for us, and today I enjoyed investigatinCEg some new bugs in new titles. Playing with these new games was a nice breath of fresh air from the targets that we had been testing since the beginning – like Spaceship Warlock and Chop Suey and The Apartment.

My other big task last week was working on the text selection interface. When I think back, I believe my first experience with Director happened when I was pretty young; it was a typing game that also depended heavily on text selection. I remember this game as Director because it crashed once and I distinctly recall the Director projector icon. @sev had done most of the algo work in the MacGUI side, but I needed to write a bit more interface and do lots of testing to discover what was behind a selection offset offset bug.

Once I finish up the palettes and add a few new targets that I found, I will be working on supporting movies that have >8-bit colour. If you look in the graphics code, there are tons of const byte * declarations everywhere, so those will be changed out for a more general implementation. There are also bitmap decoding issues with greater colour depths that I need to look into. This task, a fairly big one, will be a nice way to round out my GSoC work on our Director engine.