Libretro: Add support for libnx (#755)
This commit is contained in:
parent
551b2800cf
commit
5bb0f5c811
4 changed files with 16 additions and 6 deletions
|
@ -1,13 +1,14 @@
|
|||
#include "stdafx.h"
|
||||
#include "DefaultVideoFilter.h"
|
||||
#include "EmulationSettings.h"
|
||||
#define _USE_MATH_DEFINES
|
||||
#include <math.h>
|
||||
#define M_PI 3.14159265358979323846264f
|
||||
#include <algorithm>
|
||||
#include "PPU.h"
|
||||
#include "DebugHud.h"
|
||||
#include "Console.h"
|
||||
|
||||
|
||||
DefaultVideoFilter::DefaultVideoFilter(shared_ptr<Console> console) : BaseVideoFilter(console)
|
||||
{
|
||||
InitConversionMatrix(_pictureSettings.Hue, _pictureSettings.Saturation);
|
||||
|
@ -126,4 +127,4 @@ uint32_t DefaultVideoFilter::ApplyScanlineEffect(uint16_t ppuPixel, uint8_t scan
|
|||
uint8_t b = (pixelOutput & 0xFF) * scanlineIntensity / 255;
|
||||
|
||||
return 0xFF000000 | (r << 16) | (g << 8) | b;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -163,6 +163,15 @@ else ifeq ($(platform), vita)
|
|||
AR = arm-vita-eabi-ar
|
||||
CXXFLAGS += -Wl,-q -Wall -O3
|
||||
STATIC_LINKING = 1
|
||||
# Nintendo Switch (libnx)
|
||||
else ifeq ($(platform), libnx)
|
||||
include $(DEVKITPRO)/libnx/switch_rules
|
||||
TARGET := $(TARGET_NAME)_libretro_$(platform).a
|
||||
DEFINES := -DSWITCH=1 -D__SWITCH__ -D_LARGEFILE_SOURCE -DHAVE_LIBNX -D__aarch64__
|
||||
CFLAGS := $(DEFINES) -fPIE -I$(LIBNX)/include/ -ffunction-sections -fdata-sections -ftls-model=local-exec
|
||||
CFLAGS += -march=armv8-a -mtune=cortex-a57 -mtp=soft -mcpu=cortex-a57+crc+fp+simd -ffast-math
|
||||
CXXFLAGS := $(ASFLAGS) $(CFLAGS)
|
||||
STATIC_LINKING = 1
|
||||
# Windows MSVC 2017 all architectures
|
||||
else ifneq (,$(findstring windows_msvc2017,$(platform)))
|
||||
|
||||
|
|
|
@ -16,12 +16,12 @@ extern const uint32_t Crc32Lookup[MaxSlice][256];
|
|||
#endif
|
||||
|
||||
// define endianess and some integer data types
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__aarch64__)
|
||||
// Windows always little endian
|
||||
#define __BYTE_ORDER __LITTLE_ENDIAN
|
||||
#else
|
||||
// defines __BYTE_ORDER as __LITTLE_ENDIAN or __BIG_ENDIAN
|
||||
#ifdef __APPLE__
|
||||
#if defined(__APPLE__) || defined(HAVE_LIBNX)
|
||||
#include <machine/endian.h>
|
||||
#else
|
||||
#include <endian.h>
|
||||
|
@ -685,4 +685,4 @@ const uint32_t Crc32Lookup[MaxSlice][256] =
|
|||
0x839B5EED,0x2DF3CF7C,0x043B7B8E,0xAA53EA1F,0x57AA126A,0xF9C283FB,0xD00A3709,0x7E62A698,
|
||||
0xF088C1A2,0x5EE05033,0x7728E4C1,0xD9407550,0x24B98D25,0x8AD11CB4,0xA319A846,0x0D7139D7,
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
@ -224,7 +224,7 @@
|
|||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#if defined(__linux__) || defined(__linux) || defined(__EMSCRIPTEN__)
|
||||
#if defined(__linux__) || defined(__linux) || defined(__EMSCRIPTEN__) || defined(HAVE_LIBNX)
|
||||
#include <alloca.h>
|
||||
#endif
|
||||
#else // STB_VORBIS_NO_CRT
|
||||
|
|
Loading…
Add table
Reference in a new issue