[mupen64plus-rsp-hle] 153/167: Imported Upstream version 2.0+169+g6158876

Sven Eckelmann ecsv-guest at moszumanska.debian.org
Thu Nov 26 06:02:38 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-rsp-hle.

commit 9d589694e834fdea687cedda5fffb247f2de7dd1
Author: Sven Eckelmann <sven at narfation.org>
Date:   Fri Sep 5 11:14:17 2014 +0200

    Imported Upstream version 2.0+169+g6158876
---
 .travis.yml                                  | 13 ++++++++++
 projects/msvc11/mupen64plus-rsp-hle.vcxproj  |  4 +--
 projects/msvc8/mupen64plus-rsp-hle.vcproj    |  4 +--
 src/alist.c                                  | 38 +++++++++++++++-------------
 src/arithmetics.h                            |  2 ++
 src/audio.h                                  |  2 ++
 src/common.h                                 |  5 ++++
 src/hle.c                                    | 24 +++++++++---------
 src/memory.h                                 |  1 +
 src/{arithmetics.h => msvc-compat/stdbool.h} | 23 +++++++++--------
 src/plugin.c                                 |  4 +--
 11 files changed, 72 insertions(+), 48 deletions(-)

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..427f7f6
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,13 @@
+language: cpp
+compiler:
+  - gcc
+  - clang
+before_install:
+  - sudo apt-get update -qq
+  - sudo apt-get install -y git
+  - git clone --depth=1 --branch=master git://github.com/mupen64plus/mupen64plus-core.git deps/mupen64plus-core
+env:
+ - DUMP=0
+ - DUMP=1
+script:
+ - make -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 clean && LDFLAGS="-Wl,--no-add-needed -Wl,--no-undefined" OPTFLAGS="-O2" make CC="${CC}" CXX="${CXX}" -j$(nproc) -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 all
diff --git a/projects/msvc11/mupen64plus-rsp-hle.vcxproj b/projects/msvc11/mupen64plus-rsp-hle.vcxproj
index 9e61f99..7613a5e 100644
--- a/projects/msvc11/mupen64plus-rsp-hle.vcxproj
+++ b/projects/msvc11/mupen64plus-rsp-hle.vcxproj
@@ -55,7 +55,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..\mupen64plus-core\src\api;..\..\src\msvc-compat;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@@ -74,7 +74,7 @@
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
-      <AdditionalIncludeDirectories>..\..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..\mupen64plus-core\src\api;..\..\src\msvc-compat;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <PrecompiledHeader>
diff --git a/projects/msvc8/mupen64plus-rsp-hle.vcproj b/projects/msvc8/mupen64plus-rsp-hle.vcproj
index 6e148b3..592cc08 100644
--- a/projects/msvc8/mupen64plus-rsp-hle.vcproj
+++ b/projects/msvc8/mupen64plus-rsp-hle.vcproj
@@ -40,7 +40,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\mupen64plus-core\src\api"
+				AdditionalIncludeDirectories="..\..\..\mupen64plus-core\src\api;..\..\src\msvc-compat"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
@@ -117,7 +117,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\..\..\mupen64plus-core\src\api"
+				AdditionalIncludeDirectories="..\..\..\mupen64plus-core\src\api;..\..\src\msvc-compat"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE"
 				RuntimeLibrary="2"
 				UsePrecompiledHeader="0"
diff --git a/src/alist.c b/src/alist.c
index dcb475a..da42f68 100644
--- a/src/alist.c
+++ b/src/alist.c
@@ -78,9 +78,11 @@ static void alist_envmix_mix(size_t n, int16_t** dst, const int16_t* gains, int1
 
 static int16_t ramp_step(struct ramp_t* ramp)
 {
+    bool target_reached;
+
     ramp->value += ramp->step;
 
-    bool target_reached = (ramp->step <= 0)
+    target_reached = (ramp->step <= 0)
         ? (ramp->value <= ramp->target)
         : (ramp->value >= ramp->target);
 
@@ -90,7 +92,7 @@ static int16_t ramp_step(struct ramp_t* ramp)
         ramp->step  = 0;
     }
 
-    return (ramp->value >> 16);
+    return (int16_t)(ramp->value >> 16);
 }
 
 /* global functions */
