mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 12:40:23 +00:00
* Add 'null' frontend context driver (will come into use later on in
more important ways) * RetroArch when compiled with menu support will now cleanly exit if menu driver cannot be initialized properly
This commit is contained in:
parent
4d46c36917
commit
cf669f21ca
1
Makefile
1
Makefile
@ -6,6 +6,7 @@ OBJDIR := obj-unix
|
||||
|
||||
OBJ = frontend/frontend.o \
|
||||
frontend/frontend_context.o \
|
||||
frontend/platform/platform_null.o \
|
||||
retroarch.o \
|
||||
file.o \
|
||||
file_path.o \
|
||||
|
@ -1,6 +1,7 @@
|
||||
TARGET = retroarch.js
|
||||
|
||||
OBJ = frontend/platform/platform_emscripten.o \
|
||||
frontend/platform/platform_null.o \
|
||||
frontend/frontend.o \
|
||||
retroarch.o \
|
||||
file.o \
|
||||
|
@ -5,6 +5,7 @@ OBJDIR := obj-w32
|
||||
|
||||
OBJ = frontend/frontend.o \
|
||||
frontend/frontend_context.o \
|
||||
frontend/platform/platform_null.o \
|
||||
retroarch.o \
|
||||
file.o \
|
||||
file_path.o \
|
||||
|
@ -117,10 +117,6 @@ static void rarch_get_environment_console(void)
|
||||
#define attempt_load_game_fails (1ULL << MODE_EXIT)
|
||||
#endif
|
||||
|
||||
#define frontend_init_enable true
|
||||
#define menu_init_enable true
|
||||
#define initial_lifecycle_state_preinit false
|
||||
|
||||
static retro_keyboard_event_t key_event;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
@ -345,14 +341,16 @@ returntype main_entry(signature())
|
||||
declare_argv();
|
||||
args_type() args = (args_type())args_initial_ptr();
|
||||
|
||||
if (frontend_init_enable)
|
||||
{
|
||||
frontend_ctx = (frontend_ctx_driver_t*)frontend_ctx_init_first();
|
||||
frontend_ctx = (frontend_ctx_driver_t*)frontend_ctx_init_first();
|
||||
|
||||
if (frontend_ctx && frontend_ctx->init)
|
||||
frontend_ctx->init(args);
|
||||
if (!frontend_ctx)
|
||||
{
|
||||
RARCH_WARN("Frontend context could not be initialized.\n");
|
||||
}
|
||||
|
||||
if (frontend_ctx && frontend_ctx->init)
|
||||
frontend_ctx->init(args);
|
||||
|
||||
if (!ra_preinited)
|
||||
{
|
||||
rarch_main_clear_state();
|
||||
@ -372,14 +370,18 @@ returntype main_entry(signature())
|
||||
}
|
||||
|
||||
#if defined(HAVE_MENU)
|
||||
if (menu_init_enable)
|
||||
driver.menu = (rgui_handle_t*)menu_init();
|
||||
driver.menu = (rgui_handle_t*)menu_init();
|
||||
|
||||
if (!driver.menu)
|
||||
{
|
||||
RARCH_ERR("Couldn't initialize menu, exiting...\n");
|
||||
returnfunc();
|
||||
}
|
||||
|
||||
if (frontend_ctx && frontend_ctx->process_args)
|
||||
frontend_ctx->process_args(argc, argv, args);
|
||||
|
||||
if (!initial_lifecycle_state_preinit)
|
||||
g_extern.lifecycle_state |= initial_menu_lifecycle_state;
|
||||
g_extern.lifecycle_state |= initial_menu_lifecycle_state;
|
||||
|
||||
if (attempt_load_game_push_history)
|
||||
{
|
||||
|
@ -42,6 +42,7 @@ static const frontend_ctx_driver_t *frontend_ctx_drivers[] = {
|
||||
#if defined(PSP)
|
||||
&frontend_ctx_psp,
|
||||
#endif
|
||||
&frontend_ctx_null,
|
||||
NULL // zero length array is not valid
|
||||
};
|
||||
|
||||
|
@ -51,6 +51,7 @@ extern const frontend_ctx_driver_t frontend_ctx_qnx;
|
||||
extern const frontend_ctx_driver_t frontend_ctx_apple;
|
||||
extern const frontend_ctx_driver_t frontend_ctx_android;
|
||||
extern const frontend_ctx_driver_t frontend_ctx_psp;
|
||||
extern const frontend_ctx_driver_t frontend_ctx_null;
|
||||
|
||||
const frontend_ctx_driver_t *frontend_ctx_find_driver(const char *ident); // Finds driver with ident. Does not initialize.
|
||||
const frontend_ctx_driver_t *frontend_ctx_init_first(void); // Finds first suitable driver and initializes.
|
||||
|
34
frontend/platform/platform_null.c
Normal file
34
frontend/platform/platform_null.c
Normal file
@ -0,0 +1,34 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2014 - Daniel De Matteis
|
||||
* Copyright (C) 2012-2014 - Jason Fetters
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
* * You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../frontend_context.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../../boolean.h"
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
const frontend_ctx_driver_t frontend_ctx_null = {
|
||||
NULL, /* environment_get */
|
||||
NULL, /* init */
|
||||
NULL, /* deinit */
|
||||
NULL, /* exitspawn */
|
||||
NULL, /* process_args */
|
||||
NULL, /* process_events */
|
||||
NULL, /* exec */
|
||||
NULL, /* shutdown */
|
||||
"null",
|
||||
};
|
@ -560,6 +560,7 @@ FRONTEND
|
||||
#elif defined(ANDROID)
|
||||
#include "../frontend/platform/platform_android.c"
|
||||
#endif
|
||||
#include "../frontend/platform/platform_null.c"
|
||||
|
||||
#include "../frontend/info/core_info.c"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user