Software - Utilities

Chroma Program Enhancement Creator

The Chroma Program Enhancement Creator is a Windows utility for designing replacement character sets and colourisation definitions for enhancing the appearance of existing ZX80 and ZX81 programs using the facilities provided by the Chroma 80 and Chroma 81 interfaces respectively. It will automatically generate loader programs that configure the Chroma interface facilities prior to loading the target program. Character and colourisation definitions can be saved as .chr and .col files respectively for reloading at a later date, or for use with the ZX ROM Cartridge Creator.

The Chroma Program Enhancement Creator is an amalgamation of the functionality previously provided by the Chroma Program Enhancement Designer utility and Chroma Program Enhancement Generator utility (which itself replaced the Chroma Colourisation Generator and the Chroma Character Generator utilities).

A screenshot of the Chroma Program Enhancement Creator can be seen below:

Chroma Program Enhancement Creator

The top right area presents an entry for each character of the character set. The top of a character entry shows the standard Sinclair pixel pattern and underneath this is the redefined pattern and colour for the character. Clicking on an entry will draw a red border around it to show that it is selected. A large version of the character will then appear in the area to the top left, and this can be edited using the left and right mouse buttons to set and reset pixels respectively.

The controls underneath the character grid allow manipulation of the character definition, and moving the mouse over each control will display a help summary of the action it performs. Bit patterns may be copied from one character to another or from an external image. To the right of the grid are drop down selections that allow the ink and paper colour for each line of the character to be specified. The Cell Colours checkbox allows the ink and paper drop downs for the top line to apply to all lines of the character. Changes made are not automatically stored back into the character set and so the Commit control button must be used to do this. Alternatively, the Auto Commit checkbox can be ticked and will cause all changes to be immediately written back to the character set.

The Character Set Controls area allows selection of the target computer - ZX80 or ZX81. The two computers have slightly different character set arrangements and so selecting to change computer type will remap the character settings as appropriate. The controls area also provides functions to manipulate all entries in the character set in one go, along with a drop down to allow selection of the border colour.

The Show Colours checkbox causes the character set entries to be displayed with or without colour. This is useful to check that the redefined characters will also display correctly if used on non-colour UDG hardware, e.g. an original QS Character Board or dk'tronics / Kayde Graphics ROM Board.

For the entry selected in the character set area, its character code and a description appear below the character set area. The description is included only as a reminder of what the character represents in the program being enhanced. Double clicking the entry will allow its description to be changed.

Right clicking the Sinclair character for an entry in the character set area will present options to copy the pattern to the clipboard or to revert the redefined version for that entry. Right clicking on the redefined version presents an option to created all inverted or all non-inverted characters based on the opposite set of characters, which can be particularly useful when constructing fonts. It also presents options to revert the character pattern and description back to their original values.

The Character Definition Details area allows a description to be specified, which can be used as a reminder of the program the character definitions are intended to enhance, along with other relevant details such as the author and creation date. Character definition files can be loaded and saved in .chr text based format or in binary format. When loading from a binary file, the character set pattern bytes can be extracted from a specified 1K boundary within the file (which must be no larger than 8K in size). Options allow 64 or 128 characters to be specified, and if 128 characters are selected then whether to invert the last 64 characters.

The Colour Definition Details area allows a description to be specified, which can be used as a reminder of the program the colourisation definitions are intended to enhance, along with other relevant details such as the author and creation date. Colourisation definition files can be loaded and saved in .col format.

The Program Details area allows the target program to be selected. It will show the file name embedded within the ZX81 program if present, else the name of the PC file it was read in from.

The area to the bottom left presents controls to discard all character and / or colour configuration data.

The bottom right area is used to select the type of output file to generate, with toggle buttons used to specify whether to include a character loader, and / or a colour loader, and / or the program file. When a character loader is to be included, the format of the UDGs can be specified. Three formats are available. Information about the modes can be viewed by clicking the 'i' icon next to the 'Format' label.

The three UDG formats are:

