Fix colour emphasis support for NTSC filter & raw palette + nes decoder shader

- this implementation is based on a more accurate colour emphasis from fceux.

- The raw palette + nes decoder shader was kinda incomplete since the implementation was based on
a per-frame basis which means that the emphasis bits were read once and applied to the whole frame. This
means that some games that uses a per pixel or per scanline emphasis would not appear correct. The more
accurate implementation reads emphasis bits from bits 5-7 of PPU[1] and saves this info in a separate frame.

- The same implementation is also used to fix emphasis for the ntsc filter.
This commit is contained in:
negativeExponent
2020-02-25 11:51:41 +08:00
parent 4f599a77f9
commit fa74a364de
7 changed files with 72 additions and 58 deletions

View File

@@ -36,6 +36,7 @@
#include "vsuni.h"
uint8 *XBuf = NULL;
uint8 *XDBuf = NULL;
int show_crosshair = 0;
void FCEU_KillVirtualVideo(void)
@@ -43,6 +44,9 @@ void FCEU_KillVirtualVideo(void)
if (XBuf)
free(XBuf);
XBuf = 0;
if (XDBuf)
free(XDBuf);
XDBuf = 0;
}
int FCEU_InitVirtualVideo(void)
@@ -50,11 +54,14 @@ int FCEU_InitVirtualVideo(void)
/* 256 bytes per scanline, * 240 scanline maximum, +8 for alignment, */
if (!XBuf)
XBuf = (uint8*)(FCEU_malloc(256 * (256 + extrascanlines + 8)));
if (!XDBuf)
XDBuf = (uint8*)(FCEU_malloc(256 * (256 + extrascanlines + 8)));
if (!XBuf)
if (!XBuf || !XDBuf)
return 0;
memset(XBuf, 128, 256 * (256 + extrascanlines));
memset(XBuf, 128, 256 * (256 + extrascanlines + 8));
memset(XDBuf, 128, 256 * (256 + extrascanlines + 8));
return 1;
}