New hq2x: Fix ambiguity with abs and credit near.

This commit is contained in:
BearOso 2023-03-14 16:01:35 -05:00
parent 046f348d4e
commit 7d9cc644cf
1 changed files with 3 additions and 2 deletions

View File

@ -29,7 +29,7 @@
/* Modified to 16-bit R5G6B5 for Snes9x */ /* Modified to 16-bit R5G6B5 for Snes9x */
#include <cmath> #include <cstdlib>
#include <cstdint> #include <cstdint>
static uint32_t yuvtable[65536]; static uint32_t yuvtable[65536];
@ -41,13 +41,14 @@ static void init()
return; return;
initialized = true; initialized = true;
// YUV table generation public domain from nall by near
for (unsigned i = 0; i < 65536; i++) for (unsigned i = 0; i < 65536; i++)
{ {
uint8_t R = (i >> 0) & 31; uint8_t R = (i >> 0) & 31;
uint8_t G = (i >> 5) & 31; uint8_t G = (i >> 5) & 31;
uint8_t B = (i >> 11) & 31; uint8_t B = (i >> 11) & 31;
// bgr555->bgr888 // bgr565->bgr888
double r = (R << 3) | (R >> 2); double r = (R << 3) | (R >> 2);
double g = (G << 2) | (G >> 4); double g = (G << 2) | (G >> 4);
double b = (B << 3) | (B >> 2); double b = (B << 3) | (B >> 2);