Index: head/emulators/mame/Makefile =================================================================== --- head/emulators/mame/Makefile +++ head/emulators/mame/Makefile @@ -11,8 +11,8 @@ LICENSE= GPLv2 -ONLY_FOR_ARCHS= amd64 i386 -ONLY_FOR_ARCHS_REASON= not yet ported to any arch other than x86 +ONLY_FOR_ARCHS= amd64 i386 powerpc64 +ONLY_FOR_ARCHS_REASON= not yet ported to any arch other than x86 and powerpc64 LIB_DEPENDS= libFLAC.so:audio/flac \ libexpat.so:textproc/expat2 \ @@ -58,7 +58,7 @@ .include -.if ${ARCH} == amd64 +.if ${ARCH} == amd64 || ${ARCH} == powerpc64 MAKE_ARGS+= PTR64=1 EMULATOR= ${MSUBTARGET}64 .else Index: head/emulators/mame/files/patch-3rdparty_bx_include_bx_inline_endian.inl =================================================================== --- head/emulators/mame/files/patch-3rdparty_bx_include_bx_inline_endian.inl +++ head/emulators/mame/files/patch-3rdparty_bx_include_bx_inline_endian.inl @@ -0,0 +1,29 @@ +--- 3rdparty/bx/include/bx/inline/endian.inl.orig 2019-04-24 05:00:38 UTC ++++ 3rdparty/bx/include/bx/inline/endian.inl +@@ -46,7 +46,7 @@ namespace bx + } + + template +- inline Ty toLittleEndian(const Ty _in) ++ inline Ty toLittleEndian(Ty _in) + { + #if BX_CPU_ENDIAN_BIG + return endianSwap(_in); +@@ -56,7 +56,7 @@ namespace bx + } + + template +- inline Ty toBigEndian(const Ty _in) ++ inline Ty toBigEndian(Ty _in) + { + #if BX_CPU_ENDIAN_LITTLE + return endianSwap(_in); +@@ -66,7 +66,7 @@ namespace bx + } + + template +- inline Ty toHostEndian(const Ty _in, bool _fromLittleEndian) ++ inline Ty toHostEndian(Ty _in, bool _fromLittleEndian) + { + #if BX_CPU_ENDIAN_LITTLE + return _fromLittleEndian ? _in : endianSwap(_in); Index: head/emulators/mame/files/patch-3rdparty_bx_include_bx_inline_readerwriter.inl =================================================================== --- head/emulators/mame/files/patch-3rdparty_bx_include_bx_inline_readerwriter.inl +++ head/emulators/mame/files/patch-3rdparty_bx_include_bx_inline_readerwriter.inl @@ -0,0 +1,76 @@ +--- 3rdparty/bx/include/bx/inline/readerwriter.inl.orig 2019-04-24 05:00:38 UTC ++++ 3rdparty/bx/include/bx/inline/readerwriter.inl +@@ -273,7 +273,7 @@ namespace bx + } + + template +- int32_t read(ReaderI* _reader, Ty& _value, Error* _err) ++ inline int32_t read(ReaderI* _reader, Ty& _value, Error* _err) + { + BX_ERROR_SCOPE(_err); + BX_STATIC_ASSERT(isTriviallyCopyable() ); +@@ -281,7 +281,7 @@ namespace bx + } + + template +- int32_t readHE(ReaderI* _reader, Ty& _value, bool _fromLittleEndian, Error* _err) ++ inline int32_t readHE(ReaderI* _reader, Ty& _value, bool _fromLittleEndian, Error* _err) + { + BX_ERROR_SCOPE(_err); + BX_STATIC_ASSERT(isTriviallyCopyable() ); +@@ -329,7 +329,7 @@ namespace bx + } + + template +- int32_t write(WriterI* _writer, const Ty& _value, Error* _err) ++ inline int32_t write(WriterI* _writer, const Ty& _value, Error* _err) + { + BX_ERROR_SCOPE(_err); + BX_STATIC_ASSERT(isTriviallyCopyable() ); +@@ -337,7 +337,7 @@ namespace bx + } + + template +- int32_t writeLE(WriterI* _writer, const Ty& _value, Error* _err) ++ inline int32_t writeLE(WriterI* _writer, const Ty& _value, Error* _err) + { + BX_ERROR_SCOPE(_err); + BX_STATIC_ASSERT(isTriviallyCopyable() ); +@@ -346,8 +346,14 @@ namespace bx + return result; + } + ++ template<> ++ inline int32_t writeLE(WriterI* _writer, const float& _value, Error* _err) ++ { ++ return writeLE(_writer, floatToBits(_value), _err); ++ } ++ + template +- int32_t writeBE(WriterI* _writer, const Ty& _value, Error* _err) ++ inline int32_t writeBE(WriterI* _writer, const Ty& _value, Error* _err) + { + BX_ERROR_SCOPE(_err); + BX_STATIC_ASSERT(isTriviallyCopyable() ); +@@ -356,6 +362,12 @@ namespace bx + return result; + } + ++ template<> ++ inline int32_t writeBE(WriterI* _writer, const float& _value, Error* _err) ++ { ++ return writeBE(_writer, floatToBits(_value), _err); ++ } ++ + inline int64_t skip(SeekerI* _seeker, int64_t _offset) + { + return _seeker->seek(_offset, Whence::Current); +@@ -392,7 +404,7 @@ namespace bx + } + + template +- int32_t peek(ReaderSeekerI* _reader, Ty& _value, Error* _err) ++ inline int32_t peek(ReaderSeekerI* _reader, Ty& _value, Error* _err) + { + BX_ERROR_SCOPE(_err); + BX_STATIC_ASSERT(isTriviallyCopyable() ); Index: head/emulators/mame/files/patch-3rdparty_bx_include_bx_readerwriter.h =================================================================== --- head/emulators/mame/files/patch-3rdparty_bx_include_bx_readerwriter.h +++ head/emulators/mame/files/patch-3rdparty_bx_include_bx_readerwriter.h @@ -0,0 +1,10 @@ +--- 3rdparty/bx/include/bx/readerwriter.h.orig 2019-04-24 05:00:38 UTC ++++ 3rdparty/bx/include/bx/readerwriter.h +@@ -10,6 +10,7 @@ + #include "endian.h" + #include "error.h" + #include "filepath.h" ++#include "math.h" + #include "string.h" + #include "uint32_t.h" + Index: head/emulators/mame/files/patch-3rdparty_bx_tests_readerwriter__test.cpp =================================================================== --- head/emulators/mame/files/patch-3rdparty_bx_tests_readerwriter__test.cpp +++ head/emulators/mame/files/patch-3rdparty_bx_tests_readerwriter__test.cpp @@ -0,0 +1,34 @@ +--- 3rdparty/bx/tests/readerwriter_test.cpp.orig 2019-07-24 09:54:15 UTC ++++ 3rdparty/bx/tests/readerwriter_test.cpp +@@ -0,0 +1,31 @@ ++/* ++ * Copyright 2010-2019 Branimir Karadzic. All rights reserved. ++ * License: https://github.com/bkaradzic/bx#license-bsd-2-clause ++ */ ++ ++#include "test.h" ++#include ++ ++TEST_CASE("writeLE", "") ++{ ++ bx::SizerWriter writer; ++ ++ bx::Error err; ++ ++ int32_t total = bx::writeLE(&writer, 1.0f, &err); ++ ++ REQUIRE(err.isOk() ); ++ REQUIRE(total == 4); ++} ++ ++TEST_CASE("writeBE", "") ++{ ++ bx::SizerWriter writer; ++ ++ bx::Error err; ++ ++ int32_t total = bx::writeBE(&writer, 1.0f, &err); ++ ++ REQUIRE(err.isOk() ); ++ REQUIRE(total == 4); ++}