mirror of
				https://github.com/libretro/Lakka-LibreELEC.git
				synced 2025-11-04 04:28:54 +00:00 
			
		
		
		
	* Switch: Minor kernel config update
* fat32-boot: Attempt to fix umounting flash partition to prevent possible corruption on reboot
* Switch: Bootloader: Fix mistake in boot.txt that wasnt properly setting up dvfsb stuff
* Switch: Add user for retroarch to run as
* Busybox: Fix writing flash partition when using fat32-boot option to give all users write access
* Audio: Pulseaudio-configs: Minor updates for use when running apps as non root user
* Switch: Finalize changes so for running as non root user.
* Retroarch: Revert broken WAR in retroarch-config script
* Switch: Fix default retroarch config, to work out of box with new user
* Fix retroarch controller configs for switch, and add line to fix it to the update.sh file
* Add back missing lite gamepad config, which got lost in a rebase somewhere
* Retroarch: Start Reworking Switch Clocks
* Switch: Bump switch specific package versions, and add changes needed to make built in lakka clock speed menu work properly. Also hide gamemode.
* Retroarch: add patch to remove game mode from menu to all builds
* Switch: dont enable overclock by default
* sort
* Sort me.
* Switch: Drop old flycast from switch build in favor of newer core.
This has some issues with some games showing artifact bars using vulkan renderer,
but also fixes a lot of issues. As a work around to this issue, users can set opengl renderer, and the bars will not be there.
* More to sort
* Fix CEC stuff
* Fix dock audio switching with new user config
* WIP: GPU Clocks
* sort
* fix quotes
* Add working single joycon configs
* Update Switch Joycond to latest
* Switch: Retroarch: add bluetooth ertm disable, and add patch to fix l2cap kernel hang
* Switch: Update image stuff, so kernel reflects Lakka/Libreelec kernel makes in uimage header, and re-arange some things to make them global
* Switch: Linux: Enable Xpad Driver for wired xbox controllers
* Switch: More xpadneo stuff
This should at a minimum fix issues with Xbox One S controllers
8bitdo and GuliKit KingKong Controller families will probably need more
hid-core patching to redirect them to this driver for support.
Also, when 0.10 version of Xpadneo is released, It will stop building due to kernel not having this patch:
f07b3c1da9
When the time comes, this will need to be looked into.
* xpadneo: update package
* Switch: Update U-Boot to Switchroot 2023-NX03 version
* Switch: Update kernel to Switchroot 5.1.0
* Switch: Create Singular switch-bsp Package
This package consolodates the switch specific configs into one package,
as this feels cleaner, and easier to deal with later, if/when needed.
This package combines the switch-alsa-ucm and switch-bluetooth-dock stuff
into one package.
---------
Co-authored-by: Tomáš Kelemen (vudiq) <vudiq@vudiq.sk>
		
	
		
			
				
	
	
		
			480 lines
		
	
	
		
			20 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			480 lines
		
	
	
		
			20 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
From f1898216c4aaf2a6f508ff04e88503137b627248 Mon Sep 17 00:00:00 2001
 | 
						|
From: Ronald Brown <rbrown4014@yahoo.com>
 | 
						|
Date: Mon, 30 Jan 2023 08:47:30 -0800
 | 
						|
Subject: [PATCH 4/7] Lakka: Switch: Add Nintendo Switch Options List, with
 | 
						|
 first option to enable overclocking.
 | 
						|
 | 
						|
---
 | 
						|
 configuration.h                   |  3 ++
 | 
						|
 intl/msg_hash_lbl.h               | 15 +++++++
 | 
						|
 intl/msg_hash_us.h                | 18 ++++++++
 | 
						|
 lakka-switch.h                    | 21 ++++++++++
 | 
						|
 menu/cbs/menu_cbs_deferred_push.c |  6 +++
 | 
						|
 menu/cbs/menu_cbs_ok.c            | 13 ++++++
 | 
						|
 menu/cbs/menu_cbs_sublabel.c      | 12 ++++++
 | 
						|
 menu/cbs/menu_cbs_title.c         |  6 +++
 | 
						|
 menu/menu_cbs.h                   |  1 +
 | 
						|
 menu/menu_displaylist.c           | 23 +++++++++++
 | 
						|
 menu/menu_displaylist.h           |  3 ++
 | 
						|
 menu/menu_setting.c               | 68 +++++++++++++++++++++++++++++--
 | 
						|
 msg_hash.h                        |  7 ++++
 | 
						|
 13 files changed, 193 insertions(+), 3 deletions(-)
 | 
						|
 create mode 100644 lakka-switch.h
 | 
						|
 | 
						|
diff --git a/configuration.h b/configuration.h
 | 
						|
index 3619ca7f0a..69984fed87 100644
 | 
						|
--- a/configuration.h
 | 
						|
+++ b/configuration.h
 | 
						|
