mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 08:43:10 +00:00
Basic networking, bug fixes
Fix CPU count bug, make 3ds compile with networking
This commit is contained in:
parent
417be6e497
commit
7dbaa45172
@ -46,6 +46,9 @@ ifeq ($(GRIFFIN_BUILD), 1)
|
|||||||
OBJ += griffin/griffin.o
|
OBJ += griffin/griffin.o
|
||||||
DEFINES += -DHAVE_GRIFFIN=1 -DHAVE_MENU -DHAVE_RGUI -DHAVE_XMB -DHAVE_MATERIALUI -DHAVE_LIBRETRODB -DHAVE_CC_RESAMPLER
|
DEFINES += -DHAVE_GRIFFIN=1 -DHAVE_MENU -DHAVE_RGUI -DHAVE_XMB -DHAVE_MATERIALUI -DHAVE_LIBRETRODB -DHAVE_CC_RESAMPLER
|
||||||
DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DWANT_ZLIB
|
DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DWANT_ZLIB
|
||||||
|
DEFINES += -DHAVE_NETWORKING -DHAVE_CHEEVOS -DHAVE_SOCKET_LEGACY
|
||||||
|
#-DHAVE_SSL -DMBEDTLS_SSL_DEBUG_ALL
|
||||||
|
#ssl is currently incompatible with griffin due to use of the "static" flag on repeating functions that will conflict when included in one file
|
||||||
else
|
else
|
||||||
HAVE_CC_RESAMPLER = 1
|
HAVE_CC_RESAMPLER = 1
|
||||||
HAVE_MENU_COMMON = 1
|
HAVE_MENU_COMMON = 1
|
||||||
@ -63,6 +66,10 @@ else
|
|||||||
HAVE_XMB = 1
|
HAVE_XMB = 1
|
||||||
HAVE_STATIC_VIDEO_FILTERS = 1
|
HAVE_STATIC_VIDEO_FILTERS = 1
|
||||||
HAVE_STATIC_AUDIO_FILTERS = 1
|
HAVE_STATIC_AUDIO_FILTERS = 1
|
||||||
|
HAVE_NETWORKING = 1
|
||||||
|
HAVE_CHEEVOS = 1
|
||||||
|
HAVE_SOCKET_LEGACY = 1
|
||||||
|
HAVE_SSL = 1
|
||||||
|
|
||||||
include Makefile.common
|
include Makefile.common
|
||||||
BLACKLIST :=
|
BLACKLIST :=
|
||||||
|
@ -264,7 +264,7 @@ static bool menu_show_help = true;
|
|||||||
static bool menu_show_quit_retroarch = true;
|
static bool menu_show_quit_retroarch = true;
|
||||||
static bool menu_show_reboot = true;
|
static bool menu_show_reboot = true;
|
||||||
|
|
||||||
#if defined(HAVE_LAKKA) || defined(VITA)
|
#if defined(HAVE_LAKKA) || defined(VITA) || defined(_3DS)
|
||||||
static bool menu_show_core_updater = false;
|
static bool menu_show_core_updater = false;
|
||||||
#else
|
#else
|
||||||
static bool menu_show_core_updater = true;
|
static bool menu_show_core_updater = true;
|
||||||
|
@ -160,7 +160,7 @@ ACHIEVEMENTS
|
|||||||
/*============================================================
|
/*============================================================
|
||||||
MD5
|
MD5
|
||||||
============================================================ */
|
============================================================ */
|
||||||
#if (defined(HAVE_CHEEVOS) && defined(HAVE_THREADS)) || (defined(HAVE_HTTPSERVER) && defined(HAVE_ZLIB))
|
#if defined(HAVE_CHEEVOS) || (defined(HAVE_HTTPSERVER) && defined(HAVE_ZLIB))
|
||||||
#include "../libretro-common/utils/md5.c"
|
#include "../libretro-common/utils/md5.c"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -82,6 +82,7 @@
|
|||||||
#if defined(_3DS)
|
#if defined(_3DS)
|
||||||
#include <3ds/svc.h>
|
#include <3ds/svc.h>
|
||||||
#include <3ds/os.h>
|
#include <3ds/os.h>
|
||||||
|
#include <3ds/services/cfgu.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* iOS/OSX specific. Lacks clock_gettime(), so implement it. */
|
/* iOS/OSX specific. Lacks clock_gettime(), so implement it. */
|
||||||
@ -474,7 +475,25 @@ unsigned cpu_features_get_core_amount(void)
|
|||||||
#elif defined(VITA)
|
#elif defined(VITA)
|
||||||
return 4;
|
return 4;
|
||||||
#elif defined(_3DS)
|
#elif defined(_3DS)
|
||||||
return 1;
|
u8 device_model = 0xFF;
|
||||||
|
CFGU_GetSystemModel(&device_model);/*(0 = O3DS, 1 = O3DSXL, 2 = N3DS, 3 = 2DS, 4 = N3DSXL, 5 = N2DSXL)*/
|
||||||
|
switch (device_model)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
case 1:
|
||||||
|
case 3:
|
||||||
|
/*Old 3/2DS*/
|
||||||
|
return 2;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
case 5:
|
||||||
|
/*New 3/2DS*/
|
||||||
|
return 4;
|
||||||
|
|
||||||
|
default:
|
||||||
|
/*Unknown Device Or Check Failed*/
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
#elif defined(WIIU)
|
#elif defined(WIIU)
|
||||||
return 3;
|
return 3;
|
||||||
#elif defined(_SC_NPROCESSORS_ONLN)
|
#elif defined(_SC_NPROCESSORS_ONLN)
|
||||||
|
@ -142,6 +142,13 @@ struct hostent *gethostbyname(const char *name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int retro_epoll_fd;
|
int retro_epoll_fd;
|
||||||
|
#elif defined(_3DS)
|
||||||
|
#include <malloc.h>
|
||||||
|
#include <3ds/types.h>
|
||||||
|
#include <3ds/services/soc.h>
|
||||||
|
#define SOC_ALIGN 0x1000
|
||||||
|
#define SOC_BUFFERSIZE 0x100000
|
||||||
|
static u32* _net_compat_net_memory;
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
int inet_aton(const char *cp, struct in_addr *inp)
|
int inet_aton(const char *cp, struct in_addr *inp)
|
||||||
{
|
{
|
||||||
@ -310,6 +317,15 @@ bool network_init(void)
|
|||||||
return false;
|
return false;
|
||||||
#elif defined(WIIU)
|
#elif defined(WIIU)
|
||||||
socket_lib_init();
|
socket_lib_init();
|
||||||
|
#elif defined(_3DS)
|
||||||
|
_net_compat_net_memory = (u32*)memalign(SOC_ALIGN, SOC_BUFFERSIZE);
|
||||||
|
if (_net_compat_net_memory == NULL)
|
||||||
|
return false;
|
||||||
|
//RARCH_LOG("Wifi Buffer at: [0x%08X]\n", (u32)_net_compat_net_memory);
|
||||||
|
Result ret = socInit(_net_compat_net_memory, SOC_BUFFERSIZE);//WIFI init
|
||||||
|
if (ret != 0)
|
||||||
|
return false;
|
||||||
|
//RARCH_LOG("Socket Status: [0x%08X]\n", (uint32_t)ret);
|
||||||
#else
|
#else
|
||||||
signal(SIGPIPE, SIG_IGN); /* Do not like SIGPIPE killing our app. */
|
signal(SIGPIPE, SIG_IGN); /* Do not like SIGPIPE killing our app. */
|
||||||
#endif
|
#endif
|
||||||
@ -342,6 +358,14 @@ void network_deinit(void)
|
|||||||
}
|
}
|
||||||
#elif defined(GEKKO) && !defined(HW_DOL)
|
#elif defined(GEKKO) && !defined(HW_DOL)
|
||||||
net_deinit();
|
net_deinit();
|
||||||
|
#elif defined(_3DS)
|
||||||
|
socExit();
|
||||||
|
|
||||||
|
if(_net_compat_net_memory)
|
||||||
|
{
|
||||||
|
free(_net_compat_net_memory);
|
||||||
|
_net_compat_net_memory = NULL;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,7 +236,7 @@ int socket_connect(int fd, void *data, bool timeout_enable)
|
|||||||
{
|
{
|
||||||
struct addrinfo *addr = (struct addrinfo*)data;
|
struct addrinfo *addr = (struct addrinfo*)data;
|
||||||
|
|
||||||
#if !defined(_WIN32) && !defined(VITA) && !defined(WIIU)
|
#if !defined(_WIN32) && !defined(VITA) && !defined(WIIU) && !defined(_3DS)
|
||||||
if (timeout_enable)
|
if (timeout_enable)
|
||||||
{
|
{
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user