mirror of
https://github.com/libretro/RetroArch
synced 2025-03-24 13:43:32 +00:00
(Frontend) Add get_rating to frontend context
This commit is contained in:
parent
adcbb1ba42
commit
fdfa41b1e0
@ -35,6 +35,7 @@ typedef struct frontend_ctx_driver
|
||||
int (*process_events)(void *data);
|
||||
void (*exec)(const char *, bool);
|
||||
void (*shutdown)(bool);
|
||||
int (*get_rating)(void);
|
||||
|
||||
// Human readable string.
|
||||
const char *ident;
|
||||
|
@ -649,6 +649,13 @@ static void system_shutdown(bool unused)
|
||||
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 = {
|
||||
get_environment_settings, /* get_environment_settings */
|
||||
system_init, /* init */
|
||||
@ -658,5 +665,6 @@ const frontend_ctx_driver_t frontend_ctx_android = {
|
||||
process_events, /* process_events */
|
||||
NULL, /* exec */
|
||||
system_shutdown, /* shutdown */
|
||||
frontend_android_get_rating, /* get_rating */
|
||||
"android",
|
||||
};
|
||||
|
@ -121,6 +121,12 @@ int apple_rarch_load_content(int argc, char* argv[])
|
||||
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 = {
|
||||
NULL, /* environment_get */
|
||||
NULL, /* init */
|
||||
@ -130,5 +136,6 @@ const frontend_ctx_driver_t frontend_ctx_apple = {
|
||||
NULL, /* process_events */
|
||||
NULL, /* exec */
|
||||
NULL, /* shutdown */
|
||||
frontend_apple_get_rating, /* get_rating */
|
||||
"apple",
|
||||
};
|
||||
|
@ -366,6 +366,15 @@ static void system_exec(const char *path, bool should_load_game)
|
||||
#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 = {
|
||||
get_environment_settings, /* get_environment_settings */
|
||||
system_init, /* init */
|
||||
@ -375,6 +384,7 @@ const frontend_ctx_driver_t frontend_ctx_gx = {
|
||||
NULL, /* process_events */
|
||||
system_exec, /* exec */
|
||||
NULL, /* shutdown */
|
||||
frontend_gx_get_rating, /* get_rating */
|
||||
"gx",
|
||||
#ifdef IS_SALAMANDER
|
||||
salamander_init,
|
||||
|
@ -21,6 +21,12 @@
|
||||
#include <stddef.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 = {
|
||||
NULL, /* environment_get */
|
||||
NULL, /* init */
|
||||
@ -30,5 +36,6 @@ const frontend_ctx_driver_t frontend_ctx_null = {
|
||||
NULL, /* process_events */
|
||||
NULL, /* exec */
|
||||
NULL, /* shutdown */
|
||||
frontend_null_get_rating, /* get_rating */
|
||||
"null",
|
||||
};
|
||||
|
@ -454,6 +454,11 @@ static void system_exec(const char *path, bool should_load_game)
|
||||
cellSysmoduleUnloadModule(CELL_SYSMODULE_NET);
|
||||
}
|
||||
|
||||
static int frontend_xdk_get_rating(void)
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
|
||||
const frontend_ctx_driver_t frontend_ctx_ps3 = {
|
||||
get_environment_settings, /* get_environment_settings */
|
||||
system_init, /* init */
|
||||
@ -463,6 +468,7 @@ const frontend_ctx_driver_t frontend_ctx_ps3 = {
|
||||
NULL, /* process_events */
|
||||
system_exec, /* exec */
|
||||
NULL, /* shutdown */
|
||||
frontend_ps3_get_rating, /* get_rating */
|
||||
"ps3",
|
||||
#ifdef IS_SALAMANDER
|
||||
salamander_init,
|
||||
|
@ -122,6 +122,11 @@ static int psp_process_args(int argc, char *argv[], void *args)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int frontend_psp_get_rating(void)
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
const frontend_ctx_driver_t frontend_ctx_psp = {
|
||||
get_environment_settings, /* get_environment_settings */
|
||||
system_init, /* init */
|
||||
@ -131,6 +136,7 @@ const frontend_ctx_driver_t frontend_ctx_psp = {
|
||||
NULL, /* process_events */
|
||||
NULL, /* exec */
|
||||
NULL, /* shutdown */
|
||||
frontend_psp_get_rating, /* get_rating */
|
||||
"psp",
|
||||
#ifdef IS_SALAMANDER
|
||||
NULL,
|
||||
|
@ -50,6 +50,13 @@ static void system_shutdown(void)
|
||||
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 = {
|
||||
get_environment_settings, /* get_environment_settings */
|
||||
system_init, /* init */
|
||||
@ -59,5 +66,6 @@ const frontend_ctx_driver_t frontend_ctx_qnx = {
|
||||
NULL, /* process_events */
|
||||
NULL, /* exec */
|
||||
system_shutdown, /* shutdown */
|
||||
frontend_qnx_get_rating, /* get_rating */
|
||||
"qnx",
|
||||
};
|
||||
|
@ -354,6 +354,17 @@ static void system_exec(const char *path, bool should_load_game)
|
||||
#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 = {
|
||||
get_environment_settings, /* get_environment_settings */
|
||||
system_init, /* init */
|
||||
@ -363,6 +374,7 @@ const frontend_ctx_driver_t frontend_ctx_xdk = {
|
||||
NULL, /* process_events */
|
||||
system_exec, /* exec */
|
||||
NULL, /* shutdown */
|
||||
frontend_xdk_get_rating, /* get_rating */
|
||||
"xdk",
|
||||
#ifdef IS_SALAMANDER
|
||||
salamander_init,
|
||||
|
@ -392,7 +392,7 @@ enum retro_mod
|
||||
//
|
||||
// This function can be called on a per-game basis,
|
||||
// as certain games an implementation can play might be
|
||||
// particularily demanding.
|
||||
// particularly demanding.
|
||||
// If called, it should be called in retro_load_game().
|
||||
//
|
||||
#define RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY 9
|
||||
|
Loading…
x
Reference in New Issue
Block a user