The Kaleidoscope
Release Year
Author
Publisher
Description
The Kaleidoscope was the cut-down version of the Hardware Development Kit with just the components soldered on the board for the Kaleioscope function, and housed in the usual white interface box.
Retailed for £34.99
Only one 3rd party program is known for it, Nigel Kettlewell’s KALETTE routine in SAM PRIME 3 disk magazine.
For more information see below and the Hardware Development Kit
Screenshots
Instructions
From Newsdisk 5
And now for THIS month's competition...
We all know that SAM is super machine for producing graphics. What we're looking for this month, are examples of graphic screens or animation demos (see Jeremy Wood's short animation in the DEMOS section) which show SAM's capabilities to the full. The best graphic screens or animations will be included on next month's double disk issue of the newsdisk for all the world to admire, and we'll be awarding a prize of £40.00 worth of SAMCo products to the piece of software which uses the new KALEIDOSCOPE graphics interface in the best way - Who knows, we may even be interested in publishing your software for inclusion with the KALEIDOSCOPE interface itself ! The closing date for this competition is the 10th July 1992, so get drawing!!!! And for those of you who want to try and win the KALEIDOSCOPE prize, here are some more details from Adrian Parker.
Kaleidoscope!
Kaleidoscope - 32,000 exotic shades and colours on your screen -that's what your SAM Coupe is now capable of producing. Whereas the Coupe, in its basic form, already has many more colours available to the user than its counterparts, with Kaleidoscope you can now produce a whole new plethora of graphical effects.
But that's not all. Whilst still in its infancy, we want Kaleidoscope to be a participative, interactive product. Whilst the software on this disk will show you how to generate different colours, and position them anywhere on screen, we are only scratching the surface of the possibilities. Just as when the Coupe was first launched, it took time before people came to grips with the outstanding features and put them to good use, so it will take a small amount of time before you see Kaleidoscope used to the full in games and utilities.
That's where you can help. We already have people working on new graphics packages, games, etc. We need you, as one of the first Kaleidoscope owners, to show us what you can do with this new, and quite revolutionary piece of hardware. We are launching, on this Newsdisk, a competition to encourage people to send in their kaleidoscopic creations. We want to show people out there just how good you are, and the very best effects will also be placed on future Newsdisks. This will guarantee us an array of good commercial and utility software!
The following is intended to be technical information that will be needed to synchronise your Kaleidoscope changes with the way that the screen is built up. You do NOT need most of the information just to use Kaleidoscope - you could just experiment with the programs on the Kaleidoscope disk - but you will have a lot more fun and learn a lot more about the workings of your computer if you do try.
So, how does Kaleidoscope work?
To consider this, we first need to consider how a normal screen is assembled. When you create, for example, a MODE 4 screen, the Coupe realizes that you want 256 pixels across, 192 pixels down in sixteen different colours (we won't consider LINE Interrupts yet!). Now, those of you who know binary will realise that to have sixteen different colours, you will need 4 bits per pixel (and those of you who don't know binary can either take my word for it, or read the hardware articles from Newsdisk 2 onwards). So, to display a MODE 4 screen, we will need 4 * 192 * 256 bits = 196608 bits, and as there are 8 Bits in a Byte, 196608 Bits = 24576 Bytes. So, provided that we have this amount of memory free (and that it starts on a 16K page boundary for the ASIC, but that's a different story) we can have a MODE 4, 16 colour screen. The actual physical translation of the video memory to the screen does not concern us.
What's different about Kaleidoscope?
When the idea of Kaleidoscope first came about, it was purely a matter of curiosity. Could a large number of colours be produced? The simple answer was 'Yes!', but the memory requirements would be horrendous. A 32768 colour, MODE 4 screen would require 15 bits per pixel, which amounts to 737280 bits (92160 Bytes) - over 90K per screen! In addition to this, the ASIC, which takes care of the video memory to screen display translation, cannot manage screen areas that big, and so the ASIC would also have to be redesigned as well. This was totally impractical, so a different scheme had to be adopted. The criteria for the system were that:
1. It should not impose any physical limits on the number of colour changes per screen, or per line;
2. It should be compatible with current Coupe screens;
3. It would be convenient if it worked in MODE 3 also, or better still, in all MODEs.
These three criteria have been met by the Kaleidoscope circuitry, and I think its about time that we looked at exactly how these colours are generated.
'Curiouser and curiouser'...
Forget all about computers for a minute, let's have a think about how the screen in front of you is made up. A display consists of three 'dots', all moving at high speed across the screen, and going over the screen quickly enough to give the illusion of a continuous display (just in the same way that waving a 'sparkler' on November 5th can 'fool' your eye into thinking that there is a circle of light, even when there is really only a point). These three dots move together, drawing from left to right across each line, and working their way down the screen on successive lines as they go. At the end of each line, the dots stop drawing and 'fly-back' to the extreme left at a very high speed, ready for the next line. Now, each of these dots can be varied in brightness as they go, so that we can see different intensities on the screen. More than this, the front of the screen is coated with different coloured spots, grouped in threes. Each dot is lined up with one of the spots in each group. Each one of the three spots are slightly different, in that as each dot hits a spot, one will light up Red, one Green and the final one Blue. By combining these three colours together, a television (or a monitor) can display many different colours.
What's all this got to do with us? Well, a television is known as an 'analogue' device, and it can change each of the three colour intensities by varying amounts, producing millions of shades. Computers, on the other hand, are 'digital' devices, and deal with values in terms of 'how many fingers they have to count with'! (ie if you have ten fingers, then you cannot represent a number like 'seven and a half'!) Now the Coupe has various signals (a signal is like a finger in our analogy) which it uses to work our the current colour. It has two signals for each of the Red, Green and Blue spots on the screen. Each signal can be either on or off. This is just like binary, and so there are four combinations per basic colour. This would give us 4 * 4* 4 = 64 colours available on the Coupe. But you know that you have 128 colours on the Coupe so how can this be?
This is achieved by giving the Coupe the choice of using one of two different hands, each with the same six fingers for representing the colours, but one hand gives a 'brighter' tinge to all of the colours than the other hand. We only need one extra bit to say which hand we are using. So we have seven bits for colour representation, giving us 128 different colours available.
Now what we have described so far are the Coupe 'native’ colours. Anyone with a Coupe can use them. The colour bits are named as follows:
RED : BRIGHT, RED1, RED0
GREEN : BRIGHT, GREEN1, GREEN0
BLUE : BRIGHT, BLUE1, BLUE0
The BRIGHT bit in each case is the same signal (ie if BRIGHT is on, it affects all three colours in the same way, it cannot be independently ON for red, and OFF for green and blue, for example).
Kaleidoscope gives us an additional eight, independent bits for colour generation, offering us 256 shades of each of the native 128 Coupe colours. In order to avoid overlap of the colours, producing multiple copies of the same colour, Kaleidoscope produces subtle changes in the current colours (ie the Kaleidoscope bits are of a lower significance than the native colour bits in the Coupe). So, with Kaleidoscope fitted, the colours are as follows:
RED : (Native RED) minus KalRED2, KalRED1, KalRED0
GREEN : (Native GREEN) minus KalGRN2, KalGRN1, KalGRN0
BLUE : (Native BLUE) minus KalBLU1, KalBLU0
Note that the Kaleidoscope colours get SUBTRACTED from the native colour intensities. There is one exception to this, if you try to subtract from a colour that is already at zero (eg bright red has zero green and blue content), the values in the Kaleidoscope register will be ADDED to the Native colour content. Also there are only two bits associated with the blue Kaleidoscope colour. This was unavoidable, as to produce three bits for each colour would have needed a 'nine bit port' and they’re about as common as a 'seven pound note'!
So, how do we use these colours? Well, first we need to know how to access them. Kaleidoscope looks like a single write-only port to the processor, sitting at port address 8063 (&1F7F). So, if you use the instruction:
OUT 8063,KalCol
(where 'KalCol' is the Kaleidoscope colour modifier that you want), you will affect all native colours from then on with this particular Kaleidoscope tinge. OK, that's all very well, but of what use is a 'tinge' to every single colour on the screen? Not very much, on the face of it. We need to be able to alter a very small area of the screen, ideally a single pixel, so how do we do this?
If we only had BASIC available to us, we wouldn't be able to. So we have developed, and are continuing to develop, a series of machine code utilities to give you full flexibility over all 32768 colours. The programs on this disk are fully commented along with the source for the machine code in LERM/COMET format. There are, at the time of writing, still limitations with the software. It sits in the middle of the BASIC area at the moment and will get destroyed by large BASIC programs. The current machine code also stops the LINE interrupts from functioning. Despite all of this, the utilities provided are more than sufficient to allow pictures of startling realism to be created by positioning Kaleidoscope changes over a 'standard' drawing. So, for example, we could have a tree, drawn in MODE 4 with the normal Coupe colours. Then we could produce hundreds of shades within the green leaves of the tree. People who do not have Kaleidoscope will still see the picture, but without the subtleties. People with Kaleidoscope will get the whole effect.
Now you may be wondering why I spent some time earlier detailing how a picture is built up on the television screen. Well, if you are about to try writing your own machine code driver, then you will need to synchronise your changes with a particular part of the screen. The only way to do this, given the way in which Kaleidoscope works, is to use either frame or line interrupts for synchronisation. Interrupts are fully explained, for those who don't know, in the hardware article of Newsdisk 5. Briefly, there is a FRAME interrupt that occurs at the top left-hand corner of the screen. If you write some machine code, and place it below address 65535 in memory, you can DPOKE the frame interrupt vector (FRAMEIV) at address &5AE2 with the start address of your code and it will be called every fiftieth of a second. More to the point, your code will be entered when the scan line is at a particular point on the television screen. So you can place your colour changes at any point on the screen. That's in addition to all of the normal screen colour changes that you can make as well!
Using this method you can place all 32768 colours on screen at once (as long as you use the line interrupts to put the native 128 colours on screen).
So what can I do with it?
As we have mentioned earlier, we want to make Kaleidoscope a participative product, and the programs that we have provided on the disk will show you what can be achieved. In addition, a form of user interface from BASIC is provided, so that you can set up 'tables' of Kaleidoscope changes, which can be displayed by your BASIC program. But what we really want to see is what YOU can do with this revolutionary product. We've provided you with a new, exciting tool, it's up to you to use it in an exciting manner! But above all - have FUN with Kaleidoscope, and we look forward to seeing what you can create with your new colour capabilities!
Some extensive documentation has been included where appropriate within the programs, and the commented source of the machine code has also been included (in LERM/COMET ASSEMBLER format). Please note that some of these programs disable LINE INTERRUPTS and other operations of the computer. It is best to switch off the computer before doing any other programming.
Colours
All of the 'native 128' colours of the Coupe are displayed on screen at once and as you alter the value in the 'Kaleidoscope' Port you will see the effect of this on all of the screen colours at once. Each of the bits of the Kaleidoscope port are named as being Red (R2 to R4), Green (G2 to G4) and Blue (B2 and B3). R2 is the least significant bit of the red part of Kaleidoscope, R3 the next most significant and R4 the most significant. Similarly for Green and Blue. However, the contents of the Kaleidoscope port are subtracted from the current screen colour. e.g. if the Kaleidoscope port contents is 7, then there should be a noticeable reduction in red from each of the on-screen colours. Use keys 1 to 8 to toggle each of the bits in the Kaleidoscope port.
Palette_Col
This lets you step through each of the 128 native Coupe colours and see all 256 Kaleidoscope changes on each screen. Use any key to step through the colours.
Col_ Range
Each of the native eight Coupe pure reds, greens and blues are displayed on screen. Then, at the touch of a button, 2048 shades are displayed - more than your eye can see!
Reviews
Your Sinclair review courtesy of the YS Rock 'n' Roll Years YS79
Kaleidoscope (SAM)SAMCo £39.99 Jul 1992
Well, it's here and it works. The Kaleidoscope - a new circuit that increases the Coupe's palette of 128 colours to 32,768 of the beggars - has finally banged onto the YS doormat. The version I saw was the one that comes with the DIY Hardware Development Kit - but fans of my adventures with electricity will be disappointed to learn that the kit was already made up.
It's actually extremely difficult to judge just how useful the Kaleidoscope is going to be. The demo disk that came with the kit is slightly rubbish, with a few "here's a screen full of different shades of a particular colour" affairs and nothing else. Not even a Kaleidoscoped picture. Even trickier, as this was a pre-release unit, I didn't get any technical info. Oh well.
To be honest, the bundled demos rather put me off the kit. The actual colour-enhancing process is, as SAMCo cheerfully admit, a bodge. The unit doesn't produce "pure" colours, it sort of mixes the originals and fiddles about a bit with the TV signal. This is all impressively clever, but the actual results vary according to the colour. In the worst case, as the demos show painfully clearly, some shades seem to have a terminal case of the streaks.
The Kaleidoscope certainly has the potential to propel the Coupe into the big time, but only if some talented programmers get their hooks into the unit. Apparently pre-release units are already swooshing around the development community, so hopefully good software is coming. Unless you're a serious hacker, until it arrives, I'd have to recommend you hold onto your money.
Verdict: 60%
“The Forgotten Artifacts of SAM - The Kaleidoscope” a 7 page feature in Sam Revival issue 15 (May/June 2006).
Quote from Colin Piggot on the Sam Users Mailing List
It was a complete bodge.
What the kaleidoscope did was pull down the RGB video signals generated by the Sam as normal (by darkening the output by varying amounts of red, green, blue - set with an OUT command to the kaleidoscope port) so it technically produced 256 tinted shades of the original colours - in total 32768 shades, but could they be used in a proper fashion - nope!
So whatever value of shading the kaleidoscope was set to would affect all the colours on screen. There was no real way to use it all, could you have individually shaded pixels - nope again!
At most, you could write code to tint horizontal groups of 16 pixels at a time… but for all 192 scanlines you would be using all the CPU time and even effectively tinting 16 pixel blocks that wouldn’t really let you achieve any decent graphical effects, plus 62% of all the CPU time is being used.
In all, a waste of time, it couldn't be utilised in any useable way at all, therefore no software attempted to used it.