summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Wilbert Pol <wilbertpol@users.noreply.github.com>2014-10-31 20:36:13 +0100
committer Wilbert Pol <wilbertpol@users.noreply.github.com>2014-10-31 20:36:13 +0100
commit155a056aec49c7c111f1a6506de74de3e631750c (patch)
tree4ef37d40bdf3b71e5aafcda89c4a5ad57b8fcf2f
parent49882329bf8c00da2e92644d24faa87a7bc268ed (diff)
tia.c: Prevent Nans. (nw)
-rw-r--r--src/mame/video/tia.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mame/video/tia.c b/src/mame/video/tia.c
index c0698dc4568..384a3773ddc 100644
--- a/src/mame/video/tia.c
+++ b/src/mame/video/tia.c
@@ -269,14 +269,14 @@ Phase Shift 26.2
double G = Y - 0.272 * I - 0.647 * Q;
double B = Y - 1.106 * I + 1.703 * Q;
- R = pow(R, 0.9) / pow(1, 0.9);
- G = pow(G, 0.9) / pow(1, 0.9);
- B = pow(B, 0.9) / pow(1, 0.9);
-
if (R < 0) R = 0;
if (G < 0) G = 0;
if (B < 0) B = 0;
+ R = pow(R, 0.9);
+ G = pow(G, 0.9);
+ B = pow(B, 0.9);
+
if (R > 1) R = 1;
if (G > 1) G = 1;
if (B > 1) B = 1;
@@ -328,14 +328,14 @@ PALETTE_INIT_MEMBER(tia_pal_video_device, tia_pal)
double G = Y - 0.344 * U - 0.714 * V;
double B = Y + 1.770 * U;
- R = pow(R, 1.2) / pow(1, 1.2);
- G = pow(G, 1.2) / pow(1, 1.2);
- B = pow(B, 1.2) / pow(1, 1.2);
-
if (R < 0) R = 0;
if (G < 0) G = 0;
if (B < 0) B = 0;
+ R = pow(R, 1.2);
+ G = pow(G, 1.2);
+ B = pow(B, 1.2);
+
if (R > 1) R = 1;
if (G > 1) G = 1;
if (B > 1) B = 1;