Applied all mainline commits; Moved all declarations to not be in the middle of code; SVGA linear reads and writes now account for linear base; Fixed a bug with the Compaq ATI 28800.
This commit is contained in:
@@ -70,14 +70,22 @@ FILE *df;
|
||||
void update_cga16_color(cga_t *cga) {
|
||||
int x;
|
||||
Bit32u x2;
|
||||
double i0, i3, mode_saturation, c, i, v, r, g, b, q, a, s, iq_adjust_i, iq_adjust_q;
|
||||
|
||||
static const double ri = 0.9563;
|
||||
static const double rq = 0.6210;
|
||||
static const double gi = -0.2721;
|
||||
static const double gq = -0.6474;
|
||||
static const double bi = -1.1069;
|
||||
static const double bq = 1.7046;
|
||||
|
||||
if (!new_cga) {
|
||||
min_v = chroma_multiplexer[0] + intensity[0];
|
||||
max_v = chroma_multiplexer[255] + intensity[3];
|
||||
}
|
||||
else {
|
||||
double i0 = intensity[0];
|
||||
double i3 = intensity[3];
|
||||
i0 = intensity[0];
|
||||
i3 = intensity[3];
|
||||
min_v = NEW_CGA(chroma_multiplexer[0], i0, i0, i0, i0);
|
||||
max_v = NEW_CGA(chroma_multiplexer[255], i3, i3, i3, i3);
|
||||
}
|
||||
@@ -90,7 +98,7 @@ void update_cga16_color(cga_t *cga) {
|
||||
|
||||
mode_contrast *= contrast * (new_cga ? 1.2 : 1)/100; // new CGA: 120%
|
||||
mode_brightness += (new_cga ? brightness-10 : brightness)*5; // new CGA: -10
|
||||
double mode_saturation = (new_cga ? 4.35 : 2.9)*saturation/100; // new CGA: 150%
|
||||
mode_saturation = (new_cga ? 4.35 : 2.9)*saturation/100; // new CGA: 150%
|
||||
|
||||
for (x = 0; x < 1024; ++x) {
|
||||
int phase = x & 3;
|
||||
@@ -102,38 +110,29 @@ void update_cga16_color(cga_t *cga) {
|
||||
rc = (right & 8) | ((right & 7) != 0 ? 7 : 0);
|
||||
lc = (left & 8) | ((left & 7) != 0 ? 7 : 0);
|
||||
}
|
||||
double c =
|
||||
chroma_multiplexer[((lc & 7) << 5) | ((rc & 7) << 2) | phase];
|
||||
double i = intensity[(left >> 3) | ((right >> 2) & 2)];
|
||||
double v;
|
||||
c = chroma_multiplexer[((lc & 7) << 5) | ((rc & 7) << 2) | phase];
|
||||
i = intensity[(left >> 3) | ((right >> 2) & 2)];
|
||||
if (!new_cga)
|
||||
v = c + i;
|
||||
else {
|
||||
double r = intensity[((left >> 2) & 1) | ((right >> 1) & 2)];
|
||||
double g = intensity[((left >> 1) & 1) | (right & 2)];
|
||||
double b = intensity[(left & 1) | ((right << 1) & 2)];
|
||||
r = intensity[((left >> 2) & 1) | ((right >> 1) & 2)];
|
||||
g = intensity[((left >> 1) & 1) | (right & 2)];
|
||||
b = intensity[(left & 1) | ((right << 1) & 2)];
|
||||
v = NEW_CGA(c, i, r, g, b);
|
||||
}
|
||||
CGA_Composite_Table[x] = (int) (v*mode_contrast + mode_brightness);
|
||||
}
|
||||
|
||||
double i = CGA_Composite_Table[6*68] - CGA_Composite_Table[6*68 + 2];
|
||||
double q = CGA_Composite_Table[6*68 + 1] - CGA_Composite_Table[6*68 + 3];
|
||||
i = CGA_Composite_Table[6*68] - CGA_Composite_Table[6*68 + 2];
|
||||
q = CGA_Composite_Table[6*68 + 1] - CGA_Composite_Table[6*68 + 3];
|
||||
|
||||
double a = tau*(33 + 90 + hue_offset + mode_hue)/360.0;
|
||||
double c = cos(a);
|
||||
double s = sin(a);
|
||||
double r = 256*mode_saturation/sqrt(i*i+q*q);
|
||||
a = tau*(33 + 90 + hue_offset + mode_hue)/360.0;
|
||||
c = cos(a);
|
||||
s = sin(a);
|
||||
r = 256*mode_saturation/sqrt(i*i+q*q);
|
||||
|
||||
double iq_adjust_i = -(i*c + q*s)*r;
|
||||
double iq_adjust_q = (q*c - i*s)*r;
|
||||
|
||||
static const double ri = 0.9563;
|
||||
static const double rq = 0.6210;
|
||||
static const double gi = -0.2721;
|
||||
static const double gq = -0.6474;
|
||||
static const double bi = -1.1069;
|
||||
static const double bq = 1.7046;
|
||||
iq_adjust_i = -(i*c + q*s)*r;
|
||||
iq_adjust_q = (q*c - i*s)*r;
|
||||
|
||||
video_ri = (int) (ri*iq_adjust_i + rq*iq_adjust_q);
|
||||
video_rq = (int) (-ri*iq_adjust_q + rq*iq_adjust_i);
|
||||
@@ -186,6 +185,8 @@ Bit8u * Composite_Process(cga_t *cga, Bit8u border, Bit32u blocks/*, bool double
|
||||
int* o = temp;
|
||||
Bit8u* rgbi = TempLine;
|
||||
int* b = &CGA_Composite_Table[border*68];
|
||||
int *i, *ap, *bp;
|
||||
Bit32u* srgb;
|
||||
for (x = 0; x < 4; ++x)
|
||||
OUT(b[(x+3)&3]);
|
||||
OUT(CGA_Composite_Table[(border<<6) | ((*rgbi)<<2) | 3]);
|
||||
@@ -199,8 +200,8 @@ Bit8u * Composite_Process(cga_t *cga, Bit8u border, Bit32u blocks/*, bool double
|
||||
|
||||
if ((cga->cgamode & 4) != 0) {
|
||||
// Decode
|
||||
int* i = temp + 5;
|
||||
Bit32u* srgb = (Bit32u *)TempLine;
|
||||
i = temp + 5;
|
||||
srgb = (Bit32u *)TempLine;
|
||||
for (x2 = 0; x2 < blocks*4; ++x2) {
|
||||
int c = (i[0]+i[0])<<3;
|
||||
int d = (i[-1]+i[1])<<3;
|
||||
@@ -212,9 +213,9 @@ Bit8u * Composite_Process(cga_t *cga, Bit8u border, Bit32u blocks/*, bool double
|
||||
}
|
||||
else {
|
||||
// Store chroma
|
||||
int* i = temp + 4;
|
||||
int* ap = atemp + 1;
|
||||
int* bp = btemp + 1;
|
||||
i = temp + 4;
|
||||
ap = atemp + 1;
|
||||
bp = btemp + 1;
|
||||
for (x = -1; x < w + 1; ++x) {
|
||||
ap[x] = i[-4]-((i[-2]-i[0]+i[2])<<1)+i[4];
|
||||
bp[x] = (i[-3]-i[-1]+i[1]-i[3])<<1;
|
||||
@@ -225,7 +226,7 @@ Bit8u * Composite_Process(cga_t *cga, Bit8u border, Bit32u blocks/*, bool double
|
||||
i = temp + 5;
|
||||
i[-1] = (i[-1]<<3) - ap[-1];
|
||||
i[0] = (i[0]<<3) - ap[0];
|
||||
Bit32u* srgb = (Bit32u *)TempLine;
|
||||
srgb = (Bit32u *)TempLine;
|
||||
for (x2 = 0; x2 < blocks; ++x2) {
|
||||
int y,a,b,c,d,rr,gg,bb;
|
||||
COMPOSITE_CONVERT(a, b);
|
||||
|
||||
Reference in New Issue
Block a user