(Frontend) Add get_rating to frontend context

This commit is contained in:
twinaphex 2014-05-16 22:20:33 +02:00
parent adcbb1ba42
commit fdfa41b1e0
10 changed files with 66 additions and 1 deletions

View File

@ -35,6 +35,7 @@ typedef struct frontend_ctx_driver
int (*process_events)(void *data); int (*process_events)(void *data);
void (*exec)(const char *, bool); void (*exec)(const char *, bool);
void (*shutdown)(bool); void (*shutdown)(bool);
int (*get_rating)(void);
// Human readable string. // Human readable string.
const char *ident; const char *ident;

View File

@ -649,6 +649,13 @@ static void system_shutdown(bool unused)
exit(0); exit(0);
} }
static int frontend_android_get_rating(void)
{
/* TODO/FIXME - look at unique identifier per device and
* determine rating for some */
return -1;
}
const frontend_ctx_driver_t frontend_ctx_android = { const frontend_ctx_driver_t frontend_ctx_android = {
get_environment_settings, /* get_environment_settings */ get_environment_settings, /* get_environment_settings */
system_init, /* init */ system_init, /* init */
@ -658,5 +665,6 @@ const frontend_ctx_driver_t frontend_ctx_android = {
process_events, /* process_events */ process_events, /* process_events */
NULL, /* exec */ NULL, /* exec */
system_shutdown, /* shutdown */ system_shutdown, /* shutdown */
frontend_android_get_rating, /* get_rating */
"android", "android",
}; };

View File

@ -121,6 +121,12 @@ int apple_rarch_load_content(int argc, char* argv[])
return 0; return 0;
} }
static int frontend_apple_get_rating(void)
{
/* TODO/FIXME - look at unique identifier per device and
* determine rating for some */
return -1;
}
const frontend_ctx_driver_t frontend_ctx_apple = { const frontend_ctx_driver_t frontend_ctx_apple = {
NULL, /* environment_get */ NULL, /* environment_get */
NULL, /* init */ NULL, /* init */
@ -130,5 +136,6 @@ const frontend_ctx_driver_t frontend_ctx_apple = {
NULL, /* process_events */ NULL, /* process_events */
NULL, /* exec */ NULL, /* exec */
NULL, /* shutdown */ NULL, /* shutdown */
frontend_apple_get_rating, /* get_rating */
"apple", "apple",
}; };

View File

@ -366,6 +366,15 @@ static void system_exec(const char *path, bool should_load_game)
#endif #endif
} }
static int frontend_gx_get_rating(void)
{
#ifdef HW_RVL
return 8;
#else
return 6;
#endif
}
const frontend_ctx_driver_t frontend_ctx_gx = { const frontend_ctx_driver_t frontend_ctx_gx = {
get_environment_settings, /* get_environment_settings */ get_environment_settings, /* get_environment_settings */
system_init, /* init */ system_init, /* init */
@ -375,6 +384,7 @@ const frontend_ctx_driver_t frontend_ctx_gx = {
NULL, /* process_events */ NULL, /* process_events */
system_exec, /* exec */ system_exec, /* exec */
NULL, /* shutdown */ NULL, /* shutdown */
frontend_gx_get_rating, /* get_rating */
"gx", "gx",
#ifdef IS_SALAMANDER #ifdef IS_SALAMANDER
salamander_init, salamander_init,

View File

@ -21,6 +21,12 @@
#include <stddef.h> #include <stddef.h>
#include <string.h> #include <string.h>
static int frontend_null_get_rating(void)
{
/* TODO/FIXME: Determine rating */
return -1;
}
const frontend_ctx_driver_t frontend_ctx_null = { const frontend_ctx_driver_t frontend_ctx_null = {
NULL, /* environment_get */ NULL, /* environment_get */
NULL, /* init */ NULL, /* init */
@ -30,5 +36,6 @@ const frontend_ctx_driver_t frontend_ctx_null = {
NULL, /* process_events */ NULL, /* process_events */
NULL, /* exec */ NULL, /* exec */
NULL, /* shutdown */ NULL, /* shutdown */
frontend_null_get_rating, /* get_rating */
"null", "null",
}; };

View File

@ -454,6 +454,11 @@ static void system_exec(const char *path, bool should_load_game)
cellSysmoduleUnloadModule(CELL_SYSMODULE_NET); cellSysmoduleUnloadModule(CELL_SYSMODULE_NET);
} }
static int frontend_xdk_get_rating(void)
{
return 10;
}
const frontend_ctx_driver_t frontend_ctx_ps3 = { const frontend_ctx_driver_t frontend_ctx_ps3 = {
get_environment_settings, /* get_environment_settings */ get_environment_settings, /* get_environment_settings */
system_init, /* init */ system_init, /* init */
@ -463,6 +468,7 @@ const frontend_ctx_driver_t frontend_ctx_ps3 = {
NULL, /* process_events */ NULL, /* process_events */
system_exec, /* exec */ system_exec, /* exec */
NULL, /* shutdown */ NULL, /* shutdown */
frontend_ps3_get_rating, /* get_rating */
"ps3", "ps3",
#ifdef IS_SALAMANDER #ifdef IS_SALAMANDER
salamander_init, salamander_init,

View File

@ -122,6 +122,11 @@ static int psp_process_args(int argc, char *argv[], void *args)
return 0; return 0;
} }
static int frontend_psp_get_rating(void)
{
return 4;
}
const frontend_ctx_driver_t frontend_ctx_psp = { const frontend_ctx_driver_t frontend_ctx_psp = {
get_environment_settings, /* get_environment_settings */ get_environment_settings, /* get_environment_settings */
system_init, /* init */ system_init, /* init */
@ -131,6 +136,7 @@ const frontend_ctx_driver_t frontend_ctx_psp = {
NULL, /* process_events */ NULL, /* process_events */
NULL, /* exec */ NULL, /* exec */
NULL, /* shutdown */ NULL, /* shutdown */
frontend_psp_get_rating, /* get_rating */
"psp", "psp",
#ifdef IS_SALAMANDER #ifdef IS_SALAMANDER
NULL, NULL,

View File

@ -50,6 +50,13 @@ static void system_shutdown(void)
bps_shutdown(); bps_shutdown();
} }
static int frontend_qnx_get_rating(void)
{
/* TODO/FIXME - look at unique identifier per device and
* determine rating for some */
return -1;
}
const frontend_ctx_driver_t frontend_ctx_qnx = { const frontend_ctx_driver_t frontend_ctx_qnx = {
get_environment_settings, /* get_environment_settings */ get_environment_settings, /* get_environment_settings */
system_init, /* init */ system_init, /* init */
@ -59,5 +66,6 @@ const frontend_ctx_driver_t frontend_ctx_qnx = {
NULL, /* process_events */ NULL, /* process_events */
NULL, /* exec */ NULL, /* exec */
system_shutdown, /* shutdown */ system_shutdown, /* shutdown */
frontend_qnx_get_rating, /* get_rating */
"qnx", "qnx",
}; };

View File

@ -354,6 +354,17 @@ static void system_exec(const char *path, bool should_load_game)
#endif #endif
} }
static int frontend_xdk_get_rating(void)
{
#if defined(_XBOX360)
return 11;
#elif defined(_XBOX1)
return 7;
#else
return -1;
#endif
}
const frontend_ctx_driver_t frontend_ctx_xdk = { const frontend_ctx_driver_t frontend_ctx_xdk = {
get_environment_settings, /* get_environment_settings */ get_environment_settings, /* get_environment_settings */
system_init, /* init */ system_init, /* init */
@ -363,6 +374,7 @@ const frontend_ctx_driver_t frontend_ctx_xdk = {
NULL, /* process_events */ NULL, /* process_events */
system_exec, /* exec */ system_exec, /* exec */
NULL, /* shutdown */ NULL, /* shutdown */
frontend_xdk_get_rating, /* get_rating */
"xdk", "xdk",
#ifdef IS_SALAMANDER #ifdef IS_SALAMANDER
salamander_init, salamander_init,

View File

@ -392,7 +392,7 @@ enum retro_mod
// //
// This function can be called on a per-game basis, // This function can be called on a per-game basis,
// as certain games an implementation can play might be // as certain games an implementation can play might be
// particularily demanding. // particularly demanding.
// If called, it should be called in retro_load_game(). // If called, it should be called in retro_load_game().
// //
#define RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY 9 #define RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY 9