Skip to content

Commit

Permalink
Merge branch 'update-fork'
Browse files Browse the repository at this point in the history
  • Loading branch information
Felk committed Sep 5, 2023
2 parents f38b160 + dc9c5ed commit e65599d
Show file tree
Hide file tree
Showing 1,522 changed files with 162,102 additions and 166,117 deletions.
27 changes: 27 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,33 @@
url = https://github.com/libusb/libusb.git
branch = master
shallow = true
[submodule "Externals/spirv_cross/SPIRV-Cross"]
path = Externals/spirv_cross/SPIRV-Cross
url = https://github.com/KhronosGroup/SPIRV-Cross.git
branch = master
shallow = true
[submodule "SDL"]
path = Externals/SDL/SDL
url = https://github.com/libsdl-org/SDL.git
branch = main
shallow = true
[submodule "Externals/zlib-ng/zlib-ng"]
path = Externals/zlib-ng/zlib-ng
url = https://github.com/zlib-ng/zlib-ng.git
shallow = true
[submodule "Externals/libspng/libspng"]
path = Externals/libspng/libspng
url = https://github.com/randy408/libspng.git
branch = v0.7.2
shallow = true
[submodule "Externals/VulkanMemoryAllocator"]
path = Externals/VulkanMemoryAllocator
url = https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
[submodule "Externals/cubeb/cubeb"]
path = Externals/cubeb/cubeb
url = https://github.com/mozilla/cubeb.git
branch = master
shallow = true
[submodule "Externals/python"]
path = Externals/python
url = https://github.com/Felk/ext-python.git
Expand Down
2 changes: 1 addition & 1 deletion AndroidSetup.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Double clicking any of these tasks will execute it, and also add it to a short l

Clicking the green triangle next to this list will execute the currently selected task.

For command-line users, any task may be executed with `Source/Android/gradlew <task-name>`.
For command-line users, any task may be executed with `cd Source/Android` followed by `gradlew <task-name>`. In particular, `gradlew assemble` builds debug and release versions of the application (which are placed in `Source/Android/app/build/outputs/apk`).

## Getting Dependencies

Expand Down
25 changes: 24 additions & 1 deletion BuildMacOSUniversalBinary.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@

"run_unit_tests": False,

# Whether we should make a build for Steam.
"steam": False,

# Whether our autoupdate functionality is enabled or not.
"autoupdate": True
}

# Architectures to build for. This is explicity left out of the command line
Expand Down Expand Up @@ -119,6 +124,18 @@ def parse_args(conf=DEFAULT_CONFIG):
parser.add_argument("--run_unit_tests", action="store_true",
default=conf["run_unit_tests"])

parser.add_argument(
"--steam",
help="Create a build for Steam",
action="store_true",
default=conf["steam"])

parser.add_argument(
"--autoupdate",
help="Enables our autoupdate functionality",
action=argparse.BooleanOptionalAction,
default=conf["autoupdate"])

