[ Sven Eckelmann ]
[ Debian Janitor ]
New upstream release.
Debian Janitor
2 years ago
0 | sudo: required | |
1 | dist: xenial | |
0 | 2 | language: cpp |
1 | 3 | compiler: |
2 | 4 | - gcc |
3 | 5 | - clang |
6 | addons: | |
7 | apt: | |
8 | packages: | |
9 | - git | |
4 | 10 | before_install: |
5 | - sudo apt-get update -qq | |
6 | - sudo apt-get install -y git | |
7 | 11 | - git clone --depth=1 --branch=master git://github.com/mupen64plus/mupen64plus-core.git deps/mupen64plus-core |
8 | 12 | env: |
9 | 13 | - DUMP=0 |
10 | 14 | - DUMP=1 |
11 | 15 | script: |
12 | 16 | - 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 |
17 | ||
18 | # extra mxe build entries | |
19 | matrix: | |
20 | include: | |
21 | - env: | |
22 | - MXE_CPU=i686 | |
23 | - PATH="/usr/lib/mxe/usr/bin/:$PATH" | |
24 | before_install: | |
25 | - curl -sSL "https://mirror.mxe.cc/repos/apt/client-conf/mxeapt.gpg" | sudo -E apt-key add - | |
26 | - echo "deb https://mirror.mxe.cc/repos/apt xenial main" | sudo tee -a /etc/apt/sources.list | |
27 | - sudo apt-get update -qq | |
28 | - sudo apt-get -y --allow-unauthenticated install mxe-i686-w64-mingw32.shared-gcc | |
29 | - git clone --depth=1 --branch=master git://github.com/mupen64plus/mupen64plus-core.git deps/mupen64plus-core | |
30 | script: | |
31 | - make UNAME=MINGW CROSS_COMPILE="${MXE_CPU}-w64-mingw32.shared-" CC="${MXE_CPU}-w64-mingw32.shared-gcc" CXX="${MXE_CPU}-w64-mingw32.shared-g++" HOST_CPU="${MXE_CPU}" -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 clean && | |
32 | make UNAME=MINGW CROSS_COMPILE="${MXE_CPU}-w64-mingw32.shared-" CC="${MXE_CPU}-w64-mingw32.shared-gcc" CXX="${MXE_CPU}-w64-mingw32.shared-g++" HOST_CPU="${MXE_CPU}" -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 -j$(nproc) all | |
33 | ||
34 | - env: | |
35 | - MXE_CPU=x86_64 | |
36 | - PATH="/usr/lib/mxe/usr/bin/:$PATH" | |
37 | before_install: | |
38 | - curl -sSL "https://mirror.mxe.cc/repos/apt/client-conf/mxeapt.gpg" | sudo -E apt-key add - | |
39 | - echo "deb https://mirror.mxe.cc/repos/apt xenial main" | sudo tee -a /etc/apt/sources.list | |
40 | - sudo apt-get update -qq | |
41 | - sudo apt-get -y --allow-unauthenticated install mxe-x86-64-w64-mingw32.shared-gcc | |
42 | - git clone --depth=1 --branch=master git://github.com/mupen64plus/mupen64plus-core.git deps/mupen64plus-core | |
43 | script: | |
44 | - make UNAME=MINGW CROSS_COMPILE="${MXE_CPU}-w64-mingw32.shared-" CC="${MXE_CPU}-w64-mingw32.shared-gcc" CXX="${MXE_CPU}-w64-mingw32.shared-g++" HOST_CPU="${MXE_CPU}" -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 clean && | |
45 | make UNAME=MINGW CROSS_COMPILE="${MXE_CPU}-w64-mingw32.shared-" CC="${MXE_CPU}-w64-mingw32.shared-gcc" CXX="${MXE_CPU}-w64-mingw32.shared-g++" HOST_CPU="${MXE_CPU}" -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 -j$(nproc) all |
29 | 29 | Version 2, June 1991 |
30 | 30 | |
31 | 31 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. |
32 | 675 Mass Ave, Cambridge, MA 02139, USA | |
32 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
33 | 33 | Everyone is permitted to copy and distribute verbatim copies |
34 | 34 | of this license document, but changing it is not allowed. |
35 | 35 |
0 | 0 | RSP High-Level Emulation plugin for Mupen64Plus |
1 | 1 | ----------------------------------------------- |
2 | ||
3 | Mupen64Plus-rsp-hle v2.5.9 - February 10, 2019 | |
4 | ---------------------------------------------- | |
5 | - *** BETA RELEASE *** For Testing Only *** | |
2 | 6 | |
3 | 7 | Mupen64Plus-rsp-hle v2.5 - April 26, 2015 |
4 | 8 | ------------------------------------------------- |
0 | mupen64plus-rsp-hle (2.5-6) UNRELEASED; urgency=medium | |
1 | ||
0 | mupen64plus-rsp-hle (2.5.9-1) UNRELEASED; urgency=medium | |
1 | ||
2 | [ Sven Eckelmann ] | |
2 | 3 | * debian/control: |
3 | 4 | - Upgraded to policy 4.5.1, no changes required |
4 | 5 | - Allow build without (fake)root |
11 | 12 | * debian/rules: |
12 | 13 | - Drop default flag --as-needed from linker flags |
13 | 14 | |
14 | -- Sven Eckelmann <sven@narfation.org> Fri, 04 Oct 2019 13:23:00 +0200 | |
15 | [ Debian Janitor ] | |
16 | * New upstream release. | |
17 | ||
18 | -- Sven Eckelmann <sven@narfation.org> Wed, 26 May 2021 14:42:21 -0000 | |
15 | 19 | |
16 | 20 | mupen64plus-rsp-hle (2.5-5) unstable; urgency=medium |
17 | 21 |
0 | <?xml version="1.0" encoding="utf-8"?> | |
1 | <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
2 | <ItemGroup Label="ProjectConfigurations"> | |
3 | <ProjectConfiguration Include="Debug|Win32"> | |
4 | <Configuration>Debug</Configuration> | |
5 | <Platform>Win32</Platform> | |
6 | </ProjectConfiguration> | |
7 | <ProjectConfiguration Include="Release|Win32"> | |
8 | <Configuration>Release</Configuration> | |
9 | <Platform>Win32</Platform> | |
10 | </ProjectConfiguration> | |
11 | </ItemGroup> | |
12 | <PropertyGroup Label="Globals"> | |
13 | <ProjectGuid>{2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}</ProjectGuid> | |
14 | <RootNamespace>mupen64plusrsphle</RootNamespace> | |
15 | <Keyword>Win32Proj</Keyword> | |
16 | </PropertyGroup> | |
17 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | |
18 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | |
19 | <ConfigurationType>DynamicLibrary</ConfigurationType> | |
20 | <CharacterSet>MultiByte</CharacterSet> | |
21 | <WholeProgramOptimization>true</WholeProgramOptimization> | |
22 | <PlatformToolset>v120</PlatformToolset> | |
23 | </PropertyGroup> | |
24 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> | |
25 | <ConfigurationType>DynamicLibrary</ConfigurationType> | |
26 | <CharacterSet>MultiByte</CharacterSet> | |
27 | <PlatformToolset>v120</PlatformToolset> | |
28 | </PropertyGroup> | |
29 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | |
30 | <ImportGroup Label="ExtensionSettings"> | |
31 | </ImportGroup> | |
32 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> | |
33 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | |
34 | </ImportGroup> | |
35 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> | |
36 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | |
37 | </ImportGroup> | |
38 | <PropertyGroup Label="UserMacros" /> | |
39 | <PropertyGroup> | |
40 | <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion> | |
41 | <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir> | |
42 | <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir> | |
43 | <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> | |
44 | <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir> | |
45 | <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir> | |
46 | <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> | |
47 | <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> | |
48 | <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> | |
49 | <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> | |
50 | <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> | |
51 | <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> | |
52 | <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> | |
53 | </PropertyGroup> | |
54 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | |
55 | <ClCompile> | |
56 | <Optimization>Disabled</Optimization> | |
57 | <AdditionalIncludeDirectories>..\..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | |
58 | <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
59 | <MinimalRebuild>true</MinimalRebuild> | |
60 | <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
61 | <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> | |
62 | <PrecompiledHeader> | |
63 | </PrecompiledHeader> | |
64 | <WarningLevel>Level3</WarningLevel> | |
65 | <DebugInformationFormat>EditAndContinue</DebugInformationFormat> | |
66 | <CompileAs>Default</CompileAs> | |
67 | </ClCompile> | |
68 | <Link> | |
69 | <GenerateDebugInformation>true</GenerateDebugInformation> | |
70 | <SubSystem>Windows</SubSystem> | |
71 | <TargetMachine>MachineX86</TargetMachine> | |
72 | </Link> | |
73 | </ItemDefinitionGroup> | |
74 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | |
75 | <ClCompile> | |
76 | <AdditionalIncludeDirectories>..\..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | |
77 | <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
78 | <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
79 | <PrecompiledHeader> | |
80 | </PrecompiledHeader> | |
81 | <WarningLevel>Level3</WarningLevel> | |
82 | <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> | |
83 | <CompileAs>Default</CompileAs> | |
84 | </ClCompile> | |
85 | <Link> | |
86 | <GenerateDebugInformation>true</GenerateDebugInformation> | |
87 | <SubSystem>Windows</SubSystem> | |
88 | <OptimizeReferences>true</OptimizeReferences> | |
89 | <EnableCOMDATFolding>true</EnableCOMDATFolding> | |
90 | <TargetMachine>MachineX86</TargetMachine> | |
91 | </Link> | |
92 | </ItemDefinitionGroup> | |
93 | <ItemGroup> | |
94 | <ClCompile Include="..\..\src\alist.c" /> | |
95 | <ClCompile Include="..\..\src\alist_audio.c" /> | |
96 | <ClCompile Include="..\..\src\alist_naudio.c" /> | |
97 | <ClCompile Include="..\..\src\alist_nead.c" /> | |
98 | <ClCompile Include="..\..\src\audio.c" /> | |
99 | <ClCompile Include="..\..\src\cicx105.c" /> | |
100 | <ClCompile Include="..\..\src\hle.c" /> | |
101 | <ClCompile Include="..\..\src\jpeg.c" /> | |
102 | <ClCompile Include="..\..\src\memory.c" /> | |
103 | <ClCompile Include="..\..\src\mp3.c" /> | |
104 | <ClCompile Include="..\..\src\musyx.c" /> | |
105 | <ClCompile Include="..\..\src\plugin.c" /> | |
106 | </ItemGroup> | |
107 | <ItemGroup> | |
108 | <ClInclude Include="..\..\src\alist.h" /> | |
109 | <ClInclude Include="..\..\src\arithmetics.h" /> | |
110 | <ClInclude Include="..\..\src\audio.h" /> | |
111 | <ClInclude Include="..\..\src\common.h" /> | |
112 | <ClInclude Include="..\..\src\hle.h" /> | |
113 | <ClInclude Include="..\..\src\hle_external.h" /> | |
114 | <ClInclude Include="..\..\src\hle_internal.h" /> | |
115 | <ClInclude Include="..\..\src\memory.h" /> | |
116 | <ClInclude Include="..\..\src\ucodes.h" /> | |
117 | </ItemGroup> | |
118 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | |
119 | <ImportGroup Label="ExtensionTargets"> | |
120 | </ImportGroup> | |
121 | </Project>⏎ | |
0 | <?xml version="1.0" encoding="utf-8"?> | |
1 | <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
2 | <ItemGroup Label="ProjectConfigurations"> | |
3 | <ProjectConfiguration Include="Debug|Win32"> | |
4 | <Configuration>Debug</Configuration> | |
5 | <Platform>Win32</Platform> | |
6 | </ProjectConfiguration> | |
7 | <ProjectConfiguration Include="Debug|x64"> | |
8 | <Configuration>Debug</Configuration> | |
9 | <Platform>x64</Platform> | |
10 | </ProjectConfiguration> | |
11 | <ProjectConfiguration Include="Release|Win32"> | |
12 | <Configuration>Release</Configuration> | |
13 | <Platform>Win32</Platform> | |
14 | </ProjectConfiguration> | |
15 | <ProjectConfiguration Include="Release|x64"> | |
16 | <Configuration>Release</Configuration> | |
17 | <Platform>x64</Platform> | |
18 | </ProjectConfiguration> | |
19 | </ItemGroup> | |
20 | <PropertyGroup Label="Globals"> | |
21 | <ProjectGuid>{2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}</ProjectGuid> | |
22 | <RootNamespace>mupen64plusrsphle</RootNamespace> | |
23 | <Keyword>Win32Proj</Keyword> | |
24 | </PropertyGroup> | |
25 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | |
26 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | |
27 | <ConfigurationType>DynamicLibrary</ConfigurationType> | |
28 | <CharacterSet>MultiByte</CharacterSet> | |
29 | <WholeProgramOptimization>true</WholeProgramOptimization> | |
30 | <PlatformToolset>v120_xp</PlatformToolset> | |
31 | </PropertyGroup> | |
32 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> | |
33 | <ConfigurationType>DynamicLibrary</ConfigurationType> | |
34 | <CharacterSet>MultiByte</CharacterSet> | |
35 | <WholeProgramOptimization>true</WholeProgramOptimization> | |
36 | <PlatformToolset>v120</PlatformToolset> | |
37 | </PropertyGroup> | |
38 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> | |
39 | <ConfigurationType>DynamicLibrary</ConfigurationType> | |
40 | <CharacterSet>MultiByte</CharacterSet> | |
41 | <PlatformToolset>v120</PlatformToolset> | |
42 | </PropertyGroup> | |
43 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> | |
44 | <ConfigurationType>DynamicLibrary</ConfigurationType> | |
45 | <CharacterSet>MultiByte</CharacterSet> | |
46 | <PlatformToolset>v120</PlatformToolset> | |
47 | </PropertyGroup> | |
48 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | |
49 | <ImportGroup Label="ExtensionSettings"> | |
50 | </ImportGroup> | |
51 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> | |
52 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | |
53 | </ImportGroup> | |
54 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> | |
55 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | |
56 | </ImportGroup> | |
57 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> | |
58 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | |
59 | </ImportGroup> | |
60 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> | |
61 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | |
62 | </ImportGroup> | |
63 | <PropertyGroup Label="UserMacros" /> | |
64 | <PropertyGroup> | |
65 | <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion> | |
66 | <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir> | |
67 | <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir> | |
68 | <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> | |
69 | <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> | |
70 | <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir> | |
71 | <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir> | |
72 | <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> | |
73 | <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> | |
74 | <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> | |
75 | <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet> | |
76 | <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> | |
77 | <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> | |
78 | <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> | |
79 | <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> | |
80 | <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> | |
81 | <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet> | |
82 | <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> | |
83 | <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> | |
84 | <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> | |
85 | <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> | |
86 | </PropertyGroup> | |
87 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | |
88 | <ClCompile> | |
89 | <Optimization>Disabled</Optimization> | |
90 | <AdditionalIncludeDirectories>..\..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | |
91 | <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
92 | <MinimalRebuild>true</MinimalRebuild> | |
93 | <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
94 | <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> | |
95 | <PrecompiledHeader> | |
96 | </PrecompiledHeader> | |
97 | <WarningLevel>Level3</WarningLevel> | |
98 | <DebugInformationFormat>EditAndContinue</DebugInformationFormat> | |
99 | <CompileAs>Default</CompileAs> | |
100 | </ClCompile> | |
101 | <Link> | |
102 | <GenerateDebugInformation>true</GenerateDebugInformation> | |
103 | <SubSystem>Windows</SubSystem> | |
104 | <TargetMachine>MachineX86</TargetMachine> | |
105 | </Link> | |
106 | </ItemDefinitionGroup> | |
107 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | |
108 | <ClCompile> | |
109 | <Optimization>Disabled</Optimization> | |
110 | <AdditionalIncludeDirectories>..\..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | |
111 | <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
112 | <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
113 | <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> | |
114 | <PrecompiledHeader> | |
115 | </PrecompiledHeader> | |
116 | <WarningLevel>Level3</WarningLevel> | |
117 | <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> | |
118 | <CompileAs>Default</CompileAs> | |
119 | </ClCompile> | |
120 | <Link> | |
121 | <GenerateDebugInformation>true</GenerateDebugInformation> | |
122 | <SubSystem>Windows</SubSystem> | |
123 | </Link> | |
124 | </ItemDefinitionGroup> | |
125 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | |
126 | <ClCompile> | |
127 | <AdditionalIncludeDirectories>..\..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | |
128 | <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
129 | <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
130 | <PrecompiledHeader> | |
131 | </PrecompiledHeader> | |
132 | <WarningLevel>Level3</WarningLevel> | |
133 | <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> | |
134 | <CompileAs>Default</CompileAs> | |
135 | </ClCompile> | |
136 | <Link> | |
137 | <GenerateDebugInformation>true</GenerateDebugInformation> | |
138 | <SubSystem>Windows</SubSystem> | |
139 | <OptimizeReferences>true</OptimizeReferences> | |
140 | <EnableCOMDATFolding>true</EnableCOMDATFolding> | |
141 | <TargetMachine>MachineX86</TargetMachine> | |
142 | </Link> | |
143 | </ItemDefinitionGroup> | |
144 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | |
145 | <ClCompile> | |
146 | <AdditionalIncludeDirectories>..\..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | |
147 | <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
148 | <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
149 | <PrecompiledHeader> | |
150 | </PrecompiledHeader> | |
151 | <WarningLevel>Level3</WarningLevel> | |
152 | <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> | |
153 | <CompileAs>Default</CompileAs> | |
154 | </ClCompile> | |
155 | <Link> | |
156 | <GenerateDebugInformation>true</GenerateDebugInformation> | |
157 | <SubSystem>Windows</SubSystem> | |
158 | <OptimizeReferences>true</OptimizeReferences> | |
159 | <EnableCOMDATFolding>true</EnableCOMDATFolding> | |
160 | </Link> | |
161 | </ItemDefinitionGroup> | |
162 | <ItemGroup> | |
163 | <ClCompile Include="..\..\src\alist.c" /> | |
164 | <ClCompile Include="..\..\src\alist_audio.c" /> | |
165 | <ClCompile Include="..\..\src\alist_naudio.c" /> | |
166 | <ClCompile Include="..\..\src\alist_nead.c" /> | |
167 | <ClCompile Include="..\..\src\audio.c" /> | |
168 | <ClCompile Include="..\..\src\cicx105.c" /> | |
169 | <ClCompile Include="..\..\src\hle.c" /> | |
170 | <ClCompile Include="..\..\src\jpeg.c" /> | |
171 | <ClCompile Include="..\..\src\memory.c" /> | |
172 | <ClCompile Include="..\..\src\mp3.c" /> | |
173 | <ClCompile Include="..\..\src\musyx.c" /> | |
174 | <ClCompile Include="..\..\src\osal_dynamiclib_win32.c" /> | |
175 | <ClCompile Include="..\..\src\plugin.c" /> | |
176 | <ClCompile Include="..\..\src\re2.c" /> | |
177 | </ItemGroup> | |
178 | <ItemGroup> | |
179 | <ClInclude Include="..\..\src\alist.h" /> | |
180 | <ClInclude Include="..\..\src\arithmetics.h" /> | |
181 | <ClInclude Include="..\..\src\audio.h" /> | |
182 | <ClInclude Include="..\..\src\common.h" /> | |
183 | <ClInclude Include="..\..\src\hle.h" /> | |
184 | <ClInclude Include="..\..\src\hle_external.h" /> | |
185 | <ClInclude Include="..\..\src\hle_internal.h" /> | |
186 | <ClInclude Include="..\..\src\memory.h" /> | |
187 | <ClInclude Include="..\..\src\osal_dynamiclib.h" /> | |
188 | <ClInclude Include="..\..\src\ucodes.h" /> | |
189 | </ItemGroup> | |
190 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | |
191 | <ImportGroup Label="ExtensionTargets"> | |
192 | </ImportGroup> | |
193 | </Project> |
0 | 0 | #/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
1 | 1 | # * mupen64plus-rsp-hle - Makefile * |
2 | # * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * | |
2 | # * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | 3 | # * Copyright (C) 2008-2009 Richard Goedeken * |
4 | 4 | # * Copyright (C) 2007-2008 DarkJeztr Tillin9 * |
5 | 5 | # * * |
52 | 52 | OS = FREEBSD |
53 | 53 | SO_EXTENSION = so |
54 | 54 | SHARED = -shared |
55 | $(warning OS type "$(UNAME)" not officially supported.') | |
56 | 55 | endif |
57 | 56 | ifneq ("$(filter GNU/kFreeBSD kfreebsd,$(UNAME))","") |
58 | 57 | OS = LINUX |
66 | 65 | PIC = 0 |
67 | 66 | endif |
68 | 67 | ifeq ("$(OS)","NONE") |
69 | $(error OS type "$(UNAME)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') | |
68 | $(error OS type "$(UNAME)" not supported. Please file bug report at 'https://github.com/mupen64plus/mupen64plus-core/issues') | |
70 | 69 | endif |
71 | 70 | |
72 | 71 | # detect system architecture |
116 | 115 | PIC ?= 1 |
117 | 116 | $(warning Architecture "$(HOST_CPU)" not officially supported.') |
118 | 117 | endif |
118 | ifneq ("$(filter aarch64,$(HOST_CPU))","") | |
119 | CPU := AARCH | |
120 | ARCH_DETECTED := 64BITS | |
121 | PIC ?= 1 | |
122 | NEW_DYNAREC := 1 | |
123 | NO_ASM := 1 | |
124 | endif | |
119 | 125 | ifeq ("$(CPU)","NONE") |
120 | $(error CPU type "$(HOST_CPU)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') | |
126 | $(error CPU type "$(HOST_CPU)" not supported. Please file bug report at 'https://github.com/mupen64plus/mupen64plus-core/issues') | |
121 | 127 | endif |
122 | 128 | |
123 | 129 | # base CFLAGS, LDLIBS, and LDFLAGS |
151 | 157 | ifeq ($(OS), LINUX) |
152 | 158 | # only export api symbols |
153 | 159 | LDFLAGS += -Wl,-version-script,$(SRCDIR)/rsp_api_export.ver |
160 | LDLIBS += -ldl | |
154 | 161 | endif |
155 | 162 | ifeq ($(OS), OSX) |
156 | #xcode-select has been around since XCode 3.0, i.e. OS X 10.5 | |
157 | OSX_SDK_ROOT = $(shell xcode-select -print-path)/Platforms/MacOSX.platform/Developer/SDKs | |
158 | OSX_SDK_PATH = $(OSX_SDK_ROOT)/$(shell ls $(OSX_SDK_ROOT) | tail -1) | |
163 | OSX_SDK_PATH = $(shell xcrun --sdk macosx --show-sdk-path) | |
159 | 164 | |
160 | 165 | ifeq ($(CPU), X86) |
161 | 166 | ifeq ($(ARCH_DETECTED), 64BITS) |
210 | 215 | CFLAGS += -g |
211 | 216 | INSTALL_STRIP_FLAG ?= |
212 | 217 | else |
218 | CFLAGS += -DNDEBUG | |
213 | 219 | ifneq ($(OS),OSX) |
214 | 220 | INSTALL_STRIP_FLAG ?= -s |
215 | 221 | endif |
248 | 254 | $(SRCDIR)/memory.c \ |
249 | 255 | $(SRCDIR)/mp3.c \ |
250 | 256 | $(SRCDIR)/musyx.c \ |
257 | $(SRCDIR)/re2.c \ | |
251 | 258 | $(SRCDIR)/plugin.c |
259 | ||
260 | ifeq ($(OS), MINGW) | |
261 | SOURCE += \ | |
262 | $(SRCDIR)/osal_dynamiclib_win32.c | |
263 | else | |
264 | SOURCE += \ | |
265 | $(SRCDIR)/osal_dynamiclib_unix.c | |
266 | endif | |
252 | 267 | |
253 | 268 | # generate a list of object files build, make a temporary directory for them |
254 | 269 | OBJECTS := $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(filter %.c, $(SOURCE))) |
0 | 0 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
1 | 1 | * Mupen64plus-rsp-hle - alist.c * |
2 | * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * | |
2 | * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | 3 | * Copyright (C) 2014 Bobby Smiles * |
4 | 4 | * Copyright (C) 2009 Richard Goedeken * |
5 | 5 | * Copyright (C) 2002 Hacktarux * |
49 | 49 | |
50 | 50 | static int16_t* sample(struct hle_t* hle, unsigned pos) |
51 | 51 | { |
52 | return (int16_t*)hle->alist_buffer + (pos ^ S); | |
52 | return (int16_t*)hle->alist_buffer + ((pos ^ S) & 0xfff); | |
53 | 53 | } |
54 | 54 | |
55 | 55 | static uint8_t* alist_u8(struct hle_t* hle, uint16_t dmem) |
56 | 56 | { |
57 | return u8(hle->alist_buffer, dmem); | |
57 | return (uint8_t*)(hle->alist_buffer + ((dmem ^ S8) & 0xfff)); | |
58 | 58 | } |
59 | 59 | |
60 | 60 | static int16_t* alist_s16(struct hle_t* hle, uint16_t dmem) |
61 | 61 | { |
62 | return (int16_t*)u16(hle->alist_buffer, dmem); | |
62 | return (int16_t*)(hle->alist_buffer + ((dmem ^ S16) & 0xfff)); | |
63 | 63 | } |
64 | 64 | |
65 | 65 | |
281 | 281 | int x, y; |
282 | 282 | short save_buffer[40]; |
283 | 283 | |
284 | memcpy((uint8_t *)save_buffer, (hle->dram + address), sizeof(save_buffer)); | |
284 | 285 | if (init) { |
285 | 286 | ramps[0].value = (vol[0] << 16); |
286 | 287 | ramps[1].value = (vol[1] << 16); |
291 | 292 | exp_seq[0] = (vol[0] * rate[0]); |
292 | 293 | exp_seq[1] = (vol[1] * rate[1]); |
293 | 294 | } else { |
294 | memcpy((uint8_t *)save_buffer, (hle->dram + address), 80); | |
295 | 295 | wet = *(int16_t *)(save_buffer + 0); /* 0-1 */ |
296 | 296 | dry = *(int16_t *)(save_buffer + 2); /* 2-3 */ |
297 | 297 | ramps[0].target = *(int32_t *)(save_buffer + 4); /* 4-5 */ |
353 | 353 | *(int32_t *)(save_buffer + 14) = exp_seq[1]; /* 14-15 */ |
354 | 354 | *(int32_t *)(save_buffer + 16) = (int32_t)ramps[0].value; /* 12-13 */ |
355 | 355 | *(int32_t *)(save_buffer + 18) = (int32_t)ramps[1].value; /* 14-15 */ |
356 | memcpy(hle->dram + address, (uint8_t *)save_buffer, 80); | |
356 | memcpy(hle->dram + address, (uint8_t *)save_buffer, sizeof(save_buffer)); | |
357 | 357 | } |
358 | 358 | |
359 | 359 | void alist_envmix_ge( |
381 | 381 | struct ramp_t ramps[2]; |
382 | 382 | short save_buffer[40]; |
383 | 383 | |
384 | memcpy((uint8_t *)save_buffer, (hle->dram + address), 80); | |
384 | 385 | if (init) { |
385 | 386 | ramps[0].value = (vol[0] << 16); |
386 | 387 | ramps[1].value = (vol[1] << 16); |
389 | 390 | ramps[0].step = rate[0] / 8; |
390 | 391 | ramps[1].step = rate[1] / 8; |
391 | 392 | } else { |
392 | memcpy((uint8_t *)save_buffer, (hle->dram + address), 80); | |
393 | 393 | wet = *(int16_t *)(save_buffer + 0); /* 0-1 */ |
394 | 394 | dry = *(int16_t *)(save_buffer + 2); /* 2-3 */ |
395 | 395 | ramps[0].target = *(int32_t *)(save_buffer + 4); /* 4-5 */ |
457 | 457 | int16_t* const wl = (int16_t*)(hle->alist_buffer + dmem_wl); |
458 | 458 | int16_t* const wr = (int16_t*)(hle->alist_buffer + dmem_wr); |
459 | 459 | |
460 | memcpy((uint8_t *)save_buffer, hle->dram + address, 80); | |
460 | 461 | if (init) { |
461 | 462 | ramps[0].step = rate[0] / 8; |
462 | 463 | ramps[0].value = (vol[0] << 16); |
466 | 467 | ramps[1].target = (target[1] << 16); |
467 | 468 | } |
468 | 469 | else { |
469 | memcpy((uint8_t *)save_buffer, hle->dram + address, 80); | |
470 | 470 | wet = *(int16_t *)(save_buffer + 0); /* 0-1 */ |
471 | 471 | dry = *(int16_t *)(save_buffer + 2); /* 2-3 */ |
472 | 472 | ramps[0].target = *(int16_t *)(save_buffer + 4) << 16; /* 4-5 */ |
665 | 665 | while (count != 0) { |
666 | 666 | const int16_t* lut = RESAMPLE_LUT + ((pitch_accu & 0xfc00) >> 8); |
667 | 667 | |
668 | *sample(hle, opos++) = clamp_s16( | |
669 | ((*sample(hle, ipos ) * lut[0]) >> 15) + | |
670 | ((*sample(hle, ipos + 1) * lut[1]) >> 15) + | |
671 | ((*sample(hle, ipos + 2) * lut[2]) >> 15) + | |
672 | ((*sample(hle, ipos + 3) * lut[3]) >> 15)); | |
668 | *sample(hle, opos++) = clamp_s16( ( | |
669 | (*sample(hle, ipos ) * lut[0]) + | |
670 | (*sample(hle, ipos + 1) * lut[1]) + | |
671 | (*sample(hle, ipos + 2) * lut[2]) + | |
672 | (*sample(hle, ipos + 3) * lut[3]) ) >> 15); | |
673 | 673 | |
674 | 674 | pitch_accu += pitch; |
675 | 675 | ipos += (pitch_accu >> 16); |
960 | 960 | count -= 16; |
961 | 961 | } while (count != 0); |
962 | 962 | |
963 | dram_store_u16(hle, (uint16_t*)(dst - 4), address, 4); | |
963 | dram_store_u32(hle, (uint32_t*)(dst - 4), address, 2); | |
964 | 964 | } |
965 | 965 | |
966 | 966 | void alist_iirf( |
0 | 0 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
1 | 1 | * Mupen64plus-rsp-hle - alist.h * |
2 | * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * | |
2 | * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | 3 | * Copyright (C) 2014 Bobby Smiles * |
4 | 4 | * * |
5 | 5 | * This program is free software; you can redistribute it and/or modify * |
0 | 0 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
1 | 1 | * Mupen64plus-rsp-hle - alist_audio.c * |
2 | * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * | |
2 | * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | 3 | * Copyright (C) 2014 Bobby Smiles * |
4 | 4 | * Copyright (C) 2009 Richard Goedeken * |
5 | 5 | * Copyright (C) 2002 Hacktarux * |
56 | 56 | static void CLEARBUFF(struct hle_t* hle, uint32_t w1, uint32_t w2) |
57 | 57 | { |
58 | 58 | uint16_t dmem = w1 + DMEM_BASE; |
59 | uint16_t count = w2; | |
59 | uint16_t count = w2 & 0xfff; | |
60 | 60 | |
61 | 61 | if (count == 0) |
62 | 62 | return; |
110 | 110 | |
111 | 111 | alist_resample( |
112 | 112 | hle, |
113 | flags & 0x1, | |
113 | flags & A_INIT, | |
114 | 114 | flags & 0x2, |
115 | 115 | hle->alist_audio.out, |
116 | 116 | hle->alist_audio.in, |
151 | 151 | |
152 | 152 | alist_adpcm( |
153 | 153 | hle, |
154 | flags & 0x1, | |
155 | flags & 0x2, | |
154 | flags & A_INIT, | |
155 | flags & A_LOOP, | |
156 | 156 | false, /* unsupported in this ucode */ |
157 | 157 | hle->alist_audio.out, |
158 | 158 | hle->alist_audio.in, |
277 | 277 | |
278 | 278 | clear_segments(hle); |
279 | 279 | alist_process(hle, ABI, 0x10); |
280 | rsp_break(hle, SP_STATUS_TASKDONE); | |
280 | 281 | } |
281 | 282 | |
282 | 283 | void alist_process_audio_ge(struct hle_t* hle) |
290 | 291 | |
291 | 292 | clear_segments(hle); |
292 | 293 | alist_process(hle, ABI, 0x10); |
294 | rsp_break(hle, SP_STATUS_TASKDONE); | |
293 | 295 | } |
294 | 296 | |
295 | 297 | void alist_process_audio_bc(struct hle_t* hle) |
303 | 305 | |
304 | 306 | clear_segments(hle); |
305 | 307 | alist_process(hle, ABI, 0x10); |
306 | } | |
308 | rsp_break(hle, SP_STATUS_TASKDONE); | |
309 | } |
0 | 0 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
1 | 1 | * Mupen64plus-rsp-hle - alist_naudio.c * |
2 | * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * | |
2 | * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | 3 | * Copyright (C) 2014 Bobby Smiles * |
4 | 4 | * Copyright (C) 2009 Richard Goedeken * |
5 | 5 | * Copyright (C) 2002 Hacktarux * |
107 | 107 | { |
108 | 108 | uint8_t flags = (w1 >> 16); |
109 | 109 | |
110 | if (flags & 0x4) { | |
111 | if (flags & 0x2) { | |
110 | if (flags & A_VOL) { | |
111 | if (flags & A_LEFT) { | |
112 | 112 | hle->alist_naudio.vol[0] = w1; |
113 | 113 | hle->alist_naudio.dry = (w2 >> 16); |
114 | 114 | hle->alist_naudio.wet = w2; |
115 | 115 | } |
116 | else { | |
116 | else { /* A_RIGHT */ | |
117 | 117 | hle->alist_naudio.target[1] = w1; |
118 | 118 | hle->alist_naudio.rate[1] = w2; |
119 | 119 | } |
120 | 120 | } |
121 | else { | |
121 | else { /* A_RATE */ | |
122 | 122 | hle->alist_naudio.target[0] = w1; |
123 | 123 | hle->alist_naudio.rate[0] = w2; |
124 | 124 | } |
133 | 133 | |
134 | 134 | alist_envmix_lin( |
135 | 135 | hle, |
136 | flags & 0x1, | |
136 | flags & A_INIT, | |
137 | 137 | NAUDIO_DRY_LEFT, |
138 | 138 | NAUDIO_DRY_RIGHT, |
139 | 139 | NAUDIO_WET_LEFT, |
151 | 151 | static void CLEARBUFF(struct hle_t* hle, uint32_t w1, uint32_t w2) |
152 | 152 | { |
153 | 153 | uint16_t dmem = w1 + NAUDIO_MAIN; |
154 | uint16_t count = w2; | |
154 | uint16_t count = w2 & 0xfff; | |
155 | 155 | |
156 | 156 | alist_clear(hle, dmem, count); |
157 | 157 | } |
215 | 215 | |
216 | 216 | alist_adpcm( |
217 | 217 | hle, |
218 | flags & 0x1, | |
219 | flags & 0x2, | |
218 | flags & A_INIT, | |
219 | flags & A_LOOP, | |
220 | 220 | false, /* unsuported by this ucode */ |
221 | 221 | dmemo, |
222 | 222 | dmemi, |
236 | 236 | |
237 | 237 | alist_resample( |
238 | 238 | hle, |
239 | flags & 0x1, | |
239 | flags & A_INIT, | |
240 | 240 | false, /* TODO: check which ABI supports it */ |
241 | 241 | dmemo, |
242 | 242 | dmemi, |
273 | 273 | }; |
274 | 274 | |
275 | 275 | alist_process(hle, ABI, 0x10); |
276 | rsp_break(hle, SP_STATUS_TASKDONE); | |
276 | 277 | } |
277 | 278 | |
278 | 279 | void alist_process_naudio_bk(struct hle_t* hle) |
286 | 287 | }; |
287 | 288 | |
288 | 289 | alist_process(hle, ABI, 0x10); |
290 | rsp_break(hle, SP_STATUS_TASKDONE); | |
289 | 291 | } |
290 | 292 | |
291 | 293 | void alist_process_naudio_dk(struct hle_t* hle) |
299 | 301 | }; |
300 | 302 | |
301 | 303 | alist_process(hle, ABI, 0x10); |
304 | rsp_break(hle, SP_STATUS_TASKDONE); | |
302 | 305 | } |
303 | 306 | |
304 | 307 | void alist_process_naudio_mp3(struct hle_t* hle) |
311 | 314 | }; |
312 | 315 | |
313 | 316 | alist_process(hle, ABI, 0x10); |
317 | rsp_break(hle, SP_STATUS_TASKDONE); | |
314 | 318 | } |
315 | 319 | |
316 | 320 | void alist_process_naudio_cbfd(struct hle_t* hle) |
324 | 328 | }; |
325 | 329 | |
326 | 330 | alist_process(hle, ABI, 0x10); |
327 | } | |
331 | rsp_break(hle, SP_STATUS_TASKDONE); | |
332 | } |
0 | 0 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
1 | 1 | * Mupen64plus-rsp-hle - alist_nead.c * |
2 | * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * | |
2 | * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | 3 | * Copyright (C) 2014 Bobby Smiles * |
4 | 4 | * Copyright (C) 2009 Richard Goedeken * |
5 | 5 | * Copyright (C) 2002 Hacktarux * |
91 | 91 | static void CLEARBUFF(struct hle_t* hle, uint32_t w1, uint32_t w2) |
92 | 92 | { |
93 | 93 | uint16_t dmem = w1; |
94 | uint16_t count = w2; | |
94 | uint16_t count = w2 & 0xfff; | |
95 | 95 | |
96 | 96 | if (count == 0) |
97 | 97 | return; |
299 | 299 | static void HILOGAIN(struct hle_t* hle, uint32_t w1, uint32_t w2) |
300 | 300 | { |
301 | 301 | int8_t gain = (w1 >> 16); /* Q4.4 signed */ |
302 | uint16_t count = w1; | |
302 | uint16_t count = w1 & 0xfff; | |
303 | 303 | uint16_t dmem = (w2 >> 16); |
304 | 304 | |
305 | 305 | alist_multQ44(hle, dmem, count, gain); |
371 | 371 | }; |
372 | 372 | |
373 | 373 | alist_process(hle, ABI, 0x20); |
374 | rsp_break(hle, SP_STATUS_TASKDONE); | |
374 | 375 | } |
375 | 376 | |
376 | 377 | void alist_process_nead_sf(struct hle_t* hle) |
387 | 388 | }; |
388 | 389 | |
389 | 390 | alist_process(hle, ABI, 0x20); |
391 | rsp_break(hle, SP_STATUS_TASKDONE); | |
390 | 392 | } |
391 | 393 | |
392 | 394 | void alist_process_nead_sfj(struct hle_t* hle) |
403 | 405 | }; |
404 | 406 | |
405 | 407 | alist_process(hle, ABI, 0x20); |
408 | rsp_break(hle, SP_STATUS_TASKDONE); | |
406 | 409 | } |
407 | 410 | |
408 | 411 | void alist_process_nead_fz(struct hle_t* hle) |
419 | 422 | }; |
420 | 423 | |
421 | 424 | alist_process(hle, ABI, 0x20); |
425 | rsp_break(hle, SP_STATUS_TASKDONE); | |
422 | 426 | } |
423 | 427 | |
424 | 428 | void alist_process_nead_wrjb(struct hle_t* hle) |
435 | 439 | }; |
436 | 440 | |
437 | 441 | alist_process(hle, ABI, 0x20); |
442 | rsp_break(hle, SP_STATUS_TASKDONE); | |
438 | 443 | } |
439 | 444 | |
440 | 445 | void alist_process_nead_ys(struct hle_t* hle) |
449 | 454 | }; |
450 | 455 | |
451 | 456 | alist_process(hle, ABI, 0x18); |
457 | rsp_break(hle, SP_STATUS_TASKDONE); | |
452 | 458 | } |
453 | 459 | |
454 | 460 | void alist_process_nead_1080(struct hle_t* hle) |
463 | 469 | }; |
464 | 470 | |
465 | 471 | alist_process(hle, ABI, 0x18); |
472 | rsp_break(hle, SP_STATUS_TASKDONE); | |
466 | 473 | } |
467 | 474 | |
468 | 475 | void alist_process_nead_oot(struct hle_t* hle) |
477 | 484 | }; |
478 | 485 | |
479 | 486 | alist_process(hle, ABI, 0x18); |
487 | rsp_break(hle, SP_STATUS_TASKDONE); | |
480 | 488 | } |
481 | 489 | |
482 | 490 | void alist_process_nead_mm(struct hle_t* hle) |
491 | 499 | }; |
492 | 500 | |
493 | 501 | alist_process(hle, ABI, 0x18); |
502 | rsp_break(hle, SP_STATUS_TASKDONE); | |
494 | 503 | } |
495 | 504 | |
496 | 505 | void alist_process_nead_mmb(struct hle_t* hle) |
505 | 514 | }; |
506 | 515 | |
507 | 516 | alist_process(hle, ABI, 0x18); |
517 | rsp_break(hle, SP_STATUS_TASKDONE); | |
508 | 518 | } |
509 | 519 | |
510 | 520 | void alist_process_nead_ac(struct hle_t* hle) |
519 | 529 | }; |
520 | 530 | |
521 | 531 | alist_process(hle, ABI, 0x18); |
522 | } | |
532 | rsp_break(hle, SP_STATUS_TASKDONE); | |
533 | } | |
534 | ||
535 | void alist_process_nead_mats(struct hle_t* hle) | |
536 | { | |
537 | /* FIXME: implement proper ucode | |
538 | * Forward the task if possible, | |
539 | * otherwise better to have no sound than garbage sound | |
540 | */ | |
541 | if (HleForwardTask(hle->user_defined) != 0) { | |
542 | rsp_break(hle, SP_STATUS_TASKDONE); | |
543 | } | |
544 | } | |
545 | ||
546 | void alist_process_nead_efz(struct hle_t* hle) | |
547 | { | |
548 | /* FIXME: implement proper ucode | |
549 | * Forward the task if possible, | |
550 | * otherwise use FZero ucode which should be very similar | |
551 | */ | |
552 | if (HleForwardTask(hle->user_defined) != 0) { | |
553 | alist_process_nead_fz(hle); | |
554 | } | |
555 | } |
0 | 0 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
1 | 1 | * Mupen64plus-rsp-hle - arithmetics.h * |
2 | * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * | |
2 | * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | 3 | * Copyright (C) 2014 Bobby Smiles * |
4 | 4 | * * |
5 | 5 | * This program is free software; you can redistribute it and/or modify * |
0 | 0 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
1 | 1 | * Mupen64plus-rsp-hle - audio.c * |
2 | * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * | |
2 | * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | 3 | * Copyright (C) 2014 Bobby Smiles * |
4 | 4 | * * |
5 | 5 | * This program is free software; you can redistribute it and/or modify * |
0 | 0 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
1 | 1 | * Mupen64plus-rsp-hle - audio.h * |
2 | * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * | |
2 | * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | 3 | * Copyright (C) 2014 Bobby Smiles * |
4 | 4 | * * |
5 | 5 | * This program is free software; you can redistribute it and/or modify * |
0 | 0 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
1 | 1 | * Mupen64plus-rsp-hle - cicx105.c * |
2 | * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * | |
2 | * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | 3 | * Copyright (C) 2012 Bobby Smiles * |
4 | 4 | * Copyright (C) 2009 Richard Goedeken * |
5 | 5 | * Copyright (C) 2002 Hacktarux * |
49 | 49 | src += 0x8; |
50 | 50 | |
51 | 51 | } |
52 | ||
53 | rsp_break(hle, 0); | |
52 | 54 | } |
53 | 55 |
0 | 0 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
1 | 1 | * Mupen64plus-rsp-hle - common.h * |
2 | * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * | |
2 | * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | 3 | * Copyright (C) 2014 Bobby Smiles * |
4 | 4 | * * |
5 | 5 | * This program is free software; you can redistribute it and/or modify * |
0 | 0 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
1 | 1 | * Mupen64plus-rsp-hle - hle.c * |
2 | * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * | |
2 | * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | 3 | * Copyright (C) 2012 Bobby Smiles * |
4 | 4 | * Copyright (C) 2009 Richard Goedeken * |
5 | 5 | * Copyright (C) 2002 Hacktarux * |
34 | 34 | |
35 | 35 | #define min(a,b) (((a) < (b)) ? (a) : (b)) |
36 | 36 | |
37 | /* some rsp status flags */ | |
38 | #define SP_STATUS_HALT 0x1 | |
39 | #define SP_STATUS_BROKE 0x2 | |
40 | #define SP_STATUS_INTR_ON_BREAK 0x40 | |
41 | #define SP_STATUS_TASKDONE 0x200 | |
42 | ||
43 | 37 | /* some rdp status flags */ |
44 | 38 | #define DP_STATUS_FREEZE 0x2 |
45 | 39 | |
46 | /* some mips interface interrupt flags */ | |
47 | #define MI_INTR_SP 0x1 | |
48 | 40 | |
49 | 41 | |
50 | 42 | /* helper functions prototypes */ |
51 | 43 | static unsigned int sum_bytes(const unsigned char *bytes, unsigned int size); |
52 | 44 | static bool is_task(struct hle_t* hle); |
53 | static void rsp_break(struct hle_t* hle, unsigned int setbits); | |
54 | static void forward_gfx_task(struct hle_t* hle); | |
45 | static void send_dlist_to_gfx_plugin(struct hle_t* hle); | |
55 | 46 | static bool try_fast_audio_dispatching(struct hle_t* hle); |
56 | 47 | static bool try_fast_task_dispatching(struct hle_t* hle); |
57 | 48 | static void normal_task_dispatching(struct hle_t* hle); |
58 | 49 | static void non_task_dispatching(struct hle_t* hle); |
50 | static bool try_re2_task_dispatching(struct hle_t* hle); | |
59 | 51 | |
60 | 52 | #ifdef ENABLE_TASK_DUMP |
61 | 53 | static void dump_binary(struct hle_t* hle, const char *const filename, |
64 | 56 | static void dump_unknown_task(struct hle_t* hle, unsigned int sum); |
65 | 57 | static void dump_unknown_non_task(struct hle_t* hle, unsigned int sum); |
66 | 58 | #endif |
67 | ||
68 | /* local variables */ | |
69 | static const bool FORWARD_AUDIO = false, FORWARD_GFX = true; | |
70 | 59 | |
71 | 60 | /* Global functions */ |
72 | 61 | void hle_init(struct hle_t* hle, |
122 | 111 | if (is_task(hle)) { |
123 | 112 | if (!try_fast_task_dispatching(hle)) |
124 | 113 | normal_task_dispatching(hle); |
125 | rsp_break(hle, SP_STATUS_TASKDONE); | |
126 | 114 | } else { |
127 | 115 | non_task_dispatching(hle); |
128 | rsp_break(hle, 0); | |
129 | 116 | } |
130 | 117 | } |
131 | 118 | |
156 | 143 | return (*dmem_u32(hle, TASK_UCODE_BOOT_SIZE) <= 0x1000); |
157 | 144 | } |
158 | 145 | |
159 | static void rsp_break(struct hle_t* hle, unsigned int setbits) | |
146 | void rsp_break(struct hle_t* hle, unsigned int setbits) | |
160 | 147 | { |
161 | 148 | *hle->sp_status |= setbits | SP_STATUS_BROKE | SP_STATUS_HALT; |
162 | 149 | |
166 | 153 | } |
167 | 154 | } |
168 | 155 | |
169 | static void forward_gfx_task(struct hle_t* hle) | |
170 | { | |
156 | static void send_alist_to_audio_plugin(struct hle_t* hle) | |
157 | { | |
158 | HleProcessAlistList(hle->user_defined); | |
159 | rsp_break(hle, SP_STATUS_TASKDONE); | |
160 | } | |
161 | ||
162 | static void send_dlist_to_gfx_plugin(struct hle_t* hle) | |
163 | { | |
164 | /* Since GFX_INFO version 2, these bits are set before calling the ProcessDlistList function. | |
165 | * And the GFX plugin is responsible to unset them if needed. | |
166 | * For GFX_INFO version < 2, the GFX plugin didn't have access to sp_status so | |
167 | * it doesn't matter if we set these bits before calling ProcessDlistList function. | |
168 | */ | |
169 | *hle->sp_status |= SP_STATUS_TASKDONE | SP_STATUS_BROKE | SP_STATUS_HALT; | |
170 | ||
171 | 171 | HleProcessDlistList(hle->user_defined); |
172 | ||
173 | if ((*hle->sp_status & SP_STATUS_INTR_ON_BREAK) && (*hle->sp_status & (SP_STATUS_TASKDONE | SP_STATUS_BROKE | SP_STATUS_HALT))) { | |
174 | *hle->mi_intr |= MI_INTR_SP; | |
175 | HleCheckInterrupts(hle->user_defined); | |
176 | } | |
172 | 177 | } |
173 | 178 | |
174 | 179 | static bool try_fast_audio_dispatching(struct hle_t* hle) |
219 | 224 | alist_process_nead_ac(hle); return true; |
220 | 225 | case 0x00010010: /* MusyX v2 (IndianaJones, BattleForNaboo) */ |
221 | 226 | musyx_v2_task(hle); return true; |
222 | ||
227 | case 0x1f701238: /* Mario Artist Talent Studio */ | |
228 | alist_process_nead_mats(hle); return true; | |
229 | case 0x1f4c1230: /* FZeroX Expansion */ | |
230 | alist_process_nead_efz(hle); return true; | |
223 | 231 | default: |
224 | 232 | HleWarnMessage(hle->user_defined, "ABI2 identification regression: v=%08x", v); |
225 | 233 | } |
257 | 265 | /* identify task ucode by its type */ |
258 | 266 | switch (*dmem_u32(hle, TASK_TYPE)) { |
259 | 267 | case 1: |
260 | if (FORWARD_GFX) { | |
261 | forward_gfx_task(hle); | |
268 | /* Resident evil 2 */ | |
269 | if (*dmem_u32(hle, TASK_DATA_PTR) == 0) { | |
270 | return try_re2_task_dispatching(hle); | |
271 | } | |
272 | ||
273 | if (hle->hle_gfx) { | |
274 | send_dlist_to_gfx_plugin(hle); | |
262 | 275 | return true; |
263 | 276 | } |
264 | 277 | break; |
265 | 278 | |
266 | 279 | case 2: |
267 | if (FORWARD_AUDIO) { | |
268 | HleProcessAlistList(hle->user_defined); | |
280 | if (hle->hle_aud) { | |
281 | send_alist_to_audio_plugin(hle); | |
269 | 282 | return true; |
270 | 283 | } else if (try_fast_audio_dispatching(hle)) |
271 | 284 | return true; |
273 | 286 | |
274 | 287 | case 7: |
275 | 288 | HleShowCFB(hle->user_defined); |
276 | return true; | |
289 | break; | |
277 | 290 | } |
278 | 291 | |
279 | 292 | return false; |
288 | 301 | /* StoreVe12: found in Zelda Ocarina of Time [misleading task->type == 4] */ |
289 | 302 | case 0x278: |
290 | 303 | /* Nothing to emulate */ |
304 | rsp_break(hle, SP_STATUS_TASKDONE); | |
291 | 305 | return; |
292 | 306 | |
293 | 307 | /* GFX: Twintris [misleading task->type == 0] */ |
294 | 308 | case 0x212ee: |
295 | if (FORWARD_GFX) { | |
296 | forward_gfx_task(hle); | |
309 | if (hle->hle_gfx) { | |
310 | send_dlist_to_gfx_plugin(hle); | |
297 | 311 | return; |
298 | 312 | } |
299 | 313 | break; |
315 | 329 | return; |
316 | 330 | } |
317 | 331 | |
318 | HleWarnMessage(hle->user_defined, "unknown OSTask: sum: %x PC:%x", sum, *hle->sp_pc); | |
332 | /* Forward task to RSP Fallback. | |
333 | * If task is not forwarded, use the regular "unknown task" path */ | |
334 | if (HleForwardTask(hle->user_defined) != 0) { | |
335 | ||
336 | /* Send task_done signal for unknown ucodes to allow further processings */ | |
337 | rsp_break(hle, SP_STATUS_TASKDONE); | |
338 | ||
339 | HleWarnMessage(hle->user_defined, "unknown OSTask: sum: %x PC:%x", sum, *hle->sp_pc); | |
319 | 340 | #ifdef ENABLE_TASK_DUMP |
320 | dump_unknown_task(hle, sum); | |
341 | dump_unknown_task(hle, sum); | |
321 | 342 | #endif |
343 | } | |
322 | 344 | } |
323 | 345 | |
324 | 346 | static void non_task_dispatching(struct hle_t* hle) |
332 | 354 | return; |
333 | 355 | } |
334 | 356 | |
335 | HleWarnMessage(hle->user_defined, "unknown RSP code: sum: %x PC:%x", sum, *hle->sp_pc); | |
357 | /* Forward task to RSP Fallback. | |
358 | * If task is not forwarded, use the regular "unknown ucode" path */ | |
359 | if (HleForwardTask(hle->user_defined) != 0) { | |
360 | ||
361 | HleWarnMessage(hle->user_defined, "unknown RSP code: sum: %x PC:%x", sum, *hle->sp_pc); | |
336 | 362 | #ifdef ENABLE_TASK_DUMP |
337 | dump_unknown_non_task(hle, sum); | |
363 | dump_unknown_non_task(hle, sum); | |
338 | 364 | #endif |
339 | } | |
340 | ||
365 | } | |
366 | } | |
367 | ||
368 | /* Resident evil 2 */ | |
369 | static bool try_re2_task_dispatching(struct hle_t* hle) | |
370 | { | |
371 | const unsigned int sum = | |
372 | sum_bytes((void*)dram_u32(hle, *dmem_u32(hle, TASK_UCODE)), 256); | |
373 | ||
374 | switch (sum) { | |
375 | ||
376 | case 0x450f: | |
377 | resize_bilinear_task(hle); | |
378 | return true; | |
379 | ||
380 | case 0x3b44: | |
381 | decode_video_frame_task(hle); | |
382 | return true; | |
383 | ||
384 | case 0x3d84: | |
385 | fill_video_double_buffer_task(hle); | |
386 | return true; | |
387 | } | |
388 | ||
389 | return false; | |
390 | } | |
341 | 391 | |
342 | 392 | #ifdef ENABLE_TASK_DUMP |
343 | 393 | static void dump_unknown_task(struct hle_t* hle, unsigned int sum) |
0 | 0 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
1 | 1 | * Mupen64plus-rsp-hle - hle.h * |
2 | * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * | |
2 | * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | 3 | * Copyright (C) 2014 Bobby Smiles * |
4 | 4 | * * |
5 | 5 | * This program is free software; you can redistribute it and/or modify * |
0 | 0 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
1 | 1 | * Mupen64plus-rsp-hle - hle_external.h * |
2 | * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * | |
2 | * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | 3 | * Copyright (C) 2014 Bobby Smiles * |
4 | 4 | * * |
5 | 5 | * This program is free software; you can redistribute it and/or modify * |
24 | 24 | /* users of the hle core are expected to define these functions */ |
25 | 25 | |
26 | 26 | void HleVerboseMessage(void* user_defined, const char *message, ...); |
27 | void HleInfoMessage(void* user_defined, const char *message, ...); | |
27 | 28 | void HleErrorMessage(void* user_defined, const char *message, ...); |
28 | 29 | void HleWarnMessage(void* user_defined, const char *message, ...); |
29 | 30 | |
32 | 33 | void HleProcessAlistList(void* user_defined); |
33 | 34 | void HleProcessRdpList(void* user_defined); |
34 | 35 | void HleShowCFB(void* user_defined); |
36 | int HleForwardTask(void* user_defined); | |
35 | 37 | |
36 | 38 | #endif |
37 | 39 |
0 | 0 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
1 | 1 | * Mupen64plus-rsp-hle - hle_internal.h * |
2 | * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * | |
2 | * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | 3 | * Copyright (C) 2014 Bobby Smiles * |
4 | 4 | * * |
5 | 5 | * This program is free software; you can redistribute it and/or modify * |
56 | 56 | /* for user convenience, this will be passed to "external" functions */ |
57 | 57 | void* user_defined; |
58 | 58 | |
59 | int hle_gfx; | |
60 | int hle_aud; | |
59 | 61 | |
60 | 62 | /* alist.c */ |
61 | 63 | uint8_t alist_buffer[0x1000]; |
73 | 75 | uint8_t mp3_buffer[0x1000]; |
74 | 76 | }; |
75 | 77 | |
78 | /* some mips interface interrupt flags */ | |
79 | #define MI_INTR_SP 0x1 | |
80 | ||
81 | /* some rsp status flags */ | |
82 | #define SP_STATUS_HALT 0x1 | |
83 | #define SP_STATUS_BROKE 0x2 | |
84 | #define SP_STATUS_INTR_ON_BREAK 0x40 | |
85 | #define SP_STATUS_TASKDONE 0x200 | |
86 | ||
87 | void rsp_break(struct hle_t* hle, unsigned int setbits); | |
88 | ||
76 | 89 | #endif |
77 | 90 |
0 | 0 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
1 | 1 | * Mupen64plus-rsp-hle - jpeg.c * |
2 | * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * | |
2 | * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | 3 | * Copyright (C) 2012 Bobby Smiles * |
4 | 4 | * Copyright (C) 2009 Richard Goedeken * |
5 | 5 | * Copyright (C) 2002 Hacktarux * |
140 | 140 | void jpeg_decode_PS0(struct hle_t* hle) |
141 | 141 | { |
142 | 142 | jpeg_decode_std(hle, "PS0", RescaleYSubBlock, RescaleUVSubBlock, EmitYUVTileLine); |
143 | rsp_break(hle, SP_STATUS_TASKDONE); | |
143 | 144 | } |
144 | 145 | |
145 | 146 | /*************************************************************************** |
149 | 150 | void jpeg_decode_PS(struct hle_t* hle) |
150 | 151 | { |
151 | 152 | jpeg_decode_std(hle, "PS", NULL, NULL, EmitRGBATileLine); |
153 | rsp_break(hle, SP_STATUS_TASKDONE); | |
152 | 154 | } |
153 | 155 | |
154 | 156 | /*************************************************************************** |
189 | 191 | |
190 | 192 | address += (2 * 6 * SUBBLOCK_SIZE); |
191 | 193 | } |
194 | rsp_break(hle, SP_STATUS_TASKDONE); | |
192 | 195 | } |
193 | 196 | |
194 | 197 | |
471 | 474 | unsigned int i; |
472 | 475 | |
473 | 476 | /* source and destination sublocks cannot overlap */ |
474 | assert(abs(dst - src) > SUBBLOCK_SIZE); | |
477 | assert(labs(dst - src) > SUBBLOCK_SIZE); | |
475 | 478 | |
476 | 479 | for (i = 0; i < SUBBLOCK_SIZE; ++i) |
477 | 480 | dst[i] = src[table[i]]; |
0 | 0 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
1 | 1 | * Mupen64plus-rsp-hle - memory.c * |
2 | * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * | |
2 | * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | 3 | * Copyright (C) 2014 Bobby Smiles * |
4 | 4 | * * |
5 | 5 | * This program is free software; you can redistribute it and/or modify * |
0 | 0 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
1 | 1 | * Mupen64plus-rsp-hle - memory.h * |
2 | * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * | |
2 | * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | 3 | * Copyright (C) 2014 Bobby Smiles * |
4 | 4 | * * |
5 | 5 | * This program is free software; you can redistribute it and/or modify * |
0 | 0 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
1 | 1 | * Mupen64plus-rsp-hle - mp3.c * |
2 | * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * | |
2 | * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | 3 | * Copyright (C) 2014 Bobby Smiles * |
4 | 4 | * Copyright (C) 2009 Richard Goedeken * |
5 | 5 | * Copyright (C) 2002 Hacktarux * |
0 | 0 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
1 | 1 | * Mupen64plus-rsp-hle - musyx.c * |
2 | * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * | |
2 | * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | 3 | * Copyright (C) 2013 Bobby Smiles * |
4 | 4 | * * |
5 | 5 | * This program is free software; you can redistribute it and/or modify * |
255 | 255 | dram_store_u16(hle, (uint16_t *)musyx.cc0, state_ptr + STATE_CC0, SUBFRAME_SIZE); |
256 | 256 | dram_store_u16(hle, (uint16_t *)musyx.subframe_740_last4, state_ptr + STATE_740_LAST4_V1, |
257 | 257 | 4); |
258 | ||
259 | rsp_break(hle, SP_STATUS_TASKDONE); | |
258 | 260 | } |
259 | 261 | |
260 | 262 | /************************************************************************** |
332 | 334 | |
333 | 335 | sfd_ptr += SFD2_VOICES + MAX_VOICES * VOICE_SIZE; |
334 | 336 | } |
337 | ||
338 | rsp_break(hle, SP_STATUS_TASKDONE); | |
335 | 339 | } |
336 | 340 | |
337 | 341 |
0 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | |
1 | * Mupen64plus-ui-console - osal_dynamiclib.h * | |
2 | * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | * Copyright (C) 2009 Richard Goedeken * | |
4 | * * | |
5 | * This program is free software; you can redistribute it and/or modify * | |
6 | * it under the terms of the GNU General Public License as published by * | |
7 | * the Free Software Foundation; either version 2 of the License, or * | |
8 | * (at your option) any later version. * | |
9 | * * | |
10 | * This program is distributed in the hope that it will be useful, * | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | |
13 | * GNU General Public License for more details. * | |
14 | * * | |
15 | * You should have received a copy of the GNU General Public License * | |
16 | * along with this program; if not, write to the * | |
17 | * Free Software Foundation, Inc., * | |
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * | |
19 | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |
20 | ||
21 | #if !defined(OSAL_DYNAMICLIB_H) | |
22 | #define OSAL_DYNAMICLIB_H | |
23 | ||
24 | #include "m64p_types.h" | |
25 | ||
26 | m64p_error osal_dynlib_open(m64p_dynlib_handle *pLibHandle, const char *pccLibraryPath); | |
27 | ||
28 | void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName); | |
29 | ||
30 | m64p_error osal_dynlib_close(m64p_dynlib_handle LibHandle); | |
31 | ||
32 | #endif /* #define OSAL_DYNAMICLIB_H */ | |
33 |
0 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | |
1 | * Mupen64plus-ui-console - osal_dynamiclib_unix.c * | |
2 | * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | * Copyright (C) 2009 Richard Goedeken * | |
4 | * * | |
5 | * This program is free software; you can redistribute it and/or modify * | |
6 | * it under the terms of the GNU General Public License as published by * | |
7 | * the Free Software Foundation; either version 2 of the License, or * | |
8 | * (at your option) any later version. * | |
9 | * * | |
10 | * This program is distributed in the hope that it will be useful, * | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | |
13 | * GNU General Public License for more details. * | |
14 | * * | |
15 | * You should have received a copy of the GNU General Public License * | |
16 | * along with this program; if not, write to the * | |
17 | * Free Software Foundation, Inc., * | |
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * | |
19 | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |
20 | ||
21 | #include <dlfcn.h> | |
22 | #include <stdio.h> | |
23 | #include <stdlib.h> | |
24 | #include <string.h> | |
25 | ||
26 | #include "m64p_types.h" | |
27 | #include "hle_external.h" | |
28 | #include "osal_dynamiclib.h" | |
29 | ||
30 | m64p_error osal_dynlib_open(m64p_dynlib_handle *pLibHandle, const char *pccLibraryPath) | |
31 | { | |
32 | if (pLibHandle == NULL || pccLibraryPath == NULL) | |
33 | return M64ERR_INPUT_ASSERT; | |
34 | ||
35 | *pLibHandle = dlopen(pccLibraryPath, RTLD_NOW); | |
36 | ||
37 | if (*pLibHandle == NULL) | |
38 | { | |
39 | /* only print an error message if there is a directory separator (/) in the pathname */ | |
40 | /* this prevents us from throwing an error for the use case where Mupen64Plus is not installed */ | |
41 | if (strchr(pccLibraryPath, '/') != NULL) | |
42 | HleErrorMessage(NULL, "dlopen('%s') failed: %s", pccLibraryPath, dlerror()); | |
43 | return M64ERR_INPUT_NOT_FOUND; | |
44 | } | |
45 | ||
46 | return M64ERR_SUCCESS; | |
47 | } | |
48 | ||
49 | void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName) | |
50 | { | |
51 | if (pccProcedureName == NULL) | |
52 | return NULL; | |
53 | ||
54 | return dlsym(LibHandle, pccProcedureName); | |
55 | } | |
56 | ||
57 | m64p_error osal_dynlib_close(m64p_dynlib_handle LibHandle) | |
58 | { | |
59 | int rval = dlclose(LibHandle); | |
60 | ||
61 | if (rval != 0) | |
62 | { | |
63 | HleErrorMessage(NULL, "dlclose() failed: %s", dlerror()); | |
64 | return M64ERR_INTERNAL; | |
65 | } | |
66 | ||
67 | return M64ERR_SUCCESS; | |
68 | } | |
69 | ||
70 |
0 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | |
1 | * Mupen64plus-ui-console - osal_dynamiclib_win32.c * | |
2 | * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | * Copyright (C) 2009 Richard Goedeken * | |
4 | * * | |
5 | * This program is free software; you can redistribute it and/or modify * | |
6 | * it under the terms of the GNU General Public License as published by * | |
7 | * the Free Software Foundation; either version 2 of the License, or * | |
8 | * (at your option) any later version. * | |
9 | * * | |
10 | * This program is distributed in the hope that it will be useful, * | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | |
13 | * GNU General Public License for more details. * | |
14 | * * | |
15 | * You should have received a copy of the GNU General Public License * | |
16 | * along with this program; if not, write to the * | |
17 | * Free Software Foundation, Inc., * | |
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * | |
19 | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |
20 | ||
21 | #include <stdio.h> | |
22 | #include <stdlib.h> | |
23 | #include <windows.h> | |
24 | ||
25 | #include "m64p_types.h" | |
26 | #include "hle_external.h" | |
27 | #include "osal_dynamiclib.h" | |
28 | ||
29 | m64p_error osal_dynlib_open(m64p_dynlib_handle *pLibHandle, const char *pccLibraryPath) | |
30 | { | |
31 | if (pLibHandle == NULL || pccLibraryPath == NULL) | |
32 | return M64ERR_INPUT_ASSERT; | |
33 | ||
34 | *pLibHandle = LoadLibrary(pccLibraryPath); | |
35 | ||
36 | if (*pLibHandle == NULL) | |
37 | { | |
38 | char *pchErrMsg; | |
39 | DWORD dwErr = GetLastError(); | |
40 | FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr, | |
41 | MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pchErrMsg, 0, NULL); | |
42 | HleErrorMessage(NULL, "LoadLibrary('%s') error: %s", pccLibraryPath, pchErrMsg); | |
43 | LocalFree(pchErrMsg); | |
44 | return M64ERR_INPUT_NOT_FOUND; | |
45 | } | |
46 | ||
47 | return M64ERR_SUCCESS; | |
48 | } | |
49 | ||
50 | void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName) | |
51 | { | |
52 | if (pccProcedureName == NULL) | |
53 | return NULL; | |
54 | ||
55 | return GetProcAddress(LibHandle, pccProcedureName); | |
56 | } | |
57 | ||
58 | m64p_error osal_dynlib_close(m64p_dynlib_handle LibHandle) | |
59 | { | |
60 | int rval = FreeLibrary(LibHandle); | |
61 | ||
62 | if (rval == 0) | |
63 | { | |
64 | char *pchErrMsg; | |
65 | DWORD dwErr = GetLastError(); | |
66 | FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr, | |
67 | MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pchErrMsg, 0, NULL); | |
68 | HleErrorMessage(NULL, "FreeLibrary() error: %s", pchErrMsg); | |
69 | LocalFree(pchErrMsg); | |
70 | return M64ERR_INTERNAL; | |
71 | } | |
72 | ||
73 | return M64ERR_SUCCESS; | |
74 | } |
0 | 0 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
1 | 1 | * Mupen64plus-rsp-hle - plugin.c * |
2 | * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * | |
2 | * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | 3 | * Copyright (C) 2014 Bobby Smiles * |
4 | 4 | * Copyright (C) 2009 Richard Goedeken * |
5 | 5 | * Copyright (C) 2002 Hacktarux * |
22 | 22 | |
23 | 23 | #include <stdarg.h> |
24 | 24 | #include <stdio.h> |
25 | #include <string.h> | |
25 | 26 | |
26 | 27 | #include "common.h" |
27 | 28 | #include "hle.h" |
28 | 29 | #include "hle_internal.h" |
30 | #include "hle_external.h" | |
29 | 31 | |
30 | 32 | #define M64P_PLUGIN_PROTOTYPES 1 |
31 | 33 | #include "m64p_common.h" |
34 | #include "m64p_config.h" | |
35 | #include "m64p_frontend.h" | |
32 | 36 | #include "m64p_plugin.h" |
33 | 37 | #include "m64p_types.h" |
34 | 38 | |
35 | #define RSP_HLE_VERSION 0x020500 | |
39 | #include "osal_dynamiclib.h" | |
40 | ||
41 | #define CONFIG_API_VERSION 0x020100 | |
42 | #define CONFIG_PARAM_VERSION 1.00 | |
43 | ||
44 | #define RSP_API_VERSION 0x20000 | |
45 | #define RSP_HLE_VERSION 0x020509 | |
36 | 46 | #define RSP_PLUGIN_API_VERSION 0x020000 |
47 | ||
48 | #define RSP_HLE_CONFIG_SECTION "Rsp-HLE" | |
49 | #define RSP_HLE_CONFIG_VERSION "Version" | |
50 | #define RSP_HLE_CONFIG_FALLBACK "RspFallback" | |
51 | #define RSP_HLE_CONFIG_HLE_GFX "DisplayListToGraphicsPlugin" | |
52 | #define RSP_HLE_CONFIG_HLE_AUD "AudioListToAudioPlugin" | |
53 | ||
54 | ||
55 | #define VERSION_PRINTF_SPLIT(x) (((x) >> 16) & 0xffff), (((x) >> 8) & 0xff), ((x) & 0xff) | |
56 | ||
57 | /* Handy macro to avoid code bloat when loading symbols */ | |
58 | #define GET_FUNC(type, field, name) \ | |
59 | ((field = (type)osal_dynlib_getproc(handle, name)) != NULL) | |
37 | 60 | |
38 | 61 | /* local variables */ |
39 | 62 | static struct hle_t g_hle; |
44 | 67 | static void (*l_ShowCFB)(void) = NULL; |
45 | 68 | static void (*l_DebugCallback)(void *, int, const char *) = NULL; |
46 | 69 | static void *l_DebugCallContext = NULL; |
70 | static m64p_dynlib_handle l_CoreHandle = NULL; | |
47 | 71 | static int l_PluginInit = 0; |
48 | 72 | |
73 | static m64p_handle l_ConfigRspHle; | |
74 | static m64p_dynlib_handle l_RspFallback; | |
75 | static ptr_InitiateRSP l_InitiateRSP = NULL; | |
76 | static ptr_DoRspCycles l_DoRspCycles = NULL; | |
77 | static ptr_RomClosed l_RomClosed = NULL; | |
78 | static ptr_PluginShutdown l_PluginShutdown = NULL; | |
79 | ||
80 | /* definitions of pointers to Core functions */ | |
81 | static ptr_ConfigOpenSection ConfigOpenSection = NULL; | |
82 | static ptr_ConfigDeleteSection ConfigDeleteSection = NULL; | |
83 | static ptr_ConfigSetParameter ConfigSetParameter = NULL; | |
84 | static ptr_ConfigGetParameter ConfigGetParameter = NULL; | |
85 | static ptr_ConfigSetDefaultInt ConfigSetDefaultInt = NULL; | |
86 | static ptr_ConfigSetDefaultFloat ConfigSetDefaultFloat = NULL; | |
87 | static ptr_ConfigSetDefaultBool ConfigSetDefaultBool = NULL; | |
88 | static ptr_ConfigSetDefaultString ConfigSetDefaultString = NULL; | |
89 | static ptr_ConfigGetParamInt ConfigGetParamInt = NULL; | |
90 | static ptr_ConfigGetParamFloat ConfigGetParamFloat = NULL; | |
91 | static ptr_ConfigGetParamBool ConfigGetParamBool = NULL; | |
92 | static ptr_ConfigGetParamString ConfigGetParamString = NULL; | |
93 | static ptr_CoreDoCommand CoreDoCommand = NULL; | |
94 | ||
49 | 95 | /* local function */ |
96 | static void teardown_rsp_fallback() | |
97 | { | |
98 | if (l_RspFallback != NULL) { | |
99 | (*l_PluginShutdown)(); | |
100 | osal_dynlib_close(l_RspFallback); | |
101 | } | |
102 | ||
103 | l_RspFallback = NULL; | |
104 | l_DoRspCycles = NULL; | |
105 | l_InitiateRSP = NULL; | |
106 | l_RomClosed = NULL; | |
107 | l_PluginShutdown = NULL; | |
108 | } | |
109 | ||
110 | static void setup_rsp_fallback(const char* rsp_fallback_path) | |
111 | { | |
112 | m64p_dynlib_handle handle = NULL; | |
113 | ||
114 | /* reset rsp fallback */ | |
115 | teardown_rsp_fallback(); | |
116 | ||
117 | if (rsp_fallback_path == NULL || strlen(rsp_fallback_path) == 0) { | |
118 | HleInfoMessage(NULL, "RSP Fallback disabled !"); | |
119 | return; | |
120 | } | |
121 | ||
122 | /* load plugin */ | |
123 | if (osal_dynlib_open(&handle, rsp_fallback_path) != M64ERR_SUCCESS) { | |
124 | HleErrorMessage(NULL, "Can't load library: %s", rsp_fallback_path); | |
125 | return; | |
126 | } | |
127 | ||
128 | /* call the GetVersion function for the plugin and check compatibility */ | |
129 | ptr_PluginGetVersion PluginGetVersion = (ptr_PluginGetVersion) osal_dynlib_getproc(handle, "PluginGetVersion"); | |
130 | if (PluginGetVersion == NULL) | |
131 | { | |
132 | HleErrorMessage(NULL, "library '%s' is not a Mupen64Plus library.", rsp_fallback_path); | |
133 | goto close_handle; | |
134 | } | |
135 | ||
136 | m64p_plugin_type plugin_type = (m64p_plugin_type)0; | |
137 | int plugin_version = 0; | |
138 | const char *plugin_name = NULL; | |
139 | int api_version = 0; | |
140 | ||
141 | (*PluginGetVersion)(&plugin_type, &plugin_version, &api_version, &plugin_name, NULL); | |
142 | ||
143 | if (plugin_type != M64PLUGIN_RSP) { | |
144 | HleErrorMessage(NULL, "plugin %s is not an RSP plugin (%u)", plugin_name, plugin_type); | |
145 | goto close_handle; | |
146 | } | |
147 | ||
148 | if ((api_version & 0xffff0000) != (RSP_API_VERSION & 0xffff0000)) { | |
149 | HleErrorMessage(NULL, "plugin %s. Version mismatch: %u.%u. Expected >= %u.0", | |
150 | plugin_name, | |
151 | (uint16_t)(api_version >> 16), | |
152 | (uint16_t)(api_version), | |
153 | (uint16_t)(RSP_API_VERSION >> 16)); | |
154 | goto close_handle; | |
155 | } | |
156 | ||
157 | /* load functions */ | |
158 | ptr_PluginStartup PluginStartup; | |
159 | ||
160 | if (!GET_FUNC(ptr_PluginStartup, PluginStartup, "PluginStartup") || | |
161 | !GET_FUNC(ptr_PluginShutdown, l_PluginShutdown, "PluginShutdown") || | |
162 | !GET_FUNC(ptr_DoRspCycles, l_DoRspCycles, "DoRspCycles") || | |
163 | !GET_FUNC(ptr_InitiateRSP, l_InitiateRSP, "InitiateRSP") || | |
164 | !GET_FUNC(ptr_RomClosed, l_RomClosed, "RomClosed")) | |
165 | { | |
166 | HleErrorMessage(NULL, "broken RSP plugin; function(s) not found."); | |
167 | l_PluginShutdown = NULL; | |
168 | l_DoRspCycles = NULL; | |
169 | l_InitiateRSP = NULL; | |
170 | l_RomClosed = NULL; | |
171 | goto close_handle; | |
172 | } | |
173 | ||
174 | /* call the plugin's initialization function and make sure it starts okay */ | |
175 | if ((*PluginStartup)(l_CoreHandle, l_DebugCallContext, l_DebugCallback) != M64ERR_SUCCESS) { | |
176 | HleErrorMessage(NULL, "Error: %s plugin library '%s' failed to start.", plugin_name, rsp_fallback_path); | |
177 | goto close_handle; | |
178 | } | |
179 | ||
180 | /* OK we're done ! */ | |
181 | l_RspFallback = handle; | |
182 | HleInfoMessage(NULL, "RSP Fallback '%s' loaded successfully !", rsp_fallback_path); | |
183 | return; | |
184 | ||
185 | close_handle: | |
186 | osal_dynlib_close(handle); | |
187 | } | |
188 | ||
50 | 189 | static void DebugMessage(int level, const char *message, va_list args) |
51 | 190 | { |
52 | 191 | char msgbuf[1024]; |
68 | 207 | va_end(args); |
69 | 208 | } |
70 | 209 | |
210 | void HleInfoMessage(void* UNUSED(user_defined), const char *message, ...) | |
211 | { | |
212 | va_list args; | |
213 | va_start(args, message); | |
214 | DebugMessage(M64MSG_INFO, message, args); | |
215 | va_end(args); | |
216 | } | |
217 | ||
71 | 218 | void HleErrorMessage(void* UNUSED(user_defined), const char *message, ...) |
72 | 219 | { |
73 | 220 | va_list args; |
125 | 272 | } |
126 | 273 | |
127 | 274 | |
275 | int HleForwardTask(void* user_defined) | |
276 | { | |
277 | if (l_DoRspCycles == NULL) | |
278 | return -1; | |
279 | ||
280 | (*l_DoRspCycles)(-1); | |
281 | return 0; | |
282 | } | |
283 | ||
284 | ||
128 | 285 | /* DLL-exported functions */ |
129 | EXPORT m64p_error CALL PluginStartup(m64p_dynlib_handle UNUSED(CoreLibHandle), void *Context, | |
286 | EXPORT m64p_error CALL PluginStartup(m64p_dynlib_handle CoreLibHandle, void *Context, | |
130 | 287 | void (*DebugCallback)(void *, int, const char *)) |
131 | 288 | { |
289 | ptr_CoreGetAPIVersions CoreAPIVersionFunc; | |
290 | int ConfigAPIVersion, DebugAPIVersion, VidextAPIVersion; | |
291 | float fConfigParamsVersion = 0.0f; | |
292 | ||
132 | 293 | if (l_PluginInit) |
133 | 294 | return M64ERR_ALREADY_INIT; |
134 | 295 | |
136 | 297 | l_DebugCallback = DebugCallback; |
137 | 298 | l_DebugCallContext = Context; |
138 | 299 | |
139 | /* this plugin doesn't use any Core library functions (ex for Configuration), so no need to keep the CoreLibHandle */ | |
300 | /* attach and call the CoreGetAPIVersions function, check Config API version for compatibility */ | |
301 | CoreAPIVersionFunc = (ptr_CoreGetAPIVersions) osal_dynlib_getproc(CoreLibHandle, "CoreGetAPIVersions"); | |
302 | if (CoreAPIVersionFunc == NULL) | |
303 | { | |
304 | HleErrorMessage(NULL, "Core emulator broken; no CoreAPIVersionFunc() function found."); | |
305 | return M64ERR_INCOMPATIBLE; | |
306 | } | |
307 | ||
308 | (*CoreAPIVersionFunc)(&ConfigAPIVersion, &DebugAPIVersion, &VidextAPIVersion, NULL); | |
309 | if ((ConfigAPIVersion & 0xffff0000) != (CONFIG_API_VERSION & 0xffff0000)) | |
310 | { | |
311 | HleErrorMessage(NULL, "Emulator core Config API (v%i.%i.%i) incompatible with plugin (v%i.%i.%i)", | |
312 | VERSION_PRINTF_SPLIT(ConfigAPIVersion), VERSION_PRINTF_SPLIT(CONFIG_API_VERSION)); | |
313 | return M64ERR_INCOMPATIBLE; | |
314 | } | |
315 | ||
316 | /* Get the core config function pointers from the library handle */ | |
317 | ConfigOpenSection = (ptr_ConfigOpenSection) osal_dynlib_getproc(CoreLibHandle, "ConfigOpenSection"); | |
318 | ConfigDeleteSection = (ptr_ConfigDeleteSection) osal_dynlib_getproc(CoreLibHandle, "ConfigDeleteSection"); | |
319 | ConfigSetParameter = (ptr_ConfigSetParameter) osal_dynlib_getproc(CoreLibHandle, "ConfigSetParameter"); | |
320 | ConfigGetParameter = (ptr_ConfigGetParameter) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParameter"); | |
321 | ConfigSetDefaultInt = (ptr_ConfigSetDefaultInt) osal_dynlib_getproc(CoreLibHandle, "ConfigSetDefaultInt"); | |
322 | ConfigSetDefaultFloat = (ptr_ConfigSetDefaultFloat) osal_dynlib_getproc(CoreLibHandle, "ConfigSetDefaultFloat"); | |
323 | ConfigSetDefaultBool = (ptr_ConfigSetDefaultBool) osal_dynlib_getproc(CoreLibHandle, "ConfigSetDefaultBool"); | |
324 | ConfigSetDefaultString = (ptr_ConfigSetDefaultString) osal_dynlib_getproc(CoreLibHandle, "ConfigSetDefaultString"); | |
325 | ConfigGetParamInt = (ptr_ConfigGetParamInt) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParamInt"); | |
326 | ConfigGetParamFloat = (ptr_ConfigGetParamFloat) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParamFloat"); | |
327 | ConfigGetParamBool = (ptr_ConfigGetParamBool) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParamBool"); | |
328 | ConfigGetParamString = (ptr_ConfigGetParamString) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParamString"); | |
329 | ||
330 | if (!ConfigOpenSection || !ConfigDeleteSection || !ConfigSetParameter || !ConfigGetParameter || | |
331 | !ConfigSetDefaultInt || !ConfigSetDefaultFloat || !ConfigSetDefaultBool || !ConfigSetDefaultString || | |
332 | !ConfigGetParamInt || !ConfigGetParamFloat || !ConfigGetParamBool || !ConfigGetParamString) | |
333 | return M64ERR_INCOMPATIBLE; | |
334 | ||
335 | /* Get core DoCommand function */ | |
336 | CoreDoCommand = (ptr_CoreDoCommand) osal_dynlib_getproc(CoreLibHandle, "CoreDoCommand"); | |
337 | if (!CoreDoCommand) { | |
338 | return M64ERR_INCOMPATIBLE; | |
339 | } | |
340 | ||
341 | /* get a configuration section handle */ | |
342 | if (ConfigOpenSection(RSP_HLE_CONFIG_SECTION, &l_ConfigRspHle) != M64ERR_SUCCESS) | |
343 | { | |
344 | HleErrorMessage(NULL, "Couldn't open config section '" RSP_HLE_CONFIG_SECTION "'"); | |
345 | return M64ERR_INPUT_NOT_FOUND; | |
346 | } | |
347 | ||
348 | /* check the section version number */ | |
349 | if (ConfigGetParameter(l_ConfigRspHle, RSP_HLE_CONFIG_VERSION, M64TYPE_FLOAT, &fConfigParamsVersion, sizeof(float)) != M64ERR_SUCCESS) | |
350 | { | |
351 | HleWarnMessage(NULL, "No version number in '" RSP_HLE_CONFIG_SECTION "' config section. Setting defaults."); | |
352 | ConfigDeleteSection(RSP_HLE_CONFIG_SECTION); | |
353 | ConfigOpenSection(RSP_HLE_CONFIG_SECTION, &l_ConfigRspHle); | |
354 | } | |
355 | else if (((int) fConfigParamsVersion) != ((int) CONFIG_PARAM_VERSION)) | |
356 | { | |
357 | HleWarnMessage(NULL, "Incompatible version %.2f in '" RSP_HLE_CONFIG_SECTION "' config section: current is %.2f. Setting defaults.", fConfigParamsVersion, (float) CONFIG_PARAM_VERSION); | |
358 | ConfigDeleteSection(RSP_HLE_CONFIG_SECTION); | |
359 | ConfigOpenSection(RSP_HLE_CONFIG_SECTION, &l_ConfigRspHle); | |
360 | } | |
361 | else if ((CONFIG_PARAM_VERSION - fConfigParamsVersion) >= 0.0001f) | |
362 | { | |
363 | /* handle upgrades */ | |
364 | float fVersion = CONFIG_PARAM_VERSION; | |
365 | ConfigSetParameter(l_ConfigRspHle, "Version", M64TYPE_FLOAT, &fVersion); | |
366 | HleInfoMessage(NULL, "Updating parameter set version in '" RSP_HLE_CONFIG_SECTION "' config section to %.2f", fVersion); | |
367 | } | |
368 | ||
369 | /* set the default values for this plugin */ | |
370 | ConfigSetDefaultFloat(l_ConfigRspHle, RSP_HLE_CONFIG_VERSION, CONFIG_PARAM_VERSION, | |
371 | "Mupen64Plus RSP HLE Plugin config parameter version number"); | |
372 | ConfigSetDefaultString(l_ConfigRspHle, RSP_HLE_CONFIG_FALLBACK, "", | |
373 | "Path to a RSP plugin which will be used when encountering an unknown ucode." | |
374 | "You can disable this by letting an empty string."); | |
375 | ConfigSetDefaultBool(l_ConfigRspHle, RSP_HLE_CONFIG_HLE_GFX, 1, | |
376 | "Send display lists to the graphics plugin"); | |
377 | ConfigSetDefaultBool(l_ConfigRspHle, RSP_HLE_CONFIG_HLE_AUD, 0, | |
378 | "Send audio lists to the audio plugin"); | |
379 | ||
380 | l_CoreHandle = CoreLibHandle; | |
140 | 381 | |
141 | 382 | l_PluginInit = 1; |
142 | 383 | return M64ERR_SUCCESS; |
150 | 391 | /* reset some local variable */ |
151 | 392 | l_DebugCallback = NULL; |
152 | 393 | l_DebugCallContext = NULL; |
394 | l_CoreHandle = NULL; | |
395 | ||
396 | teardown_rsp_fallback(); | |
153 | 397 | |
154 | 398 | l_PluginInit = 0; |
155 | 399 | return M64ERR_SUCCESS; |
182 | 426 | return Cycles; |
183 | 427 | } |
184 | 428 | |
185 | EXPORT void CALL InitiateRSP(RSP_INFO Rsp_Info, unsigned int* UNUSED(CycleCount)) | |
429 | EXPORT void CALL InitiateRSP(RSP_INFO Rsp_Info, unsigned int* CycleCount) | |
186 | 430 | { |
187 | 431 | hle_init(&g_hle, |
188 | 432 | Rsp_Info.RDRAM, |
213 | 457 | l_ProcessAlistList = Rsp_Info.ProcessAlistList; |
214 | 458 | l_ProcessRdpList = Rsp_Info.ProcessRdpList; |
215 | 459 | l_ShowCFB = Rsp_Info.ShowCFB; |
460 | ||
461 | setup_rsp_fallback(ConfigGetParamString(l_ConfigRspHle, RSP_HLE_CONFIG_FALLBACK)); | |
462 | ||
463 | m64p_rom_header rom_header; | |
464 | CoreDoCommand(M64CMD_ROM_GET_HEADER, sizeof(rom_header), &rom_header); | |
465 | ||
466 | g_hle.hle_gfx = ConfigGetParamBool(l_ConfigRspHle, RSP_HLE_CONFIG_HLE_GFX); | |
467 | g_hle.hle_aud = ConfigGetParamBool(l_ConfigRspHle, RSP_HLE_CONFIG_HLE_AUD); | |
468 | ||
469 | /* notify fallback plugin */ | |
470 | if (l_InitiateRSP) { | |
471 | l_InitiateRSP(Rsp_Info, CycleCount); | |
472 | } | |
216 | 473 | } |
217 | 474 | |
218 | 475 | EXPORT void CALL RomClosed(void) |
219 | 476 | { |
220 | /* do nothing */ | |
221 | } | |
477 | /* notify fallback plugin */ | |
478 | if (l_RomClosed) { | |
479 | l_RomClosed(); | |
480 | } | |
481 | } |
0 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | |
1 | * Mupen64plus-rsp-hle - re2.c * | |
2 | * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | * Copyright (C) 2016 Gilles Siberlin * | |
4 | * * | |
5 | * This program is free software; you can redistribute it and/or modify * | |
6 | * it under the terms of the GNU General Public License as published by * | |
7 | * the Free Software Foundation; either version 2 of the License, or * | |
8 | * (at your option) any later version. * | |
9 | * * | |
10 | * This program is distributed in the hope that it will be useful, * | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | |
13 | * GNU General Public License for more details. * | |
14 | * * | |
15 | * You should have received a copy of the GNU General Public License * | |
16 | * along with this program; if not, write to the * | |
17 | * Free Software Foundation, Inc., * | |
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * | |
19 | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |
20 | ||
21 | #include <assert.h> | |
22 | #include <stdint.h> | |
23 | #include <stdlib.h> | |
24 | ||
25 | #include "hle_external.h" | |
26 | #include "hle_internal.h" | |
27 | #include "memory.h" | |
28 | ||
29 | #define SATURATE8(x) ((unsigned int) x <= 255 ? x : (x < 0 ? 0: 255)) | |
30 | ||
31 | /************************************************************************** | |
32 | * Resident evil 2 ucodes | |
33 | **************************************************************************/ | |
34 | void resize_bilinear_task(struct hle_t* hle) | |
35 | { | |
36 | int data_ptr = *dmem_u32(hle, TASK_UCODE_DATA); | |
37 | ||
38 | int src_addr = *dram_u32(hle, data_ptr); | |
39 | int dst_addr = *dram_u32(hle, data_ptr + 4); | |
40 | int dst_width = *dram_u32(hle, data_ptr + 8); | |
41 | int dst_height = *dram_u32(hle, data_ptr + 12); | |
42 | int x_ratio = *dram_u32(hle, data_ptr + 16); | |
43 | int y_ratio = *dram_u32(hle, data_ptr + 20); | |
44 | #if 0 /* unused, but keep it for documentation purpose */ | |
45 | int dst_stride = *dram_u32(hle, data_ptr + 24); | |
46 | #endif | |
47 | int src_offset = *dram_u32(hle, data_ptr + 36); | |
48 | ||
49 | int a, b, c ,d, index, y_index, xr, yr, blue, green, red, addr, i, j; | |
50 | long long x, y, x_diff, y_diff, one_min_x_diff, one_min_y_diff; | |
51 | unsigned short pixel; | |
52 | ||
53 | src_addr += (src_offset >> 16) * (320 * 3); | |
54 | x = y = 0; | |
55 | ||
56 | for(i = 0; i < dst_height; i++) | |
57 | { | |
58 | yr = (int)(y >> 16); | |
59 | y_diff = y - (yr << 16); | |
60 | one_min_y_diff = 65536 - y_diff; | |
61 | y_index = yr * 320; | |
62 | x = 0; | |
63 | ||
64 | for(j = 0; j < dst_width; j++) | |
65 | { | |
66 | xr = (int)(x >> 16); | |
67 | x_diff = x - (xr << 16); | |
68 | one_min_x_diff = 65536 - x_diff; | |
69 | index = y_index + xr; | |
70 | addr = src_addr + (index * 3); | |
71 | ||
72 | dram_load_u8(hle, (uint8_t*)&a, addr, 3); | |
73 | dram_load_u8(hle, (uint8_t*)&b, (addr + 3), 3); | |
74 | dram_load_u8(hle, (uint8_t*)&c, (addr + (320 * 3)), 3); | |
75 | dram_load_u8(hle, (uint8_t*)&d, (addr + (320 * 3) + 3), 3); | |
76 | ||
77 | blue = (int)(((a&0xff)*one_min_x_diff*one_min_y_diff + (b&0xff)*x_diff*one_min_y_diff + | |
78 | (c&0xff)*y_diff*one_min_x_diff + (d&0xff)*x_diff*y_diff) >> 32); | |
79 | ||
80 | green = (int)((((a>>8)&0xff)*one_min_x_diff*one_min_y_diff + ((b>>8)&0xff)*x_diff*one_min_y_diff + | |
81 | ((c>>8)&0xff)*y_diff*one_min_x_diff + ((d>>8)&0xff)*x_diff*y_diff) >> 32); | |
82 | ||
83 | red = (int)((((a>>16)&0xff)*one_min_x_diff*one_min_y_diff + ((b>>16)&0xff)*x_diff*one_min_y_diff + | |
84 | ((c>>16)&0xff)*y_diff*one_min_x_diff + ((d>>16)&0xff)*x_diff*y_diff) >> 32); | |
85 | ||
86 | blue = (blue >> 3) & 0x001f; | |
87 | green = (green >> 3) & 0x001f; | |
88 | red = (red >> 3) & 0x001f; | |
89 | pixel = (red << 11) | (green << 6) | (blue << 1) | 1; | |
90 | ||
91 | dram_store_u16(hle, &pixel, dst_addr, 1); | |
92 | dst_addr += 2; | |
93 | ||
94 | x += x_ratio; | |
95 | } | |
96 | y += y_ratio; | |
97 | } | |
98 | ||
99 | rsp_break(hle, SP_STATUS_TASKDONE); | |
100 | } | |
101 | ||
102 | static uint32_t YCbCr_to_RGBA(uint8_t Y, uint8_t Cb, uint8_t Cr) | |
103 | { | |
104 | int r, g, b; | |
105 | ||
106 | r = (int)(((double)Y * 0.582199097) + (0.701004028 * (double)(Cr - 128))); | |
107 | g = (int)(((double)Y * 0.582199097) - (0.357070923 * (double)(Cr - 128)) - (0.172073364 * (double)(Cb - 128))); | |
108 | b = (int)(((double)Y * 0.582199097) + (0.886001587 * (double)(Cb - 128))); | |
109 | ||
110 | r = SATURATE8(r); | |
111 | g = SATURATE8(g); | |
112 | b = SATURATE8(b); | |
113 | ||
114 | return (r << 24) | (g << 16) | (b << 8) | 0; | |
115 | } | |
116 | ||
117 | void decode_video_frame_task(struct hle_t* hle) | |
118 | { | |
119 | int data_ptr = *dmem_u32(hle, TASK_UCODE_DATA); | |
120 | ||
121 | int pLuminance = *dram_u32(hle, data_ptr); | |
122 | int pCb = *dram_u32(hle, data_ptr + 4); | |
123 | int pCr = *dram_u32(hle, data_ptr + 8); | |
124 | int pDestination = *dram_u32(hle, data_ptr + 12); | |
125 | int nMovieWidth = *dram_u32(hle, data_ptr + 16); | |
126 | int nMovieHeight = *dram_u32(hle, data_ptr + 20); | |
127 | #if 0 /* unused, but keep it for documentation purpose */ | |
128 | int nRowsPerDMEM = *dram_u32(hle, data_ptr + 24); | |
129 | int nDMEMPerFrame = *dram_u32(hle, data_ptr + 28); | |
130 | int nLengthSkipCount = *dram_u32(hle, data_ptr + 32); | |
131 | #endif | |
132 | int nScreenDMAIncrement = *dram_u32(hle, data_ptr + 36); | |
133 | ||
134 | int i, j; | |
135 | uint8_t Y, Cb, Cr; | |
136 | uint32_t pixel; | |
137 | int pY_1st_row, pY_2nd_row, pDest_1st_row, pDest_2nd_row; | |
138 | ||
139 | for (i = 0; i < nMovieHeight; i += 2) | |
140 | { | |
141 | pY_1st_row = pLuminance; | |
142 | pY_2nd_row = pLuminance + nMovieWidth; | |
143 | pDest_1st_row = pDestination; | |
144 | pDest_2nd_row = pDestination + (nScreenDMAIncrement >> 1); | |
145 | ||
146 | for (j = 0; j < nMovieWidth; j += 2) | |
147 | { | |
148 | dram_load_u8(hle, (uint8_t*)&Cb, pCb++, 1); | |
149 | dram_load_u8(hle, (uint8_t*)&Cr, pCr++, 1); | |
150 | ||
151 | /*1st row*/ | |
152 | dram_load_u8(hle, (uint8_t*)&Y, pY_1st_row++, 1); | |
153 | pixel = YCbCr_to_RGBA(Y, Cb, Cr); | |
154 | dram_store_u32(hle, &pixel, pDest_1st_row, 1); | |
155 | pDest_1st_row += 4; | |
156 | ||
157 | dram_load_u8(hle, (uint8_t*)&Y, pY_1st_row++, 1); | |
158 | pixel = YCbCr_to_RGBA(Y, Cb, Cr); | |
159 | dram_store_u32(hle, &pixel, pDest_1st_row, 1); | |
160 | pDest_1st_row += 4; | |
161 | ||
162 | /*2nd row*/ | |
163 | dram_load_u8(hle, (uint8_t*)&Y, pY_2nd_row++, 1); | |
164 | pixel = YCbCr_to_RGBA(Y, Cb, Cr); | |
165 | dram_store_u32(hle, &pixel, pDest_2nd_row, 1); | |
166 | pDest_2nd_row += 4; | |
167 | ||
168 | dram_load_u8(hle, (uint8_t*)&Y, pY_2nd_row++, 1); | |
169 | pixel = YCbCr_to_RGBA(Y, Cb, Cr); | |
170 | dram_store_u32(hle, &pixel, pDest_2nd_row, 1); | |
171 | pDest_2nd_row += 4; | |
172 | } | |
173 | ||
174 | pLuminance += (nMovieWidth << 1); | |
175 | pDestination += nScreenDMAIncrement; | |
176 | } | |
177 | ||
178 | rsp_break(hle, SP_STATUS_TASKDONE); | |
179 | } | |
180 | ||
181 | void fill_video_double_buffer_task(struct hle_t* hle) | |
182 | { | |
183 | int data_ptr = *dmem_u32(hle, TASK_UCODE_DATA); | |
184 | ||
185 | int pSrc = *dram_u32(hle, data_ptr); | |
186 | int pDest = *dram_u32(hle, data_ptr + 0x4); | |
187 | int width = *dram_u32(hle, data_ptr + 0x8) >> 1; | |
188 | int height = *dram_u32(hle, data_ptr + 0x10) << 1; | |
189 | int stride = *dram_u32(hle, data_ptr + 0x1c) >> 1; | |
190 | ||
191 | assert((*dram_u32(hle, data_ptr + 0x28) >> 16) == 0x8000); | |
192 | ||
193 | #if 0 /* unused, but keep it for documentation purpose */ | |
194 | int arg3 = *dram_u32(hle, data_ptr + 0xc); | |
195 | int arg5 = *dram_u32(hle, data_ptr + 0x14); | |
196 | int arg6 = *dram_u32(hle, data_ptr + 0x18); | |
197 | #endif | |
198 | ||
199 | int i, j; | |
200 | int r, g, b; | |
201 | uint32_t pixel, pixel1, pixel2; | |
202 | ||
203 | for(i = 0; i < height; i++) | |
204 | { | |
205 | for(j = 0; j < width; j=j+4) | |
206 | { | |
207 | pixel1 = *dram_u32(hle, pSrc+j); | |
208 | pixel2 = *dram_u32(hle, pDest+j); | |
209 | ||
210 | r = (((pixel1 >> 24) & 0xff) + ((pixel2 >> 24) & 0xff)) >> 1; | |
211 | g = (((pixel1 >> 16) & 0xff) + ((pixel2 >> 16) & 0xff)) >> 1; | |
212 | b = (((pixel1 >> 8) & 0xff) + ((pixel2 >> 8) & 0xff)) >> 1; | |
213 | ||
214 | pixel = (r << 24) | (g << 16) | (b << 8) | 0; | |
215 | ||
216 | dram_store_u32(hle, &pixel, pDest+j, 1); | |
217 | } | |
218 | pSrc += stride; | |
219 | pDest += stride; | |
220 | } | |
221 | ||
222 | rsp_break(hle, SP_STATUS_TASKDONE); | |
223 | } |
0 | 0 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
1 | 1 | * Mupen64plus-rsp-hle - ucodes.h * |
2 | * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * | |
2 | * Mupen64Plus homepage: https://mupen64plus.org/ * | |
3 | 3 | * Copyright (C) 2014 Bobby Smiles * |
4 | 4 | * * |
5 | 5 | * This program is free software; you can redistribute it and/or modify * |
125 | 125 | void alist_process_nead_mm (struct hle_t* hle); |
126 | 126 | void alist_process_nead_mmb (struct hle_t* hle); |
127 | 127 | void alist_process_nead_ac (struct hle_t* hle); |
128 | ||
128 | void alist_process_nead_mats(struct hle_t* hle); | |
129 | void alist_process_nead_efz (struct hle_t* hle); | |
129 | 130 | |
130 | 131 | /* mp3 ucode */ |
131 | 132 | void mp3_task(struct hle_t* hle, unsigned int index, uint32_t address); |
141 | 142 | void jpeg_decode_PS(struct hle_t* hle); |
142 | 143 | void jpeg_decode_OB(struct hle_t* hle); |
143 | 144 | |
145 | /* Resident evil 2 ucode */ | |
146 | void resize_bilinear_task(struct hle_t* hle); | |
147 | void decode_video_frame_task(struct hle_t* hle); | |
148 | void fill_video_double_buffer_task(struct hle_t* hle); | |
149 | ||
144 | 150 | #endif |
145 | 151 |