diff --git a/dynamic.c b/dynamic.c index 3e1fdbc4b8..3f362e4e4d 100644 --- a/dynamic.c +++ b/dynamic.c @@ -585,6 +585,16 @@ bool rarch_environment_cb(unsigned cmd, void *data) RARCH_LOG("Environ SAVE_DIRECTORY: \"%s\".\n", g_extern.savefile_dir); break; + case RETRO_ENVIRONMENT_GET_USERNAME: + //TODO/FIXME - username should be decoupled from HAVE_NETPLAY +#ifdef HAVE_NETPLAY + *(const char**)data = *g_extern.netplay_nick ? g_extern.netplay_nick : NULL; + RARCH_LOG("Environ GET_USERNAME: \"%s\".\n", g_extern.netplay_nick); +#else + *(const char**)data = NULL; +#endif + break; + case RETRO_ENVIRONMENT_SET_PIXEL_FORMAT: { enum retro_pixel_format pix_fmt = *(const enum retro_pixel_format*)data; diff --git a/libretro.h b/libretro.h index 15c92e98b5..0663afdf89 100755 --- a/libretro.h +++ b/libretro.h @@ -660,8 +660,14 @@ enum retro_mod // // A frontend must guarantee that this environment call completes in constant time. - - +#define RETRO_ENVIRONMENT_GET_USERNAME 38 + // const char ** + // Returns the specified username of the frontend, if specified. + // This username can be used as a nickname for a core that has online facilities or any other mode where personalization // of the user is desirable. + // The returned value can be NULL. + // If this environ callback is used by a core that requires a valid username, a default username should be specified + // by the core. + // #define RETRO_MEMDESC_CONST (1 << 0) // The frontend will never change this memory area once retro_load_game has returned. #define RETRO_MEMDESC_BIGENDIAN (1 << 1) // The memory area contains big endian data. Default is little endian.