mirror of
https://github.com/libretro/RetroArch
synced 2025-03-02 19:13:34 +00:00
Move more state to runloop_state
This commit is contained in:
parent
6d6ed11b60
commit
2b41173cd5
16
retroarch.c
16
retroarch.c
@ -11910,7 +11910,7 @@ static bool retroarch_environment_cb(unsigned cmd, void *data)
|
||||
const unsigned *poll_type_data = (const unsigned*)data;
|
||||
|
||||
if (poll_type_data)
|
||||
p_rarch->core_poll_type_override = (enum poll_type_override_t)*poll_type_data;
|
||||
runloop_st->core_poll_type_override = (enum poll_type_override_t)*poll_type_data;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -12516,7 +12516,7 @@ static void secondary_core_destroy(struct rarch_state *p_rarch)
|
||||
/* unload game from core */
|
||||
if (runloop_st->secondary_core.retro_unload_game)
|
||||
runloop_st->secondary_core.retro_unload_game();
|
||||
p_rarch->core_poll_type_override = POLL_TYPE_OVERRIDE_DONTCARE;
|
||||
runloop_st->core_poll_type_override = POLL_TYPE_OVERRIDE_DONTCARE;
|
||||
|
||||
/* deinit */
|
||||
if (runloop_st->secondary_core.retro_deinit)
|
||||
@ -16792,7 +16792,7 @@ static void unload_hook(void)
|
||||
secondary_core_destroy(p_rarch);
|
||||
if (runloop_st->current_core.retro_unload_game)
|
||||
runloop_st->current_core.retro_unload_game();
|
||||
p_rarch->core_poll_type_override = POLL_TYPE_OVERRIDE_DONTCARE;
|
||||
runloop_st->core_poll_type_override = POLL_TYPE_OVERRIDE_DONTCARE;
|
||||
}
|
||||
|
||||
static void runahead_deinit_hook(void)
|
||||
@ -21293,10 +21293,9 @@ static int16_t core_input_state_poll_late(unsigned port,
|
||||
|
||||
static retro_input_state_t core_input_state_poll_return_cb(void)
|
||||
{
|
||||
struct rarch_state *p_rarch = &rarch_st;
|
||||
runloop_state_t *runloop_st = &runloop_state;
|
||||
const enum poll_type_override_t
|
||||
core_poll_type_override = p_rarch->core_poll_type_override;
|
||||
core_poll_type_override = runloop_st->core_poll_type_override;
|
||||
unsigned new_poll_type = (core_poll_type_override > POLL_TYPE_OVERRIDE_DONTCARE)
|
||||
? (core_poll_type_override - 1)
|
||||
: runloop_st->current_core.poll_type;
|
||||
@ -21307,10 +21306,9 @@ static retro_input_state_t core_input_state_poll_return_cb(void)
|
||||
|
||||
static void core_input_state_poll_maybe(void)
|
||||
{
|
||||
struct rarch_state *p_rarch = &rarch_st;
|
||||
runloop_state_t *runloop_st = &runloop_state;
|
||||
const enum poll_type_override_t
|
||||
core_poll_type_override = p_rarch->core_poll_type_override;
|
||||
core_poll_type_override = runloop_st->core_poll_type_override;
|
||||
unsigned new_poll_type = (core_poll_type_override > POLL_TYPE_OVERRIDE_DONTCARE)
|
||||
? (core_poll_type_override - 1)
|
||||
: runloop_st->current_core.poll_type;
|
||||
@ -21670,7 +21668,7 @@ static bool core_unload_game(struct rarch_state *p_rarch)
|
||||
{
|
||||
RARCH_LOG("[Core]: Unloading game..\n");
|
||||
runloop_st->current_core.retro_unload_game();
|
||||
p_rarch->core_poll_type_override = POLL_TYPE_OVERRIDE_DONTCARE;
|
||||
runloop_st->core_poll_type_override = POLL_TYPE_OVERRIDE_DONTCARE;
|
||||
runloop_st->current_core.game_loaded = false;
|
||||
}
|
||||
|
||||
@ -21687,7 +21685,7 @@ bool core_run(void)
|
||||
struct retro_core_t *
|
||||
current_core = &runloop_st->current_core;
|
||||
const enum poll_type_override_t
|
||||
core_poll_type_override = p_rarch->core_poll_type_override;
|
||||
core_poll_type_override = runloop_st->core_poll_type_override;
|
||||
unsigned new_poll_type = (core_poll_type_override != POLL_TYPE_OVERRIDE_DONTCARE)
|
||||
? (core_poll_type_override - 1)
|
||||
: current_core->poll_type;
|
||||
|
@ -490,14 +490,6 @@ enum
|
||||
RA_OPT_LOAD_MENU_ON_ERROR
|
||||
};
|
||||
|
||||
enum poll_type_override_t
|
||||
{
|
||||
POLL_TYPE_OVERRIDE_DONTCARE = 0,
|
||||
POLL_TYPE_OVERRIDE_EARLY,
|
||||
POLL_TYPE_OVERRIDE_NORMAL,
|
||||
POLL_TYPE_OVERRIDE_LATE
|
||||
};
|
||||
|
||||
typedef void *(*constructor_t)(void);
|
||||
typedef void (*destructor_t )(void*);
|
||||
|
||||
@ -624,9 +616,6 @@ struct rarch_state
|
||||
#if defined(HAVE_DYNAMIC) || defined(HAVE_DYLIB)
|
||||
dylib_t secondary_lib_handle; /* ptr alignment */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_RUNAHEAD
|
||||
size_t runahead_save_state_size;
|
||||
#endif
|
||||
|
||||
@ -675,7 +664,6 @@ struct rarch_state
|
||||
#if defined(HAVE_RUNAHEAD)
|
||||
enum rarch_core_type last_core_type;
|
||||
#endif
|
||||
enum poll_type_override_t core_poll_type_override;
|
||||
|
||||
retro_bits_t has_set_libretro_device; /* uint32_t alignment */
|
||||
|
||||
|
10
runloop.h
10
runloop.h
@ -46,6 +46,15 @@ enum runloop_state_enum
|
||||
RUNLOOP_STATE_QUIT
|
||||
};
|
||||
|
||||
enum poll_type_override_t
|
||||
{
|
||||
POLL_TYPE_OVERRIDE_DONTCARE = 0,
|
||||
POLL_TYPE_OVERRIDE_EARLY,
|
||||
POLL_TYPE_OVERRIDE_NORMAL,
|
||||
POLL_TYPE_OVERRIDE_LATE
|
||||
};
|
||||
|
||||
|
||||
typedef struct runloop_ctx_msg_info
|
||||
{
|
||||
const char *msg;
|
||||
@ -135,6 +144,7 @@ struct runloop
|
||||
unsigned audio_latency;
|
||||
|
||||
fastmotion_overrides_t fastmotion_override; /* float alignment */
|
||||
enum poll_type_override_t core_poll_type_override;
|
||||
|
||||
bool missing_bios;
|
||||
bool force_nonblock;
|
||||
|
Loading…
x
Reference in New Issue
Block a user