Secret colors Commodore 64

Original author: Aaron Bell
  • Transfer
COMMODORE FORMAT Issue 13, Q&A:

It is not possible to increase the number of colors in the C64 palette, but there are tricky subroutines that create the impression of more colors. Activision's Dragon Breed uses a very fast color switcher to give an intermediate tone, and PD encoders have created a Fli-Pic mechanism that allows you to use more than four colors per character block.


In 1991, I was fourteen years old. You could say that I was obsessed with computers. I was the proud owner of the brown Commodore 64 “breadbox” with an exotic modernization - the Oceanic 5.25 drive: “




In May of that year, I read COMMODORE FORMAT and devoured reviews of C64 games. Once I read the headline that has been in my head for years . Under the picture is colorful robotic dragon was written:
Wait ... you can’t get this color on 64! But this is possible if you change the pale green and blue 50 times per second!

It shocked me to the core.

Thanks to the miracle of the Internet and the passion of some of the great magazine archivists, we can unearth the very page that amazed me a long time ago:



It was quite unusual. If you had any 8-bit computer, you are well acquainted with its color scheme. This simple photo blew my mind. This blue color was simply impossible .

According to the title, if you alternate two different colors quickly enough, a completely new color appears for the eye. How did this new secret color look on your shitty CRT TV in the early 90s? The screenshot was just a hint. Did he shine? Flicker?

Twenty-six years later, I found the answer.

This article is about switching colors.on Commodore 64. Below are some interactive examples . I did not find anything similar, so it is possible that this is the only resource on this topic.

Let's think a little bit why the secret colors were so grandiose.

The palette detected the computer


The palette was important.

A typical 8-bit computer could display only sixteen colors . These colors were hardwired when designing a computer.

This means that the palette defines fixed frames for the computer. She limited the way images looked and felt. This fundamentally distinguished the Commodore 64 from the ZX Spectrum, from the Apple II, from the Amstrad CPC. You could immediately say on which computer this or that screenshot was taken.

It was expected that the design of the hardware palette was extremely important. Artists worked with only sixteen colors and needed carefully selected colors to help them reflect the real world.

It didn’t always work out well. Too bad the screaming palette wired into the Sinclair ZX Spectrumthat generated images like these:



It so happened that Commodore engineers did an excellent job. The figure below shows the palette in the upper left corner. The rest of the image shows the nice gradients possible on C64.


Note: This is not my picture! The original author is unknown, but I found her here .

Note:

  • The palette has more earth tones that correspond to real objects. Compare with the explosion of colors Spectrum.
  • It has many shades of gray . This allows you to display monochrome images, as well as things like metal. In the end, neutral shades of gray can be mixed with other colors by placing them side by side.

Therefore, C64 owners are accustomed to such screens:





Such pixel images look much better on typical fuzzy CRT televisions, due to softer mixing.

After many years of careful study of this palette, it has eaten into my brain. I recognize these colors right away. They resonate with the frequency of nostalgia and make my brain tremble. I even use these colors as my avatar on Github :



Given this, the idea that you can destroy this face and invent new secret colors on C64, that you can make you see something that does not exist, seemed magical.

Color switching


If you quickly change two colors, for example, 50-60 times per second, then you can deceive your vision and see what is not. For a machine with sixteen colors, even one or two additional colors can greatly enrich the scene.

Since we all live in the future, and you read a fully programmable document on a supercomputer, let's try to repeat this effect.

Simple example


Here is a square that changes color from red to blue and back every second.

Translator's note: From here on, switch to the Result tab to run the example.

Click on it so that the colors begin to switch at a speed of 60fps (or, in some cases, at the maximum refresh rate of your browser screen. It would be great to see this on a 144-Hz monitor).

Notice how the third color appeared? This shade of purple is not displayed. Only red and blue squares appear, and your eye sees a color that is not there. I do not deceive you. This is color switching in action.

Press again to slow down and check.

Dragon Breed example


Back in 1991, I was intrigued by the review, but I never had that game. What did Dragon Breed really look like?

First of all, it turns out that unusual color switching is not used in the game at all until you reach the end of STAGE 3, where the boss, a robotic dragon, begins to shine in this strange blue color.

Lyrical digression: We have an interesting opportunity - to launch an original arcade. Since we live in the future, you can play Dragon Breed right now in your browser (press the power button, wait for the download, press 5 to insert a coin, then 1 to start). This is amazing. Unfortunately, to see the dragon that interests us, you have to go to the end of STAGE 3. Good luck.

