<?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=PhotoChrome_file_format</id>
	<title>PhotoChrome 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=PhotoChrome_file_format"/>
	<link rel="alternate" type="text/html" href="https://www.temlib.org/AtariForumWiki/index.php?title=PhotoChrome_file_format&amp;action=history"/>
	<updated>2026-05-13T18:38:09Z</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=PhotoChrome_file_format&amp;diff=16071&amp;oldid=prev</id>
		<title>&gt;Lp: Created page with &quot;&lt;pre&gt; PhotoChrome     *.PCS (low resolution only)  1 word          0x0140 (hex) x-resolution (always 320) 1 word          0x00C8 (hex) y-resolution (always 200) 1 byte          0...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.temlib.org/AtariForumWiki/index.php?title=PhotoChrome_file_format&amp;diff=16071&amp;oldid=prev"/>
		<updated>2017-01-03T00:03:55Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;pre&amp;gt; PhotoChrome     *.PCS (low resolution only)  1 word          0x0140 (hex) x-resolution (always 320) 1 word          0x00C8 (hex) y-resolution (always 200) 1 byte          0...&amp;quot;&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;
PhotoChrome     *.PCS (low resolution only)&lt;br /&gt;
&lt;br /&gt;
1 word          0x0140 (hex) x-resolution (always 320)&lt;br /&gt;
1 word          0x00C8 (hex) y-resolution (always 200)&lt;br /&gt;
1 byte          00 = single screen mode&lt;br /&gt;
                nonzero value's = alternating screen mode,&lt;br /&gt;
                bit 0 (0x01) not set: second screen data is xor'ed with first screen&lt;br /&gt;
                bit 1 (0x02) not set: second color palette is xor'ed with first&lt;br /&gt;
1 byte          bit 0 (0x01) set: 50 Hz mode, when not set 60 Hz mode&lt;br /&gt;
?? bytes        compressed screen data&lt;br /&gt;
?? bytes        compressed palette&lt;br /&gt;
?? bytes        compressed second screen data (in case of alternating screens)&lt;br /&gt;
?? bytes        compressed second palette&lt;br /&gt;
-------------&lt;br /&gt;
 &amp;gt; 18 bytes      total&lt;br /&gt;
&lt;br /&gt;
Screen compression scheme:&lt;br /&gt;
1 word          total number of control bytes that follow&lt;br /&gt;
1 control byte  x&lt;br /&gt;
                x &amp;lt; 0 : copy -x literal bytes (1 - 128)&lt;br /&gt;
                x = 0 : next word specifies the number of times the following byte &lt;br /&gt;
                        has to be copied (0-65535)&lt;br /&gt;
                x = 1 : next word specifies the number of bytes to be copied (0-65535)&lt;br /&gt;
                x &amp;gt; 1 : repeat the next byte x times (2-127)&lt;br /&gt;
&lt;br /&gt;
The 4 bitplanes are separated, first 8000 bytes of the first bitplane, then 8000 bytes &lt;br /&gt;
for the second, 8000 bytes for the third and 8000 bytes for the fourth; a total of 32000 bytes.&lt;br /&gt;
&lt;br /&gt;
Palette compression scheme:&lt;br /&gt;
the palette compression scheme is the same as the screen compression but it works with &lt;br /&gt;
16 bit words&lt;br /&gt;
1 word          total number of control bytes that follow&lt;br /&gt;
1 control byte  x&lt;br /&gt;
                x &amp;lt; 0 : copy -x literal words (1 - 128)&lt;br /&gt;
                x = 0 : next word specifies the number of times the following word &lt;br /&gt;
                        has to be copied (0-65535)&lt;br /&gt;
                x = 1 : next word specifies the number of words to be copied (0-65535)&lt;br /&gt;
                x &amp;gt; 1 : repeat the next word x times (2-127)&lt;br /&gt;
&lt;br /&gt;
In total 9616 palette entries are stored. 200 scanlines with 3 palettes&lt;br /&gt;
(48 colors) each, plus one final palette (16 colors). PhotoChrome files&lt;br /&gt;
with a few extra entries have been found. The first scanline usually&lt;br /&gt;
contains no data.&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 *  Given an x-coordinate and a color index, returns the corresponding&lt;br /&gt;
 *  Photochrome palette index.&lt;br /&gt;
 *&lt;br /&gt;
 *  by Hans Wessels; placed in the public domain January, 2008.&lt;br /&gt;
 */&lt;br /&gt;
int find_pcs_index(int x, int c)&lt;br /&gt;
{&lt;br /&gt;
	int x1=4*c;&lt;br /&gt;
	int index = c;&lt;br /&gt;
	if(x&amp;gt;=x1)&lt;br /&gt;
	{&lt;br /&gt;
		index+=16;&lt;br /&gt;
	}&lt;br /&gt;
	if((x&amp;gt;=(x1+64+12)) &amp;amp;&amp;amp; (c&amp;lt;14))&lt;br /&gt;
	{&lt;br /&gt;
		index+=16;&lt;br /&gt;
	}&lt;br /&gt;
	if((x&amp;gt;=(132+16)) &amp;amp;&amp;amp; (c==14))&lt;br /&gt;
	{&lt;br /&gt;
		index+=16;&lt;br /&gt;
	}&lt;br /&gt;
	if((x&amp;gt;=(132+20)) &amp;amp;&amp;amp; (c==15))&lt;br /&gt;
	{&lt;br /&gt;
		index+=16;&lt;br /&gt;
	}&lt;br /&gt;
	x1=10*c;&lt;br /&gt;
	if((c&amp;amp;1)==1)&lt;br /&gt;
	{&lt;br /&gt;
	  x1-=6;&lt;br /&gt;
	}&lt;br /&gt;
	if((x&amp;gt;=(176+x1)) &amp;amp;&amp;amp; (c&amp;lt;14))&lt;br /&gt;
	{&lt;br /&gt;
		index+=16;&lt;br /&gt;
	}&lt;br /&gt;
	return index;&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>