From 0a33e562f454c00857e12ba3fc592d364623e3e8 Mon Sep 17 00:00:00 2001 From: jdgleaver Date: Thu, 4 Jun 2020 12:19:24 +0100 Subject: [PATCH] Add option to backup/restore installed cores --- Makefile.common | 3 + core_backup.c | 744 ++++++++++++++ core_backup.h | 175 ++++ core_updater_list.c | 4 +- file_path_special.h | 4 +- file_path_str.c | 6 + griffin/griffin.c | 7 + intl/msg_hash_lbl.h | 24 + intl/msg_hash_us.h | 88 ++ libretro-common/file/file_path.c | 21 +- .../include/streams/interface_stream.h | 2 + libretro-common/include/time/rtime.h | 48 + libretro-common/streams/interface_stream.c | 27 + libretro-common/time/rtime.c | 80 ++ menu/cbs/menu_cbs_deferred_push.c | 11 + menu/cbs/menu_cbs_ok.c | 248 ++--- menu/cbs/menu_cbs_sublabel.c | 37 + menu/cbs/menu_cbs_title.c | 57 ++ menu/drivers/materialui.c | 27 +- menu/drivers/ozone/ozone_texture.c | 3 + menu/drivers/xmb.c | 3 + menu/menu_cbs.h | 4 +- menu/menu_displaylist.c | 187 +++- menu/menu_displaylist.h | 2 + menu/menu_driver.c | 17 +- menu/menu_driver.h | 6 + msg_hash.h | 27 + retroarch.c | 5 + runtime_file.c | 25 +- tasks/task_core_backup.c | 961 ++++++++++++++++++ tasks/task_core_updater.c | 25 +- tasks/task_database.c | 23 +- tasks/task_save.c | 6 +- tasks/tasks_internal.h | 15 + verbosity.c | 9 +- 35 files changed, 2675 insertions(+), 256 deletions(-) create mode 100644 core_backup.c create mode 100644 core_backup.h create mode 100644 libretro-common/include/time/rtime.h create mode 100644 libretro-common/time/rtime.c create mode 100644 tasks/task_core_backup.c diff --git a/Makefile.common b/Makefile.common index c1bd19d9b9..8fcbc288c9 100644 --- a/Makefile.common +++ b/Makefile.common @@ -186,6 +186,7 @@ OBJ += frontend/frontend_driver.o \ tasks/task_image.o \ tasks/task_playlist_manager.o \ tasks/task_manual_content_scan.o \ + tasks/task_core_backup.o \ $(LIBRETRO_COMM_DIR)/encodings/encoding_utf.o \ $(LIBRETRO_COMM_DIR)/encodings/encoding_crc32.o \ $(LIBRETRO_COMM_DIR)/encodings/encoding_base64.o \ @@ -251,6 +252,7 @@ OBJ += \ $(LIBRETRO_COMM_DIR)/compat/compat_posix_string.o \ managers/cheat_manager.o \ core_info.o \ + core_backup.o \ $(LIBRETRO_COMM_DIR)/file/config_file.o \ $(LIBRETRO_COMM_DIR)/file/config_file_userdata.o \ runtime_file.o \ @@ -272,6 +274,7 @@ OBJ += \ $(LIBRETRO_COMM_DIR)/features/features_cpu.o \ verbosity.o \ $(LIBRETRO_COMM_DIR)/playlists/label_sanitization.o \ + $(LIBRETRO_COMM_DIR)/time/rtime.o \ manual_content_scan.o \ disk_control_interface.o diff --git a/core_backup.c b/core_backup.c new file mode 100644 index 0000000000..b79cf74b18 --- /dev/null +++ b/core_backup.c @@ -0,0 +1,744 @@ +/* Copyright (C) 2010-2019 The RetroArch team + * + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (core_backup.c). + * --------------------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include +#include +#include +#include +#include +#include +#include