Chroma 81 - SCART and Colour interface for the ZX81

Discussions about Sinclair ZX80 and ZX81 Hardware
Post Reply
Fruitcake
Posts: 346
Joined: Wed Sep 01, 2010 10:53 pm

Chroma 81 - SCART and Colour interface for the ZX81

Post by Fruitcake »

I’m pleased to announce the launch of the Chroma 81 interface, a new multi-purpose interface for the ZX81. Its primary function is to allow the ZX81 to be connected to a TV via a SCART socket using an RGB connection to produce a picture that is sharp and bright. The Chroma interface plugs into the expansion port of the ZX81 and connects to the TV using a standard SCART cable. There is no need to make any modifications to the ZX81 since the Chroma interface only requires access to those signals available on the expansion bus.

An exciting feature of the Chroma interface is its ability to add colour to the ZX81's display, with support for a palette of 15 colours and 2 colour modes. One mode provides an attributes file similar in concept to that of the Spectrum, giving maximum flexibility in creating a colour display but can only be used by new software developed to explicitly control it. The other mode allows colours to be assigned for each character in the character set, and then whenever a character is displayed it will be shown in its defined colours. The colour mappings are retained across a LOAD and so it is possible to load a game and for it to be displayed using the defined colours, i.e. existing games can be colourised!


The Chroma interface also provides the following facilities:
  • An onboard 16K RAM pack.
  • Additional 16K RAM that be mapped into the 48K-64K region, or the 8K-16K region.
  • Support for a user definable character set within the RAM located in the 8K-16K region.
  • Support for WRX graphics format, allowing true high resolution graphics.
  • QS Character Board emulation, allowing a user definable character set and operating with the range of Quicksilva games that supported the original character board.
  • A ROM cartridge socket that allows complete overriding of the ZX81 ROM, making it possible to run replacement operating systems or ROM enhancements, e.g. the Skywave FORTH ROM, the Comprocsys ASZMIC ROM, the dk'tronics and Kayde Graphics ROMs. The socket is compatible with my range of ZXC ROM cartridges, including the recently released ZXC4 that contains a 4MB FLASH ROM (opening the potential to store 100s of games on a single cartridge for instant loading and for recording these files directly from the ZX81).
  • A Cursor joystick socket, with support for auto-fire joysticks.
  • An RS232 socket, which could be useful for connecting to a printer, modem or a PC (a ROM cartridge program is already available to allow loading and saving via RS232 from a PC).
  • Output of LOAD/SAVE sounds through the TV speaker(s).
  • A set of configuration switches to allow each facility to be enabled / disabled, ensuring maximum compatibility with all existing hardware, e.g. ZXpand.
  • A full width, gold plated rear expansion bus.
  • A reset button.
The ROM cartridge facility is already supported by a number of ROMs available for download:
  • Transform the ZX81 into a ZX80, allowing it to run all ZX80 software!
  • Load and save ZX81 programs via RS232 from a PC.
  • Run the dk'tronics and Kayde Graphics ROMs.
  • Upgrade an ZX81 with an edition 1 ROM to use the edition 2 ROM.
Or alternatively run an existing replacement ROM directly from a ROM cartridge, e.g. Skywave's FORTH ROM or Comprocsys' ASZMIC ROM.

The Chroma interface can be used with all ZX81s irrespective of the ULA version they contain. It has been designed for compatibility with ZXpand and so it is possible to have a great quality picture and still load programs quickly from SD card!

Full details about the interface and the facilities it provides can be found at:
http://www.fruitcake.plus.com/Sinclair/ ... erface.htm
Last edited by Fruitcake on Fri Oct 24, 2014 8:19 pm, edited 1 time in total.
User avatar
siggi
Posts: 988
Joined: Thu May 08, 2008 9:30 am
Location: Wetterau, Germany
Contact:

Re: Chroma 81 - SCART and Colour interface for the ZX81

Post by siggi »

Sorry, the link does not work anymore: "This site has been removed because it has exceeded its bandwidth allowance."