@@ -343,14 +345,14 @@ void alist_envmix_exp(
 
     *(int16_t *)(save_buffer +  0) = wet;               /* 0-1 */
     *(int16_t *)(save_buffer +  2) = dry;               /* 2-3 */
-    *(int32_t *)(save_buffer +  4) = ramps[0].target;   /* 4-5 */
-    *(int32_t *)(save_buffer +  6) = ramps[1].target;   /* 6-7 */
+    *(int32_t *)(save_buffer +  4) = (int32_t)ramps[0].target;   /* 4-5 */
+    *(int32_t *)(save_buffer +  6) = (int32_t)ramps[1].target;   /* 6-7 */
     *(int32_t *)(save_buffer +  8) = exp_rates[0];      /* 8-9 (save_buffer is a 16bit pointer) */
     *(int32_t *)(save_buffer + 10) = exp_rates[1];      /* 10-11 */
     *(int32_t *)(save_buffer + 12) = exp_seq[0];        /* 12-13 */
     *(int32_t *)(save_buffer + 14) = exp_seq[1];        /* 14-15 */
-    *(int32_t *)(save_buffer + 16) = ramps[0].value;    /* 12-13 */
-    *(int32_t *)(save_buffer + 18) = ramps[1].value;    /* 14-15 */
+    *(int32_t *)(save_buffer + 16) = (int32_t)ramps[0].value;    /* 12-13 */
+    *(int32_t *)(save_buffer + 18) = (int32_t)ramps[1].value;    /* 14-15 */
     memcpy(hle->dram + address, (uint8_t *)save_buffer, 80);
 }
 
@@ -422,14 +424,14 @@ void alist_envmix_ge(
 
     *(int16_t *)(save_buffer +  0) = wet;               /* 0-1 */
     *(int16_t *)(save_buffer +  2) = dry;               /* 2-3 */
-    *(int32_t *)(save_buffer +  4) = ramps[0].target;   /* 4-5 */
-    *(int32_t *)(save_buffer +  6) = ramps[1].target;   /* 6-7 */
-    *(int32_t *)(save_buffer +  8) = ramps[0].step;     /* 8-9 (save_buffer is a 16bit pointer) */
-    *(int32_t *)(save_buffer + 10) = ramps[1].step;     /* 10-11 */
+    *(int32_t *)(save_buffer +  4) = (int32_t)ramps[0].target;   /* 4-5 */
+    *(int32_t *)(save_buffer +  6) = (int32_t)ramps[1].target;   /* 6-7 */
+    *(int32_t *)(save_buffer +  8) = (int32_t)ramps[0].step;     /* 8-9 (save_buffer is a 16bit pointer) */
+    *(int32_t *)(save_buffer + 10) = (int32_t)ramps[1].step;     /* 10-11 */
     /**(int32_t *)(save_buffer + 12);*/                 /* 12-13 */
     /**(int32_t *)(save_buffer + 14);*/                 /* 14-15 */
-    *(int32_t *)(save_buffer + 16) = ramps[0].value;    /* 12-13 */
-    *(int32_t *)(save_buffer + 18) = ramps[1].value;    /* 14-15 */
+    *(int32_t *)(save_buffer + 16) = (int32_t)ramps[0].value;    /* 12-13 */
+    *(int32_t *)(save_buffer + 18) = (int32_t)ramps[1].value;    /* 14-15 */
     memcpy(hle->dram + address, (uint8_t *)save_buffer, 80);
 }
 
@@ -497,12 +499,12 @@ void alist_envmix_lin(
 
     *(int16_t *)(save_buffer +  0) = wet;            /* 0-1 */
     *(int16_t *)(save_buffer +  2) = dry;            /* 2-3 */
-    *(int16_t *)(save_buffer +  4) = ramps[0].target >> 16; /* 4-5 */
-    *(int16_t *)(save_buffer +  6) = ramps[1].target >> 16; /* 6-7 */
-    *(int32_t *)(save_buffer +  8) = ramps[0].step;  /* 8-9 (save_buffer is a 16bit pointer) */
-    *(int32_t *)(save_buffer + 10) = ramps[1].step;  /* 10-11 */
-    *(int32_t *)(save_buffer + 16) = ramps[0].value; /* 16-17 */
-    *(int32_t *)(save_buffer + 18) = ramps[1].value; /* 18-19 */
+    *(int16_t *)(save_buffer +  4) = (int16_t)(ramps[0].target >> 16); /* 4-5 */
+    *(int16_t *)(save_buffer +  6) = (int16_t)(ramps[1].target >> 16); /* 6-7 */
+    *(int32_t *)(save_buffer +  8) = (int32_t)ramps[0].step;  /* 8-9 (save_buffer is a 16bit pointer) */
+    *(int32_t *)(save_buffer + 10) = (int32_t)ramps[1].step;  /* 10-11 */
+    *(int32_t *)(save_buffer + 16) = (int32_t)ramps[0].value; /* 16-17 */
+    *(int32_t *)(save_buffer + 18) = (int32_t)ramps[1].value; /* 18-19 */
     memcpy(hle->dram + address, (uint8_t *)save_buffer, 80);
 }
 