@@ -931,6 +931,9 @@ typedef struct settings
 | 
						|
       bool screenshots_in_content_dir;
 | 
						|
       bool systemfiles_in_content_dir;
 | 
						|
       bool ssh_enable;
 | 
						|
+#ifdef HAVE_LAKKA_SWITCH
 | 
						|
+      bool switch_oc;
 | 
						|
+#endif
 | 
						|
       bool samba_enable;
 | 
						|
       bool bluetooth_enable;
 | 
						|
       bool localap_enable;
 | 
						|
diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h
 | 
						|
index fbc3326315..fbe296a792 100644
 | 
						|
--- a/intl/msg_hash_lbl.h
 | 
						|
+++ b/intl/msg_hash_lbl.h
 | 
						|
@@ -3481,6 +3481,21 @@ MSG_HASH(
 | 
						|
    "ssh_enable"
 | 
						|
    )
 | 
						|
 #endif
 | 
						|
+
 | 
						|
+#ifdef HAVE_LAKKA_SWITCH
 | 
						|
+MSG_HASH(
 | 
						|
+   MENU_ENUM_LABEL_DEFERRED_LAKKA_SWITCH_OPTIONS_LIST,
 | 
						|
+   "deferred_lakka_switch_options_list"
 | 
						|
+   )
 | 
						|
+MSG_HASH(
 | 
						|
+   MENU_ENUM_LABEL_LAKKA_SWITCH_OPTIONS,
 | 
						|
+   "Switch_Options"
 | 
						|
+   )
 | 
						|
+MSG_HASH(
 | 
						|
+   MENU_ENUM_LABEL_SWITCH_OC_ENABLE,
 | 
						|
+   "Switch_OC_enable"
 | 
						|
+   )
 | 
						|
