Good luck!
Starfall
Good luck!
Starfall
#include typedef unsigned char byte; void SetGraphMode(); void SetGraphMode(){ void DisplayVram(){ void main(){
#include
#include
#include
#include
byte *vram;
int i;
void DisplayVram();
void spalette(int colour,int red,int green,int blue);
__dpmi_regs regs;
regs.x.ax = 0x13;
__dpmi_int(0x10,®s);
};
dosmemput(vram,64000,0xa0000);
}
SetGraphMode();
vram = (byte*)malloc(64000);
memset(vram,0,64000);
for(i=0;i<10;i++){
spalette(i,int(6.1*i),0,0);
}
for(i=0;i<10;i++){
spalette(i+10,0,int(6.1*i),0);
}
for(i=0;i<10;i++){
spalette(i+20,0,0,int(6.1*i));
}
for(i=0;i<10;i++){
spalette(i+30,int(6.1*i),int(6.1*i),0);
}
for(i=0;i<10;i++){
spalette(i+40,int(6.1*i),0,int(6.1*i));
}
for(i=0;i<10;i++){
spalette(i+50,0,int(6.1*i),int(6.1*i));
}
for(i=0;i<60;i++){
spalette(i+60,int(6.1*i),int(6.1*i),int(6.1*i));
}
for(i = 0;i<80;i++){
vram=i;<BR> }<BR> DisplayVram();<BR> bioskey(0);<BR>}<P>void spalette(int colour,int red,int green,int blue){<BR> __dpmi_regs regs;<BR> regs.x.ax=0x1010;<BR> regs.x.bx=colour;<BR> regs.h.dh=red;<BR> regs.h.ch=green;<BR> regs.h.cl=blue;<BR> __dpmi_int(0x10,®s);<BR>}<P>If ne1 could suggest a good way plz reply
Obviously tradeoffs can be made. For example, ordering your palette so that colors that "nearly match" are close to each other, you can treat them as identical when blending, reducing each CLUT to e.g. 64x64 entries (Entry 0 covers colors 0,1,2 and 3, Entry 1 covers 4,5,6 and 7). Limiting the amount of alpha levels also help. 16 levels or less is enough for some applications. I.e. 64x64x16=64K of CLUT.
Finally, may I suggest that true color IS the only way to get the really "crisp" look.
/Niels