Reading SCI1 view resources

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

Post Reply
uglyduckling
Posts: 3
Joined: Tue May 25, 2010 10:38 pm

Reading SCI1 view resources

Post by uglyduckling »

Hello,

I've been experimenting with writing a managed (C#) resource loader, and I'm able to read the resource.map file and parse out the types, offsets, and resource files where all of the resources live.

Unfortunately, once I read the data in the requisite resource file, I'm a bit lost how to proceed. According to the specifications here (http://wiki.scummvm.org/index.php/SCI/S ... w_resource), the SCI0 format starts straight off with the bytes for image groups, et al.

In SCI1, from what I can gather, the first byte at the offset is 128 (if it's a VGA game), followed by the resource number (which we already parsed from resource.map), followed by... I don't know what.

I'm assuming this is the compressed resource data and that there is a header buried in there somewhere that tells me the compression algorithm, packed and unpacked size, but the specs don't cover this.

Any hints on what do once you've got the right place to extract the data?
User avatar
sev
ScummVM Lead
Posts: 2308
Joined: Wed Sep 21, 2005 1:06 pm
Contact:

Post by sev »

engines/sci/resource.cpp file is your friend. From there you will know what exactly to do.


Eugene
uglyduckling
Posts: 3
Joined: Tue May 25, 2010 10:38 pm

Post by uglyduckling »

I wish that were true. I already combed that file and there's some excellent info in it re: VOLs, patches, etc., but the only bits that concern loading views are to check the resource type.

After checking the VGA bit as I mentioned, there's not a lot of detail, at least none that I can read from the source.
uglyduckling
Posts: 3
Joined: Tue May 25, 2010 10:38 pm

Post by uglyduckling »

sev wrote:engines/sci/resource.cpp file is your friend. From there you will know what exactly to do.


Eugene
Nevermind, it looks you were right (naturally). What I was confused with was that the relevant method name was detectVolVersion, and from that code it seemed like VOLs were their own entity, not "resource volumes" in this case. But a more careful read around line 1126 and I can see that after the resource number, it's packed, unpacked, and compression like how I suspected.

If I get it working I'll update your specifications page on the wiki.

Cheers!
Post Reply