diff --git a/melondsds_libretro.info b/melondsds_libretro.info index e374d479..64fdf51c 100644 --- a/melondsds_libretro.info +++ b/melondsds_libretro.info @@ -6,7 +6,7 @@ corename = "melonDS DS" categories = "Emulator" license = "GPLv3" permissions = "" -display_version = "0.6.0" +display_version = "0.6.1" # Hardware Information manufacturer = "Nintendo" diff --git a/src/libretro/pcap.hpp b/src/libretro/pcap.hpp index 80e4f759..6bb6a35a 100644 --- a/src/libretro/pcap.hpp +++ b/src/libretro/pcap.hpp @@ -32,23 +32,7 @@ namespace melonds { constexpr std::array BAD_MAC = {0, 0, 0, 0, 0, 0}; constexpr std::array BROADCAST_MAC = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; - constexpr bool IsAdapterAcceptable(const LAN_PCap::AdapterData& adapter) noexcept { - const SPI_Firmware::MacAddress& mac = *reinterpret_cast(adapter.MAC); - - if (mac == BAD_MAC || mac == BROADCAST_MAC) - return false; - - const pcap_if_t* iface = static_cast(adapter.Internal); - if (iface == nullptr) - return false; - - if (iface->flags & PCAP_IF_LOOPBACK) - // If this is a loopback interface... - return false; - - return true; - } - + bool IsAdapterAcceptable(const LAN_PCap::AdapterData& adapter) noexcept; } #endif #endif //MELONDS_DS_PCAP_HPP diff --git a/src/libretro/platform/lan.cpp b/src/libretro/platform/lan.cpp index 7794da28..709df38a 100644 --- a/src/libretro/platform/lan.cpp +++ b/src/libretro/platform/lan.cpp @@ -53,6 +53,23 @@ namespace Config { } #ifdef HAVE_NETWORKING_DIRECT_MODE +bool melonds::IsAdapterAcceptable(const LAN_PCap::AdapterData& adapter) noexcept { + const SPI_Firmware::MacAddress& mac = *reinterpret_cast(adapter.MAC); + + if (mac == BAD_MAC || mac == BROADCAST_MAC) + return false; + + const pcap_if_t* iface = static_cast(adapter.Internal); + if (iface == nullptr) + return false; + + if (iface->flags & PCAP_IF_LOOPBACK) + // If this is a loopback interface... + return false; + + return true; +} + static const LAN_PCap::AdapterData* SelectNetworkInterface(const LAN_PCap::AdapterData* adapters, int numAdapters) noexcept { using namespace melonds;