From dc9176fa83770a60109d06e89634ba79f4718982 Mon Sep 17 00:00:00 2001 From: Michel-FK Date: Mon, 25 May 2020 08:02:56 +0200 Subject: [PATCH] Made FunKey packages CFLAGS consistent --- .../patches/0001-pixel-alpha-multiply.patch | 23 ------------------- FunKey/package/PCSX-ReARMed/PCSX-ReARMed.mk | 20 ++++++++++++---- FunKey/package/mednafen/Config.in | 18 --------------- FunKey/package/mednafen/mednafen.mk | 19 ++++++++++++--- 4 files changed, 32 insertions(+), 48 deletions(-) delete mode 100644 FunKey/board/funkey/patches/0001-pixel-alpha-multiply.patch diff --git a/FunKey/board/funkey/patches/0001-pixel-alpha-multiply.patch b/FunKey/board/funkey/patches/0001-pixel-alpha-multiply.patch deleted file mode 100644 index 9539276..0000000 --- a/FunKey/board/funkey/patches/0001-pixel-alpha-multiply.patch +++ /dev/null @@ -1,23 +0,0 @@ - SDL_blit_A.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c -index 219cdcc..d8e921e 100644 ---- a/src/video/SDL_blit_A.c -+++ b/src/video/SDL_blit_A.c -@@ -2679,6 +2985,7 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) - int dstskip = info->d_skip; - SDL_PixelFormat *srcfmt = info->src; - SDL_PixelFormat *dstfmt = info->dst; -+ uint8_t alpha_multiply = srcfmt->alpha; - - int srcbpp; - int dstbpp; -@@ -2705,6 +3012,7 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) - unsigned sA; - unsigned dA; - DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA); -+ sA=(sA*alpha_multiply)>>8; - if(sA) { - DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA); - ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB); diff --git a/FunKey/package/PCSX-ReARMed/PCSX-ReARMed.mk b/FunKey/package/PCSX-ReARMed/PCSX-ReARMed.mk index f8eaf5c..986750f 100644 --- a/FunKey/package/PCSX-ReARMed/PCSX-ReARMed.mk +++ b/FunKey/package/PCSX-ReARMed/PCSX-ReARMed.mk @@ -12,17 +12,29 @@ PCSX_REARMED_LICENSE_FILES = COPYING PCSX_REARMED_DEPENDENCIES = sdl sdl_image sdl_mixer sdl_ttf zlib -PCSX_REARMED_CFLAGS = $(TARGET_CFLAGS) -ggdb -O3 -ftree-vectorize -ifeq ($(BR2_PACKAGE_PCSX_REARMED_FAST),y) -PCSX_REARMED_CFLAGS += -ffast-math -funsafe-math-optimizations +PCSX_REARMED_CFLAGS = $(TARGET_CFLAGS) +ifeq ($(BR2_ARM_CPU_ARMV7A),y) +PCSX_REARMED_CFLAGS += -march=armv7-a endif + +ifeq ($(BR2_GCC_TARGET_CPU),"cortex-a7") +PCSX_REARMED_CFLAGS += -mtune=cortex-a7 +endif + +ifeq ($(BR2_GCC_TARGET_FLOAT_ABI),"hard") +PCSX_REARMED_CFLAGS += -mfloat-abi=hard -ffast-math -funsafe-math-optimizations +else ifeq ($(BR2_GCC_TARGET_FLOAT_ABI),"soft") +PCSX_REARMED_CFLAGS += -mfloat-abi=soft -ffast-math -funsafe-math-optimizations +endif + ifeq ($(BR2_ARM_CPU_HAS_NEON),y) -PCSX_REARMED_CFLAGS += -D__ARM_NEON__ -mfpu=neon -mvectorize-with-neon-quad PCSX_REARMED_CONF_OPTS += --enable-neon --gpu=neon +PCSX_REARMED_CFLAGS += -D__ARM_NEON__ -mfpu=neon -mvectorize-with-neon-quad endif PCSX_REARMED_CONF_OPTS += --sound-drivers=sdl +PCSX_REARMED_CFLAGS += -ggdb -O3 define PCSX_REARMED_CONFIGURE_CMDS (cd $(@D); \ diff --git a/FunKey/package/mednafen/Config.in b/FunKey/package/mednafen/Config.in index 74aedaa..6e00ca0 100644 --- a/FunKey/package/mednafen/Config.in +++ b/FunKey/package/mednafen/Config.in @@ -10,21 +10,3 @@ config BR2_PACKAGE_MEDNAFEN The mednafen game engine. https://mednafen.github.io/ - -if BR2_PACKAGE_MEDNAFEN - -config BR2_PACKAGE_MEDNAFEN_FAST - bool "optimise for speed over accuracy" - default y - help - Optimise for fast math functions, at the expense of accuracy. - - Say 'y' if you need speed and can live with inaccuracies in - the results. Say 'n' (the default) if accuracy is of utmost - importance. - - This basically uses gcc's -Ofast optimisation level, which in - turn is basically using gcc's -ffast-math. See the gcc manual - for what this means. - -endif diff --git a/FunKey/package/mednafen/mednafen.mk b/FunKey/package/mednafen/mednafen.mk index 59f83a1..b99cd67 100644 --- a/FunKey/package/mednafen/mednafen.mk +++ b/FunKey/package/mednafen/mednafen.mk @@ -15,15 +15,28 @@ MEDNAFEN_LICENSE_FILES = COPYING MEDNAFEN_DEPENDENCIES = sdl sdl_image sdl_mixer sdl_ttf zlib -MEDNAFEN_CFLAGS = $(TARGET_CFLAGS) -ggdb -O3 -ftree-vectorize -ifeq ($(BR2_PACKAGE_MEDNAFEN_FAST),y) -MEDNAFEN_CFLAGS += -ffast-math -funsafe-math-optimizations +MEDNAFEN_CFLAGS = $(TARGET_CFLAGS) +ifeq ($(BR2_ARM_CPU_ARMV7A),y) +MEDNAFEN_CFLAGS += -march=armv7-a endif + +ifeq ($(BR2_GCC_TARGET_CPU),"cortex-a7") +MEDNAFEN_CFLAGS += -mtune=cortex-a7 +endif + +ifeq ($(BR2_GCC_TARGET_FLOAT_ABI),"hard") +MEDNAFEN_CFLAGS += -mfloat-abi=hard -ffast-math -funsafe-math-optimizations +else ifeq ($(BR2_GCC_TARGET_FLOAT_ABI),"soft") +MEDNAFEN_CFLAGS += -mfloat-abi=soft -ffast-math -funsafe-math-optimizations +endif + ifeq ($(BR2_ARM_CPU_HAS_NEON),y) MEDNAFEN_CFLAGS += -D__ARM_NEON__ -mfpu=neon -mvectorize-with-neon-quad endif +MEDNAFEN_CFLAGS += -ggdb -O3 + MEDNAFEN_CONF_OPTS += CFLAGS="$(MEDNAFEN_CFLAGS)" MEDNAFEN_CONF_OPTS += --prefix=/usr/local --bindir=/usr/games --without-libsndfile