+#endif
 | 
						|
 MSG_HASH(
 | 
						|
    MENU_ENUM_LABEL_START_CORE,
 | 
						|
    "start_core"
 | 
						|
diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h
 | 
						|
index 85db8480fd..062b454d0a 100644
 | 
						|
--- a/intl/msg_hash_us.h
 | 
						|
+++ b/intl/msg_hash_us.h
 | 
						|
@@ -14971,6 +14971,24 @@ MSG_HASH(
 | 
						|
    MENU_ENUM_LABEL_HELP_TIMEZONE,
 | 
						|
    "Displays a list of available timezones. After selecting a time zone, time and date is adjusted to the selected time zone. It assumes, that system/hardware clock is set to UTC."
 | 
						|
    )
 | 
						|
+#ifdef HAVE_LAKKA_SWITCH
 | 
						|
+MSG_HASH(
 | 
						|
+   MENU_ENUM_LABEL_VALUE_LAKKA_SWITCH_OPTIONS,
 | 
						|
+   "Nintendo Switch Options"
 | 
						|
+   )
 | 
						|
+MSG_HASH(
 | 
						|
+   MENU_ENUM_SUBLABEL_LAKKA_SWITCH_OPTIONS,
 | 
						|
+   "Manage Nintendo Switch Specific Options."
 | 
						|
+   )
 | 
						|
+MSG_HASH(
 | 
						|
+   MENU_ENUM_LABEL_VALUE_SWITCH_OC_ENABLE,
 | 
						|
+   "CPU Overclock"
 | 
						|
+   )
 | 
						|
+MSG_HASH(
 | 
						|
+   MENU_ENUM_SUBLABEL_SWITCH_OC_ENABLE,
 | 
						|
+   "Enable CPU Overclock frequencies"
 | 
						|
+   )
 | 
						|
+#endif
 | 
						|
 MSG_HASH(
 | 
						|
    MSG_LOCALAP_SWITCHING_OFF,
 | 
						|
    "Switching off Wi-Fi Access Point."
 | 
						|
diff --git a/lakka-switch.h b/lakka-switch.h
 | 
						|
new file mode 100644
 | 
						|
index 0000000000..7525b22286
 | 
						|
--- /dev/null
 | 
						|
+++ b/lakka-switch.h
 | 
						|
@@ -0,0 +1,21 @@
 | 
						|
+/*  RetroArch - A frontend for libretro.
 | 
						|
+ *  Copyright (C) 2023 - Gavin_Darkglider
 | 
						|
+ * 
 | 
						|
+ *  RetroArch is free software: you can redistribute it and/or modify it under the terms
 | 
						|
+ *  of the GNU General Public License as published by the Free Software Found-
 | 
						|
+ *  ation, either version 3 of the License, or (at your option) any later version.
 | 
						|
+ *
 | 
						|
+ *  RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 | 
						|
+ *  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 | 
						|
+ *  PURPOSE.  See the GNU General Public License for more details.
 | 
						|
+ *
 | 
						|
+ *  You should have received a copy of the GNU General Public License along with RetroArch.
 | 
						|
+ *  If not, see <http://www.gnu.org/licenses/>.
 | 
						|
+ */
 | 
						|
+
 | 
						|
+#ifndef __RARCH_LAKKA_SWITCH_H
 | 
						|
+#define __RARCH_LAKKA_SWITCH_H
 | 
						|
+
 | 
						|
+#define SWITCH_OC_TOGGLE_PATH "/sys/kernel/tegra_cpufreq/overclock"
 | 
						|
+
 | 
						|
+#endif
 | 
						|
diff --git a/menu/cbs/menu_cbs_deferred_push.c b/menu/cbs/menu_cbs_deferred_push.c
 | 
						|
index 17c53d8758..ae9fca0fd7 100644
 | 
						|
--- a/menu/cbs/menu_cbs_deferred_push.c
 | 
						|
+++ b/menu/cbs/menu_cbs_deferred_push.c
 | 
						|
@@ -218,6 +218,9 @@ GENERIC_DEFERRED_PUSH(deferred_push_netplay_kick_list,              DISPLAYLIST_
 | 
						|
 GENERIC_DEFERRED_PUSH(deferred_push_netplay_ban_list,               DISPLAYLIST_NETPLAY_BAN_LIST)
 | 
						|
 GENERIC_DEFERRED_PUSH(deferred_push_netplay_lobby_filters_list,     DISPLAYLIST_NETPLAY_LOBBY_FILTERS_LIST)
 | 
						|
 GENERIC_DEFERRED_PUSH(deferred_push_lakka_services_list,            DISPLAYLIST_LAKKA_SERVICES_LIST)
 | 
						|
+#ifdef HAVE_LAKKA_SWITCH
 | 
						|
+GENERIC_DEFERRED_PUSH(deferred_push_lakka_switch_options_list,      DISPLAYLIST_LAKKA_SWITCH_OPTIONS_LIST)
 | 
						|
+#endif
 | 
						|
 GENERIC_DEFERRED_PUSH(deferred_push_user_settings_list,             DISPLAYLIST_USER_SETTINGS_LIST)
 | 
						|
 GENERIC_DEFERRED_PUSH(deferred_push_directory_settings_list,        DISPLAYLIST_DIRECTORY_SETTINGS_LIST)
 | 
						|
 GENERIC_DEFERRED_PUSH(deferred_push_privacy_settings_list,          DISPLAYLIST_PRIVACY_SETTINGS_LIST)
 | 
						|
@@ -737,6 +740,9 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
 | 
						|
       {MENU_ENUM_LABEL_DEFERRED_WIFI_SETTINGS_LIST, deferred_push_wifi_settings_list},
 | 
						|
       {MENU_ENUM_LABEL_DEFERRED_WIFI_NETWORKS_LIST, deferred_push_wifi_networks_list},
 | 
						|
       {MENU_ENUM_LABEL_DEFERRED_LAKKA_SERVICES_LIST, deferred_push_lakka_services_list},
 | 
						|
+#ifdef HAVE_LAKKA_SWITCH
 | 
						|
+      {MENU_ENUM_LABEL_DEFERRED_LAKKA_SWITCH_OPTIONS_LIST, deferred_push_lakka_switch_options_list},
 | 
						|
+#endif
 | 
						|
       {MENU_ENUM_LABEL_DEFERRED_USER_SETTINGS_LIST, deferred_push_user_settings_list},
 | 
						|
       {MENU_ENUM_LABEL_DEFERRED_DIRECTORY_SETTINGS_LIST, deferred_push_directory_settings_list},
 | 
						|
       {MENU_ENUM_LABEL_DEFERRED_PRIVACY_SETTINGS_LIST, deferred_push_privacy_settings_list},
 | 
						|
diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c
 | 
						|
index 6104dc6e37..668d49b8ff 100644
 | 
						|
--- a/menu/cbs/menu_cbs_ok.c
 | 
						|
+++ b/menu/cbs/menu_cbs_ok.c
 | 
						|
@@ -447,6 +447,10 @@ static enum msg_hash_enums action_ok_dl_to_enum(unsigned lbl)
 | 
						|
          return MENU_ENUM_LABEL_DEFERRED_NETPLAY_LAN_SCAN_SETTINGS_LIST;
 | 
						|
       case ACTION_OK_DL_LAKKA_SERVICES_LIST:
 | 
						|
          return MENU_ENUM_LABEL_DEFERRED_LAKKA_SERVICES_LIST;
 | 
						|
+#ifdef HAVE_LAKKA_SWITCH
 | 
						|
+      case ACTION_OK_DL_LAKKA_SWITCH_OPTIONS_LIST:
 | 
						|
+         return MENU_ENUM_LABEL_DEFERRED_LAKKA_SWITCH_OPTIONS_LIST;
 | 
						|
+#endif
 | 
						|
       case ACTION_OK_DL_USER_SETTINGS_LIST:
 | 
						|
          return MENU_ENUM_LABEL_DEFERRED_USER_SETTINGS_LIST;
 | 
						|
       case ACTION_OK_DL_DIRECTORY_SETTINGS_LIST:
 | 
						|
@@ -1662,6 +1666,9 @@ int generic_action_ok_displaylist_push(const char *path,
 | 
						|
       case ACTION_OK_DL_NETPLAY:
 | 
						|
       case ACTION_OK_DL_NETPLAY_LAN_SCAN_SETTINGS_LIST:
 | 
						|
       case ACTION_OK_DL_LAKKA_SERVICES_LIST:
 | 
						|
+#ifdef HAVE_LAKKA_SWITCH
 | 
						|
+      case ACTION_OK_DL_LAKKA_SWITCH_OPTIONS_LIST:
 | 
						|
+#endif
 | 
						|
       case ACTION_OK_DL_USER_SETTINGS_LIST:
 | 
						|
       case ACTION_OK_DL_DIRECTORY_SETTINGS_LIST:
 | 
						|
       case ACTION_OK_DL_PRIVACY_SETTINGS_LIST:
 | 
						|
@@ -5888,6 +5895,9 @@ DEFAULT_ACTION_OK_FUNC(action_ok_cheevos_appearance_list, ACTION_OK_DL_CHEEVOS_A
 | 
						|
 DEFAULT_ACTION_OK_FUNC(action_ok_cheevos_visibility_list, ACTION_OK_DL_CHEEVOS_VISIBILITY_SETTINGS_LIST)
 | 
						|
 DEFAULT_ACTION_OK_FUNC(action_ok_updater_list, ACTION_OK_DL_UPDATER_SETTINGS_LIST)
 | 
						|
 DEFAULT_ACTION_OK_FUNC(action_ok_lakka_services, ACTION_OK_DL_LAKKA_SERVICES_LIST)
 | 
						|
+#ifdef HAVE_LAKKA_SWITCH
 | 
						|
+DEFAULT_ACTION_OK_FUNC(action_ok_lakka_switch_options, ACTION_OK_DL_LAKKA_SWITCH_OPTIONS_LIST)
 | 
						|
+#endif
 | 
						|
 DEFAULT_ACTION_OK_FUNC(action_ok_user_list, ACTION_OK_DL_USER_SETTINGS_LIST)
 | 
						|
 DEFAULT_ACTION_OK_FUNC(action_ok_netplay_sublist, ACTION_OK_DL_NETPLAY)
 | 
						|
 DEFAULT_ACTION_OK_FUNC(action_ok_directory_list, ACTION_OK_DL_DIRECTORY_SETTINGS_LIST)
 | 
						|
@@ -8485,6 +8495,9 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
 | 
						|
          {MENU_ENUM_LABEL_SUBSYSTEM_SETTINGS,                  action_ok_subsystem_list},
 | 
						|
          {MENU_ENUM_LABEL_NETWORK_SETTINGS,                    action_ok_network_list},
 | 
						|
          {MENU_ENUM_LABEL_LAKKA_SERVICES,                      action_ok_lakka_services},
 | 
						|
+#ifdef HAVE_LAKKA_SWITCH
 | 
						|
+         {MENU_ENUM_LABEL_LAKKA_SWITCH_OPTIONS,                action_ok_lakka_switch_options},
 | 
						|
+#endif
 | 
						|
          {MENU_ENUM_LABEL_NETPLAY_SETTINGS,                    action_ok_netplay_sublist},
 | 
						|
          {MENU_ENUM_LABEL_USER_SETTINGS,                       action_ok_user_list},
 | 
						|
          {MENU_ENUM_LABEL_DIRECTORY_SETTINGS,                  action_ok_directory_list},
 | 
						|
diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c
 | 
						|
index 3344b0a4da..d3e5a46d74 100644
 | 
						|
--- a/menu/cbs/menu_cbs_sublabel.c
 | 
						|
+++ b/menu/cbs/menu_cbs_sublabel.c
 | 
						|
@@ -366,6 +366,10 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_bluetooth_enable,              MENU_
 | 
						|
 DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_localap_enable,                MENU_ENUM_SUBLABEL_LOCALAP_ENABLE )
 | 
						|
 DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_timezone,                      MENU_ENUM_SUBLABEL_TIMEZONE)
 | 
						|
 #endif
 | 
						|
+#ifdef HAVE_LAKKA_SWITCH
 | 
						|
+DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_switch_options,                MENU_ENUM_SUBLABEL_LAKKA_SWITCH_OPTIONS)
 | 
						|
+DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_switch_oc_enable,              MENU_ENUM_SUBLABEL_SWITCH_OC_ENABLE)
 | 
						|
+#endif
 | 
						|
 DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_user_language,                 MENU_ENUM_SUBLABEL_USER_LANGUAGE)
 | 
						|
 DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_max_swapchain_images,          MENU_ENUM_SUBLABEL_VIDEO_MAX_SWAPCHAIN_IMAGES)
 | 
						|
 DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_waitable_swapchains,           MENU_ENUM_SUBLABEL_VIDEO_WAITABLE_SWAPCHAINS)
 | 
						|
@@ -4856,6 +4860,14 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
 | 
						|
          case MENU_ENUM_LABEL_CPU_PERF_MODE:
 | 
						|
             BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_cpu_perf_mode);
 | 
						|
             break;
 | 
						|
+#endif
 | 
						|
+#ifdef HAVE_LAKKA_SWITCH
 | 
						|
+         case MENU_ENUM_LABEL_LAKKA_SWITCH_OPTIONS:
 | 
						|
+            BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_switch_options);
 | 
						|
+            break;
 | 
						|
+         case MENU_ENUM_LABEL_SWITCH_OC_ENABLE:
 | 
						|
+            BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_switch_oc_enable);
 | 
						|
+            break;
 | 
						|
 #endif
 | 
						|
          case MENU_ENUM_LABEL_USER_LANGUAGE:
 | 
						|
             BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_user_language);
 | 
						|
diff --git a/menu/cbs/menu_cbs_title.c b/menu/cbs/menu_cbs_title.c
 | 
						|
index b24d740949..905722736c 100644
 | 
						|
--- a/menu/cbs/menu_cbs_title.c
 | 
						|
+++ b/menu/cbs/menu_cbs_title.c
 | 
						|
@@ -672,6 +672,9 @@ DEFAULT_TITLE_MACRO(action_get_netplay_lan_scan_settings_list,  MENU_ENUM_LABEL_
 | 
						|
 #ifdef HAVE_LAKKA
 | 
						|
 DEFAULT_TITLE_MACRO(action_get_lakka_services_list,             MENU_ENUM_LABEL_VALUE_LAKKA_SERVICES)
 | 
						|
 #endif
 | 
						|
+#ifdef HAVE_LAKKA_SWITCH
 | 
						|
+DEFAULT_TITLE_MACRO(action_get_lakka_switch_options_list,       MENU_ENUM_LABEL_VALUE_LAKKA_SWITCH_OPTIONS)
 | 
						|
+#endif
 | 
						|
 DEFAULT_TITLE_MACRO(action_get_user_settings_list,              MENU_ENUM_LABEL_VALUE_USER_SETTINGS)
 | 
						|
 DEFAULT_TITLE_MACRO(action_get_directory_settings_list,         MENU_ENUM_LABEL_VALUE_DIRECTORY_SETTINGS)
 | 
						|
 DEFAULT_TITLE_MACRO(action_get_privacy_settings_list,           MENU_ENUM_LABEL_VALUE_PRIVACY_SETTINGS)
 | 
						|
@@ -1031,6 +1034,9 @@ static int menu_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs,
 | 
						|
       {MENU_ENUM_LABEL_DEFERRED_NETPLAY_LAN_SCAN_SETTINGS_LIST,       action_get_netplay_lan_scan_settings_list},
 | 
						|
 #ifdef HAVE_LAKKA
 | 
						|
       {MENU_ENUM_LABEL_DEFERRED_LAKKA_SERVICES_LIST,                  action_get_lakka_services_list},
 | 
						|
+#endif
 | 
						|
+#ifdef HAVE_LAKKA_SWITCH
 | 
						|
+      {MENU_ENUM_LABEL_DEFERRED_LAKKA_SWITCH_OPTIONS_LIST,            action_get_lakka_switch_options_list},
 | 
						|
 #endif
 | 
						|
       {MENU_ENUM_LABEL_DEFERRED_USER_SETTINGS_LIST,                   action_get_user_settings_list},
 | 
						|
       {MENU_ENUM_LABEL_DEFERRED_DIRECTORY_SETTINGS_LIST,              action_get_directory_settings_list},
 | 
						|
diff --git a/menu/menu_cbs.h b/menu/menu_cbs.h
 | 
						|
index 85a5e95561..57f11cf23b 100644
 | 
						|
--- a/menu/menu_cbs.h
 | 
						|
+++ b/menu/menu_cbs.h
 | 
						|
@@ -217,6 +217,7 @@ enum
 | 
						|
    ACTION_OK_DL_NETPLAY_LOBBY_FILTERS_LIST,
 | 
						|
    ACTION_OK_DL_NETPLAY_LAN_SCAN_SETTINGS_LIST,
 | 
						|
    ACTION_OK_DL_LAKKA_SERVICES_LIST,
 | 
						|
+   ACTION_OK_DL_LAKKA_SWITCH_OPTIONS_LIST,
 | 
						|
    ACTION_OK_DL_USER_SETTINGS_LIST,
 | 
						|
    ACTION_OK_DL_DIRECTORY_SETTINGS_LIST,
 | 
						|
    ACTION_OK_DL_PRIVACY_SETTINGS_LIST,
 | 
						|
diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c
 | 
						|
index f6af4a9148..8544609b38 100644
 | 
						|
--- a/menu/menu_displaylist.c
 | 
						|
+++ b/menu/menu_displaylist.c
 | 
						|
@@ -9099,6 +9099,23 @@ unsigned menu_displaylist_build_list(
 | 
						|
             }
 | 
						|
          }
 | 
						|
          break;
 | 
						|
