Автор: Elliot Gingold
Год: 1984
Издатели: Your Computer
Языки:
Немецкий
Формат:
TZX лента
Требования:
ZX Spectrum 16K,
ZX Spectrum 48K
Ссылки:
Страница на ZXArt
Страница на World Of Spectrum
Страница на Spectrum Computing
Скриншоты:
Описание:
Программа "Colour Change" была разработана Эллиотом Гингольдом в 1984 году для ZX Spectrum. Она предлагает уникальную возможность изменять цвета объектов на экране, что часто вызывало восхищение у владельцев Spectrum, завидовавших команде VDU19 компьютера BBC. Эта программа позволяет почти мгновенно изменять цвета чернил или бумаги с помощью простых машинных кодов.
Основная функциональность "Colour Change" основана на манипуляции атрибутным файлом Spectrum, который состоит из 768 байтов, соответствующих позициям на экране. Каждый байт контролирует цвет квадрата 8x8 пикселей, с битами, обозначающими цвета чернил и бумаги. Пользователи могут изменить все синие чернила на красные, проверяя определенные биты и изменяя их соответствующим образом.
Помимо базовых изменений цвета, программа включает рутину для обмена любыми двумя номинированными цветами чернил, что позволяет создавать различные эффекты мигания. Пользователи могут добиться этих эффектов, вызывая определенные рутины и используя команды цикла для управления частотой мигания. Эта функция улучшает визуальную динамику программы.
"Colour Change" изначально была написана для 48K Spectrum, но может быть адаптирована для 16K машины с незначительными изменениями. Для этой цели включена загрузочная программа, обеспечивая гибкость и совместимость. Программа демонстрирует творческий потенциал простых машинных кодов в улучшении графических утилит на ZX Spectrum.
Год: 1984
Издатели: Your Computer
Языки:
Формат:
Требования:
Ссылки:
Скриншоты:
Описание:
Программа "Colour Change" была разработана Эллиотом Гингольдом в 1984 году для ZX Spectrum. Она предлагает уникальную возможность изменять цвета объектов на экране, что часто вызывало восхищение у владельцев Spectrum, завидовавших команде VDU19 компьютера BBC. Эта программа позволяет почти мгновенно изменять цвета чернил или бумаги с помощью простых машинных кодов.
Основная функциональность "Colour Change" основана на манипуляции атрибутным файлом Spectrum, который состоит из 768 байтов, соответствующих позициям на экране. Каждый байт контролирует цвет квадрата 8x8 пикселей, с битами, обозначающими цвета чернил и бумаги. Пользователи могут изменить все синие чернила на красные, проверяя определенные биты и изменяя их соответствующим образом.
Помимо базовых изменений цвета, программа включает рутину для обмена любыми двумя номинированными цветами чернил, что позволяет создавать различные эффекты мигания. Пользователи могут добиться этих эффектов, вызывая определенные рутины и используя команды цикла для управления частотой мигания. Эта функция улучшает визуальную динамику программы.
"Colour Change" изначально была написана для 48K Spectrum, но может быть адаптирована для 16K машины с незначительными изменениями. Для этой цели включена загрузочная программа, обеспечивая гибкость и совместимость. Программа демонстрирует творческий потенциал простых машинных кодов в улучшении графических утилит на ZX Spectrum.
Colour change
Elloit [sic] Gingold,
Watford,
Herfordshire.
One feature of computers such as the BBC that is often
admired by Spectrum owners is the ability to change colours
of objects already on the screen. Thus using the BBC
command VDU19 one is able to, say, change all the blue
objects to red instantaneously. Such a command also allows
one to draw a complicated diagram in an "invisible" colour
and then, by redefinition of the colours, make it suddenly
appear in its full completion.
The Spectrum, of course, has no such feature. It is
possible to do a colour change from Basic by OVER 1 PRINT-
ing an empty string 704 spaces long but this is rather slow
and produces a display with a single colour ink or paper.
But the organisation of the Spectrum attribute file makes
almost instantaneous ink or paper changes of specific types
easy to achieve with simple machine-code routines.
The attribute file consists of 768 bytes corresponding to
the positions on the screen. Each byte controls the colour
of the 8 by 8 pixel square as follows:
Bit 7 6 5 4 3 2 1 0
------- -------
Paper Ink
Thus bits 0 to 2 hold a number from 0 to 7 corresponding to
the set ink colour with a similar situation for bits 3 to 5
and paper colour. To change all blue ink to red all that is
needed is to move through the 768 bytes, check bits 0-2 for
the presence of the code 1, and if this is found change it
to 2. A similar look at bits 3-5 will effect selective
paper changes.
The program actually consists of three short routines
that act in this way. In addition to ink and paper changing
I have included a routine that will swap any two nominated
ink colours. This final routine is useful in producing a
variety of flashing effects.
The main points to note are that the colour to be re-
placed is poked into location 65000 and the new colour is
poked into 65001. If you wish to change ink colour call
USR 65002, or if it is the paper you want to alter call
USR 65031. The Ink Swap routine is obtained from USR 65078.
To achieve a flashing effect, it is called from within a
loop, the length of any PAUSE command determining the flash
rate. Try having one of the two colours the same as the
paper; this produces a rather more sedate effect than that
in the demonstration program.
The program was written on a 48K Spectrum but, with a few
changes, the routines can be relocated anywhere. I have
included a loader program for a 16K machine, in this case
the machine code goes in at 32000. The details of use are
the same except all relevant locations start with 32 rather
than 65, e.g. 65031 becomes 32031. Do not forget to CLEAR
64999 - or 31999 - before loading the code in future appli-
cations.
Elloit [sic] Gingold,
Watford,
Herfordshire.
One feature of computers such as the BBC that is often
admired by Spectrum owners is the ability to change colours
of objects already on the screen. Thus using the BBC
command VDU19 one is able to, say, change all the blue
objects to red instantaneously. Such a command also allows
one to draw a complicated diagram in an "invisible" colour
and then, by redefinition of the colours, make it suddenly
appear in its full completion.
The Spectrum, of course, has no such feature. It is
possible to do a colour change from Basic by OVER 1 PRINT-
ing an empty string 704 spaces long but this is rather slow
and produces a display with a single colour ink or paper.
But the organisation of the Spectrum attribute file makes
almost instantaneous ink or paper changes of specific types
easy to achieve with simple machine-code routines.
The attribute file consists of 768 bytes corresponding to
the positions on the screen. Each byte controls the colour
of the 8 by 8 pixel square as follows:
Bit 7 6 5 4 3 2 1 0
------- -------
Paper Ink
Thus bits 0 to 2 hold a number from 0 to 7 corresponding to
the set ink colour with a similar situation for bits 3 to 5
and paper colour. To change all blue ink to red all that is
needed is to move through the 768 bytes, check bits 0-2 for
the presence of the code 1, and if this is found change it
to 2. A similar look at bits 3-5 will effect selective
paper changes.
The program actually consists of three short routines
that act in this way. In addition to ink and paper changing
I have included a routine that will swap any two nominated
ink colours. This final routine is useful in producing a
variety of flashing effects.
The main points to note are that the colour to be re-
placed is poked into location 65000 and the new colour is
poked into 65001. If you wish to change ink colour call
USR 65002, or if it is the paper you want to alter call
USR 65031. The Ink Swap routine is obtained from USR 65078.
To achieve a flashing effect, it is called from within a
loop, the length of any PAUSE command determining the flash
rate. Try having one of the two colours the same as the
paper; this produces a rather more sedate effect than that
in the demonstration program.
The program was written on a 48K Spectrum but, with a few
changes, the routines can be relocated anywhere. I have
included a loader program for a 16K machine, in this case
the machine code goes in at 32000. The details of use are
the same except all relevant locations start with 32 rather
than 65, e.g. 65031 becomes 32031. Do not forget to CLEAR
64999 - or 31999 - before loading the code in future appli-
cations.