1
0
Fork 0
forked from suyu/suyu

Compare commits

..

1 commit

Author SHA1 Message Date
41ebc0b06a
fix: retrack application when guest applet is closed 2024-03-24 19:53:45 -04:00
18 changed files with 138 additions and 189 deletions

View file

@ -1,7 +1,6 @@
#!/bin/bash -ex #!/bin/bash -ex
# SPDX-FileCopyrightText: 2023 yuzu Emulator Project # SPDX-FileCopyrightText: 2023 yuzu Emulator Project
# SPDX-FileCopyrightText: 2024 suyu Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
export NDK_CCACHE="$(which ccache)" export NDK_CCACHE="$(which ccache)"
@ -10,7 +9,7 @@ ccache -s
BUILD_FLAVOR="mainline" BUILD_FLAVOR="mainline"
BUILD_TYPE="release" BUILD_TYPE="release"
if [ "${GITHUB_REPOSITORY}" == "suyu/suyu" ]; then if [ "${GITHUB_REPOSITORY}" == "suyu-emu/suyu" ]; then
BUILD_TYPE="relWithDebInfo" BUILD_TYPE="relWithDebInfo"
fi fi

View file

@ -11,7 +11,7 @@ BUILD_FLAVOR="mainline"
BUILD_TYPE_LOWER="release" BUILD_TYPE_LOWER="release"
BUILD_TYPE_UPPER="Release" BUILD_TYPE_UPPER="Release"
if [ "${GITHUB_REPOSITORY}" == "suyu/suyu" ]; then if [ "${GITHUB_REPOSITORY}" == "suyu-emu/suyu" ]; then
BUILD_TYPE_LOWER="relWithDebInfo" BUILD_TYPE_LOWER="relWithDebInfo"
BUILD_TYPE_UPPER="RelWithDebInfo" BUILD_TYPE_UPPER="RelWithDebInfo"
fi fi

View file

@ -1,22 +1,19 @@
#!/bin/bash -ex #!/bin/bash -ex
# SPDX-FileCopyrightText: 2021 yuzu Emulator Project # SPDX-FileCopyrightText: 2021 yuzu Emulator Project
# SPDX-FileCopyrightText: 2024 suyu Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later # SPDX-License-Identifier: GPL-2.0-or-later
# Exit on error, rather than continuing with the rest of the script. # Exit on error, rather than continuing with the rest of the script.
set -e set -e
ccache -sv ccache -s
mkdir build || true && cd build mkdir build || true && cd build
cmake .. \ cmake .. \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DSUYU_USE_PRECOMPILED_HEADERS=OFF \
-DDYNARMIC_USE_PRECOMPILED_HEADERS=OFF \
-DCMAKE_CXX_FLAGS="-march=x86-64-v2" \ -DCMAKE_CXX_FLAGS="-march=x86-64-v2" \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++ \ -DCMAKE_CXX_COMPILER=/usr/lib/ccache/clang++ \
-DCMAKE_C_COMPILER=/usr/bin/clang \ -DCMAKE_C_COMPILER=/usr/lib/ccache/clang \
-DCMAKE_INSTALL_PREFIX="/usr" \ -DCMAKE_INSTALL_PREFIX="/usr" \
-DDISPLAY_VERSION=$1 \ -DDISPLAY_VERSION=$1 \
-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \ -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \
@ -25,12 +22,11 @@ cmake .. \
-DSUYU_CRASH_DUMPS=ON \ -DSUYU_CRASH_DUMPS=ON \
-DSUYU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} \ -DSUYU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} \
-DSUYU_USE_BUNDLED_FFMPEG=ON \ -DSUYU_USE_BUNDLED_FFMPEG=ON \
-DSUYU_USE_FASTER_LD=ON \
-GNinja -GNinja
ninja ninja
ccache -sv ccache -s
ctest -VV -C Release ctest -VV -C Release

View file