diff --git a/src/arithmetics.h b/src/arithmetics.h
index 3d0edf6..9ffba7a 100644
--- a/src/arithmetics.h
+++ b/src/arithmetics.h
@@ -24,6 +24,8 @@
 
 #include <stdint.h>
 
+#include "common.h"
+
 static inline int16_t clamp_s16(int_fast32_t x)
 {
     x = (x < INT16_MIN) ? INT16_MIN: x;
diff --git a/src/audio.h b/src/audio.h
index e2c34cd..8942a78 100644
--- a/src/audio.h
+++ b/src/audio.h
@@ -25,6 +25,8 @@
 #include <stddef.h>
 #include <stdint.h>
 
+#include "common.h"
+
 extern const int16_t RESAMPLE_LUT[64 * 4];
 
 int32_t rdot(size_t n, const int16_t *x, const int16_t *y);
diff --git a/src/common.h b/src/common.h
index 3b28562..48a9229 100644
--- a/src/common.h
+++ b/src/common.h
@@ -29,5 +29,10 @@
 #  define UNUSED(x) UNUSED_ ## x
 #endif
 
+/* macro for inline keyword */
+#ifdef _MSC_VER
+#define inline __inline
+#endif
+
 #endif
 
diff --git a/src/hle.c b/src/hle.c
index d33fe6d..51286b9 100644
--- a/src/hle.c
+++ b/src/hle.c
@@ -60,8 +60,8 @@ static void normal_task_dispatching(struct hle_t* hle);
 static void non_task_dispatching(struct hle_t* hle);
 
 #ifdef ENABLE_TASK_DUMP
-static void dump_binary(const char *const filename, const unsigned char *const bytes,
-                        unsigned int size);
+static void dump_binary(struct hle_t* hle, const char *const filename,
+                        const unsigned char *const bytes, unsigned int size);
 static void dump_task(struct hle_t* hle, const char *const filename);
 static void dump_unknown_task(struct hle_t* hle, unsigned int sum);
 static void dump_unknown_non_task(struct hle_t* hle, unsigned int sum);
@@ -356,24 +356,24 @@ static void dump_unknown_task(struct hle_t* hle, unsigned int sum)
 
     /* dump ucode_boot */
     sprintf(&filename[0], "ucode_boot_%x.bin", sum);
-    dump_binary(filename, (void*)dram_u32(hle, *dmem_u32(hle, TASK_UCODE_BOOT)), *dmem_u32(hle, TASK_UCODE_BOOT_SIZE));
+    dump_binary(hle, filename, (void*)dram_u32(hle, *dmem_u32(hle, TASK_UCODE_BOOT)), *dmem_u32(hle, TASK_UCODE_BOOT_SIZE));
 
     /* dump ucode */
     if (ucode != 0) {
         sprintf(&filename[0], "ucode_%x.bin", sum);
-        dump_binary(filename, (void*)dram_u32(hle, ucode), 0xf80);
+        dump_binary(hle, filename, (void*)dram_u32(hle, ucode), 0xf80);
     }
 
     /* dump ucode_data */
     if (ucode_data != 0) {
         sprintf(&filename[0], "ucode_data_%x.bin", sum);
-        dump_binary(filename, (void*)dram_u32(hle, ucode_data), *dmem_u32(hle, TASK_UCODE_DATA_SIZE));
+        dump_binary(hle, filename, (void*)dram_u32(hle, ucode_data), *dmem_u32(hle, TASK_UCODE_DATA_SIZE));
     }
 
     /* dump data */
     if (data_ptr != 0) {
         sprintf(&filename[0], "data_%x.bin", sum);
-        dump_binary(filename, (void*)dram_u32(hle, data_ptr), *dmem_u32(hle, TASK_DATA_SIZE));
+        dump_binary(hle, filename, (void*)dram_u32(hle, data_ptr), *dmem_u32(hle, TASK_DATA_SIZE));
     }
 }
 
