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

View file

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

View file

@ -1,22 +1,19 @@
#!/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 -sv
ccache -s
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/bin/clang++ \
-DCMAKE_C_COMPILER=/usr/bin/clang \
-DCMAKE_CXX_COMPILER=/usr/lib/ccache/clang++ \
-DCMAKE_C_COMPILER=/usr/lib/ccache/clang \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DDISPLAY_VERSION=$1 \
-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \
@ -25,12 +22,11 @@ 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 -sv
ccache -s
ctest -VV -C Release

View file

@ -6,7 +6,7 @@
# Exit on error, rather than continuing with the rest of the script.
set -e
ccache -sv
ccache -s
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/local/bin/g++ \
-DCMAKE_C_COMPILER=/usr/local/bin/gcc \
-DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ \
-DCMAKE_C_COMPILER=/usr/lib/ccache/gcc \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DDISPLAY_VERSION=$1 \
-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=OFF \
@ -24,14 +24,14 @@ cmake .. \
-DUSE_DISCORD_PRESENCE=ON \
-DSUYU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} \
-DSUYU_USE_BUNDLED_FFMPEG=ON \
-DSUYU_ENABLE_LTO=OFF \
-DSUYU_ENABLE_LTO=ON \
-DSUYU_CRASH_DUMPS=ON \
-DSUYU_USE_FASTER_LD=ON \
-GNinja
ninja
ccache -sv
ccache -s
ctest -VV -C Release

View file

@ -16,8 +16,8 @@ on:
- 'externals/**'
- 'CMakeLists.txt'
- 'vcpkg.json'
# paths-ignore:
# - 'src/android/**'
paths-ignore:
- 'src/android/**'
push:
branches: [ "dev" ]
paths:
@ -27,13 +27,12 @@ on:
- 'externals/**'
- 'CMakeLists.txt'
- 'vcpkg.json'
- '.forgejo/workflows/verify.yml'
- '.ci/**'
# paths-ignore:
# - 'src/android/**'
paths-ignore:
- 'src/android/**'
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:
@ -174,44 +173,47 @@ jobs:
# with:
# name: ${{ env.INDIVIDUAL_EXE }}
# path: ${{ env.INDIVIDUAL_EXE }}
android:
runs-on: ubuntu-latest
container: fijxu/build-environments:android
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: 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/

View file

@ -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://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})
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}")
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
@ -630,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://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
STATUS DOWNLOAD_SUCCESS)
if (NOT DOWNLOAD_SUCCESS EQUAL 0)
@ -710,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

View file

@ -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/branch/master/")
set(package_repo "ext-windows-bin/-/raw/master/")
set(package_extension ".7z")
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")
# elseif (APPLE)
# set(package_repo "ext-osx-bin/-/raw/main/")
# set(package_extension ".dmg")
elseif (ANDROID)
set(package_repo "ext-android-bin/raw/branch/main/")
set(package_repo "ext-android-bin/-/raw/main/")
set(package_extension ".tar.xz")
else()
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)
* __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.
## Building

View file

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

View file

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

View file

@ -601,7 +601,6 @@
<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_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>
<!-- CPU Backend -->

View file

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

View file

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

View file

@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2024 suyu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#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) {
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()));
}

View file

@ -47,6 +47,53 @@ bool ShouldCreateGuestApplet(AppletId applet_id) {
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,
WindowSystem& window_system,
std::shared_ptr<Applet> caller_applet,
@ -116,53 +163,6 @@ std::shared_ptr<ILibraryAppletAccessor> CreateFrontendApplet(Core::System& syste
} // 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,
WindowSystem& window_system)
: ServiceFramework{system_, "ILibraryAppletCreator"},

View file

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

View file

@ -24,8 +24,7 @@ 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
// NOTE: This application is owned by million1156 (million@alyocord.com)
Discord_Initialize("1221314350216646828", &handlers, 1, nullptr);
Discord_Initialize("712465656758665259", &handlers, 1, nullptr);
}
DiscordImpl::~DiscordImpl() {

View file

@ -5,7 +5,6 @@
#include <iostream>
#include <memory>
#include <regex>
#include <sstream>
#include <string>
#include <thread>
@ -24,12 +23,9 @@
#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"
@ -72,7 +68,7 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
static void PrintHelp(const char* argv0) {
std::cout << "Usage: " << argv0
<< " [options]\n"
<< " [options] <filename>\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"
@ -81,13 +77,7 @@ static void PrintHelp(const char* argv0) {
" 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";
"-v, --version Output version information and exit\n";
}
static void PrintVersion() {
@ -222,7 +212,6 @@ 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{};
@ -234,7 +223,6 @@ int main(int argc, char** argv) {
{"fullscreen", no_argument, 0, 'f'},
{"help", no_argument, 0, 'h'},
{"game", required_argument, 0, 'g'},
{"applet-params", optional_argument, 0, 'l'},
{"multiplayer", required_argument, 0, 'm'},
{"program", optional_argument, 0, 'p'},
{"user", required_argument, 0, 'u'},
@ -244,7 +232,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:", long_options, &option_index);
if (arg != -1) {
switch (static_cast<char>(arg)) {
case 'c':
@ -262,27 +250,6 @@ int main(int argc, char** argv) {
filepath = str_arg;
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': {
use_multiplayer = true;
const std::string str_arg(optarg);
@ -364,7 +331,7 @@ int main(int argc, char** argv) {
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");
return -1;
}
@ -400,27 +367,9 @@ int main(int argc, char** argv) {
system.GetFileSystemController().CreateFactories(*system.GetFilesystem());
system.GetUserChannel().clear();
if (static_cast<u32>(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<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;
}
Service::AM::FrontendAppletParameters load_parameters{
.applet_id = Service::AM::AppletId::Application,
};
const Core::SystemResultStatus load_result{system.Load(*emu_window, filepath, load_parameters)};
switch (load_result) {