sonarlint vid_cga_comp.c
This commit is contained in:
@@ -21,13 +21,11 @@
|
|||||||
#ifndef VIDEO_CGA_COMP_H
|
#ifndef VIDEO_CGA_COMP_H
|
||||||
#define VIDEO_CGA_COMP_H
|
#define VIDEO_CGA_COMP_H
|
||||||
|
|
||||||
#define Bit8u uint8_t
|
#define Bitu unsigned int
|
||||||
#define Bit32u uint32_t
|
#define bool uint8_t
|
||||||
#define Bitu unsigned int
|
|
||||||
#define bool uint8_t
|
|
||||||
|
|
||||||
void update_cga16_color(uint8_t cgamode);
|
void update_cga16_color(uint8_t cgamode);
|
||||||
void cga_comp_init(int revision);
|
void cga_comp_init(int revision);
|
||||||
Bit32u *Composite_Process(uint8_t cgamode, Bit8u border, Bit32u blocks /*, bool doublewidth*/, Bit32u *TempLine);
|
Bit32u *Composite_Process(uint8_t cgamode, uint8_t border, uint32_t blocks /*, bool doublewidth*/, uint32_t *TempLine);
|
||||||
|
|
||||||
#endif /*VIDEO_CGA_COMP_H*/
|
#endif /*VIDEO_CGA_COMP_H*/
|
||||||
|
@@ -172,7 +172,7 @@ update_cga16_color(uint8_t cgamode)
|
|||||||
video_sharpness = (int) (sharpness * 256 / 100);
|
video_sharpness = (int) (sharpness * 256 / 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bit8u
|
static uint8_t
|
||||||
byte_clamp(int v)
|
byte_clamp(int v)
|
||||||
{
|
{
|
||||||
v >>= 13;
|
v >>= 13;
|
||||||
@@ -186,21 +186,20 @@ static int temp[SCALER_MAXWIDTH + 10] = { 0 };
|
|||||||
static int atemp[SCALER_MAXWIDTH + 2] = { 0 };
|
static int atemp[SCALER_MAXWIDTH + 2] = { 0 };
|
||||||
static int btemp[SCALER_MAXWIDTH + 2] = { 0 };
|
static int btemp[SCALER_MAXWIDTH + 2] = { 0 };
|
||||||
|
|
||||||
Bit32u *
|
uint32_t *
|
||||||
Composite_Process(uint8_t cgamode, Bit8u border, Bit32u blocks /*, bool doublewidth*/, Bit32u *TempLine)
|
Composite_Process(uint8_t cgamode, uint8_t border, uint32_t blocks /*, bool doublewidth*/, uint32_t *TempLine)
|
||||||
{
|
{
|
||||||
int x;
|
uint32_t x2;
|
||||||
Bit32u x2;
|
|
||||||
|
|
||||||
int w = blocks * 4;
|
int w = blocks * 4;
|
||||||
|
|
||||||
int *o;
|
int *o;
|
||||||
Bit32u *rgbi;
|
const uint32_t *rgbi;
|
||||||
int *b;
|
const int *b;
|
||||||
int *i;
|
int *i;
|
||||||
Bit32u *srgb;
|
uint32_t *srgb;
|
||||||
int *ap;
|
int *ap;
|
||||||
int *bp;
|
int *bp;
|
||||||
|
|
||||||
#define COMPOSITE_CONVERT(I, Q) \
|
#define COMPOSITE_CONVERT(I, Q) \
|
||||||
do { \
|
do { \
|
||||||
@@ -230,15 +229,15 @@ Composite_Process(uint8_t cgamode, Bit8u border, Bit32u blocks /*, bool doublewi
|
|||||||
o = temp;
|
o = temp;
|
||||||
rgbi = TempLine;
|
rgbi = TempLine;
|
||||||
b = &CGA_Composite_Table[border * 68];
|
b = &CGA_Composite_Table[border * 68];
|
||||||
for (x = 0; x < 4; ++x)
|
for (uint8_t x = 0; x < 4; ++x)
|
||||||
OUT(b[(x + 3) & 3]);
|
OUT(b[(x + 3) & 3]);
|
||||||
OUT(CGA_Composite_Table[(border << 6) | ((*rgbi & 0x0f) << 2) | 3]);
|
OUT(CGA_Composite_Table[(border << 6) | ((*rgbi & 0x0f) << 2) | 3]);
|
||||||
for (x = 0; x < w - 1; ++x) {
|
for (int x = 0; x < w - 1; ++x) {
|
||||||
OUT(CGA_Composite_Table[((rgbi[0] & 0x0f) << 6) | ((rgbi[1] & 0x0f) << 2) | (x & 3)]);
|
OUT(CGA_Composite_Table[((rgbi[0] & 0x0f) << 6) | ((rgbi[1] & 0x0f) << 2) | (x & 3)]);
|
||||||
++rgbi;
|
++rgbi;
|
||||||
}
|
}
|
||||||
OUT(CGA_Composite_Table[((*rgbi & 0x0f) << 6) | (border << 2) | 3]);
|
OUT(CGA_Composite_Table[((*rgbi & 0x0f) << 6) | (border << 2) | 3]);
|
||||||
for (x = 0; x < 5; ++x)
|
for (uint8_t x = 0; x < 5; ++x)
|
||||||
OUT(b[x & 3]);
|
OUT(b[x & 3]);
|
||||||
|
|
||||||
if ((cgamode & 4) != 0) {
|
if ((cgamode & 4) != 0) {
|
||||||
@@ -258,7 +257,7 @@ Composite_Process(uint8_t cgamode, Bit8u border, Bit32u blocks /*, bool doublewi
|
|||||||
i = temp + 4;
|
i = temp + 4;
|
||||||
ap = atemp + 1;
|
ap = atemp + 1;
|
||||||
bp = btemp + 1;
|
bp = btemp + 1;
|
||||||
for (x = -1; x < w + 1; ++x) {
|
for (int x = -1; x < w + 1; ++x) {
|
||||||
ap[x] = i[-4] - ((i[-2] - i[0] + i[2]) << 1) + i[4];
|
ap[x] = i[-4] - ((i[-2] - i[0] + i[2]) << 1) + i[4];
|
||||||
bp[x] = (i[-3] - i[-1] + i[1] - i[3]) << 1;
|
bp[x] = (i[-3] - i[-1] + i[1] - i[3]) << 1;
|
||||||
++i;
|
++i;
|
||||||
|
Reference in New Issue
Block a user