From 568450db7a7fd0c1da0ee427dda5505a6c2a6394 Mon Sep 17 00:00:00 2001 From: nia Date: Tue, 13 Nov 2018 17:16:25 +0000 Subject: libretro-fbalpha: Attempt to fix the big endian build --- emulators/libretro-fbalpha/Makefile | 3 +- emulators/libretro-fbalpha/distinfo | 3 +- .../patch-src_burner_libretro_burn__endian.h | 33 ++++++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 emulators/libretro-fbalpha/patches/patch-src_burner_libretro_burn__endian.h diff --git a/emulators/libretro-fbalpha/Makefile b/emulators/libretro-fbalpha/Makefile index a3d4fd9dd8a..8761d13b056 100644 --- a/emulators/libretro-fbalpha/Makefile +++ b/emulators/libretro-fbalpha/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.4 2018/10/31 18:40:41 nia Exp $ +# $NetBSD: Makefile,v 1.5 2018/11/13 17:16:25 nia Exp $ DISTNAME= libretro-fbalpha-0.2.97.43.20181022 +PKGREVISION= 1 CATEGORIES= emulators MASTER_SITES= ${MASTER_SITE_GITHUB:=libretro/} GITHUB_PROJECT= fbalpha2018 diff --git a/emulators/libretro-fbalpha/distinfo b/emulators/libretro-fbalpha/distinfo index c124b4bd3a1..deec6c7579d 100644 --- a/emulators/libretro-fbalpha/distinfo +++ b/emulators/libretro-fbalpha/distinfo @@ -1,7 +1,8 @@ -$NetBSD: distinfo,v 1.3 2018/10/31 18:40:41 nia Exp $ +$NetBSD: distinfo,v 1.4 2018/11/13 17:16:25 nia Exp $ SHA1 (libretro-fbalpha-0.2.97.43.20181022-20daa807957d7fce64371620271b502811318163.tar.gz) = 45025f8fb79afcbb65d3de7d927f5eeed709faaf RMD160 (libretro-fbalpha-0.2.97.43.20181022-20daa807957d7fce64371620271b502811318163.tar.gz) = d42603bb5298965cbcc0565846b893a2fef7685d SHA512 (libretro-fbalpha-0.2.97.43.20181022-20daa807957d7fce64371620271b502811318163.tar.gz) = a5aee22e6e17905ac33bd221efced9844579ec11dfe7ba55755fdd327099f1017ec7d83ff5dbb5390ddfb4fe5661d792ffda204cbe3e14bd8598ae5800f77f4c Size (libretro-fbalpha-0.2.97.43.20181022-20daa807957d7fce64371620271b502811318163.tar.gz) = 10216979 bytes SHA1 (patch-makefile.libretro) = 53580ffc41c22c745d70aa9949c5df2affc783d4 +SHA1 (patch-src_burner_libretro_burn__endian.h) = fbca4fbadbc6a15630719ab6d9494d00a36f226a diff --git a/emulators/libretro-fbalpha/patches/patch-src_burner_libretro_burn__endian.h b/emulators/libretro-fbalpha/patches/patch-src_burner_libretro_burn__endian.h new file mode 100644 index 00000000000..0d919ebe8bc --- /dev/null +++ b/emulators/libretro-fbalpha/patches/patch-src_burner_libretro_burn__endian.h @@ -0,0 +1,33 @@ +$NetBSD: patch-src_burner_libretro_burn__endian.h,v 1.1 2018/11/13 17:16:25 nia Exp $ + +More than games consoles are big endian. + +--- src/burner/libretro/burn_endian.h.orig 2018-11-13 16:00:03.905824261 +0000 ++++ src/burner/libretro/burn_endian.h +@@ -1,7 +1,7 @@ + #ifndef _FBA_ENDIAN_H + #define _FBA_ENDIAN_H + +-#ifndef _XBOX ++#if !defined(_XBOX) && !defined(__NetBSD__) + #define NO_64BIT_BYTESWAP + #endif + +@@ -49,6 +49,17 @@ typedef union { + /* Not sure the asm stuff is working properly, so trying something else for debugging (may be slower) */ + //#define BURN_ENDIAN_SWAP_INT16(x) (((x) >> 8) | (((x) & 0xFF) << 8)) + //#define BURN_ENDIAN_SWAP_INT32(x) (((x) >> 24) | (((x) & 0x00FF0000) >> 8) | (((x) & 0x0000FF00) << 8) | (((x) & 0xFF) << 24)) ++#elif defined(__NetBSD__) ++#include ++#include ++#define BURN_ENDIAN_SWAP_INT8(x) (x^1) ++#define BURN_ENDIAN_SWAP_INT16(x) (bswap16(x)) ++#define BURN_ENDIAN_SWAP_INT32(x) (bswap32(x)) ++#define BURN_ENDIAN_SWAP_INT64(x) (bswap64(x)) ++#else ++#define BURN_ENDIAN_SWAP_INT8(x) (x^1) ++#define BURN_ENDIAN_SWAP_INT16(x) ((((x) << 8) & 0xff00) | (((x) >> 8) & 0x00ff)) ++#define BURN_ENDIAN_SWAP_INT32(x) ((((x) << 24) & 0xff000000) | (((x) << 8) & 0x00ff0000) | (((x) >> 8) & 0x0000ff00) | (((x) >> 24) & 0x000000ff)) + #endif + + #ifdef NO_64BIT_BYTESWAP -- cgit v1.2.3