[mupen64plus-core] 248/310: Allow to overwrite the cycles per instruction

Sven Eckelmann ecsv-guest at moszumanska.debian.org
Thu Nov 26 05:58:10 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 14c04a00aab5c9f979e8ce00bb277ace2a168bbe
Author: Sven Eckelmann <sven at narfation.org>
Date:   Fri Dec 13 14:43:23 2013 +0100

    Allow to overwrite the cycles per instruction
    
    Some ROMs require a different average cycles per instruction count than the
    default one (2 per emulated instruction). This setting is necessary because
    mupen64plus is not cycle accurate. A complete simulation of pipeline, cache,
    bus and so on is necessary to get it perfectly without this workaround.
    
    Known titles which require a CounterPerOp of 1 are
    
     * 64 de Hakken!! Tamagotchi - Minna de Tamagotchi World
     * 64 Oozumou
     * A Bug's Life
     * Airboarder 64
     * Bass Hunter 64
     * Bass Rush - ECOGEAR PowerWorm Championship
     * Bassmasters 2000
     * Biohazard 2
     * Body Harvest
     * California Speed
     * Carmageddon 64
     * Charlie Blast's Territory
     * City Tour Grandprix - Zennihon GT Senshuken
     * Destruction Derby 64
     * Disney's Tarzan
     * Donkey Kong 64
     * Duck Dodgers Starring Daffy Duck
     * Duke Nukem - ZER0 H0UR
     * Excitebike 64
     * Fighting Force 64
     * Flying Dragon
     * Fushigi no Dungeon - Fuurai no Shiren 2 - Oni Shuurai! Shiren Jou!
     * GT 64 - Championship Edition
     * Hamster Monogatari 64
     * Harvest Moon 64
     * Hercules - The Legendary Journeys
     * Hexen
     * Hiryuu no Ken Twin
     * In-Fisherman Bass Hunter 64
     * International Superstar Soccer 64
     * Itoi Shigesato no Bass Tsuri No. 1 Kettei Ban!
     * Jikkyou G1 Stable
     * Jikkyou World Soccer 3
     * Madden NFL 2000
     * Madden NFL 2001
     * Madden NFL 2002
     * Madden NFL 99
     * Mario Party
     * Mario Party 2
     * Mario Party 3
     * Mario Story
     * Monopoly
     * Mystical Ninja 2 Starring Goemon
     * NBA In the Zone '99
     * NBA Showtime - NBA on NBC
     * Nightmare Creatures
     * Nintama Rantarou 64 Game Gallery
     * Nuclear Strike 64
     * Nushi Duri 64
     * Nushi Duri 64 - Shiokaze ni Notte
     * Paper Mario
     * Pro Mahjong Kiwame 64
     * Pro Mahjong Tsuwamono 64 - Jansou Battle ni Chousen
     * Quake II
     * Razor Freestyle Scooter
     * Ready 2 Rumble Boxing Round 2
     * Resident Evil 2
     * Roadsters Trophy
     * Rush 2 - Extreme Racing USA
     * San Francisco Rush 2049
     * Shadow Man
     * Tigger's Honey Hunt
     * Toy Story 2
     * Triple Play 2000
     * Ucchan Nanchan no Hono no Challenger - Denryuu Ira Ira Bou
     * Vigilante 8
     * Vigilante 8 - 2nd Offence
     * Virtual Pool 64
     * War Gods
     * WCW-nWo Revenge
     * Wipeout 64
     * HardCoded by Iceage
     * Spacer by Memir (POM '99)
    
    Known titles which require a CounterPerOp of 3 are
    
     * BattleTanx
     * BattleTanx - Global Assault
     * Beetle Adventure Racing!
     * Disney's Donald Duck - Goin' Quackers
     * Donald Duck - Quack Attack
     * HSV Adventure Racing
     * Jikkyou Powerful Pro Yakyuu Basic Ban 2001
     * LEGO Racers
     * Monster Truck Madness 64
     * Pilotwings 64
     * Road Rash 64
     * Wave Race 64 - Shindou Edition
     * WCW Nitro
     * Wetrix
---
 debian/changelog                    |   1 +
 debian/patches/counter_per_op.patch | 241 ++++++++++++++++++++++++++++++++++++
 debian/patches/series               |   1 +
 3 files changed, 243 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 456b600..2c17354 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ mupen64plus-core (2.0-4) UNRELEASED; urgency=low
   * debian/patches:
     - Add oot_subscreen_delay_fix.patch, Add Missing Subscreen Delay Fix for
       Ocarina of Time
+    - Add counter_per_op.patch, Allow to overwrite the cycles per instruction
 
  -- Sven Eckelmann <sven at narfation.org>  Sat, 05 Oct 2013 22:52:30 +0200
 
diff --git a/debian/patches/counter_per_op.patch b/debian/patches/counter_per_op.patch
new file mode 100644
index 0000000..c54e896
--- /dev/null
+++ b/debian/patches/counter_per_op.patch
@@ -0,0 +1,241 @@
+Description: Allow to overwrite the cycles per instruction
+ Some ROMs require a different average cycles per instruction count than the
+ default one (2 per emulated instruction). This setting is necessary because
+ mupen64plus is not cycle accurate. A complete simulation of pipeline, cache,
+ bus and so on is necessary to get it perfectly without this workaround.
+ .
+ Known titles which require a CounterPerOp of 1 are
+ * 64 de Hakken!! Tamagotchi - Minna de Tamagotchi World
+ * 64 Oozumou
+ * A Bug's Life
+ * Airboarder 64
+ * Bass Hunter 64
+ * Bass Rush - ECOGEAR PowerWorm Championship
+ * Bassmasters 2000
+ * Biohazard 2
+ * Body Harvest
+ * California Speed
+ * Carmageddon 64
+ * Charlie Blast's Territory
+ * City Tour Grandprix - Zennihon GT Senshuken
+ * Destruction Derby 64
+ * Disney's Tarzan
+ * Donkey Kong 64
+ * Duck Dodgers Starring Daffy Duck
+ * Duke Nukem - ZER0 H0UR
+ * Excitebike 64
+ * Fighting Force 64
+ * Flying Dragon
+ * Fushigi no Dungeon - Fuurai no Shiren 2 - Oni Shuurai! Shiren Jou!
+ * GT 64 - Championship Edition
+ * Hamster Monogatari 64
+ * Harvest Moon 64
+ * Hercules - The Legendary Journeys
+ * Hexen
+ * Hiryuu no Ken Twin
+ * In-Fisherman Bass Hunter 64
+ * International Superstar Soccer 64
+ * Itoi Shigesato no Bass Tsuri No. 1 Kettei Ban!
+ * Jikkyou G1 Stable
+ * Jikkyou World Soccer 3
+ * Madden NFL 2000
+ * Madden NFL 2001
+ * Madden NFL 2002
+ * Madden NFL 99
+ * Mario Party
+ * Mario Party 2
+ * Mario Party 3
+ * Mario Story
+ * Monopoly
+ * Mystical Ninja 2 Starring Goemon
+ * NBA In the Zone '99
+ * NBA Showtime - NBA on NBC
+ * Nightmare Creatures
+ * Nintama Rantarou 64 Game Gallery
+ * Nuclear Strike 64
+ * Nushi Duri 64
+ * Nushi Duri 64 - Shiokaze ni Notte
+ * Paper Mario
+ * Pro Mahjong Kiwame 64
+ * Pro Mahjong Tsuwamono 64 - Jansou Battle ni Chousen
+ * Quake II
+ * Razor Freestyle Scooter
+ * Ready 2 Rumble Boxing Round 2
+ * Resident Evil 2
+ * Roadsters Trophy
+ * Rush 2 - Extreme Racing USA
+ * San Francisco Rush 2049
+ * Shadow Man
+ * Tigger's Honey Hunt
+ * Toy Story 2
+ * Triple Play 2000
+ * Ucchan Nanchan no Hono no Challenger - Denryuu Ira Ira Bou
+ * Vigilante 8
+ * Vigilante 8 - 2nd Offence
+ * Virtual Pool 64
+ * War Gods
+ * WCW-nWo Revenge
+ * Wipeout 64
+ * HardCoded by Iceage
+ * Spacer by Memir (POM '99)
+ .
+ Known titles which require a CounterPerOp of 3 are
+ * BattleTanx
+ * BattleTanx - Global Assault
+ * Beetle Adventure Racing!
+ * Disney's Donald Duck - Goin' Quackers
+ * Donald Duck - Quack Attack
+ * HSV Adventure Racing
+ * Jikkyou Powerful Pro Yakyuu Basic Ban 2001
+ * LEGO Racers
+ * Monster Truck Madness 64
+ * Pilotwings 64
+ * Road Rash 64
+ * Wave Race 64 - Shindou Edition
+ * WCW Nitro
+ * Wetrix
+Author: Sven Eckelmann <sven at narfation.org>
+
+---
+diff --git a/doc/emuwiki-api-doc/Mupen64Plus_Core_Parameters.txt b/doc/emuwiki-api-doc/Mupen64Plus_Core_Parameters.txt
+index cc0876b92b510f07cb2a392cd79c2817685d5c5b..a5f49f6f4827c469d94d607c75eaa492e0457d26 100644
+--- a/doc/emuwiki-api-doc/Mupen64Plus_Core_Parameters.txt
++++ b/doc/emuwiki-api-doc/Mupen64Plus_Core_Parameters.txt
+@@ -55,6 +55,10 @@ These are standard parameters which are used by the Mupen64Plus Core library.  T
+ |M64TYPE_STRING
+ |Path to a directory to search when looking for shared data files in the <tt>ConfigGetSharedDataFilepath()</tt> function.
+ |-
++|CountPerOp
++|M64TYPE_INT
++|Force number of cycles per emulated instruction when set greater than 0.
++|-
+ |}
+ 
+ These configuration parameters are used in the Core's event loop to detect keyboard and joystick commands.  They are stored in a configuration section called "CoreEvents" and may be altered by the front-end in order to adjust the behaviour of the emulator.  These may be adjusted at any time and the effect of the change should occur immediately.  The Keysym value stored is actually <tt>(SDLMod << 16) || SDLKey</tt>, so that keypresses with modifiers like shift, control, or alt may be used.
+diff --git a/src/main/main.c b/src/main/main.c
+index 0929fe718fcc9d55d7657edacc689d2f8c324780..a101782fd3eeeca3208d8cc580f338929d790cf3 100644
+--- a/src/main/main.c
++++ b/src/main/main.c
+@@ -194,6 +194,7 @@ int main_set_core_defaults(void)
+     ConfigSetDefaultString(g_CoreConfig, "SaveStatePath", "", "Path to directory where emulator save states (snapshots) are saved. If this is blank, the default value of ${UserConfigPath}/save will be used");
+     ConfigSetDefaultString(g_CoreConfig, "SaveSRAMPath", "", "Path to directory where SRAM/EEPROM data (in-game saves) are stored. If this is blank, the default value of ${UserConfigPath}/save will be used");
+     ConfigSetDefaultString(g_CoreConfig, "SharedDataPath", "", "Path to a directory to search when looking for shared data files");
++    ConfigSetDefaultInt(g_CoreConfig, "CountPerOp", 0, "Force number of cycles per emulated instruction");
+ 
+     /* handle upgrades */
+     if (bUpgrade)
+@@ -734,6 +735,9 @@ m64p_error main_run(void)
+     savestates_set_autoinc_slot(ConfigGetParamBool(g_CoreConfig, "AutoStateSlotIncrement"));
+     savestates_select_slot(ConfigGetParamInt(g_CoreConfig, "CurrentStateSlot"));
+     no_compiled_jump = ConfigGetParamBool(g_CoreConfig, "NoCompiledJump");
++    count_per_op = ConfigGetParamInt(g_CoreConfig, "CountPerOp");
++    if (count_per_op <= 0)
++        count_per_op = 2;
+ 
+     // initialize memory, and do byte-swapping if it's not been done yet
+     if (g_MemHasBeenBSwapped == 0)
+diff --git a/src/r4300/interupt.c b/src/r4300/interupt.c
+index 32255597cdd54dc65b8cc5eb68e94b3f50be7a67..b7d2e5094c0bd01465dcbbce8ac6005761923ef1 100644
+--- a/src/r4300/interupt.c
++++ b/src/r4300/interupt.c
+@@ -423,9 +423,9 @@ void gen_interupt(void)
+     
+         case COMPARE_INT:
+             remove_interupt_event();
+-            Count+=2;
++            Count+=count_per_op;
+             add_interupt_event_count(COMPARE_INT, Compare);
+-            Count-=2;
++            Count-=count_per_op;
+     
+             Cause = (Cause | 0x8000) & 0xFFFFFF83;
+             if ((Status & 7) != 1) return;
+diff --git a/src/r4300/r4300.c b/src/r4300/r4300.c
+index 9a64fdb480602359359ba7e41fc6f7945fe1852a..200722ed811803bdad17bf7d7fc1662c6b98d24d 100644
+--- a/src/r4300/r4300.c
++++ b/src/r4300/r4300.c
+@@ -45,6 +45,7 @@
+ 
+ unsigned int r4300emu = 0;
+ int no_compiled_jump = 0;
++unsigned int count_per_op = 2;
+ int llbit, rompause;
+ #if NEW_DYNAREC != NEW_DYNAREC_ARM
+ int stop;
+@@ -705,7 +706,7 @@ void update_count(void)
+     if (r4300emu != CORE_DYNAREC)
+     {
+ #endif
+-        Count = Count + (PC->addr - last_addr)/2;
++        Count += ((PC->addr - last_addr) >> 2) * count_per_op;
+         last_addr = PC->addr;
+ #ifdef NEW_DYNAREC
+     }
+diff --git a/src/r4300/r4300.h b/src/r4300/r4300.h
+index 399a9fbaa1460d02cff831b2d7c5a1efd0471edc..7c0b9488424638199cd876f05f67208c119b9878 100644
+--- a/src/r4300/r4300.h
++++ b/src/r4300/r4300.h
+@@ -47,6 +47,7 @@ extern unsigned int last_addr;
+ extern char invalid_code[0x100000];
+ extern unsigned int jump_to_address;
+ extern int no_compiled_jump;
++extern unsigned int count_per_op;
+ 
+ void init_blocks(void);
+ void free_blocks(void);
+diff --git a/src/r4300/x86/gr4300.c b/src/r4300/x86/gr4300.c
+index d2ed999728842ca39e299cbd039338b1d5aee39e..30484a563641381fee8799070fe60a34ba221aa0 100644
+--- a/src/r4300/x86/gr4300.c
++++ b/src/r4300/x86/gr4300.c
+@@ -44,25 +44,20 @@ static int eax, ebx, ecx, edx, esp, ebp, esi, edi;
+ int branch_taken;
+ 
+ /* static functions */
+-
+ static void genupdate_count(unsigned int addr)
+ {
+-#ifndef COMPARE_CORE
+-#ifndef DBG
++#if !defined(COMPARE_CORE) && !defined(DBG)
+    mov_reg32_imm32(EAX, addr);
+    sub_reg32_m32(EAX, (unsigned int*)(&last_addr));
+-   shr_reg32_imm8(EAX, 1);
++   shr_reg32_imm8(EAX, 2);
++   mov_reg32_m32(EDX, &count_per_op);
++   mul_reg32(EDX);
+    add_m32_reg32((unsigned int*)(&Count), EAX);
+ #else
+    mov_m32_imm32((unsigned int*)(&PC), (unsigned int)(dst+1));
+    mov_reg32_imm32(EAX, (unsigned int)update_count);
+    call_reg32(EAX);
+ #endif
+-#else
+-   mov_m32_imm32((unsigned int*)(&PC), (unsigned int)(dst+1));
+-   mov_reg32_imm32(EAX, (unsigned int)update_count);
+-   call_reg32(EAX);
+-#endif
+ }
+ 
+ static void gencheck_interupt(unsigned int instr_structure)
+diff --git a/src/r4300/x86_64/gr4300.c b/src/r4300/x86_64/gr4300.c
+index 15db43fd54563a8e2197b60ad03e3b445cf62bdc..0354fde3556a1bf58b6b37b9944ef0f661d722f4 100644
+--- a/src/r4300/x86_64/gr4300.c
++++ b/src/r4300/x86_64/gr4300.c
+@@ -84,13 +84,14 @@ static long long debug_reg_storage[8];
+ int branch_taken = 0;
+ 
+ /* static functions */
+-
+ static void genupdate_count(unsigned int addr)
+ {
+-#if !defined(COMPARE_CORE) && !defined(DBG)
++#if !defined(COMPARE_CORE) && !defined(DBG) && 0
+    mov_reg32_imm32(EAX, addr);
+    sub_xreg32_m32rel(EAX, (unsigned int*)(&last_addr));
+-   shr_reg32_imm8(EAX, 1);
++   shr_reg32_imm8(EAX, 2);
++   mov_xreg32_m32rel(EDX, (void*)&count_per_op);
++   mul_reg32(EDX);
+    add_m32rel_xreg32((unsigned int*)(&Count), EAX);
+ #else
+    mov_reg64_imm64(RAX, (unsigned long long) (dst+1));
diff --git a/debian/patches/series b/debian/patches/series
index 4738675..7d59472 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@ n64_cic_nus_6105_reset.patch
 sdl2_select_saveslot.patch
 sdl2_no_unicode.patch
 oot_subscreen_delay_fix.patch
+counter_per_op.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