@@ -383,14 +383,14 @@ static void dump_unknown_non_task(struct hle_t* hle, unsigned int sum)
 
     /* dump IMEM & DMEM for further analysis */
     sprintf(&filename[0], "imem_%x.bin", sum);
-    dump_binary(filename, hle->imem, 0x1000);
+    dump_binary(hle, filename, hle->imem, 0x1000);
 
     sprintf(&filename[0], "dmem_%x.bin", sum);
-    dump_binary(filename, hle->dmem, 0x1000);
+    dump_binary(hle, filename, hle->dmem, 0x1000);
 }
 
-static void dump_binary(const char *const filename, const unsigned char *const bytes,
-                        unsigned int size)
+static void dump_binary(struct hle_t* hle, const char *const filename,
+                        const unsigned char *const bytes, unsigned int size)
 {
     FILE *f;
 
@@ -401,10 +401,10 @@ static void dump_binary(const char *const filename, const unsigned char *const b
         f = fopen(filename, "wb");
         if (f != NULL) {
             if (fwrite(bytes, 1, size, f) != size)
-                hleErrorMessage(hle->user_defined, "Writing error on %s", filename);
+                HleErrorMessage(hle->user_defined, "Writing error on %s", filename);
             fclose(f);
         } else
-            hleErrorMessage(hle->user_defined, "Couldn't open %s for writing !", filename);
+            HleErrorMessage(hle->user_defined, "Couldn't open %s for writing !", filename);
     } else
         fclose(f);
 }
diff --git a/src/memory.h b/src/memory.h
index 91a747b..8acc8c3 100644
--- a/src/memory.h
+++ b/src/memory.h
@@ -26,6 +26,7 @@
 #include <stddef.h>
 #include <stdint.h>
 
+#include "common.h"
 #include "hle_internal.h"
 
 #ifdef M64P_BIG_ENDIAN
diff --git a/src/arithmetics.h b/src/msvc-compat/stdbool.h
similarity index 76%
copy from src/arithmetics.h
copy to src/msvc-compat/stdbool.h
index 3d0edf6..07fe83e 100644
--- a/src/arithmetics.h
+++ b/src/msvc-compat/stdbool.h
@@ -1,5 +1,5 @@
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- *   Mupen64plus-rsp-hle - arithmetics.h                                   *
+ *   Mupen64plus-rsp-hle - stdbool.h                                       *
  *   Mupen64Plus homepage: http://code.google.com/p/mupen64plus/           *
  *   Copyright (C) 2014 Bobby Smiles                                       *
  *                                                                         *
@@ -19,18 +19,19 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.          *
  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
-#ifndef ARITHMETICS_H
-#define ARITHMETICS_H
+/* This header is only intended to be used with msvc compilers */
 
-#include <stdint.h>
+#pragma once
 
-static inline int16_t clamp_s16(int_fast32_t x)
-{
-    x = (x < INT16_MIN) ? INT16_MIN: x;
-    x = (x > INT16_MAX) ? INT16_MAX: x;
+typedef int _Bool;
 
-    return x;
-}
+/**
+ * The standard states that "an application may undefine and then possibly redefine the macro
+ * bool, true and false". However, such feature might be withdrawn in a future version.
+ **/
+#define bool _Bool
+#define true 1
+#define false 0
 
-#endif
+#define __bool_true_false_are_defined 1
 
diff --git a/src/plugin.c b/src/plugin.c
index f55063c..7ae85f6 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -22,7 +22,6 @@
  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 #include <stdarg.h>
-#include <string.h>
 #include <stdio.h>
 
 #include "common.h"
@@ -218,6 +217,5 @@ EXPORT void CALL InitiateRSP(RSP_INFO Rsp_Info, unsigned int* UNUSED(CycleCount)
 
 EXPORT void CALL RomClosed(void)
 {
-    memset(g_hle.dmem, 0, 0x1000);
-    memset(g_hle.imem, 0, 0x1000);
+    /* do nothing */
 }

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



More information about the Pkg-games-commits mailing list