Surely someone was recording the effect on the longplay -video C64? After a little digging, I found our famous dragon robot boss on Youtube:


But, since the video was recorded at 30fps, two problems pop up:

  1. It looks bad. Sprites flicker annoyingly.
  2. The color switching effect is completely lost.

If you played on an emulator with 50 / 60fps, the effect would be convincing.
Lyrical digression: Note on frames per second. The European version of PAL C64 is being updated at 50 frames per second, while NTSC systems in the USA are being updated at 60 frames per second ( link ). Strange, huh? This means that the effect is a bit more convincing on an American car.

Can we show Dragon Breed effect on a web page? Let's get to STAGE 3 (using cheats, of course) and save the boss in a couple of frames:




Next, with a little JavaScript, we can alternate the images and see the original effect at 60fps. On the phone, you probably need to zoom out a bit first. Once again, press to slow down or activate color switching :

Look at all three images, we have created a completely new color!

Also note the dragon's flickering tail: this is a consequence of the sprite limit in C64. The computer does not support enough sprites to display six tail segments and all enemies at the same time, so only three are displayed and each frame is alternated with a flickering effect.

We did it! We recreated the color switching mechanism from Dragon Breed in the browser. Are you done?

Palette example


Not. You can mix these two colors, and what other combinations are possible? In other words, what is the set of all possible secret colors on this machine?

Let's find out. Put on your glasses! We will bring each unique pair of colors on the Commodore 64 into one beautiful epileptic burst. Again, click to switch modes :

Pretty cool, huh? Looks like a tartan for the McBue clan.

Keep in mind that each shimmering square above is a unique pair of colors. I highlighted the combination that is used in Dragon Breed using the border.

Please note that some combinations have an unpleasant stroboscopic effect. But not all of them! Why it happens? It's all about brightness . Two colors of the same brightness are perfectly combined, while black and white will flicker very much.

Switch to fast mode, find the mixed color you need. Then click to slow down the rotation and see which two colors are mixed to form this shade.

the end


That's the whole story of how I read about the secret colors of C64 in 1991, and then twenty-six years later finally got to them. If you are still interested and your eyes have not leaked out, then the bonus content is next.

Article from 1991
Before the Internet, computer magazines were the only way to find out what was going on in the technology world. It's hard to describe how exciting it was to get the ZZAP release ! 64 or COMMODORE FORMAT and read reviews of all new games, or consider advertising peripheral devices, and then beg them from their parents / Santa.

For maximum nostalgia, here are the full Dragon Breed review pages from COMMODORE FORMAT:


Color Switch Mentions
This is a list of all the 8-bit color switching links I found on the Internet.
COMMODORE FORMAT Issue 5, Dragon Breed Review :
Complementary colors are obtained by switching colors, where pixels are assigned different colors every 1 / 50th of a second, giving the impression of a completely new hue
COMMODORE FORMAT Issue 13, Q&A :
It is not possible to increase the number of colors in the C64 palette, but there are tricky subroutines that create the impression of more colors. Activision's Dragon Breed uses a very fast color switcher to give an intermediate tone, and PD encoders have created a Fli-Pic mechanism that allows you to use more than four colors per character block.
COMMODORE FORMAT, Issue 32, Mayhem in Monsterland Developer Diary :
As with our background graphics, we wanted more than 16 Komodor colors for sprites. However, we could not use the same blending method as for level graphics (See CF28) because we do not have enough sprite colors. Therefore, for sprites, I implemented another blending procedure, which quickly switches between two colors (equal brightness) to create new shades.
C64.com Interview with Dragon Breed Programmer Ashley Rutledge:
I often recall the dragon with this strange shade of blue and blue.
How to change pictures at 60fps
When writing programs for this article, I found it quite difficult to get two images to change at 60fps without visual artifacts.

  • GIF (regular GIF, not GIFV ) is too slow for 60 frames per second.
  • Manipulating backgroundImage works, but hellishly flickers.

To make it work, you need to create a couple of Image objects, set their src attribute and wait for them to fully load (using the event) before starting the animation cycle. Fuh! If necessary, check out the source code for this article or study this code .

OK, now for sure! Thanks for reading. If you liked it, I would like to hear from you comments below.

Also popular now: