Monkey Island Resources
In an effort to understand the data that I was parsing from the index file and to do it as quickly as possible, I needed to lean on the ScummVM source and find some common ground so I knew what I was looking at.
Get Nathan Wallis’s stories in your inbox
Join Medium for free to get updates from this writer.
There are a number of resource.cpp (with different versions) files located in the /engines/scumm folder in the ScummVM source that seemed to be doing the same thing as my original index parsing attempt. Seeing as there are so many versions of the index file, I needed to find the right one and I wasn’t convinced that it was a simple one for one match up between the version numbers of the C++ files and the version numbers mentioned in the ScummVM techical reference.
It looks like the ScummVM source file that matches up with the index file parsing is located at /engines/scumm/resource_v4.cpp where they use a similar method of iterating the file in chunks. It looks like they iterate the file once and get the total number of scripts, costumes, rooms etc and store those in variables. Then seek back to the start of the file and iterate the data in the same way that my current elixir code does.
It looks like they will then iterate these data structures at a later date to retrieve information for each room, however I think we can improve here and store the information in structs for each room now so that future collation does not need to happen.
More to come…




