From b2387e06bc3562d15d2d41fc608d0bb3d088ed41 Mon Sep 17 00:00:00 2001 From: Themaister Date: Fri, 1 Jun 2012 16:50:38 +0200 Subject: [PATCH] Add RETRO_ENVIRONMENT_SET_PERFORMANCE_LEVEL. --- dynamic.c | 4 ++++ general.h | 1 + libretro.h | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/dynamic.c b/dynamic.c index 2bf7d65f46..c0d2a8d542 100644 --- a/dynamic.c +++ b/dynamic.c @@ -320,6 +320,10 @@ static bool environment_cb(unsigned cmd, void *data) g_extern.system.shutdown = true; break; + case RETRO_ENVIRONMENT_SET_PERFORMANCE_LEVEL: + g_extern.system.performance_level = *(const unsigned*)data; + break; + default: RARCH_LOG("Environ UNSUPPORTED (#%u).\n", cmd); return false; diff --git a/general.h b/general.h index 40c75fe97a..17680d65af 100644 --- a/general.h +++ b/general.h @@ -329,6 +329,7 @@ struct global unsigned rotation; bool shutdown; + unsigned performance_level; } system; struct diff --git a/libretro.h b/libretro.h index 1ce9cbd382..d9309214c9 100755 --- a/libretro.h +++ b/libretro.h @@ -122,6 +122,26 @@ extern "C" { // Should only be used if game has a specific // way to shutdown the game from a menu item or similar. +#define RETRO_ENVIRONMENT_SET_PERFORMANCE_LEVEL 8 + // const unsigned * -- + // Gives a hint to the frontend how demanding this implementation + // is on a system. E.g. reporting a level of 2 means + // this implementation should run decently on all frontends + // of level 2 and up. + // + // It can be used by the frontend to potentially warn + // about too demanding implementations. + // + // The levels are "floating", but roughly defined as: + // 1: Low-powered devices such as Raspberry Pi, smart phones, tablets, etc. + // 2: Medium-spec consoles, such as PS3/360, with sub-par CPUs. + // 3: Modern desktop/laptops with reasonably powerful CPUs. + // 4: High-end desktops with very powerful CPUs. + // + // This function can be called on a per-game basis, + // as certain games an implementation can play might be + // particularily demanding. + struct retro_message { const char *msg; // Message to be displayed.