[mupen64plus-core] 262/310: Allow to load CountPerOp info from mupen64plus.ini

Sven Eckelmann ecsv-guest at moszumanska.debian.org
Thu Nov 26 05:58:14 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 3de13fb0464f5f1c74db3f9223a8c716e0d7f41e
Author: Sven Eckelmann <sven at narfation.org>
Date:   Wed Jan 22 20:13:47 2014 +0100

    Allow to load CountPerOp info from mupen64plus.ini
    
    The CountPerOp settings has to be adjusted for each ROM. It is easier for the
    enduser when the default value is not hardcoded in mupen64plus and instead this
    dynamic information is retreived from the mupen64plus.ini.
    
    The countperop information (currently named count_per_op_default) is not saved
    inside m64p_rom_settings because this type is exported using the frontend api.
    Modifying this would require a version bump.
---
 debian/changelog                        |   2 +
 debian/patches/countperop_rominfo.patch | 136 ++++++++++++++++++++++++++++++++
 debian/patches/series                   |   1 +
 3 files changed, 139 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 31fc42a..9434b9d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,8 @@ mupen64plus-core (2.0-5) UNRELEASED; urgency=medium
     - Cleanup patch counter_per_op.patch
     - Add format_eeprom.patch, A cleared EEPROM block has all bits to 1 and
       not 0
+    - Add countperop_rominfo.patch, Allow to load CountPerOp info from
+      mupen64plus.ini
   * debian/watch:
     - Change upstream check from bitbucket to github
   * debian/copyright:
