Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Could somebody explain in simple words how can they achieve the 1024 colors with the CGA? Is this some kind of trickery? The article is too technical and demo-scene targeted for me...

If it is possible why there were no CGA games with so many colors? Thank you!



CGA supports a 16-color 160x100 graphics mode as a hack on the 16-color text mode. A few games used it, but not many. See http://tunneler.org/low-res/

In this mode, if you use a dithering pattern you can generate 256 (16x16) dithered colors.

When connected to a composite monitor, the dithering pattern appears as a solid color, giving you 256 unique solid colors at a resolution of 80x100.

In a composite video signal, different pixel positions produce different colors, so if you shift the dithering pattern over by one pixel, you get an additional 256 colors.

The author was able to find four such dithering patterns, for a total of 1024 (256x4) colors. However, the last two dithering patterns (the last 512 colors) require some low-level hacking scan-line hacking.


They mention a couple issues in the article:

> Naturally, there are downsides: having to mess with the CRTC every couple of scanlines is quite taxing for the poor 4.77MHz 8088, so there's not much you can do with this other than static pictures. The 512-color variant, using only ASCII 0x55 and 0x13, doesn't suffer from this – it's basically "set and forget", requiring no more CPU intervention than any 80-column text mode (the familiar overhead of avoiding snow).

> Then, there's that other problem which plagues 80-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.


I thought I recalled a story about someone doing the scanline palette flip trick on C64 hardware long, long ago.


Might have been to accomplish PAL color blending.

PAL uses the color info from a prior scan line in addition to the color info on the current scan line to establish a given pixel color.

If one is clever about changing pixel colors in a way synchronized with the display, more than 16 colors will be seen.

The C64 only has 16 colors. Fixed colors.

Abusing TV was, and can still be, interesting.

On the older machines, a gain of new colors was a big deal.

In this case, it still is a big deal, given how craptastic the CGA is.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: