Newsgroups: comp.sys.sinclair
Path: ulke.hiMolde.no!trane.uninett.no!sunic!sunic.sunet.se!doc.news.pipex.net!pipex!uknet!comlab.ox.ac.uk!imc
From: imc@comlab.ox.ac.uk (Ian Collier)
Subject: Re: REQUEST FOR INFO.... Sam. Screen$ / Get-put format
Message-ID: <6247.imc@comlab.ox.ac.uk>
X-Local-Date: Tuesday, 14th March 1995 at 3:33pm GMT
Originator: imc@msc2.comlab
Organization: Oxford University Computing Laboratory
References: <3k1url$p7j@rowan.coventry.ac.uk>
Date: Tue, 14 Mar 1995 15:33:40 GMT
Lines: 32

In article <3k1url$p7j@rowan.coventry.ac.uk>, nmassey@coventry.ac.uk (ShadowDweller) wrote:
>also, is there any way of reading a Sam disc on a pc.

Not that I know of.  But you can do it on a Sparc station...

>What Is important (to me at least) is how does the Sam Coupe store its (mode 4)
>screen$. ( How is the palette derived etc).

Each pixel is stored as half a byte.  The 256 pixels of one pixel line
are stored (from left to right) as 128 bytes.  The 192 lines are stored
in sequence (from top to bottom) as 24576 bytes.  The next 16 bytes are
the palette numbers for colours 0-15 in the format

     7   6   5   4   3   2   1   0
  +---+---+---+---+---+---+---+---+
  | 0 | G | R | B | I | g | r | b |
  +---+---+---+---+---+---+---+---+

where the colour values for red, green and blue are 4R+2r+I, 4G+2g+I and
4B+2b+I respectively.

The next 4 bytes are irrelevant.  Then next 20 bytes are (usually) a repeat
of the previous 20.  The next byte is the end marker 255.

>And secondly, how is a 'grabbed' area of the screen stored. 

By using the GRAB command...

Ian Collier - Departmental Lecturer (and perpetual postgrad student) -
imc@comlab.ox.ac.uk - Oxford University Computing Laboratory, Wolfson
Building, Parks Road, Oxford OX1 3QD - WWW Home Page (including Spectrum
section): http://www.comlab.ox.ac.uk/oucl/users/ian.collier/index.html
