From 1ed34b1e471eb375f679788caba75465803e2f75 Mon Sep 17 00:00:00 2001 From: RadsammyT Date: Thu, 21 Mar 2024 23:52:32 -0400 Subject: [PATCH 01/15] suyu_cmd: allow launching of applets by supplying FrontendAppletParameters as an arg Based off of a patch i saved before I nuked my local copy of the suyu repo from gitlab and replaced it with the one local-hosted --- .../am/service/library_applet_creator.cpp | 142 +++++++++--------- .../am/service/library_applet_creator.h | 2 + src/suyu_cmd/suyu.cpp | 83 ++++++++-- 3 files changed, 140 insertions(+), 87 deletions(-) diff --git a/src/core/hle/service/am/service/library_applet_creator.cpp b/src/core/hle/service/am/service/library_applet_creator.cpp index 3ffb03bc97..4048cb8704 100644 --- a/src/core/hle/service/am/service/library_applet_creator.cpp +++ b/src/core/hle/service/am/service/library_applet_creator.cpp @@ -47,6 +47,75 @@ bool ShouldCreateGuestApplet(AppletId applet_id) { return true; } +std::shared_ptr CreateGuestApplet(Core::System& system, + WindowSystem& window_system, + std::shared_ptr caller_applet, + AppletId applet_id, + LibraryAppletMode mode) { + const auto program_id = static_cast(Service::AM::AppletIdToProgramId(applet_id)); + if (program_id == 0) { + // Unknown applet + return {}; + } + + // TODO: enable other versions of applets + enum : u8 { + Firmware1400 = 14, + Firmware1500 = 15, + Firmware1600 = 16, + Firmware1700 = 17, + }; + + auto process = CreateProcess(system, program_id, Firmware1400, Firmware1700); + if (!process) { + // Couldn't initialize the guest process + return {}; + } + + const auto applet = std::make_shared(system, std::move(process), false); + applet->program_id = program_id; + applet->applet_id = applet_id; + applet->type = AppletType::LibraryApplet; + applet->library_applet_mode = mode; + applet->window_visible = mode != LibraryAppletMode::AllForegroundInitiallyHidden; + + auto broker = std::make_shared(system); + applet->caller_applet = caller_applet; + applet->caller_applet_broker = broker; + caller_applet->child_applets.push_back(applet); + + window_system.TrackApplet(applet, false); + + return std::make_shared(system, broker, applet); +} + +std::shared_ptr CreateFrontendApplet(Core::System& system, + WindowSystem& window_system, + std::shared_ptr caller_applet, + AppletId applet_id, + LibraryAppletMode mode) { + const auto program_id = static_cast(Service::AM::AppletIdToProgramId(applet_id)); + + auto process = std::make_unique(system); + auto applet = std::make_shared(system, std::move(process), false); + applet->program_id = program_id; + applet->applet_id = applet_id; + applet->type = AppletType::LibraryApplet; + applet->library_applet_mode = mode; + + auto storage = std::make_shared(system); + applet->caller_applet = caller_applet; + applet->caller_applet_broker = storage; + applet->frontend = system.GetFrontendAppletHolder().GetApplet(applet, applet_id, mode); + caller_applet->child_applets.push_back(applet); + + window_system.TrackApplet(applet, false); + + return std::make_shared(system, storage, applet); +} + +} // namespace + AppletProgramId AppletIdToProgramId(AppletId applet_id) { switch (applet_id) { case AppletId::OverlayDisplay: @@ -94,79 +163,10 @@ AppletProgramId AppletIdToProgramId(AppletId applet_id) { } } -std::shared_ptr CreateGuestApplet(Core::System& system, - WindowSystem& window_system, - std::shared_ptr caller_applet, - AppletId applet_id, - LibraryAppletMode mode) { - const auto program_id = static_cast(AppletIdToProgramId(applet_id)); - if (program_id == 0) { - // Unknown applet - return {}; - } - - // TODO: enable other versions of applets - enum : u8 { - Firmware1400 = 14, - Firmware1500 = 15, - Firmware1600 = 16, - Firmware1700 = 17, - }; - - auto process = CreateProcess(system, program_id, Firmware1400, Firmware1700); - if (!process) { - // Couldn't initialize the guest process - return {}; - } - - const auto applet = std::make_shared(system, std::move(process), false); - applet->program_id = program_id; - applet->applet_id = applet_id; - applet->type = AppletType::LibraryApplet; - applet->library_applet_mode = mode; - applet->window_visible = mode != LibraryAppletMode::AllForegroundInitiallyHidden; - - auto broker = std::make_shared(system); - applet->caller_applet = caller_applet; - applet->caller_applet_broker = broker; - caller_applet->child_applets.push_back(applet); - - window_system.TrackApplet(applet, false); - - return std::make_shared(system, broker, applet); -} - -std::shared_ptr CreateFrontendApplet(Core::System& system, - WindowSystem& window_system, - std::shared_ptr caller_applet, - AppletId applet_id, - LibraryAppletMode mode) { - const auto program_id = static_cast(AppletIdToProgramId(applet_id)); - - auto process = std::make_unique(system); - auto applet = std::make_shared(system, std::move(process), false); - applet->program_id = program_id; - applet->applet_id = applet_id; - applet->type = AppletType::LibraryApplet; - applet->library_applet_mode = mode; - - auto storage = std::make_shared(system); - applet->caller_applet = caller_applet; - applet->caller_applet_broker = storage; - applet->frontend = system.GetFrontendAppletHolder().GetApplet(applet, applet_id, mode); - caller_applet->child_applets.push_back(applet); - - window_system.TrackApplet(applet, false); - - return std::make_shared(system, storage, applet); -} - -} // namespace - ILibraryAppletCreator::ILibraryAppletCreator(Core::System& system_, std::shared_ptr applet, WindowSystem& window_system) - : ServiceFramework{system_, "ILibraryAppletCreator"}, - m_window_system{window_system}, m_applet{std::move(applet)} { + : ServiceFramework{system_, "ILibraryAppletCreator"}, m_window_system{window_system}, + m_applet{std::move(applet)} { static const FunctionInfo functions[] = { {0, D<&ILibraryAppletCreator::CreateLibraryApplet>, "CreateLibraryApplet"}, {1, nullptr, "TerminateAllLibraryApplets"}, diff --git a/src/core/hle/service/am/service/library_applet_creator.h b/src/core/hle/service/am/service/library_applet_creator.h index a10a769828..80ea6bd1af 100644 --- a/src/core/hle/service/am/service/library_applet_creator.h +++ b/src/core/hle/service/am/service/library_applet_creator.h @@ -35,4 +35,6 @@ private: const std::shared_ptr m_applet; }; +AppletProgramId AppletIdToProgramId(AppletId applet_id); + } // namespace Service::AM diff --git a/src/suyu_cmd/suyu.cpp b/src/suyu_cmd/suyu.cpp index f559c74f5b..5458b0793b 100644 --- a/src/suyu_cmd/suyu.cpp +++ b/src/suyu_cmd/suyu.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include @@ -23,9 +24,12 @@ #include "core/core_timing.h" #include "core/cpu_manager.h" #include "core/crypto/key_manager.h" +#include "core/file_sys/content_archive.h" +#include "core/file_sys/nca_metadata.h" #include "core/file_sys/registered_cache.h" #include "core/file_sys/vfs/vfs_real.h" #include "core/hle/service/am/applet_manager.h" +#include "core/hle/service/am/service/library_applet_creator.h" #include "core/hle/service/filesystem/filesystem.h" #include "core/loader/loader.h" #include "frontend_common/config.h" @@ -67,17 +71,23 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; #endif static void PrintHelp(const char* argv0) { - std::cout << "Usage: " << argv0 - << " [options] \n" - "-c, --config Load the specified configuration file\n" - "-f, --fullscreen Start in fullscreen mode\n" - "-g, --game File path of the game to load\n" - "-h, --help Display this help and exit\n" - "-m, --multiplayer=nick:password@address:port" - " Nickname, password, address and port for multiplayer\n" - "-p, --program Pass following string as arguments to executable\n" - "-u, --user Select a specific user profile from 0 to 7\n" - "-v, --version Output version information and exit\n"; + std::cout + << "Usage: " << argv0 + << " [options] \n" + "-c, --config Load the specified configuration file\n" + "-f, --fullscreen Start in fullscreen mode\n" + "-g, --game File path of the game to load\n" + "-h, --help Display this help and exit\n" + "-m, --multiplayer=nick:password@address:port" + " Nickname, password, address and port for multiplayer\n" + "-p, --program Pass following string as arguments to executable\n" + "-u, --user Select a specific user profile from 0 to 7\n" + "-v, --version Output version information and exit\n" + "-l, " + "--applet-params=" + "\"program_id,applet_id,applet_type,launch_type,prog_index,prev_prog_index\"\n" + " Numerical parameters for launching an applet. If applet_id\n" + " is 0, then the provided game will launch, if any.\n"; } static void PrintVersion() { @@ -212,6 +222,7 @@ int main(int argc, char** argv) { bool use_multiplayer = false; bool fullscreen = false; + Service::AM::FrontendAppletParameters load_parameters{}; std::string nickname{}; std::string password{}; std::string address{}; @@ -223,6 +234,7 @@ int main(int argc, char** argv) { {"fullscreen", no_argument, 0, 'f'}, {"help", no_argument, 0, 'h'}, {"game", required_argument, 0, 'g'}, + {"applet-params", required_argument, 0, 'l'}, {"multiplayer", required_argument, 0, 'm'}, {"program", optional_argument, 0, 'p'}, {"user", required_argument, 0, 'u'}, @@ -232,7 +244,7 @@ int main(int argc, char** argv) { }; while (optind < argc) { - int arg = getopt_long(argc, argv, "g:fhvp::c:u:", long_options, &option_index); + int arg = getopt_long(argc, argv, "g:fhvp::c:u:l:", long_options, &option_index); if (arg != -1) { switch (static_cast(arg)) { case 'c': @@ -250,6 +262,27 @@ int main(int argc, char** argv) { filepath = str_arg; break; } + case 'l': { + std::string str_arg(optarg); + str_arg.append(",0"); // FALLBACK: if string is partially completed ("1234,3") + // this will set all those unset to 0. otherwise we get + // all 3s. + std::stringstream stream(str_arg); + std::string sub; + std::getline(stream, sub, ','); + load_parameters.program_id = std::stoull(sub); + std::getline(stream, sub, ','); + load_parameters.applet_id = static_cast(std::stoul(sub)); + std::getline(stream, sub, ','); + load_parameters.applet_type = static_cast(std::stoi(sub)); + std::getline(stream, sub, ','); + load_parameters.launch_type = static_cast(std::stoi(sub)); + std::getline(stream, sub, ','); + load_parameters.program_index = std::stoi(sub); + std::getline(stream, sub, ','); + load_parameters.previous_program_index = std::stoi(sub); + break; + } case 'm': { use_multiplayer = true; const std::string str_arg(optarg); @@ -331,7 +364,7 @@ int main(int argc, char** argv) { Common::ConfigureNvidiaEnvironmentFlags(); - if (filepath.empty()) { + if (filepath.empty() && !static_cast(load_parameters.applet_id)) { LOG_CRITICAL(Frontend, "Failed to load ROM: No ROM specified"); return -1; } @@ -367,9 +400,27 @@ int main(int argc, char** argv) { system.GetFileSystemController().CreateFactories(*system.GetFilesystem()); system.GetUserChannel().clear(); - Service::AM::FrontendAppletParameters load_parameters{ - .applet_id = Service::AM::AppletId::Application, - }; + if (static_cast(load_parameters.applet_id)) { + // code below based off of suyu/main.cpp : GMainWindow::OnHomeMenu() + Service::AM::AppletProgramId applet_prog_id = + Service::AM::AppletIdToProgramId(load_parameters.applet_id); + auto sysnand = system.GetFileSystemController().GetSystemNANDContents(); + if (!sysnand) { + LOG_CRITICAL(Frontend, "Failed to load applet: Firmware not installed."); + return -1; + } + + auto user_applet_nca = sysnand->GetEntry(static_cast(applet_prog_id), + FileSys::ContentRecordType::Program); + if (!user_applet_nca) { + LOG_CRITICAL(Frontend, "Failed to load applet: applet cannot be found."); + return -1; + } + if (filepath.empty()) + filepath = user_applet_nca->GetFullPath(); + } else { + load_parameters.applet_id = Service::AM::AppletId::Application; + } const Core::SystemResultStatus load_result{system.Load(*emu_window, filepath, load_parameters)}; switch (load_result) { From f9c3b8dc758ae6c1baef3a36daaec151d22ebb36 Mon Sep 17 00:00:00 2001 From: RadsammyT Date: Sat, 23 Mar 2024 00:27:27 -0400 Subject: [PATCH 02/15] PR#3 review: -l's arg is now optional --- src/suyu_cmd/suyu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/suyu_cmd/suyu.cpp b/src/suyu_cmd/suyu.cpp index 5458b0793b..c0757d0821 100644 --- a/src/suyu_cmd/suyu.cpp +++ b/src/suyu_cmd/suyu.cpp @@ -234,7 +234,7 @@ int main(int argc, char** argv) { {"fullscreen", no_argument, 0, 'f'}, {"help", no_argument, 0, 'h'}, {"game", required_argument, 0, 'g'}, - {"applet-params", required_argument, 0, 'l'}, + {"applet-params", optional_argument, 0, 'l'}, {"multiplayer", required_argument, 0, 'm'}, {"program", optional_argument, 0, 'p'}, {"user", required_argument, 0, 'u'}, @@ -244,7 +244,7 @@ int main(int argc, char** argv) { }; while (optind < argc) { - int arg = getopt_long(argc, argv, "g:fhvp::c:u:l:", long_options, &option_index); + int arg = getopt_long(argc, argv, "g:fhvp::c:u:l::", long_options, &option_index); if (arg != -1) { switch (static_cast(arg)) { case 'c': From caa93cda4838404b5b6612689a0c4b212b54ee63 Mon Sep 17 00:00:00 2001 From: RadsammyT Date: Sat, 23 Mar 2024 00:51:40 -0400 Subject: [PATCH 03/15] PR#3 review: (hopefully) unfuck formatting changes squash: re-deanonymize AppletIdToProgramId() --- .../hle/service/am/service/library_applet_creator.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/hle/service/am/service/library_applet_creator.cpp b/src/core/hle/service/am/service/library_applet_creator.cpp index 4048cb8704..b4c95a8ff3 100644 --- a/src/core/hle/service/am/service/library_applet_creator.cpp +++ b/src/core/hle/service/am/service/library_applet_creator.cpp @@ -52,7 +52,7 @@ std::shared_ptr CreateGuestApplet(Core::System& system, std::shared_ptr caller_applet, AppletId applet_id, LibraryAppletMode mode) { - const auto program_id = static_cast(Service::AM::AppletIdToProgramId(applet_id)); + const auto program_id = static_cast(AppletIdToProgramId(applet_id)); if (program_id == 0) { // Unknown applet return {}; @@ -94,7 +94,7 @@ std::shared_ptr CreateFrontendApplet(Core::System& syste std::shared_ptr caller_applet, AppletId applet_id, LibraryAppletMode mode) { - const auto program_id = static_cast(Service::AM::AppletIdToProgramId(applet_id)); + const auto program_id = static_cast(AppletIdToProgramId(applet_id)); auto process = std::make_unique(system); auto applet = std::make_shared(system, std::move(process), false); @@ -163,10 +163,11 @@ AppletProgramId AppletIdToProgramId(AppletId applet_id) { } } + ILibraryAppletCreator::ILibraryAppletCreator(Core::System& system_, std::shared_ptr applet, WindowSystem& window_system) - : ServiceFramework{system_, "ILibraryAppletCreator"}, m_window_system{window_system}, - m_applet{std::move(applet)} { + : ServiceFramework{system_, "ILibraryAppletCreator"}, + m_window_system{window_system}, m_applet{std::move(applet)} { static const FunctionInfo functions[] = { {0, D<&ILibraryAppletCreator::CreateLibraryApplet>, "CreateLibraryApplet"}, {1, nullptr, "TerminateAllLibraryApplets"}, From bce23c24e03e1a2212c6acff68b55f338eb1c923 Mon Sep 17 00:00:00 2001 From: RadsammyT Date: Sat, 23 Mar 2024 14:51:33 -0400 Subject: [PATCH 04/15] PR#3 review: fix -l arg breaking because optarg goes NULL when encountering an optional argument, so I have to do this instead to get the argument. See case 'p'. --- src/suyu_cmd/suyu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/suyu_cmd/suyu.cpp b/src/suyu_cmd/suyu.cpp index c0757d0821..1a5714950d 100644 --- a/src/suyu_cmd/suyu.cpp +++ b/src/suyu_cmd/suyu.cpp @@ -263,7 +263,7 @@ int main(int argc, char** argv) { break; } case 'l': { - std::string str_arg(optarg); + std::string str_arg(argv[optind++]); str_arg.append(",0"); // FALLBACK: if string is partially completed ("1234,3") // this will set all those unset to 0. otherwise we get // all 3s. From ede4f2d8f40488b03f2096a96b311e1a4ac77c08 Mon Sep 17 00:00:00 2001 From: RadsammyT Date: Sat, 23 Mar 2024 16:39:48 -0400 Subject: [PATCH 05/15] PR#3 review: remove from --help + formatting changes ran clang-format on suyu_cmd/suyu.cpp and removed one blank line on library_applet_accessor.cpp so formatting CI doesn't complain --- .../am/service/library_applet_creator.cpp | 1 - src/suyu_cmd/suyu.cpp | 34 +++++++++---------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/core/hle/service/am/service/library_applet_creator.cpp b/src/core/hle/service/am/service/library_applet_creator.cpp index b4c95a8ff3..c2d9b43639 100644 --- a/src/core/hle/service/am/service/library_applet_creator.cpp +++ b/src/core/hle/service/am/service/library_applet_creator.cpp @@ -163,7 +163,6 @@ AppletProgramId AppletIdToProgramId(AppletId applet_id) { } } - ILibraryAppletCreator::ILibraryAppletCreator(Core::System& system_, std::shared_ptr applet, WindowSystem& window_system) : ServiceFramework{system_, "ILibraryAppletCreator"}, diff --git a/src/suyu_cmd/suyu.cpp b/src/suyu_cmd/suyu.cpp index 1a5714950d..a820e896da 100644 --- a/src/suyu_cmd/suyu.cpp +++ b/src/suyu_cmd/suyu.cpp @@ -71,23 +71,23 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; #endif static void PrintHelp(const char* argv0) { - std::cout - << "Usage: " << argv0 - << " [options] \n" - "-c, --config Load the specified configuration file\n" - "-f, --fullscreen Start in fullscreen mode\n" - "-g, --game File path of the game to load\n" - "-h, --help Display this help and exit\n" - "-m, --multiplayer=nick:password@address:port" - " Nickname, password, address and port for multiplayer\n" - "-p, --program Pass following string as arguments to executable\n" - "-u, --user Select a specific user profile from 0 to 7\n" - "-v, --version Output version information and exit\n" - "-l, " - "--applet-params=" - "\"program_id,applet_id,applet_type,launch_type,prog_index,prev_prog_index\"\n" - " Numerical parameters for launching an applet. If applet_id\n" - " is 0, then the provided game will launch, if any.\n"; + std::cout << "Usage: " << argv0 + << " [options]\n" + "-c, --config Load the specified configuration file\n" + "-f, --fullscreen Start in fullscreen mode\n" + "-g, --game File path of the game to load\n" + "-h, --help Display this help and exit\n" + "-m, --multiplayer=nick:password@address:port" + " Nickname, password, address and port for multiplayer\n" + "-p, --program Pass following string as arguments to executable\n" + "-u, --user Select a specific user profile from 0 to 7\n" + "-v, --version Output version information and exit\n" + "-l, " + "--applet-params=" + "\"program_id,applet_id,applet_type,launch_type,prog_index,prev_prog_index\"\n" + " Numerical parameters for launching an applet. If no\n" + " game is provided, then the applet will launch off of\n" + " the applet_id.\n"; } static void PrintVersion() { From f9f4622b288d12400b56850351d903d49348c1fd Mon Sep 17 00:00:00 2001 From: Fijxu Date: Sat, 23 Mar 2024 17:57:35 -0300 Subject: [PATCH 06/15] ci: Container options in verify.yml negaetes the options in the runner configuration --- .forgejo/workflows/verify.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/verify.yml b/.forgejo/workflows/verify.yml index e379168033..f175fd08f6 100644 --- a/.forgejo/workflows/verify.yml +++ b/.forgejo/workflows/verify.yml @@ -49,7 +49,8 @@ jobs: image: linux-mingw container: image: fijxu/build-environments:${{ matrix.image }} - options: -u 1001 + # User 1001 doesn't exists on the images. + # options: -u 1001 steps: - uses: https://code.forgejo.org/actions/checkout@v3 with: From 9339a4dbdedc3a004e0f6c65cee06800bc2956d6 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Sun, 24 Mar 2024 03:19:38 -0300 Subject: [PATCH 07/15] ci: Only run jobs when modifying a file in specific directories. Android job disabled because it fails. I will fix it other day. --- .forgejo/workflows/verify.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/verify.yml b/.forgejo/workflows/verify.yml index d55df43ea2..0e9263fbb4 100644 --- a/.forgejo/workflows/verify.yml +++ b/.forgejo/workflows/verify.yml @@ -9,13 +9,29 @@ name: 'suyu verify' on: pull_request: branches: [ "dev" ] + paths: + - 'src/**' + - 'CMakeModules/**' + - 'dist/**' + - 'externals/**' + - 'vcpkg.json' + paths-ignore: + - 'src/android/**' push: branches: [ "dev" ] + paths: + - 'src/**' + - 'CMakeModules/**' + - 'dist/**' + - 'externals/**' + - 'vcpkg.json' + paths-ignore: + - 'src/android/**' + env: PR_NUMBER: pr${{ github.event.number }} CCACHE_DIR: '.ccache' - jobs: format: name: 'Verify Format' From 77813b232e2d4cd888b6816c4cfc135c14843961 Mon Sep 17 00:00:00 2001 From: Exverge Date: Sun, 24 Mar 2024 15:27:00 +0100 Subject: [PATCH 08/15] =?UTF-8?q?We=20(don=E2=80=99t)=20own=20gradle.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/android/gradlew | 65 +++++++++++++++++++++++++++++++++++++---- src/android/gradlew.bat | 19 ++++++++++-- 2 files changed, 75 insertions(+), 9 deletions(-) diff --git a/src/android/gradlew b/src/android/gradlew index afa1279664..766b044aac 100755 --- a/src/android/gradlew +++ b/src/android/gradlew @@ -1,12 +1,65 @@ -#!/usr/bin/env sh +#!/bin/sh -# SPDX-FileCopyrightText: 2023 yuzu Emulator Project -# SPDX-License-Identifier: GPL-3.0-or-later +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME diff --git a/src/android/gradlew.bat b/src/android/gradlew.bat index 3aa3a7669c..fec6cb2bdd 100644 --- a/src/android/gradlew.bat +++ b/src/android/gradlew.bat @@ -1,7 +1,20 @@ -@rem SPDX-FileCopyrightText: 2023 suyu Emulator Project -@rem SPDX-License-Identifier: GPL-3.0-or-later +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows From a9312c837e91006033bb045da65673cfdce4a58d Mon Sep 17 00:00:00 2001 From: Lucas Clemente Vella Date: Sat, 23 Mar 2024 11:37:50 +0000 Subject: [PATCH 09/15] Searching for Vulkan before QT6, so it doesn't messes with Vulkan. --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b4df91028..6fec995c6d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -374,6 +374,9 @@ if(ENABLE_QT6 AND Qt6_LOCATION) list(APPEND CMAKE_PREFIX_PATH "${Qt6_LOCATION}") endif() +# QT6 searches for Vulkan::Headers, too, so we have to define it before QT6 has a chance to do it. +add_subdirectory(externals) + function(set_suyu_qt_components) # Best practice is to ask for all components at once, so they are from the same version set(SUYU_QT_COMPONENTS2 Core Widgets Concurrent) @@ -709,7 +712,6 @@ if (SUYU_USE_FASTER_LD AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") endif() endif() -add_subdirectory(externals) add_subdirectory(src) # Set suyu project or suyu-cmd project as default StartUp Project in Visual Studio depending on whether QT is enabled or not From 907f9aa6f2a011431d105de9e43887727c8b10d8 Mon Sep 17 00:00:00 2001 From: suyudontsueme Date: Sun, 24 Mar 2024 21:12:15 +0100 Subject: [PATCH 10/15] Rewrite missing keys dialog to be more descriptive Closes #30 --- .forgejo/workflows/verify.yml | 88 ++++++++++++++++++----------------- src/suyu/main.cpp | 9 ++-- 2 files changed, 49 insertions(+), 48 deletions(-) diff --git a/.forgejo/workflows/verify.yml b/.forgejo/workflows/verify.yml index 0e9263fbb4..46fa5f958b 100644 --- a/.forgejo/workflows/verify.yml +++ b/.forgejo/workflows/verify.yml @@ -14,6 +14,7 @@ on: - 'CMakeModules/**' - 'dist/**' - 'externals/**' + - 'CMakeLists.txt' - 'vcpkg.json' paths-ignore: - 'src/android/**' @@ -24,6 +25,7 @@ on: - 'CMakeModules/**' - 'dist/**' - 'externals/**' + - 'CMakeLists.txt' - 'vcpkg.json' paths-ignore: - 'src/android/**' @@ -171,47 +173,47 @@ jobs: # with: # name: ${{ env.INDIVIDUAL_EXE }} # path: ${{ env.INDIVIDUAL_EXE }} - android: - runs-on: ubuntu-latest - needs: format - steps: - - uses: https://code.forgejo.org/actions/checkout@v3 - with: - submodules: recursive - fetch-depth: 0 - - name: set up JDK 17 - uses: https://github.com/actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' - - name: Set up cache - uses: https://code.forgejo.org/actions/cache@v3 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - .ccache - key: ${{ runner.os }}-android-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-android- - - name: Query tag name - uses: https://github.com/olegtarasov/get-tag@v2.1.2 - id: tagName - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y ccache apksigner glslang-dev glslang-tools - - name: Build - run: ./.ci/scripts/android/build.sh - - name: Copy and sign artifacts - env: - ANDROID_KEYSTORE_B64: ${{ secrets.ANDROID_KEYSTORE_B64 }} - ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} - ANDROID_KEYSTORE_PASS: ${{ secrets.ANDROID_KEYSTORE_PASS }} - run: ./.ci/scripts/android/upload.sh - - name: Upload - uses: https://code.forgejo.org/actions/upload-artifact@v3 - with: - name: android - path: artifacts/ + # android: + # runs-on: ubuntu-latest + # needs: format + # steps: + # - uses: https://code.forgejo.org/actions/checkout@v3 + # with: + # submodules: recursive + # fetch-depth: 0 + # - name: set up JDK 17 + # uses: https://github.com/actions/setup-java@v3 + # with: + # java-version: '17' + # distribution: 'temurin' + # - name: Set up cache + # uses: https://code.forgejo.org/actions/cache@v3 + # with: + # path: | + # ~/.gradle/caches + # ~/.gradle/wrapper + # .ccache + # key: ${{ runner.os }}-android-${{ github.sha }} + # restore-keys: | + # ${{ runner.os }}-android- + # - name: Query tag name + # uses: https://github.com/olegtarasov/get-tag@v2.1.2 + # id: tagName + # - name: Install dependencies + # run: | + # sudo apt-get update + # sudo apt-get install -y ccache apksigner glslang-dev glslang-tools + # - name: Build + # run: ./.ci/scripts/android/build.sh + # - name: Copy and sign artifacts + # env: + # ANDROID_KEYSTORE_B64: ${{ secrets.ANDROID_KEYSTORE_B64 }} + # ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} + # ANDROID_KEYSTORE_PASS: ${{ secrets.ANDROID_KEYSTORE_PASS }} + # run: ./.ci/scripts/android/upload.sh + # - name: Upload + # uses: https://code.forgejo.org/actions/upload-artifact@v3 + # with: + # name: android + # path: artifacts/ diff --git a/src/suyu/main.cpp b/src/suyu/main.cpp index fc0028b45d..9a3ee7f662 100644 --- a/src/suyu/main.cpp +++ b/src/suyu/main.cpp @@ -1756,11 +1756,10 @@ bool GMainWindow::LoadROM(const QString& filename, Service::AM::FrontendAppletPa } if (!ContentManager::AreKeysPresent()) { - QMessageBox::warning(this, tr("Derivation Components Missing"), - tr("Encryption keys are missing. " - "In order to use this emulator, " - "you need to provide your own encryption keys " - "in order to play them.")); + QMessageBox::warning( + this, tr("Encryption Keys Missing"), + tr("In order to use suyu you need to provide your own encryption keys. " + "You can install them by going to Tools -> Install encryption keys.")); return false; } } From 201bff1731aa8bae76be72e7746e0a0ba38df8df Mon Sep 17 00:00:00 2001 From: Fijxu Date: Sun, 24 Mar 2024 20:04:45 -0300 Subject: [PATCH 11/15] Add missing REUSE files and directories --- .forgejo/workflows/{ci.yml => reuse.yml} | 0 .forgejo/workflows/verify.yml | 4 +- .reuse/dep5 | 23 +- LICENSES/CC-BY-NC-SA-4.0.txt | 438 +++++++++++++++++++++++ dist/readme/suyu__Logo-Pill.svg | 5 + src/android/gradlew | 65 +--- src/android/gradlew.bat | 19 +- 7 files changed, 476 insertions(+), 78 deletions(-) rename .forgejo/workflows/{ci.yml => reuse.yml} (100%) create mode 100644 LICENSES/CC-BY-NC-SA-4.0.txt diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/reuse.yml similarity index 100% rename from .forgejo/workflows/ci.yml rename to .forgejo/workflows/reuse.yml diff --git a/.forgejo/workflows/verify.yml b/.forgejo/workflows/verify.yml index 46fa5f958b..47b28725fb 100644 --- a/.forgejo/workflows/verify.yml +++ b/.forgejo/workflows/verify.yml @@ -62,8 +62,8 @@ jobs: image: linux-fresh - type: linux image: linux-fresh - - type: windows - image: linux-mingw + # - type: windows + # image: linux-mingw container: fijxu/build-environments:${{ matrix.image }} # User 1001 doesn't exists on the images. # options: -u 1001 diff --git a/.reuse/dep5 b/.reuse/dep5 index 926ddd097d..b39bc42fb7 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -9,7 +9,8 @@ Files: dist/english_plurals/* dist/qt_themes/*/icons/48x48/sd_card.png dist/qt_themes/*/icons/index.theme dist/qt_themes/default/style.qss -Copyright: suyu Emulator Project +Copyright: yuzu Emulator Project + suyu Emulator Project License: GPL-2.0-or-later Files: dist/qt_themes/default/icons/256x256/suyu.png @@ -159,3 +160,23 @@ License: BSD-3-Clause Files: src/android/app/debug.keystore Copyright: 2023 yuzu Emulator Project License: GPL-3.0-or-later + +Files: .github-archive/ISSUE_TEMPLATE/* +Copyright: 2022 yuzu Emulator Project +License: GPL-2.0-or-later + +Files: .forgejo/ISSUE_TEMPLATE/* +Copyright: 2024 suyu Emulator Project +License: GPL-3.0-or-later + +Files: .gitea/ISSUE_TEMPLATE/* +Copyright: 2024 suyu Emulator Project +License: GPL-3.0-or-later + +Files: .gitlab-ci.yml +Copyright: 2024 suyu Emulator Project +License: GPL-3.0-or-later + +Files: dist/icns_generator.sh +Copyright: 2024 suyu Emulator Project +License: GPL-3.0-or-later diff --git a/LICENSES/CC-BY-NC-SA-4.0.txt b/LICENSES/CC-BY-NC-SA-4.0.txt new file mode 100644 index 0000000000..7cdbe0b482 --- /dev/null +++ b/LICENSES/CC-BY-NC-SA-4.0.txt @@ -0,0 +1,438 @@ +Attribution-NonCommercial-ShareAlike 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International +Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution-NonCommercial-ShareAlike 4.0 International Public License +("Public License"). To the extent this Public License may be +interpreted as a contract, You are granted the Licensed Rights in +consideration of Your acceptance of these terms and conditions, and the +Licensor grants You such rights in consideration of benefits the +Licensor receives from making the Licensed Material available under +these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. BY-NC-SA Compatible License means a license listed at + creativecommons.org/compatiblelicenses, approved by Creative + Commons as essentially the equivalent of this Public License. + + d. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + e. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + f. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + g. License Elements means the license attributes listed in the name + of a Creative Commons Public License. The License Elements of this + Public License are Attribution, NonCommercial, and ShareAlike. + + h. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + i. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + j. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + k. NonCommercial means not primarily intended for or directed towards + commercial advantage or monetary compensation. For purposes of + this Public License, the exchange of the Licensed Material for + other material subject to Copyright and Similar Rights by digital + file-sharing or similar means is NonCommercial provided there is + no payment of monetary compensation in connection with the + exchange. + + l. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + m. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + n. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part, for NonCommercial purposes only; and + + b. produce, reproduce, and Share Adapted Material for + NonCommercial purposes only. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. Additional offer from the Licensor -- Adapted Material. + Every recipient of Adapted Material from You + automatically receives an offer from the Licensor to + exercise the Licensed Rights in the Adapted Material + under the conditions of the Adapter's License You apply. + + c. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties, including when + the Licensed Material is used other than for NonCommercial + purposes. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + b. ShareAlike. + + In addition to the conditions in Section 3(a), if You Share + Adapted Material You produce, the following conditions also apply. + + 1. The Adapter's License You apply must be a Creative Commons + license with the same License Elements, this version or + later, or a BY-NC-SA Compatible License. + + 2. You must include the text of, or the URI or hyperlink to, the + Adapter's License You apply. You may satisfy this condition + in any reasonable manner based on the medium, means, and + context in which You Share Adapted Material. + + 3. You may not offer or impose any additional or different terms + or conditions on, or apply any Effective Technological + Measures to, Adapted Material that restrict exercise of the + rights granted under the Adapter's License You apply. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database for NonCommercial purposes + only; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material, + including for purposes of Section 3(b); and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. + diff --git a/dist/readme/suyu__Logo-Pill.svg b/dist/readme/suyu__Logo-Pill.svg index e34ab989c8..673732798a 100644 --- a/dist/readme/suyu__Logo-Pill.svg +++ b/dist/readme/suyu__Logo-Pill.svg @@ -1,3 +1,8 @@ + + diff --git a/src/android/gradlew b/src/android/gradlew index 766b044aac..afa1279664 100755 --- a/src/android/gradlew +++ b/src/android/gradlew @@ -1,65 +1,12 @@ -#!/bin/sh +#!/usr/bin/env sh -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# +# SPDX-FileCopyrightText: 2023 yuzu Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later ############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# +## +## Gradle start up script for UN*X +## ############################################################################## # Attempt to set APP_HOME diff --git a/src/android/gradlew.bat b/src/android/gradlew.bat index fec6cb2bdd..be152d1088 100644 --- a/src/android/gradlew.bat +++ b/src/android/gradlew.bat @@ -1,20 +1,7 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +@rem SPDX-FileCopyrightText: 2023 yuzu Emulator Project +@rem SPDX-License-Identifier: GPL-3.0-or-later -@if "%DEBUG%"=="" @echo off +@if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows From bbe9f86554b3deb83b32a13a9f34a5917e003509 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Sun, 24 Mar 2024 21:01:56 -0300 Subject: [PATCH 12/15] ci: Execute CI if verify.yml has been changed --- .forgejo/workflows/verify.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.forgejo/workflows/verify.yml b/.forgejo/workflows/verify.yml index 47b28725fb..d250c136b7 100644 --- a/.forgejo/workflows/verify.yml +++ b/.forgejo/workflows/verify.yml @@ -27,6 +27,7 @@ on: - 'externals/**' - 'CMakeLists.txt' - 'vcpkg.json' + - '.forgejo/workflows/verify.yml' paths-ignore: - 'src/android/**' From ba411a17e0ada259085a3d9190b4698eeb048569 Mon Sep 17 00:00:00 2001 From: zqpvr01 Date: Mon, 25 Mar 2024 01:14:35 +0100 Subject: [PATCH 13/15] change application id when we enable discord rpc for use this will change the yuzu icon to suyu. --- src/suyu/discord_impl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/suyu/discord_impl.cpp b/src/suyu/discord_impl.cpp index f5a6448d82..b72b9e41e3 100644 --- a/src/suyu/discord_impl.cpp +++ b/src/suyu/discord_impl.cpp @@ -24,7 +24,8 @@ DiscordImpl::DiscordImpl(Core::System& system_) : system{system_} { DiscordEventHandlers handlers{}; // The number is the client ID for suyu, it's used for images and the // application name - Discord_Initialize("712465656758665259", &handlers, 1, nullptr); + // NOTE: This application is owned by million1156 (million@alyocord.com) + Discord_Initialize("1221314350216646828", &handlers, 1, nullptr); } DiscordImpl::~DiscordImpl() { From 0c2bdc6f61cb9016ebcfad0cef1560631c213462 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Sun, 24 Mar 2024 22:25:08 -0300 Subject: [PATCH 14/15] Fix wrong URL on DownloadExternals. Change Clang and GCC executables on CI scripts --- .ci/scripts/clang/docker.sh | 12 ++++++++---- .ci/scripts/linux/docker.sh | 6 +++--- CMakeLists.txt | 4 ++-- CMakeModules/DownloadExternals.cmake | 8 ++++---- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.ci/scripts/clang/docker.sh b/.ci/scripts/clang/docker.sh index 7b5c6ec4df..57fbb97544 100755 --- a/.ci/scripts/clang/docker.sh +++ b/.ci/scripts/clang/docker.sh @@ -1,19 +1,22 @@ #!/bin/bash -ex # SPDX-FileCopyrightText: 2021 yuzu Emulator Project +# SPDX-FileCopyrightText: 2024 suyu Emulator Project # SPDX-License-Identifier: GPL-2.0-or-later # Exit on error, rather than continuing with the rest of the script. set -e -ccache -s +ccache -sv mkdir build || true && cd build cmake .. \ -DCMAKE_BUILD_TYPE=Release \ + -DSUYU_USE_PRECOMPILED_HEADERS=OFF \ + -DDYNARMIC_USE_PRECOMPILED_HEADERS=OFF \ -DCMAKE_CXX_FLAGS="-march=x86-64-v2" \ - -DCMAKE_CXX_COMPILER=/usr/lib/ccache/clang++ \ - -DCMAKE_C_COMPILER=/usr/lib/ccache/clang \ + -DCMAKE_CXX_COMPILER=/usr/bin/clang++ \ + -DCMAKE_C_COMPILER=/usr/bin/clang \ -DCMAKE_INSTALL_PREFIX="/usr" \ -DDISPLAY_VERSION=$1 \ -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \ @@ -22,11 +25,12 @@ cmake .. \ -DSUYU_CRASH_DUMPS=ON \ -DSUYU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} \ -DSUYU_USE_BUNDLED_FFMPEG=ON \ + -DSUYU_USE_FASTER_LD=ON \ -GNinja ninja -ccache -s +ccache -sv ctest -VV -C Release diff --git a/.ci/scripts/linux/docker.sh b/.ci/scripts/linux/docker.sh index b6b8efeea4..a7a0eb0b00 100755 --- a/.ci/scripts/linux/docker.sh +++ b/.ci/scripts/linux/docker.sh @@ -15,8 +15,8 @@ cmake .. \ -DSUYU_USE_PRECOMPILED_HEADERS=OFF \ -DDYNARMIC_USE_PRECOMPILED_HEADERS=OFF \ -DCMAKE_CXX_FLAGS="-march=x86-64-v2" \ - -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ \ - -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc \ + -DCMAKE_CXX_COMPILER=/usr/bin/g++ \ + -DCMAKE_C_COMPILER=/usr/bin/gcc \ -DCMAKE_INSTALL_PREFIX="/usr" \ -DDISPLAY_VERSION=$1 \ -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=OFF \ @@ -24,7 +24,7 @@ cmake .. \ -DUSE_DISCORD_PRESENCE=ON \ -DSUYU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} \ -DSUYU_USE_BUNDLED_FFMPEG=ON \ - -DSUYU_ENABLE_LTO=ON \ + -DSUYU_ENABLE_LTO=OFF \ -DSUYU_CRASH_DUMPS=ON \ -DSUYU_USE_FASTER_LD=ON \ -GNinja diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fec995c6d..84132e47d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -132,7 +132,7 @@ if (SUYU_USE_BUNDLED_VCPKG) set(VCPKG_DOWNLOADS_PATH ${PROJECT_SOURCE_DIR}/externals/vcpkg/downloads) set(NASM_VERSION "2.16.01") set(NASM_DESTINATION_PATH ${VCPKG_DOWNLOADS_PATH}/nasm-${NASM_VERSION}-win64.zip) - set(NASM_DOWNLOAD_URL "https://gitlab.com/suyu-emu/ext-windows-bin/raw/master/nasm/nasm-${NASM_VERSION}-win64.zip") + set(NASM_DOWNLOAD_URL "https://git.suyu.dev/suyu/ext-windows-bin/raw/branch/master/nasm/nasm-${NASM_VERSION}-win64.zip") if (NOT EXISTS ${NASM_DESTINATION_PATH}) file(DOWNLOAD ${NASM_DOWNLOAD_URL} ${NASM_DESTINATION_PATH} SHOW_PROGRESS STATUS NASM_STATUS) @@ -632,7 +632,7 @@ if (NOT CLANG_FORMAT) message(STATUS "Clang format not found! Downloading...") set(CLANG_FORMAT "${PROJECT_BINARY_DIR}/externals/clang-format${CLANG_FORMAT_POSTFIX}.exe") file(DOWNLOAD - https://gitlab.com/suyu-emu/ext-windows-bin/raw/master/clang-format${CLANG_FORMAT_POSTFIX}.exe + https://git.suyu.dev/suyu/ext-windows-bin/raw/branch/master/clang-format${CLANG_FORMAT_POSTFIX}.exe "${CLANG_FORMAT}" SHOW_PROGRESS STATUS DOWNLOAD_SUCCESS) if (NOT DOWNLOAD_SUCCESS EQUAL 0) diff --git a/CMakeModules/DownloadExternals.cmake b/CMakeModules/DownloadExternals.cmake index 2498773e61..858bce8771 100644 --- a/CMakeModules/DownloadExternals.cmake +++ b/CMakeModules/DownloadExternals.cmake @@ -7,21 +7,21 @@ # prefix_var: name of a variable which will be set with the path to the extracted contents function(download_bundled_external remote_path lib_name prefix_var) -set(package_base_url "https://git.suyu.dev/suyu") +set(package_base_url "https://git.suyu.dev/suyu/") set(package_repo "no_platform") set(package_extension "no_platform") set(package_head "?ref_type=heads") if (WIN32) - set(package_repo "ext-windows-bin/-/raw/master/") + set(package_repo "ext-windows-bin/raw/branch/master/") set(package_extension ".7z") elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - set(package_repo "ext-linux-bin/-/raw/main/") + set(package_repo "ext-linux-bin/raw/branch/main/") set(package_extension ".tar.xz") # elseif (APPLE) # set(package_repo "ext-osx-bin/-/raw/main/") # set(package_extension ".dmg") elseif (ANDROID) - set(package_repo "ext-android-bin/-/raw/main/") + set(package_repo "ext-android-bin/raw/branch/main/") set(package_extension ".tar.xz") else() message(FATAL_ERROR "No package available for this platform") From d4375a21ef2114ca5689e277ca1e53eb406c5f8f Mon Sep 17 00:00:00 2001 From: Fijxu Date: Mon, 25 Mar 2024 00:11:11 -0300 Subject: [PATCH 15/15] Revert a9312c837e . Use proper GCC binary location and CCACHE changes in the CI --- .ci/scripts/linux/docker.sh | 8 ++++---- .forgejo/workflows/verify.yml | 5 ++--- CMakeLists.txt | 3 +-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.ci/scripts/linux/docker.sh b/.ci/scripts/linux/docker.sh index a7a0eb0b00..82432bd835 100755 --- a/.ci/scripts/linux/docker.sh +++ b/.ci/scripts/linux/docker.sh @@ -6,7 +6,7 @@ # Exit on error, rather than continuing with the rest of the script. set -e -ccache -s +ccache -sv mkdir build || true && cd build cmake .. \ @@ -15,8 +15,8 @@ cmake .. \ -DSUYU_USE_PRECOMPILED_HEADERS=OFF \ -DDYNARMIC_USE_PRECOMPILED_HEADERS=OFF \ -DCMAKE_CXX_FLAGS="-march=x86-64-v2" \ - -DCMAKE_CXX_COMPILER=/usr/bin/g++ \ - -DCMAKE_C_COMPILER=/usr/bin/gcc \ + -DCMAKE_CXX_COMPILER=/usr/local/bin/g++ \ + -DCMAKE_C_COMPILER=/usr/local/bin/gcc \ -DCMAKE_INSTALL_PREFIX="/usr" \ -DDISPLAY_VERSION=$1 \ -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=OFF \ @@ -31,7 +31,7 @@ cmake .. \ ninja -ccache -s +ccache -sv ctest -VV -C Release diff --git a/.forgejo/workflows/verify.yml b/.forgejo/workflows/verify.yml index d250c136b7..1d17c43a2b 100644 --- a/.forgejo/workflows/verify.yml +++ b/.forgejo/workflows/verify.yml @@ -33,7 +33,6 @@ on: env: PR_NUMBER: pr${{ github.event.number }} - CCACHE_DIR: '.ccache' jobs: format: @@ -77,13 +76,13 @@ jobs: uses: https://code.forgejo.org/actions/cache@v3 id: ccache-restore with: - path: .ccache + path: ~/.ccache key: ${{ runner.os }}-${{ matrix.type }}-${{ github.sha }} restore-keys: | ${{ runner.os }}-${{ matrix.type }}- - name: Create ccache directory if: steps.ccache-restore.outputs.cache-hit != 'true' - run: mkdir -p .ccache + run: mkdir -p ~/.ccache - name: Build run: ./.ci/scripts/${{ matrix.type }}/docker.sh env: diff --git a/CMakeLists.txt b/CMakeLists.txt index 84132e47d1..42e8615e57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -374,8 +374,6 @@ if(ENABLE_QT6 AND Qt6_LOCATION) list(APPEND CMAKE_PREFIX_PATH "${Qt6_LOCATION}") endif() -# QT6 searches for Vulkan::Headers, too, so we have to define it before QT6 has a chance to do it. -add_subdirectory(externals) function(set_suyu_qt_components) # Best practice is to ask for all components at once, so they are from the same version @@ -712,6 +710,7 @@ if (SUYU_USE_FASTER_LD AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") endif() endif() +add_subdirectory(externals) add_subdirectory(src) # Set suyu project or suyu-cmd project as default StartUp Project in Visual Studio depending on whether QT is enabled or not