<?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=Spectrum_512_Smooshed_file_format</id>
	<title>Spectrum 512 Smooshed 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=Spectrum_512_Smooshed_file_format"/>
	<link rel="alternate" type="text/html" href="https://www.temlib.org/AtariForumWiki/index.php?title=Spectrum_512_Smooshed_file_format&amp;action=history"/>
	<updated>2026-05-13T18:40:30Z</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=Spectrum_512_Smooshed_file_format&amp;diff=18281&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=Spectrum_512_Smooshed_file_format&amp;diff=18281&amp;oldid=prev"/>
		<updated>2017-01-02T23:56:36Z</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;
Spectrum 512 (Smooshed), or Anispec, see below    *.SPS&lt;br /&gt;
&lt;br /&gt;
   This format compresses Spectrum 512 pictures better than the standard&lt;br /&gt;
method.  There are at least two programs that support this format, SPSLIDEX&lt;br /&gt;
and ANISPEC, although the two seem to differ slightly in their interpretation&lt;br /&gt;
of the format.&lt;br /&gt;
   One point of interest: Shamus McBride deciphered this format without an ST!&lt;br /&gt;
 &lt;br /&gt;
1 word          5350 (hex) (&amp;quot;SP&amp;quot;)&lt;br /&gt;
1 word          0 (reserved for future use)&lt;br /&gt;
1 long          length of data bit map&lt;br /&gt;
1 long          length of color bit map&lt;br /&gt;
&amp;lt;= 32092 bytes  compressed data bit map&lt;br /&gt;
&amp;lt;= 17910 bytes  compressed color bit map&lt;br /&gt;
----------&lt;br /&gt;
&amp;lt; 50014  bytes  total&lt;br /&gt;
&lt;br /&gt;
Data compression:&lt;br /&gt;
&lt;br /&gt;
   Compression is via a modified run length encoding (RLE) scheme,&lt;br /&gt;
similar to that used in Spectrum Compressed (*.SPC) pictures.&lt;br /&gt;
&lt;br /&gt;
The data map is stored as a sequence of records.  Each record consists of a&lt;br /&gt;
header byte followed by one or more data bytes.  The meaning of the header&lt;br /&gt;
byte is as follows:&lt;br /&gt;
&lt;br /&gt;
        For a given header byte, x (unsigned):&lt;br /&gt;
&lt;br /&gt;
          0 &amp;lt;= x &amp;lt;= 127    Use the next byte x + 3 times&lt;br /&gt;
        128 &amp;lt;= x &amp;lt;= 255    Use the next x - 128 + 1 bytes literally&lt;br /&gt;
                           (no repetition)&lt;br /&gt;
&lt;br /&gt;
There are two kinds of *.SPS files.  The type is defined by the least significant &lt;br /&gt;
bit of the last byte in the color bit map.&lt;br /&gt;
&lt;br /&gt;
If the bit is set the data appears in the same order as *.SPC files:&lt;br /&gt;
&lt;br /&gt;
        1. Picture data, bit plane 0, scan lines 1 - 199&lt;br /&gt;
        2. Picture data, bit plane 1, scan lines 1 - 199&lt;br /&gt;
        3. Picture data, bit plane 2, scan lines 1 - 199&lt;br /&gt;
        4. Picture data, bit plane 3, scan lines 1 - 199&lt;br /&gt;
&lt;br /&gt;
If the bit is not set the data is encoded as byte wide vertical strips:&lt;br /&gt;
&lt;br /&gt;
        Picture data, bit plane 0, scan line   1, MSB.&lt;br /&gt;
        Picture data, bit plane 0, scan line   2, MSB.&lt;br /&gt;
        Picture data, bit plane 0, scan line   3, MSB.&lt;br /&gt;
        . . .&lt;br /&gt;
        Picture data, bit plane 0, scan line 199, MSB.&lt;br /&gt;
        Picture data, bit plane 0, scan line   1, LSB.&lt;br /&gt;
        Picture data, bit plane 0, scan line   2, LSB.&lt;br /&gt;
        . . .&lt;br /&gt;
        Picture data, bit plane 0, scan line 199, LSB.&lt;br /&gt;
        Picture data, bit plane 1, scan line   1, MSB.&lt;br /&gt;
        . . .&lt;br /&gt;
        Picture data, bit plane 3, scan line 198, LSB&lt;br /&gt;
        Picture data, bit plane 3, scan line 199, LSB.&lt;br /&gt;
&lt;br /&gt;
A for loop to process that data would look like&lt;br /&gt;
&lt;br /&gt;
        for (plane = 0; plane &amp;lt; 4; plane++)&lt;br /&gt;
            for (x = 0; x &amp;lt; 320; x += 8)&lt;br /&gt;
                for (y = 1; y &amp;lt; 200; y++)&lt;br /&gt;
                    for (x1 = 0; x1 &amp;lt; 8; x1++)&lt;br /&gt;
                        image[y, x + x1] = ...&lt;br /&gt;
&lt;br /&gt;
Color map compression:&lt;br /&gt;
&lt;br /&gt;
   Color map compression is similar to *.SPC color map compression, but&lt;br /&gt;
the map is compressed as a string of bits, rather than words.  There are&lt;br /&gt;
597 records (one for each palette). Each record is composed of a 14-bit&lt;br /&gt;
header followed by a number of 9-bit palette entries.  The 14-bit header&lt;br /&gt;
specifies which palette entries follow (1 = included, 0 = not included).&lt;br /&gt;
The most significant bit of the header refers to palette entry 1, while&lt;br /&gt;
the least significant bit refers to palette 14.  Palette entries 0 and 15&lt;br /&gt;
are forced to black (zero).  Each palette entry is encoded as &amp;quot;rrrgggbbb&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The format of the palette is described above in the section on uncompressed&lt;br /&gt;
Spectrum pictures (*.SPU).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Spectrum 512 (Anispec)&amp;gt;          *.SPS&lt;br /&gt;
Format for animated Spectrum pictures.&lt;br /&gt;
&lt;br /&gt;
1 word          5353 (hex) (&amp;quot;SS&amp;quot;)&lt;br /&gt;
30 bytes        unknown header bytes&lt;br /&gt;
51104 bytes     uncompressed spectrum picture (see SPU format)&lt;br /&gt;
?? bytes        animation data (unknown format) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
See also [[Spectrum 512 file format]]&lt;br /&gt;
&lt;br /&gt;
Back to [[ST Picture Formats]]&lt;/div&gt;</summary>
		<author><name>&gt;Lp</name></author>
	</entry>
</feed>