Attribute clash
Encyclopedia
Attribute clash was a display artifact caused by limits in the graphics circuitry of a number of early color 8-bit home computer
Home computer
Home computers were a class of microcomputers entering the market in 1977, and becoming increasingly common during the 1980s. They were marketed to consumers as affordable and accessible computers that, for the first time, were intended for the use of a single nontechnical user...

s, most notably the Sinclair Research ZX Spectrum
ZX Spectrum
The ZX Spectrum is an 8-bit personal home computer released in the United Kingdom in 1982 by Sinclair Research Ltd...

, where it meant that only two colors could be used in any area of 8×8 pixels. Programmer workarounds to prevent this limit from becoming apparent have since been considered an element of Spectrum user culture.

Causes

Attribute clash on the ZX Spectrum was caused by its idiosyncratic display memory layout, designed in such a way as to minimise memory use of the frame buffer, and optimise for text display instead of graphics. Rather than limit the color palette to conserve memory, Sinclair's design stored pixel
Pixel
In digital imaging, a pixel, or pel, is a single point in a raster image, or the smallest addressable screen element in a display device; it is the smallest unit of picture that can be represented or controlled....

 bitmap
Bitmap
In computer graphics, a bitmap or pixmap is a type of memory organization or image file format used to store digital images. The term bitmap comes from the computer programming terminology, meaning just a map of bits, a spatially mapped array of bits. Now, along with pixmap, it commonly refers to...

 and color information in separate areas of memory. While the bitmap specified the state of individual pixels (either on or off), the color information (or "attributes") corresponded to the text character matrix — 24 rows of 32 columns — with one byte
Byte
The byte is a unit of digital information in computing and telecommunications that most commonly consists of eight bits. Historically, a byte was the number of bits used to encode a single character of text in a computer and for this reason it is the basic addressable element in many computer...

 per 8x8 pixel character cell. This byte encoded two 3-bit values, known as INK (foreground color) and PAPER (background color) after the BASIC
BASIC
BASIC is a family of general-purpose, high-level programming languages whose design philosophy emphasizes ease of use - the name is an acronym from Beginner's All-purpose Symbolic Instruction Code....

 instructions used to define the color values. Two other binary values were included in an attribute; a BRIGHT bit indicating one of two brightness levels for the two colors, and a FLASH bit, which, when set, caused the two colors to be swapped at regular intervals. This scheme provided 15 different colors: the eight combinations of red, green and blue at two brightness levels (except for black, which appeared the same at both brightness). Thus, each 8x8 pixel block could only contain 2 colors from the 15 available, which must both be from either the BRIGHT or non-BRIGHT halves of the palette. Trying to add a third color in an 8x8 pixel area would result in the three colors being reduced to two by the ZX Spectrum.

The ZX Spectrum used 6144 bytes for pixel information, with one byte representing a row of eight pixels, and 768 bytes used for the color attributes, thus giving a total of 6912 bytes for the entire graphics display, a relatively small total for a computer of the Spectrum's era with "color" capabilities. This graphics architecture was retained right through to Sinclair and Amstrad
Amstrad
Amstrad is a British electronics company, now wholly owned by BSkyB. As of 2006, Amstrad's main business is manufacturing Sky Digital interactive boxes....

's later redesigns of the Spectrum, up until Amstrad's final model, the ZX Spectrum +3, despite subsequent models having contained 128 kB of RAM, reducing the need to save memory in this manner. The architecture was retained to prevent loss of backwards compatibility.

Attributes were used by a variety of other computers and consoles, including the Commodore 64
Commodore 64
The Commodore 64 is an 8-bit home computer introduced by Commodore International in January 1982.Volume production started in the spring of 1982, with machines being released on to the market in August at a price of US$595...

, the MSX
MSX
MSX was the name of a standardized home computer architecture in the 1980s conceived by Kazuhiko Nishi, then Vice-president at Microsoft Japan and Director at ASCII Corporation...

 and NES
Nintendo Entertainment System
The Nintendo Entertainment System is an 8-bit video game console that was released by Nintendo in North America during 1985, in Europe during 1986 and Australia in 1987...

, although the size of the attribute blocks and the number of colors per block varied. However, with the use of hardware sprites
Sprite (computer graphics)
In computer graphics, a sprite is a two-dimensional image or animation that is integrated into a larger scene...

 and scrolling
Scrolling
In computer graphics, filmmaking, television production, and other kinetic displays, scrolling is sliding text, images or video across a monitor or display. "Scrolling", as such, does not change the layout of the text or pictures, or but incrementally moves the user's view across what is...

, attribute clash could be avoided.

The Thomson MO5
Thomson MO5
The Thomson MO5 was a 6809E-based computer introduced in France in 1984. It featured 32 KB of RAM, a 40×25 text display, and built-in Microsoft BASIC. The MO5 was replaced by the MO6 in 1986.-External links:...

 and TO7
Thomson TO7
The Thomson TO7 is a home computer introduced by Thomson SA in November 1982.The TO7 is built around a 1 MHz Motorola 6809 processor. ROM cartridges, designed as MEMO7, can be introduced through a memory bay. The user interface uses Microsoft BASIC, included in the kit cartridge. The keyboard...

 microcomputers, the Oric 1, the MSX 1 architecture
Computer architecture
In computer science and engineering, computer architecture is the practical art of selecting and interconnecting hardware components to create computers that meet functional, performance and cost goals and the formal modelling of those systems....

, and other systems based on the Texas Instruments TMS9918
Texas Instruments TMS9918
thumb|VDP TMS9918Athumb|VDP TMS9918Athumb|VDP TMS9928AThe TMS9918 is a Video Display Controller manufactured by Texas Instruments.-General information:...

 Video Display Controller
Video Display Controller
A Video Display Controller or VDC is an integrated circuit which is the main component in a video signal generator, a device responsible for the production of a TV video signal in a computing or game system...

 display a very similar constraint: for each group of eight pixels horizontally, only two colors out of 16 are available. giving a similar but less severe effect than with the Spectrum. The MSX 1 did not have just one single color attribute byte available for a whole 8x8 pixel area, as was the case with the Sinclair Spectrum, but eight, one attribute byte for each 8×1 pixel area. Thus, while the Spectrum was limited to one color pair for a square area of 8x8 pixels, the MSX 1 was only limited to one color pair for a "line" of eight adjacent pixels. In addition MSX1 could use sprites
Sprite (computer graphics)
In computer graphics, a sprite is a two-dimensional image or animation that is integrated into a larger scene...

 which were not bound to any attribute clash problems (although MSX 1 sprites did have their own limitations).

In practice this technical advantage often did not help MSX 1 systems to produce better pictures. The problem for the MSX 1 was that many European software companies who converted Spectrum games to MSX 1 ignored all the improvements the MSX 1 had over the Spectrum, and thus the resulting MSX 1 versions had the same amount of attribute clash as the original Spectrum games. To ease conversion, the software developers simply copied the single attribute byte value of the Spectrum to all eight corresponding attribute bytes of the MSX 1. For the same reason, the software companies also ignored the sprite capabilities of the MSX 1, and because the video display capabilities were otherwise quite similar (256×192 resolution, 16 colors), both systems produced virtually identical displays for the same game. In contrast, Japanese MSX 1 games did use all the capabilities of MSX 1, often resulting in better looking games.

Effects

To avoid attribute clash, static graphic displays had to be constructed with care. Finely-detailed color graphics were impossible, as color could only be applied in 8×8 pixel blocks. Careful design could achieve impressive results, as could synchronizing color changes to the refresh rate of the display — usually a television set.

However, animated displays were more difficult — a distinct drawback in a machine whose primary use was playing video games. If just one pixel in an 8×8 block was recolored because a moving part of the display touched it, the entire block would change color. Thus detailed moving graphics caused large ugly fringes of rapidly changing colors to follow them around.

Workarounds

Early software simply ignored the problem. Later, the standard workaround was to use color for static display elements — such as a decorative border around the edges of the screen, which might include score displays and so on, or some form of instrumentation — with a smaller central monochrome
Monochrome
Monochrome describes paintings, drawings, design, or photographs in one color or shades of one color. A monochromatic object or image has colors in shades of limited colors or hues. Images using only shades of grey are called grayscale or black-and-white...

 area containing all the animated graphics. This also made graphics faster, as less of the screen had to be updated — both a smaller region, plus only changing pixel information and leaving the color area untouched.

Some late Spectrum software, such as FTL's Light Force
Light Force (video game)
Light Force is a shoot 'em up game released by FTL in for several home computer systems.-Plot:The Regulus system is under attack by aliens. A single Terran fighter of the "Light Force" of Galactic Fighter Command must defeat the invaders and rescue their hostages.-Gameplay:The game is a...

, used extremely careful graphics design to achieve full-color moving graphics, essentially by limiting both the design of the onscreen elements and their paths of motion to 8×8 color resolution boundaries. The moving elements were thus relatively large and rather blocky or squarish, and their movement was constrained, but this was not visually obvious and the sight of moving full-color graphics was hugely impressive to Spectrum owners.

No mainstream developers were able to find a suitable all-round fix for the attribute clash problem, instead preferring to use the monochrome graphics method when fast, clear graphics were needed, and full-color graphics when the situation permitted.

It was possible by paying careful attention to timing to modify the attribute area of RAM at certain specific times as the display was drawn - let the display hardware draw one line of the display, then change the attribute RAM before the next line is drawn to give the effect of different attributes for each individual line. These changes had to be done in software and were time-consuming to program, meaning that this technique was usually limited to special effects. This technique was also very popular in the demoscene.

Screenshots showing the problem and solutions

Most illustrative of the problem were games pre-1987 that ignored attribute clash, such as shown here by the game Knight Tyme
Knight Tyme
Knight Tyme is a computer game released for the ZX Spectrum, Amstrad CPC, Commodore 64 and MSX compatibles in 1986. It was published by Mastertronic as part of their Mastertronic Added Dimension label....

. Note how the central character (the small figure with a knight's helmet just to the right of the green plant) is almost hidden by the attribute clash that has occurred. Knight Tyme was one of the few games that let players select between two modes of attribute clash: one which ignored main character attributes (producing the shown effect), and one which applied main character attributes, turning any graphics surrounding the character white.
One workaround was to simply render the graphics in two colors, otherwise known as monochrome, as shown here with the Spectrum version of Knight Lore
Knight Lore
Knight Lore is a computer game developed and released by Ultimate Play The Game in 1984. The game is the third in the Sabreman series, following on from his adventures in Sabre Wulf and Underwurlde. Unlike the earlier games in the series it used Ultimate's filmation engine to achieve a 3D look...

in 1984.
Many games used full-color backgrounds and "character scrolling" (where the environment was scrolled eight pixels at a time), but monochrome sprites that were effectively transparent, as displayed here in Double Dragon
Double Dragon (arcade game)
is a 1987 beat 'em up developed by Technos Japan and distributed in North America and Europe by Taito Corporation. The game is a spiritual and technological successor to Technos' earlier beat 'em up, Nekketsu Kōha Kunio-kun , but introduced several additions such as two-player cooperative gameplay...

. The sprites in this case were drawn in such a way so they stand out, avoiding dependence on color. Many games used this method with smooth pixel-by-pixel scrolling, but the attribute clash as elements of one character block were "passed" to the next were clearly visible.
A prominent (and less successful) example of the use of full-color graphics was the Spectrum conversion of Altered Beast
Altered Beast
Altered Beast is a 1988 beat 'em up arcade game developed and manufactured by Sega. The game is set in Ancient Greece, and follows a centurion who is resurrected by Zeus to rescue his daughter Athena, and to do so become able to turn into beasts such as the werewolf with usage of power-ups...

. Note that the game suffers from considerable attribute clash.
Programmer Don Priestley
Don Priestley
Don Priestley is a video game programmer who wrote for the ZX81 and ZX Spectrum between 1982 and 1989.-Background:Until 1979, Don Priestley was a teacher. In 1981 both he and his son enrolled in a Pascal course at night school. Although his son dropped out, Don carried on...

 developed a distinctive style for several of his games by using large, cartoon-like sprites which were carefully designed to span whole character blocks without appearing unduly square. A disadvantage of this technique was that the gameplay had to be designed around the graphics, and so it was not useful for ports
Porting
In computer science, porting is the process of adapting software so that an executable program can be created for a computing environment that is different from the one for which it was originally designed...

 from other platforms. Games that used this technique included Popeye, The Trap Door
The Trap Door (game)
thumb|left|240pxThe Trap Door is a computer game published for several 8-bit formats in 1986 by Piranha Games. It was written by Don Priestley and based on the British children's television show of the same name.-Gameplay:...

(shown right), Through the Trapdoor, and Flunky
Flunky (computer game)
Flunky is a computer game programmed by Don Priestley and released in 1987 for the ZX Spectrum, Commodore 64 and Amstrad CPC home computers. It was published by Piranha Games...

. Other developers who used a similar technique included Mike Singleton
Mike Singleton
Mike Singleton is a British author and video game developer who wrote various well-regarded titles for the ZX Spectrum during the 1980s. His titles include The Lords of Midnight, Doomdark's Revenge, Throne of Fire, Dark Sceptre and War In Middle Earth. He also wrote a novel, The Eternal Empire,...

, with Dark Sceptre
Dark Sceptre
Dark Sceptre is a strategy adventure video game by Mike Singleton's design team Maelstrom Games, for Beyond Software. It was published by Firebird Software for the ZX Spectrum in 1987 and for the Amstrad CPC in 1988.-Gameplay:...

, and Gang of Five, with Dan Dare: Pilot of the Future
Dan Dare: Pilot of the Future
Dan Dare: Pilot of the Future is a 1986 computer game by Virgin Interactive for the ZX Spectrum, Amstrad CPC and Commodore 64 home computer systems. It is based on the classic British comic strip Dan Dare...

.
.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK