Kodi Arfer / Beach Bum

Porting Beach Bum

Porting Beach Bum posed some interesting technical obstacles. I didn't have the source code, and I had no access at the time (late January 2014) to a real Mac. I was running Linux and could emulate System 7 on it with Basilisk II, but that was it.

Getting the text of the game and the game layout (i.e., a description of which in-game actions led to which scenes) was easy. I searched the MacBinary for "ice cram" and found the game layout in a single chunk of plain text. The format of this text wasn't standard, but it was easy to figure out.

The hard part of porting Beach Bum was converting the images to a usable format. They're stored as PICTs in the resource fork of the application. First, I extracted them with ResPresso. ImageMagick has some support for PICT, but it wasn't able to recognize the result. Even forcing interpretation as a PICT (with, e.g., convert pict:1001.raw out.png) only produced the error convert.im6: improper image header `1001.raw' @ error/pict.c/ReadPICTImage/868. It turned out that I needed to prepend 512 null bytes to each image. After I did so, ImageMagick could indeed process the files, but I ran into another limitation of its PICT support: it doesn't correctly implement bounding boxes, so 5 pixels were cut off the edges of each image.

So, rather than using ImageMagick, I used a Macintosh application under Basilisk II, namely GraphicConverter 3.x. Its PNG output appears to be buggy, so I converted the PICTs to GIF instead, using the batch command "Convert…" from GraphicConverter's File menu.

The way to tell which image goes with which scene is that the PICT resources are numbered in the same order that scenes are defined in the game layout.