From e915f990bb973c6d5ef4f5fd3f836161a1c1af3c Mon Sep 17 00:00:00 2001 From: Sepalani Date: Sat, 3 Feb 2024 11:18:40 +0400 Subject: [PATCH] BBA/HLE: Make network_ref into a class --- Source/Core/Core/HW/EXI/BBA/BuiltIn.h | 18 ++++++++++++++++++ Source/Core/Core/HW/EXI/EXI_DeviceEthernet.h | 3 +-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/HW/EXI/BBA/BuiltIn.h b/Source/Core/Core/HW/EXI/BBA/BuiltIn.h index 981b2e46e2..3edfbd7840 100644 --- a/Source/Core/Core/HW/EXI/BBA/BuiltIn.h +++ b/Source/Core/Core/HW/EXI/BBA/BuiltIn.h @@ -92,3 +92,21 @@ struct StackRef BbaTcpSocket tcp_socket; u64 poke_time; }; + +// Max 10 at same time, I think most gc game had a +// limit of 8 in the GC framework +using StackRefs = std::array; + +class NetworkRef +{ +public: + StackRefs& data() { return m_stacks; } + const StackRefs& data() const { return m_stacks; } + auto begin() { return m_stacks.begin(); } + auto begin() const { return m_stacks.cbegin(); } + auto end() { return m_stacks.end(); } + auto end() const { return m_stacks.cend(); } + +private: + StackRefs m_stacks; +}; diff --git a/Source/Core/Core/HW/EXI/EXI_DeviceEthernet.h b/Source/Core/Core/HW/EXI/EXI_DeviceEthernet.h index 465f050521..4dde4e8a06 100644 --- a/Source/Core/Core/HW/EXI/EXI_DeviceEthernet.h +++ b/Source/Core/Core/HW/EXI/EXI_DeviceEthernet.h @@ -456,8 +456,7 @@ private: sf::TcpListener m_upnp_httpd; #if defined(WIN32) || defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__) - std::array network_ref{}; // max 10 at same time, i think most gc game had a - // limit of 8 in the gc framework + NetworkRef network_ref; std::thread m_read_thread; Common::Flag m_read_enabled; Common::Flag m_read_thread_shutdown;