Amstrad XT pages
Home -> Amstrad XTs -> Counterpoint


The Counterpoint program launcher was supplied with the Amstrad PC5086 and other Amstrad PCs from that era. It acts as a user-friendly front end, replacing the full GUIs (Windows 2.0, or GEM) supplied with previous models.

The Amstrad-branded version opens with a warning that it should only be used on Amstrad computers. However it appears to run successfully in non-Amstrad environments, such as the virtual machine used to make these screenshots.

Counterpoint, in the Amstrad version, appears to assume a colour VGA screen using the 16-colour 640×480 mode. The main executable is launched from a batch file with the command CP_C V. It also supports launching with CP_C E, which selects EGA 640×350 mode, but displays only a blank screen. I think at the very least EGA mode would not work without a set of EGA support files (CP_E.APP, CP_E.CUR etc.) which are not included.

Other arguments produce the error message Run CP.BAT.

Internally, Counterpoint appears to include a copy of the BGI driver EGAVGA.BGI to provide its graphics drawing functions.

The 'Exit' icon in the top right-hand corner terminates Counterpoint immediately, returning you to the DOS prompt.

The clock in the bottom left-hand corner shows the time and date; the three buttons below it allow the format to be changed between analogue and digital, and the date and time to be set.

The three icons in the middle of the screen lead to subfolders. As with Windows 95, you can mix program icons and subfolders freely; there is no one-level 'program groups' system as in Windows 3.1.

On a stock PC5086, only the 'Utilities' submenu is populated. Two separate 'Games' packages were sold; when these are installed, icons are added in the 'Games' subfolder.

Presumably a corresponding 'Business' package also existed, which populated the 'Business' menu.

In a subfolder, the icon in the top right-hand corner takes you to the top level (not the parent folder).

The 'Format 720' icon has been highlighted, which is why its colours are inverted.

If Counterpoint is left idle, a screensaver kicks in, with a clock that moves around the desktop.

The main menu drops down when the mouse hovers over it, as in GEM. The 'Text Mode' option switches to a blank text-mode screen, presumably for the convenience of text-mode popup utilities.

'Set Colours' rotates through a number of fixed palettes.

The 'Icons' menu has four options: Create Icon to create a new shortcut or subfolder, and the remaining three to edit the icon properties.

This screen is brought up by the "CP RAM usage" option. Programs set to have Counterpoint not resident are launched from a batch file which then reruns Counterpoint.

By default, newly-created icons are simple white outlines with text captions. The 'Edit' menu allows the captions and the commands executed by the icon to be changed.

An icon editor can also be accessed from the "Appearance" option of the "Edit" menu.

Counterpoint .ICN file format

The file format is reasonably straightforward: a four-byte header giving the width and height:

	DW	width	;Icon width (little-endian word)
	DW	height	;Icon height (little-endian word)

followed by a bitmap. The width of each line in a bitmap is ((width / 8) + 1) bytes, so that if the width is an exact multiple of 8, the last byte is ignored. Each line is repeated 4 times, once for each of the four VGA planes.

To read the ink used for a pixel, code like this can be used:

	unsigned pitch = (w + 8) / 8;
        unsigned char ink   = 0;
        unsigned char pmask = 0x01;
	unsigned char mask  = 0x80 >> (x % 8);
        for (plane = 0; plane < 4; plane++)
        	unsigned char ch = image[(y * 4 + plane) * pitch + (x/8)];
                if (ch & mask)
                        ink |= pmask;
                pmask = pmask << 1;

The Amstrad branding is stored in the file CP_V.LGO, in the same format. On a stock installation, it looks like this: ; loading the second PC5086 games package replaces it with the version seen in the screenshots above.

John Elliott 11 June 2011.