@ -6,7 +6,7 @@
# Exit on error, rather than continuing with the rest of the script. # Exit on error, rather than continuing with the rest of the script.
set -e set -e
ccache -sv ccache -s
mkdir build || true && cd build mkdir build || true && cd build
cmake .. \ cmake .. \
@ -15,8 +15,8 @@ cmake .. \
-DSUYU_USE_PRECOMPILED_HEADERS=OFF \ -DSUYU_USE_PRECOMPILED_HEADERS=OFF \
-DDYNARMIC_USE_PRECOMPILED_HEADERS=OFF \ -DDYNARMIC_USE_PRECOMPILED_HEADERS=OFF \
-DCMAKE_CXX_FLAGS="-march=x86-64-v2" \ -DCMAKE_CXX_FLAGS="-march=x86-64-v2" \
-DCMAKE_CXX_COMPILER=/usr/local/bin/g++ \ -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ \
-DCMAKE_C_COMPILER=/usr/local/bin/gcc \ -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc \
-DCMAKE_INSTALL_PREFIX="/usr" \ -DCMAKE_INSTALL_PREFIX="/usr" \
-DDISPLAY_VERSION=$1 \ -DDISPLAY_VERSION=$1 \
-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=OFF \ -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=OFF \
@ -24,14 +24,14 @@ cmake .. \
-DUSE_DISCORD_PRESENCE=ON \ -DUSE_DISCORD_PRESENCE=ON \
-DSUYU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} \ -DSUYU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} \
-DSUYU_USE_BUNDLED_FFMPEG=ON \ -DSUYU_USE_BUNDLED_FFMPEG=ON \
-DSUYU_ENABLE_LTO=OFF \ -DSUYU_ENABLE_LTO=ON \
-DSUYU_CRASH_DUMPS=ON \ -DSUYU_CRASH_DUMPS=ON \
-DSUYU_USE_FASTER_LD=ON \ -DSUYU_USE_FASTER_LD=ON \
-GNinja -GNinja
ninja ninja
ccache -sv ccache -s
ctest -VV -C Release ctest -VV -C Release

View file

@ -16,8 +16,8 @@ on:
- 'externals/**' - 'externals/**'
- 'CMakeLists.txt' - 'CMakeLists.txt'
- 'vcpkg.json' - 'vcpkg.json'
# paths-ignore: paths-ignore:
# - 'src/android/**' - 'src/android/**'
push: push:
branches: [ "dev" ] branches: [ "dev" ]
paths: paths:
@ -27,13 +27,12 @@ on:
- 'externals/**' - 'externals/**'
- 'CMakeLists.txt' - 'CMakeLists.txt'
- 'vcpkg.json' - 'vcpkg.json'
- '.forgejo/workflows/verify.yml' paths-ignore:
- '.ci/**' - 'src/android/**'
# paths-ignore:
# - 'src/android/**'
env: env:
PR_NUMBER: pr${{ github.event.number }} PR_NUMBER: pr${{ github.event.number }}
CCACHE_DIR: '.ccache'
jobs: jobs:
format: format:
@ -77,13 +76,13 @@ jobs:
uses: https://code.forgejo.org/actions/cache@v3 uses: https://code.forgejo.org/actions/cache@v3
id: ccache-restore id: ccache-restore
with: with:
path: ~/.ccache path: .ccache
key: ${{ runner.os }}-${{ matrix.type }}-${{ github.sha }} key: ${{ runner.os }}-${{ matrix.type }}-${{ github.sha }}
restore-keys: | restore-keys: |
${{ runner.os }}-${{ matrix.type }}- ${{ runner.os }}-${{ matrix.type }}-
- name: Create ccache directory - name: Create ccache directory
if: steps.ccache-restore.outputs.cache-hit != 'true' if: steps.ccache-restore.outputs.cache-hit != 'true'
run: mkdir -p ~/.ccache run: mkdir -p .ccache
- name: Build - name: Build
run: ./.ci/scripts/${{ matrix.type }}/docker.sh run: ./.ci/scripts/${{ matrix.type }}/docker.sh
env: env:
@ -174,44 +173,47 @@ jobs:
# with: # with:
# name: ${{ env.INDIVIDUAL_EXE }} # name: ${{ env.INDIVIDUAL_EXE }}
# path: ${{ env.INDIVIDUAL_EXE }} # path: ${{ env.INDIVIDUAL_EXE }}
android: # android:
runs-on: ubuntu-latest # runs-on: ubuntu-latest
container: fijxu/build-environments:android # needs: format
needs: format # steps:
steps: # - uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/checkout@v3 # with:
with: # submodules: recursive
submodules: recursive # fetch-depth: 0
fetch-depth: 0 # - name: set up JDK 17
- name: set up JDK 17 # uses: https://github.com/actions/setup-java@v3
uses: https://github.com/actions/setup-java@v3 # with:
with: # java-version: '17'
java-version: '17' # distribution: 'temurin'
distribution: 'temurin' # - name: Set up cache
- name: Set up cache # uses: https://code.forgejo.org/actions/cache@v3
uses: https://code.forgejo.org/actions/cache@v3 # with:
with: # path: |
path: | # ~/.gradle/caches
~/.gradle/caches # ~/.gradle/wrapper
~/.gradle/wrapper # .ccache
~/.ccache # key: ${{ runner.os }}-android-${{ github.sha }}
key: ${{ runner.os }}-android-${{ github.sha }} # restore-keys: |
restore-keys: | # ${{ runner.os }}-android-
${{ runner.os }}-android- # - name: Query tag name
- name: Query tag name # uses: https://github.com/olegtarasov/get-tag@v2.1.2
uses: https://github.com/olegtarasov/get-tag@v2.1.2 # id: tagName
id: tagName # - name: Install dependencies
- name: Build # run: |
run: ./.ci/scripts/android/build.sh # sudo apt-get update
- name: Copy and sign artifacts # sudo apt-get install -y ccache apksigner glslang-dev glslang-tools
env: # - name: Build
ANDROID_KEYSTORE_B64: ${{ secrets.ANDROID_KEYSTORE_B64 }} # run: ./.ci/scripts/android/build.sh
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} # - name: Copy and sign artifacts
ANDROID_KEYSTORE_PASS: ${{ secrets.ANDROID_KEYSTORE_PASS }} # env:
run: ./.ci/scripts/android/upload.sh # ANDROID_KEYSTORE_B64: ${{ secrets.ANDROID_KEYSTORE_B64 }}
- name: Upload # ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
uses: https://code.forgejo.org/actions/upload-artifact@v3 # ANDROID_KEYSTORE_PASS: ${{ secrets.ANDROID_KEYSTORE_PASS }}
with: # run: ./.ci/scripts/android/upload.sh
name: android # - name: Upload
path: artifacts/ # uses: https://code.forgejo.org/actions/upload-artifact@v3
# with:
# name: android
# path: artifacts/

