<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.temlib.org/AtariForumWiki/index.php?action=history&amp;feed=atom&amp;title=Picworks_file_format</id>
	<title>Picworks file format - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.temlib.org/AtariForumWiki/index.php?action=history&amp;feed=atom&amp;title=Picworks_file_format"/>
	<link rel="alternate" type="text/html" href="https://www.temlib.org/AtariForumWiki/index.php?title=Picworks_file_format&amp;action=history"/>
	<updated>2026-07-27T05:27:24Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.2</generator>
	<entry>
		<id>https://www.temlib.org/AtariForumWiki/index.php?title=Picworks_file_format&amp;diff=16081&amp;oldid=prev</id>
		<title>&gt;Lp: New page</title>
		<link rel="alternate" type="text/html" href="https://www.temlib.org/AtariForumWiki/index.php?title=Picworks_file_format&amp;diff=16081&amp;oldid=prev"/>
		<updated>2017-02-08T20:56:59Z</updated>

		<summary type="html">&lt;p&gt;New page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Picworks    *.CP3&lt;br /&gt;
&lt;br /&gt;
Always compressed 640x400 st high resolution images.&lt;br /&gt;
&lt;br /&gt;
Files do not seem to have any resolution or bit plane info stored in them. The file&lt;br /&gt;
extension seems to be the only way to determine the contents.&lt;br /&gt;
&lt;br /&gt;
Assuming the following:&lt;br /&gt;
uint8 *file=malloc(file_size); /* load file in array */&lt;br /&gt;
uint32 *bmap=malloc(32000);&lt;br /&gt;
decode_cp3(file, bmap);&lt;br /&gt;
&lt;br /&gt;
/* ported to PureC from Picworks v1 GFABASIC source code */&lt;br /&gt;
/* Written by Lonny Pursell - placed in to Public Domain 2/8/2017 */&lt;br /&gt;
void decode_cp3(uint8 *data, uint32 *bmap) {&lt;br /&gt;
    register uint16 *dpeek, cnt, i, c;&lt;br /&gt;
    register uint32 *lpeek, src=0, dst=0, offset, tmp1, tmp2;&lt;br /&gt;
&lt;br /&gt;
    dpeek = (uint16*)data;&lt;br /&gt;
    cnt = dpeek[src++];&lt;br /&gt;
    offset = 2L+2L+4L*(uint32)cnt;  /* offset into file */&lt;br /&gt;
    lpeek = (uint32*)&amp;amp;data[offset]; /* base of long table */&lt;br /&gt;
    offset = 0;                     /* reset index */&lt;br /&gt;
&lt;br /&gt;
    for (c=0; c&amp;lt;cnt; c++) {&lt;br /&gt;
        src++;&lt;br /&gt;
        if (dpeek[src]) {&lt;br /&gt;
            for (i=0; i&amp;lt;dpeek[src]; i++) {&lt;br /&gt;
                bmap[dst++] = lpeek[offset++];&lt;br /&gt;
                bmap[dst++] = lpeek[offset++];&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        src++;&lt;br /&gt;
        tmp1 = lpeek[offset++];&lt;br /&gt;
        tmp2 = lpeek[offset++];&lt;br /&gt;
        for (i=0; i&amp;lt;dpeek[src]; i++) {&lt;br /&gt;
            bmap[dst++] = tmp1;&lt;br /&gt;
            bmap[dst++] = tmp2;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    while (dst&amp;lt;8000L) { /* 32000/4 */&lt;br /&gt;
        bmap[dst++] = lpeek[offset++];&lt;br /&gt;
        bmap[dst++] = lpeek[offset++];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Back to [[ST Picture Formats]]&lt;/div&gt;</summary>
		<author><name>&gt;Lp</name></author>
	</entry>
</feed>