Vita: Port socket shim
Vicki Pfau vi@endrift.com
Tue, 18 Aug 2020 18:41:51 -0700
2 files changed,
17 insertions(+),
4 deletions(-)
M
include/mgba-util/socket.h
→
include/mgba-util/socket.h
@@ -64,6 +64,10 @@ #endif
#ifdef __SWITCH__ #include <switch.h> #endif +#ifdef PSP2 +#include <psp2/net/net.h> +#include <psp2/sysmodule.h> +#endif static inline void SocketSubsystemInit() { #ifdef _WIN32@@ -78,6 +82,10 @@ #elif defined(__SWITCH__)
socketInitializeDefault(); #elif defined(GEKKO) net_init(); +#elif defined(PSP2) + static uint8_t netMem[1024*1024]; + sceSysmoduleLoadModule(SCE_SYSMODULE_NET); + sceNetInit(&(SceNetInitParam) { netMem, sizeof(netMem) }); #endif }@@ -92,6 +100,9 @@ #elif defined(__SWITCH__)
socketExit(); #elif defined(GEKKO) net_deinit(); +#elif defined(PSP2) + sceNetTerm(); + sceSysmoduleUnloadModule(SCE_SYSMODULE_NET); #endif }@@ -249,6 +260,11 @@ static inline Socket SocketListen(Socket socket, int queueLength) {
#ifdef GEKKO return net_listen(socket, queueLength); #else +#ifdef PSP2 + if (queueLength <= 0) { + queueLength = 1; + } +#endif return listen(socket, queueLength); #endif }
M
src/platform/qt/Window.cpp
→
src/platform/qt/Window.cpp
@@ -1425,12 +1425,9 @@
ConfigOption* mute = m_config->addOption("mute"); mute->addBoolean(tr("Mute"), &m_actions, "av"); mute->connect([this](const QVariant& value) { - if (value.toInt()) { - m_config->setOption("fastForwardMute", true); - } + m_config->setOption("fastForwardMute", static_cast<bool>(value.toInt())); reloadConfig(); }, this); - m_config->updateOption("mute"); m_actions.addMenu(tr("FPS target"),"target", "av"); ConfigOption* fpsTargetOption = m_config->addOption("fpsTarget");