Dali Compressed file format: Difference between revisions

From AtariForumWiki
Jump to navigation Jump to search
>Lp
(New page)
 
>Lp
m (add decompression code)
Line 8: Line 8:
          
          
16 words    palette
16 words    palette
?          table 1 size in bytes stored as plain ASCII text + cr/lf
?          size of byte array in bytes, stored as plain ASCII text + cr/lf
?          table 2 size in bytes stored as plain ASCII text + cr/lf
?          size of long array in bytes, stored as plain ASCII text + cr/lf
?          array of bytes 'table 1 size'
?          array of bytes
?          array of longs 'table 2 size'
?          array of longs


No description of the compression method exists at this time.
?          image data:
Assuming the tables have been loaded into arrays:
uint8 *btab=malloc(size of byte array);
uint32 *ltab=malloc(size of long array);
 
/* Written by Lonny Pursell - placed into the Public Domain 1/19/2017 */
flag = index = 0;
for (i=0; i<=156; i=i+4) {
    for (offset=0; offset<=31840; offset=offset+160) {
        if (flag==0) {
            flag = btab[index];
            data = ltab[index];
            index++;
        }
        bmap[offset + i] = (data >> 24) & 0xFF;
        bmap[offset + i + 1] = (data >> 16) & 0xFF;
        bmap[offset + i + 2] = (data >> 8) & 0xFF;
        bmap[offset + i + 3] = data & 0xFF;
        flag--;
    }
}
</pre>
</pre>
Back to [[ST Picture Formats]]
Back to [[ST Picture Formats]]

Revision as of 14:51, 19 January 2017

Dali compressed    *.LPK (ST low resolution)
                   *.MPK (ST medium resolution)
                   *.HPK (ST high resolution)
        
Files do not seem to have any resolution or bit plane info stored in them. The file
extension seems to be the only way to determine the contents.
        
16 words    palette
?           size of byte array in bytes, stored as plain ASCII text + cr/lf
?           size of long array in bytes, stored as plain ASCII text + cr/lf
?           array of bytes
?           array of longs

?           image data:
Assuming the tables have been loaded into arrays:
uint8 *btab=malloc(size of byte array);
uint32 *ltab=malloc(size of long array);

/* Written by Lonny Pursell - placed into the Public Domain 1/19/2017 */
flag = index = 0;
for (i=0; i<=156; i=i+4) {
    for (offset=0; offset<=31840; offset=offset+160) {
        if (flag==0) {
            flag = btab[index];
            data = ltab[index];
            index++;
        }
        bmap[offset + i] = (data >> 24) & 0xFF;
        bmap[offset + i + 1] = (data >> 16) & 0xFF;
        bmap[offset + i + 2] = (data >> 8) & 0xFF;
        bmap[offset + i + 3] = data & 0xFF;
        flag--;
    }
}

Back to ST Picture Formats