From 14a0da7fb39bb3bd08f9c1875cb0affaa291afd6 Mon Sep 17 00:00:00 2001 From: staphen Date: Fri, 4 Jun 2021 12:48:50 -0400 Subject: [PATCH] Enable TCP in 3DS build --- CMake/ctr/n3ds_defs.cmake | 3 ++- CMakeLists.txt | 4 +++- Source/platform/ctr/system.cpp | 10 +++++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CMake/ctr/n3ds_defs.cmake b/CMake/ctr/n3ds_defs.cmake index 4fe187f5e..dd8862de2 100644 --- a/CMake/ctr/n3ds_defs.cmake +++ b/CMake/ctr/n3ds_defs.cmake @@ -1,5 +1,6 @@ #General compilation options -set(NONET ON) +set(DEVILUTIONX_SYSTEM_LIBSODIUM OFF) +set(DISABLE_ZERO_TIER ON) set(USE_SDL1 ON) set(PREFILL_PLAYER_NAME ON) diff --git a/CMakeLists.txt b/CMakeLists.txt index df9b44362..7bc8adfc1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -484,7 +484,9 @@ if(NINTENDO_3DS) Source/platform/ctr/system.cpp Source/platform/ctr/keyboard.cpp Source/platform/ctr/display.cpp - Source/platform/ctr/messagebox.cpp) + Source/platform/ctr/messagebox.cpp + Source/platform/ctr/random.cpp + Source/platform/ctr/sockets.cpp) set(BIN_TARGET ${BIN_TARGET}.elf) endif() diff --git a/Source/platform/ctr/system.cpp b/Source/platform/ctr/system.cpp index 853cdb8d2..be7565de9 100644 --- a/Source/platform/ctr/system.cpp +++ b/Source/platform/ctr/system.cpp @@ -2,6 +2,8 @@ #include #include <3ds.h> #include "platform/ctr/system.h" +#include "platform/ctr/random.hpp" +#include "platform/ctr/sockets.hpp" bool isN3DS; @@ -76,4 +78,10 @@ void ctr_sys_init() romfsInit(); atexit([]() { romfsExit(); }); -} \ No newline at end of file + + randombytes_ctrrandom_init(); + atexit([]() { + if (psGetSessionHandle()) + psExit(); + }); +}