parser.add_argument(
"--codesign",
help="Code signing identity to use to sign the applications",
Expand Down Expand Up @@ -246,6 +263,8 @@ def recursive_merge_binaries(src0, src1, dst):
relative_path = os.path.relpath(os.path.realpath(newpath1), src1)
os.symlink(relative_path, new_dst_path)

def python_to_cmake_bool(boolean):
return "ON" if boolean else "OFF"

def build(config):
"""
Expand Down Expand Up @@ -292,7 +311,11 @@ def build(config):
+ config["codesign_identity"],
"-DMACOS_CODE_SIGNING_IDENTITY_UPDATER="
+ config["codesign_identity"],
'-DMACOS_CODE_SIGNING="ON"'
'-DMACOS_CODE_SIGNING="ON"',
"-DSTEAM="
+ python_to_cmake_bool(config["steam"]),
"-DENABLE_AUTOUPDATE="
+ python_to_cmake_bool(config["autoupdate"]),
],
env=env, cwd=arch)

Expand Down
4 changes: 4 additions & 0 deletions CMake/FindPowerShell.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
find_program(POWERSHELL_EXE NAMES powershell)

INCLUDE(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PowerShell DEFAULT_MSG POWERSHELL_EXE)
90 changes: 64 additions & 26 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
########################################
# General setup
#
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.13)

cmake_policy(SET CMP0079 NEW) # let target_link_libraries() link to a target defined in a different directory
cmake_policy(SET CMP0080 OLD) # allow using BundleUtilities at configure time

# Weird chicken-and-egg problem: We can't check the compiler before the project() call, but we have to set the policies before it.
# So we do this in two steps: Set the policies if they exist, then error out afterwards if we end up being MSVC and they don't exist.
Expand Down Expand Up @@ -64,6 +67,7 @@ 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)
option(ENABLE_AUTOUPDATE "Enables support for automatic updates" ON)
option(STEAM "Creates a build for Steam" OFF)

# Maintainers: if you consider blanket disabling this for your users, please
# consider the following points:
Expand All @@ -82,8 +86,8 @@ option(OPROFILING "Enable profiling" OFF)
# TODO: Add DSPSpy
option(DSPTOOL "Build dsptool" OFF)

# Enable SDL for default on operating systems that aren't Android, Linux or Windows.
if(NOT ANDROID AND NOT CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT MSVC)
# Enable SDL for default on operating systems that aren't Android or Linux.
if(NOT ANDROID AND NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
option(ENABLE_SDL "Enables SDL as a generic controller backend" ON)
else()
option(ENABLE_SDL "Enables SDL as a generic controller backend" OFF)
Expand All @@ -94,6 +98,7 @@ if(APPLE)
option(SKIP_POSTPROCESS_BUNDLE "Skip postprocessing bundle for redistributability" OFF)
# Enable adhoc code signing by default (otherwise makefile builds on ARM will not work)
option(MACOS_CODE_SIGNING "Enable codesigning" ON)
option(USE_BUNDLED_MOLTENVK "Build MoltenVK from Externals with Dolphin-specific patches" ON)
set(MACOS_CODE_SIGNING_IDENTITY "-" CACHE STRING "The identity used for codesigning.")
set(MACOS_CODE_SIGNING_IDENTITY_UPDATER "-" CACHE STRING "The identity used for codesigning, for the updater.")
endif()
Expand Down Expand Up @@ -420,8 +425,10 @@ if(ENABLE_LTO)
endif()
endif()

if(UNIX AND LINUX_LOCAL_DEV)
add_definitions(-DLINUX_LOCAL_DEV)
if(UNIX)
if(LINUX_LOCAL_DEV OR (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND STEAM))
add_definitions(-DLINUX_LOCAL_DEV)
endif()
endif()

# BSDs put packages in /usr/local instead of /usr, so we need to
Expand All @@ -433,6 +440,12 @@ if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD|NetBSD")
set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};/usr/local")
set(CMAKE_REQUIRED_INCLUDES "/usr/local/include")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/local/lib")

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14.0)
# Workaround: the llvm libc++ and versions of clang eariler than 14 have a bug with consteval
# so we define FMT_CONSTEVAL to blank to just disable consteval in fmt
add_definitions(-DFMT_CONSTEVAL=)
endif()
endif()

# Dolphin requires threads.
Expand Down Expand Up @@ -604,6 +617,35 @@ if(UNIX)
add_definitions(-DUSE_MEMORYWATCHER=1)
endif()

if(ENABLE_SDL)
find_package(SDL2)

if(SDL2_FOUND)
message(STATUS "Using system SDL2")
else()
message(STATUS "Using static SDL2 from Externals")
option(SDL2_DISABLE_SDL2MAIN "" ON)
option(SDL2_DISABLE_INSTALL "" ON)
option(SDL2_DISABLE_UNINSTALL "" ON)
set(SDL_SHARED OFF)
set(SDL_SHARED_ENABLED_BY_DEFAULT OFF)
set(SDL_STATIC ON)
set(SDL_STATIC_ENABLED_BY_DEFAULT ON)
set(SDL_TEST OFF)
set(SDL_TEST_ENABLED_BY_DEFAULT OFF)
set(OPT_DEF_LIBC ON)
add_subdirectory(Externals/SDL/SDL)
if (TARGET SDL2)
dolphin_disable_warnings_msvc(SDL2)
endif()
if (TARGET SDL2-static)
dolphin_disable_warnings_msvc(SDL2-static)
endif()
set(SDL2_FOUND TRUE)
endif()
add_definitions(-DHAVE_SDL2=1)
endif()

if(ENABLE_ANALYTICS)
message(STATUS "Enabling analytics collection (subject to end-user opt-in)")
add_definitions(-DUSE_ANALYTICS=1)
Expand Down Expand Up @@ -652,11 +694,12 @@ else()
endif()
add_subdirectory(Externals/imgui)
add_subdirectory(Externals/glslang)
add_subdirectory(Externals/spirv_cross)

if(ENABLE_VULKAN)
add_definitions(-DHAS_VULKAN)

if(APPLE)
if(APPLE AND USE_BUNDLED_MOLTENVK)
add_subdirectory(Externals/MoltenVK)
endif()
endif()
Expand Down Expand Up @@ -744,16 +787,9 @@ else()
add_subdirectory(Externals/zstd)
endif()

find_package(ZLIB)
if(ZLIB_FOUND)
message(STATUS "Using shared zlib")
else()
check_vendoring_approved(zlib)
message(STATUS "Shared zlib not found, falling back to the static library")
add_subdirectory(Externals/zlib)
endif()
add_subdirectory(Externals/zlib-ng)

pkg_check_modules(MINIZIP minizip>=2.0.0)
pkg_check_modules(MINIZIP minizip-ng>=3.0.0)
if(MINIZIP_FOUND)
message(STATUS "Using shared minizip")
include_directories(${MINIZIP_INCLUDE_DIRS})
Expand All @@ -776,17 +812,7 @@ else()
set(LZO lzo2)
endif()

if(NOT APPLE)
check_lib(PNG libpng png png.h QUIET)
endif()
if (PNG_FOUND)
message(STATUS "Using shared libpng")
else()
check_vendoring_approved(libpng)
message(STATUS "Using static libpng from Externals")
add_subdirectory(Externals/libpng)
set(PNG png)
endif()
add_subdirectory(Externals/libspng)

# Using static FreeSurround from Externals
# There is no system FreeSurround library.
Expand Down Expand Up @@ -930,15 +956,23 @@ else()
message(STATUS "libsystemd not found, disabling traversal server watchdog support")
endif()

if(STEAM)
add_definitions(-DSTEAM)
endif()

if (WIN32)
include_directories(Externals/WIL/include)
include_directories(Externals/OpenAL/include)
endif()

include_directories(Externals/picojson)

add_subdirectory(Externals/expr)

add_subdirectory(Externals/rangeset)

add_subdirectory(Externals/FatFs)

########################################
# Pre-build events: Define configuration variables and write SCM info header
#
Expand All @@ -948,6 +982,10 @@ else()
set(DOLPHIN_WC_IS_STABLE "0")
endif()

# Remove in-tree revision information generated by Visual Studio
# This is because the compiler will check in-tree first and use this, even if it is outdated
file(REMOVE "${PROJECT_SOURCE_DIR}/Source/Core/Common/scmrev.h")

configure_file(
"${PROJECT_SOURCE_DIR}/Source/Core/Common/scmrev.h.in"
"${PROJECT_BINARY_DIR}/Source/Core/Common/scmrev.h"
Expand Down
5 changes: 4 additions & 1 deletion Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ If you make any contributions to Dolphin after December 1st, 2014, you are agree
- [C++ coding style and formatting](#cpp-coding-style-and-formatting)
- [C++ code-specific guidelines](#cpp-code-specific-guidelines)
- [Android and Java](#android-and-java)
- [Help](#help)


# <a name="introduction"></a>Introduction
Expand All @@ -25,7 +26,6 @@ Following this guide and formatting your code as detailed will likely get your p

This project uses clang-format (stable branch) to check for common style issues. In case of conflicts between this guide and clang-format rules, the latter should be followed instead of this guide.


## <a name="intro-formatting-issues"></a>Checking and fixing formatting issues

Windows users need to be careful about line endings. Windows users should configure git to checkout UNIX-style line endings to keep clang-format simple.
Expand Down Expand Up @@ -275,3 +275,6 @@ Summary:
# <a name="android-and-java"></a>Android and Java
The Android project is currently written in Java. If you are using Android Studio to contribute, you can import the project's code style from `code-style-java.jar`, located in `[Dolphin Root]/Source/Android`. Please organize imports before committing.
# <a name="help"></a>Help
If you have any questions about Dolphin's development or would like some help, Dolphin developers use `#dolphin-emu @ irc.libera.chat` to communicate. If you are new to IRC, [Libera.Chat has resources to get started chatting with IRC.](https://libera.chat/)
17 changes: 17 additions & 0 deletions Data/Sys/GameSettings/G6S.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# G6SE7D, G6SP7D - The Legend of Spyro: A New Beginning

[Core]
# Values set here will override the main Dolphin settings.

[OnLoad]
# Add memory patches to be loaded once on boot here.

[OnFrame]
# Add memory patches to be applied every frame here.

[ActionReplay]
# Add action replay cheats here.

[Video_Settings]
SafeTextureCacheColorSamples = 0

5 changes: 5 additions & 0 deletions Data/Sys/GameSettings/GBZ.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# GBZE08, GBZP08, GBZJ08 - Resident Evil 0

[Video_Hacks]
# Fixes purple screens when transitioning between menus.
XFBToTextureEnable = False
11 changes: 11 additions & 0 deletions Data/Sys/GameSettings/GDREAF.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# GDREAF - Dead to Rights

[OnFrame]
# This game follows the anti-pattern of calling memset on a buffer in the midst
# of being DMA copied to ARAM, then calling a DVD read function that effectively
# cancels the memset with dcbi instructions. Dolphin does not emulate dcache for
# performance reasons, so this patch removes the offending memset call.
$Fix audio issues
0x8000AF34:dword:0x60000000
[OnFrame_Enabled]
$Fix audio issues
11 changes: 11 additions & 0 deletions Data/Sys/GameSettings/GDRP69.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# GDRP69 - Dead to Rights

[OnFrame]
# This game follows the anti-pattern of calling memset on a buffer in the midst
# of being DMA copied to ARAM, then calling a DVD read function that effectively
# cancels the memset with dcbi instructions. Dolphin does not emulate dcache for
# performance reasons, so this patch removes the offending memset call.
$Fix audio issues
0x8000B7EC:dword:0x60000000
[OnFrame_Enabled]
$Fix audio issues
12 changes: 12 additions & 0 deletions Data/Sys/GameSettings/GEME7F.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# GEME7F - Egg Mania: Eggstreme Madness

[OnFrame]
# This game does not support Progressive Scan or Dolphin's
# "Force Progressive" hack. However this patch can be used
# to substitute field rendering with full frame rendering.
$Force Progressive Scan
0x800331BE:word:0x000001C0
0x800331FC:dword:0x60000000
0x806D0898:dword:0x801671CC
[OnFrame_Enabled]
$Force Progressive Scan
12 changes: 12 additions & 0 deletions Data/Sys/GameSettings/GEMJ28.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# GEMJ28 - Egg Mania: Eggstreme Madness

[OnFrame]
# This game does not support Progressive Scan or Dolphin's
# "Force Progressive" hack. However this patch can be used
# to substitute field rendering with full frame rendering.
$Force Progressive Scan
0x80033062:word:0x000001C0
0x800330A0:dword:0x60000000
0x806D0660:dword:0x801640A4
[OnFrame_Enabled]
$Force Progressive Scan
Loading

0 comments on commit e65599d

Please sign in to comment.