Merge pull request #9600 from Bonta0/mgba-pr

Full GBA Controllers Integration with mGBA
This commit is contained in:
JMC47
2021-07-21 02:36:43 -04:00
committed by GitHub
99 changed files with 4327 additions and 412 deletions
+1
View File
@@ -3,6 +3,7 @@ Thumbs.db
# Ignore Finder view option files created by OS X
.DS_Store
# Ignore autogenerated source files
Externals/mGBA/version.c
Source/Core/Common/scmrev.h
# Ignore files output by build
/[Bb]uild*/
+5
View File
@@ -3,3 +3,8 @@
url = https://github.com/dolphin-emu/ext-win-qt.git
branch = master
shallow = true
[submodule "Externals/mGBA/mgba"]
path = Externals/mGBA/mgba
url = https://github.com/mgba-emu/mgba.git
branch = master
shallow = true
+9
View File
@@ -45,6 +45,7 @@ option(ENABLE_LLVM "Enables LLVM support, for disassembly" ON)
option(ENABLE_TESTS "Enables building the unit tests" ON)
option(ENABLE_VULKAN "Enables vulkan video backend" ON)
option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence, show the current game on Discord" ON)
option(USE_MGBA "Enables GBA controllers emulation using libmgba" ON)
# Maintainers: if you consider blanket disabling this for your users, please
# consider the following points:
@@ -826,6 +827,14 @@ if(USE_DISCORD_PRESENCE)
include_directories(Externals/discord-rpc/include)
endif()
if(NOT ENABLE_QT)
set(USE_MGBA 0)
endif()
if(USE_MGBA)
message(STATUS "Using static libmgba from Externals")
add_subdirectory(Externals/mGBA)
endif()
find_package(SYSTEMD)
if(SYSTEMD_FOUND)
message(STATUS "libsystemd found, enabling traversal server watchdog support")
+3
View File
@@ -58,6 +58,9 @@
<ProjectReference Include="$(ExternalsDir)mbedtls\mbedTLS.vcxproj">
<Project>{bdb6578b-0691-4e80-a46c-df21639fd3b8}</Project>
</ProjectReference>
<ProjectReference Include="$(ExternalsDir)mGBA\mgba.vcxproj">
<Project>{864C4C8E-296D-3DBC-AD83-F1D5CB6E8EC6}</Project>
</ProjectReference>
<ProjectReference Include="$(ExternalsDir)miniupnpc\miniupnpc.vcxproj">
<Project>{31643fdb-1bb8-4965-9de7-000fc88d35ae}</Project>
</ProjectReference>
+2
View File
@@ -38,6 +38,8 @@ Dolphin includes or links code of the following third-party software projects:
[University of Illinois/NCSA Open Source license](http://llvm.org/docs/DeveloperPolicy.html#license)
- [LZO](http://www.oberhumer.com/opensource/lzo/):
[GPLv2+](http://www.oberhumer.com/opensource/gpl.html)
- [mGBA](http://mgba.io)
[MPL 2.0](https://github.com/mgba-emu/mgba/blob/master/LICENSE)
- [MiniUPnPc](http://miniupnp.free.fr/):
[3-clause BSD](https://github.com/miniupnp/miniupnp/blob/master/miniupnpc/LICENSE)
- [Microsoft Visual C++ Runtime Library](http://www.microsoft.com/en-us/download/details.aspx?id=40784):
+13
View File
@@ -0,0 +1,13 @@
set(LIBMGBA_ONLY ON)
set(USE_LZMA ON)
add_subdirectory(mgba EXCLUDE_FROM_ALL)
if(NOT MSVC)
target_compile_options(mgba PRIVATE -Wno-unused-parameter -Wno-unused-result -Wno-unused-variable)
endif()
if(ANDROID)
target_compile_definitions(mgba PRIVATE -Dfutimes=futimens)
endif()
add_library(mGBA::mgba ALIAS mgba)
+140
View File
@@ -0,0 +1,140 @@
var wshShell = new ActiveXObject("WScript.Shell")
var oFS = new ActiveXObject("Scripting.FileSystemObject");
wshShell.CurrentDirectory += "\\mgba";
var outfile = "../version.c";
var cmd_commit = " describe --always --abbrev=40 --dirty";
var cmd_commit_short = " describe --always --dirty";
var cmd_branch = " symbolic-ref --short HEAD";
var cmd_rev = " rev-list HEAD --count";
var cmd_tag = " describe --tag --exact-match";
function GetGitExe()
{
try
{
gitexe = wshShell.RegRead("HKCU\\Software\\GitExtensions\\gitcommand");
wshShell.Exec(gitexe);
return gitexe;
}
catch (e)
{}
for (var gitexe in {"git.cmd":1, "git":1, "git.bat":1})
{
try
{
wshShell.Exec(gitexe);
return gitexe;
}
catch (e)
{}
}
// last try - msysgit not in path (vs2015 default)
msyspath = "\\Git\\cmd\\git.exe";
gitexe = wshShell.ExpandEnvironmentStrings("%PROGRAMFILES(x86)%") + msyspath;
if (oFS.FileExists(gitexe)) {
return gitexe;
}
gitexe = wshShell.ExpandEnvironmentStrings("%PROGRAMFILES%") + msyspath;
if (oFS.FileExists(gitexe)) {
return gitexe;
}
WScript.Echo("Cannot find git or git.cmd, check your PATH:\n" +
wshShell.ExpandEnvironmentStrings("%PATH%"));
WScript.Quit(1);
}
function GetFirstStdOutLine(cmd)
{
try
{
return wshShell.Exec(cmd).StdOut.ReadLine();
}
catch (e)
{
// catch "the system cannot find the file specified" error
WScript.Echo("Failed to exec " + cmd + " this should never happen");
WScript.Quit(1);
}
}
function GetFileContents(f)
{
try
{
return oFS.OpenTextFile(f).ReadAll();
}
catch (e)
{
// file doesn't exist
return "";
}
}
// get version from version.cmake
var version_cmake = GetFileContents("version.cmake");
var version_major = version_cmake.match(/set\(LIB_VERSION_MAJOR (.*)\)/)[1];
var version_minor = version_cmake.match(/set\(LIB_VERSION_MINOR (.*)\)/)[1];
var version_patch = version_cmake.match(/set\(LIB_VERSION_PATCH (.*)\)/)[1];
var version_abi = version_cmake.match(/set\(LIB_VERSION_ABI (.*)\)/)[1];
var version_string = version_major + "." + version_minor + "." + version_patch;
// get info from git
var gitexe = GetGitExe();
var commit = GetFirstStdOutLine(gitexe + cmd_commit);
var commit_short = GetFirstStdOutLine(gitexe + cmd_commit_short);
var branch = GetFirstStdOutLine(gitexe + cmd_branch);
var rev = GetFirstStdOutLine(gitexe + cmd_rev);
var tag = GetFirstStdOutLine(gitexe + cmd_tag);
var binary_name = "mgba";
var project_name = "mGBA";
if (!rev)
rev = -1;
if (tag)
{
version_string = tag;
}
else if (branch)
{
if (branch == "master")
version_string = rev + "-" + commit_short;
else
version_string = branch + "-" + rev + "-" + commit_short;
if (branch != version_abi)
version_string = version_abi + "-" + version_string;
}
if (!commit)
commit = "(unknown)";
if (!commit_short)
commit_short = "(unknown)";
if (!branch)
branch = "(unknown)";
var out_contents =
"#include <mgba/core/version.h>\n" +
"MGBA_EXPORT const char* const gitCommit = \"" + commit + "\";\n" +
"MGBA_EXPORT const char* const gitCommitShort = \"" + commit_short + "\";\n" +
"MGBA_EXPORT const char* const gitBranch = \"" + branch + "\";\n" +
"MGBA_EXPORT const int gitRevision = " + rev + ";\n" +
"MGBA_EXPORT const char* const binaryName = \"" + binary_name + "\";\n" +
"MGBA_EXPORT const char* const projectName = \"" + project_name + "\";\n" +
"MGBA_EXPORT const char* const projectVersion = \"" + version_string + "\";\n";
// check if file needs updating
if (out_contents == GetFileContents(outfile))
{
WScript.Echo(project_name + ": " + outfile + " current at " + version_string);
}
else
{
// needs updating - writeout current info
oFS.CreateTextFile(outfile, true).Write(out_contents);
WScript.Echo(project_name + ": " + outfile + " updated to " + version_string);
}
Vendored Submodule
+1
Submodule Externals/mGBA/mgba added at 9cccc5197e
+241
View File
@@ -0,0 +1,241 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\Source\VSProps\Base.Macros.props" />
<Import Project="$(VSPropsDir)Base.Targets.props" />
<PropertyGroup Label="Globals">
<ProjectGuid>{864C4C8E-296D-3DBC-AD83-F1D5CB6E8EC6}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VSPropsDir)Configuration.StaticLibrary.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VSPropsDir)Base.props" />
<Import Project="$(VSPropsDir)ClDisableAllWarnings.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>mgba\include;mgba\src;mgba\src\third-party\lzma;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>BUILD_STATIC;M_CORE_GB;M_CORE_GBA;USE_LZMA;_7ZIP_PPMD_SUPPPORT;HAVE_STRDUP;HAVE_SETLOCALE;HAVE_CHMOD;HAVE_UMASK;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<PreBuildEvent>
<Command>"$(CScript)" /nologo /E:JScript "make_version.c.js"</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="mgba\src\core\bitmap-cache.c" />
<ClCompile Include="mgba\src\core\cache-set.c">
<ObjectFileName>$(IntDir)/src/core/cache-set.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\core\cheats.c">
<ObjectFileName>$(IntDir)/src/core/cheats.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\core\config.c" />
<ClCompile Include="mgba\src\core\core.c">
<ObjectFileName>$(IntDir)/src/core/core.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\core\directories.c" />
<ClCompile Include="mgba\src\core\input.c">
<ObjectFileName>$(IntDir)/src/core/input.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\core\interface.c" />
<ClCompile Include="mgba\src\core\library.c" />
<ClCompile Include="mgba\src\core\lockstep.c">
<ObjectFileName>$(IntDir)/src/core/lockstep.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\core\log.c" />
<ClCompile Include="mgba\src\core\map-cache.c" />
<ClCompile Include="mgba\src\core\mem-search.c" />
<ClCompile Include="mgba\src\core\rewind.c" />
<ClCompile Include="mgba\src\core\scripting.c" />
<ClCompile Include="mgba\src\core\serialize.c">
<ObjectFileName>$(IntDir)/src/core/serialize.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\core\sync.c" />
<ClCompile Include="mgba\src\core\thread.c" />
<ClCompile Include="mgba\src\core\tile-cache.c" />
<ClCompile Include="mgba\src\core\timing.c" />
<ClCompile Include="mgba\src\sm83\decoder.c">
<ObjectFileName>$(IntDir)/src/sm83/decoder.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\sm83\isa-sm83.c" />
<ClCompile Include="mgba\src\sm83\sm83.c" />
<ClCompile Include="mgba\src\gb\audio.c">
<ObjectFileName>$(IntDir)/src/gb/audio.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\gb\cheats.c">
<ObjectFileName>$(IntDir)/src/gb/cheats.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\gb\core.c">
<ObjectFileName>$(IntDir)/src/gb/core.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\gb\gb.c" />
<ClCompile Include="mgba\src\gb\input.c">
<ObjectFileName>$(IntDir)/src/gb/input.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\gb\io.c">
<ObjectFileName>$(IntDir)/src/gb/io.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\gb\mbc.c" />
<ClCompile Include="mgba\src\gb\memory.c">
<ObjectFileName>$(IntDir)/src/gb/memory.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\gb\overrides.c">
<ObjectFileName>$(IntDir)/src/gb/overrides.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\gb\serialize.c">
<ObjectFileName>$(IntDir)/src/gb/serialize.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\gb\renderers\cache-set.c">
<ObjectFileName>$(IntDir)/src/gb/renderers/cache-set.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\gb\renderers\software.c" />
<ClCompile Include="mgba\src\gb\sio.c">
<ObjectFileName>$(IntDir)/src/gb/sio.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\gb\timer.c">
<ObjectFileName>$(IntDir)/src/gb/timer.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\gb\video.c">
<ObjectFileName>$(IntDir)/src/gb/video.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\arm\arm.c" />
<ClCompile Include="mgba\src\arm\decoder-arm.c" />
<ClCompile Include="mgba\src\arm\decoder.c">
<ObjectFileName>$(IntDir)/src/arm/decoder.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\arm\decoder-thumb.c" />
<ClCompile Include="mgba\src\arm\isa-arm.c" />
<ClCompile Include="mgba\src\arm\isa-thumb.c" />
<ClCompile Include="mgba\src\gba\audio.c">
<ObjectFileName>$(IntDir)/src/gba/audio.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\gba\bios.c" />
<ClCompile Include="mgba\src\gba\cart\ereader.c" />
<ClCompile Include="mgba\src\gba\cart\gpio.c" />
<ClCompile Include="mgba\src\gba\cart\matrix.c" />
<ClCompile Include="mgba\src\gba\cart\vfame.c" />
<ClCompile Include="mgba\src\gba\cheats.c">
<ObjectFileName>$(IntDir)/src/gba/cheats.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\gba\cheats\codebreaker.c" />
<ClCompile Include="mgba\src\gba\cheats\gameshark.c" />
<ClCompile Include="mgba\src\gba\cheats\parv3.c" />
<ClCompile Include="mgba\src\gba\core.c">
<ObjectFileName>$(IntDir)/src/gba/core.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\gba\dma.c" />
<ClCompile Include="mgba\src\gba\gba.c" />
<ClCompile Include="mgba\src\gba\hle-bios.c" />
<ClCompile Include="mgba\src\gba\input.c">
<ObjectFileName>$(IntDir)/src/gba/input.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\gba\io.c">
<ObjectFileName>$(IntDir)/src/gba/io.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\gba\memory.c">
<ObjectFileName>$(IntDir)/src/gba/memory.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\gba\overrides.c">
<ObjectFileName>$(IntDir)/src/gba/overrides.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\gba\renderers\cache-set.c">
<ObjectFileName>$(IntDir)/src/gba/renderers/cache-set.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\gba\renderers\common.c" />
<ClCompile Include="mgba\src\gba\renderers\gl.c" />
<ClCompile Include="mgba\src\gba\renderers\software-bg.c" />
<ClCompile Include="mgba\src\gba\renderers\software-mode0.c" />
<ClCompile Include="mgba\src\gba\renderers\software-obj.c" />
<ClCompile Include="mgba\src\gba\renderers\video-software.c" />
<ClCompile Include="mgba\src\gba\savedata.c" />
<ClCompile Include="mgba\src\gba\serialize.c">
<ObjectFileName>$(IntDir)/src/gba/serialize.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\gba\sharkport.c" />
<ClCompile Include="mgba\src\gba\sio.c">
<ObjectFileName>$(IntDir)/src/gba/sio.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\gba\sio\gbp.c" />
<ClCompile Include="mgba\src\gba\sio\joybus.c" />
<ClCompile Include="mgba\src\gba\timer.c">
<ObjectFileName>$(IntDir)/src/gba/timer.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\gba\video.c">
<ObjectFileName>$(IntDir)/src/gba/video.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\util\circle-buffer.c" />
<ClCompile Include="mgba\src\util\configuration.c" />
<ClCompile Include="mgba\src\util\convolve.c" />
<ClCompile Include="mgba\src\util\crc32.c" />
<ClCompile Include="mgba\src\util\elf-read.c" />
<ClCompile Include="mgba\src\util\export.c" />
<ClCompile Include="mgba\src\util\formatting.c" />
<ClCompile Include="mgba\src\util\gbk-table.c" />
<ClCompile Include="mgba\src\util\hash.c" />
<ClCompile Include="mgba\src\util\patch.c" />
<ClCompile Include="mgba\src\util\patch-fast.c" />
<ClCompile Include="mgba\src\util\patch-ips.c" />
<ClCompile Include="mgba\src\util\patch-ups.c" />
<ClCompile Include="mgba\src\util\png-io.c" />
<ClCompile Include="mgba\src\util\ring-fifo.c" />
<ClCompile Include="mgba\src\util\string.c" />
<ClCompile Include="mgba\src\util\table.c" />
<ClCompile Include="mgba\src\util\text-codec.c" />
<ClCompile Include="mgba\src\util\vfs.c" />
<ClCompile Include="version.c" />
<ClCompile Include="mgba\src\util\vfs\vfs-mem.c" />
<ClCompile Include="mgba\src\util\vfs\vfs-fifo.c" />
<ClCompile Include="mgba\src\util\vfs\vfs-fd.c" />
<ClCompile Include="mgba\src\platform\windows\vfs-w32.c" />
<ClCompile Include="mgba\src\platform\windows\memory.c">
<ObjectFileName>$(IntDir)/src/platform/windows/memory.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\third-party\inih\ini.c" />
<ClCompile Include="mgba\src\third-party\blip_buf\blip_buf.c" />
<ClCompile Include="mgba\src\util\vfs\vfs-lzma.c" />
<ClCompile Include="mgba\src\third-party\lzma\7zAlloc.c" />
<ClCompile Include="mgba\src\third-party\lzma\7zArcIn.c" />
<ClCompile Include="mgba\src\third-party\lzma\7zBuf.c" />
<ClCompile Include="mgba\src\third-party\lzma\7zBuf2.c" />
<ClCompile Include="mgba\src\third-party\lzma\7zCrc.c" />
<ClCompile Include="mgba\src\third-party\lzma\7zCrcOpt.c" />
<ClCompile Include="mgba\src\third-party\lzma\7zDec.c" />
<ClCompile Include="mgba\src\third-party\lzma\CpuArch.c" />
<ClCompile Include="mgba\src\third-party\lzma\Delta.c" />
<ClCompile Include="mgba\src\third-party\lzma\LzmaDec.c" />
<ClCompile Include="mgba\src\third-party\lzma\Lzma2Dec.c" />
<ClCompile Include="mgba\src\third-party\lzma\Bra.c" />
<ClCompile Include="mgba\src\third-party\lzma\Bra86.c" />
<ClCompile Include="mgba\src\third-party\lzma\BraIA64.c" />
<ClCompile Include="mgba\src\third-party\lzma\Bcj2.c" />
<ClCompile Include="mgba\src\third-party\lzma\Ppmd7.c" />
<ClCompile Include="mgba\src\third-party\lzma\Ppmd7Dec.c" />
<ClCompile Include="mgba\src\third-party\lzma\7zFile.c" />
<ClCompile Include="mgba\src\third-party\lzma\7zStream.c" />
<ClCompile Include="mgba\src\gba\sio\dolphin.c" />
<ClCompile Include="mgba\src\gba\sio\lockstep.c">
<ObjectFileName>$(IntDir)/src/gba/sio/lockstep.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\gb\sio\lockstep.c">
<ObjectFileName>$(IntDir)/src/gb/sio/lockstep.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\gb\sio\printer.c" />
<ClCompile Include="mgba\src\gba\extra\audio-mixer.c" />
<ClCompile Include="mgba\src\gba\extra\battlechip.c" />
<ClCompile Include="mgba\src\gba\extra\proxy.c">
<ObjectFileName>$(IntDir)/src/gba/extra/proxy.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\gb\extra\proxy.c">
<ObjectFileName>$(IntDir)/src/gb/extra/proxy.c.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="mgba\src\feature\commandline.c" />
<ClCompile Include="mgba\src\feature\thread-proxy.c" />
<ClCompile Include="mgba\src\feature\video-logger.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
+427
View File
@@ -0,0 +1,427 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="mgba\src\core\bitmap-cache.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\core\cache-set.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\core\cheats.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\core\config.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\core\core.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\core\directories.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\core\input.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\core\interface.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\core\library.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\core\lockstep.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\core\log.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\core\map-cache.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\core\mem-search.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\core\rewind.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\core\scripting.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\core\serialize.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\core\sync.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\core\thread.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\core\tile-cache.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\core\timing.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\sm83\decoder.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\sm83\isa-sm83.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\sm83\sm83.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gb\audio.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gb\cheats.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gb\core.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gb\gb.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gb\input.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gb\io.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gb\mbc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gb\memory.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gb\overrides.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gb\serialize.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gb\renderers\cache-set.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gb\renderers\software.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gb\sio.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gb\timer.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gb\video.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\arm\arm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\arm\decoder-arm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\arm\decoder.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\arm\decoder-thumb.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\arm\isa-arm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\arm\isa-thumb.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\audio.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\bios.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\cart\ereader.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\cart\gpio.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\cart\matrix.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\cart\vfame.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\cheats.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\cheats\codebreaker.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\cheats\gameshark.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\cheats\parv3.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\core.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\dma.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\gba.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\hle-bios.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\input.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\io.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\memory.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\overrides.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\renderers\cache-set.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\renderers\common.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\renderers\gl.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\renderers\software-bg.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\renderers\software-mode0.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\renderers\software-obj.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\renderers\video-software.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\savedata.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\serialize.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\sharkport.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\sio.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\sio\gbp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\sio\joybus.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\timer.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\video.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\util\circle-buffer.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\util\configuration.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\util\convolve.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\util\crc32.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\util\elf-read.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\util\export.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\util\formatting.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\util\gbk-table.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\util\hash.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\util\patch.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\util\patch-fast.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\util\patch-ips.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\util\patch-ups.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\util\png-io.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\util\ring-fifo.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\util\string.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\util\table.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\util\text-codec.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\util\vfs.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="version.c">
<Filter>Generated sources</Filter>
</ClCompile>
<ClCompile Include="mgba\src\util\vfs\vfs-mem.c">
<Filter>Virtual files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\util\vfs\vfs-fifo.c">
<Filter>Virtual files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\util\vfs\vfs-fd.c">
<Filter>Virtual files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\platform\windows\vfs-w32.c">
<Filter>Virtual files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\platform\windows\memory.c">
<Filter>Windows-specific code</Filter>
</ClCompile>
<ClCompile Include="mgba\src\third-party\inih\ini.c">
<Filter>Third-party code</Filter>
</ClCompile>
<ClCompile Include="mgba\src\third-party\blip_buf\blip_buf.c">
<Filter>Third-party code</Filter>
</ClCompile>
<ClCompile Include="mgba\src\util\vfs\vfs-lzma.c">
<Filter>Virtual files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\third-party\lzma\7zAlloc.c">
<Filter>Virtual files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\third-party\lzma\7zArcIn.c">
<Filter>Virtual files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\third-party\lzma\7zBuf.c">
<Filter>Virtual files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\third-party\lzma\7zBuf2.c">
<Filter>Virtual files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\third-party\lzma\7zCrc.c">
<Filter>Virtual files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\third-party\lzma\7zCrcOpt.c">
<Filter>Virtual files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\third-party\lzma\7zDec.c">
<Filter>Virtual files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\third-party\lzma\CpuArch.c">
<Filter>Virtual files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\third-party\lzma\Delta.c">
<Filter>Virtual files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\third-party\lzma\LzmaDec.c">
<Filter>Virtual files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\third-party\lzma\Lzma2Dec.c">
<Filter>Virtual files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\third-party\lzma\Bra.c">
<Filter>Virtual files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\third-party\lzma\Bra86.c">
<Filter>Virtual files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\third-party\lzma\BraIA64.c">
<Filter>Virtual files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\third-party\lzma\Bcj2.c">
<Filter>Virtual files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\third-party\lzma\Ppmd7.c">
<Filter>Virtual files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\third-party\lzma\Ppmd7Dec.c">
<Filter>Virtual files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\third-party\lzma\7zFile.c">
<Filter>Virtual files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\third-party\lzma\7zStream.c">
<Filter>Virtual files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\sio\dolphin.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\sio\lockstep.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gb\sio\lockstep.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gb\sio\printer.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\extra\audio-mixer.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\extra\battlechip.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gba\extra\proxy.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\gb\extra\proxy.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\feature\commandline.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\feature\thread-proxy.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgba\src\feature\video-logger.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Filter Include="Generated sources">
<UniqueIdentifier>{57438DCC-46E8-3FBA-90F2-185F80CEBE2C}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files">
<UniqueIdentifier>{C0CFD641-7357-3B1D-B2A3-B2477AEF3147}</UniqueIdentifier>
</Filter>
<Filter Include="Third-party code">
<UniqueIdentifier>{6C07F537-79D5-3651-A634-9E523B9936B2}</UniqueIdentifier>
</Filter>
<Filter Include="Virtual files">
<UniqueIdentifier>{AFF59D0C-C624-393F-8703-2FB3784928C8}</UniqueIdentifier>
</Filter>
<Filter Include="Windows-specific code">
<UniqueIdentifier>{37E5D4D5-B263-3B94-8968-21228F26DF67}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>
+5
View File
@@ -173,6 +173,11 @@ void Host_TitleChanged()
env->CallStaticVoidMethod(IDCache::GetNativeLibraryClass(), IDCache::GetOnTitleChanged());
}
std::unique_ptr<GBAHostInterface> Host_CreateGBAHost(std::weak_ptr<HW::GBA::Core> core)
{
return nullptr;
}
static bool MsgAlert(const char* caption, const char* text, bool yes_no, Common::MsgType style)
{
// If a panic alert happens very early in the execution of a game, we can crash here with
+2 -1
View File
@@ -68,7 +68,8 @@ void InitSoundStream()
void PostInitSoundStream()
{
// This needs to be called after AudioInterface::Init where input sample rates are set
// This needs to be called after AudioInterface::Init and SerialInterface::Init (for GBA devices)
// where input sample rates are set
UpdateSoundStream();
SetSoundStreamRunning(true);
+33 -8
View File
@@ -47,6 +47,8 @@ void Mixer::DoState(PointerWrap& p)
m_dma_mixer.DoState(p);
m_streaming_mixer.DoState(p);
m_wiimote_speaker_mixer.DoState(p);
for (auto& mixer : m_gba_mixers)
mixer.DoState(p);
}
// Executed from sound stream thread
@@ -93,20 +95,24 @@ unsigned int Mixer::MixerFifo::Mix(short* samples, unsigned int numSamples,
s32 lvolume = m_LVolume.load();
s32 rvolume = m_RVolume.load();
const auto read_buffer = [this](auto index) {
return m_little_endian ? m_buffer[index] : Common::swap16(m_buffer[index]);
};
// TODO: consider a higher-quality resampling algorithm.
for (; currentSample < numSamples * 2 && ((indexW - indexR) & INDEX_MASK) > 2; currentSample += 2)
{
u32 indexR2 = indexR + 2; // next sample
s16 l1 = Common::swap16(m_buffer[indexR & INDEX_MASK]); // current
s16 l2 = Common::swap16(m_buffer[indexR2 & INDEX_MASK]); // next
s16 l1 = read_buffer(indexR & INDEX_MASK); // current
s16 l2 = read_buffer(indexR2 & INDEX_MASK); // next
int sampleL = ((l1 << 16) + (l2 - l1) * (u16)m_frac) >> 16;
sampleL = (sampleL * lvolume) >> 8;
sampleL += samples[currentSample + 1];
samples[currentSample + 1] = std::clamp(sampleL, -32767, 32767);
s16 r1 = Common::swap16(m_buffer[(indexR + 1) & INDEX_MASK]); // current
s16 r2 = Common::swap16(m_buffer[(indexR2 + 1) & INDEX_MASK]); // next
s16 r1 = read_buffer((indexR + 1) & INDEX_MASK); // current
s16 r2 = read_buffer((indexR2 + 1) & INDEX_MASK); // next
int sampleR = ((r1 << 16) + (r2 - r1) * (u16)m_frac) >> 16;
sampleR = (sampleR * rvolume) >> 8;
sampleR += samples[currentSample];
@@ -122,8 +128,8 @@ unsigned int Mixer::MixerFifo::Mix(short* samples, unsigned int numSamples,
// Padding
short s[2];
s[0] = Common::swap16(m_buffer[(indexR - 1) & INDEX_MASK]);
s[1] = Common::swap16(m_buffer[(indexR - 2) & INDEX_MASK]);
s[0] = read_buffer((indexR - 1) & INDEX_MASK);
s[1] = read_buffer((indexR - 2) & INDEX_MASK);
s[0] = (s[0] * rvolume) >> 8;
s[1] = (s[1] * lvolume) >> 8;
for (; currentSample < numSamples * 2; currentSample += 2)
@@ -158,6 +164,8 @@ unsigned int Mixer::Mix(short* samples, unsigned int num_samples)
m_dma_mixer.Mix(m_scratch_buffer.data(), available_samples, false);
m_streaming_mixer.Mix(m_scratch_buffer.data(), available_samples, false);
m_wiimote_speaker_mixer.Mix(m_scratch_buffer.data(), available_samples, false);
for (auto& mixer : m_gba_mixers)
mixer.Mix(m_scratch_buffer.data(), available_samples, false);
if (!m_is_stretching)
{
@@ -172,6 +180,8 @@ unsigned int Mixer::Mix(short* samples, unsigned int num_samples)
m_dma_mixer.Mix(samples, num_samples, true);
m_streaming_mixer.Mix(samples, num_samples, true);
m_wiimote_speaker_mixer.Mix(samples, num_samples, true);
for (auto& mixer : m_gba_mixers)
mixer.Mix(samples, num_samples, true);
m_is_stretching = false;
}
@@ -258,14 +268,19 @@ void Mixer::PushWiimoteSpeakerSamples(const short* samples, unsigned int num_sam
for (unsigned int i = 0; i < num_samples; ++i)
{
samples_stereo[i * 2] = Common::swap16(samples[i]);
samples_stereo[i * 2 + 1] = Common::swap16(samples[i]);
samples_stereo[i * 2] = samples[i];
samples_stereo[i * 2 + 1] = samples[i];
}
m_wiimote_speaker_mixer.PushSamples(samples_stereo, num_samples);
}
}
void Mixer::PushGBASamples(int device_number, const short* samples, unsigned int num_samples)
{
m_gba_mixers[device_number].PushSamples(samples, num_samples);
}
void Mixer::SetDMAInputSampleRate(unsigned int rate)
{
m_dma_mixer.SetInputSampleRate(rate);
@@ -276,6 +291,11 @@ void Mixer::SetStreamInputSampleRate(unsigned int rate)
m_streaming_mixer.SetInputSampleRate(rate);
}
void Mixer::SetGBAInputSampleRates(int device_number, unsigned int rate)
{
m_gba_mixers[device_number].SetInputSampleRate(rate);
}
void Mixer::SetStreamingVolume(unsigned int lvolume, unsigned int rvolume)
{
m_streaming_mixer.SetVolume(lvolume, rvolume);
@@ -286,6 +306,11 @@ void Mixer::SetWiimoteSpeakerVolume(unsigned int lvolume, unsigned int rvolume)
m_wiimote_speaker_mixer.SetVolume(lvolume, rvolume);
}
void Mixer::SetGBAVolume(int device_number, unsigned int lvolume, unsigned int rvolume)
{
m_gba_mixers[device_number].SetVolume(lvolume, rvolume);
}
void Mixer::StartLogDTKAudio(const std::string& filename)
{
if (!m_log_dtk_audio)
+14 -4
View File
@@ -30,11 +30,17 @@ public:
void PushStreamingSamples(const short* samples, unsigned int num_samples);
void PushWiimoteSpeakerSamples(const short* samples, unsigned int num_samples,
unsigned int sample_rate);
void PushGBASamples(int device_number, const short* samples, unsigned int num_samples);
unsigned int GetSampleRate() const { return m_sampleRate; }
void SetDMAInputSampleRate(unsigned int rate);
void SetStreamInputSampleRate(unsigned int rate);
void SetGBAInputSampleRates(int device_number, unsigned int rate);
void SetStreamingVolume(unsigned int lvolume, unsigned int rvolume);
void SetWiimoteSpeakerVolume(unsigned int lvolume, unsigned int rvolume);
void SetGBAVolume(int device_number, unsigned int lvolume, unsigned int rvolume);
void StartLogDTKAudio(const std::string& filename);
void StopLogDTKAudio();
@@ -57,7 +63,8 @@ private:
class MixerFifo final
{
public:
MixerFifo(Mixer* mixer, unsigned sample_rate) : m_mixer(mixer), m_input_sample_rate(sample_rate)
MixerFifo(Mixer* mixer, unsigned sample_rate, bool little_endian)
: m_mixer(mixer), m_input_sample_rate(sample_rate), m_little_endian(little_endian)
{
}
void DoState(PointerWrap& p);
@@ -71,6 +78,7 @@ private:
private:
Mixer* m_mixer;
unsigned m_input_sample_rate;
bool m_little_endian;
std::array<short, MAX_SAMPLES * 2> m_buffer{};
std::atomic<u32> m_indexW{0};
std::atomic<u32> m_indexR{0};
@@ -81,9 +89,11 @@ private:
u32 m_frac = 0;
};
MixerFifo m_dma_mixer{this, 32000};
MixerFifo m_streaming_mixer{this, 48000};
MixerFifo m_wiimote_speaker_mixer{this, 3000};
MixerFifo m_dma_mixer{this, 32000, false};
MixerFifo m_streaming_mixer{this, 48000, false};
MixerFifo m_wiimote_speaker_mixer{this, 3000, true};
std::array<MixerFifo, 4> m_gba_mixers{MixerFifo{this, 48000, true}, MixerFifo{this, 48000, true},
MixerFifo{this, 48000, true}, MixerFifo{this, 48000, true}};
unsigned int m_sampleRate;
bool m_is_stretching = false;
+5
View File
@@ -34,6 +34,7 @@
// Subdirs in the User dir returned by GetUserPath(D_USER_IDX)
#define GC_USER_DIR "GC"
#define GBA_USER_DIR "GBA"
#define WII_USER_DIR "Wii"
#define CONFIG_DIR "Config"
#define GAMESETTINGS_DIR "GameSettings"
@@ -61,6 +62,7 @@
#define RESOURCES_DIR "Resources"
#define THEMES_DIR "Themes"
#define STYLES_DIR "Styles"
#define GBASAVES_DIR "Saves"
#define ANAGLYPH_DIR "Anaglyph"
#define PASSIVE_DIR "Passive"
#define PIPES_DIR "Pipes"
@@ -119,6 +121,9 @@
#define GC_MEMCARDB "MemoryCardB"
#define GC_MEMCARD_NETPLAY "NetPlayTemp"
#define GBA_BIOS "gba_bios.bin"
#define GBA_SAVE_NETPLAY "NetPlayTemp"
#define WII_STATE "state.dat"
#define WII_SDCARD "sd.raw"
+4
View File
@@ -977,6 +977,10 @@ static void RebuildUserDirectories(unsigned int dir_index)
s_user_paths[F_MEMORYWATCHERSOCKET_IDX] =
s_user_paths[D_MEMORYWATCHER_IDX] + MEMORYWATCHER_SOCKET;
s_user_paths[D_GBAUSER_IDX] = s_user_paths[D_USER_IDX] + GBA_USER_DIR DIR_SEP;
s_user_paths[D_GBASAVES_IDX] = s_user_paths[D_GBAUSER_IDX] + GBASAVES_DIR DIR_SEP;
s_user_paths[F_GBABIOS_IDX] = s_user_paths[D_GBAUSER_IDX] + GBA_BIOS;
// The shader cache has moved to the cache directory, so remove the old one.
// TODO: remove that someday.
File::DeleteDirRecursively(s_user_paths[D_USER_IDX] + SHADERCACHE_LEGACY_DIR DIR_SEP);
+3
View File
@@ -59,6 +59,8 @@ enum
D_BACKUP_IDX,
D_RESOURCEPACK_IDX,
D_DYNAMICINPUT_IDX,
D_GBAUSER_IDX,
D_GBASAVES_IDX,
F_DOLPHINCONFIG_IDX,
F_GCPADCONFIG_IDX,
F_WIIPADCONFIG_IDX,
@@ -77,6 +79,7 @@ enum
F_WIISDCARD_IDX,
F_DUALSHOCKUDPCLIENTCONFIG_IDX,
F_FREELOOKCONFIG_IDX,
F_GBABIOS_IDX,
NUM_PATH_INDICES
};
-4
View File
@@ -35,10 +35,6 @@
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\VSProps\Base.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros">
<CScript Condition="'$(ProgramFiles(x86))' != ''">%windir%\System32\cscript</CScript>
<CScript Condition="'$(ProgramFiles(x86))' == ''">%windir%\Sysnative\cscript</CScript>
</PropertyGroup>
<!--
OutDir is always created, which is annoying for SCMRevGen as it doesn't really have an outdir.
Here it's redirected to some other place to hide the annoyance.
+17 -2
View File
@@ -195,6 +195,10 @@ add_library(core
HW/EXI/EXI_DeviceMic.h
HW/EXI/EXI.cpp
HW/EXI/EXI.h
HW/GBAPad.cpp
HW/GBAPad.h
HW/GBAPadEmu.cpp
HW/GBAPadEmu.h
HW/GCKeyboard.cpp
HW/GCKeyboard.h
HW/GCKeyboardEmu.cpp
@@ -434,8 +438,8 @@ add_library(core
PowerPC/Interpreter/Interpreter_Tables.cpp
PowerPC/Interpreter/Interpreter.cpp
PowerPC/Interpreter/Interpreter.h
PowerPC/JitCommon/DivUtils.cpp
PowerPC/JitCommon/DivUtils.h
PowerPC/JitCommon/DivUtils.cpp
PowerPC/JitCommon/DivUtils.h
PowerPC/JitCommon/JitAsmCommon.cpp
PowerPC/JitCommon/JitAsmCommon.h
PowerPC/JitCommon/JitBase.cpp
@@ -614,6 +618,17 @@ if(ENABLE_VULKAN)
target_link_libraries(core PUBLIC videovulkan)
endif()
if(USE_MGBA)
target_sources(core PRIVATE
HW/GBACore.cpp
HW/GBACore.h
HW/SI/SI_DeviceGBAEmu.cpp
HW/SI/SI_DeviceGBAEmu.h
)
target_link_libraries(core PUBLIC mGBA::mgba)
target_compile_definitions(core PUBLIC -DHAS_LIBMGBA)
endif()
if(WIN32)
target_sources(core PRIVATE
HW/EXI/BBA/TAP_Win32.cpp
+12
View File
@@ -145,6 +145,18 @@ const Info<std::string> MAIN_RESOURCEPACK_PATH{{System::Main, "General", "Resour
const Info<std::string> MAIN_FS_PATH{{System::Main, "General", "NANDRootPath"}, ""};
const Info<std::string> MAIN_SD_PATH{{System::Main, "General", "WiiSDCardPath"}, ""};
// Main.GBA
const Info<std::string> MAIN_GBA_BIOS_PATH{{System::Main, "GBA", "BIOS"}, ""};
const std::array<Info<std::string>, 4> MAIN_GBA_ROM_PATHS{
Info<std::string>{{System::Main, "GBA", "Rom1"}, ""},
Info<std::string>{{System::Main, "GBA", "Rom2"}, ""},
Info<std::string>{{System::Main, "GBA", "Rom3"}, ""},
Info<std::string>{{System::Main, "GBA", "Rom4"}, ""}};
const Info<std::string> MAIN_GBA_SAVES_PATH{{System::Main, "GBA", "SavesPath"}, ""};
const Info<bool> MAIN_GBA_SAVES_IN_ROM_PATH{{System::Main, "GBA", "SavesInRomPath"}, false};
const Info<bool> MAIN_GBA_THREADS{{System::Main, "GBA", "Threads"}, true};
// Main.Network
const Info<bool> MAIN_NETWORK_SSL_DUMP_READ{{System::Main, "Network", "SSLDumpRead"}, false};

Some files were not shown because too many files have changed in this diff Show More