kolibrios-gitea/programs/emulator/dgen-sdl-1.33/graph.cpp
turbocat ea1a60faa3 Upload DGEN port source
git-svn-id: svn://kolibrios.org@9837 a494cfbc-eb01-0410-851d-a64ba20cac60
2022-06-15 18:25:17 +00:00

25 lines
463 B
C++

// DGen v1.13+
#include <stdio.h>
#include "md.h"
// This allows you to get the palette, mess around with it
// (e.g. contrast/brightness)
// and then pass it back
int get_md_palette(unsigned char pal[256],unsigned char *cram)
{
int c;
if (pal==NULL) return 1;
for (c=0;c<64;c++)
{
int r,g,b;
b=(cram[c*2+0]&0x0e)<<4;
g=(cram[c*2+1]&0xe0);
r=(cram[c*2+1]&0x0e)<<4;
pal[c*4+0]=r;
pal[c*4+1]=g;
pal[c*4+2]=b;
}
return 0;
}