From 0c9aec94c2dd7e06f413c7de3914169ce3117a1e Mon Sep 17 00:00:00 2001 From: Xphalnos <164882787+Xphalnos@users.noreply.github.com> Date: Wed, 3 Apr 2024 14:08:53 +0200 Subject: [PATCH] Minor Cleanup --- .github/workflows/ci.yml | 1 - .gitmodules | 3 +-- CMakeLists.txt | 3 +-- README.md | 10 ++++------ documents/readme.txt | 5 ++--- documents/{building-windows.md => windows_building.md} | 6 +++--- src/audio_core/sdl_audio.cpp | 4 ++-- src/audio_core/sdl_audio.h | 2 +- src/common/endian.h | 7 +++---- src/common/logging/backend.cpp | 10 ++++------ src/common/logging/filter.h | 5 ++--- src/core/PS4/HLE/Graphics/video_out.cpp | 2 +- src/core/linker.cpp | 2 +- src/emulator.h | 2 +- src/main.cpp | 6 +++--- src/vulkan_util.cpp | 6 +++--- third-party/CMakeLists.txt | 5 +---- 17 files changed, 33 insertions(+), 46 deletions(-) rename documents/{building-windows.md => windows_building.md} (64%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 645a2ea97..871827dfe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,3 @@ - # SPDX-FileCopyrightText: 2021 yuzu Emulator Project # SPDX-License-Identifier: GPL-2.0-or-later diff --git a/.gitmodules b/.gitmodules index 08481f317..0dcfc2701 100644 --- a/.gitmodules +++ b/.gitmodules @@ -46,5 +46,4 @@ url = https://github.com/shadps4-emu/ext-zlib-ng.git [submodule "externals/sdl3"] path = externals/sdl3 - url = https://github.com/shadps4-emu/ext-SDL.git - + url = https://github.com/shadps4-emu/ext-SDL.git \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index cdd0fcb26..64528358f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project # SPDX-License-Identifier: GPL-2.0-or-later -cmake_minimum_required(VERSION 3.16.3) +cmake_minimum_required(VERSION 3.22) set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED True) @@ -38,7 +38,6 @@ function(create_target_directory_groups target_name) endforeach() endfunction() - # Setup a custom clang-format target (if clang-format can be found) that will run # against all the src files. This should be used before making a pull request. # ======================================================================= diff --git a/README.md b/README.md index 7f51d5c46..a22bf7e39 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,13 @@ SPDX-License-Identifier: GPL-2.0-or-later # shadPS4 -An early PS4 emulator for Windows and Linux written in C++ -by shadow , skmp , wheremyfoodat , GPUCode +shadPS4 is an early PS4 emulator for Windows and Linux written in C++ [Check us on twitter](https://twitter.com/shadps4 "Check us on twitter") # Status -Early progress , a small amount of ps4 sdk demos and homebrew games working +Early progress, a small amount of ps4 sdk demos and homebrew games working. # Why? @@ -22,7 +21,7 @@ The project started as a fun project. Due to short free time, it will probably t ## Windows -Check building instructions in [windows build](https://github.com/shadps4-emu/shadPS4/blob/main/documents/building-windows.md) +Check building instructions in [windows build](https://github.com/shadps4-emu/shadPS4/blob/main/documents/windows_building.md) ## Linux @@ -51,7 +50,6 @@ Logo is done by Xphalnos We currently accept any contribution, just open a pr and we will check it :) - # Sister Projects - [Panda3DS](https://github.com/wheremyfoodat/Panda3DS): An multiplatform 3DS emulator from our co-author wheremyfoodat -- [hydra](https://github.com/hydra-emu/hydra): An multisystem , multiplatform emulator (chip-8,GB,NES,N64) from Paris +- [hydra](https://github.com/hydra-emu/hydra): An multisystem , multiplatform emulator (chip-8,GB,NES,N64) from Paris \ No newline at end of file diff --git a/documents/readme.txt b/documents/readme.txt index 43c70a93e..f496bd753 100644 --- a/documents/readme.txt +++ b/documents/readme.txt @@ -31,7 +31,6 @@ I would like to thank the following people for helping me so far , with coding o - skmp - or kornilios for being good old friend - PandaBad - our beloved stalker - emufan4568 - for advices -- velocity - for talking 1-2 times per year on discord server . We miss you velocity - -- probably more , will include in the next readme :D +- velocity - for talking 1-2 times per year on discord server. We miss you velocity +- probably more , will include in the next readme :D \ No newline at end of file diff --git a/documents/building-windows.md b/documents/windows_building.md similarity index 64% rename from documents/building-windows.md rename to documents/windows_building.md index e5b75a079..1834beff9 100644 --- a/documents/building-windows.md +++ b/documents/windows_building.md @@ -5,9 +5,9 @@ SPDX-License-Identifier: GPL-2.0-or-later # How to build shadps4 in windows -## Download VStudio Community 2022 17.9.5 +## Download Visual Studio Community 2022 17.9.5 -[VStudio 2022](https://visualstudio.microsoft.com/vs/) +[Visual Studio 2022](https://visualstudio.microsoft.com/vs/) ## Requirements @@ -22,4 +22,4 @@ Install the following - ## Compiling -- Open vstudio and select the clang debug or clang release . It should compile just fine +- Open Visual Studio and select the clang debug or clang release. It should compile just fine. \ No newline at end of file diff --git a/src/audio_core/sdl_audio.cpp b/src/audio_core/sdl_audio.cpp index 457f8802f..8d722a4b9 100644 --- a/src/audio_core/sdl_audio.cpp +++ b/src/audio_core/sdl_audio.cpp @@ -1,8 +1,8 @@ // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include -#include +#include "common/assert.h" +#include "core/libraries/error_codes.h" #include "sdl_audio.h" namespace Audio { diff --git a/src/audio_core/sdl_audio.h b/src/audio_core/sdl_audio.h index 5c29835c3..d17478d2e 100644 --- a/src/audio_core/sdl_audio.h +++ b/src/audio_core/sdl_audio.h @@ -5,8 +5,8 @@ #include #include -#include +#include "src/core/libraries/libsceaudioout.h" #include "src/common/types.h" namespace Audio { diff --git a/src/common/endian.h b/src/common/endian.h index 4b0b70cdd..089c7e6d6 100644 --- a/src/common/endian.h +++ b/src/common/endian.h @@ -15,9 +15,8 @@ namespace Common { -/** - * Native endianness - */ +// Native endianness + template using NativeEndian = T; @@ -239,4 +238,4 @@ using u64_be = Common::BigEndian; using u16_le = Common::LittleEndian; using u32_le = Common::LittleEndian; -using u64_le = Common::LittleEndian; +using u64_le = Common::LittleEndian; \ No newline at end of file diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index 68bbcdb86..413e6b304 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp @@ -55,9 +55,8 @@ private: std::atomic_bool enabled{true}; }; -/** - * Backend that writes to a file passed into the constructor - */ +// Backend that writes to a file passed into the constructor + class FileBackend { public: explicit FileBackend(const std::filesystem::path& filename) @@ -117,9 +116,8 @@ public: bool initialization_in_progress_suppress_logging = true; -/** - * Static state as a singleton. - */ +// Static state as a singleton. + class Impl { public: static Impl& Instance() { diff --git a/src/common/logging/filter.h b/src/common/logging/filter.h index 7c46fd822..4bfdc7e68 100644 --- a/src/common/logging/filter.h +++ b/src/common/logging/filter.h @@ -16,9 +16,8 @@ namespace Common::Log { */ const char* GetLogClassName(Class log_class); -/** - * Returns the name of the passed log level as a C-string. - */ +// Returns the name of the passed log level as a C-string. + const char* GetLevelName(Level log_level); /** diff --git a/src/core/PS4/HLE/Graphics/video_out.cpp b/src/core/PS4/HLE/Graphics/video_out.cpp index 82c789bb8..ee59bc7b7 100644 --- a/src/core/PS4/HLE/Graphics/video_out.cpp +++ b/src/core/PS4/HLE/Graphics/video_out.cpp @@ -17,7 +17,7 @@ #include "core/hle/libraries/libscegnmdriver/libscegnmdriver.h" #include "core/loader/symbols_resolver.h" #include "emulator.h" -#include "src/core/libraries/libsceuserservice.h" +#include "core/libraries/libsceuserservice.h" namespace HLE::Libs::Graphics::VideoOut { diff --git a/src/core/linker.cpp b/src/core/linker.cpp index ba38d4123..f408d226f 100644 --- a/src/core/linker.cpp +++ b/src/core/linker.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include -#include +#include "common/assert.h" #include "common/config.h" #include "common/logging/log.h" #include "common/path_util.h" diff --git a/src/emulator.h b/src/emulator.h index 54193db51..f07152bae 100644 --- a/src/emulator.h +++ b/src/emulator.h @@ -4,7 +4,7 @@ #pragma once #include -#include +#include "core/PS4/HLE/Graphics/graphics_ctx.h" #include #include diff --git a/src/main.cpp b/src/main.cpp index 92058541c..8a927f875 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -9,9 +9,9 @@ #include #include -#include -#include -#include +#include "common/logging/log.h" +#include "core/hle/libraries/libc/libc.h" +#include "core/hle/libraries/libkernel/thread_management.h" #include "common/config.h" #include "common/discord.h" #include "common/logging/backend.h" diff --git a/src/vulkan_util.cpp b/src/vulkan_util.cpp index 828654727..d8fa48f81 100644 --- a/src/vulkan_util.cpp +++ b/src/vulkan_util.cpp @@ -1,19 +1,19 @@ // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include #include -#include #include #include #include + +#include "core/PS4/GPU/gpu_memory.h" #include "common/assert.h" #include "common/debug.h" #include "common/logging/log.h" #include "common/singleton.h" #include "vulkan_util.h" -#include - void Graphics::Vulkan::vulkanCreate(Emu::WindowCtx* ctx) { Emu::VulkanExt ext; vulkanGetInstanceExtensions(&ext); diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt index 8acf2406f..f98eefc94 100644 --- a/third-party/CMakeLists.txt +++ b/third-party/CMakeLists.txt @@ -31,7 +31,4 @@ target_include_directories(xxhash INTERFACE xxhash) # Zydis option(ZYDIS_BUILD_TOOLS "" OFF) option(ZYDIS_BUILD_EXAMPLES "" OFF) -add_subdirectory(zydis EXCLUDE_FROM_ALL) - - - +add_subdirectory(zydis EXCLUDE_FROM_ALL) \ No newline at end of file