8 bit values in mode 13h?

From: JGCasey (kjcasey_at_hotkey.net.au)
Date: 10/19/03


Date: Sun, 19 Oct 2003 19:59:53 +1000


"Beth" <BethStone21@hotmail.NOSPICEDHAM.com> wrote in message
news:C_wkb.139$427.54@newsfep1-gui.server.ntli.net...
 snip
> ...it's perfectly possible to set any colour
> index to represent any colour from a stupidly large palette (three
> primaries from 0-63 each...64^3 = 262144 colours...note that modern
> video cards actually have 0-255 (8-bit) for each primary and it is
> possible to switch this on to get the same massively large choice of
> colours as 24-bit colour modes - though only 256 of them can be
> on-screen at once - but the VGA was originally only 6 bit, not 8 bit
> and the program you've got here uses the VGA in its 6-bit mode, as it
> originally was)...

How can I turn on the 8-bit values in mode 13h ?

At the moment I use,

;INPUT: bh = red, bl = green, ch = blue, cl = palette#

SetPalette:
        push dx
        mov dx,3C6h ;palette_mask
        mov al,0FFh ;mask to all colors
        out dx,al ;OUT 3C6h,0FFh
        mov dx,3C8h ;write palette
        mov al,cl ;get number
        out dx,al ;OUT 3C8h,number
        mov dx,3C9h ;rgb values port
        mov al,bh ;get red
        out dx,al
        mov al,bl ;get green
        out dx,al
        mov al,ch ;get blue
        out dx,al
        pop dx
        ret

One method I used to display 24 bit images in mode 13h was
to make palette 0-63 the red range, 64 - 127 the green range,
128 to 191 the blue range and 192 to 255 the gray range for
monochrome images.

Then I used 3 pixels one for each color value rgb and it looked kinda
like viewing the image through a fly wire screen. I had intended using
the same trick in the a higher resolution 256 color mode because I
think the result would look much better.

John Casey


Quantcast