(Platform) Cleanups + add missing function pointer bind for Darwin

This commit is contained in:
twinaphex 2021-01-16 16:14:03 +01:00
parent 0bba2d45d3
commit 4c51e31b9d
17 changed files with 334 additions and 327 deletions

View File

@ -91,7 +91,7 @@ static void get_first_valid_core(char* path_return, size_t len)
}
#endif
static void frontend_ctr_get_environment_settings(int* argc, char* argv[],
static void frontend_ctr_get_env(int* argc, char* argv[],
void* args, void* params_data)
{
fill_pathname_basedir(g_defaults.dirs[DEFAULT_DIR_PORT], elf_path_cst, sizeof(g_defaults.dirs[DEFAULT_DIR_PORT]));
@ -523,7 +523,7 @@ static int frontend_ctr_get_rating(void)
return -1;
}
enum frontend_architecture frontend_ctr_get_architecture(void)
enum frontend_architecture frontend_ctr_get_arch(void)
{
return FRONTEND_ARCH_ARM;
}
@ -550,12 +550,12 @@ static int frontend_ctr_parse_drive_list(void* data, bool load_content)
return 0;
}
static uint64_t frontend_ctr_get_mem_total(void)
static uint64_t frontend_ctr_get_total_mem(void)
{
return osGetMemRegionSize(MEMREGION_ALL);
}
static uint64_t frontend_ctr_get_mem_free(void)
static uint64_t frontend_ctr_get_free_mem(void)
{
return osGetMemRegionFree(MEMREGION_ALL);
}
@ -644,41 +644,42 @@ static void frontend_ctr_get_name(char* s, size_t len)
frontend_ctx_driver_t frontend_ctx_ctr =
{
frontend_ctr_get_environment_settings,
frontend_ctr_init,
frontend_ctr_deinit,
frontend_ctr_exitspawn,
NULL, /* process_args */
frontend_ctr_exec,
frontend_ctr_get_env, /* get_env */
frontend_ctr_init, /* init */
frontend_ctr_deinit, /* deinit */
frontend_ctr_exitspawn, /* exitspawn */
NULL, /* process_args */
frontend_ctr_exec, /* exec */
#ifdef IS_SALAMANDER
NULL,
NULL, /* set_fork */
#else
frontend_ctr_set_fork,
frontend_ctr_set_fork, /* set_fork */
#endif
frontend_ctr_shutdown,
frontend_ctr_get_name,
frontend_ctr_get_os,
frontend_ctr_get_rating,
NULL, /* load_content */
frontend_ctr_get_architecture,
frontend_ctr_get_powerstate,
frontend_ctr_parse_drive_list,
frontend_ctr_get_mem_total,
frontend_ctr_get_mem_free,
NULL, /* install_signal_handler */
NULL, /* get_signal_handler_state */
NULL, /* set_signal_handler_state */
NULL, /* destroy_signal_handler_state */
NULL, /* attach_console */
NULL, /* detach_console */
NULL, /* get_lakka_version */
NULL, /* set_screen_brightness */
NULL, /* watch_path_for_changes */
NULL, /* check_for_path_changes */
frontend_ctr_shutdown, /* shutdown */
frontend_ctr_get_name, /* get_name */
frontend_ctr_get_os, /* get_os */
frontend_ctr_get_rating, /* get_rating */
NULL, /* load_content */
frontend_ctr_get_arch, /* get_architecture */
frontend_ctr_get_powerstate, /* get_powerstate */
frontend_ctr_parse_drive_list,/* parse_drive_list */
frontend_ctr_get_total_mem, /* get_total_mem */
frontend_ctr_get_free_mem, /* get_free_mem */
NULL, /* install_signal_handler */
NULL, /* get_signal_handler_state */
NULL, /* set_signal_handler_state */
NULL, /* destroy_signal_handler_state */
NULL, /* attach_console */
NULL, /* detach_console */
NULL, /* get_lakka_version */
NULL, /* set_screen_brightness */
NULL, /* watch_path_for_changes */
NULL, /* check_for_path_changes */
NULL, /* set_sustained_performance_mode */
NULL, /* get_cpu_model_name */
NULL, /* get_user_language */
NULL, /* is_narrator_running */
NULL, /* accessibility_speak */
"ctr",
NULL, /* get_cpu_model_name */
NULL, /* get_user_language */
NULL, /* is_narrator_running */
NULL, /* accessibility_speak */
"ctr", /* ident */
NULL /* get_video_driver */
};

View File

