move runloop state from retroarch_data to runloop_state

This commit is contained in:
twinaphex 2021-10-14 21:15:11 +02:00
parent 6ccac53d89
commit eef9668263
3 changed files with 428 additions and 356 deletions

File diff suppressed because it is too large Load Diff

View File

@ -510,10 +510,6 @@ typedef struct my_list_t
int size;
} my_list;
#ifdef HAVE_RUNAHEAD
typedef bool(*runahead_load_state_function)(const void*, size_t);
#endif
#ifdef HAVE_DISCORD
/* The Discord API specifies these variables:
- userId --------- char[24] - the userId of the player asking to join
@ -558,21 +554,12 @@ struct rarch_state
#ifdef HAVE_DISCORD
discord_state_t discord_st; /* int64_t alignment */
#endif
struct retro_core_t current_core; /* uint64_t alignment */
#if defined(HAVE_RUNAHEAD)
#if defined(HAVE_DYNAMIC) || defined(HAVE_DYLIB)
struct retro_core_t secondary_core; /* uint64_t alignment */
#endif
#endif
#ifdef HAVE_RUNAHEAD
uint64_t runahead_last_frame_count;
#endif
struct retro_camera_callback camera_cb; /* uint64_t alignment */
struct string_list *subsystem_fullpaths;
bool *load_no_content_hook;
#if defined(HAVE_RUNAHEAD)
#if defined(HAVE_DYNAMIC) || defined(HAVE_DYLIB)
@ -627,20 +614,6 @@ struct rarch_state
[SUBSYSTEM_MAX_SUBSYSTEM_ROMS]; /* ptr alignment */
content_state_t content_st; /* ptr alignment */
retro_input_state_t input_state_callback_original; /* ptr alignment */
#ifdef HAVE_RUNAHEAD
function_t retro_reset_callback_original; /* ptr alignment */
function_t original_retro_deinit; /* ptr alignment */
function_t original_retro_unload; /* ptr alignment */
runahead_load_state_function
retro_unserialize_callback_original; /* ptr alignment */
#endif
struct retro_callbacks retro_ctx; /* ptr alignment */
#if defined(HAVE_RUNAHEAD)
#if defined(HAVE_DYNAMIC) || defined(HAVE_DYLIB)
struct retro_callbacks secondary_callbacks; /* ptr alignment */
#endif
#endif
#ifdef HAVE_NETWORKING
struct netplay_room netplay_host_room; /* ptr alignment */
#endif
@ -793,10 +766,7 @@ struct rarch_state
#ifdef HAVE_RUNAHEAD
bool runahead_save_state_size_known;
bool request_fast_savestate;
bool input_is_dirty;
#endif
#if defined(HAVE_NETWORKING)
bool has_set_netplay_mode;
bool has_set_netplay_ip_address;

View File

@ -24,6 +24,7 @@
#include <boolean.h>
#include <retro_inline.h>
#include <retro_common_api.h>
#include <dynamic/dylib.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
@ -33,6 +34,7 @@
#include <rthreads/rthreads.h>
#endif
#include "dynamic.h"
#include "core_option_manager.h"
enum runloop_state_enum
@ -84,13 +86,36 @@ typedef struct core_options_callbacks
retro_core_options_update_display_callback_t update_display;
} core_options_callbacks_t;
#ifdef HAVE_RUNAHEAD
typedef bool(*runahead_load_state_function)(const void*, size_t);
#endif
struct runloop
{
retro_time_t frame_limit_minimum_time;
retro_time_t frame_limit_last_time;
retro_usec_t frame_time_last; /* int64_t alignment */
retro_usec_t frame_time_last; /* int64_t alignment */
msg_queue_t msg_queue; /* ptr alignment */
struct retro_core_t current_core; /* uint64_t alignment */
#if defined(HAVE_RUNAHEAD)
#if defined(HAVE_DYNAMIC) || defined(HAVE_DYLIB)
struct retro_core_t secondary_core; /* uint64_t alignment */
#endif
#endif
struct retro_callbacks retro_ctx; /* ptr alignment */
msg_queue_t msg_queue; /* ptr alignment */
retro_input_state_t input_state_callback_original; /* ptr alignment */
#ifdef HAVE_RUNAHEAD
function_t retro_reset_callback_original; /* ptr alignment */
function_t original_retro_deinit; /* ptr alignment */
function_t original_retro_unload; /* ptr alignment */
runahead_load_state_function
retro_unserialize_callback_original; /* ptr alignment */
#if defined(HAVE_DYNAMIC) || defined(HAVE_DYLIB)
struct retro_callbacks secondary_callbacks; /* ptr alignment */
#endif
#endif
#ifdef HAVE_THREADS
slock_t *msg_queue_lock;
#endif
@ -137,6 +162,7 @@ struct runloop
#endif
#ifdef HAVE_RUNAHEAD
bool has_variable_update;
bool input_is_dirty;
#endif
};