View file

@ -132,7 +132,7 @@ if (SUYU_USE_BUNDLED_VCPKG)
set(VCPKG_DOWNLOADS_PATH ${PROJECT_SOURCE_DIR}/externals/vcpkg/downloads) set(VCPKG_DOWNLOADS_PATH ${PROJECT_SOURCE_DIR}/externals/vcpkg/downloads)
set(NASM_VERSION "2.16.01") set(NASM_VERSION "2.16.01")
set(NASM_DESTINATION_PATH ${VCPKG_DOWNLOADS_PATH}/nasm-${NASM_VERSION}-win64.zip) set(NASM_DESTINATION_PATH ${VCPKG_DOWNLOADS_PATH}/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") set(NASM_DOWNLOAD_URL "https://gitlab.com/suyu-emu/ext-windows-bin/raw/master/nasm/nasm-${NASM_VERSION}-win64.zip")
if (NOT EXISTS ${NASM_DESTINATION_PATH}) if (NOT EXISTS ${NASM_DESTINATION_PATH})
file(DOWNLOAD ${NASM_DOWNLOAD_URL} ${NASM_DESTINATION_PATH} SHOW_PROGRESS STATUS NASM_STATUS) file(DOWNLOAD ${NASM_DOWNLOAD_URL} ${NASM_DESTINATION_PATH} SHOW_PROGRESS STATUS NASM_STATUS)
@ -374,6 +374,8 @@ if(ENABLE_QT6 AND Qt6_LOCATION)
list(APPEND CMAKE_PREFIX_PATH "${Qt6_LOCATION}") list(APPEND CMAKE_PREFIX_PATH "${Qt6_LOCATION}")
endif() 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) function(set_suyu_qt_components)
# Best practice is to ask for all components at once, so they are from the same version # Best practice is to ask for all components at once, so they are from the same version
@ -630,7 +632,7 @@ if (NOT CLANG_FORMAT)
message(STATUS "Clang format not found! Downloading...") message(STATUS "Clang format not found! Downloading...")
set(CLANG_FORMAT "${PROJECT_BINARY_DIR}/externals/clang-format${CLANG_FORMAT_POSTFIX}.exe") set(CLANG_FORMAT "${PROJECT_BINARY_DIR}/externals/clang-format${CLANG_FORMAT_POSTFIX}.exe")
file(DOWNLOAD file(DOWNLOAD
https://git.suyu.dev/suyu/ext-windows-bin/raw/branch/master/clang-format${CLANG_FORMAT_POSTFIX}.exe https://gitlab.com/suyu-emu/ext-windows-bin/raw/master/clang-format${CLANG_FORMAT_POSTFIX}.exe
"${CLANG_FORMAT}" SHOW_PROGRESS "${CLANG_FORMAT}" SHOW_PROGRESS
STATUS DOWNLOAD_SUCCESS) STATUS DOWNLOAD_SUCCESS)
if (NOT DOWNLOAD_SUCCESS EQUAL 0) if (NOT DOWNLOAD_SUCCESS EQUAL 0)
@ -710,7 +712,6 @@ if (SUYU_USE_FASTER_LD AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
endif() endif()
endif() endif()
add_subdirectory(externals)
add_subdirectory(src) 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 # Set suyu project or suyu-cmd project as default StartUp Project in Visual Studio depending on whether QT is enabled or not

View file

@ -7,21 +7,21 @@
# prefix_var: name of a variable which will be set with the path to the extracted contents # 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) 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_repo "no_platform")
set(package_extension "no_platform") set(package_extension "no_platform")
set(package_head "?ref_type=heads") set(package_head "?ref_type=heads")
if (WIN32) if (WIN32)
set(package_repo "ext-windows-bin/raw/branch/master/") set(package_repo "ext-windows-bin/-/raw/master/")
set(package_extension ".7z") set(package_extension ".7z")
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(package_repo "ext-linux-bin/raw/branch/main/") set(package_repo "ext-linux-bin/-/raw/main/")
set(package_extension ".tar.xz") set(package_extension ".tar.xz")
# elseif (APPLE) # elseif (APPLE)
# set(package_repo "ext-osx-bin/-/raw/main/") # set(package_repo "ext-osx-bin/-/raw/main/")
# set(package_extension ".dmg") # set(package_extension ".dmg")
elseif (ANDROID) elseif (ANDROID)
set(package_repo "ext-android-bin/raw/branch/main/") set(package_repo "ext-android-bin/-/raw/main/")
set(package_extension ".tar.xz") set(package_extension ".tar.xz")
else() else()
message(FATAL_ERROR "No package available for this platform") message(FATAL_ERROR "No package available for this platform")

View file

@ -57,8 +57,6 @@ You can also contact any of the developers on Discord to learn more about the cu
* __macOS__: [Releases](https://git.suyu.dev/suyu/suyu/releases) * __macOS__: [Releases](https://git.suyu.dev/suyu/suyu/releases)
* __Android__: [Releases](https://git.suyu.dev/suyu/suyu/releases) * __Android__: [Releases](https://git.suyu.dev/suyu/suyu/releases)
If you want daily builds then go here. https://git.suyu.dev/suyu/suyu/actions
We have official builds [here.](https://git.suyu.dev/suyu/suyu/releases) If any website or person is claiming to have a build for suyu, take that with a grain of salt. We have official builds [here.](https://git.suyu.dev/suyu/suyu/releases) If any website or person is claiming to have a build for suyu, take that with a grain of salt.
## Building ## Building

View file

@ -241,8 +241,6 @@ abstract class SettingsItem(
IntSetting.FSR_SHARPENING_SLIDER, IntSetting.FSR_SHARPENING_SLIDER,
titleId = R.string.fsr_sharpness, titleId = R.string.fsr_sharpness,
descriptionId = R.string.fsr_sharpness_description, descriptionId = R.string.fsr_sharpness_description,
min = 0,
max = 200,
units = "%" units = "%"
) )
) )
@ -329,8 +327,6 @@ abstract class SettingsItem(
ByteSetting.AUDIO_VOLUME, ByteSetting.AUDIO_VOLUME,
titleId = R.string.audio_volume, titleId = R.string.audio_volume,
descriptionId = R.string.audio_volume_description, descriptionId = R.string.audio_volume_description,
min = 0,
max = 120,
units = "%" units = "%"
) )
) )

