Skip to content

Commit

Permalink
Added RetroArch username detection.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinnegatamante committed Oct 13, 2019
1 parent e6e4313 commit 16be481
Show file tree
Hide file tree
Showing 15 changed files with 13 additions and 3,624 deletions.
15 changes: 13 additions & 2 deletions code/libretro/libretro.c
Expand Up @@ -568,7 +568,7 @@ Sys_Init
void Sys_Init(void) {
Cmd_AddCommand("in_restart", Sys_In_Restart_f);
Cvar_Set("arch", OS_STRING " " ARCH_STRING);
Cvar_Set("username", Sys_GetCurrentUser());
Cvar_Set("name", Sys_GetCurrentUser());
}

/*
Expand Down Expand Up @@ -1191,6 +1191,7 @@ void retro_run(void)
Com_Init(commandLine);
NET_Init();
update_variables(false);
Cvar_Set("name", Sys_GetCurrentUser());
first_boot = false;
}

Expand Down Expand Up @@ -1299,7 +1300,17 @@ Sys_GetCurrentUser
*/
char nick[128];
char *Sys_GetCurrentUser(void) {
sprintf(nick, "username");
const char *default_username = NULL;
sprintf(nick, "UnnamedPlayer");

if (environ_cb(RETRO_ENVIRONMENT_GET_USERNAME, &default_username))
{
if (default_username && default_username[0] != '\0')
{
sprintf(nick, default_username);
}
}

return nick;
}

Expand Down
63 changes: 0 additions & 63 deletions code/psp2/con_psp2.c

This file was deleted.

218 changes: 0 additions & 218 deletions code/psp2/dll_psp2.c

This file was deleted.

59 changes: 0 additions & 59 deletions code/psp2/dll_psp2.h

This file was deleted.

Empty file removed code/psp2/endian.h
Empty file.

0 comments on commit 16be481

Please sign in to comment.