[mupen64plus-core] 115/310: Read option SaveStatePath from config when set

Sven Eckelmann ecsv-guest at moszumanska.debian.org
Thu Nov 26 05:57:32 UTC 2015


This is an automated email from the git hooks/post-receive script.

ecsv-guest pushed a commit to branch armhf_test
in repository mupen64plus-core.

commit d14e7087d63100590d2e799b9be436a9bde47b51
Author: Sven Eckelmann <sven at narfation.org>
Date:   Thu Oct 6 11:15:57 2011 +0200

    Read option SaveStatePath from config when set
---
 debian/changelog                          |  2 ++
 debian/patches/savestatepath_config.patch | 50 +++++++++++++++++++++++++++++++
 debian/patches/series                     |  1 +
 3 files changed, 53 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 7fb74b7..ca7f736 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,8 @@ mupen64plus-core (1.99.4-4) UNRELEASED; urgency=low
   * Don't mix implicit and explicit rules to prevent FTBFS with make 3.82
   * debian/patches:
     - Add new_minizip.patch, Import minizip from zlib 1.2.5
+    - Add savestatepath_config.patch, Read option SaveStatePath from config when
+      set
 
  -- Sven Eckelmann <sven at narfation.org>  Sat, 20 Aug 2011 21:53:01 +0200
 
diff --git a/debian/patches/savestatepath_config.patch b/debian/patches/savestatepath_config.patch
new file mode 100644
index 0000000..7db863b
--- /dev/null
+++ b/debian/patches/savestatepath_config.patch
@@ -0,0 +1,50 @@
+Description: Read option SaveStatePath from config when set
+Author: Sven Eckelmann <sven at narfation.org>
+
+---
+diff --git a/src/main/main.c b/src/main/main.c
+index 25fe9acc443c9e858200dfa1ba68ea880a5f6855..deeb56851edc33d710ffbab9227542233df17991 100644
+--- a/src/main/main.c
++++ b/src/main/main.c
+@@ -81,12 +81,25 @@ static osd_message_t *l_msgPause = NULL;
+ /*********************************************************************************************************
+ * helper functions
+ */
+-char *get_savespath()
++const char *get_savespath(void)
+ {
+     static char path[1024];
++    const char *savestatepath = NULL;
++    m64p_handle CoreHandle = NULL;
+ 
+-    snprintf(path, 1024, "%ssave%c", ConfigGetUserDataPath(), OSAL_DIR_SEPARATOR);
+-    path[1023] = 0;
++    /* try to get the SaveStatePath string variable in the Core configuration section */
++    if (ConfigOpenSection("Core", &CoreHandle) == M64ERR_SUCCESS)
++    {
++        savestatepath = ConfigGetParamString(CoreHandle, "SaveStatePath");
++    }
++
++    if (!savestatepath || (strlen(savestatepath) == 0)) {
++        snprintf(path, 1024, "%ssave%c", ConfigGetUserDataPath(), OSAL_DIR_SEPARATOR);
++        path[1023] = 0;
++    } else {
++        snprintf(path, 1024, "%s%c", savestatepath, OSAL_DIR_SEPARATOR);
++        path[1023] = 0;
++    }
+ 
+     /* create directory if it doesn't exist */
+     osal_mkdirp(path, 0700);
+diff --git a/src/main/main.h b/src/main/main.h
+index 8d7697c80efb775fced671acbb57a9009309340c..114ec842af05cae3f962c7e5d09336859a79f26d 100644
+--- a/src/main/main.h
++++ b/src/main/main.h
+@@ -33,7 +33,7 @@ extern int g_EmulatorRunning;
+ 
+ extern m64p_frame_callback g_FrameCallback;
+ 
+-char* get_savespath(void);
++const char* get_savespath(void);
+ 
+ void new_frame(void);
+ void new_vi(void);
diff --git a/debian/patches/series b/debian/patches/series
index 91f47bd..88746e2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -16,3 +16,4 @@ interpreter_rw_memory.patch
 n64_cic_nus_6105.patch
 mipmapping_doc.patch
 new_minizip.patch
+savestatepath_config.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/mupen64plus-core.git



More information about the Pkg-games-commits mailing list