+#endif
 | 
						|
+#ifdef HAVE_LAKKA_SWITCH
 | 
						|
+      case DISPLAYLIST_LAKKA_SWITCH_OPTIONS_LIST:
 | 
						|
+         {
 | 
						|
+            menu_displaylist_build_info_t build_list[] = {
 | 
						|
+               {MENU_ENUM_LABEL_SWITCH_OC_ENABLE,                                            PARSE_ONLY_BOOL},
 | 
						|
+            };
 | 
						|
+
 | 
						|
+            for (i = 0; i < ARRAY_SIZE(build_list); i++)
 | 
						|
+            {
 | 
						|
+               if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list,
 | 
						|
+                        build_list[i].enum_idx,  build_list[i].parse_type,
 | 
						|
+                        false) == 0)
 | 
						|
+                  count++;
 | 
						|
+            }
 | 
						|
+         }
 | 
						|
+         break;
 | 
						|
 #endif
 | 
						|
       case DISPLAYLIST_MENU_VIEWS_SETTINGS_LIST:
 | 
						|
          {
 | 
						|
@@ -9854,6 +9871,9 @@ unsigned menu_displaylist_build_list(
 | 
						|
                {MENU_ENUM_LABEL_NETPLAY_LAN_SCAN_SETTINGS,   PARSE_ACTION, true},
 | 
						|
 #endif
 | 
						|
                {MENU_ENUM_LABEL_LAKKA_SERVICES,              PARSE_ACTION, true},
 | 
						|
+#ifdef HAVE_LAKKA_SWITCH
 | 
						|
+               {MENU_ENUM_LABEL_LAKKA_SWITCH_OPTIONS,        PARSE_ACTION, true},
 | 
						|
+#endif
 | 
						|
                {MENU_ENUM_LABEL_PLAYLIST_SETTINGS,           PARSE_ACTION, true},
 | 
						|
                {MENU_ENUM_LABEL_USER_SETTINGS,               PARSE_ACTION, true},
 | 
						|
                {MENU_ENUM_LABEL_DIRECTORY_SETTINGS,          PARSE_ACTION, true},
 | 
						|
@@ -13258,6 +13278,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
 | 
						|
       case DISPLAYLIST_MENU_FILE_BROWSER_SETTINGS_LIST:
 | 
						|
       case DISPLAYLIST_MENU_VIEWS_SETTINGS_LIST:
 | 
						|
       case DISPLAYLIST_LAKKA_SERVICES_LIST:
 | 
						|
+#ifdef HAVE_LAKKA_SWITCH
 | 
						|
+      case DISPLAYLIST_LAKKA_SWITCH_OPTIONS_LIST:
 | 
						|
+#endif
 | 
						|
       case DISPLAYLIST_MIDI_SETTINGS_LIST:
 | 
						|
       case DISPLAYLIST_CRT_SWITCHRES_SETTINGS_LIST:
 | 
						|
       case DISPLAYLIST_VIDEO_FULLSCREEN_MODE_SETTINGS_LIST:
 | 
						|
diff --git a/menu/menu_displaylist.h b/menu/menu_displaylist.h
 | 
						|
index af54c0cb7b..44b2f068af 100644
 | 
						|
--- a/menu/menu_displaylist.h
 | 
						|
+++ b/menu/menu_displaylist.h
 | 
						|
@@ -230,6 +230,9 @@ enum menu_displaylist_ctl_state
 | 
						|
    DISPLAYLIST_NETPLAY_LOBBY_FILTERS_LIST,
 | 
						|
    DISPLAYLIST_NETPLAY_LAN_SCAN_SETTINGS_LIST,
 | 
						|
    DISPLAYLIST_LAKKA_SERVICES_LIST,
 | 
						|
+#ifdef HAVE_LAKKA_SWITCH
 | 
						|
+   DISPLAYLIST_LAKKA_SWITCH_OPTIONS_LIST,
 | 
						|
+#endif
 | 
						|
    DISPLAYLIST_USER_SETTINGS_LIST,
 | 
						|
    DISPLAYLIST_DIRECTORY_SETTINGS_LIST,
 | 
						|
    DISPLAYLIST_PRIVACY_SETTINGS_LIST,
 | 
						|
diff --git a/menu/menu_setting.c b/menu/menu_setting.c
 | 
						|
index 89fdda3fe9..09af706203 100644
 | 
						|
--- a/menu/menu_setting.c
 | 
						|
+++ b/menu/menu_setting.c
 | 
						|
@@ -21,7 +21,6 @@
 | 
						|
 #else
 | 
						|
 #include <unistd.h>
 | 
						|
 #endif
 | 
						|
-
 | 
						|
 #include <libretro.h>
 | 
						|
 #include <lists/file_list.h>
 | 
						|
 #include <file/file_path.h>
 | 
						|
@@ -98,6 +97,9 @@
 | 
						|
 #include "../performance_counters.h"
 | 
						|
 #include "../setting_list.h"
 | 
						|
 #include "../lakka.h"
 | 
						|
+#ifdef HAVE_LAKKA_SWITCH
 | 
						|
+#include "../lakka-switch.h"
 | 
						|
+#endif 
 | 
						|
 #include "../retroarch.h"
 | 
						|
 #include "../gfx/video_display_server.h"
 | 
						|
 #ifdef HAVE_CHEATS
 | 
						|
@@ -311,6 +313,9 @@ enum settings_list_type
 | 
						|
    SETTINGS_LIST_CORE_UPDATER,
 | 
						|
    SETTINGS_LIST_NETPLAY,
 | 
						|
    SETTINGS_LIST_LAKKA_SERVICES,
 | 
						|
+#ifdef HAVE_LAKKA_SWITCH
 | 
						|
+   SETTINGS_LIST_LAKKA_SWITCH_OPTIONS,
 | 
						|
+#endif
 | 
						|
    SETTINGS_LIST_USER,
 | 
						|
    SETTINGS_LIST_USER_ACCOUNTS,
 | 
						|
    SETTINGS_LIST_USER_ACCOUNTS_CHEEVOS,
 | 
						|
@@ -9067,6 +9072,19 @@ static void systemd_service_toggle(const char *path, char *unit, bool enable)
 | 
						|
    }
 | 
						|
 }
 | 
						|
 
 | 
						|
