mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-15 14:59:37 +00:00
:3
This commit is contained in:
parent
5eccffced3
commit
fd86688cc4
15
hqflt/ntsc.c
15
hqflt/ntsc.c
@ -1,16 +1,19 @@
|
||||
#include "ntsc.h"
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
void ntsc_filter(uint16_t * restrict out, const uint16_t * restrict in, int width, int height)
|
||||
{
|
||||
static snes_ntsc_t *ntsc = NULL;
|
||||
static int phase = 0;
|
||||
if (ntsc == NULL)
|
||||
static snes_ntsc_t ntsc;
|
||||
static bool inited = false;
|
||||
|
||||
if (inited == false)
|
||||
{
|
||||
ntsc = calloc(1, sizeof(snes_ntsc_t));
|
||||
snes_ntsc_init(ntsc, &snes_ntsc_composite);
|
||||
snes_ntsc_init(&ntsc, &snes_ntsc_composite);
|
||||
inited = true;
|
||||
}
|
||||
|
||||
snes_ntsc_blit(ntsc, in, width, phase, width, height, out, SNES_NTSC_OUT_WIDTH(width) * sizeof(uint16_t));
|
||||
phase = (phase + 1) % 4;
|
||||
snes_ntsc_blit(&ntsc, in, width, phase, width, height, out, SNES_NTSC_OUT_WIDTH(width) * sizeof(uint16_t));
|
||||
phase ^= 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user