diff --git a/debian/patches/countperop_rominfo.patch b/debian/patches/countperop_rominfo.patch
new file mode 100644
index 0000000..760a9ce
--- /dev/null
+++ b/debian/patches/countperop_rominfo.patch
@@ -0,0 +1,136 @@
+Description: Allow to load CountPerOp info from mupen64plus.ini
+ The CountPerOp settings has to be adjusted for each ROM. It is easier for the
+ enduser when the default value is not hardcoded in mupen64plus and instead
+ this dynamic information is retreived from the mupen64plus.ini.
+ .
+ The countperop information (currently named count_per_op_default) is not saved
+ inside m64p_rom_settings because this type is exported using the frontend api.
+ Modifying this would require a version bump.
+Author: Sven Eckelmann <sven at narfation.org>
+
+---
+diff --git a/src/main/main.c b/src/main/main.c
+index 2dd11eff54416bdcded7aab5884396d37088e9fd..8aaa2f2a87bd7572be8ba18d38f899258bede580 100644
+--- a/src/main/main.c
++++ b/src/main/main.c
+@@ -739,7 +739,7 @@ m64p_error main_run(void)
+     delay_si = ConfigGetParamBool(g_CoreConfig, "DelaySI");
+     count_per_op = ConfigGetParamInt(g_CoreConfig, "CountPerOp");
+     if (count_per_op <= 0)
+-        count_per_op = 2;
++        count_per_op = ROM_PARAMS.countperop;
+ 
+     // initialize memory, and do byte-swapping if it's not been done yet
+     if (g_MemHasBeenBSwapped == 0)
+diff --git a/src/main/rom.c b/src/main/rom.c
+index 5cd1b3e7cfd5bc13de6279b261c7929f63db2fc8..23c3631fdb513ff27e6a90c8ca9e23d5577d120e 100644
+--- a/src/main/rom.c
++++ b/src/main/rom.c
+@@ -37,6 +37,7 @@
+ #include "util.h"
+ 
+ #include "memory/memory.h"
++#include "r4300/r4300.h"
+ #include "osal/preproc.h"
+ #include "osd/osd.h"
+ 
+@@ -163,6 +164,7 @@ m64p_error open_rom(const unsigned char* romimage, unsigned int size)
+     ROM_PARAMS.systemtype = rom_country_code_to_system_type(ROM_HEADER.Country_code);
+     ROM_PARAMS.vilimit = rom_system_type_to_vi_limit(ROM_PARAMS.systemtype);
+     ROM_PARAMS.aidacrate = rom_system_type_to_ai_dac_rate(ROM_PARAMS.systemtype);
++    ROM_PARAMS.countperop = COUNT_PER_OP_DEFAULT;
+ 
+     memcpy(ROM_PARAMS.headername, ROM_HEADER.Name, 20);
+     ROM_PARAMS.headername[20] = '\0';
+@@ -178,6 +180,7 @@ m64p_error open_rom(const unsigned char* romimage, unsigned int size)
+         ROM_SETTINGS.status = entry->status;
+         ROM_SETTINGS.players = entry->players;
+         ROM_SETTINGS.rumble = entry->rumble;
++        ROM_PARAMS.countperop = entry->countperop;
+     }
+     else
+     {
+@@ -187,6 +190,7 @@ m64p_error open_rom(const unsigned char* romimage, unsigned int size)
+         ROM_SETTINGS.status = 0;
+         ROM_SETTINGS.players = 0;
+         ROM_SETTINGS.rumble = 0;
++        ROM_PARAMS.countperop = COUNT_PER_OP_DEFAULT;
+     }
+ 
+     /* print out a bunch of info about the ROM */
+@@ -355,6 +359,7 @@ void romdatabase_open(void)
+             search->entry.savetype = DEFAULT;
+             search->entry.players = DEFAULT;
+             search->entry.rumble = DEFAULT; 
++            search->entry.countperop = COUNT_PER_OP_DEFAULT;
+ 
+             search->next_entry = NULL;
+             search->next_crc = NULL;
+@@ -445,6 +450,13 @@ void romdatabase_open(void)
+                 else
+                     DebugMessage(M64MSG_WARNING, "ROM Database: Invalid rumble string on line %i", lineno);
+             }
++            else if(!strcmp(l.name, "CountPerOp"))
++            {
++                if (string_to_int(l.value, &value) && value > 0 && value <= 4)
++                    search->entry.countperop = value;
++                else
++                    DebugMessage(M64MSG_WARNING, "ROM Database: Invalid CountPerOp on line %i", lineno);
++            }
+             else
+             {
+                 DebugMessage(M64MSG_WARNING, "ROM Database: Unknown property on line %i", lineno);
+@@ -473,6 +485,8 @@ void romdatabase_open(void)
+                     search->entry.players = ref->players;
+                 if(ref->rumble!=DEFAULT)
+                     search->entry.rumble = ref->rumble;
++                if (ref->countperop != COUNT_PER_OP_DEFAULT)
++                    search->entry.countperop = ref->countperop;
+             }
+             else
+                 DebugMessage(M64MSG_WARNING, "ROM Database: Error solving RefMD5s");
+diff --git a/src/main/rom.h b/src/main/rom.h
+index 5b91ace727b7b4cf05462edd4f38f746babcce55..b8be154ec735603889219d6af8e9ad5a0c2ddf93 100644
+--- a/src/main/rom.h
++++ b/src/main/rom.h
+@@ -42,6 +42,7 @@ typedef struct _rom_params
+    int vilimit;
+    int aidacrate;
+    char headername[21];  /* ROM Name as in the header, removing trailing whitespace */
++   unsigned char countperop;
+ } rom_params;
+ 
+ extern m64p_rom_header   ROM_HEADER;
+@@ -111,6 +112,7 @@ typedef struct
+    unsigned char savetype;
+    unsigned char players; /* Local players 0-4, 2/3/4 way Netplay indicated by 5/6/7. */
+    unsigned char rumble; /* 0 - No, 1 - Yes boolean for rumble support. */
++   unsigned char countperop;
+ } romdatabase_entry;
+ 
+ typedef struct _romdatabase_search
+diff --git a/src/r4300/r4300.c b/src/r4300/r4300.c
+index 5b57ce694d17aaabe18e864eef379f2e024c396d..5fbbf630c2934c890215fc9e34de6281e2367b97 100644
+--- a/src/r4300/r4300.c
++++ b/src/r4300/r4300.c
+@@ -45,7 +45,7 @@
+ 
+ unsigned int r4300emu = 0;
+ int no_compiled_jump = 0;
+-unsigned int count_per_op = 2;
++unsigned int count_per_op = COUNT_PER_OP_DEFAULT;
+ int llbit, rompause;
+ #if NEW_DYNAREC != NEW_DYNAREC_ARM
+ int stop;
+diff --git a/src/r4300/r4300.h b/src/r4300/r4300.h
+index 679690351a0fd467087afde3ea4e2ad3ad5487a7..2363412bc76477b879e3130274d2eb6bf0fbf779 100644
+--- a/src/r4300/r4300.h
++++ b/src/r4300/r4300.h
+@@ -46,6 +46,7 @@ extern unsigned int last_addr;
+ extern char invalid_code[0x100000];
+ extern unsigned int jump_to_address;
+ extern int no_compiled_jump;
++#define COUNT_PER_OP_DEFAULT 2
+ extern unsigned int count_per_op;
+ 
+ void init_blocks(void);
diff --git a/debian/patches/series b/debian/patches/series
index 370322b..1e77793 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -14,3 +14,4 @@ config_currentstateslot.patch
 obsolete_variable.patch
 format_eeprom.patch
 revert_wii64_eeprom.patch
+countperop_rominfo.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