The Create button brings up a dialog allowing the output file format to be chosen. If multiple program options are selected for output then the save format will be .tzx, but if only a single program option is selected then the save format can also be to .p (nameless ZX81 file) or .p81 (named ZX81 file). When creating a character loader, the utility will first prompt whether to include the definitions for all characters that have not changed from their default Sinclair forms. On a standard ZX81 there is no need to include these as the default character patterns are simply copied from the ROM, but if the output file is to be used with the ZXpand interface then it is not possible to copy the character patterns from the ROM and so it is necessary for the loader program to explicitly include and set them all. However, this will make the loader program larger which may be less desirable if it will be loaded from a real cassette.

The ZX81 file name used for a character or colour loader when saving as a .tzx or .p81 file is based upon the ZX81 file name of the program file. For the character loader, a '$' is appended to the file name, and for the colour loader a '+' is appended to the file name. If a program file is not selected then the Program Details File Name entry box will be empty, in which case the name of the output PC file will be used as the base for the loader program file names. In such a case, the colour loader (or the character loader if a colour loader is not included in the output) will perform an unnamed load, i.e. LOAD "". However, if a program file name is specified (with or without a program file being selected) then a named load will be performed, i.e. LOAD "name". Performing an unnamed load can be useful to allow the loader programs to be used with multiple programs, although if targetting the ZXpand interface then all loads must be of the named variety. The ZXpand only supports .p files and so each loader program must be created individually. Only PC file names up to 8 characters long are supported and so the ZX81 program's file name must be edit to fit within this length. Note that the ZXpand has further restrictions on the symbol characters that can appear within file names (refer to the ZXpand documentation for further details).


Character Definition File Format

Character files are text files formatted using XML tags, allowing them to be viewed and even created using a simple text editor. They have the .chr file extension. A character file defines the pixel patterns for every line of each character. An example character file is shown below.

<?xml version="1.0"?>
<definition>
  <version>1</>
  <computer>ZX81</>
  <description>Character definition file (c)2015 Paul Farrow for QS Asteroids (c)1982 Quicksilva</description>
  <entry code="157" description="Inverse 1">
    <line index="0">11110000</line>
    <line index="1">11101110</line>
    <line index="2">11011110</line>
    <line index="3">10111110</line>
    <line index="4">00001101</line>
    <line index="5">11101011</line>
    <line index="6">11100111</line>
    <line index="7">11101111</line>
  </entry>
  <entry code="129" description="Top-left-white">
  ...
  </entry>
</definition>

The example shows the definition of the following character:

QS Asteroids character

The purpose of each XML tag is described in the following table.

Tag Description
definition Encloses the character definitions.
version The format of the character file. Currently this must always be 1.
computer The computer this file is for: ZX80 or ZX81. If this tag is not specified then the file is assumed to be for the ZX81.
description Free form text to note any information deemed relevant, e.g. author, release date, intended program(s) to use the characters with.
entry A character file will typically contain several entry tags one after the other. Each will define the bit patterns to use for a specified character. The code attribute indicates the character code (0 to 63 for the normal characters, and 128 to 191 for the inverted characters). The description attribute allows free form text and is intended to be used as a comment to describe the character that this entry defines.
line Each character is formed of 8 lines and so an entry tag must contain 8 line tags to explicitly define them. The index attribute defines which line within the character, with 0 for the top line down to 7 for the bottom line. The contents of the tag define the bit pattern for the line using binary notation, with 1 for a black pixel and 0 for a white pixel.

When a character loader is generated it always initialises every character to their standard Sinclair patterns and then overwrites those characters that have been redefined. This means only those characters that deviate from their standard pixel patterns need be saved in a .chr file, which minimises the space required when the .chr file is used with the ZX ROM Cartridge Creator. However, the utility will prompt whether or not to include all character definitions irrespective of which have been redefined.

Should a .chr file be edited by hand with the result that there are multiple entry definitions for a particular character then the last entry supersedes all preceding ones for that character.


Colourisation Definition File Format