+#ifdef HAVE_LAKKA_SWITCH
 | 
						|
+static void switch_oc_enable_toggle_change_handler(rarch_setting_t *setting)
 | 
						|
+{
 | 
						|
+   FILE* f = fopen(SWITCH_OC_TOGGLE_PATH, "w");
 | 
						|
+    if (*setting->value.target.boolean == true) {
 | 
						|
+	  fprintf(f, "1\n");
 | 
						|
+	} else {
 | 
						|
+	  fprintf(f, "0\n");	
 | 
						|
+    }
 | 
						|
+    fclose(f);
 | 
						|
+}
 | 
						|
+#endif
 | 
						|
+
 | 
						|
 static void ssh_enable_toggle_change_handler(rarch_setting_t *setting)
 | 
						|
 {
 | 
						|
    systemd_service_toggle(LAKKA_SSH_PATH, (char*)"sshd.service",
 | 
						|
@@ -10407,7 +10425,15 @@ static bool setting_append_list(
 | 
						|
                &subgroup_info,
 | 
						|
                parent_group);
 | 
						|
 #endif
 | 
						|
-
 | 
						|
+#ifdef HAVE_LAKKA_SWITCH
 | 
						|
+         CONFIG_ACTION(
 | 
						|
+               list, list_info,
 | 
						|
+               MENU_ENUM_LABEL_LAKKA_SWITCH_OPTIONS,
 | 
						|
+               MENU_ENUM_LABEL_VALUE_LAKKA_SWITCH_OPTIONS,
 | 
						|
+               &group_info,
 | 
						|
+               &subgroup_info,
 | 
						|
+               parent_group);
 | 
						|
+#endif
 | 
						|
          CONFIG_ACTION(
 | 
						|
                list, list_info,
 | 
						|
                MENU_ENUM_LABEL_PLAYLIST_SETTINGS,
 | 
						|
@@ -21277,7 +21303,6 @@ static bool setting_append_list(
 | 
						|
             START_SUB_GROUP(list, list_info,
 | 
						|
                   msg_hash_to_str(MENU_ENUM_LABEL_VALUE_LAKKA_SERVICES),
 | 
						|
                   &group_info, &subgroup_info, parent_group);
 | 
						|
-
 | 
						|
             CONFIG_BOOL(
 | 
						|
                   list, list_info,
 | 
						|
                   &settings->bools.ssh_enable,
 | 
						|
@@ -21366,6 +21391,40 @@ static bool setting_append_list(
 | 
						|
 #endif
 | 
						|
          }
 | 
						|
          break;
 | 
						|
+#ifdef HAVE_LAKKA_SWITCH
 | 
						|
+      case SETTINGS_LIST_LAKKA_SWITCH_OPTIONS:
 | 
						|
+         {
 | 
						|
+            START_GROUP(list, list_info, &group_info,
 | 
						|
+                  msg_hash_to_str(MENU_ENUM_LABEL_VALUE_LAKKA_SWITCH_OPTIONS),
 | 
						|
+                  parent_group);
 | 
						|
+
 | 
						|
+            parent_group = msg_hash_to_str(MENU_ENUM_LABEL_SETTINGS);
 | 
						|
+
 | 
						|
+            START_SUB_GROUP(list, list_info,
 | 
						|
+                  msg_hash_to_str(MENU_ENUM_LABEL_VALUE_LAKKA_SWITCH_OPTIONS),
 | 
						|
+                  &group_info, &subgroup_info, parent_group);
 | 
						|
+
 | 
						|
+            CONFIG_BOOL(
 | 
						|
+                  list, list_info,
 | 
						|
+                  &settings->bools.switch_oc,
 | 
						|
+                  MENU_ENUM_LABEL_SWITCH_OC_ENABLE,
 | 
						|
+                  MENU_ENUM_LABEL_VALUE_SWITCH_OC_ENABLE,
 | 
						|
+                  true,
 | 
						|
+                  MENU_ENUM_LABEL_VALUE_OFF,
 | 
						|
+                  MENU_ENUM_LABEL_VALUE_ON,
 | 
						|
+                  &group_info,
 | 
						|
+                  &subgroup_info,
 | 
						|
+                  parent_group,
 | 
						|
+                  general_write_handler,
 | 
						|
+                  general_read_handler,
 | 
						|
+                  SD_FLAG_NONE);
 | 
						|
+            (*list)[list_info->index - 1].change_handler = switch_oc_enable_toggle_change_handler;
 | 
						|
+
 | 
						|
+            END_SUB_GROUP(list, list_info, parent_group);
 | 
						|
+            END_GROUP(list, list_info, parent_group);
 | 
						|
+         }
 | 
						|
+         break;
 | 
						|
+#endif
 | 
						|
       case SETTINGS_LIST_USER:
 | 
						|
          START_GROUP(list, list_info, &group_info,
 | 
						|
                msg_hash_to_str(MENU_ENUM_LABEL_VALUE_USER_SETTINGS),
 | 
						|
@@ -22578,6 +22637,9 @@ static rarch_setting_t *menu_setting_new_internal(rarch_setting_info_t *list_inf
 | 
						|
       SETTINGS_LIST_CORE_UPDATER,
 | 
						|
       SETTINGS_LIST_NETPLAY,
 | 
						|
       SETTINGS_LIST_LAKKA_SERVICES,
 | 
						|
+#ifdef HAVE_LAKKA_SWITCH
 | 
						|
+      SETTINGS_LIST_LAKKA_SWITCH_OPTIONS,
 | 
						|
+#endif
 | 
						|
       SETTINGS_LIST_USER,
 | 
						|
       SETTINGS_LIST_USER_ACCOUNTS,
 | 
						|
       SETTINGS_LIST_USER_ACCOUNTS_CHEEVOS,
 | 
						|
diff --git a/msg_hash.h b/msg_hash.h
 | 
						|
index 88f3c85d61..861881024b 100644
 | 
						|
--- a/msg_hash.h
 | 
						|
+++ b/msg_hash.h
 | 
						|
@@ -1914,6 +1914,7 @@ enum msg_hash_enums
 | 
						|
    MENU_ENUM_LABEL_DEFERRED_NETPLAY_LOBBY_FILTERS_LIST,
 | 
						|
    MENU_ENUM_LABEL_DEFERRED_NETPLAY_LAN_SCAN_SETTINGS_LIST,
 | 
						|
    MENU_ENUM_LABEL_DEFERRED_LAKKA_SERVICES_LIST,
 | 
						|
+   MENU_ENUM_LABEL_DEFERRED_LAKKA_SWITCH_OPTIONS_LIST,
 | 
						|
    MENU_ENUM_LABEL_DEFERRED_USER_SETTINGS_LIST,
 | 
						|
    MENU_ENUM_LABEL_DEFERRED_DIRECTORY_SETTINGS_LIST,
 | 
						|
    MENU_ENUM_LABEL_DEFERRED_PRIVACY_SETTINGS_LIST,
 | 
						|
@@ -2247,6 +2248,9 @@ enum msg_hash_enums
 | 
						|
    MENU_LABEL(BLUETOOTH_ENABLE),
 | 
						|
    MENU_LABEL(LOCALAP_ENABLE),
 | 
						|
    MENU_LBL_H(TIMEZONE),
 | 
						|
+#endif
 | 
						|
+#ifdef HAVE_LAKKA_SWITCH
 | 
						|
+   MENU_LABEL(SWITCH_OC_ENABLE),
 | 
						|
 #endif
 | 
						|
    MENU_LABEL(NETPLAY_DELAY_FRAMES), /* deprecated */
 | 
						|
    MENU_LABEL(NETPLAY_PUBLIC_ANNOUNCE),
 | 
						|
@@ -3048,6 +3052,9 @@ enum msg_hash_enums
 | 
						|
 
 | 
						|
    MENU_LABEL(CORE_UPDATER_SETTINGS),
 | 
						|
    MENU_LABEL(LAKKA_SERVICES),
 | 
						|
+#ifdef HAVE_LAKKA_SWITCH
 | 
						|
+   MENU_LABEL(LAKKA_SWITCH_OPTIONS),
 | 
						|
+#endif
 | 
						|
    MENU_LBL_H(SHADER_APPLY_CHANGES),
 | 
						|
    MENU_LBL_H(SHADER_WATCH_FOR_CHANGES),
 | 
						|
    MENU_LABEL(VIDEO_SHADER_REMEMBER_LAST_DIR),
 | 
						|
-- 
 | 
						|
2.25.1
 | 
						|
 |