[comp.sys.amiga.hardware] Video hardware hack

peterk@cbmger.UUCP (Peter Kittel GERMANY) (01/22/91)

This was already posted earlier, but in a wrong newsgroup.
Perhaps it finds any response now.


There was a discussion in c.s.a about the DCTV or HAM-E devices.
Incidentally I had similar thoughts at the same time.
Perhaps this is not a really serious project for Commodore,
but usefull for some hardware hacker.

So here comes my idea:
How about 24-bit colors by a truely simple hack?
I'm going to describe a little project here that exists until now
only as an idea, and I myself have no time to put it into reality,
but perhaps someone will feel to do this.

Concept:
Replace or enhance the Video Hybrid chip at the video output of the
Amiga. Make it take two adjacent pixels to gather enough information
bits. The normal Amiga video should run in Hires, 4 bitplanes, but
also lower resolution shouldn't be forbidden, who knows what it's
good for. With the resulting resolution of 320x200 and 256 colors you
are at the same level with simple VGA cards (though the palette is
more limited, see below).

Parts needed:
An Amiga, some bus buffers, some inverters, some latches, a flip-flop,
three 8-bit DACs (should be cheap now with all the VGA cards out).

Before:
Inputs to the Video Hybrid are 12 bits color values (4 for RGB each)
and a sync. Output is analog RGB and monochrome video.

Additional inputs needed:
The dot clock (14 MHz clock for hires, should be available somewhere)
A mode status bit (Well, for first attempt you may put a simple
   toggle switch here. But to make it system consistent, we would
   need a bit output by one of the custom chips and controllable
   by one of the custom chip registers. Only this way you will be
   allowed to drag this screen down, and the Copper can switch this
   mode bit somewhere during the scan. As we can't simply change
   the custom chips and I don't know of any unused bit or pin,
   this is the nastiest caveat, nearly unsolvable. Any ideas?)

The circuitry (only words here):
Let's consider only one color component (say R) and keep in mind to
make the two others identically.
1. The analog output of the Video Hybrid is disconnected, connect
   the 8-bit DAC output instead. (We still need the other outputs
   of the Video Hybrid, mainly the sync signals.)
2. Signal path for normal mode: the four input bits are fed to a
   buffer that connects them to the upper 4 bits of the DAC.
   The lower 4 bits are set to zero by use of another enabled
   buffer with inputs tied to ground. You may use this 4-bit buffer
   once for all three color components. Buffers are output-enabled
   by the mode bit.
3. Signal path for new mode: The 4 input bits are fed to two parallel,
   edge-triggered latches. One is triggered by the dot clock, the
   other by the inverted dot clock. After the latter, a second latch
   is triggered by the opposite signal. Thus you ensure that you get
   stable 8 bits during a 2-pixel period at the output of the latches.
   If you use latches with output enable, you can use them as buffers,
   enabled by the mode bit, and feed them directly to the DAC.
   To achieve a maximum variance of resulting 24-bit color values, it
   might be of advantage to feed the 4 bits of the first pixel to the
   even DAC bits (0,2,4,6) and the 4 bits of the second pixel to the
   odd  DAC bits (1,3,5,7).
   If there arise problems with syncing the dot clock with the beginning
   of the scan line, there must be added some circuitry (flip-flop,
   latch, perhaps an EXOR to invert the dot clock) to solve this.
   Inputs for line start triggering could be generated out of the
   sync signal.
Done.

Software issues:
It seems not very simple to construct an algorithm that makes up a
palette (remember: we are in hires and have only 16 colors!) to fit
best for a given image. No ideas from me until now :-(
As said above, to achieve most variation, you must also consider the
bit mixing of the adjacent pixels.

General:
This was thought as a mode starting from conventional hires mode with
640 pixels wide. But there shouldn't be made a limitation to this mode
only. But then you would have to provide the real pixel clock signal
and not the 14 MHz clock, because in one mode you need 14 MHz (hires),
in lores you need 7 MHz, in superhires 28 MHz.


When talking about such hacks: There is even a more simpler possibility,
needing about the same effort. This one would create a medium value of
every two adjacent pixels, thus increasing the color resolution to
15 bits, needing three 5-bit DACs. This would enhance output of dithered
colors, but again reduce the horizontal resolution. But you can make
this medium-computing such a way that it is performed on every pixel
(and its predecessor) and not on pairs that start on even pixel numbers.

(end of old posting)


By now there are new things available. I mean that CEG chip by Edsun.
It works as a CLUT (color lookup table) plus three 6-bit DACs. Its
mode and the CLUT are selcted via addressable registers. So, what
about the above explained concept, but taking this chip as DAC.
Additionally we would have to provide an I/O interface, obviously
autoconfiguring, to access the registers. (Well, this makes access
by the Copper impossible, I fear.) The chip needs "real" 8 bits as
input, so the above explained kludge may not work, but that should
be explored by someone who is more of an expert than me.
I think this CEG chip will become quite common in the PC world,
so we should have an answer for it on the Amiga. (Or are there
different opinions?)


Have fun, please comment.

-- 
Best regards, Dr. Peter Kittel  // E-Mail to  \\  Only my personal opinions... 
Commodore Frankfurt, Germany  \X/ {uunet|pyramid|rutgers}!cbmvax!cbmger!peterk

kdarling@hobbes.ncsu.edu (Kevin Darling) (01/25/91)

peterk@cbmger.UUCP (Peter Kittel GERMANY) writes:
> How about 24-bit colors by a truely simple hack? [...description]

I think you've almost described the HAM-E.  As I understand it,
it uses the 640x4-bit mode, and combines the nybbles into 320x8-bits.
That gives 256 choices/pixel, and those index into a palette system
which outputs 8-bits each on R/G/B to the D/As.

(They also got fancy, and have a HAM-like mode... but with 18 bits
instead of 12 bits... for 262K colors instead of standard 4K colors.
A coming upgrade will give 640x256colors, but I sure don't know how!)

A special code sequence in the first line(s) of a picture is what
triggers it to read in a palette set and/or use the HAM-E modes.
A full zero line untriggers it (so that the blank lines between
screens allow normal Amiga mode screens to be pulled up or mixed).
That also means normal IFF display programs can be used.  Clever.

> By now there are new things available. I mean that CEG chip by Edsun.
> It works as a CLUT (color lookup table) plus three 6-bit DACs. [...]
> I think this CEG chip will become quite common in the PC world,
> so we should have an answer for it on the Amiga. (Or are there
> different opinions?)

I think CBM could make a video card using more popular components, yes.
For instance, on the MM/1 we used a standard Brooktree 8-bitRGB palette
chip, and so can easily drop in much neater chips (like the anti-aliasing
smart palette chips, or the windowing pal chip, etc).  It's a lot
easier to "catch up" when you can take advantage of PClone research ;-).

This route also requires weening Ami programmers away from non-independent
gfx diddling... and that could be difficult (the Amiga and IBM worlds
are almost in the same boat here).  Still, it'll have to be done sooner or
later (the weening, not the chip changes). - kevin <kdarling@catt.ncsu.edu>