TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: ALL
from: REINIER ZWITSERLOOT
date: 1998-04-25 12:32:00
subject: Re: 256 Color Palette

From: Reinier Zwitserloot 
Subject: Re: 256 Color Palette
 
This is an assembly newsgroup. most pb discussion is at
http://www.powerbasic.com/support/bbs
 
To the original poster: Why don't you 'make' the hues?
 
mov dx, 0x3C8
mov al, 
OUT DX, AL
inc dx
mov al, 
out dx, al
mov al, 
out dx, al
mov al, 
out dx, al
dec dx ;now you are back at 0x3C8, the index port.
 
to set up your hues just divide the numbers by 3 and then multiply by 2
or 1 depending on how much hue you want. You might wanna divide by 4 and
multiply by 1, 2, 3, or 4.. and use all shifts for some speed (and a
shift up plus add for tbe *3) to give four hues.
 
NB: Instead up OUTing the colors you can IN them and you'll recieve the
intensities, from 0-63, of red, then green, then blue.
 
Wiebe Zoon wrote:
>
> Don Schullian heeft geschreven in bericht
> ...
> >Hi,
> Hi,
> >
> >  Has anyone figured out some numerical progression in the layout of the
> 256
> >color palette?
> 256 colors ??? in POWERbasic ????
> are you using VESA modes or are you using a self-made SCREEN 13 ???
>
> >In other words.. If I start with the standard VGA palette and
> >take #32 (true blue) is there some factor I could add to get a lighter 
lue
> >and/or a darker blue?
> if you are using VESA you could use interrupt 10 to change the palette to
> whatever you like.
> 64 shades of blue for instance ;)
> fill an array with the colors you like just like this :
> first color (color 0)
> red              byte
> green            byte
> blue             byte
> empty one        byte
> second color (color 1)
> red              byte
> green            byte
>
> etc.
>
> sub SetPalette (tabel() as byte) public
>   reg %ax,&h4f09             'vesa paletfunctions
>   reg %bx,&0000              'subfunction set palette
>   reg %cx,128                'number (the first 128, bacause you can't 
nter
>                              '256 in a byte to do them all at once. )
>   reg %dx,0                  'first palletindex
>   reg %es,varseg(tabel(0))   let them kow where the colors are
>   reg %di,varptr(tabel(0))
>   call interrupt &h10        'do the job
>
>   reg %ax,&h4f09             'vesa paletfunctions
>   reg %bx,&0000              'subfunction set palette
>   reg %cx,128                'number
>   reg %dx,128                  'first palletindex
>
>   reg %es,varseg(tabel(512))
>   reg %di,varptr(tabel(512))
>   call interrupt &h10
> end sub
>
> >
> >  I'm attempting to create a 3D effect for box frames, etc. and require AT
> *AAAAAAAAHHHHHHHHHHH !!!!!! (good luck :)
>
> >LEAST 3 hues of the same color to do so. 4 or 5 would be better but I'll
> >settle for 3..
> >
> >TIA,
> >
> >
> >
> >        Don Schullian
> >Reply to: d83@ath.forthnet.gr
> > www.basicguru.com/schullian
 
Continued with next message...
 
*** QwkNews (tm) v2.1
 * [TN71] Toast House Import
--- GEcho 1.20/Pro
---------------
* Origin: Toast House Remote (1:100/561)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.