mirror of
https://github.com/libretro/RetroArch
synced 2025-02-27 09:41:14 +00:00
Reorder structs, alignment
This commit is contained in:
parent
a5efd70db7
commit
f09df7c6e3
@ -13,6 +13,7 @@ For POD-types, try to order structs as follows (first to last):
|
|||||||
* ptrdiff_t (4 bytes [32bit], 8 bytes [64bit])
|
* ptrdiff_t (4 bytes [32bit], 8 bytes [64bit])
|
||||||
* ssize_t (4 bytes [32bit], 8 bytes [64bit])
|
* ssize_t (4 bytes [32bit], 8 bytes [64bit])
|
||||||
* size_t (4 bytes [32bit], 8 bytes [64bit])
|
* size_t (4 bytes [32bit], 8 bytes [64bit])
|
||||||
|
* jmp_buf (4 bytes)
|
||||||
* long (4 bytes [64bit Win], 8 bytes [64bit non-Win], 4 bytes [32bit])
|
* long (4 bytes [64bit Win], 8 bytes [64bit non-Win], 4 bytes [32bit])
|
||||||
* int32_t (4 bytes)
|
* int32_t (4 bytes)
|
||||||
* float (4 bytes)
|
* float (4 bytes)
|
||||||
|
@ -55,6 +55,7 @@ const struct retro_controller_description *
|
|||||||
|
|
||||||
struct retro_core_t
|
struct retro_core_t
|
||||||
{
|
{
|
||||||
|
uint64_t serialization_quirks_v;
|
||||||
void (*retro_init)(void);
|
void (*retro_init)(void);
|
||||||
void (*retro_deinit)(void);
|
void (*retro_deinit)(void);
|
||||||
unsigned (*retro_api_version)(void);
|
unsigned (*retro_api_version)(void);
|
||||||
@ -89,7 +90,6 @@ struct retro_core_t
|
|||||||
bool input_polled;
|
bool input_polled;
|
||||||
bool has_set_subsystems;
|
bool has_set_subsystems;
|
||||||
bool has_set_input_descriptors;
|
bool has_set_input_descriptors;
|
||||||
uint64_t serialization_quirks_v;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
bool libretro_get_shared_context(void);
|
bool libretro_get_shared_context(void);
|
||||||
|
@ -95,16 +95,6 @@ typedef struct vulkan_context
|
|||||||
slock_t *queue_lock;
|
slock_t *queue_lock;
|
||||||
retro_vulkan_destroy_device_t destroy_device; /* ptr alignment */
|
retro_vulkan_destroy_device_t destroy_device; /* ptr alignment */
|
||||||
|
|
||||||
uint32_t graphics_queue_index;
|
|
||||||
uint32_t num_swapchain_images;
|
|
||||||
uint32_t current_swapchain_index;
|
|
||||||
uint32_t current_frame_index;
|
|
||||||
|
|
||||||
unsigned swapchain_width;
|
|
||||||
unsigned swapchain_height;
|
|
||||||
unsigned swap_interval;
|
|
||||||
unsigned num_recycled_acquire_semaphores;
|
|
||||||
|
|
||||||
VkInstance instance;
|
VkInstance instance;
|
||||||
VkPhysicalDevice gpu;
|
VkPhysicalDevice gpu;
|
||||||
VkDevice device;
|
VkDevice device;
|
||||||
@ -125,6 +115,16 @@ typedef struct vulkan_context
|
|||||||
#ifdef VULKAN_DEBUG
|
#ifdef VULKAN_DEBUG
|
||||||
VkDebugReportCallbackEXT debug_callback;
|
VkDebugReportCallbackEXT debug_callback;
|
||||||
#endif
|
#endif
|
||||||
|
uint32_t graphics_queue_index;
|
||||||
|
uint32_t num_swapchain_images;
|
||||||
|
uint32_t current_swapchain_index;
|
||||||
|
uint32_t current_frame_index;
|
||||||
|
|
||||||
|
unsigned swapchain_width;
|
||||||
|
unsigned swapchain_height;
|
||||||
|
unsigned swap_interval;
|
||||||
|
unsigned num_recycled_acquire_semaphores;
|
||||||
|
|
||||||
bool swapchain_fences_signalled[VULKAN_MAX_SWAPCHAIN_IMAGES];
|
bool swapchain_fences_signalled[VULKAN_MAX_SWAPCHAIN_IMAGES];
|
||||||
bool invalid_swapchain;
|
bool invalid_swapchain;
|
||||||
/* Used by screenshot to get blits with correct colorspace. */
|
/* Used by screenshot to get blits with correct colorspace. */
|
||||||
@ -189,7 +189,7 @@ struct vk_vertex
|
|||||||
{
|
{
|
||||||
float x, y;
|
float x, y;
|
||||||
float tex_x, tex_y;
|
float tex_x, tex_y;
|
||||||
struct vk_color color;
|
struct vk_color color; /* float alignment */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct vk_image
|
struct vk_image
|
||||||
@ -233,7 +233,7 @@ struct vk_buffer
|
|||||||
|
|
||||||
struct vk_buffer_node
|
struct vk_buffer_node
|
||||||
{
|
{
|
||||||
struct vk_buffer buffer;
|
struct vk_buffer buffer; /* uint64_t alignment */
|
||||||
struct vk_buffer_node *next;
|
struct vk_buffer_node *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -40,21 +40,21 @@
|
|||||||
|
|
||||||
typedef struct freetype_atlas_slot
|
typedef struct freetype_atlas_slot
|
||||||
{
|
{
|
||||||
struct font_glyph glyph;
|
struct freetype_atlas_slot* next; /* ptr alignment */
|
||||||
|
struct font_glyph glyph; /* unsigned alignment */
|
||||||
unsigned charcode;
|
unsigned charcode;
|
||||||
unsigned last_used;
|
unsigned last_used;
|
||||||
struct freetype_atlas_slot* next;
|
|
||||||
}freetype_atlas_slot_t;
|
}freetype_atlas_slot_t;
|
||||||
|
|
||||||
typedef struct freetype_renderer
|
typedef struct freetype_renderer
|
||||||
{
|
{
|
||||||
FT_Library lib;
|
FT_Library lib; /* ptr alignment */
|
||||||
FT_Face face;
|
FT_Face face; /* ptr alignment */
|
||||||
struct font_atlas atlas;
|
struct font_atlas atlas; /* ptr alignment */
|
||||||
freetype_atlas_slot_t atlas_slots[FT_ATLAS_SIZE];
|
freetype_atlas_slot_t atlas_slots[FT_ATLAS_SIZE]; /* ptr alignment */
|
||||||
freetype_atlas_slot_t* uc_map[0x100];
|
freetype_atlas_slot_t* uc_map[0x100]; /* ptr alignment */
|
||||||
unsigned usage_counter;
|
unsigned usage_counter;
|
||||||
struct font_line_metrics line_metrics;
|
struct font_line_metrics line_metrics; /* float alignment */
|
||||||
} ft_font_renderer_t;
|
} ft_font_renderer_t;
|
||||||
|
|
||||||
static struct font_atlas *font_renderer_ft_get_atlas(void *data)
|
static struct font_atlas *font_renderer_ft_get_atlas(void *data)
|
||||||
|
@ -36,9 +36,9 @@
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
struct font_line_metrics line_metrics;
|
struct font_atlas atlas; /* ptr alignment */
|
||||||
struct font_atlas atlas;
|
struct font_glyph glyphs[256]; /* unsigned alignment */
|
||||||
struct font_glyph glyphs[256];
|
struct font_line_metrics line_metrics; /* float alignment */
|
||||||
} stb_font_renderer_t;
|
} stb_font_renderer_t;
|
||||||
|
|
||||||
static struct font_atlas *font_renderer_stb_get_atlas(void *data)
|
static struct font_atlas *font_renderer_stb_get_atlas(void *data)
|
||||||
|
@ -44,26 +44,24 @@
|
|||||||
|
|
||||||
typedef struct stb_unicode_atlas_slot
|
typedef struct stb_unicode_atlas_slot
|
||||||
{
|
{
|
||||||
struct font_glyph glyph;
|
struct stb_unicode_atlas_slot* next;
|
||||||
|
struct font_glyph glyph; /* unsigned alignment */
|
||||||
unsigned charcode;
|
unsigned charcode;
|
||||||
unsigned last_used;
|
unsigned last_used;
|
||||||
struct stb_unicode_atlas_slot* next;
|
|
||||||
}stb_unicode_atlas_slot_t;
|
}stb_unicode_atlas_slot_t;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
uint8_t *font_data;
|
uint8_t *font_data;
|
||||||
stbtt_fontinfo info;
|
struct font_atlas atlas; /* ptr alignment */
|
||||||
|
stb_unicode_atlas_slot_t* uc_map[0x100];
|
||||||
|
stb_unicode_atlas_slot_t atlas_slots[STB_UNICODE_ATLAS_SIZE];
|
||||||
|
stbtt_fontinfo info; /* ptr alignment */
|
||||||
int max_glyph_width;
|
int max_glyph_width;
|
||||||
int max_glyph_height;
|
int max_glyph_height;
|
||||||
float scale_factor;
|
|
||||||
struct font_line_metrics line_metrics;
|
|
||||||
|
|
||||||
struct font_atlas atlas;
|
|
||||||
stb_unicode_atlas_slot_t atlas_slots[STB_UNICODE_ATLAS_SIZE];
|
|
||||||
stb_unicode_atlas_slot_t* uc_map[0x100];
|
|
||||||
unsigned usage_counter;
|
unsigned usage_counter;
|
||||||
|
float scale_factor;
|
||||||
|
struct font_line_metrics line_metrics; /* float alignment */
|
||||||
} stb_unicode_font_renderer_t;
|
} stb_unicode_font_renderer_t;
|
||||||
|
|
||||||
static struct font_atlas *font_renderer_stb_unicode_get_atlas(void *data)
|
static struct font_atlas *font_renderer_stb_unicode_get_atlas(void *data)
|
||||||
|
@ -168,7 +168,7 @@ typedef struct menu_input_pointer
|
|||||||
|
|
||||||
typedef struct menu_input
|
typedef struct menu_input
|
||||||
{
|
{
|
||||||
menu_input_pointer_t pointer; /* int64_t alignment */
|
menu_input_pointer_t pointer; /* retro_time_t alignment */
|
||||||
unsigned ptr;
|
unsigned ptr;
|
||||||
bool select_inhibit;
|
bool select_inhibit;
|
||||||
bool cancel_inhibit;
|
bool cancel_inhibit;
|
||||||
|
135
retroarch.c
135
retroarch.c
@ -1934,6 +1934,10 @@ struct rarch_state
|
|||||||
retro_time_t libretro_core_runtime_usec;
|
retro_time_t libretro_core_runtime_usec;
|
||||||
retro_time_t video_driver_frame_time_samples[
|
retro_time_t video_driver_frame_time_samples[
|
||||||
MEASURE_FRAME_TIME_SAMPLES_COUNT];
|
MEASURE_FRAME_TIME_SAMPLES_COUNT];
|
||||||
|
struct global g_extern; /* retro_time_t alignment */
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
menu_input_t menu_input_state; /* retro_time_t alignment */
|
||||||
|
#endif
|
||||||
|
|
||||||
retro_usec_t runloop_frame_time_last;
|
retro_usec_t runloop_frame_time_last;
|
||||||
|
|
||||||
@ -1946,11 +1950,22 @@ struct rarch_state
|
|||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
struct menu_state menu_driver_state; /* int64_t alignment */
|
struct menu_state menu_driver_state; /* int64_t alignment */
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(HAVE_COMMAND)
|
||||||
|
#ifdef HAVE_NETWORK_CMD
|
||||||
|
struct sockaddr_storage lastcmd_net_source; /* int64_t alignment */
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
#ifdef HAVE_GFX_WIDGETS
|
#ifdef HAVE_GFX_WIDGETS
|
||||||
dispgfx_widget_t dispwidget_st; /* uint64_t alignment */
|
dispgfx_widget_t dispwidget_st; /* uint64_t alignment */
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
struct menu_bind_state menu_input_binds; /* uint64_t alignment */
|
struct menu_bind_state menu_input_binds; /* uint64_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
|
#endif
|
||||||
|
|
||||||
uint64_t audio_driver_free_samples_count;
|
uint64_t audio_driver_free_samples_count;
|
||||||
@ -2107,6 +2122,10 @@ struct rarch_state
|
|||||||
|
|
||||||
const struct retro_keybind *libretro_input_binds[MAX_USERS];
|
const struct retro_keybind *libretro_input_binds[MAX_USERS];
|
||||||
|
|
||||||
|
struct retro_subsystem_rom_info
|
||||||
|
subsystem_data_roms[SUBSYSTEM_MAX_SUBSYSTEMS]
|
||||||
|
[SUBSYSTEM_MAX_SUBSYSTEM_ROMS]; /* ptr alignment */
|
||||||
|
gfx_ctx_driver_t current_video_context; /* ptr alignment */
|
||||||
content_state_t content_st; /* ptr alignment */
|
content_state_t content_st; /* ptr alignment */
|
||||||
midi_event_t midi_drv_input_event; /* ptr alignment */
|
midi_event_t midi_drv_input_event; /* ptr alignment */
|
||||||
midi_event_t midi_drv_output_event; /* ptr alignment */
|
midi_event_t midi_drv_output_event; /* ptr alignment */
|
||||||
@ -2132,70 +2151,29 @@ struct rarch_state
|
|||||||
runahead_load_state_function
|
runahead_load_state_function
|
||||||
retro_unserialize_callback_original; /* ptr alignment */
|
retro_unserialize_callback_original; /* ptr alignment */
|
||||||
#endif
|
#endif
|
||||||
|
struct retro_callbacks retro_ctx; /* ptr alignment */
|
||||||
/*************************************/
|
|
||||||
/* TODO/FIXME BEGIN - find alignment */
|
|
||||||
#ifdef HAVE_DYNAMIC
|
|
||||||
dylib_t lib_handle;
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_NETWORKING
|
|
||||||
struct netplay_room netplay_host_room;
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_RUNAHEAD)
|
#if defined(HAVE_RUNAHEAD)
|
||||||
#if defined(HAVE_DYNAMIC) || defined(HAVE_DYLIB)
|
#if defined(HAVE_DYNAMIC) || defined(HAVE_DYLIB)
|
||||||
dylib_t secondary_module;
|
struct retro_callbacks secondary_callbacks; /* ptr alignment */
|
||||||
struct retro_core_t secondary_core;
|
|
||||||
struct retro_callbacks secondary_callbacks;
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_MENU
|
|
||||||
menu_input_pointer_hw_state_t menu_input_pointer_hw_state;
|
|
||||||
menu_input_t menu_input_state;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
gfx_ctx_driver_t current_video_context;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dynamic.c:dynamic_request_hw_context will try to set flag data when the context
|
|
||||||
* is in the middle of being rebuilt; in these cases we will save flag
|
|
||||||
* data and set this to true.
|
|
||||||
* When the context is reinit, it checks this, reads from
|
|
||||||
* deferred_flag_data and cleans it.
|
|
||||||
*
|
|
||||||
* TODO - Dirty hack, fix it better
|
|
||||||
*/
|
|
||||||
gfx_ctx_flags_t deferred_flag_data;
|
|
||||||
|
|
||||||
retro_bits_t has_set_libretro_device;
|
|
||||||
|
|
||||||
#ifdef HAVE_AUDIOMIXER
|
#ifdef HAVE_AUDIOMIXER
|
||||||
struct audio_mixer_stream
|
struct audio_mixer_stream
|
||||||
audio_mixer_streams[AUDIO_MIXER_MAX_SYSTEM_STREAMS];
|
audio_mixer_streams[AUDIO_MIXER_MAX_SYSTEM_STREAMS];
|
||||||
|
/* ptr alignment */
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_NETWORKING
|
||||||
struct retro_callbacks retro_ctx;
|
struct netplay_room netplay_host_room; /* ptr alignment */
|
||||||
struct retro_core_t current_core;
|
#endif
|
||||||
struct global g_extern;
|
#ifdef HAVE_DYNAMIC
|
||||||
#if defined(HAVE_COMMAND)
|
dylib_t lib_handle; /* ptr alignment */
|
||||||
#ifdef HAVE_NETWORK_CMD
|
#endif
|
||||||
struct sockaddr_storage lastcmd_net_source;
|
#if defined(HAVE_RUNAHEAD)
|
||||||
socklen_t lastcmd_net_source_len;
|
#if defined(HAVE_DYNAMIC) || defined(HAVE_DYLIB)
|
||||||
|
dylib_t secondary_lib_handle; /* ptr alignment */
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_THREAD_STORAGE
|
|
||||||
sthread_tls_t rarch_tls;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
jmp_buf error_sjlj_context;
|
|
||||||
|
|
||||||
struct retro_subsystem_rom_info
|
|
||||||
subsystem_data_roms[SUBSYSTEM_MAX_SUBSYSTEMS]
|
|
||||||
[SUBSYSTEM_MAX_SUBSYSTEM_ROMS];
|
|
||||||
|
|
||||||
/* TODO/FIXME END - find alignment */
|
|
||||||
/*************************************/
|
|
||||||
|
|
||||||
/* Opaque handles to currently running window.
|
/* Opaque handles to currently running window.
|
||||||
* Used by e.g. input drivers which bind to a window.
|
* Used by e.g. input drivers which bind to a window.
|
||||||
* Drivers are responsible for setting these if an input driver
|
* Drivers are responsible for setting these if an input driver
|
||||||
@ -2225,6 +2203,9 @@ struct rarch_state
|
|||||||
size_t runahead_save_state_size;
|
size_t runahead_save_state_size;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
jmp_buf error_sjlj_context; /* 4-byte alignment,
|
||||||
|
put it right before long */
|
||||||
|
|
||||||
turbo_buttons_t input_driver_turbo_btns; /* int32_t alignment */
|
turbo_buttons_t input_driver_turbo_btns; /* int32_t alignment */
|
||||||
int osk_ptr;
|
int osk_ptr;
|
||||||
#if defined(HAVE_COMMAND)
|
#if defined(HAVE_COMMAND)
|
||||||
@ -2250,9 +2231,13 @@ struct rarch_state
|
|||||||
int reannounce;
|
int reannounce;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
input_device_info_t input_device_info[MAX_INPUT_DEVICES]; /* unsigned alignment */
|
input_device_info_t input_device_info[MAX_INPUT_DEVICES];
|
||||||
|
/* unsigned alignment */
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
menu_dialog_t dialog_st; /* unsigned alignment */
|
menu_dialog_t dialog_st; /* unsigned alignment */
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_THREAD_STORAGE
|
||||||
|
sthread_tls_t rarch_tls; /* unsigned alignment */
|
||||||
#endif
|
#endif
|
||||||
unsigned runloop_pending_windowed_scale;
|
unsigned runloop_pending_windowed_scale;
|
||||||
unsigned runloop_max_frames;
|
unsigned runloop_max_frames;
|
||||||
@ -2322,9 +2307,31 @@ struct rarch_state
|
|||||||
enum overlay_visibility *overlay_visibility;
|
enum overlay_visibility *overlay_visibility;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
menu_input_pointer_hw_state_t menu_input_pointer_hw_state;
|
||||||
|
/* int16_t alignment */
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
unsigned char menu_keyboard_key_state[RETROK_LAST];
|
unsigned char menu_keyboard_key_state[RETROK_LAST];
|
||||||
#endif
|
#endif
|
||||||
|
/**
|
||||||
|
* dynamic.c:dynamic_request_hw_context will try to set flag data when the context
|
||||||
|
* is in the middle of being rebuilt; in these cases we will save flag
|
||||||
|
* data and set this to true.
|
||||||
|
* When the context is reinit, it checks this, reads from
|
||||||
|
* deferred_flag_data and cleans it.
|
||||||
|
*
|
||||||
|
* TODO - Dirty hack, fix it better
|
||||||
|
*/
|
||||||
|
gfx_ctx_flags_t deferred_flag_data; /* uint32_t alignment */
|
||||||
|
#if defined(HAVE_COMMAND)
|
||||||
|
#ifdef HAVE_NETWORK_CMD
|
||||||
|
socklen_t lastcmd_net_source_len; /* uint32_t alignment */
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
retro_bits_t has_set_libretro_device; /* uint32_t alignment */
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_BSV_MOVIE
|
#ifdef HAVE_BSV_MOVIE
|
||||||
struct bsv_state bsv_movie_state; /* char alignment */
|
struct bsv_state bsv_movie_state; /* char alignment */
|
||||||
@ -20606,7 +20613,7 @@ static void strcat_alloc(char **dst, const char *s)
|
|||||||
|
|
||||||
static void secondary_core_destroy(struct rarch_state *p_rarch)
|
static void secondary_core_destroy(struct rarch_state *p_rarch)
|
||||||
{
|
{
|
||||||
if (!p_rarch || !p_rarch->secondary_module)
|
if (!p_rarch || !p_rarch->secondary_lib_handle)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* unload game from core */
|
/* unload game from core */
|
||||||
@ -20619,8 +20626,8 @@ static void secondary_core_destroy(struct rarch_state *p_rarch)
|
|||||||
p_rarch->secondary_core.retro_deinit();
|
p_rarch->secondary_core.retro_deinit();
|
||||||
memset(&p_rarch->secondary_core, 0, sizeof(struct retro_core_t));
|
memset(&p_rarch->secondary_core, 0, sizeof(struct retro_core_t));
|
||||||
|
|
||||||
dylib_close(p_rarch->secondary_module);
|
dylib_close(p_rarch->secondary_lib_handle);
|
||||||
p_rarch->secondary_module = NULL;
|
p_rarch->secondary_lib_handle = NULL;
|
||||||
filestream_delete(p_rarch->secondary_library_path);
|
filestream_delete(p_rarch->secondary_library_path);
|
||||||
if (p_rarch->secondary_library_path)
|
if (p_rarch->secondary_library_path)
|
||||||
free(p_rarch->secondary_library_path);
|
free(p_rarch->secondary_library_path);
|
||||||
@ -20629,7 +20636,7 @@ static void secondary_core_destroy(struct rarch_state *p_rarch)
|
|||||||
|
|
||||||
static bool secondary_core_ensure_exists(struct rarch_state *p_rarch)
|
static bool secondary_core_ensure_exists(struct rarch_state *p_rarch)
|
||||||
{
|
{
|
||||||
if (!p_rarch->secondary_module)
|
if (!p_rarch->secondary_lib_handle)
|
||||||
if (!secondary_core_create(p_rarch))
|
if (!secondary_core_create(p_rarch))
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
@ -20653,7 +20660,8 @@ static void remember_controller_port_device(
|
|||||||
{
|
{
|
||||||
if (port >= 0 && port < MAX_USERS)
|
if (port >= 0 && port < MAX_USERS)
|
||||||
p_rarch->port_map[port] = (int)device;
|
p_rarch->port_map[port] = (int)device;
|
||||||
if (p_rarch->secondary_module && p_rarch->secondary_core.retro_set_controller_port_device)
|
if ( p_rarch->secondary_lib_handle
|
||||||
|
&& p_rarch->secondary_core.retro_set_controller_port_device)
|
||||||
p_rarch->secondary_core.retro_set_controller_port_device((unsigned)port, (unsigned)device);
|
p_rarch->secondary_core.retro_set_controller_port_device((unsigned)port, (unsigned)device);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -20875,7 +20883,8 @@ static bool secondary_core_create(struct rarch_state *p_rarch)
|
|||||||
/* Load Core */
|
/* Load Core */
|
||||||
if (!init_libretro_symbols_custom(p_rarch,
|
if (!init_libretro_symbols_custom(p_rarch,
|
||||||
CORE_TYPE_PLAIN, &p_rarch->secondary_core,
|
CORE_TYPE_PLAIN, &p_rarch->secondary_core,
|
||||||
p_rarch->secondary_library_path, &p_rarch->secondary_module))
|
p_rarch->secondary_library_path,
|
||||||
|
&p_rarch->secondary_lib_handle))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
p_rarch->secondary_core.symbols_inited = true;
|
p_rarch->secondary_core.symbols_inited = true;
|
||||||
@ -38866,14 +38875,14 @@ static enum runloop_state runloop_check_state(
|
|||||||
global->menu.noop_start_time = current_time;
|
global->menu.noop_start_time = current_time;
|
||||||
global->menu.noop_press_time = 0;
|
global->menu.noop_press_time = 0;
|
||||||
|
|
||||||
if (global->menu.prev_action == old_action)
|
if (global->menu_prev_action == old_action)
|
||||||
global->menu.action_start_time = global->menu.prev_start_time;
|
global->menu.action_start_time = global->menu.prev_start_time;
|
||||||
else
|
else
|
||||||
global->menu.action_start_time = current_time;
|
global->menu.action_start_time = current_time;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( global->menu.prev_action == action &&
|
if ( global->menu_prev_action == action &&
|
||||||
global->menu.noop_press_time < 200000) /* 250ms */
|
global->menu.noop_press_time < 200000) /* 250ms */
|
||||||
{
|
{
|
||||||
global->menu.action_start_time = global->menu.prev_start_time;
|
global->menu.action_start_time = global->menu.prev_start_time;
|
||||||
@ -38882,7 +38891,7 @@ static enum runloop_state runloop_check_state(
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
global->menu.prev_start_time = current_time;
|
global->menu.prev_start_time = current_time;
|
||||||
global->menu.prev_action = action;
|
global->menu_prev_action = action;
|
||||||
global->menu.action_press_time = 0;
|
global->menu.action_press_time = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
113
retroarch.h
113
retroarch.h
@ -226,61 +226,6 @@ typedef struct rarch_resolution
|
|||||||
|
|
||||||
typedef struct global
|
typedef struct global
|
||||||
{
|
{
|
||||||
bool launched_from_cli;
|
|
||||||
bool cli_load_menu_on_error;
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
char savefile[8192];
|
|
||||||
char savestate[8192];
|
|
||||||
char cheatfile[8192];
|
|
||||||
char ups[8192];
|
|
||||||
char bps[8192];
|
|
||||||
char ips[8192];
|
|
||||||
char label[8192];
|
|
||||||
char *remapfile;
|
|
||||||
} name;
|
|
||||||
|
|
||||||
/* Recording. */
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
bool use_output_dir;
|
|
||||||
char path[8192];
|
|
||||||
char config[8192];
|
|
||||||
char output_dir[8192];
|
|
||||||
char config_dir[8192];
|
|
||||||
unsigned width;
|
|
||||||
unsigned height;
|
|
||||||
|
|
||||||
size_t gpu_width;
|
|
||||||
size_t gpu_height;
|
|
||||||
} record;
|
|
||||||
|
|
||||||
/* Settings and/or global state that is specific to
|
|
||||||
* a console-style implementation. */
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
bool flickerfilter_enable;
|
|
||||||
bool softfilter_enable;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
bool pal_enable;
|
|
||||||
bool pal60_enable;
|
|
||||||
unsigned char soft_filter_index;
|
|
||||||
unsigned gamma_correction;
|
|
||||||
unsigned int flicker_filter_index;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
bool check;
|
|
||||||
unsigned count;
|
|
||||||
uint32_t *list;
|
|
||||||
rarch_resolution_t current;
|
|
||||||
rarch_resolution_t initial;
|
|
||||||
} resolutions;
|
|
||||||
} screen;
|
|
||||||
} console;
|
|
||||||
/* Settings and/or global states specific to menus */
|
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
@ -289,9 +234,65 @@ typedef struct global
|
|||||||
retro_time_t noop_start_time;
|
retro_time_t noop_start_time;
|
||||||
retro_time_t action_start_time;
|
retro_time_t action_start_time;
|
||||||
retro_time_t action_press_time;
|
retro_time_t action_press_time;
|
||||||
enum menu_action prev_action;
|
|
||||||
} menu;
|
} menu;
|
||||||
#endif
|
#endif
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
char *remapfile;
|
||||||
|
char savefile[8192];
|
||||||
|
char savestate[8192];
|
||||||
|
char cheatfile[8192];
|
||||||
|
char ups[8192];
|
||||||
|
char bps[8192];
|
||||||
|
char ips[8192];
|
||||||
|
char label[8192];
|
||||||
|
} name;
|
||||||
|
|
||||||
|
/* Recording. */
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
size_t gpu_width;
|
||||||
|
size_t gpu_height;
|
||||||
|
unsigned width;
|
||||||
|
unsigned height;
|
||||||
|
char path[8192];
|
||||||
|
char config[8192];
|
||||||
|
char output_dir[8192];
|
||||||
|
char config_dir[8192];
|
||||||
|
bool use_output_dir;
|
||||||
|
} record;
|
||||||
|
|
||||||
|
/* Settings and/or global state that is specific to
|
||||||
|
* a console-style implementation. */
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
uint32_t *list;
|
||||||
|
unsigned count;
|
||||||
|
rarch_resolution_t current;
|
||||||
|
rarch_resolution_t initial;
|
||||||
|
bool check;
|
||||||
|
} resolutions;
|
||||||
|
unsigned gamma_correction;
|
||||||
|
unsigned int flicker_filter_index;
|
||||||
|
unsigned char soft_filter_index;
|
||||||
|
bool pal_enable;
|
||||||
|
bool pal60_enable;
|
||||||
|
} screen;
|
||||||
|
|
||||||
|
bool flickerfilter_enable;
|
||||||
|
bool softfilter_enable;
|
||||||
|
|
||||||
|
} console;
|
||||||
|
/* Settings and/or global states specific to menus */
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
enum menu_action menu_prev_action;
|
||||||
|
#endif
|
||||||
|
bool launched_from_cli;
|
||||||
|
bool cli_load_menu_on_error;
|
||||||
} global_t;
|
} global_t;
|
||||||
|
|
||||||
typedef struct content_state
|
typedef struct content_state
|
||||||
|
Loading…
x
Reference in New Issue
Block a user