[CDG5] Random questions
Max Poliakovski
maximumspatium at googlemail.com
Tue Dec 4 03:25:30 AWST 2018
Compressed resources have a 18 bytes header at the beginning of the
resource data. That header tells some bits about the underlying
compression. It has the following format:
typedef struct ExtendedResource {
uint32_t signature; // must be 0xA89F6572
uint16_t hdrLength; // usually set to 0x12
uint8_t hdrVersion; // 8 - Donn, 9 - Gregg
uint8_t extAttributes; // bit 0 == 1 indicates compressed data
union {
struct {
uint8_t varTableRatio;
uint8_t overRun;
uint16_t decompressID;
uint16_t cTableID;
} DonnSpecific;
struct {
uint16_t defprocID; // decompressor resource ID
uint16_t decompressSlop;
uint8_t byteTabelSize;
uint8_t compressFlags;
} GreggSpecific;
} extHdr;
};
The DonnSpecific fields are only valid when hdrVersion == 8. Donn
decompression scheme seems to use two distinct algorithms: 0 for data, 1
for code.
Looking into the resources you sent to me, I found out that none of them
has been compressed using the Donn algo. ProcessManager's scod contains
defprocID = 0x0002 while glnd uses defprocID = 0x0003. The former seems to
indicate the GreggyBits algo (dcmp 2), while the latter looks like that
unknown algo added in OS9 (dcmp 3).
Next, I'll try to create a Python decompressor for the Greggy-compressed
resource...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ucc.gu.uwa.edu.au/pipermail/cdg5/attachments/20181203/3586d2d3/attachment.htm
More information about the cdg5
mailing list