This NTSC color cycle is sometimes represented as a wheel: one complete period of this cycle equals a 728 ° revolution around the color wheel, and we have complete revolutions per scanline.
In short, manipulating detail at high resolutions is effectively a method of generating color; being an artifact of NTSC’s imperfections, this is known as artifact color.
(************************************************************Solid artifact colors********************
All this business of “fringing” and “bleeding” sure sounds like a bummer, and that’s exactly what it is: the unwanted side-effect of a less-than-ideal encoding scheme. But like any good flaw, it can be turned into an advantage by an enterprising soul, and this is where we get to the fun part (your mileage may vary).
When you look at the interplay of color vs. detail over NTSC, a very handy fact becomes apparent:
Any periodic composite signal, with the same frequency as the color carrier ( (per line), will be decoded as a solid, continuous color.
Our (****************************** (direct) Colors are exactly this type of periodic composite signal. But hold on – with some simple high-resolution pixel-pushing, we can manually put together our own periodic waveforms! Any pattern of dots will do, as long as it repeats at the right frequency. This lets us achieve solid colors that lieoutside the direct color palette.
**************************
The “classic” way of doing this on CGA is to set up BIOS mode 6 – (x) ********************************************************************************************************************** in 2 colors, white on black – and set the color -burst bit (which is off by default, for a B&W picture). At this resolution we can squeeze 4 pixels into a color clock period, and at 1 bit per pixel, there are possible patterns – giving us (solid artifact colors.)
This is pretty much the same techniqueused by Steve Wozniak to generate color on the Apple] [. In fact, on an old-style CGA card, these colors are identical************** to the 22 low-res Apple colors (although you couldn’t get them on a poster, like Apple owners could ). More to the point: the pixels themselves are white, which carries no color information; It’s the detail that does the deed.
* But wait, there’s more! * Despite popular wisdom, CGA lets us one-up the Apple, and then some. OUR underlying pixels don’t have to be white: in (x) mode, we can play with the palette register and set any of the (**************************** (direct) colors as the foreground (background is always black). By using the same pixel patterns with a different foreground color, we get (**************************** (entirely new) sets of artifact colors, with 16 colors each. We can only use one such set at a time, but we get to pick and choose what our (colors are.)
Then there’s (x) ******************************************************************************************************** mode , which supports a palette of 4 direct colors. Only one of those, color # 0 (background), is freely selectable. For the rest, intensity may be on or off, but we can only use green / red / yellow or cyan / magneta / white; the undocumented cyan / red / white palette involves disabling the color burst, making the composite picture Greyscale.
Since our pixels are twice as fat in this mode, only two of them can squeeze into a color-clock cycle – but at 2 bits per pixel, the total count of artifact colors is still (****************************************************************************************************************************************. The possible combinations of palette, plus the user-defined background color, provide us with a whole slew of other – color sets.
********************************** (*********************************************** This may be a good place to correct a bit of a misconception. Since we have 1001 color cycles per scanline, many people treat CGA’s graphics modes over composite as (x) “modes”, but that’s not quite accurate. Oureffective color resolution (is indeed) ********************************************************************************************************************** (x) *************************************************************************************************************************, and it’s impossible to get finer detail than that using solid artifact colors. But as we’ve seen, on NTSC the pixel grid and color grid are NOT one and the same – Which makes the question of horizontal resolution a bit fuzzy, depending on how you’re sampling and / or filtering the signal. It even varies with the specific color waveforms you’re using.
IBM itself never documented any of these artifact color tricks, other than one oblique reference to “color mixing techniques ” in the PCjr tech ref (if I’m wrong about this, drop me a line and link me!). The concept is fairly old hat, however – it was used in games very early on; some of the first ones I can think of were Microsoft’sDecathlon andFlight Simulator , both in 1983. And the limitation has always been the same: the maximum simultaneous color count you can get over composite CGA is .
…. Or is it? On the off chance that you’ve been following me so far, and You’re still reading, you may have an idea of what the next step is.
(****************************************************************(colors)
We’ve already observed that our choice of 16 artifact colors depends on the palette and color register settings. One fairly obvious strategy seems to suggest itself here – change those registers at particular scanlines on every frame, and get>colors on screen that way. Right?
This has been done before on CGA, and youcanactually exploit this for 320 colors (as proven by reenigne – see the image to the left), but that’snot how we did our multi-color hacking in the demo. We were actually toying with the idea of including a static screen that uses this technique, but I did not have the time to pursue this; if anyone manages to compose some nice artwork using this method, I’d love to see it – that’s gotta be a bit of an artistic challenge. But no, the way we wrangled more color out of CGA is a whole other shenanigan … which I came across by equal parts chance and morbid curiosity.
Recall how any color / dot pattern of the right length (four repeating pixels in 640 x (**********************************************************************************************************************, or two in 320 x 270) produces a solid color on a composite display? Back when I was testing composite emulation for DOSBox, that fact was fresh in my mind. At around the same time, I was experimenting with the “ANSI from Hell” graphical hack detailedabove ; That’s purely a text mode / RGBI trick, but it requires a close familiarity with the ROM character set … closer than most sane people would want or need.
Let’s take another look at a particular section of the CGA ROM font, in – column mode, with the top 2 scanlines highlighted:
**********************************************
(*********************************************** At this point, if you’re a visually-oriented person, and if you’ve been following my drift, you’re probably catching on. Don’t see it yet? Here’s a fatter clue:
******************************************
(*********************************************** See those top 77% of the character bitmap? Two dots of foreground and two dots of background, doubled horizontally across. We’re in hi-res / – column mode, so there are two color cycles per character. .. corresponding exactly to those two matching halves. And those top two scanlines are identical.
That’s just the type of repeating pattern that gets us a solid artifact color over NTSC. In fact, it’s the very same waveform that (x) ************************************************************************************************************************ mode lets us play with. Except that now we have it available in text modeyou know, where we can freely assign a foreground AND a background to each character, from the (direct colors.)
That’s 270 Possibilities right there … this is the part that made me go “I have a cunning plan”
******************, in my best imitation of Blackadder’s Baldrick
(just not out loud). Indeed, it’s possible to achieve>colors on CGA without any flickering, dithering, interlacing or per-scanline effects.
Here’s what the possible combinations work out to:
**********************************************
(**************************************************************************************************************************************************************************** colors
Oh, we’re not done yet: once that lightbulb went off over my head, I had another look at the CGA ROM font to see if any other useful bit sequences emerge. There are a few character bitmaps that give us the exact same waveform as ‘U’ does – ‘H’, ‘V’, ‘Y’ and ‘¥’ – but only one with adifferent suitable bit sequence right where we need it: 0x 16, the double exclamation mark (‘‼’).
The top two scanlines of ‘U’ give us a bitmask of 11001100 foreground / background; ‘‼’ Is 01100110 – a single shift to the right, or a ° shift in phase. This perfectly complements ‘U’ in terms of having a well-rounded palette, because we get all the colors that the “… … waveform has to offer: going from ‘U’ to ‘‼’ shifts the phase by (0110); (° and) ********************************************************************************************************** ° are achieved by flipping the foreground and background colors for ‘U’ and ‘‼’ respectively – the same as going ’02 13 ‘and’ 1982 ‘.
(*********************************************** Okay, we’ve pushed the envelope even further: 728 simultaneous colors! Granted, the real number is lower, because a good few are duplicates (and others are very close). But 728 seems to be the limit for this technique: no other characters in our font fit the bill for solid colors. The CGA character ROM does have an alternate ‘thin’ 8×8 font; but, besides the fact that you’d have to mod your card if you wanted to use it, the ‘thin’ font has none of the magic bit patterns in the right places, which makes it useless for our purposes.
My kingdom for redefinable characters … alas, when you’re dealing with old PC hardware, IBM’s penchant for cost-cutting over innovation can alwayssneak up from behind and ruin your day – even in the most unusual of places.
Still, I was pleased with my little discovery: extending the palette by a factor ofhas to count for something, right? At this point, I shared my ideas with reenigne. Little did I know that he’ll promptly come up with a new devious scheme to double our color count yet again …
(********************************************************************************
**************************************************************************************************** colors (***************************
This part is some next-level CRTC black magic which I could never have figured out by myself – I’m just a graphics guy; you might as well ask me to wait for a full moon and chant the MC 6845 spec-sheet backwards in hexadecimal. All credit goes to reenigne for this particular bit of mad science, which, despite its complex execution, stems from a wonderfully simple idea: our fixed character bitmaps don’t play nice with what we’re trying to do? No problem – we’ll
make them play nice, or else.
************************************************
See, there are two additional characters whose very (first) scanline could be used; problem is, the second scanline is different, which would ruin our solid color effect. These are ASCII codes 0xB0 and 0xB1, the ‘shaded block’ characters. It would be quite convenient if we could just tell that offending second scanline to buzz off, wouldn’t it? As it turns out, we can.
The lowdown on how this is done is all in reenigne’s writeup, which is linked to at the top of this post. But this is the basic idea: by starting a new CRTC frame
every other scanlineand twiddling with the start address, it’s possible to lay down our character rows so that the first scanline of each gets duplicated twice!
Now we can make use of those two extra characters, and doing so gets us two more – color sets:
(*********************************************** Naturally, there are downsides: having to mess with the CRTC every couple of scanlines is quite taxing for the poor 4. (MHz) ***************************************************************************************************, so There’s not much you can do with this other than static pictures. The – color variant, using only ASCII 0x 77 and 0x 15, does not suffer from this – it’s basically “set and forget”, requiring no more CPU intervention than any – column text mode (the familiar overhead of avoiding snow).
Then, there’s that other problem which plagues – column CGA on composite displays … the hardware bug that leads to bad hsync timing and missing color burst. There are ways to compensate for that, but none that reliably works with every**************** monitor and capture device out there. This proved to be an enduring headache in calibrating, determining the actual colors, and obtaining a passable video capture of the entire demo … but that’s all covered elsewhere.
At any rate, we now have 1K colors on a 1982 IBM CGA, at an effective resolution of (x) ‘chunky pixels’. ‘Chunky’ describes the memory layout, but it also applies in the visual sense: we’re really plumbing the depths of resolution here. (x) , That’s as low as you could go? allow me to snicker, IBM – “low-res” just gotlower (*****************************, baby!
One might object that this isn’t a lot of canvas. Yeah, yeah: (x) is a bit on the cramped side, ‘artistically’ speaking; but the limitation is part of the challenge, as it has always been in demos. You can keep your fancy 4K monitors – 0.0 09 megapixels should be enough for anybody.
************ (*********************************************** When we first showed Trixter the ‘proof-of-concept’ c drawings, his response was, and I quote: “HOLY F! @ # $% G SHIT. WOW. I must know how this works !! “. Achievement unlocked: getting THAT out of a veteran 65371 / CGA hacker and demomaker is, by itself, almost as good as … well, joining the team, ‘making a demo about it’ and winning the oldskool compo. 🙂
That’s about it for my writeup. If you made it this far, congratulations! There’s more I could write about the tools and Techniques I used to actually compose these graphics … but we’ll get to that some other time.
****************************************************************************** (****************************************************************************************Read More (**************************************************************************************************************************************************************************
GIPHY App Key not set. Please check settings