Ағылшыншамен салыстырыңыз: абзацты басыңыз — түпнұсқа терезеде ашылады. Абзац астындағы EN түймесі оны мәтін ішінде көрсетеді.
Мазмұны
Кіріспе
Атрибуттар қақтығысы (түстер қақтығысы немесе түс ағуы деп те аталады) – кейбір түсті 8 биттік үй компьютерлерінің графикалық схемасындағы шектеулерден туындаған дисплей артефактісі, ең бастысы ZX Spectrum, онда кез келген 8×8 пикселдік плиткада тек екі түс қолдануға болатын. Бұл эффект MSX бағдарламалық жасақтамасында және кейбір Commodore 64 ойындарында да байқалды. Осы шектеудің көзге түсуін болдырмау үшін жасалған шешімдер сол кезде Spectrum бағдарламашыларының мәдениетінің бір бөлігіне айналды. Бұл мәселе "жартылай графикалық режимдерде" (графикалық мүмкіндіктері бар мәтіндік режимдер) Color Computer және Dragon компьютерлерінде де кездеседі, бірақ оларда атрибутталмаған графика да бар және жақсырақ ажыратымдылыққа ие. Сол дәуірдің бірнеше ойын консольдерінің бейне режимдері де осындай шектеулерге алып келді, бірақ әдетте бір плиткаға екі түстен артық рұқсат етілді: NES (Famicom) тек бір режимге ие болды, ол да "жартылай графикалық" еді және 16×16 "блок" (төрт 8×8 плиткадан тұратын топ) үшін төрт түске, ал экранға 16 түске рұқсат берді. Super NES әр плиткаға 16 түс, ал экранға 256 түс (басқа да жақсартулармен бірге) рұқсат берді, бұл артефактіге назар аударуды өте қиын етті, тіпті байқамайтын болды (жабдықты бағдарламалауға мәжбүр болғандардан басқа).
Attribute clash (also known as colour clash or bleeding) is a display artifact caused by limits in the graphics circuitry of some colour 8 bit home computers, most notably the ZX Spectrum, where it meant that only two colours could be used in any 8×8 tile of pixels. The effect was also noticeable on MSX software and in some Commodore 64 titles. Workarounds to prevent this limit from becoming apparent have since been considered an element of Spectrum programmer culture. This problem also happens with the "semigraphic modes" (text modes with graphics features) of the Color Computer and Dragon, but those computers also have non attributed graphics and with better resolution. Several video game consoles of the era had such video modes that caused such limitations, but usually allowed more than two colours per tile: the NES (Famicom) had only one mode, which was also "semigraphic", and allowed four colours per 16×16 "block" (group of four 8×8 tile) but 16 per screen. The Super NES allowed 16 colours per tile but 256 per screen (among other improvements), and this made the artefact much harder to notice, if at all (except for those who had to program the device).
Себептер
ZX Spectrum-дағы атрибуттар қақтығысы оның ерекше дисплейлік жадының орналасуынан туындады, ол кадр буферінің жадты пайдалануын азайту және графика емес, мәтін көрсетілуін оңтайландыру үшін жасалған. Жадты үнемдеу үшін түстер палитрасын шектеудің орнына, Синклер дизайны пикселдік бит картасы мен түс туралы ақпаратты жадтың бөлек аймақтарында сақтады. Бит картасы жеке пикселдердің күйін (қосулы немесе өшірілген) көрсеткенмен, түс туралы ақпарат (немесе "атрибуттар") 32 бағаннан тұратын 24 қатарлы мәтіндік таңбалар матрицасына сәйкес келді – 8x8 пикселдік таңбалар ұяшығына бір байт. Бұл байт екі 3 биттік мәнді кодтады, олар INK (алдыңғы түс) және PAPER (артқы түс) деп аталады, бұл түс мәндерін анықтау үшін BASIC командаларынан кейін берілген атаулар. Атрибутқа тағы екі екілік мән енгізілген: екі түстің біреуін көрсететін BRIGHT биті (жарық деңгейі) және FLASH биті, ол қосылғанда екі түс белгілі бір интервалмен ауысып тұрады. Бұл схема 15 түрлі түс ұсынды: екі жарық деңгейіндегі қызыл, жасыл және көк түстердің сегіз комбинациясы (қара түс екі жарық деңгейінде де бірдей көрінеді). Осылайша, әрбір 8x8 пикселдік блок 15 қолжетімді түстің тек 2-ін ғана қамтуы мүмкін, олардың екеуі де палитраның жарық немесе жарық емес бөлігінен болуы керек. 8x8 пикселдік аймаққа үшінші түс қосуға тырысылса, бұрынғы түстердің бірі жаңа түспен жазылып шығарылады. ZX Spectrum бит картасы үшін 6144 байт (бір байт сегіз пикселді білдіреді) және түс атрибуттары үшін 768 байт пайдаланды. Бұл графикалық дисплейдің жалпы көлемін 6912 байтқа жеткізеді, бұл Spectrum дәуіріндегі "түсті" мүмкіндіктері бар компьютер үшін салыстырмалы түрде аз көлем. Бұл графикалық архитектура Синклер мен Амстрадтың Spectrum-ды қайта жобалауларында, Amstrad-тың соңғы үлгісі ZX Spectrum +3-ке дейін сақталды, тіпті кейінгі үлгілерде 128 КиБ жедел жад болғанымен, жадты үнемдеу қажеттілігі азайды. Архитектура артқа қарай үйлесімділікті сақтау үшін сақталды. Атрибуттар Commodore 64, MSX және NES сияқты басқа компьютерлер мен консольдерде де қолданылды, бірақ атрибут блоктарының мөлшері мен блокқа түстер саны әртүрлі болды. Дегенмен, аппараттық сприттерді пайдалану арқылы атрибуттар қақтығысының алдын алуға болады. Thomson MO5 және TO7 микрокомпьютерлері, Oric 1, MSX 1 архитектурасы және Texas Instruments TMS9918 бейне дисплейін басқарушыға негізделген басқа жүйелер де ұқсас шектеуге тап болды: көлденең бағыттағы сегіз пикселден тұратын әр топ үшін 16 түстің тек екеуі ғана қолжетімді, бұл Spectrum-дағыдан ұқсас, бірақ аздап әлсіз әсер береді. MSX 1-де Sinclair Spectrum-дағыдай, 8x8 пикселдік аймақ үшін бір түс атрибуты байты емес, сегіз байт болды, әр 8x1 пикселдік топқа бір байттан. Осылайша, Spectrum 8x8 пикселдік шаршы аймақ үшін бір түс жұбымен шектелген болса, MSX 1 тек сегіз іргелес пикселдің "сызығы" үшін бір түс жұбымен ғана шектелді. Сонымен қатар, MSX1 атрибуттар қақтығысына ұшырамаған сприттерді де пайдалана алды (дегенмен MSX 1 сприттерінің де өз шектеулері болды, мысалы, монохромды болуы). Бірақ бұл техникалық артықшылық MSX 1 жүйелеріне жақсырақ суреттер жасауға көбінесе көмектеспеді. MSX 1-дің мәселесі – Spectrum ойындарын MSX 1-ге көшірген көптеген еуропалық бағдарламалық компаниялар MSX 1-дің Spectrum-дан басымдықтарын ескермеді, сондықтан MSX 1 нұсқаларында да атрибуттар қақтығысы болды (мысалы, Jack the Nipper II: In Coconut Capers). Ауыстыруды жеңілдету үшін бағдарламалық жасақтама жасаушылар Spectrum-дың бір атрибуты байт мәнін MSX 1-дің барлық сегіз сәйкес атрибуты байттарына көшірді. Сол себепті бағдарламалық компаниялар MSX 1-дің сприт мүмкіндіктерін де ескермеді, және бейне дисплей мүмкіндіктері басқа жағынан өте ұқсас болғандықтан (256 × 192 ажыратымдылық, 16 түс), екі жүйе де бір ойын үшін дерлік бірдей суреттерді шығарды. Керісінше, жапондық MSX 1 ойындары MSX 1-дің барлық мүмкіндіктерін пайдаланды, нәтижесінде көбінесе жақсырақ көрінетін ойындар шықты.
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 colour palette to conserve memory, Sinclair's design stored pixel bitmap and colour information in separate areas of memory. While the bitmap specified the state of individual pixels (either on or off), the colour information (or "attributes") corresponded to the text character matrix—24 rows of 32 columns—with one byte per 8x8 pixel character cell. This byte encoded two 3 bit values, known as INK (foreground colour) and PAPER (background colour) after the BASIC instructions used to define the colour values. Two other binary values were included in an attribute; a BRIGHT bit indicating one of two brightness levels for the two colours, and a FLASH bit, which, when set, caused the two colours to be swapped at regular intervals. This scheme provided 15 different colours: 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 colours from the 15 available, which must both be from either the BRIGHT or non BRIGHT halves of the palette. Trying to add a third colour in an 8x8 pixel area would overwrite one of the previous colours. The ZX Spectrum used 6144 bytes for the bitmap, with one byte representing eight pixels, and used 768 bytes for the colour attributes. This gives a total of 6912 bytes for the entire graphics display, a relatively small total for a computer of the Spectrum's era with "colour" capabilities. This graphics architecture was retained right through to Sinclair and Amstrad's later redesigns of the Spectrum, up until Amstrad's final model, the ZX Spectrum +3, despite subsequent models having contained 128 KiB of RAM, reducing the need to save memory in this manner. The architecture was retained to prevent loss of backward compatibility. Attributes were used by a variety of other computers and consoles, including the Commodore 64, the MSX and NES, although the size of the attribute blocks and the number of colours per block varied. However, with the use of hardware sprites, attribute clash could be avoided. The Thomson MO5 and TO7 microcomputers, the Oric 1, the MSX 1 architecture, and other systems based on the Texas Instruments TMS9918 video display controller display a very similar constraint: for each group of eight pixels horizontally, only two colours 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 colour attribute byte available for a whole 8x8 pixel area, as was the case with the Sinclair Spectrum, but eight, with one attribute byte for each 8×1 pixel group. Thus, while the Spectrum was limited to one colour pair for a square area of 8x8 pixels, the MSX 1 was only limited to one colour pair for a "line" of eight adjacent pixels. In addition MSX1 could use sprites which were not bound to any attribute clash problems (although MSX 1 sprites did have their own limitations, such as being monochrome). 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 (Jack the Nipper II: In Coconut Capers is one example of this). 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 colours), 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.
Әсерлер
Атрибуттардың қақтығысын болдырмау үшін статикалық графикалық дисплейлерді сақтықпен құру қажет болды. Түс 8х8 пикселдік блоктарда ғана қолданыла алатындықтан, егжей-тегжейлі түсті графика жасау мүмкін емес еді. Мұқият жоспарлау арқылы әсерлі нәтижелерге қол жеткізуге болады, сондай-ақ түстердің өзгеруін дисплейдің жаңарту жиілігімен синхрондауға болады – әдетте теледидар экраны. Дегенмен, анимациялық дисплейлер жасау қиын болды, бұл бейне ойындар ойнауға арналған машина үшін маңызды кемшілік еді. Егер дисплейдің қозғалмалы бөлігі тиген кезде 8х8 блоктан бір пикселдің түсі өзгерсе, бүкіл блоктың түсі ауысатын еді. Сондықтан егжей-тегжейлі қозғалатын графиканың артынан жылдам өзгеріп тұратын түстердің жағымсыз жиектері қуып жететін.
To avoid attribute clash, static graphic displays had to be constructed with care. Finely detailed colour graphics were impossible, as colour could only be applied in 8×8 pixel blocks. Careful design could achieve impressive results, as could synchronising colour 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 recoloured because a moving part of the display touched it, the entire block would change colour. Thus detailed moving graphics caused large ugly fringes of rapidly changing colours to follow them around.
Айналадағы амалдар
Алғашқы бағдарламалық құралдар бұл мәселені елемеді. Кейін стандартты шешім – экран шеттеріндегі әшекей жиектер сияқты статикалық элементтер үшін түс пайдалану болды, мысалы, есептің көрсеткіштері немесе түрлі аспаптардың белгілері, ал барлық анимациялық графика кішкентай орталық монохромды аймақта орналастырылды. Бұл графиканы жылдамдатып, экранның кішкентай бөлігін жаңартуға мүмкіндік берді – кішкентай аймақ және тек пиксельдік ақпаратты өзгерту арқылы түсті аймаққа қол тигізбеу. FTL-дің Light Force бағдарламасы сияқты кейбір Spectrum бағдарламалық құралдары толық түсті жылжымалы графиканы қол жеткізу үшін өте мұқият графикалық дизайнды пайдаланды, негізінен экрандағы элементтердің дизайнын және олардың қозғалыс жолын 8×8 түсті ажыратымдылық шегіне дейін шектеді. Сондықтан қозғалатын элементтер салыстырмалы түрде үлкен, блоктық немесе шаршы тәрізді болып келді, олардың қозғалысы шектелген, бірақ бұл көзбен байқау қиын болды және толық түсті графиканы көру Spectrum пайдаланушыларына үлкен әсер етті. Басты әзірлеушілер атрибуттардың қақтығысу мәселесіне толыққанды шешім таба алмады, олар жылдам және анық графика қажет болғанда монохромды графикалық әдісті, ал жағдайға қарай толық түсті графикалық әдісті пайдалануды жөн көрді. Дисплейдің бір жолын салуға дисплейлік аппараттық құралға мүмкіндік беріп, келесі жол салынбас бұрын RAM атрибутын өзгерту арқылы әр жеке жолға әртүрлі атрибуттарды беру үшін, белгілі бір уақытта RAM атрибутының аймағын өзгертуге мұқият назар аударуға болады. Бұл өзгерістер бағдарламалық құралда жасалуы керек еді және бағдарламалауға көп уақыт кетіп, әдетте бұл әдіс арнайы эффекттермен шектелді. Бұл әдіс демосценада да кең таралған.
Early software simply ignored the problem. Later, the standard workaround was to use colour 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 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 colour area untouched. Some Spectrum software, such as FTL's Light Force, used extremely careful graphics design to achieve full colour moving graphics, essentially by limiting both the design of the onscreen elements and their paths of motion to 8×8 colour 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 colour 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 colour 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.
Проблема және оның шешімдері
1987 жылға дейінгі көптеген ойындар атрибуттар қақтығысын назарға алмады. Кейінірек шыққан ойындардың кейбіреулері, мысалы Knight Tyme және Three Weeks in Paradise, ойыншыларға атрибуттар қақтығысының екі режимін таңдау мүмкіндігін берді: бірі басты кейіпкердің атрибуттарын елемейтін, кейіпкерді фонға сіңіріп, ал керісінше, фондық суреттерге қарағанда кейіпкерлердің түс схемасына басымдық берді. Тағы бір шешім – 1984 жылы Knight Lore ойынының Spectrum нұсқасында жасалғандай, графикті екі түспен көрсету, яғни монохромды ету. Көптеген ойындар толық түсті фон мен «кейіпкерді жылжыту» (орта сегіз пикселге қадаммен жылжытылатын) әдісін қолданды, бірақ Double Dragon сияқты, тиімді түрде мөлдір монохромды спрайттар қолданылды, олар түске тәуелді болмай, көзге түсетіндей етілді. Көптеген ойындар осы әдісті тегіс пикселдік жылжумен қолданды, бірақ бір кейіпкер блогының элементтері келесіге «өткенде» атрибуттар қақтығысы анық көрінетін. Толық түсті графиканы қолданудың айқын (бірақ толық сәтті емес) мысалы – Altered Beast ойынының Spectrum нұсқасы. Ойын айқын атрибуттар қақтығысынан зардап шегеді. Бағдарламашы Дон Пристли өзінің бірнеше ойыны үшін үлкен, мультфильм сияқты спрайттарды пайдаланып ерекше стиль жасады, олар әдепті түрде кейіпкер блогының барлығын қамтып, шаршы болып көрінбеуі үшін жасалған. Бұл техниканың кемшілігі – ойын графикаға сәйкес жасалуы керек болды, сондықтан ол басқа платформаларға порттау үшін қолайлы емес еді. Бұл әдісті қолданған ойындарға Popeye, The Trap Door, Through the Trapdoor және Flunky кірді. Осыған ұқсас әдісті қолданған басқа да әзірлеушілердің арасында Майк Синглтон (Dark Sceptre) және Gang of Five (Dan Dare: Pilot of the Future) бар. 1994 жылы бағдарламашы Игорь Мазница ZX Spectrum 128 негізінде «ZX Poly» көппроцессорлық платформасын жасады; бұл платформа атрибуттар қақтығысынан аулақ болуға мүмкіндік береді және тіпті орындалатын кодты өзгертпей көптеген ескі ойындарды түстеуге болады.
Most games before 1987 ignored attribute clash. Some later games, such as Knight Tyme and Three Weeks in Paradise allowed players to select between two modes of attribute clash: one which ignored main character attributes, blending the character into the background and vice versa, prioritising the characters colour scheme over the background imagery. Another workaround was to simply render the graphics in two colours, otherwise known as monochrome, as done with the Spectrum version of Knight Lore in 1984. Many games used full colour backgrounds and "character scrolling" (where the environment was scrolled eight pixels at a time), but monochrome sprites that were effectively transparent, as in Double Dragon, were drawn in such a way so they stand out, avoiding dependence on colour. 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 colour graphics was the Spectrum conversion of Altered Beast. The game suffers from considerable attribute clash. Programmer Don Priestley 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 from other platforms. Games that used this technique included Popeye, The Trap Door, Through the Trapdoor, and Flunky. Other developers who used a similar technique included Mike Singleton, with Dark Sceptre, and Gang of Five, with Dan Dare: Pilot of the Future. In 1994, programmer Igor Maznitsa developed a multi CPU concept platform "ZX Poly" based on ZX Spectrum 128; the platform allows for avoidance of attribute clash, and can even colourise many old games without changes in executable code.