View file

@ -142,7 +142,6 @@
<item>@string/ratio_force_four_three</item> <item>@string/ratio_force_four_three</item>
<item>@string/ratio_force_twenty_one_nine</item> <item>@string/ratio_force_twenty_one_nine</item>
<item>@string/ratio_force_sixteen_ten</item> <item>@string/ratio_force_sixteen_ten</item>
<item>@string/ratio_force_thirty_two_nine</item>
<item>@string/ratio_stretch</item> <item>@string/ratio_stretch</item>
</string-array> </string-array>
@ -152,7 +151,6 @@
<item>2</item> <item>2</item>
<item>3</item> <item>3</item>
<item>4</item> <item>4</item>
<item>5</item>
</integer-array> </integer-array>
<string-array name="rendererScalingFilterNames"> <string-array name="rendererScalingFilterNames">

View file

@ -601,7 +601,6 @@
<string name="ratio_force_four_three">Force 4:3</string> <string name="ratio_force_four_three">Force 4:3</string>
<string name="ratio_force_twenty_one_nine">Force 21:9</string> <string name="ratio_force_twenty_one_nine">Force 21:9</string>
<string name="ratio_force_sixteen_ten">Force 16:10</string> <string name="ratio_force_sixteen_ten">Force 16:10</string>
<string name="ratio_force_thirty_two_nine">Force 32:9</string>
<string name="ratio_stretch">Stretch to window</string> <string name="ratio_stretch">Stretch to window</string>
<!-- CPU Backend --> <!-- CPU Backend -->

View file

@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2024 suyu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include "common/settings.h" #include "common/settings.h"
@ -335,4 +336,8 @@ void AppletManager::SetWindowSystem(WindowSystem* window_system) {
applet->process->Run(); applet->process->Run();
} }
void AppletManager::ReTrackApplication(std::shared_ptr<Applet> applet) {
m_window_system->RequestApplicationToGetForeground();
}
} // namespace Service::AM } // namespace Service::AM

View file

@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2024 suyu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#pragma once #pragma once
@ -46,6 +47,7 @@ public:
public: public:
void SetWindowSystem(WindowSystem* window_system); void SetWindowSystem(WindowSystem* window_system);
void ReTrackApplication(std::shared_ptr<Applet> applet);
private: private:
Core::System& m_system; Core::System& m_system;

View file

@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2024 suyu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include "core/hle/service/am/applet_data_broker.h" #include "core/hle/service/am/applet_data_broker.h"
@ -101,6 +102,12 @@ Result ILibraryAppletAccessor::PushInData(SharedPointer<IStorage> storage) {
Result ILibraryAppletAccessor::PopOutData(Out<SharedPointer<IStorage>> out_storage) { Result ILibraryAppletAccessor::PopOutData(Out<SharedPointer<IStorage>> out_storage) {
LOG_DEBUG(Service_AM, "called"); LOG_DEBUG(Service_AM, "called");
if(!m_applet->caller_applet.expired()) {
LOG_DEBUG(Service_AM, "resuming caller");
system.GetAppletManager().ReTrackApplication(m_applet->caller_applet.lock());
} else {
LOG_CRITICAL(Service_AM, "Failed to track application. The emulator will freeze!");
}
R_RETURN(m_broker->GetOutData().Pop(out_storage.Get())); R_RETURN(m_broker->GetOutData().Pop(out_storage.Get()));
} }

View file

@ -47,6 +47,53 @@ bool ShouldCreateGuestApplet(AppletId applet_id) {
return true; return true;
} }
AppletProgramId AppletIdToProgramId(AppletId applet_id) {
switch (applet_id) {
case AppletId::OverlayDisplay:
return AppletProgramId::OverlayDisplay;
case AppletId::QLaunch:
return AppletProgramId::QLaunch;
case AppletId::Starter:
return AppletProgramId::Starter;
case AppletId::Auth:
return AppletProgramId::Auth;
case AppletId::Cabinet:
return AppletProgramId::Cabinet;
case AppletId::Controller:
return AppletProgramId::Controller;
case AppletId::DataErase:
return AppletProgramId::DataErase;
case AppletId::Error:
return AppletProgramId::Error;
case AppletId::NetConnect:
return AppletProgramId::NetConnect;
case AppletId::ProfileSelect:
return AppletProgramId::ProfileSelect;
case AppletId::SoftwareKeyboard:
return AppletProgramId::SoftwareKeyboard;
case AppletId::MiiEdit:
return AppletProgramId::MiiEdit;
case AppletId::Web:
return AppletProgramId::Web;
case AppletId::Shop:
return AppletProgramId::Shop;
case AppletId::PhotoViewer:
return AppletProgramId::PhotoViewer;
case AppletId::Settings:
return AppletProgramId::Settings;
case AppletId::OfflineWeb:
return AppletProgramId::OfflineWeb;
case AppletId::LoginShare:
return AppletProgramId::LoginShare;
case AppletId::WebAuth:
return AppletProgramId::WebAuth;
case AppletId::MyPage:
return AppletProgramId::MyPage;
default:
return static_cast<AppletProgramId>(0);
}
}
std::shared_ptr<ILibraryAppletAccessor> CreateGuestApplet(Core::System& system, std::shared_ptr<ILibraryAppletAccessor> CreateGuestApplet(Core::System& system,
WindowSystem& window_system, WindowSystem& window_system,
std::shared_ptr<Applet> caller_applet, std::shared_ptr<Applet> caller_applet,
@ -116,53 +163,6 @@ std::shared_ptr<ILibraryAppletAccessor> CreateFrontendApplet(Core::System& syste
} // namespace } // namespace
AppletProgramId AppletIdToProgramId(AppletId applet_id) {
switch (applet_id) {
case AppletId::OverlayDisplay:
return AppletProgramId::OverlayDisplay;
case AppletId::QLaunch:
return AppletProgramId::QLaunch;
case AppletId::Starter:
return AppletProgramId::Starter;
case AppletId::Auth:
return AppletProgramId::Auth;
case AppletId::Cabinet:
return AppletProgramId::Cabinet;
case AppletId::Controller:
return AppletProgramId::Controller;
case AppletId::DataErase:
return AppletProgramId::DataErase;
case AppletId::Error:
return AppletProgramId::Error;
case AppletId::NetConnect:
return AppletProgramId::NetConnect;
case AppletId::ProfileSelect:
return AppletProgramId::ProfileSelect;
case AppletId::SoftwareKeyboard:
return AppletProgramId::SoftwareKeyboard;
case AppletId::MiiEdit:
return AppletProgramId::MiiEdit;
case AppletId::Web:
return AppletProgramId::Web;
case AppletId::Shop:
return AppletProgramId::Shop;
case AppletId::PhotoViewer:
return AppletProgramId::PhotoViewer;
case AppletId::Settings:
return AppletProgramId::Settings;
case AppletId::OfflineWeb:
return AppletProgramId::OfflineWeb;
case AppletId::LoginShare:
return AppletProgramId::LoginShare;
case AppletId::WebAuth:
return AppletProgramId::WebAuth;
case AppletId::MyPage:
return AppletProgramId::MyPage;
default:
return static_cast<AppletProgramId>(0);
}
}
ILibraryAppletCreator::ILibraryAppletCreator(Core::System& system_, std::shared_ptr<Applet> applet, ILibraryAppletCreator::ILibraryAppletCreator(Core::System& system_, std::shared_ptr<Applet> applet,
WindowSystem& window_system) WindowSystem& window_system)
: ServiceFramework{system_, "ILibraryAppletCreator"}, : ServiceFramework{system_, "ILibraryAppletCreator"},

View file

@ -35,6 +35,4 @@ private:
const std::shared_ptr<Applet> m_applet; const std::shared_ptr<Applet> m_applet;
}; };
AppletProgramId AppletIdToProgramId(AppletId applet_id);
} // namespace Service::AM } // namespace Service::AM

View file

@ -24,8 +24,7 @@ DiscordImpl::DiscordImpl(Core::System& system_) : system{system_} {
DiscordEventHandlers handlers{}; DiscordEventHandlers handlers{};
// The number is the client ID for suyu, it's used for images and the // The number is the client ID for suyu, it's used for images and the
// application name // application name
// NOTE: This application is owned by million1156 (million@alyocord.com) Discord_Initialize("712465656758665259", &handlers, 1, nullptr);
Discord_Initialize("1221314350216646828", &handlers, 1, nullptr);
} }
DiscordImpl::~DiscordImpl() { DiscordImpl::~DiscordImpl() {

View file

@ -5,7 +5,6 @@
#include <iostream> #include <iostream>
#include <memory> #include <memory>
#include <regex> #include <regex>
#include <sstream>
#include <string> #include <string>
#include <thread> #include <thread>
@ -24,12 +23,9 @@
#include "core/core_timing.h" #include "core/core_timing.h"
#include "core/cpu_manager.h" #include "core/cpu_manager.h"
#include "core/crypto/key_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/registered_cache.h"
#include "core/file_sys/vfs/vfs_real.h" #include "core/file_sys/vfs/vfs_real.h"
#include "core/hle/service/am/applet_manager.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/hle/service/filesystem/filesystem.h"
#include "core/loader/loader.h" #include "core/loader/loader.h"
#include "frontend_common/config.h" #include "frontend_common/config.h"
@ -72,7 +68,7 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
static void PrintHelp(const char* argv0) { static void PrintHelp(const char* argv0) {
std::cout << "Usage: " << argv0 std::cout << "Usage: " << argv0
<< " [options]\n" << " [options] <filename>\n"
"-c, --config Load the specified configuration file\n" "-c, --config Load the specified configuration file\n"
"-f, --fullscreen Start in fullscreen mode\n" "-f, --fullscreen Start in fullscreen mode\n"
"-g, --game File path of the game to load\n" "-g, --game File path of the game to load\n"
@ -81,13 +77,7 @@ static void PrintHelp(const char* argv0) {
" Nickname, password, address and port for multiplayer\n" " Nickname, password, address and port for multiplayer\n"
"-p, --program Pass following string as arguments to executable\n" "-p, --program Pass following string as arguments to executable\n"
"-u, --user Select a specific user profile from 0 to 7\n" "-u, --user Select a specific user profile from 0 to 7\n"
"-v, --version Output version information and exit\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() { static void PrintVersion() {
@ -222,7 +212,6 @@ int main(int argc, char** argv) {
bool use_multiplayer = false; bool use_multiplayer = false;
bool fullscreen = false; bool fullscreen = false;
Service::AM::FrontendAppletParameters load_parameters{};
std::string nickname{}; std::string nickname{};
std::string password{}; std::string password{};
std::string address{}; std::string address{};
@ -234,7 +223,6 @@ int main(int argc, char** argv) {
{"fullscreen", no_argument, 0, 'f'}, {"fullscreen", no_argument, 0, 'f'},
{"help", no_argument, 0, 'h'}, {"help", no_argument, 0, 'h'},
{"game", required_argument, 0, 'g'}, {"game", required_argument, 0, 'g'},
{"applet-params", optional_argument, 0, 'l'},
{"multiplayer", required_argument, 0, 'm'}, {"multiplayer", required_argument, 0, 'm'},
{"program", optional_argument, 0, 'p'}, {"program", optional_argument, 0, 'p'},
{"user", required_argument, 0, 'u'}, {"user", required_argument, 0, 'u'},
@ -244,7 +232,7 @@ int main(int argc, char** argv) {
}; };
while (optind < argc) { 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:", long_options, &option_index);
if (arg != -1) { if (arg != -1) {
switch (static_cast<char>(arg)) { switch (static_cast<char>(arg)) {
case 'c': case 'c':
@ -262,27 +250,6 @@ int main(int argc, char** argv) {
filepath = str_arg; filepath = str_arg;
break; break;
} }
case 'l': {
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.
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<Service::AM::AppletId>(std::stoul(sub));
std::getline(stream, sub, ',');
load_parameters.applet_type = static_cast<Service::AM::AppletType>(std::stoi(sub));
std::getline(stream, sub, ',');
load_parameters.launch_type = static_cast<Service::AM::LaunchType>(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': { case 'm': {
use_multiplayer = true; use_multiplayer = true;
const std::string str_arg(optarg); const std::string str_arg(optarg);
@ -364,7 +331,7 @@ int main(int argc, char** argv) {
Common::ConfigureNvidiaEnvironmentFlags(); Common::ConfigureNvidiaEnvironmentFlags();
if (filepath.empty() && !static_cast<u32>(load_parameters.applet_id)) { if (filepath.empty()) {
LOG_CRITICAL(Frontend, "Failed to load ROM: No ROM specified"); LOG_CRITICAL(Frontend, "Failed to load ROM: No ROM specified");
return -1; return -1;
} }
@ -400,27 +367,9 @@ int main(int argc, char** argv) {
system.GetFileSystemController().CreateFactories(*system.GetFilesystem()); system.GetFileSystemController().CreateFactories(*system.GetFilesystem());
system.GetUserChannel().clear(); system.GetUserChannel().clear();
if (static_cast<u32>(load_parameters.applet_id)) { Service::AM::FrontendAppletParameters load_parameters{
// code below based off of suyu/main.cpp : GMainWindow::OnHomeMenu() .applet_id = Service::AM::AppletId::Application,
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<u64>(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)}; const Core::SystemResultStatus load_result{system.Load(*emu_window, filepath, load_parameters)};
switch (load_result) { switch (load_result) {