diff options
| -rw-r--r-- | .gitmodules | 4 | ||||
| -rw-r--r-- | CMakeLists.txt | 4 | ||||
| -rw-r--r-- | docs/Solaris.md | 94 | ||||
| -rw-r--r-- | externals/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp | 13 | ||||
| -rw-r--r-- | externals/nx_tzdb/tzdb_to_nx/externals/tz/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/main.cpp | 9 | ||||
| -rw-r--r-- | externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.cpp | 37 | ||||
| -rw-r--r-- | externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.h | 39 | ||||
| -rw-r--r-- | externals/renderdoc/renderdoc_app.h | 11 | ||||
| -rw-r--r-- | src/audio_core/sink/sdl2_sink.cpp | 4 | ||||
| -rw-r--r-- | src/common/minicoro.h | 5 | ||||
| -rw-r--r-- | src/core/hle/service/caps/caps_manager.cpp | 7 | ||||
| -rw-r--r-- | src/core/hle/service/psc/time/common.h | 9 | ||||
| -rw-r--r-- | src/core/internal_network/network_interface.cpp | 41 | ||||
| -rw-r--r-- | src/network/CMakeLists.txt | 5 | ||||
| -rw-r--r-- | src/yuzu_cmd/CMakeLists.txt | 5 |
16 files changed, 215 insertions, 76 deletions
diff --git a/.gitmodules b/.gitmodules index 1a6e6574a3..371b62a605 100644 --- a/.gitmodules +++ b/.gitmodules @@ -12,7 +12,7 @@ url = https://github.com/KhronosGroup/Vulkan-Headers.git [submodule "xbyak"] path = externals/xbyak - url = https://github.com/herumi/xbyak.git + url = https://github.com/Lizzie841/xbyak.git [submodule "opus"] path = externals/opus url = https://github.com/xiph/opus.git @@ -51,7 +51,7 @@ url = https://github.com/Lizzie841/unordered_dense.git [submodule "externals/dynarmic/externals/xbyak"] path = externals/dynarmic/externals/xbyak - url = https://github.com/herumi/xbyak.git + url = https://github.com/Lizzie841/xbyak.git [submodule "externals/dynarmic/externals/zycore-c"] path = externals/dynarmic/externals/zycore-c url = https://github.com/zyantific/zycore-c.git diff --git a/CMakeLists.txt b/CMakeLists.txt index b28fbc7137..bb571235a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,7 @@ endif() if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") option(YUZU_USE_EXTERNAL_VULKAN_HEADERS "Use Vulkan-Headers from externals" OFF) else() - option(YUZU_USE_EXTERNAL_VULKAN_HEADERS "Use Vulkan-Headers from externals" ON) + option(YUZU_USE_EXTERNAL_VULKAN_HEADERS "Use Vulkan-Headers from externals" ON) endif() if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") @@ -123,7 +123,7 @@ CMAKE_DEPENDENT_OPTION(YUZU_USE_FASTER_LD "Check if a faster linker is available CMAKE_DEPENDENT_OPTION(USE_SYSTEM_MOLTENVK "Use the system MoltenVK lib (instead of the bundled one)" OFF "APPLE" OFF) set(DEFAULT_ENABLE_OPENSSL ON) -if (ANDROID OR WIN32 OR APPLE) +if (ANDROID OR WIN32 OR APPLE OR ${CMAKE_SYSTEM_NAME} STREQUAL "SunOS") set(DEFAULT_ENABLE_OPENSSL OFF) endif() option(ENABLE_OPENSSL "Enable OpenSSL backend for ISslConnection" ${DEFAULT_ENABLE_OPENSSL}) diff --git a/docs/Solaris.md b/docs/Solaris.md new file mode 100644 index 0000000000..c7daa2279b --- /dev/null +++ b/docs/Solaris.md @@ -0,0 +1,94 @@ +# Building for Solaris
+
+## Dependencies.
+Always consult [the OpenIndiana package list](https://pkg.openindiana.org/hipster/en/index.shtml) to cross-verify availability.
+
+Run the usual update + install of essential toolings: `sudo pkg update && sudo pkg install git cmake`.
+
+- **gcc**: `sudo pkg install developer/gcc-14`.
+- **clang**: Version 20 is broken, use `sudo pkg install developer/clang-19`.
+
+Then install the libraies: `sudo pkg install qt6 boost glslang libzip library/lz4 nlohmann-json openssl opus sdl2 zlib compress/zstd unzip pkg-config nasm autoconf mesa library/libdrm header-drm`.
+
+fmtlib is not available on repositories and has to be manually built:
+```sh
+git clone --recurisve --depth=1 https://github.com/fmtlib/fmt.git
+cd fmt
+cmake -DCMAKE_BUILD_TYPE=Release -B build
+cmake --build build
+sudo cmake --install build
+```
+
+pkg lz4 doesn't provide a proper CMakeFile to find the library, has to also be manually built:
+```sh
+git clone --depth=1 https://github.com/lz4/lz4.git
+cd lz4
+gmake
+sudo gmake install
+```
+
+Same goes for zstd:
+```sh
+git clone --depth=1 https://github.com/facebook/zstd.git
+cd zstd
+cmake -DCMAKE_BUILD_TYPE=Release -B build0 -S build/cmake
+cmake --build build0
+cd build0
+sudo gmake install
+```
+
+pkg SDL2 is also not nice to work with on CMake, save yourself some pain and compile it yourself:
+```sh
+git clone --depth=1 --branch=release-2.32.8 https://github.com/libsdl-org/SDL
+cmake -DCMAKE_BUILD_TYPE=Release -B build
+cmake --build build
+sudo cmake --install build
+```
+
+Audio is broken in OpenIndiana [see this issue](https://github.com/libsdl-org/SDL/issues/13405), go into `SDL/CMakeLists.txt` and comment out lines 1468:
+```diff
++# set(SDL_AUDIO_DRIVER_SUNAUDIO 1)
++# file(GLOB SUN_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/sun/*.c)
++# list(APPEND SOURCE_FILES ${SUN_AUDIO_SOURCES})
++# set(HAVE_SDL_AUDIO TRUE)
+```
+For Solaris this issue does not exist - however PulseAudio crashes on Solaris - so use a different backend.
+
+---
+
+### Build preparations:
+Run the following command to clone eden with git:
+```sh
+git clone --recursive https://git.eden-emu.dev/eden-emu/eden
+```
+You usually want to add the `--recursive` parameter as it also takes care of the external dependencies for you.
+
+Now change into the eden directory and create a build directory there:
+```sh
+cd eden
+mkdir build
+```
+
+Change into that build directory: `cd build`
+
+Now choose one option either 1 or 2, but not both as one option overwrites the other.
+
+### Building
+
+```sh
+# Needed for some dependencies that call cc directly (tz)
+echo '#!/bin/sh' >cc
+echo 'gcc $@' >>cc
+chmod +x cc
+export PATH="$PATH:$PWD"
+```
+
+- **Configure**: `cmake -B build -DYUZU_TESTS=OFF -DYUZU_USE_BUNDLED_SDL2=OFF -DYUZU_USE_EXTERNAL_SDL2=OFF -DYUZU_USE_LLVM_DEMANGLE=OFF -DYUZU_USE_QT_MULTIMEDIA=OFF -DYUZU_USE_QT_WEB_ENGINE=OFF -DYUZU_USE_BUNDLED_VCPKG=OFF -DYUZU_USE_BUNDLED_QT=OFF -DENABLE_QT=OFF -DSDL_AUDIO=OFF -DENABLE_WEB_SERVICE=OFF -DENABLE_QT_UPDATE_CHECKER=OFF`.
+- **Build**: `cmake --build build`.
+- **Installing**: `sudo cmake --install build`.
+
+### Notes
+
+- Modify the generated ffmpeg.make (in build dir) if using multiple threads (base system `make` doesn't use `-j4`, so change for `gmake`).
+- If using OpenIndiana, due to a bug in SDL2 cmake configuration; Audio driver defaults to SunOS `<sys/audioio.h>`, which does not exist on OpenIndiana.
+- Enabling OpenSSL requires compiling OpenSSL manually instead of using the provided one from repositores.
diff --git a/externals/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp b/externals/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp index 2d6d6ea6d8..8a523267e5 100644 --- a/externals/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp +++ b/externals/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + /* This file is part of the dynarmic project. * Copyright (c) 2019 MerryMage * SPDX-License-Identifier: 0BSD @@ -13,6 +16,9 @@ # ifndef __OpenBSD__ # include <ucontext.h> # endif +# ifdef __sun__ +# include <sys/regset.h> +# endif #endif #include <cstring> @@ -145,9 +151,9 @@ void SigHandler::SigAction(int sig, siginfo_t* info, void* raw_context) { #ifndef MCL_ARCHITECTURE_RISCV ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(raw_context); -# ifndef __OpenBSD__ +#ifndef __OpenBSD__ auto& mctx = ucontext->uc_mcontext; -# endif +#endif #endif #if defined(MCL_ARCHITECTURE_X86_64) @@ -167,6 +173,9 @@ void SigHandler::SigAction(int sig, siginfo_t* info, void* raw_context) { # elif defined(__OpenBSD__) # define CTX_RIP (ucontext->sc_rip) # define CTX_RSP (ucontext->sc_rsp) +# elif defined(__sun__) +# define CTX_RIP (mctx.gregs[REG_RIP]) +# define CTX_RSP (mctx.gregs[REG_RSP]) # else # error "Unknown platform" # endif diff --git a/externals/nx_tzdb/tzdb_to_nx/externals/tz/CMakeLists.txt b/externals/nx_tzdb/tzdb_to_nx/externals/tz/CMakeLists.txt index 948fe69a23..2312b34dd6 100644 --- a/externals/nx_tzdb/tzdb_to_nx/externals/tz/CMakeLists.txt +++ b/externals/nx_tzdb/tzdb_to_nx/externals/tz/CMakeLists.txt @@ -24,8 +24,8 @@ if (NOT EXISTS "${TZ_DIR}" OR NOT EXISTS "${TZIF_LIST_FILE}") # separate directory before building. execute_process( COMMAND - ${GIT_PROGRAM} clone --depth 1 "file://${TZ_SOURCE_DIR}" "${TZ_TMP_SOURCE_DIR}" - COMMAND_ERROR_IS_FATAL ANY + ${GIT_PROGRAM} clone --depth=1 "file://${TZ_SOURCE_DIR}" "${TZ_TMP_SOURCE_DIR}" + # No need to be fatal, on SunOS this works fine - COMMAND_ERROR_IS_FATAL ANY ) if (APPLE) diff --git a/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/main.cpp b/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/main.cpp index c1825970ac..12c12ac268 100644 --- a/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/main.cpp +++ b/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/main.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + #include "tzif.h" #include <array> #include <cerrno> @@ -7,7 +10,7 @@ #include <getopt.h> #include <poll.h> #include <sys/stat.h> -#include <sys/types.h> +#include <cstdint> #include <unistd.h> constexpr std::size_t ten_megabytes{(1 << 20) * 10}; @@ -92,7 +95,7 @@ int main(int argc, char *argv[]) { } } - u_int8_t *buf = new u_int8_t[filesize]; + std::uint8_t *buf = new std::uint8_t[filesize]; filesize = read(f, buf, filesize); if (filesize == static_cast<std::size_t>(-1)) { @@ -124,7 +127,7 @@ int main(int argc, char *argv[]) { delete[] buf; - std::vector<u_int8_t> output_buffer; + std::vector<std::uint8_t> output_buffer; tzif_data->ReformatNintendo(output_buffer); filename = "(stdout)"; diff --git a/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.cpp b/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.cpp index 4d2b842741..476afcbc8e 100644 --- a/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.cpp +++ b/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.cpp @@ -1,14 +1,17 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + #include "tzif.h" #include <cstdint> #include <cstring> #include <memory> -#include <sys/types.h> +#include <cstdint> namespace Tzif { -static std::size_t SkipToVersion2(const u_int8_t *data, std::size_t size) { +static std::size_t SkipToVersion2(const std::uint8_t *data, std::size_t size) { char magic[5]; - const u_int8_t *p{data}; + const std::uint8_t *p{data}; std::memcpy(magic, data, 4); magic[4] = '\0'; @@ -28,15 +31,15 @@ static std::size_t SkipToVersion2(const u_int8_t *data, std::size_t size) { } template <typename Type> constexpr static void SwapEndianess(Type *value) { - u_int8_t *data = reinterpret_cast<u_int8_t *>(value); + std::uint8_t *data = reinterpret_cast<std::uint8_t *>(value); union { - u_int8_t data[sizeof(Type)]; + std::uint8_t data[sizeof(Type)]; Type value; } temp; - for (u_int32_t i = 0; i < sizeof(Type); i++) { - u_int32_t alt_index = sizeof(Type) - i - 1; + for (std::uint32_t i = 0; i < sizeof(Type); i++) { + std::uint32_t alt_index = sizeof(Type) - i - 1; temp.data[alt_index] = data[i]; } @@ -52,13 +55,13 @@ static void FlipHeader(Header &header) { SwapEndianess(&header.charcnt); } -std::unique_ptr<DataImpl> ReadData(const u_int8_t *data, std::size_t size) { +std::unique_ptr<DataImpl> ReadData(const std::uint8_t *data, std::size_t size) { const std::size_t v2_offset = SkipToVersion2(data, size); if (v2_offset == static_cast<std::size_t>(-1)) { return nullptr; } - const u_int8_t *p = data + v2_offset; + const std::uint8_t *p = data + v2_offset; Header header; std::memcpy(&header, p, sizeof(header)); @@ -67,10 +70,10 @@ std::unique_ptr<DataImpl> ReadData(const u_int8_t *data, std::size_t size) { FlipHeader(header); const std::size_t data_block_length = - header.timecnt * sizeof(int64_t) + header.timecnt * sizeof(u_int8_t) + + header.timecnt * sizeof(int64_t) + header.timecnt * sizeof(std::uint8_t) + header.typecnt * sizeof(TimeTypeRecord) + - header.charcnt * sizeof(int8_t) + header.isstdcnt * sizeof(u_int8_t) + - header.isutcnt * sizeof(u_int8_t); + header.charcnt * sizeof(int8_t) + header.isstdcnt * sizeof(std::uint8_t) + + header.isutcnt * sizeof(std::uint8_t); if (v2_offset + data_block_length + sizeof(Header) > size) { return nullptr; @@ -81,7 +84,7 @@ std::unique_ptr<DataImpl> ReadData(const u_int8_t *data, std::size_t size) { const auto copy = []<typename Type>(std::unique_ptr<Type[]> &array, int length, - const u_int8_t *const &ptr) -> const u_int8_t * { + const std::uint8_t *const &ptr) -> const std::uint8_t * { const std::size_t region_length = length * sizeof(Type); array = std::make_unique<Type[]>(length); std::memcpy(array.get(), ptr, region_length); @@ -110,16 +113,16 @@ std::unique_ptr<DataImpl> ReadData(const u_int8_t *data, std::size_t size) { return impl; } -static void PushToBuffer(std::vector<u_int8_t> &buffer, const void *data, +static void PushToBuffer(std::vector<std::uint8_t> &buffer, const void *data, std::size_t size) { - const u_int8_t *p{reinterpret_cast<const u_int8_t *>(data)}; + const std::uint8_t *p{reinterpret_cast<const std::uint8_t *>(data)}; for (std::size_t i = 0; i < size; i++) { buffer.push_back(*p); p++; } } -void DataImpl::ReformatNintendo(std::vector<u_int8_t> &buffer) const { +void DataImpl::ReformatNintendo(std::vector<std::uint8_t> &buffer) const { buffer.clear(); Header header_copy{header}; @@ -131,7 +134,7 @@ void DataImpl::ReformatNintendo(std::vector<u_int8_t> &buffer) const { PushToBuffer(buffer, transition_times.get(), header.timecnt * sizeof(int64_t)); PushToBuffer(buffer, transition_types.get(), - header.timecnt * sizeof(u_int8_t)); + header.timecnt * sizeof(std::uint8_t)); PushToBuffer(buffer, local_time_type_records.get(), header.typecnt * sizeof(TimeTypeRecord)); PushToBuffer(buffer, time_zone_designations.get(), diff --git a/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.h b/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.h index 62ff3afe15..a6eb32a896 100644 --- a/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.h +++ b/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.h @@ -1,22 +1,25 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + #pragma once #include <array> #include <memory> -#include <sys/types.h> +#include <cstdint> #include <vector> namespace Tzif { typedef struct { char magic[4]; - u_int8_t version; - u_int8_t reserved[15]; - u_int32_t isutcnt; - u_int32_t isstdcnt; - u_int32_t leapcnt; - u_int32_t timecnt; - u_int32_t typecnt; - u_int32_t charcnt; + std::uint8_t version; + std::uint8_t reserved[15]; + std::uint32_t isutcnt; + std::uint32_t isstdcnt; + std::uint32_t leapcnt; + std::uint32_t timecnt; + std::uint32_t typecnt; + std::uint32_t charcnt; } Header; static_assert(sizeof(Header) == 0x2c); @@ -34,9 +37,9 @@ public: #pragma pack(push, 1) typedef struct { - u_int32_t utoff; - u_int8_t dst; - u_int8_t idx; + std::uint32_t utoff; + std::uint8_t dst; + std::uint8_t idx; } TimeTypeRecord; #pragma pack(pop) static_assert(sizeof(TimeTypeRecord) == 0x6); @@ -46,7 +49,7 @@ public: explicit Data() = default; virtual ~Data() = default; - virtual void ReformatNintendo(std::vector<u_int8_t> &buffer) const = 0; + virtual void ReformatNintendo(std::vector<std::uint8_t> &buffer) const = 0; }; class DataImpl : public Data { @@ -54,19 +57,19 @@ public: explicit DataImpl() = default; ~DataImpl() override = default; - void ReformatNintendo(std::vector<u_int8_t> &buffer) const override; + void ReformatNintendo(std::vector<std::uint8_t> &buffer) const override; Header header; Footer footer; std::unique_ptr<int64_t[]> transition_times; - std::unique_ptr<u_int8_t[]> transition_types; + std::unique_ptr<std::uint8_t[]> transition_types; std::unique_ptr<TimeTypeRecord[]> local_time_type_records; std::unique_ptr<int8_t[]> time_zone_designations; - std::unique_ptr<u_int8_t[]> standard_indicators; - std::unique_ptr<u_int8_t[]> ut_indicators; + std::unique_ptr<std::uint8_t[]> standard_indicators; + std::unique_ptr<std::uint8_t[]> ut_indicators; }; -std::unique_ptr<DataImpl> ReadData(const u_int8_t *data, std::size_t size); +std::unique_ptr<DataImpl> ReadData(const std::uint8_t *data, std::size_t size); } // namespace Tzif diff --git a/externals/renderdoc/renderdoc_app.h b/externals/renderdoc/renderdoc_app.h index 84ff62b5db..f4eb12526e 100644 --- a/externals/renderdoc/renderdoc_app.h +++ b/externals/renderdoc/renderdoc_app.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Baldur Karlsson // SPDX-License-Identifier: MIT @@ -38,14 +41,8 @@ #if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) #define RENDERDOC_CC __cdecl -#elif defined(__linux__) -#define RENDERDOC_CC -#elif defined(__APPLE__) -#define RENDERDOC_CC -#elif defined(__FreeBSD__) -#define RENDERDOC_CC #else -#error "Unknown platform" +#define RENDERDOC_CC #endif #ifdef __cplusplus diff --git a/src/audio_core/sink/sdl2_sink.cpp b/src/audio_core/sink/sdl2_sink.cpp index 7dd155ff0c..ffdd77042e 100644 --- a/src/audio_core/sink/sdl2_sink.cpp +++ b/src/audio_core/sink/sdl2_sink.cpp @@ -1,8 +1,12 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include <span> #include <vector> + #include <SDL.h> #include "audio_core/common/common.h" diff --git a/src/common/minicoro.h b/src/common/minicoro.h index 9f1dbcafb3..f4113dcbe5 100644 --- a/src/common/minicoro.h +++ b/src/common/minicoro.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + /* Minimal asymmetric stackful cross-platform coroutine library in pure C. minicoro - v0.2.0 - 15/Nov/2023 @@ -467,7 +470,7 @@ extern "C" { #ifdef MCO_NO_MULTITHREAD #define MCO_THREAD_LOCAL #else -#ifdef thread_local +#if defined(thread_local) || __STDC_VERSION__ >= 202311L || defined(__sun__) #define MCO_THREAD_LOCAL thread_local #elif __STDC_VERSION__ >= 201112 && !defined(__STDC_NO_THREADS__) #define MCO_THREAD_LOCAL _Thread_local diff --git a/src/core/hle/service/caps/caps_manager.cpp b/src/core/hle/service/caps/caps_manager.cpp index e636d90bc4..1825d345a6 100644 --- a/src/core/hle/service/caps/caps_manager.cpp +++ b/src/core/hle/service/caps/caps_manager.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -440,8 +443,8 @@ Result AlbumManager::SaveImage(ApplicationAlbumEntry& out_entry, std::span<const const auto screenshot_path = Common::FS::GetEdenPathString(Common::FS::EdenPath::ScreenshotsDir); const std::string formatted_date = - fmt::format("{:04}-{:02}-{:02}_{:02}-{:02}-{:02}-{:03}", date.year, date.month, date.day, - date.hour, date.minute, date.second, 0); + fmt::format("{:04}-{:02}-{:02}_{:02}-{:02}-{:02}-{:03}", u16(date.year), u8(date.month), u8(date.day), + u8(date.hour), u8(date.minute), u8(date.second), 0); const std::string file_path = fmt::format("{}/{:016x}_{}.png", screenshot_path, title_id, formatted_date); diff --git a/src/core/hle/service/psc/time/common.h b/src/core/hle/service/psc/time/common.h index a03322d347..954aed666a 100644 --- a/src/core/hle/service/psc/time/common.h +++ b/src/core/hle/service/psc/time/common.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -206,9 +209,9 @@ template <> struct fmt::formatter<Service::PSC::Time::CalendarTime> : fmt::formatter<fmt::string_view> { template <typename FormatContext> auto format(const Service::PSC::Time::CalendarTime& calendar, FormatContext& ctx) const { - return fmt::format_to(ctx.out(), "[{:02}/{:02}/{:04} {:02}:{:02}:{:02}]", calendar.day, - calendar.month, calendar.year, calendar.hour, calendar.minute, - calendar.second); + return fmt::format_to(ctx.out(), "[{:02}/{:02}/{:04} {:02}:{:02}:{:02}]", u8(calendar.day), + u8(calendar.month), u16(calendar.year), u8(calendar.hour), u8(calendar.minute), + u8(calendar.second)); } }; diff --git a/src/core/internal_network/network_interface.cpp b/src/core/internal_network/network_interface.cpp index 42def7af92..f62381b9e3 100644 --- a/src/core/internal_network/network_interface.cpp +++ b/src/core/internal_network/network_interface.cpp @@ -27,7 +27,7 @@ namespace Network { #ifdef _WIN32 -std::vector<NetworkInterface> GetAvailableNetworkInterfaces() { +std::vector<Network::NetworkInterface> GetAvailableNetworkInterfaces() { ULONG buf_size = 0; if (GetAdaptersAddresses( @@ -47,7 +47,7 @@ std::vector<NetworkInterface> GetAvailableNetworkInterfaces() { return {}; } - std::vector<NetworkInterface> result; + std::vector<Network::NetworkInterface> result; for (auto* a = addrs; a; a = a->Next) { @@ -80,7 +80,7 @@ std::vector<NetworkInterface> GetAvailableNetworkInterfaces() { break; } - result.emplace_back(NetworkInterface{ + result.emplace_back(Network::NetworkInterface{ .name = Common::UTF16ToUTF8(std::wstring{a->FriendlyName}), .ip_address = ip, .subnet_mask = mask, @@ -94,7 +94,7 @@ std::vector<NetworkInterface> GetAvailableNetworkInterfaces() { #else -std::vector<NetworkInterface> GetAvailableNetworkInterfaces() { +std::vector<Network::NetworkInterface> GetAvailableNetworkInterfaces() { struct ifaddrs* ifaddr = nullptr; if (getifaddrs(&ifaddr) != 0) { @@ -103,7 +103,7 @@ std::vector<NetworkInterface> GetAvailableNetworkInterfaces() { return {}; } - std::vector<NetworkInterface> result; + std::vector<Network::NetworkInterface> result; for (auto ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) { if (ifa->ifa_addr == nullptr || ifa->ifa_netmask == nullptr) { @@ -121,7 +121,7 @@ std::vector<NetworkInterface> GetAvailableNetworkInterfaces() { #ifdef ANDROID // On Android, we can't reliably get gateway info from /proc/net/route // Just use 0 as the gateway address - result.emplace_back(NetworkInterface{ + result.emplace_back(Network::NetworkInterface{ .name{ifa->ifa_name}, .ip_address{Common::BitCast<struct sockaddr_in>(*ifa->ifa_addr).sin_addr}, .subnet_mask{Common::BitCast<struct sockaddr_in>(*ifa->ifa_netmask).sin_addr}, @@ -134,11 +134,15 @@ std::vector<NetworkInterface> GetAvailableNetworkInterfaces() { if (!file.is_open()) { LOG_ERROR(Network, "Failed to open \"/proc/net/route\""); - result.emplace_back(NetworkInterface{ - .name{ifa->ifa_name}, - .ip_address{Common::BitCast<struct sockaddr_in>(*ifa->ifa_addr).sin_addr}, - .subnet_mask{Common::BitCast<struct sockaddr_in>(*ifa->ifa_netmask).sin_addr}, - .gateway{in_addr{.s_addr = gateway}}}); + // Solaris defines s_addr as a macro, can't use special C++ shenanigans here + in_addr gateway_0; + gateway_0.s_addr = gateway; + result.emplace_back(Network::NetworkInterface{ + .name = ifa->ifa_name, + .ip_address = Common::BitCast<struct sockaddr_in>(*ifa->ifa_addr).sin_addr, + .subnet_mask = Common::BitCast<struct sockaddr_in>(*ifa->ifa_netmask).sin_addr, + .gateway = gateway_0 + }); continue; } @@ -183,11 +187,14 @@ std::vector<NetworkInterface> GetAvailableNetworkInterfaces() { gateway = 0; } - result.emplace_back(NetworkInterface{ - .name{ifa->ifa_name}, - .ip_address{Common::BitCast<struct sockaddr_in>(*ifa->ifa_addr).sin_addr}, - .subnet_mask{Common::BitCast<struct sockaddr_in>(*ifa->ifa_netmask).sin_addr}, - .gateway{in_addr{.s_addr = gateway}}}); + in_addr gateway_0; + gateway_0.s_addr = gateway; + result.emplace_back(Network::NetworkInterface{ + .name = ifa->ifa_name, + .ip_address = Common::BitCast<struct sockaddr_in>(*ifa->ifa_addr).sin_addr, + .subnet_mask = Common::BitCast<struct sockaddr_in>(*ifa->ifa_netmask).sin_addr, + .gateway = gateway_0 + }); #endif // ANDROID } @@ -197,7 +204,7 @@ std::vector<NetworkInterface> GetAvailableNetworkInterfaces() { #endif // _WIN32 -std::optional<NetworkInterface> GetSelectedNetworkInterface() { +std::optional<Network::NetworkInterface> GetSelectedNetworkInterface() { const auto& selected_network_interface = Settings::values.network_interface.GetValue(); const auto network_interfaces = Network::GetAvailableNetworkInterfaces(); diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index 8e306219fb..1657feaa5f 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt @@ -25,6 +25,11 @@ if (ENABLE_WEB_SERVICE) target_link_libraries(network PRIVATE web_service) endif() +# Solaris uses /lib/amd64/libsocket.so and /lib/amd64/libnsl.so +if (${CMAKE_SYSTEM_NAME} STREQUAL "SunOS") + target_link_libraries(network PRIVATE socket nsl) +endif() + if (YUZU_USE_PRECOMPILED_HEADERS) target_precompile_headers(network PRIVATE precompiled_headers.h) endif() diff --git a/src/yuzu_cmd/CMakeLists.txt b/src/yuzu_cmd/CMakeLists.txt index ebd8fd7387..9d1e08c04c 100644 --- a/src/yuzu_cmd/CMakeLists.txt +++ b/src/yuzu_cmd/CMakeLists.txt @@ -40,6 +40,11 @@ target_include_directories(yuzu-cmd PRIVATE ${RESOURCES_DIR}) target_link_libraries(yuzu-cmd PRIVATE SDL2::SDL2 Vulkan::Headers) +# In Solaris needs explicit linking for ffmpeg which links to /lib/amd64/libX11.so +if (${CMAKE_SYSTEM_NAME} STREQUAL "SunOS") + target_link_libraries(yuzu-cmd PRIVATE X11) +endif() + if(UNIX AND NOT APPLE) install(TARGETS yuzu-cmd) endif() |