@ -333,7 +333,7 @@ static void frontend_darwin_get_os(char *s, size_t len, int *major, int *minor)
#endif
}
static void frontend_darwin_get_environment_settings(int *argc, char *argv[],
static void frontend_darwin_get_env(int *argc, char *argv[],
void *args, void *params_data)
{
CFURLRef bundle_url;
@ -507,7 +507,7 @@ static void frontend_darwin_get_environment_settings(int *argc, char *argv[],
#endif
}
static void frontend_darwin_load_content(void)
static void frontend_darwin_content_loaded(void)
{
ui_companion_driver_notify_content_loaded();
}
@ -703,7 +703,7 @@ end:
return ret;
}
static enum frontend_architecture frontend_darwin_get_architecture(void)
static enum frontend_architecture frontend_darwin_get_arch(void)
{
struct utsname buffer;
@ -766,7 +766,7 @@ static int frontend_darwin_parse_drive_list(void *data, bool load_content)
return ret;
}
static uint64_t frontend_darwin_get_mem_total(void)
static uint64_t frontend_darwin_get_total_mem(void)
{
#if defined(OSX)
uint64_t size;
@ -782,7 +782,7 @@ static uint64_t frontend_darwin_get_mem_total(void)
#endif
}
static uint64_t frontend_darwin_get_mem_used(void)
static uint64_t frontend_darwin_get_free_mem(void)
{
#if (defined(OSX) && !(defined(__ppc__) || defined(__ppc64__)))
vm_size_t page_size;
@ -949,45 +949,47 @@ static bool accessibility_speak_macos(int speed,
#endif
frontend_ctx_driver_t frontend_ctx_darwin = {
frontend_darwin_get_environment_settings,
NULL, /* init */
NULL, /* deinit */
NULL, /* exitspawn */
NULL, /* process_args */
NULL, /* exec */
NULL, /* set_fork */
NULL, /* shutdown */
frontend_darwin_get_name,
frontend_darwin_get_os,
frontend_darwin_get_rating,
frontend_darwin_load_content,
frontend_darwin_get_architecture,
frontend_darwin_get_powerstate,
frontend_darwin_parse_drive_list,
frontend_darwin_get_mem_total,
frontend_darwin_get_mem_used,
NULL, /* install_signal_handler */
NULL, /* get_sighandler_state */
NULL, /* set_sighandler_state */
NULL, /* destroy_signal_handler_state */
NULL, /* attach_console */
NULL, /* detach_console */
NULL, /* get_lakka_version */
NULL, /* watch_path_for_changes */
NULL, /* check_for_path_changes */
NULL, /* set_sustained_performance_mode */
frontend_darwin_get_env, /* get_env */
NULL, /* init */
NULL, /* deinit */
NULL, /* exitspawn */
NULL, /* process_args */
NULL, /* exec */
NULL, /* set_fork */
NULL, /* shutdown */
frontend_darwin_get_name, /* get_name */
frontend_darwin_get_os, /* get_os */
frontend_darwin_get_rating, /* get_rating */
frontend_darwin_content_loaded, /* content_loaded */
frontend_darwin_get_arch, /* get_architecture */
frontend_darwin_get_powerstate, /* get_powerstate */
frontend_darwin_parse_drive_list,/* parse_drive_list */
frontend_darwin_get_total_mem, /* get_total_mem */
frontend_darwin_get_free_mem, /* get_free_mem */
NULL, /* install_signal_handler */
NULL, /* get_sighandler_state */
NULL, /* set_sighandler_state */
NULL, /* destroy_signal_handler_state */
NULL, /* attach_console */
NULL, /* detach_console */
NULL, /* get_lakka_version */
NULL, /* set_screen_brightness */
NULL, /* watch_path_for_changes */
NULL, /* check_for_path_changes */
NULL, /* set_sustained_performance_mode */
#if (defined(OSX) && !(defined(__ppc__) || defined(__ppc64__)))
frontend_darwin_get_cpu_model_name,
frontend_darwin_get_cpu_model_name, /* get_cpu_model_name */
#else
NULL,
NULL, /* get_cpu_model_name */
#endif
NULL, /* get_user_language */
NULL, /* get_user_language */
#if (defined(OSX) && !(defined(__ppc__) || defined(__ppc64__)))
is_narrator_running_macos, /* is_narrator_running */
accessibility_speak_macos, /* accessibility_speak */
is_narrator_running_macos, /* is_narrator_running */
accessibility_speak_macos, /* accessibility_speak */
#else
NULL, /* is_narrator_running */
NULL, /* accessibility_speak */
NULL, /* is_narrator_running */
NULL, /* accessibility_speak */
#endif
"darwin",
"darwin", /* ident */
NULL /* get_video_driver */
};

View File

@ -41,7 +41,7 @@ static int frontend_dos_get_rating(void)
return -1;
}
enum frontend_architecture frontend_dos_get_architecture(void)
enum frontend_architecture frontend_dos_get_arch(void)
{
return FRONTEND_ARCH_X86;
}
@ -189,12 +189,12 @@ frontend_ctx_driver_t frontend_ctx_dos = {
NULL, /* get_name */
NULL, /* get_os */
frontend_dos_get_rating, /* get_rating */
NULL, /* load_content */
frontend_dos_get_architecture,/* get_architecture */
NULL, /* content_loaded */
frontend_dos_get_arch, /* get_architecture */
NULL, /* get_powerstate */
NULL, /* parse_drive_list */
NULL, /* get_mem_total */
NULL, /* get_mem_free */
NULL, /* get_total_mem */
NULL, /* get_free_mem */
NULL, /* install_signal_handler */
NULL, /* get_sighandler_state */
NULL, /* set_sighandler_state */
@ -210,5 +210,6 @@ frontend_ctx_driver_t frontend_ctx_dos = {
NULL, /* get_user_language */
NULL, /* is_narrator_running */
NULL, /* accessibility_speak */
"dos",
"dos", /* ident */
NULL /* get_video_driver */
};

View File

@ -189,8 +189,8 @@ frontend_ctx_driver_t frontend_ctx_emscripten = {
NULL, /* get_architecture */
NULL, /* get_powerstate */
NULL, /* parse_drive_list */
NULL, /* get_mem_total */
NULL, /* get_mem_used */
NULL, /* get_total_mem */
NULL, /* get_free_mem */
NULL, /* install_sighandlers */
NULL, /* get_signal_handler_state */
NULL, /* set_signal_handler_state */
@ -206,5 +206,6 @@ frontend_ctx_driver_t frontend_ctx_emscripten = {
NULL, /* get_user_language */
NULL, /* is_narrator_running */
NULL, /* accessibility_speak */
"emscripten"
"emscripten", /* ident */
NULL /* get_video_driver */
};

View File

@ -156,7 +156,7 @@ static void gx_devthread(void *a)
extern char gx_rom_path[PATH_MAX_LENGTH];
#endif
static void frontend_gx_get_environment_settings(
static void frontend_gx_get_env(
int *argc, char *argv[],
void *args, void *params_data)
{
@ -471,7 +471,7 @@ static int frontend_gx_get_rating(void)
#endif
}
static enum frontend_architecture frontend_gx_get_architecture(void)
static enum frontend_architecture frontend_gx_get_arch(void)
{
return FRONTEND_ARCH_PPC;
}
@ -517,7 +517,7 @@ static void frontend_gx_shutdown(bool unused)
#endif
}
static uint64_t frontend_gx_get_mem_total(void)
static uint64_t frontend_gx_get_total_mem(void)
{
uint64_t total = SYSMEM1_SIZE;
#if defined(HW_RVL) && !defined(IS_SALAMANDER)
@ -526,7 +526,7 @@ static uint64_t frontend_gx_get_mem_total(void)
return total;
}
static uint64_t frontend_gx_get_mem_free(void)
static uint64_t frontend_gx_get_free_mem(void)
{
uint64_t total = SYSMEM1_SIZE - (SYSMEM1_SIZE - SYS_GetArena1Size());
#if defined(HW_RVL) && !defined(IS_SALAMANDER)
@ -536,27 +536,27 @@ static uint64_t frontend_gx_get_mem_free(void)
}
frontend_ctx_driver_t frontend_ctx_gx = {
frontend_gx_get_environment_settings,
frontend_gx_get_env, /* get_env */
frontend_gx_init,
frontend_gx_deinit,
frontend_gx_exitspawn,
frontend_gx_process_args,
frontend_gx_exec,
#if defined(HW_RVL) && !defined(IS_SALAMANDER)
frontend_gx_set_fork,
frontend_gx_set_fork, /* set_fork */
#else
NULL,
NULL, /* set_fork */
#endif
frontend_gx_shutdown,
frontend_gx_shutdown, /* shutdown */
NULL, /* get_name */
NULL, /* get_os */
frontend_gx_get_rating,
frontend_gx_get_rating, /* get_rating */
NULL, /* load_content */
frontend_gx_get_architecture,
frontend_gx_get_arch, /* get_architecture */
NULL, /* get_powerstate */
frontend_gx_parse_drive_list,
frontend_gx_get_mem_total,
frontend_gx_get_mem_free,
frontend_gx_parse_drive_list, /* parse_drive_list */
frontend_gx_get_total_mem, /* get_total_mem */
frontend_gx_get_free_mem, /* get_free_mem */
NULL, /* install_signal_handler */
NULL, /* get_sighandler_state */
NULL, /* set_sighandler_state */
@ -568,9 +568,10 @@ frontend_ctx_driver_t frontend_ctx_gx = {
NULL, /* watch_path_for_changes */
NULL, /* check_for_path_changes */
NULL, /* set_sustained_performance_mode */
NULL, /* get_cpu_model_name */
NULL, /* get_user_language */
NULL, /* is_narrator_running */
NULL, /* accessibility_speak */
"gx",
NULL, /* get_cpu_model_name */
NULL, /* get_user_language */
NULL, /* is_narrator_running */
NULL, /* accessibility_speak */
"gx", /* ident */
NULL /* get_video_driver */
};

View File

@ -95,7 +95,7 @@ int main(int argc, char *argv[])
return rarch_main(argc, argv, NULL);
}
static void frontend_orbis_get_environment_settings(int *argc, char *argv[],
static void frontend_orbis_get_env(int *argc, char *argv[],
void *args, void *params_data)
{
unsigned i;
@ -313,7 +313,7 @@ static int frontend_orbis_get_rating(void)
return 6; /* Go with a conservative figure for now. */
}
enum frontend_architecture frontend_orbis_get_architecture(void)
enum frontend_architecture frontend_orbis_get_arch(void)
{
return FRONTEND_ARCH_X86_64;
}
@ -337,7 +337,7 @@ static int frontend_orbis_parse_drive_list(void *data, bool load_content)
}
frontend_ctx_driver_t frontend_ctx_orbis = {
frontend_orbis_get_environment_settings,
frontend_orbis_get_env,
frontend_orbis_init,
frontend_orbis_deinit,
frontend_orbis_exitspawn,
@ -352,12 +352,12 @@ frontend_ctx_driver_t frontend_ctx_orbis = {
NULL, /* get_name */
NULL, /* get_os */
frontend_orbis_get_rating,
NULL, /* load_content */
frontend_orbis_get_architecture,
NULL, /* content_loaded */
frontend_orbis_get_arch,
NULL,
frontend_orbis_parse_drive_list,
NULL, /* get_mem_total */
NULL, /* get_mem_free */
NULL, /* get_total_mem */
NULL, /* get_free_mem */
NULL, /* install_signal_handler */
NULL, /* get_sighandler_state */
NULL, /* set_sighandler_state */
@ -373,5 +373,6 @@ frontend_ctx_driver_t frontend_ctx_orbis = {
NULL, /* get_user_language */
NULL, /* is_narrator_running */
NULL, /* accessibility_speak */
"orbis",
"orbis", /* ident */
NULL /* get_video_driver */
};

View File

@ -101,7 +101,7 @@ static void reset_IOP()
sbv_patch_disable_prefix_check();
}
static void frontend_ps2_get_environment_settings(int *argc, char *argv[],
static void frontend_ps2_get_env(int *argc, char *argv[],
void *args, void *params_data)
{
int i;
@ -279,16 +279,10 @@ static void frontend_ps2_exitspawn(char *s, size_t len, char *args)
frontend_ps2_exec(s, should_load_content);
}
static void frontend_ps2_shutdown(bool unused)
{
}
static void frontend_ps2_shutdown(bool unused) { }
static int frontend_ps2_get_rating(void) { return 10; }
static int frontend_ps2_get_rating(void)
{
return 10;
}
enum frontend_architecture frontend_ps2_get_architecture(void)
enum frontend_architecture frontend_ps2_get_arch(void)
{
return FRONTEND_ARCH_MIPS;
}
@ -339,27 +333,27 @@ static int frontend_ps2_parse_drive_list(void *data, bool load_content)
}
frontend_ctx_driver_t frontend_ctx_ps2 = {
frontend_ps2_get_environment_settings, /* environment_get */
frontend_ps2_init, /* init */
frontend_ps2_deinit, /* deinit */
frontend_ps2_exitspawn, /* exitspawn */
frontend_ps2_get_env, /* get_env */
frontend_ps2_init, /* init */
frontend_ps2_deinit, /* deinit */
frontend_ps2_exitspawn, /* exitspawn */
NULL, /* process_args */
frontend_ps2_exec, /* exec */
frontend_ps2_exec, /* exec */
#ifdef IS_SALAMANDER
NULL, /* set_fork */
#else
frontend_ps2_set_fork, /* set_fork */
frontend_ps2_set_fork, /* set_fork */
#endif
frontend_ps2_shutdown, /* shutdown */
frontend_ps2_shutdown, /* shutdown */
NULL, /* get_name */
NULL, /* get_os */
frontend_ps2_get_rating, /* get_rating */
frontend_ps2_get_rating, /* get_rating */
NULL, /* load_content */
frontend_ps2_get_architecture, /* get_architecture */
frontend_ps2_get_arch, /* get_architecture */
NULL, /* get_powerstate */
frontend_ps2_parse_drive_list, /* parse_drive_list */
NULL, /* get_mem_total */
NULL, /* get_mem_free */
frontend_ps2_parse_drive_list,/* parse_drive_list */
NULL, /* get_total_mem */
NULL, /* get_free_mem */
NULL, /* install_signal_handler */
NULL, /* get_sighandler_state */
NULL, /* set_sighandler_state */
@ -375,5 +369,6 @@ frontend_ctx_driver_t frontend_ctx_ps2 = {
NULL, /* get_user_language */
NULL, /* is_narrator_running */
NULL, /* accessibility_speak */
"null",
"ps2", /* ident */
NULL /* get_video_driver */
};

View File

@ -178,7 +178,7 @@ static void use_app_path(char *content_info_path)
}
#ifdef __PSL1GHT__
static void frontend_ps3_get_environment_settings(int *argc, char *argv[],
static void frontend_ps3_get_env(int *argc, char *argv[],
void *args, void *params_data)
{
#ifndef IS_SALAMANDER
@ -213,7 +213,7 @@ static void frontend_ps3_get_environment_settings(int *argc, char *argv[],
}
#else
static void frontend_ps3_get_environment_settings(int *argc, char *argv[],
static void frontend_ps3_get_env(int *argc, char *argv[],
void *args, void *params_data)
{
int ret;
@ -579,7 +579,7 @@ static int frontend_ps3_get_rating(void)
return 10;
}
enum frontend_architecture frontend_ps3_get_architecture(void)
enum frontend_architecture frontend_ps3_get_arch(void)
{
return FRONTEND_ARCH_PPC;
}
@ -675,7 +675,7 @@ static void frontend_ps3_process_args(int *argc, char *argv[])
}
frontend_ctx_driver_t frontend_ctx_ps3 = {
frontend_ps3_get_environment_settings,
frontend_ps3_get_env,
frontend_ps3_init,
frontend_ps3_deinit,
frontend_ps3_exitspawn,
@ -689,13 +689,13 @@ frontend_ctx_driver_t frontend_ctx_ps3 = {
NULL, /* shutdown */
NULL, /* get_name */
NULL, /* get_os */
frontend_ps3_get_rating,
frontend_ps3_get_rating, /* get_rating */
NULL, /* load_content */
frontend_ps3_get_architecture,
frontend_ps3_get_arch, /* get_architecture */
NULL, /* get_powerstate */
frontend_ps3_parse_drive_list,
NULL, /* get_mem_total */
NULL, /* get_mem_free */
frontend_ps3_parse_drive_list,/* parse_drive_list */
NULL, /* get_total_mem */
NULL, /* get_free_mem */
NULL, /* install_signal_handler */
NULL, /* get_sighandler_state */
NULL, /* set_sighandler_state */
@ -711,5 +711,6 @@ frontend_ctx_driver_t frontend_ctx_ps3 = {
NULL, /* get_user_language */
NULL, /* is_narrator_running */
NULL, /* accessibility_speak */
"ps3",
"ps3", /* ident */
NULL /* get_video_driver */
};

View File

@ -88,7 +88,7 @@ char user_path[512];
static enum frontend_fork psp_fork_mode = FRONTEND_FORK_NONE;
static void frontend_psp_get_environment_settings(int *argc, char *argv[],
static void frontend_psp_get_env_settings(int *argc, char *argv[],
void *args, void *params_data)
{
unsigned i;
@ -491,7 +491,7 @@ static enum frontend_powerstate frontend_psp_get_powerstate(int *seconds, int *p
return ret;
}
enum frontend_architecture frontend_psp_get_architecture(void)
enum frontend_architecture frontend_psp_get_arch(void)
{
#ifdef VITA
return FRONTEND_ARCH_ARMV7;
@ -608,43 +608,43 @@ enum retro_language frontend_psp_get_user_language(void)
return psp_get_retro_lang_from_langid(langid);
}
static uint64_t frontend_psp_get_mem_total(void)
static uint64_t frontend_psp_get_total_mem(void)
{
return _newlib_heap_end - _newlib_heap_base;
}
static uint64_t frontend_psp_get_mem_free(void)
static uint64_t frontend_psp_get_free_mem(void)
{
return _newlib_heap_end - _newlib_heap_cur;
}
#endif
frontend_ctx_driver_t frontend_ctx_psp = {
frontend_psp_get_environment_settings,
frontend_psp_init,
frontend_psp_deinit,
frontend_psp_exitspawn,
NULL, /* process_args */
frontend_psp_exec,
frontend_psp_get_env_settings,/* get_env_settings */
frontend_psp_init, /* init */
frontend_psp_deinit, /* deinit */
frontend_psp_exitspawn, /* exitspawn */
NULL, /* process_args */
frontend_psp_exec, /* exec */
#ifdef IS_SALAMANDER
NULL,
NULL, /* set_fork */
#else
frontend_psp_set_fork,
frontend_psp_set_fork, /* set_fork */
#endif
frontend_psp_shutdown,
NULL, /* get_name */
NULL, /* get_os */
frontend_psp_get_rating,
NULL, /* load_content */
frontend_psp_get_architecture,
frontend_psp_shutdown, /* shutdown */
NULL, /* get_name */
NULL, /* get_os */
frontend_psp_get_rating, /* get_rating */
NULL, /* content_loaded */
frontend_psp_get_arch, /* get_architecture */
frontend_psp_get_powerstate,
frontend_psp_parse_drive_list,
#ifdef VITA
frontend_psp_get_mem_total,
frontend_psp_get_mem_free,
frontend_psp_get_total_mem,
frontend_psp_get_free_mem,
#else
NULL, /* get_mem_total */
NULL, /* get_mem_free */
NULL, /* get_total_mem */
NULL, /* get_free_mem */
#endif
NULL, /* install_signal_handler */
NULL, /* get_sighandler_state */
@ -659,14 +659,15 @@ frontend_ctx_driver_t frontend_ctx_psp = {
NULL, /* set_sustained_performance_mode */
NULL, /* get_cpu_model_name */
#ifdef VITA
frontend_psp_get_user_language,
frontend_psp_get_user_language, /* get_user_language */
NULL, /* is_narrator_running */
NULL, /* accessibility_speak */
"vita",
"vita", /* ident */
#else
NULL, /* get_user_language */
NULL, /* is_narrator_running */
NULL, /* accessibility_speak */
"psp",
"psp", /* ident */
#endif
NULL /* get_video_driver */
};

View File

@ -52,7 +52,7 @@ static int frontend_qnx_get_rating(void)
return -1;
}
static void frontend_qnx_get_environment_settings(int *argc, char *argv[],
static void frontend_qnx_get_env_settings(int *argc, char *argv[],
void *data, void *params_data)
{
unsigned i;
@ -171,13 +171,13 @@ static void frontend_qnx_get_environment_settings(int *argc, char *argv[],
#endif
}
enum frontend_architecture frontend_qnx_get_architecture(void)
enum frontend_architecture frontend_qnx_get_arch(void)
{
return FRONTEND_ARCH_ARM;
}
frontend_ctx_driver_t frontend_ctx_qnx = {
frontend_qnx_get_environment_settings,
frontend_qnx_get_env_settings,
frontend_qnx_init,
NULL, /* deinit */
NULL, /* exitspawn */
@ -189,11 +189,11 @@ frontend_ctx_driver_t frontend_ctx_qnx = {
NULL, /* get_os */
frontend_qnx_get_rating,
NULL, /* load_content */
frontend_qnx_get_architecture,
frontend_qnx_get_arch, /* get_architecture */
NULL, /* get_powerstate */
NULL, /* parse_drive_list */
NULL, /* get_mem_total */
NULL, /* get_mem_free */
NULL, /* get_total_mem */
NULL, /* get_free_mem */
NULL, /* install_signal_handler */
NULL, /* get_sighandler_state */
NULL, /* set_sighandler_state */
@ -209,5 +209,6 @@ frontend_ctx_driver_t frontend_ctx_qnx = {
NULL, /* get_user_language */
NULL, /* is_narrator_running */
NULL, /* accessibility_speak */
"qnx",
"qnx", /* ident */
NULL /* get_video_driver */
};

View File

@ -177,7 +177,7 @@ static void get_first_valid_core(char *path_return, size_t len)
}
#endif
static void frontend_switch_get_environment_settings(
static void frontend_switch_get_env(
int *argc, char *argv[], void *args, void *params_data)
{
unsigned i;
@ -754,7 +754,7 @@ static int frontend_switch_get_rating(void)
return 11;
}
enum frontend_architecture frontend_switch_get_architecture(void)
enum frontend_architecture frontend_switch_get_arch(void)
{
return FRONTEND_ARCH_ARMV8;
}
@ -779,13 +779,13 @@ static int frontend_switch_parse_drive_list(void *data, bool load_content)
return 0;
}
static uint64_t frontend_switch_get_mem_free(void)
static uint64_t frontend_switch_get_free_mem(void)
{
struct mallinfo mem_info = mallinfo();
return mem_info.fordblks;
}
static uint64_t frontend_switch_get_mem_total(void)
static uint64_t frontend_switch_get_total_mem(void)
{
struct mallinfo mem_info = mallinfo();
return mem_info.usmblks;
@ -892,49 +892,50 @@ void frontend_switch_process_args(int *argc, char *argv[])
}
frontend_ctx_driver_t frontend_ctx_switch =
{
frontend_switch_get_environment_settings,
frontend_switch_init,
frontend_switch_deinit,
{
frontend_switch_get_env,
frontend_switch_init,
frontend_switch_deinit,
#ifdef HAVE_LIBNX
frontend_switch_exitspawn,
frontend_switch_process_args,
frontend_switch_exec,
frontend_switch_exitspawn,
frontend_switch_process_args,
frontend_switch_exec,
#ifdef IS_SALAMANDER
NULL,
NULL,
#else
frontend_switch_set_fork,
frontend_switch_set_fork,
#endif
#else /* HAVE_LIBNX */
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
#endif /* HAVE_LIBNX */
frontend_switch_shutdown,
frontend_switch_get_name,
frontend_switch_get_os,
frontend_switch_get_rating,
NULL, /* load_content */
frontend_switch_get_architecture,
frontend_switch_get_powerstate,
frontend_switch_parse_drive_list,
frontend_switch_get_mem_total,
frontend_switch_get_mem_free,
NULL, /* install_signal_handler */
NULL, /* get_signal_handler_state */
NULL, /* set_signal_handler_state */
NULL, /* destroy_signal_handler_state */
NULL, /* attach_console */
NULL, /* detach_console */
NULL, /* get_lakka_version */
NULL, /* set_screen_brightness */
NULL, /* watch_path_for_changes */
NULL, /* check_for_path_changes */
NULL, /* set_sustained_performance_mode */
NULL, /* get_cpu_model_name */
NULL, /* get_user_language */
NULL, /* is_narrator_running */
NULL, /* accessibility_speak */
"switch",
frontend_switch_shutdown,
frontend_switch_get_name,
frontend_switch_get_os,
frontend_switch_get_rating,
NULL, /* content_loaded */
frontend_switch_get_arch, /* get_architecture */
frontend_switch_get_powerstate, /* get_powerstate */
frontend_switch_parse_drive_list, /* parse_drive_list */
frontend_switch_get_total_mem, /* get_total_mem */
frontend_switch_get_free_mem, /* get_free_mem */
NULL, /* install_signal_handler */
NULL, /* get_signal_handler_state */
NULL, /* set_signal_handler_state */
NULL, /* destroy_signal_handler_state */
NULL, /* attach_console */
NULL, /* detach_console */
NULL, /* get_lakka_version */
NULL, /* set_screen_brightness */
NULL, /* watch_path_for_changes */
NULL, /* check_for_path_changes */
NULL, /* set_sustained_performance_mode */
NULL, /* get_cpu_model_name */
NULL, /* get_user_language */
NULL, /* is_narrator_running */
NULL, /* accessibility_speak */
"switch", /* ident */
NULL /* get_video_driver */
};

View File

@ -2269,7 +2269,7 @@ static void frontend_unix_exitspawn(char *s, size_t len, char *args)
}
#endif
static uint64_t frontend_unix_get_mem_total(void)
static uint64_t frontend_unix_get_total_mem(void)
{
#if defined(DINGUX)
char line[256];
@ -2309,7 +2309,7 @@ static uint64_t frontend_unix_get_mem_total(void)
#endif
}
static uint64_t frontend_unix_get_mem_free(void)
static uint64_t frontend_unix_get_free_mem(void)
{
char line[256];
unsigned long mem_available = 0;
@ -2759,7 +2759,7 @@ end:
#endif
frontend_ctx_driver_t frontend_ctx_unix = {
frontend_unix_get_env, /* environment_get */
frontend_unix_get_env, /* get_env */
frontend_unix_init, /* init */
frontend_unix_deinit, /* deinit */
#ifdef ANDROID
@ -2783,26 +2783,26 @@ frontend_ctx_driver_t frontend_ctx_unix = {
NULL, /* get_name */
#endif
frontend_unix_get_os,
frontend_unix_get_rating, /* get_rating */
NULL, /* load_content */
frontend_unix_get_architecture,
frontend_unix_get_rating, /* get_rating */
NULL, /* content_loaded */
frontend_unix_get_arch, /* get_architecture */
frontend_unix_get_powerstate,
frontend_unix_parse_drive_list,
frontend_unix_get_mem_total,
frontend_unix_get_mem_free,
frontend_unix_get_total_mem,
frontend_unix_get_free_mem,
frontend_unix_install_signal_handlers,
frontend_unix_get_signal_handler_state,
frontend_unix_set_signal_handler_state,
frontend_unix_destroy_signal_handler_state,
NULL, /* attach_console */
NULL, /* detach_console */
NULL, /* attach_console */
NULL, /* detach_console */
#ifdef HAVE_LAKKA
frontend_unix_get_lakka_version, /* get_lakka_version */
#else
NULL, /* get_lakka_version */
NULL, /* get_lakka_version */
#endif
#if defined(HAVE_LAKKA_SWITCH) || (defined(HAVE_LAKKA) && defined(HAVE_ODROIDGO2))
frontend_unix_set_screen_brightness, /* set_screen_brightness */
frontend_unix_set_screen_brightness,/* set_screen_brightness */
#else
NULL, /* set_screen_brightness */
#endif
@ -2812,15 +2812,16 @@ frontend_ctx_driver_t frontend_ctx_unix = {
frontend_unix_get_cpu_model_name,
frontend_unix_get_user_language,
#if (defined(__linux__) || defined(__unix__)) && !defined(ANDROID)
is_narrator_running_unix,
accessibility_speak_unix,
is_narrator_running_unix, /* is_narrator_running */
accessibility_speak_unix, /* accessibility_speak */
#else
NULL, /* is_narrator_running */
NULL, /* accessibility_speak */
#endif
#ifdef ANDROID
"android"
"android", /* ident */
#else
"unix"
"unix", /* ident */
#endif
NULL /* get_video_driver */
};

View File

@ -242,7 +242,7 @@ enum frontend_powerstate frontend_uwp_get_powerstate(
return ret;
}
enum frontend_architecture frontend_uwp_get_architecture(void)
enum frontend_architecture frontend_uwp_get_arch(void)
{
#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0500
/* Windows 2000 and later */
@ -324,7 +324,7 @@ static int frontend_uwp_parse_drive_list(void *data, bool load_content)
return 0;
}
static void frontend_uwp_environment_get(int *argc, char *argv[],
static void frontend_uwp_env_get(int *argc, char *argv[],
void *args, void *params_data)
{
/* On UWP, we have to use the writable directory
@ -402,7 +402,7 @@ static void frontend_uwp_environment_get(int *argc, char *argv[],
#endif
}
static uint64_t frontend_uwp_get_mem_total(void)
static uint64_t frontend_uwp_get_total_mem(void)
{
/* OSes below 2000 don't have the Ex version,
* and non-Ex cannot work with >4GB RAM */
@ -419,7 +419,7 @@ static uint64_t frontend_uwp_get_mem_total(void)
#endif
}
static uint64_t frontend_uwp_get_mem_used(void)
static uint64_t frontend_uwp_get_free_mem(void)
{
/* OSes below 2000 don't have the Ex version,
* and non-Ex cannot work with >4GB RAM */
@ -427,12 +427,12 @@ static uint64_t frontend_uwp_get_mem_used(void)
MEMORYSTATUSEX mem_info;
mem_info.dwLength = sizeof(MEMORYSTATUSEX);
GlobalMemoryStatusEx(&mem_info);
return ((frontend_uwp_get_mem_total() - mem_info.ullAvailPhys));
return ((frontend_uwp_get_total_mem() - mem_info.ullAvailPhys));
#else
MEMORYSTATUS mem_info;
mem_info.dwLength = sizeof(MEMORYSTATUS);
GlobalMemoryStatus(&mem_info);
return ((frontend_uwp_get_mem_total() - mem_info.dwAvailPhys));
return ((frontend_uwp_get_total_mem() - mem_info.dwAvailPhys));
#endif
}
@ -447,8 +447,8 @@ static const char* frontend_uwp_get_cpu_model_name(void)
}
frontend_ctx_driver_t frontend_ctx_uwp = {
frontend_uwp_environment_get,
frontend_uwp_init,
frontend_uwp_env_get, /* env_get */
frontend_uwp_init, /* init */
NULL, /* deinit */
NULL, /* exitspawn */
NULL, /* process_args */
@ -457,13 +457,13 @@ frontend_ctx_driver_t frontend_ctx_uwp = {
NULL, /* shutdown */
NULL, /* get_name */
frontend_uwp_get_os,
NULL, /* get_rating */
NULL, /* load_content */
frontend_uwp_get_architecture,
NULL, /* get_rating */
NULL, /* content_loaded */
frontend_uwp_get_arch, /* get_architecture */
frontend_uwp_get_powerstate,
frontend_uwp_parse_drive_list,
frontend_uwp_get_mem_total,
frontend_uwp_get_mem_used,
frontend_uwp_get_total_mem, /* get_total_mem */
frontend_uwp_get_free_mem, /* get_free_mem */
NULL, /* install_signal_handler */
NULL, /* get_sighandler_state */
NULL, /* set_sighandler_state */
@ -475,9 +475,10 @@ frontend_ctx_driver_t frontend_ctx_uwp = {
NULL, /* watch_path_for_changes */
NULL, /* check_for_path_changes */
NULL, /* set_sustained_performance_mode */
frontend_uwp_get_cpu_model_name,
frontend_uwp_get_user_language,
frontend_uwp_get_cpu_model_name, /* get_cpu_model_name */
frontend_uwp_get_user_language, /* get_user_language */
NULL, /* is_narrator_running */
NULL, /* accessibility_speak */
"uwp"
"uwp", /* ident */
NULL /* get_video_driver */
};

View File

@ -96,7 +96,7 @@ static void fix_asset_directory(void)
rename(src_path_buf, dst_path_buf);
}
static void frontend_wiiu_get_environment_settings(int *argc, char *argv[],
static void frontend_wiiu_get_env_settings(int *argc, char *argv[],
void *args, void *params_data)
{
unsigned i;
@ -159,12 +159,9 @@ static void frontend_wiiu_init(void *data)
DEBUG_LINE();
}
static int frontend_wiiu_get_rating(void)
{
return 10;
}
static int frontend_wiiu_get_rating(void) { return 10; }
enum frontend_architecture frontend_wiiu_get_architecture(void)
enum frontend_architecture frontend_wiiu_get_arch(void)
{
return FRONTEND_ARCH_PPC;
}
@ -298,7 +295,7 @@ static void frontend_wiiu_exitspawn(char *s, size_t len, char *args)
frontend_ctx_driver_t frontend_ctx_wiiu =
{
frontend_wiiu_get_environment_settings,
frontend_wiiu_get_env_settings,
frontend_wiiu_init,
frontend_wiiu_deinit,
frontend_wiiu_exitspawn,
@ -313,29 +310,29 @@ frontend_ctx_driver_t frontend_ctx_wiiu =
NULL, /* get_name */
NULL, /* get_os */
frontend_wiiu_get_rating,
NULL, /* load_content */
frontend_wiiu_get_architecture,
NULL, /* content_loaded */
frontend_wiiu_get_arch, /* get_architecture */
NULL, /* get_powerstate */
frontend_wiiu_parse_drive_list,
NULL, /* get_mem_total */
NULL, /* get_mem_free */
NULL, /* get_total_mem */
NULL, /* get_free_mem */
NULL, /* install_signal_handler */
NULL, /* get_signal_handler_state */
NULL, /* set_signal_handler_state */
NULL, /* destroy_signal_handler_state */
NULL, /* attach_console */
NULL, /* detach_console */
NULL, /* get_lakka_version */
NULL, /* set_screen_brightness */
NULL, /* watch_path_for_changes */
NULL, /* check_for_path_changes */
NULL, /* set_signal_handler_state */
NULL, /* destroy_signal_handler_state */
NULL, /* attach_console */
NULL, /* detach_console */
NULL, /* get_lakka_version */
NULL, /* set_screen_brightness */
NULL, /* watch_path_for_changes */
NULL, /* check_for_path_changes */
NULL, /* set_sustained_performance_mode */
NULL, /* get_cpu_model_name */
NULL, /* get_user_language */
NULL, /* is_narrator_running */
NULL, /* accessibility_speak */
"wiiu",
NULL, /* get_video_driver */
NULL, /* get_cpu_model_name */
NULL, /* get_user_language */
NULL, /* is_narrator_running */
NULL, /* accessibility_speak */
"wiiu", /* ident */
NULL /* get_video_driver */
};
/* main() and its supporting functions */

View File

@ -512,7 +512,7 @@ enum frontend_powerstate frontend_win32_get_powerstate(int *seconds, int *percen
return ret;
}
enum frontend_architecture frontend_win32_get_architecture(void)
enum frontend_architecture frontend_win32_get_arch(void)
{
#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0500
/* Windows 2000 and later */
@ -565,7 +565,7 @@ static int frontend_win32_parse_drive_list(void *data, bool load_content)
return 0;
}
static void frontend_win32_environment_get(int *argc, char *argv[],
static void frontend_win32_env_get(int *argc, char *argv[],
void *args, void *params_data)
{
const char *tmp_dir = getenv("TMP");
@ -1114,9 +1114,9 @@ static bool accessibility_speak_windows(int speed,
#endif
frontend_ctx_driver_t frontend_ctx_win32 = {
frontend_win32_environment_get,
frontend_win32_init,
NULL, /* deinit */
frontend_win32_env_get, /* env_get */
frontend_win32_init, /* init */
NULL, /* deinit */
#if defined(_WIN32) && !defined(_XBOX)
frontend_win32_respawn, /* exitspawn */
#else
@ -1129,35 +1129,36 @@ frontend_ctx_driver_t frontend_ctx_win32 = {
#else
NULL, /* set_fork */
#endif
NULL, /* shutdown */
NULL, /* get_name */
NULL, /* shutdown */
NULL, /* get_name */
frontend_win32_get_os,
NULL, /* get_rating */
NULL, /* load_content */
frontend_win32_get_architecture,
NULL, /* get_rating */
NULL, /* content_loaded */
frontend_win32_get_arch, /* get_architecture */
frontend_win32_get_powerstate,
frontend_win32_parse_drive_list,
frontend_win32_get_total_mem,
frontend_win32_get_free_mem,
NULL, /* install_signal_handler */
NULL, /* get_sighandler_state */
NULL, /* set_sighandler_state */
NULL, /* install_signal_handler */
NULL, /* get_sighandler_state */
NULL, /* set_sighandler_state */
NULL, /* destroy_sighandler_state */
frontend_win32_attach_console, /* attach_console */
frontend_win32_detach_console, /* detach_console */
NULL, /* get_lakka_version */
NULL, /* set_screen_brightness */
NULL, /* watch_path_for_changes */
NULL, /* check_for_path_changes */
frontend_win32_attach_console, /* attach_console */
frontend_win32_detach_console, /* detach_console */
NULL, /* get_lakka_version */
NULL, /* set_screen_brightness */
NULL, /* watch_path_for_changes */
NULL, /* check_for_path_changes */
NULL, /* set_sustained_performance_mode */
frontend_win32_get_cpu_model_name,
frontend_win32_get_user_language,
#if defined(_WIN32) && !defined(_XBOX)
is_narrator_running_windows,
accessibility_speak_windows,
is_narrator_running_windows, /* is_narrator_running */
accessibility_speak_windows, /* accessibility_speak */
#else
NULL, /* is_narrator_running */
NULL, /* accessibility_speak */
NULL, /* is_narrator_running */
NULL, /* accessibility_speak */
#endif
"win32"
"win32", /* ident */
NULL /* get_video_driver */
};

View File

@ -351,7 +351,7 @@ static int frontend_xdk_get_rating(void)
#endif
}
enum frontend_architecture frontend_xdk_get_architecture(void)
enum frontend_architecture frontend_xdk_get_arch(void)
{
#if defined(_XBOX360)
return FRONTEND_ARCH_PPC;
@ -409,27 +409,27 @@ static int frontend_xdk_parse_drive_list(void *data, bool load_content)
}
frontend_ctx_driver_t frontend_ctx_xdk = {
frontend_xdk_get_environment_settings,
frontend_xdk_init,
frontend_xdk_get_env_settings,/* env_settings */
frontend_xdk_init, /* init */
NULL, /* deinit */
frontend_xdk_exitspawn,
frontend_xdk_exitspawn, /* exitspawn */
NULL, /* process_args */
frontend_xdk_exec,
frontend_xdk_exec, /* exec */
#ifdef IS_SALAMANDER
NULL,
NULL, /* set_fork */
#else
frontend_xdk_set_fork,
frontend_xdk_set_fork, /* set_fork */
#endif
NULL, /* shutdown */
NULL, /* get_name */
NULL, /* get_os */
frontend_xdk_get_rating,
NULL, /* load_content */
frontend_xdk_get_architecture,
NULL, /* content_loaded */
frontend_xdk_get_arch, /* get_architecture */
NULL, /* get_powerstate */
frontend_xdk_parse_drive_list,
NULL, /* get_mem_total */
NULL, /* get_mem_free */
frontend_xdk_parse_drive_list,/* parse_drive_list */
NULL, /* get_total_mem */
NULL, /* get_free_mem */
NULL, /* install_signal_handler */
NULL, /* get_sighandler_state */
NULL, /* set_sighandler_state */
@ -445,5 +445,6 @@ frontend_ctx_driver_t frontend_ctx_xdk = {
NULL, /* get_user_language */
NULL, /* is_narrator_running */
NULL, /* accessibility_speak */
"xdk",
"xdk", /* ident */
NULL /* get_video_driver */
};

View File

@ -59,33 +59,32 @@ static int frontend_xenon_get_rating(void)
return -1;
}
static void frontend_xenon_get_environment_settings(int *argc, char *argv[],
void *data, void *params_data)
{
}
static void frontend_xenon_get_env(int *argc, char *argv[],
void *data, void *params_data) { }
enum frontend_architecture frontend_xenon_get_architecture(void)
enum frontend_architecture frontend_xenon_get_arch(void)
{
return FRONTEND_ARCH_PPC;
}
frontend_ctx_driver_t frontend_ctx_qnx = {
frontend_xenon_get_environment_settings,
frontend_xenon_init,
NULL, /* deinit */
frontend_xenon_get_env, /* get_env */
frontend_xenon_init, /* init */
NULL, /* deinit */
NULL, /* exitspawn */
NULL, /* process_args */
NULL, /* exec */
NULL, /* set_fork */
frontend_xenon_shutdown,
frontend_xenon_shutdown, /* shutdown */
NULL, /* get_name */
NULL, /* get_os */
frontend_xenon_get_rating,
frontend_xenon_get_rating, /* get_rating */
NULL, /* load_content */
frontend_xenon_get_architecture,
frontend_xenon_get_arch, /* get_arch */
NULL, /* get_powerstate */
NULL, /* parse_drive_list */
NULL, /* get_mem_total */
NULL, /* get_total_mem */
NULL, /* get_free_mem */
NULL, /* install_signal_handler */
NULL, /* get_sighandler_state */
NULL, /* set_sighandler_state */
@ -101,5 +100,6 @@ frontend_ctx_driver_t frontend_ctx_qnx = {
NULL, /* get_user_language */
NULL, /* is_narrator_running */
NULL, /* accessibility_speak */
"xenon",
"xenon", /* ident */
NULL /* get_video_driver */
};