Colourisation files are text files formatted using XML tags, allowing them to be viewed and even created using a simple text editor. They have the .col file extension. A colourisation file defines the colouring scheme to be used for every line of each character, and also the colour to use for the border. An example colourisation file is shown below.

<?xml version="1.0"?>
<colourisation>
  <version>1</version>
  <computer>ZX81</>
  <description>Colourisation file (c)2015 Paul Farrow for Mazogs (c)1981 Bug-Byte Software</description>
  <border><colour>0</colour><bright>0</bright></border>
  <entry code="0" quantity="128" description="Default colours for all characters">
    <line index="0">
      <paper><colour>7</colour><bright>1</bright></paper>
      <ink><colour>0</colour><bright>0</bright></ink>
    </line>
    <line index="1">
      <paper><colour>7</colour><bright>1</bright></paper>
      <ink><colour>0</colour><bright>0</bright></ink>
    </line>
    <line index="2">
      <paper><colour>7</colour><bright>1</bright></paper>
      <ink><colour>0</colour><bright>0</bright></ink>
    </line>
    <line index="3">
      <paper><colour>7</colour><bright>1</bright></paper>
      <ink><colour>0</colour><bright>0</bright></ink>
    </line>
    <line index="4">
      <paper><colour>7</colour><bright>1</bright></paper>
      <ink><colour>0</colour><bright>0</bright></ink>
    </line>
    <line index="5">
      <paper><colour>7</colour><bright>1</bright></paper>
      <ink><colour>0</colour><bright>0</bright></ink>
    </line>
    <line index="6">
      <paper><colour>7</colour><bright>1</bright></paper>
      <ink><colour>0</colour><bright>0</bright></ink>
    </line>
    <line index="7">
      <paper><colour>7</colour><bright>1</bright></paper>
      <ink><colour>0</colour><bright>0</bright></ink>
    </line>
  </entry>
  ...
</colourisation>

The purpose of each XML tag is described in the following table.

Tag Description
colourisation Encloses the colour scheme definitions.
version The format of the colourisation file. Currently this must always be 1.
computer The computer this file is for: ZX80 or ZX81. If this tag is not specified then the file is assumed to be for the ZX81.
description Free form text to note any information deemed relevant, e.g. author, release date, intended program(s) to colourise.
border Contains tags that define the colour of the border area.
entry A colouristion file will typically contain several entry tags one after the other. Each will define the colours to use for one or more characters. The code attribute indicates the starting character code (0 to 63 for the normal characters, and 64 to 127 for the inverted characters). The quantity attribute specifies how many characters are to use this colourisation definition. The description attribute allows free form text and is intended to be used as a comment to describe the range or purpose of the characters this entry covers.
line Each of the lines within a character can be colour independently and hence an entry tag must contain 8 line tags to explicitly define them. The index attribute defines which line within the character, with 0 for the top line down to 7 for the bottom line.
ink Contains tags that define the colour for the set pixels for the current line.
paper Contains tags that define the colour for the reset pixels for the current line.
colour Specifies the colour for the current item.
Supported colours are: 0=Black, 1=Blue, 2=Red, 3=Magenta, 4=Green, 5=Cyan, 6=Yellow, 7=White.
bright Specifies the brightness of the colour for the current item. Note that Dull Black and Bright Black will both display the same, although the difference could be used to encode hidden data.
Supported values are : 0=Dull, 1=Bright.

When the Chroma Program Enhancement Creator saves a .col file, it automatically determines blocks of consecutive characters that use the same colour scheme and simply defines a single entry for these. This is beneficial when the .col file is to be used with the ZX ROM Cartridge Creator as it minimises the amount of space required to hold the colourisation definition information within the ROM cartridge.

Should a .col file be edited by hand with the result that there are multiple entry definitions for a particular character then the last entry supersedes all preceding ones for that character.


Downloads

Click here to download the Chroma Program Enhancement Creator [V1.2.0] utility.

A selection of character files are available for download from the Character Definition Files page, and a selection of colourisation files are available for download from the Colourisation Definition Files page. They can be used as the basis for generating character and colourisation files for other ZX81 programs.