Codebase list mupen64plus-rsp-hle / fresh-releases/main
[ Sven Eckelmann ] [ Debian Janitor ] New upstream release. Debian Janitor 2 years ago
31 changed file(s) with 1140 addition(s) and 227 deletion(s). Raw diff Collapse all Expand all
0 sudo: required
1 dist: xenial
02 language: cpp
13 compiler:
24 - gcc
35 - clang
6 addons:
7 apt:
8 packages:
9 - git
410 before_install:
5 - sudo apt-get update -qq
6 - sudo apt-get install -y git
711 - git clone --depth=1 --branch=master git://github.com/mupen64plus/mupen64plus-core.git deps/mupen64plus-core
812 env:
913 - DUMP=0
1014 - DUMP=1
1115 script:
1216 - 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
2929 Version 2, June 1991
3030
3131 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
3333 Everyone is permitted to copy and distribute verbatim copies
3434 of this license document, but changing it is not allowed.
3535
00 RSP High-Level Emulation plugin for Mupen64Plus
11 -----------------------------------------------
2
3 Mupen64Plus-rsp-hle v2.5.9 - February 10, 2019
4 ----------------------------------------------
5 - *** BETA RELEASE *** For Testing Only ***
26
37 Mupen64Plus-rsp-hle v2.5 - April 26, 2015
48 -------------------------------------------------
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 ]
23 * debian/control:
34 - Upgraded to policy 4.5.1, no changes required
45 - Allow build without (fake)root
1112 * debian/rules:
1213 - Drop default flag --as-needed from linker flags
1314
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> Fri, 06 Aug 2021 08:05:16 -0000
1519
1620 mupen64plus-rsp-hle (2.5-5) unstable; urgency=medium
1721
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>
00 #/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
11 # * mupen64plus-rsp-hle - Makefile *
2 # * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
2 # * Mupen64Plus homepage: https://mupen64plus.org/ *
33 # * Copyright (C) 2008-2009 Richard Goedeken *
44 # * Copyright (C) 2007-2008 DarkJeztr Tillin9 *
55 # * *
5252 OS = FREEBSD
5353 SO_EXTENSION = so
5454 SHARED = -shared
55 $(warning OS type "$(UNAME)" not officially supported.')
5655 endif
5756 ifneq ("$(filter GNU/kFreeBSD kfreebsd,$(UNAME))","")
5857 OS = LINUX
6665 PIC = 0
6766 endif
6867 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')
7069 endif
7170
7271 # detect system architecture
116115 PIC ?= 1
117116 $(warning Architecture "$(HOST_CPU)" not officially supported.')
118117 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
119125 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')
121127 endif
122128
123129 # base CFLAGS, LDLIBS, and LDFLAGS
151157 ifeq ($(OS), LINUX)
152158 # only export api symbols
153159 LDFLAGS += -Wl,-version-script,$(SRCDIR)/rsp_api_export.ver
160 LDLIBS += -ldl
154161 endif
155162 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)
159164
160165 ifeq ($(CPU), X86)
161166 ifeq ($(ARCH_DETECTED), 64BITS)
210215 CFLAGS += -g
211216 INSTALL_STRIP_FLAG ?=
212217 else
218 CFLAGS += -DNDEBUG
213219 ifneq ($(OS),OSX)
214220 INSTALL_STRIP_FLAG ?= -s
215221 endif
248254 $(SRCDIR)/memory.c \
249255 $(SRCDIR)/mp3.c \
250256 $(SRCDIR)/musyx.c \
257 $(SRCDIR)/re2.c \
251258 $(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
252267
253268 # generate a list of object files build, make a temporary directory for them
254269 OBJECTS := $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(filter %.c, $(SOURCE)))
00 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
11 * Mupen64plus-rsp-hle - alist.c *
2 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
2 * Mupen64Plus homepage: https://mupen64plus.org/ *
33 * Copyright (C) 2014 Bobby Smiles *
44 * Copyright (C) 2009 Richard Goedeken *
55 * Copyright (C) 2002 Hacktarux *
4949
5050 static int16_t* sample(struct hle_t* hle, unsigned pos)
5151 {
52 return (int16_t*)hle->alist_buffer + (pos ^ S);
52 return (int16_t*)hle->alist_buffer + ((pos ^ S) & 0xfff);
5353 }
5454
5555 static uint8_t* alist_u8(struct hle_t* hle, uint16_t dmem)
5656 {
57 return u8(hle->alist_buffer, dmem);
57 return (uint8_t*)(hle->alist_buffer + ((dmem ^ S8) & 0xfff));
5858 }
5959
6060 static int16_t* alist_s16(struct hle_t* hle, uint16_t dmem)
6161 {
62 return (int16_t*)u16(hle->alist_buffer, dmem);
62 return (int16_t*)(hle->alist_buffer + ((dmem ^ S16) & 0xfff));
6363 }
6464
6565
281281 int x, y;
282282 short save_buffer[40];
283283
284 memcpy((uint8_t *)save_buffer, (hle->dram + address), sizeof(save_buffer));
284285 if (init) {
285286 ramps[0].value = (vol[0] << 16);
286287 ramps[1].value = (vol[1] << 16);
291292 exp_seq[0] = (vol[0] * rate[0]);
292293 exp_seq[1] = (vol[1] * rate[1]);
293294 } else {
294 memcpy((uint8_t *)save_buffer, (hle->dram + address), 80);
295295 wet = *(int16_t *)(save_buffer + 0); /* 0-1 */
296296 dry = *(int16_t *)(save_buffer + 2); /* 2-3 */
297297 ramps[0].target = *(int32_t *)(save_buffer + 4); /* 4-5 */
353353 *(int32_t *)(save_buffer + 14) = exp_seq[1]; /* 14-15 */
354354 *(int32_t *)(save_buffer + 16) = (int32_t)ramps[0].value; /* 12-13 */
355355 *(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));
357357 }
358358
359359 void alist_envmix_ge(
381381 struct ramp_t ramps[2];
382382 short save_buffer[40];
383383
384 memcpy((uint8_t *)save_buffer, (hle->dram + address), 80);
384385 if (init) {
385386 ramps[0].value = (vol[0] << 16);
386387 ramps[1].value = (vol[1] << 16);
389390 ramps[0].step = rate[0] / 8;
390391 ramps[1].step = rate[1] / 8;
391392 } else {
392 memcpy((uint8_t *)save_buffer, (hle->dram + address), 80);
393393 wet = *(int16_t *)(save_buffer + 0); /* 0-1 */
394394 dry = *(int16_t *)(save_buffer + 2); /* 2-3 */
395395 ramps[0].target = *(int32_t *)(save_buffer + 4); /* 4-5 */
457457 int16_t* const wl = (int16_t*)(hle->alist_buffer + dmem_wl);
458458 int16_t* const wr = (int16_t*)(hle->alist_buffer + dmem_wr);
459459
460 memcpy((uint8_t *)save_buffer, hle->dram + address, 80);
460461 if (init) {
461462 ramps[0].step = rate[0] / 8;
462463 ramps[0].value = (vol[0] << 16);
466467 ramps[1].target = (target[1] << 16);
467468 }
468469 else {
469 memcpy((uint8_t *)save_buffer, hle->dram + address, 80);
470470 wet = *(int16_t *)(save_buffer + 0); /* 0-1 */
471471 dry = *(int16_t *)(save_buffer + 2); /* 2-3 */
472472 ramps[0].target = *(int16_t *)(save_buffer + 4) << 16; /* 4-5 */
665665 while (count != 0) {
666666 const int16_t* lut = RESAMPLE_LUT + ((pitch_accu & 0xfc00) >> 8);
667667
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);
673673
674674 pitch_accu += pitch;
675675 ipos += (pitch_accu >> 16);
960960 count -= 16;
961961 } while (count != 0);
962962
963 dram_store_u16(hle, (uint16_t*)(dst - 4), address, 4);
963 dram_store_u32(hle, (uint32_t*)(dst - 4), address, 2);
964964 }
965965
966966 void alist_iirf(
00 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
11 * Mupen64plus-rsp-hle - alist.h *
2 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
2 * Mupen64Plus homepage: https://mupen64plus.org/ *
33 * Copyright (C) 2014 Bobby Smiles *
44 * *
55 * This program is free software; you can redistribute it and/or modify *
00 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
11 * Mupen64plus-rsp-hle - alist_audio.c *
2 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
2 * Mupen64Plus homepage: https://mupen64plus.org/ *
33 * Copyright (C) 2014 Bobby Smiles *
44 * Copyright (C) 2009 Richard Goedeken *
55 * Copyright (C) 2002 Hacktarux *
5656 static void CLEARBUFF(struct hle_t* hle, uint32_t w1, uint32_t w2)
5757 {
5858 uint16_t dmem = w1 + DMEM_BASE;
59 uint16_t count = w2;
59 uint16_t count = w2 & 0xfff;
6060
6161 if (count == 0)
6262 return;
110110
111111 alist_resample(
112112 hle,
113 flags & 0x1,
113 flags & A_INIT,
114114 flags & 0x2,
115115 hle->alist_audio.out,
116116 hle->alist_audio.in,
151151
152152 alist_adpcm(
153153 hle,
154 flags & 0x1,
155 flags & 0x2,
154 flags & A_INIT,
155 flags & A_LOOP,
156156 false, /* unsupported in this ucode */
157157 hle->alist_audio.out,
158158 hle->alist_audio.in,
277277
278278 clear_segments(hle);
279279 alist_process(hle, ABI, 0x10);
280 rsp_break(hle, SP_STATUS_TASKDONE);
280281 }
281282
282283 void alist_process_audio_ge(struct hle_t* hle)
290291
291292 clear_segments(hle);
292293 alist_process(hle, ABI, 0x10);
294 rsp_break(hle, SP_STATUS_TASKDONE);
293295 }
294296
295297 void alist_process_audio_bc(struct hle_t* hle)
303305
304306 clear_segments(hle);
305307 alist_process(hle, ABI, 0x10);
306 }
308 rsp_break(hle, SP_STATUS_TASKDONE);
309 }
00 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
11 * Mupen64plus-rsp-hle - alist_naudio.c *
2 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
2 * Mupen64Plus homepage: https://mupen64plus.org/ *
33 * Copyright (C) 2014 Bobby Smiles *
44 * Copyright (C) 2009 Richard Goedeken *
55 * Copyright (C) 2002 Hacktarux *
107107 {
108108 uint8_t flags = (w1 >> 16);
109109
110 if (flags & 0x4) {
111 if (flags & 0x2) {
110 if (flags & A_VOL) {
111 if (flags & A_LEFT) {
112112 hle->alist_naudio.vol[0] = w1;
113113 hle->alist_naudio.dry = (w2 >> 16);
114114 hle->alist_naudio.wet = w2;
115115 }
116 else {
116 else { /* A_RIGHT */
117117 hle->alist_naudio.target[1] = w1;
118118 hle->alist_naudio.rate[1] = w2;
119119 }
120120 }
121 else {
121 else { /* A_RATE */
122122 hle->alist_naudio.target[0] = w1;
123123 hle->alist_naudio.rate[0] = w2;
124124 }
133133
134134 alist_envmix_lin(
135135 hle,
136 flags & 0x1,
136 flags & A_INIT,
137137 NAUDIO_DRY_LEFT,
138138 NAUDIO_DRY_RIGHT,
139139 NAUDIO_WET_LEFT,
151151 static void CLEARBUFF(struct hle_t* hle, uint32_t w1, uint32_t w2)
152152 {
153153 uint16_t dmem = w1 + NAUDIO_MAIN;
154 uint16_t count = w2;
154 uint16_t count = w2 & 0xfff;
155155
156156 alist_clear(hle, dmem, count);
157157 }
215215
216216 alist_adpcm(
217217 hle,
218 flags & 0x1,
219 flags & 0x2,
218 flags & A_INIT,
219 flags & A_LOOP,
220220 false, /* unsuported by this ucode */
221221 dmemo,
222222 dmemi,
236236
237237 alist_resample(
238238 hle,
239 flags & 0x1,
239 flags & A_INIT,
240240 false, /* TODO: check which ABI supports it */
241241 dmemo,
242242 dmemi,
273273 };
274274
275275 alist_process(hle, ABI, 0x10);
276 rsp_break(hle, SP_STATUS_TASKDONE);
276277 }
277278
278279 void alist_process_naudio_bk(struct hle_t* hle)
286287 };
287288
288289 alist_process(hle, ABI, 0x10);
290 rsp_break(hle, SP_STATUS_TASKDONE);
289291 }
290292
291293 void alist_process_naudio_dk(struct hle_t* hle)
299301 };
300302
301303 alist_process(hle, ABI, 0x10);
304 rsp_break(hle, SP_STATUS_TASKDONE);
302305 }
303306
304307 void alist_process_naudio_mp3(struct hle_t* hle)
311314 };
312315
313316 alist_process(hle, ABI, 0x10);
317 rsp_break(hle, SP_STATUS_TASKDONE);
314318 }
315319
316320 void alist_process_naudio_cbfd(struct hle_t* hle)
324328 };
325329
326330 alist_process(hle, ABI, 0x10);
327 }
331 rsp_break(hle, SP_STATUS_TASKDONE);
332 }
00 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
11 * Mupen64plus-rsp-hle - alist_nead.c *
2 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
2 * Mupen64Plus homepage: https://mupen64plus.org/ *
33 * Copyright (C) 2014 Bobby Smiles *
44 * Copyright (C) 2009 Richard Goedeken *
55 * Copyright (C) 2002 Hacktarux *
9191 static void CLEARBUFF(struct hle_t* hle, uint32_t w1, uint32_t w2)
9292 {
9393 uint16_t dmem = w1;
94 uint16_t count = w2;
94 uint16_t count = w2 & 0xfff;
9595
9696 if (count == 0)
9797 return;
299299 static void HILOGAIN(struct hle_t* hle, uint32_t w1, uint32_t w2)
300300 {
301301 int8_t gain = (w1 >> 16); /* Q4.4 signed */
302 uint16_t count = w1;
302 uint16_t count = w1 & 0xfff;
303303 uint16_t dmem = (w2 >> 16);
304304
305305 alist_multQ44(hle, dmem, count, gain);
371371 };
372372
373373 alist_process(hle, ABI, 0x20);
374 rsp_break(hle, SP_STATUS_TASKDONE);
374375 }
375376
376377 void alist_process_nead_sf(struct hle_t* hle)
387388 };
388389
389390 alist_process(hle, ABI, 0x20);
391 rsp_break(hle, SP_STATUS_TASKDONE);
390392 }
391393
392394 void alist_process_nead_sfj(struct hle_t* hle)
403405 };
404406
405407 alist_process(hle, ABI, 0x20);
408 rsp_break(hle, SP_STATUS_TASKDONE);
406409 }
407410
408411 void alist_process_nead_fz(struct hle_t* hle)
419422 };
420423
421424 alist_process(hle, ABI, 0x20);
425 rsp_break(hle, SP_STATUS_TASKDONE);
422426 }
423427
424428 void alist_process_nead_wrjb(struct hle_t* hle)
435439 };
436440
437441 alist_process(hle, ABI, 0x20);
442 rsp_break(hle, SP_STATUS_TASKDONE);
438443 }
439444
440445 void alist_process_nead_ys(struct hle_t* hle)
449454 };
450455
451456 alist_process(hle, ABI, 0x18);
457 rsp_break(hle, SP_STATUS_TASKDONE);
452458 }
453459
454460 void alist_process_nead_1080(struct hle_t* hle)
463469 };
464470
465471 alist_process(hle, ABI, 0x18);
472 rsp_break(hle, SP_STATUS_TASKDONE);
466473 }
467474
468475 void alist_process_nead_oot(struct hle_t* hle)
477484 };
478485
479486 alist_process(hle, ABI, 0x18);
487 rsp_break(hle, SP_STATUS_TASKDONE);
480488 }
481489
482490 void alist_process_nead_mm(struct hle_t* hle)
491499 };
492500
493501 alist_process(hle, ABI, 0x18);
502 rsp_break(hle, SP_STATUS_TASKDONE);
494503 }
495504
496505 void alist_process_nead_mmb(struct hle_t* hle)
505514 };
506515
507516 alist_process(hle, ABI, 0x18);
517 rsp_break(hle, SP_STATUS_TASKDONE);
508518 }
509519
510520 void alist_process_nead_ac(struct hle_t* hle)
519529 };
520530
521531 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 }
00 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
11 * Mupen64plus-rsp-hle - arithmetics.h *
2 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
2 * Mupen64Plus homepage: https://mupen64plus.org/ *
33 * Copyright (C) 2014 Bobby Smiles *
44 * *
55 * This program is free software; you can redistribute it and/or modify *
00 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
11 * Mupen64plus-rsp-hle - audio.c *
2 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
2 * Mupen64Plus homepage: https://mupen64plus.org/ *
33 * Copyright (C) 2014 Bobby Smiles *
44 * *
55 * This program is free software; you can redistribute it and/or modify *
00 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
11 * Mupen64plus-rsp-hle - audio.h *
2 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
2 * Mupen64Plus homepage: https://mupen64plus.org/ *
33 * Copyright (C) 2014 Bobby Smiles *
44 * *
55 * This program is free software; you can redistribute it and/or modify *
00 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
11 * Mupen64plus-rsp-hle - cicx105.c *
2 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
2 * Mupen64Plus homepage: https://mupen64plus.org/ *
33 * Copyright (C) 2012 Bobby Smiles *
44 * Copyright (C) 2009 Richard Goedeken *
55 * Copyright (C) 2002 Hacktarux *
4949 src += 0x8;
5050
5151 }
52
53 rsp_break(hle, 0);
5254 }
5355
00 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
11 * Mupen64plus-rsp-hle - common.h *
2 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
2 * Mupen64Plus homepage: https://mupen64plus.org/ *
33 * Copyright (C) 2014 Bobby Smiles *
44 * *
55 * This program is free software; you can redistribute it and/or modify *
00 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
11 * Mupen64plus-rsp-hle - hle.c *
2 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
2 * Mupen64Plus homepage: https://mupen64plus.org/ *
33 * Copyright (C) 2012 Bobby Smiles *
44 * Copyright (C) 2009 Richard Goedeken *
55 * Copyright (C) 2002 Hacktarux *
3434
3535 #define min(a,b) (((a) < (b)) ? (a) : (b))
3636
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
4337 /* some rdp status flags */
4438 #define DP_STATUS_FREEZE 0x2
4539
46 /* some mips interface interrupt flags */
47 #define MI_INTR_SP 0x1
4840
4941
5042 /* helper functions prototypes */
5143 static unsigned int sum_bytes(const unsigned char *bytes, unsigned int size);
5244 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);
5546 static bool try_fast_audio_dispatching(struct hle_t* hle);
5647 static bool try_fast_task_dispatching(struct hle_t* hle);
5748 static void normal_task_dispatching(struct hle_t* hle);
5849 static void non_task_dispatching(struct hle_t* hle);
50 static bool try_re2_task_dispatching(struct hle_t* hle);
5951
6052 #ifdef ENABLE_TASK_DUMP
6153 static void dump_binary(struct hle_t* hle, const char *const filename,
6456 static void dump_unknown_task(struct hle_t* hle, unsigned int sum);
6557 static void dump_unknown_non_task(struct hle_t* hle, unsigned int sum);
6658 #endif
67
68 /* local variables */
69 static const bool FORWARD_AUDIO = false, FORWARD_GFX = true;
7059
7160 /* Global functions */
7261 void hle_init(struct hle_t* hle,
122111 if (is_task(hle)) {
123112 if (!try_fast_task_dispatching(hle))
124113 normal_task_dispatching(hle);
125 rsp_break(hle, SP_STATUS_TASKDONE);
126114 } else {
127115 non_task_dispatching(hle);
128 rsp_break(hle, 0);
129116 }
130117 }
131118
156143 return (*dmem_u32(hle, TASK_UCODE_BOOT_SIZE) <= 0x1000);
157144 }
158145
159 static void rsp_break(struct hle_t* hle, unsigned int setbits)
146 void rsp_break(struct hle_t* hle, unsigned int setbits)
160147 {
161148 *hle->sp_status |= setbits | SP_STATUS_BROKE | SP_STATUS_HALT;
162149
166153 }
167154 }
168155
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
171171 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 }
172177 }
173178
174179 static bool try_fast_audio_dispatching(struct hle_t* hle)
219224 alist_process_nead_ac(hle); return true;
220225 case 0x00010010: /* MusyX v2 (IndianaJones, BattleForNaboo) */
221226 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;
223231 default:
224232 HleWarnMessage(hle->user_defined, "ABI2 identification regression: v=%08x", v);
225233 }
257265 /* identify task ucode by its type */
258266 switch (*dmem_u32(hle, TASK_TYPE)) {
259267 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);
262275 return true;
263276 }
264277 break;
265278
266279 case 2:
267 if (FORWARD_AUDIO) {
268 HleProcessAlistList(hle->user_defined);
280 if (hle->hle_aud) {
281 send_alist_to_audio_plugin(hle);
269282 return true;
270283 } else if (try_fast_audio_dispatching(hle))
271284 return true;
273286
274287 case 7:
275288 HleShowCFB(hle->user_defined);
276 return true;
289 break;
277290 }
278291
279292 return false;
288301 /* StoreVe12: found in Zelda Ocarina of Time [misleading task->type == 4] */
289302 case 0x278:
290303 /* Nothing to emulate */
304 rsp_break(hle, SP_STATUS_TASKDONE);
291305 return;
292306
293307 /* GFX: Twintris [misleading task->type == 0] */
294308 case 0x212ee:
295 if (FORWARD_GFX) {
296 forward_gfx_task(hle);
309 if (hle->hle_gfx) {
310 send_dlist_to_gfx_plugin(hle);
297311 return;
298312 }
299313 break;
315329 return;
316330 }
317331
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);
319340 #ifdef ENABLE_TASK_DUMP
320 dump_unknown_task(hle, sum);
341 dump_unknown_task(hle, sum);
321342 #endif
343 }
322344 }
323345
324346 static void non_task_dispatching(struct hle_t* hle)
332354 return;
333355 }
334356
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);
336362 #ifdef ENABLE_TASK_DUMP
337 dump_unknown_non_task(hle, sum);
363 dump_unknown_non_task(hle, sum);
338364 #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 }
341391
342392 #ifdef ENABLE_TASK_DUMP
343393 static void dump_unknown_task(struct hle_t* hle, unsigned int sum)
00 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
11 * Mupen64plus-rsp-hle - hle.h *
2 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
2 * Mupen64Plus homepage: https://mupen64plus.org/ *
33 * Copyright (C) 2014 Bobby Smiles *
44 * *
55 * This program is free software; you can redistribute it and/or modify *
00 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
11 * Mupen64plus-rsp-hle - hle_external.h *
2 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
2 * Mupen64Plus homepage: https://mupen64plus.org/ *
33 * Copyright (C) 2014 Bobby Smiles *
44 * *
55 * This program is free software; you can redistribute it and/or modify *
2424 /* users of the hle core are expected to define these functions */
2525
2626 void HleVerboseMessage(void* user_defined, const char *message, ...);
27 void HleInfoMessage(void* user_defined, const char *message, ...);
2728 void HleErrorMessage(void* user_defined, const char *message, ...);
2829 void HleWarnMessage(void* user_defined, const char *message, ...);
2930
3233 void HleProcessAlistList(void* user_defined);
3334 void HleProcessRdpList(void* user_defined);
3435 void HleShowCFB(void* user_defined);
36 int HleForwardTask(void* user_defined);
3537
3638 #endif
3739
00 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
11 * Mupen64plus-rsp-hle - hle_internal.h *
2 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
2 * Mupen64Plus homepage: https://mupen64plus.org/ *
33 * Copyright (C) 2014 Bobby Smiles *
44 * *
55 * This program is free software; you can redistribute it and/or modify *
5656 /* for user convenience, this will be passed to "external" functions */
5757 void* user_defined;
5858
59 int hle_gfx;
60 int hle_aud;
5961
6062 /* alist.c */
6163 uint8_t alist_buffer[0x1000];
7375 uint8_t mp3_buffer[0x1000];
7476 };
7577
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
7689 #endif
7790
00 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
11 * Mupen64plus-rsp-hle - jpeg.c *
2 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
2 * Mupen64Plus homepage: https://mupen64plus.org/ *
33 * Copyright (C) 2012 Bobby Smiles *
44 * Copyright (C) 2009 Richard Goedeken *
55 * Copyright (C) 2002 Hacktarux *
140140 void jpeg_decode_PS0(struct hle_t* hle)
141141 {
142142 jpeg_decode_std(hle, "PS0", RescaleYSubBlock, RescaleUVSubBlock, EmitYUVTileLine);
143 rsp_break(hle, SP_STATUS_TASKDONE);
143144 }
144145
145146 /***************************************************************************
149150 void jpeg_decode_PS(struct hle_t* hle)
150151 {
151152 jpeg_decode_std(hle, "PS", NULL, NULL, EmitRGBATileLine);
153 rsp_break(hle, SP_STATUS_TASKDONE);
152154 }
153155
154156 /***************************************************************************
189191
190192 address += (2 * 6 * SUBBLOCK_SIZE);
191193 }
194 rsp_break(hle, SP_STATUS_TASKDONE);
192195 }
193196
194197
471474 unsigned int i;
472475
473476 /* source and destination sublocks cannot overlap */
474 assert(abs(dst - src) > SUBBLOCK_SIZE);
477 assert(labs(dst - src) > SUBBLOCK_SIZE);
475478
476479 for (i = 0; i < SUBBLOCK_SIZE; ++i)
477480 dst[i] = src[table[i]];
00 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
11 * Mupen64plus-rsp-hle - memory.c *
2 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
2 * Mupen64Plus homepage: https://mupen64plus.org/ *
33 * Copyright (C) 2014 Bobby Smiles *
44 * *
55 * This program is free software; you can redistribute it and/or modify *
00 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
11 * Mupen64plus-rsp-hle - memory.h *
2 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
2 * Mupen64Plus homepage: https://mupen64plus.org/ *
33 * Copyright (C) 2014 Bobby Smiles *
44 * *
55 * This program is free software; you can redistribute it and/or modify *
00 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
11 * Mupen64plus-rsp-hle - mp3.c *
2 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
2 * Mupen64Plus homepage: https://mupen64plus.org/ *
33 * Copyright (C) 2014 Bobby Smiles *
44 * Copyright (C) 2009 Richard Goedeken *
55 * Copyright (C) 2002 Hacktarux *
00 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
11 * Mupen64plus-rsp-hle - musyx.c *
2 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
2 * Mupen64Plus homepage: https://mupen64plus.org/ *
33 * Copyright (C) 2013 Bobby Smiles *
44 * *
55 * This program is free software; you can redistribute it and/or modify *
255255 dram_store_u16(hle, (uint16_t *)musyx.cc0, state_ptr + STATE_CC0, SUBFRAME_SIZE);
256256 dram_store_u16(hle, (uint16_t *)musyx.subframe_740_last4, state_ptr + STATE_740_LAST4_V1,
257257 4);
258
259 rsp_break(hle, SP_STATUS_TASKDONE);
258260 }
259261
260262 /**************************************************************************
332334
333335 sfd_ptr += SFD2_VOICES + MAX_VOICES * VOICE_SIZE;
334336 }
337
338 rsp_break(hle, SP_STATUS_TASKDONE);
335339 }
336340
337341
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 }
00 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
11 * Mupen64plus-rsp-hle - plugin.c *
2 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
2 * Mupen64Plus homepage: https://mupen64plus.org/ *
33 * Copyright (C) 2014 Bobby Smiles *
44 * Copyright (C) 2009 Richard Goedeken *
55 * Copyright (C) 2002 Hacktarux *
2222
2323 #include <stdarg.h>
2424 #include <stdio.h>
25 #include <string.h>
2526
2627 #include "common.h"
2728 #include "hle.h"
2829 #include "hle_internal.h"
30 #include "hle_external.h"
2931
3032 #define M64P_PLUGIN_PROTOTYPES 1
3133 #include "m64p_common.h"
34 #include "m64p_config.h"
35 #include "m64p_frontend.h"
3236 #include "m64p_plugin.h"
3337 #include "m64p_types.h"
3438
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
3646 #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)
3760
3861 /* local variables */
3962 static struct hle_t g_hle;
4467 static void (*l_ShowCFB)(void) = NULL;
4568 static void (*l_DebugCallback)(void *, int, const char *) = NULL;
4669 static void *l_DebugCallContext = NULL;
70 static m64p_dynlib_handle l_CoreHandle = NULL;
4771 static int l_PluginInit = 0;
4872
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
4995 /* 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
50189 static void DebugMessage(int level, const char *message, va_list args)
51190 {
52191 char msgbuf[1024];
68207 va_end(args);
69208 }
70209
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
71218 void HleErrorMessage(void* UNUSED(user_defined), const char *message, ...)
72219 {
73220 va_list args;
125272 }
126273
127274
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
128285 /* 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,
130287 void (*DebugCallback)(void *, int, const char *))
131288 {
289 ptr_CoreGetAPIVersions CoreAPIVersionFunc;
290 int ConfigAPIVersion, DebugAPIVersion, VidextAPIVersion;
291 float fConfigParamsVersion = 0.0f;
292
132293 if (l_PluginInit)
133294 return M64ERR_ALREADY_INIT;
134295
136297 l_DebugCallback = DebugCallback;
137298 l_DebugCallContext = Context;
138299
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;
140381
141382 l_PluginInit = 1;
142383 return M64ERR_SUCCESS;
150391 /* reset some local variable */
151392 l_DebugCallback = NULL;
152393 l_DebugCallContext = NULL;
394 l_CoreHandle = NULL;
395
396 teardown_rsp_fallback();
153397
154398 l_PluginInit = 0;
155399 return M64ERR_SUCCESS;
182426 return Cycles;
183427 }
184428
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)
186430 {
187431 hle_init(&g_hle,
188432 Rsp_Info.RDRAM,
213457 l_ProcessAlistList = Rsp_Info.ProcessAlistList;
214458 l_ProcessRdpList = Rsp_Info.ProcessRdpList;
215459 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 }
216473 }
217474
218475 EXPORT void CALL RomClosed(void)
219476 {
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 }
00 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
11 * Mupen64plus-rsp-hle - ucodes.h *
2 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
2 * Mupen64Plus homepage: https://mupen64plus.org/ *
33 * Copyright (C) 2014 Bobby Smiles *
44 * *
55 * This program is free software; you can redistribute it and/or modify *
125125 void alist_process_nead_mm (struct hle_t* hle);
126126 void alist_process_nead_mmb (struct hle_t* hle);
127127 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);
129130
130131 /* mp3 ucode */
131132 void mp3_task(struct hle_t* hle, unsigned int index, uint32_t address);
141142 void jpeg_decode_PS(struct hle_t* hle);
142143 void jpeg_decode_OB(struct hle_t* hle);
143144
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
144150 #endif
145151