mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
commit
6f424ebc4c
@ -428,6 +428,7 @@ endif
|
||||
|
||||
ifeq ($(HAVE_LAKKA), 1)
|
||||
DEFINES += -DHAVE_LAKKA
|
||||
DEFINES += -DLAKKA_PROJECT=$(LAKKA_PROJECT)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
|
@ -602,6 +602,8 @@ static void config_set_defaults(void)
|
||||
|
||||
#ifdef HAVE_LAKKA
|
||||
settings->ssh_enable = path_file_exists(LAKKA_SSH_PATH);
|
||||
settings->samba_enable = path_file_exists(LAKKA_SAMBA_PATH);
|
||||
settings->bluetooth_enable = path_file_exists(LAKKA_BLUETOOTH_PATH);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
@ -1731,6 +1733,8 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
|
||||
#ifdef HAVE_LAKKA
|
||||
settings->ssh_enable = path_file_exists(LAKKA_SSH_PATH);
|
||||
settings->samba_enable = path_file_exists(LAKKA_SAMBA_PATH);
|
||||
settings->bluetooth_enable = path_file_exists(LAKKA_BLUETOOTH_PATH);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETWORK_GAMEPAD
|
||||
@ -2858,6 +2862,14 @@ bool config_save_file(const char *path)
|
||||
fclose(fopen(LAKKA_SSH_PATH, "w"));
|
||||
else
|
||||
remove(LAKKA_SSH_PATH);
|
||||
if (settings->samba_enable)
|
||||
fclose(fopen(LAKKA_SAMBA_PATH, "w"));
|
||||
else
|
||||
remove(LAKKA_SAMBA_PATH);
|
||||
if (settings->bluetooth_enable)
|
||||
fclose(fopen(LAKKA_BLUETOOTH_PATH, "w"));
|
||||
else
|
||||
remove(LAKKA_BLUETOOTH_PATH);
|
||||
#endif
|
||||
|
||||
config_set_float(conf, "fastforward_ratio", settings->fastforward_ratio);
|
||||
|
@ -402,6 +402,8 @@ typedef struct settings
|
||||
|
||||
#ifdef HAVE_LAKKA
|
||||
bool ssh_enable;
|
||||
bool samba_enable;
|
||||
bool bluetooth_enable;
|
||||
#endif
|
||||
|
||||
} settings_t;
|
||||
|
3
lakka.h
3
lakka.h
@ -18,5 +18,8 @@
|
||||
#define __RARCH_LAKKA_H
|
||||
|
||||
#define LAKKA_SSH_PATH "/storage/.cache/services/sshd.conf"
|
||||
#define LAKKA_SAMBA_PATH "/storage/.cache/services/samba.conf"
|
||||
#define LAKKA_BLUETOOTH_PATH "/storage/.cache/services/bluez.conf"
|
||||
#define LAKKA_UPDATE_DIR "/storage/.update/"
|
||||
|
||||
#endif
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include "../../input/input_remapping.h"
|
||||
#include "../../retroarch.h"
|
||||
#include "../../system.h"
|
||||
#include "../../lakka.h"
|
||||
|
||||
enum
|
||||
{
|
||||
@ -1331,7 +1332,7 @@ static void cb_generic_download(void *task_data,
|
||||
break;
|
||||
}
|
||||
case CB_LAKKA_DOWNLOAD:
|
||||
dir_path = "/storage/.update/"; /* TODO unhardcode this ? */
|
||||
dir_path = LAKKA_UPDATE_DIR;
|
||||
break;
|
||||
default:
|
||||
RARCH_WARN("Unknown transfer type '%u' bailing out.\n",
|
||||
|
@ -264,6 +264,10 @@ static const char *menu_hash_to_str_us_label(uint32_t hash)
|
||||
return "netplay_enable";
|
||||
case MENU_LABEL_SSH_ENABLE:
|
||||
return "ssh_enable";
|
||||
case MENU_LABEL_SAMBA_ENABLE:
|
||||
return "samba_enable";
|
||||
case MENU_LABEL_BLUETOOTH_ENABLE:
|
||||
return "bluetooth_enable";
|
||||
case MENU_LABEL_NETPLAY_DELAY_FRAMES:
|
||||
return "netplay_delay_frames";
|
||||
case MENU_LABEL_NETPLAY_MODE:
|
||||
@ -1012,6 +1016,10 @@ const char *menu_hash_to_str_us(uint32_t hash)
|
||||
return "Netplay Enable";
|
||||
case MENU_LABEL_VALUE_SSH_ENABLE:
|
||||
return "SSH Enable";
|
||||
case MENU_LABEL_VALUE_SAMBA_ENABLE:
|
||||
return "SAMBA Enable";
|
||||
case MENU_LABEL_VALUE_BLUETOOTH_ENABLE:
|
||||
return "Bluetooth Enable";
|
||||
case MENU_LABEL_VALUE_NETPLAY_DELAY_FRAMES:
|
||||
return "Netplay Delay Frames";
|
||||
case MENU_LABEL_VALUE_NETPLAY_MODE:
|
||||
|
@ -401,6 +401,10 @@ extern "C" {
|
||||
#define MENU_LABEL_VALUE_NETPLAY_ENABLE 0xbc3e81a9U
|
||||
#define MENU_LABEL_SSH_ENABLE 0xd9854a79U
|
||||
#define MENU_LABEL_VALUE_SSH_ENABLE 0x0430627aU
|
||||
#define MENU_LABEL_SAMBA_ENABLE 0x379e15efU
|
||||
#define MENU_LABEL_VALUE_SAMBA_ENABLE 0x9846d9b0U
|
||||
#define MENU_LABEL_BLUETOOTH_ENABLE 0xbac1e1e1U
|
||||
#define MENU_LABEL_VALUE_BLUETOOTH_ENABLE 0xf7e31e22U
|
||||
#define MENU_LABEL_NETPLAY_CLIENT_SWAP_INPUT 0xd87bbba9U
|
||||
#define MENU_LABEL_VALUE_NETPLAY_CLIENT_SWAP_INPUT 0x57e5be2dU
|
||||
#define MENU_LABEL_NETPLAY_DELAY_FRAMES 0x86b2c48dU
|
||||
|
@ -3091,19 +3091,35 @@ static void overlay_enable_toggle_change_handler(void *data)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LAKKA
|
||||
|
||||
void lakka_service_toggle(const char *path, bool enable)
|
||||
{
|
||||
if (enable)
|
||||
fclose(fopen(path, "w"));
|
||||
else
|
||||
remove(path);
|
||||
return;
|
||||
}
|
||||
|
||||
static void ssh_enable_toggle_change_handler(void *data)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
rarch_setting_t *setting = (rarch_setting_t *)data;
|
||||
|
||||
if (!setting)
|
||||
return;
|
||||
|
||||
if (settings && settings->ssh_enable)
|
||||
fclose(fopen(LAKKA_SSH_PATH, "w"));
|
||||
else
|
||||
remove(LAKKA_SSH_PATH);
|
||||
|
||||
lakka_service_toggle(LAKKA_SSH_PATH,
|
||||
settings && settings->ssh_enable);
|
||||
return;
|
||||
}
|
||||
static void samba_enable_toggle_change_handler(void *data)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
lakka_service_toggle(LAKKA_SAMBA_PATH,
|
||||
settings && settings->samba_enable);
|
||||
return;
|
||||
}
|
||||
static void bluetooth_enable_toggle_change_handler(void *data)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
lakka_service_toggle(LAKKA_BLUETOOTH_PATH,
|
||||
settings && settings->bluetooth_enable);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@ -6540,6 +6556,37 @@ static bool setting_append_list(
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].change_handler = ssh_enable_toggle_change_handler;
|
||||
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
&settings->samba_enable,
|
||||
menu_hash_to_str(MENU_LABEL_SAMBA_ENABLE),
|
||||
menu_hash_to_str(MENU_LABEL_VALUE_SAMBA_ENABLE),
|
||||
true,
|
||||
menu_hash_to_str(MENU_VALUE_OFF),
|
||||
menu_hash_to_str(MENU_VALUE_ON),
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].change_handler = samba_enable_toggle_change_handler;
|
||||
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
&settings->bluetooth_enable,
|
||||
menu_hash_to_str(MENU_LABEL_BLUETOOTH_ENABLE),
|
||||
menu_hash_to_str(MENU_LABEL_VALUE_BLUETOOTH_ENABLE),
|
||||
true,
|
||||
menu_hash_to_str(MENU_VALUE_OFF),
|
||||
menu_hash_to_str(MENU_VALUE_ON),
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].change_handler = bluetooth_enable_toggle_change_handler;
|
||||
|
||||
END_SUB_GROUP(list, list_info, parent_group);
|
||||
END_GROUP(list, list_info, parent_group);
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user