:(
Siggi
My ZX81 web-server: online since 2007, running since dec. 2020 using ZeddyNet hardware
http://zx81.ddns.net/ZxTeaM
Fruitcake
Posts: 346
Joined: Wed Sep 01, 2010 10:53 pm

Re: Chroma 81 - SCART and Colour interface for the ZX81

Post by Fruitcake »

The website is now available again.

New additions to it are colourisation programs for Mazogs and Kong, and a test program for the Attribute Colour Mode.

Support for both of Chroma's colour modes is now available in the JSZeddy emulator, allowing it to run all of the programs mentioned above.
User avatar
stefano
Posts: 542
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: Chroma 81 - SCART and Colour interface for the ZX81

Post by stefano »

Love the colourization trick !

I suppose you had a thought about supporting some kind of lambda compatibility, is it just still not present or it has been avoided for specific reasons ?
User avatar
kmurta
Posts: 302
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

Re: Chroma 81 - SCART and Colour interface for the ZX81

Post by kmurta »

Hi Paul,

Chroma 81 is an exciting interface an here are two colored programs that I would like to share: a game with redefined characters and a kaleidoscope pattern generator. If you want, fell free to share it at Chroma 81 web page.
Attribute Colour Mode
Attribute Colour Mode
kaleido.png (13.67 KiB) Viewed 16067 times
Character Color Mode
Character Color Mode
ZXGal1.png (14.31 KiB) Viewed 15871 times
P.S.: I missed the support to CHR$128 in CHROMA interface. It make use of the bit 7 of character code and the bit 0 of the z80 I register to address a second bank of characters patterns, so you can redefine 128 characters against only 63. There are some games that make use of this feature.
Attachments
Colored.zip
With black border the layout is lighter ;-0
(9.1 KiB) Downloaded 460 times
Last edited by kmurta on Mon Nov 03, 2014 10:34 pm, edited 1 time in total.
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org
https://toddysoftware.itch.io/
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Chroma 81 - SCART and Colour interface for the ZX81

Post by PokeMon »

Are there any technical details for CHR$128 mode published somewhere ?
I couldn't find useful information on the web.
User avatar
kmurta
Posts: 302
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

Re: Chroma 81 - SCART and Colour interface for the ZX81

Post by kmurta »

The CHR$128 is a user defined character generator that allow the generation of a set of 128 unique characters patterns and is similiar in concept to the CHR$X16 from Wilf Rigter.

In addition to the normal non-inverted characters, there are a new set of 64 patterns for the inverted characters (codes 128 to 191). The normal 64 characters are defined in a memory area of 512 bytes, usually located at address $1E00 of ROM. For the new character set are needed more 512 bytes, contiguous to the first table. So for 128 characters are needed 1024 bytes for character definition table. The extra characters are inverted by the video circuit so this should be taken into account when the characters patterns are defined.

The bit 7 of the character code are used (togheter with bit 0 of Z80 I register) to generate the address line A9. This is an implementation of CHR$128 for the TK85, see that a 74LS157 is used to generate the A9 address line. The INVERT is the previously latched bit 7 of character code and the A8 line loads (during the refresh cycle) the bit 0 of the I register. When both are high the char codes 128 to 191 will address the extra 512 bytes of the character definition table, otherwise the first table are used.

Here are some programs that use the CHR$128, included converted Quicksilva's games.

For a better understanding here are a full explanation of the CHR$128, from Wilf's ZX97LITE article:
4) CHR$ DECODER

This subsystem is closely tied to the ZX81 video design, which has mystified more than a few experienced ZX81 fans. By following along with the description of operation of this circuit, we learn much about the clever ZX81 video system and discover that Sir Clive missed some powerful video options for the ZX81 by just a few extra gates.

The ZX81 alphanumeric and graphic characters in the video display file (DFILE) consist of up to 768 (24x32) bytes of CHR$ codes. These are converted into rasterized patterns of video pixels and displayed on the monitor screen as 32 blocks of 8 x 8 light or dark pixels. For each of the 64 displayable ZX81 character codes, a rasterized graphic shape is stored in 8 contiguous bytes in a video dot pattern lookup table in the last 512 bytes of the 0-8K ZX81 ROM.

Image

The CHR$ decoder operates in two steps:

1) The Z80 reads each character in DFILE and together with the CHR$ lookup circuit generates the address of a dot pattern byte
2) The dot pattern byte is accessed during RFSH and loaded into the video shift register to be shifted out serially at 6.5M pixels per second.

The DFILE echo above 32K is literally "executed" during the video display. Each CHR$ in the DFILE is fetched by the Z80 as an OPCODE , but executed as a NOP instruction during 4 CPU clock cycles. The CHR$ decoder circuit uses 6 bits of each fetched CHR$ code together with 3 bits of a the horizontal line counter and with part of the Z80 RFSH address to form the address to a byte in the dot pattern lookup table.

