libretro-fbalpha: Cherry pick some patches from upstream post-0.2.97.43.
authorNia Alarie <nia.alarie@gmail.com>
Tue, 8 May 2018 21:53:40 +0000 (22:53 +0100)
committerNia Alarie <nia.alarie@gmail.com>
Tue, 8 May 2018 21:55:27 +0000 (22:55 +0100)
Importantly, this fixes DIP switches in quite a few games.

Unfortunately I cannot pull down fixes easily from between 0.2.97.42
and 0.2.97.43, which is a shame because there are some interesting
ones, but I can only do so much without access to the commit log.

libretro-fbalpha/distinfo
libretro-fbalpha/patches/patch-src_burn_drv_galaxian_d__galaxian.cpp [new file with mode: 0644]
libretro-fbalpha/patches/patch-src_burn_drv_pst90s_d__raiden2.cpp [new file with mode: 0644]
libretro-fbalpha/patches/patch-src_burn_snd_msm6295.cpp [new file with mode: 0644]
libretro-fbalpha/patches/patch-src_burner_libretro_libretro.cpp [new file with mode: 0644]
libretro-fbalpha/patches/patch-src_cpu_nec__intf.cpp [new file with mode: 0644]

index 207baca417115a4ae028322186b0b9a991fc3d1f..4ffc3211a91b2a15e9ad5bb89115b69fab1e0997 100644 (file)
@@ -4,3 +4,8 @@ SHA1 (libretro-fbalpha-0.2.97.42.20180408-08cf5c6abbda2512d5ef73ef8483b849a34a76
 RMD160 (libretro-fbalpha-0.2.97.42.20180408-08cf5c6abbda2512d5ef73ef8483b849a34a7603.tar.gz) = e52b45173079a5449d036eefd539ec0f2ec7cba7
 SHA512 (libretro-fbalpha-0.2.97.42.20180408-08cf5c6abbda2512d5ef73ef8483b849a34a7603.tar.gz) = 6bdbbc1a082878d14c86d5c5ddb5cc86f6342f2f408bedadc7510c612cf781bb4d0e836bd0c99997900f552d74075d34c812775e1a71760612a038667aa06e1d
 Size (libretro-fbalpha-0.2.97.42.20180408-08cf5c6abbda2512d5ef73ef8483b849a34a7603.tar.gz) = 9243803 bytes
+SHA1 (patch-src_burn_drv_galaxian_d__galaxian.cpp) = f7a7b2449c9c5116b653c4ef51cfaaafe8821df0
+SHA1 (patch-src_burn_drv_pst90s_d__raiden2.cpp) = a74ab0ce1c3c2ff5ef579d4051aba4795d274898
+SHA1 (patch-src_burn_snd_msm6295.cpp) = 5972fa472e081cd6d0ff30babdbe9d012f362cdc
+SHA1 (patch-src_burner_libretro_libretro.cpp) = b6fd783526f99a6fc296ccbf27e661af9ee14246
+SHA1 (patch-src_cpu_nec__intf.cpp) = 631d76b945ee7e214e47718b45666f27ac2ea7b2
diff --git a/libretro-fbalpha/patches/patch-src_burn_drv_galaxian_d__galaxian.cpp b/libretro-fbalpha/patches/patch-src_burn_drv_galaxian_d__galaxian.cpp
new file mode 100644 (file)
index 0000000..515f1f0
--- /dev/null
@@ -0,0 +1,27 @@
+$NetBSD$
+
+Fixing The End sound volume (#199)
+
+Upstream commit b5550733fb162ae4c5de15d2f9c42db4a919c3df.
+
+--- src/burn/drv/galaxian/d_galaxian.cpp.orig  2018-04-08 06:33:58.000000000 +0000
++++ src/burn/drv/galaxian/d_galaxian.cpp
+@@ -16864,12 +16864,12 @@ static INT32 TheendInit()
+       \r
+       KonamiPPIInit();\r
+       \r
+-      filter_rc_set_src_gain(0, 0.02);\r
+-      filter_rc_set_src_gain(1, 0.02);\r
+-      filter_rc_set_src_gain(2, 0.02);\r
+-      filter_rc_set_src_gain(3, 0.02);\r
+-      filter_rc_set_src_gain(4, 0.02);\r
+-      filter_rc_set_src_gain(5, 0.02);\r
++      filter_rc_set_src_gain(0, 0.12);\r
++      filter_rc_set_src_gain(1, 0.12);\r
++      filter_rc_set_src_gain(2, 0.12);\r
++      filter_rc_set_src_gain(3, 0.12);\r
++      filter_rc_set_src_gain(4, 0.12);\r
++      filter_rc_set_src_gain(5, 0.12);\r
+       \r
+       return nRet;\r
+ }\r
diff --git a/libretro-fbalpha/patches/patch-src_burn_drv_pst90s_d__raiden2.cpp b/libretro-fbalpha/patches/patch-src_burn_drv_pst90s_d__raiden2.cpp
new file mode 100644 (file)
index 0000000..1923ac7
--- /dev/null
@@ -0,0 +1,26 @@
+$NetBSD$
+
+Fixing Raiden 2 ARM issue (#198)
+
+Upstream commit: bfc1f2fa0a9ca41add7858ba3badfa49257ec069
+
+--- src/burn/drv/pst90s/d_raiden2.cpp.orig     2018-04-08 06:33:58.000000000 +0000
++++ src/burn/drv/pst90s/d_raiden2.cpp
+@@ -802,7 +802,7 @@ static void cop_cmd_write(INT32 offset,
+                       cop_status |= 0x8000;\r
+                       cop_angle = 0;\r
+               } else {\r
+-                      cop_angle = (UINT16)(atan(double(dx)/double(dy)) * 128 / M_PI);\r
++                      cop_angle = (INT32)(atan(double(dx)/double(dy)) * 128 / M_PI);\r
+                       if(dy<0)\r
+                               cop_angle += 0x80;\r
+               }\r
+@@ -822,7 +822,7 @@ static void cop_cmd_write(INT32 offset,
+                       cop_status |= 0x8000;\r
+                       cop_angle = 0;\r
+               } else {\r
+-                      cop_angle = (UINT16)(atan(double(dx)/double(dy)) * 128 / M_PI);\r
++                      cop_angle = (INT32)(atan(double(dx)/double(dy)) * 128 / M_PI);\r
+                       if(dy<0)\r
+                               cop_angle += 0x80;\r
+               }\r
diff --git a/libretro-fbalpha/patches/patch-src_burn_snd_msm6295.cpp b/libretro-fbalpha/patches/patch-src_burn_snd_msm6295.cpp
new file mode 100644 (file)
index 0000000..63a64fa
--- /dev/null
@@ -0,0 +1,17 @@
+$NetBSD$
+
+Fixing some sound interpolation issue in nec cpu
+
+Upstream commit: 458002c9ce850864952ff5cc62818315d788957f
+
+--- src/burn/snd/msm6295.cpp.orig      2018-04-08 06:33:58.000000000 +0000
++++ src/burn/snd/msm6295.cpp
+@@ -302,7 +302,7 @@ static void MSM6295Render_Cubic(INT32 nC
+                                       pChannelInfo->nBufPos = 4;
+                               }
+-                              nOutput += INTERPOLATE4PS_16BIT(nFractionalPosition,
++                              nOutput += INTERPOLATE4PS_16BIT(nFractionalPosition & 0x0FFF,
+                                                                                               MSM6295ChannelData[nChip][nChannel][pChannelInfo->nBufPos - 4],
+                                                                                               MSM6295ChannelData[nChip][nChannel][pChannelInfo->nBufPos - 3],
+                                                                                               MSM6295ChannelData[nChip][nChannel][pChannelInfo->nBufPos - 2],
diff --git a/libretro-fbalpha/patches/patch-src_burner_libretro_libretro.cpp b/libretro-fbalpha/patches/patch-src_burner_libretro_libretro.cpp
new file mode 100644 (file)
index 0000000..610df86
--- /dev/null
@@ -0,0 +1,33 @@
+$NetBSD$
+
+Fix for "Dip switches not working? #185"
+
+Upstream commit: bbae856806f589286f340e55c9653b0f6d45120f
+
+--- src/burner/libretro/libretro.cpp.orig      2018-04-08 06:33:58.000000000 +0000
++++ src/burner/libretro/libretro.cpp
+@@ -165,6 +165,7 @@ INT32 nFireButtons = 0;
+ bool bStreetFighterLayout = false;
+ bool bButtonMapped = false;
+ bool bVolumeIsFireButton = false;
++INT32 bDip = 1;
+ // libretro globals
+ void retro_set_video_refresh(retro_video_refresh_t cb) { video_cb = cb; }
+@@ -3391,9 +3392,14 @@ INT32 GameInpInit()
+       }
+       memset(GameInp, 0, nSize);
+-      GameInpBlank(1);
++      // Initializing dipswitches several times is causing issues (#185)
++      // So let's use a variable (bDip global) to avoid initializing them several times
++      GameInpBlank(bDip);
+-      InpDIPSWResetDIPs();
++      if(bDip)
++              InpDIPSWResetDIPs();
++
++      bDip = 0;
+       GameInpInitMacros();
diff --git a/libretro-fbalpha/patches/patch-src_cpu_nec__intf.cpp b/libretro-fbalpha/patches/patch-src_cpu_nec__intf.cpp
new file mode 100644 (file)
index 0000000..3592df0
--- /dev/null
@@ -0,0 +1,19 @@
+$NetBSD$
+
+"Fixing some UB in nec cpu"
+
+Upstream commit: 1c7d1ee57d7853ab8928e12a9eb80efe509ba96c
+
+--- src/cpu/nec_intf.cpp.orig  2018-04-08 06:33:58.000000000 +0000
++++ src/cpu/nec_intf.cpp
+@@ -211,8 +211,8 @@ UINT32 VezReadLong(UINT32 a)
+       if ( p )
+               return *(p + (a / 4));
+       else
+-              return VezCurrentCPU->ReadHandler(a) + (VezCurrentCPU->ReadHandler(a+1) * 0x100) + 
+-                      (VezCurrentCPU->ReadHandler(a+2) * 0x10000) + (VezCurrentCPU->ReadHandler(a+3) * 0x1000000);
++              return VezCurrentCPU->ReadHandler(a) + (VezCurrentCPU->ReadHandler(a+1) << 8) +
++                      (VezCurrentCPU->ReadHandler(a+2) << 16) + (VezCurrentCPU->ReadHandler(a+3) << 24);
+ }
+ static void VezCheatWrite(UINT32 a, UINT8 d)