Let’s Make: Traffic Department 2192 – Part 9

Assets - Converting Menu Assets to Bitmaps

This time we'll turn our attention to the menu assets in the Traffic Department 2192 archive: The TD.MEN, TD.SSS, and the supporting palette TDMEN.PAL. Much of this will be a rehash of everything we've done and our code will look a lot like the SCR files except we'll fix the width derive the length.

Menu File Format

We can easily guess that menu elements will take the full width of the display since we do have to display the whole screen. However, a big difference between the MEN and SSS file is that one contains many assets including our popups while the other contains just one partial asset. In retrospect, the original developer could have probably combined these files, but there may have been a memory limitation or they were created out of order.

The TD.MEN file contains more than the the main menu screen. It's actually a full sprite sheet containing all of the menu items including popups. Some of the menu items are stored interlaced. The menu text elements contain unique colors that are swapped out using palette data at the bottom. We won't be using the palette data in our implementation, but we'll copy the asset as-is and ignore that section.

Conversion Process

Read in the menu palette from TDMEN.PAL. Scan through our input file assuming a width of 320. Use that width to calculate the number of lines based on the file size. Match each index to an RGB triple in the palette. Write the resulting set colors to the output container.

Conversion process of Menu files to bitmaps

C Source Code

We'll rely on C as we've already done with all othr graphics assets.