The three bits of line counter U11.A, which is clocked by each HSYNC pulse, are used for A0'-A2'of the pattern byte address. The counter increments 8 times as each row of DFILE characters is read 8 times in succession. This generates one row of video characters on the screen, with each adjacent character made up of 8 bytes of video dot pattern data in a block of pixels 8 high by 8 wide. This is repeated for each of the 24 character rows. The total number of controlled dots (screen resolution) for a ZX81 screen is 256x192. The lower 6 bits of each CHR$ code in DFILE is clocked into U12 at the end of the /RD signal and makes up A3'- A8' of the video pattern look up address. The CHR$ D6-7 bits are used, in the VIDEO circuit, discussed later in PART 6, to enable video and to invert the video pattern for that CHR$, generating a reverse foreground - background character on the screen.

These 9 least significant address bits (LSB) select one of the 512 video dot pattern bytes. They are stored and tristate isolated with U12 - (octal register) and U10.A (tristate buffer) until the RFSH and A14 are both low which then enables 9 LSB on the A0'-A8' address lines. The most significant 7 address bits of the dot pattern byte address are supplied by contents of the Z80 Interrupt Register (IREG), which is gated onto the A8-A15 lines during RFSH time. The 7 bits in the I register are therefore used to point to the start of the lookup table while 9 least significant address bits (LSB) select one of the 512 video dot pattern bytes in that lookup table.

So far this circuit functions similar to the ZX81 ULA circuit but with one significant difference:

1) In the ZX81, the pattern lookup table must be in the internal ROM because the ULA CHR$ decoder A0'- A8' outputs lines are physically connected to the only to the ROM address lines.

2) In the ZX97L CHR$ decoder both the RAM and ROM can be accessed and either can be used for the pattern lookup tables as long as they are located in 0-16K or 32-48K (ie A14 low). This was done to permit the display of true hires video which requires that CHR$ decoding is disabled and means that hires display files must be located in 16-32K or 48-64K. Given that limitation, you can locate one or more user defined 512 byte pattern lookup tables in RAM for example in the 8-16K or 32- 40K area. The first byte of the lookup table must be located on a 512-byte boundary (ie locate the table between 8192 - 8703).

