91
Lemmings Main / Re: Best way of rendering Lemmings levels?
« on: July 19, 2006, 04:15:28 AM »
Old Mac files have two independant halves: the data and the resource fork. The resource fork is a sort of compartmentalized treasure map that's bolted onto most old Mac files. It provides a standard way of holding standard structures (like colour palettes, dialogs, machine code) and also for referencing information packed in the data part of the file.
This actually makes the data part of the file quite underused, as it's easier to keep most things in the resource fork. (The Lemmings executable, for instance, is just one large resource fork). Which, unfortunately, is a bit of a pain, as by default the resource fork is sheared off on a non-Apple filesystem.
Thankfully by packing the Mac files into a data-only format (in my case, BinHex .HQX files), it is possible to read both the data and resource fork on any platform. Of course, the resource fork is only read by the Apple system libraries and developer tools like ResEdit, so it doesn't look very nice as one long string.
Right now my tool just converts the above gibberish string into a more human-readable data structure. So it's only really useful if you're extracting data or poking around for information.
The executable has a little bit of useful information (such as the single colour palette used by Lemmings), however the Graphics file is much more cryptic. All the resource fork contains is a single table of 12-byte tuples, flagged with interesting names like "Psygnosis0", "Logo0", "Grounds1", "Special2" etc. I think the first 4 bytes references an offset, second 4 bytes references a length (all referring to the large data part of the file), but I have no idea what the last 4 bytes represent. Presumably it is an amount, as the highest two bytes always represent a small number, but it doesn't steadily increase/decrease down the list and it's always larger than the image size. As for the graphics data itself, all I know so far is that there is the occasional raw palette index, making it possible to identify sections of the image in a paint-by-numbersish way.
If anyone out there is mad enough to try it, you don't even need a real Mac to check out Lemmings with ResEdit (Basilisk II, a starter kit and a copy of HFV Explorer will do the trick).
This actually makes the data part of the file quite underused, as it's easier to keep most things in the resource fork. (The Lemmings executable, for instance, is just one large resource fork). Which, unfortunately, is a bit of a pain, as by default the resource fork is sheared off on a non-Apple filesystem.
Thankfully by packing the Mac files into a data-only format (in my case, BinHex .HQX files), it is possible to read both the data and resource fork on any platform. Of course, the resource fork is only read by the Apple system libraries and developer tools like ResEdit, so it doesn't look very nice as one long string.
Right now my tool just converts the above gibberish string into a more human-readable data structure. So it's only really useful if you're extracting data or poking around for information.
The executable has a little bit of useful information (such as the single colour palette used by Lemmings), however the Graphics file is much more cryptic. All the resource fork contains is a single table of 12-byte tuples, flagged with interesting names like "Psygnosis0", "Logo0", "Grounds1", "Special2" etc. I think the first 4 bytes references an offset, second 4 bytes references a length (all referring to the large data part of the file), but I have no idea what the last 4 bytes represent. Presumably it is an amount, as the highest two bytes always represent a small number, but it doesn't steadily increase/decrease down the list and it's always larger than the image size. As for the graphics data itself, all I know so far is that there is the occasional raw palette index, making it possible to identify sections of the image in a paint-by-numbersish way.
If anyone out there is mad enough to try it, you don't even need a real Mac to check out Lemmings with ResEdit (Basilisk II, a starter kit and a copy of HFV Explorer will do the trick).