All that is needed to access the new lookup table is to load the IREG with the high order 7 bits of the table starting address. Note that bit D0 of IREG (gated to the Z80 A8 line but not to the A8' line) is normally 0 but is otherwise ignored in the ZX81 CHR$ video mode.

A second enhancement provided by the ZX97L CHR$ decoder circuit gives you a choice of using 64 Characters and their reverse in a 512 byte pattern table or 128 unique characters in a 1024 byte pattern table. In the normal ZX81 CHR$ video mode there are 64 CHR$ codes with unique patterns stored in a 512 byte pattern table and uses CHR$ bit D7 to invert video for that CHR$, generating the same pattern but with reversed foreground / background colors on the screen. The details of the shift register and the parallel loading pulses are described in the ZX97L Video Circuit.

In the ZX97L enhanced CHR$ video mode D7 of the CHR$ code is combined with D0 of IREG to address a second pattern table thereby doubling the number of unique displayable characters to 128 instead the normal reversed character set.

For example, both upper and lowercase alphabet characters as a well as new symbols or new graphic game characters can be displayed. This second table of 64 character video patterns can be located for example in 8192-8703 RAM, contiguous with the existing ZX81 video pattern table in 7680-8191 EPROM.

To enable the 128 CHR$ mode, set bit D0 of the IREG to a logic 1. Now instead of simply reversing the displayed character whenever D7 of the CHR$ code is high, a second unique pattern (ie lowercase) for that CHR$ is displayed. Bit D0 of IREG and D7 of the CHR$ generate A8 and INVERT at the inputs of AND gate U25.A at RFSH time. If INVERT and A8 are HIGH, the U25.A output A9' is high and accesses the second pattern table.

Note that dot patterns in the second pattern table are displayed in reverse video but that is simple to correct by loading the second table with reversed (instead of normal) dot pattern bytes.
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org
https://toddysoftware.itch.io/
User avatar
kmurta
Posts: 302
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

Re: Chroma 81 - SCART and Colour interface for the ZX81

Post by kmurta »

Another coloured game: Alien Mind, from André Baune.
almind.png
almind.png (19.16 KiB) Viewed 15966 times
P.S.: The André's site is not working, so I attach a copy of Alien Mind game here.
Attachments
ALMIND.P
(14.37 KiB) Downloaded 439 times
AlienMindColour.zip
(5.78 KiB) Downloaded 527 times
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org
https://toddysoftware.itch.io/
User avatar
stefano
Posts: 542
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: Chroma 81 - SCART and Colour interface for the ZX81

Post by stefano »

For those who may be interested.. the default text mode on z88dk is "case sensitive", which means it uses the normal characters for the lowercase characters and the inverted mode for the uppercase stuff.
This came after a Siggi's suggestion trying to squeeze the maximum from the console and being able to be internet compatible (i.e. he needed a replacement for the '@' symbol).
Any C program is fully lowercase compatible, and the CHR$128 trick could be the natural complement.
Fruitcake
Posts: 346
Joined: Wed Sep 01, 2010 10:53 pm

Re: Chroma 81 - SCART and Colour interface for the ZX81

Post by Fruitcake »

stefano wrote:Love the colourization trick !
Thanks. I’ve coloured my Kong game (which is now on my website) and also my Pacman game (which I’ve yet to upload).
kmurta wrote:Chroma 81 is an exciting interface an here are two colored programs that I would like to share: a game with redefined characters and a kaleidoscope pattern generator. If you want, fell free to share it at Chroma 81 web page.
Thanks. The kaleidoscope generator nicely demonstrates the attribute colour mode being controlled from BASIC, and the colourisation of Galaxians looks really good.

The screenshot for Galaxians shows a blue border but there was a bug in the JSZeddy emulator that swapped the blue and green bits of the border colour. When I try the game on real hardware the border appeared as green. I reported the bug in JSZeddy and it has now been fixed, but the Galaxians colourisation file will also need to be updated.
kmurta wrote:The André's site is not working, so I attach a copy of Alien Mind game here.
I think his main website is here.
stefano wrote:I suppose you had a thought about supporting some kind of lambda compatibility, is it just still not present or it has been avoided for specific reasons ?
I am not very familiar with the various clones of the ZX81 and the new features they introduced, let alone how they work.

The Lambda colour board was never released in the UK and although I have seen it supported in emulators, there seemed to be little documentation about it and few (if any) games that support it. It was therefore not high up the priority list for Chroma. It could in theory be emulated, as could the DCC and Haven colour mechanisms but again the lack of software support meant they were not must-have features.

The main focus for colour support was really to allow existing games to be colourised. As I have found out with my SPECTRA SCART interface for the Spectrum, there are few people willing to develop new software for its enhanced colour modes and so it seemed reasonable to assume the same would be the case for the ZX81. The attribute colour mode shares a lot of the logic used by the character code colour mode and so it did not take up a lot of extra resource to include. Its mechanism feels more flexible to me than Lambda's, allowing the display file to be located anywhere within RAM and providing supporting for 16 ink and paper colours compared to just 8. The Lambda (and other) colour mechanisms would require significantly different logic and unfortunately there are just not the resources available in the IC I've used.

It would be very nice to see new software exploit the attribute colour mode, as I am sure some fantastic looking games could be achieved using it. The Chroma interface allows the presence of the colour facilities to be detected from software so that a game can check for the mode and use it if present else default to standard black and white mode.
kmurta wrote:I missed the support to CHR$128 in CHROMA interface. It make use of the bit 7 of character code and the bit 0 of the z80 I register to address a second bank of characters patterns, so you can redefine 128 characters against only 63. There are some games that make use of this feature.
kmurta wrote: Here are some programs that use the CHR$128, included converted Quicksilva's games.
This was a mode I was again not that familiar with. I had seen reference to it in emulators but finding details on it seemed difficult. Aside from the link you mention, I had not found any other programs that used it. The UDG mode has more support and it seemed better to target modes that there is software for. The WRX graphics mechanism has reasonable software support and so it seemed high priority to support it. The various other hi-res modes, such as G007 and Memotech, could in theory also be emulated but again the lack of software support (let alone the lack of documentation on how they work) pushed them down the priority list. The QS Character Board made it into Chroma because it was one of the original graphics boards released for the ZX81 and commercial software had been available that supported it (admittedly not much but in the 80s I had always been curious about it but had never managed to obtain one).

The CHR$128 mode is a nice clever extension to UDG mode and I have attempted to include logic to support it, but unfortunately there are not the resources available in the IC. It really is crammed full. I’ve tried different approaches but none will fit. Even if it had fitted, both the UDG and CHR$128 games on the site you mentioned locate the character bitmaps at $3000. It would therefore be necessary to provide a means to select the active mode. A switch would be the ideal way but there aren't any spare on the board. Unfortunately CHR$128 support won't be available in the Chroma interface.
Post Reply