mirror of
https://gitlab.com/suyu-emu/suyu.git
synced 2024-03-15 23:15:44 +00:00
Merge pull request #5352 from ReinUsesLisp/remove-tester
cmake: Remove yuzu_tester
This commit is contained in:
commit
6676687694
|
@ -130,7 +130,6 @@ add_subdirectory(tests)
|
||||||
|
|
||||||
if (ENABLE_SDL2)
|
if (ENABLE_SDL2)
|
||||||
add_subdirectory(yuzu_cmd)
|
add_subdirectory(yuzu_cmd)
|
||||||
add_subdirectory(yuzu_tester)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ENABLE_QT)
|
if (ENABLE_QT)
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules)
|
|
||||||
|
|
||||||
add_executable(yuzu-tester
|
|
||||||
config.cpp
|
|
||||||
config.h
|
|
||||||
default_ini.h
|
|
||||||
emu_window/emu_window_sdl2_hide.cpp
|
|
||||||
emu_window/emu_window_sdl2_hide.h
|
|
||||||
resource.h
|
|
||||||
service/yuzutest.cpp
|
|
||||||
service/yuzutest.h
|
|
||||||
yuzu.cpp
|
|
||||||
yuzu.rc
|
|
||||||
)
|
|
||||||
|
|
||||||
create_target_directory_groups(yuzu-tester)
|
|
||||||
|
|
||||||
target_link_libraries(yuzu-tester PRIVATE common core input_common)
|
|
||||||
target_link_libraries(yuzu-tester PRIVATE inih glad)
|
|
||||||
if (MSVC)
|
|
||||||
target_link_libraries(yuzu-tester PRIVATE getopt)
|
|
||||||
endif()
|
|
||||||
target_link_libraries(yuzu-tester PRIVATE ${PLATFORM_LIBRARIES} SDL2 Threads::Threads)
|
|
||||||
|
|
||||||
if(UNIX AND NOT APPLE)
|
|
||||||
install(TARGETS yuzu-tester RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (MSVC)
|
|
||||||
include(CopyYuzuSDLDeps)
|
|
||||||
copy_yuzu_SDL_deps(yuzu-tester)
|
|
||||||
endif()
|
|
|
@ -1,194 +0,0 @@
|
||||||
// Copyright 2019 yuzu Emulator Project
|
|
||||||
// Licensed under GPLv2 or any later version
|
|
||||||
// Refer to the license.txt file included.
|
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include <sstream>
|
|
||||||
#include <SDL.h>
|
|
||||||
#include <inih/cpp/INIReader.h>
|
|
||||||
#include "common/file_util.h"
|
|
||||||
#include "common/logging/log.h"
|
|
||||||
#include "common/param_package.h"
|
|
||||||
#include "core/hle/service/acc/profile_manager.h"
|
|
||||||
#include "core/settings.h"
|
|
||||||
#include "input_common/main.h"
|
|
||||||
#include "yuzu_tester/config.h"
|
|
||||||
#include "yuzu_tester/default_ini.h"
|
|
||||||
|
|
||||||
namespace FS = Common::FS;
|
|
||||||
|
|
||||||
Config::Config() {
|
|
||||||
// TODO: Don't hardcode the path; let the frontend decide where to put the config files.
|
|
||||||
sdl2_config_loc = FS::GetUserPath(FS::UserPath::ConfigDir) + "sdl2-tester-config.ini";
|
|
||||||
sdl2_config = std::make_unique<INIReader>(sdl2_config_loc);
|
|
||||||
|
|
||||||
Reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
Config::~Config() = default;
|
|
||||||
|
|
||||||
bool Config::LoadINI(const std::string& default_contents, bool retry) {
|
|
||||||
const char* location = this->sdl2_config_loc.c_str();
|
|
||||||
if (sdl2_config->ParseError() < 0) {
|
|
||||||
if (retry) {
|
|
||||||
LOG_WARNING(Config, "Failed to load {}. Creating file from defaults...", location);
|
|
||||||
FS::CreateFullPath(location);
|
|
||||||
FS::WriteStringToFile(true, default_contents, location);
|
|
||||||
sdl2_config = std::make_unique<INIReader>(location); // Reopen file
|
|
||||||
|
|
||||||
return LoadINI(default_contents, false);
|
|
||||||
}
|
|
||||||
LOG_ERROR(Config, "Failed.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
LOG_INFO(Config, "Successfully loaded {}", location);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Config::ReadValues() {
|
|
||||||
// Controls
|
|
||||||
for (std::size_t p = 0; p < Settings::values.players.GetValue().size(); ++p) {
|
|
||||||
for (int i = 0; i < Settings::NativeButton::NumButtons; ++i) {
|
|
||||||
Settings::values.players.GetValue()[p].buttons[i] = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) {
|
|
||||||
Settings::values.players.GetValue()[p].analogs[i] = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Settings::values.mouse_enabled = false;
|
|
||||||
for (int i = 0; i < Settings::NativeMouseButton::NumMouseButtons; ++i) {
|
|
||||||
Settings::values.mouse_buttons[i] = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
Settings::values.motion_device = "";
|
|
||||||
|
|
||||||
Settings::values.keyboard_enabled = false;
|
|
||||||
|
|
||||||
Settings::values.debug_pad_enabled = false;
|
|
||||||
for (int i = 0; i < Settings::NativeButton::NumButtons; ++i) {
|
|
||||||
Settings::values.debug_pad_buttons[i] = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) {
|
|
||||||
Settings::values.debug_pad_analogs[i] = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
Settings::values.vibration_enabled.SetValue(true);
|
|
||||||
Settings::values.enable_accurate_vibrations.SetValue(false);
|
|
||||||
Settings::values.motion_enabled.SetValue(true);
|
|
||||||
Settings::values.touchscreen.enabled = "";
|
|
||||||
Settings::values.touchscreen.device = "";
|
|
||||||
Settings::values.touchscreen.finger = 0;
|
|
||||||
Settings::values.touchscreen.rotation_angle = 0;
|
|
||||||
Settings::values.touchscreen.diameter_x = 15;
|
|
||||||
Settings::values.touchscreen.diameter_y = 15;
|
|
||||||
|
|
||||||
Settings::values.use_docked_mode.SetValue(
|
|
||||||
sdl2_config->GetBoolean("Controls", "use_docked_mode", true));
|
|
||||||
|
|
||||||
// Data Storage
|
|
||||||
Settings::values.use_virtual_sd =
|
|
||||||
sdl2_config->GetBoolean("Data Storage", "use_virtual_sd", true);
|
|
||||||
FS::GetUserPath(Common::FS::UserPath::NANDDir,
|
|
||||||
sdl2_config->Get("Data Storage", "nand_directory",
|
|
||||||
Common::FS::GetUserPath(Common::FS::UserPath::NANDDir)));
|
|
||||||
FS::GetUserPath(Common::FS::UserPath::SDMCDir,
|
|
||||||
sdl2_config->Get("Data Storage", "sdmc_directory",
|
|
||||||
Common::FS::GetUserPath(Common::FS::UserPath::SDMCDir)));
|
|
||||||
|
|
||||||
// System
|
|
||||||
Settings::values.current_user = std::clamp<int>(
|
|
||||||
sdl2_config->GetInteger("System", "current_user", 0), 0, Service::Account::MAX_USERS - 1);
|
|
||||||
|
|
||||||
const auto rng_seed_enabled = sdl2_config->GetBoolean("System", "rng_seed_enabled", false);
|
|
||||||
if (rng_seed_enabled) {
|
|
||||||
Settings::values.rng_seed.SetValue(sdl2_config->GetInteger("System", "rng_seed", 0));
|
|
||||||
} else {
|
|
||||||
Settings::values.rng_seed.SetValue(std::nullopt);
|
|
||||||
}
|
|
||||||
|
|
||||||
const auto custom_rtc_enabled = sdl2_config->GetBoolean("System", "custom_rtc_enabled", false);
|
|
||||||
if (custom_rtc_enabled) {
|
|
||||||
Settings::values.custom_rtc.SetValue(
|
|
||||||
std::chrono::seconds(sdl2_config->GetInteger("System", "custom_rtc", 0)));
|
|
||||||
} else {
|
|
||||||
Settings::values.custom_rtc.SetValue(std::nullopt);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Core
|
|
||||||
Settings::values.use_multi_core.SetValue(
|
|
||||||
sdl2_config->GetBoolean("Core", "use_multi_core", false));
|
|
||||||
|
|
||||||
// Renderer
|
|
||||||
Settings::values.aspect_ratio.SetValue(
|
|
||||||
static_cast<int>(sdl2_config->GetInteger("Renderer", "aspect_ratio", 0)));
|
|
||||||
Settings::values.max_anisotropy.SetValue(
|
|
||||||
static_cast<int>(sdl2_config->GetInteger("Renderer", "max_anisotropy", 0)));
|
|
||||||
Settings::values.use_frame_limit.SetValue(false);
|
|
||||||
Settings::values.frame_limit.SetValue(100);
|
|
||||||
Settings::values.use_disk_shader_cache.SetValue(
|
|
||||||
sdl2_config->GetBoolean("Renderer", "use_disk_shader_cache", false));
|
|
||||||
const int gpu_accuracy_level = sdl2_config->GetInteger("Renderer", "gpu_accuracy", 0);
|
|
||||||
Settings::values.gpu_accuracy.SetValue(static_cast<Settings::GPUAccuracy>(gpu_accuracy_level));
|
|
||||||
Settings::values.use_asynchronous_gpu_emulation.SetValue(
|
|
||||||
sdl2_config->GetBoolean("Renderer", "use_asynchronous_gpu_emulation", false));
|
|
||||||
Settings::values.use_fast_gpu_time.SetValue(
|
|
||||||
sdl2_config->GetBoolean("Renderer", "use_fast_gpu_time", true));
|
|
||||||
|
|
||||||
Settings::values.bg_red.SetValue(
|
|
||||||
static_cast<float>(sdl2_config->GetReal("Renderer", "bg_red", 0.0)));
|
|
||||||
Settings::values.bg_green.SetValue(
|
|
||||||
static_cast<float>(sdl2_config->GetReal("Renderer", "bg_green", 0.0)));
|
|
||||||
Settings::values.bg_blue.SetValue(
|
|
||||||
static_cast<float>(sdl2_config->GetReal("Renderer", "bg_blue", 0.0)));
|
|
||||||
|
|
||||||
// Audio
|
|
||||||
Settings::values.sink_id = "null";
|
|
||||||
Settings::values.enable_audio_stretching.SetValue(false);
|
|
||||||
Settings::values.audio_device_id = "auto";
|
|
||||||
Settings::values.volume.SetValue(0);
|
|
||||||
|
|
||||||
Settings::values.language_index.SetValue(
|
|
||||||
sdl2_config->GetInteger("System", "language_index", 1));
|
|
||||||
|
|
||||||
// Miscellaneous
|
|
||||||
Settings::values.log_filter = sdl2_config->Get("Miscellaneous", "log_filter", "*:Trace");
|
|
||||||
Settings::values.use_dev_keys = sdl2_config->GetBoolean("Miscellaneous", "use_dev_keys", false);
|
|
||||||
|
|
||||||
// Debugging
|
|
||||||
Settings::values.program_args = "";
|
|
||||||
Settings::values.dump_exefs = sdl2_config->GetBoolean("Debugging", "dump_exefs", false);
|
|
||||||
Settings::values.dump_nso = sdl2_config->GetBoolean("Debugging", "dump_nso", false);
|
|
||||||
|
|
||||||
const auto title_list = sdl2_config->Get("AddOns", "title_ids", "");
|
|
||||||
std::stringstream ss(title_list);
|
|
||||||
std::string line;
|
|
||||||
while (std::getline(ss, line, '|')) {
|
|
||||||
const auto title_id = std::stoul(line, nullptr, 16);
|
|
||||||
const auto disabled_list = sdl2_config->Get("AddOns", "disabled_" + line, "");
|
|
||||||
|
|
||||||
std::stringstream inner_ss(disabled_list);
|
|
||||||
std::string inner_line;
|
|
||||||
std::vector<std::string> out;
|
|
||||||
while (std::getline(inner_ss, inner_line, '|')) {
|
|
||||||
out.push_back(inner_line);
|
|
||||||
}
|
|
||||||
|
|
||||||
Settings::values.disabled_addons.insert_or_assign(title_id, out);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Web Service
|
|
||||||
Settings::values.enable_telemetry =
|
|
||||||
sdl2_config->GetBoolean("WebService", "enable_telemetry", true);
|
|
||||||
Settings::values.web_api_url =
|
|
||||||
sdl2_config->Get("WebService", "web_api_url", "https://api.yuzu-emu.org");
|
|
||||||
Settings::values.yuzu_username = sdl2_config->Get("WebService", "yuzu_username", "");
|
|
||||||
Settings::values.yuzu_token = sdl2_config->Get("WebService", "yuzu_token", "");
|
|
||||||
}
|
|
||||||
|
|
||||||
void Config::Reload() {
|
|
||||||
LoadINI(DefaultINI::sdl2_config_file);
|
|
||||||
ReadValues();
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
// Copyright 2019 yuzu Emulator Project
|
|
||||||
// Licensed under GPLv2 or any later version
|
|
||||||
// Refer to the license.txt file included.
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
class INIReader;
|
|
||||||
|
|
||||||
class Config {
|
|
||||||
std::unique_ptr<INIReader> sdl2_config;
|
|
||||||
std::string sdl2_config_loc;
|
|
||||||
|
|
||||||
bool LoadINI(const std::string& default_contents = "", bool retry = true);
|
|
||||||
void ReadValues();
|
|
||||||
|
|
||||||
public:
|
|
||||||
Config();
|
|
||||||
~Config();
|
|
||||||
|
|
||||||
void Reload();
|
|
||||||
};
|
|
|
@ -1,182 +0,0 @@
|
||||||
// Copyright 2019 yuzu Emulator Project
|
|
||||||
// Licensed under GPLv2 or any later version
|
|
||||||
// Refer to the license.txt file included.
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
namespace DefaultINI {
|
|
||||||
|
|
||||||
const char* sdl2_config_file = R"(
|
|
||||||
[Core]
|
|
||||||
# Whether to use multi-core for CPU emulation
|
|
||||||
# 0 (default): Disabled, 1: Enabled
|
|
||||||
use_multi_core=
|
|
||||||
|
|
||||||
[Cpu]
|
|
||||||
# Enable inline page tables optimization (faster guest memory access)
|
|
||||||
# 0: Disabled, 1 (default): Enabled
|
|
||||||
cpuopt_page_tables =
|
|
||||||
|
|
||||||
# Enable block linking CPU optimization (reduce block dispatcher use during predictable jumps)
|
|
||||||
# 0: Disabled, 1 (default): Enabled
|
|
||||||
cpuopt_block_linking =
|
|
||||||
|
|
||||||
# Enable return stack buffer CPU optimization (reduce block dispatcher use during predictable returns)
|
|
||||||
# 0: Disabled, 1 (default): Enabled
|
|
||||||
cpuopt_return_stack_buffer =
|
|
||||||
|
|
||||||
# Enable fast dispatcher CPU optimization (use a two-tiered dispatcher architecture)
|
|
||||||
# 0: Disabled, 1 (default): Enabled
|
|
||||||
cpuopt_fast_dispatcher =
|
|
||||||
|
|
||||||
# Enable context elimination CPU Optimization (reduce host memory use for guest context)
|
|
||||||
# 0: Disabled, 1 (default): Enabled
|
|
||||||
cpuopt_context_elimination =
|
|
||||||
|
|
||||||
# Enable constant propagation CPU optimization (basic IR optimization)
|
|
||||||
# 0: Disabled, 1 (default): Enabled
|
|
||||||
cpuopt_const_prop =
|
|
||||||
|
|
||||||
# Enable miscellaneous CPU optimizations (basic IR optimization)
|
|
||||||
# 0: Disabled, 1 (default): Enabled
|
|
||||||
cpuopt_misc_ir =
|
|
||||||
|
|
||||||
# Enable reduction of memory misalignment checks (reduce memory fallbacks for misaligned access)
|
|
||||||
# 0: Disabled, 1 (default): Enabled
|
|
||||||
cpuopt_reduce_misalign_checks =
|
|
||||||
|
|
||||||
[Renderer]
|
|
||||||
# Whether to use software or hardware rendering.
|
|
||||||
# 0: Software, 1 (default): Hardware
|
|
||||||
use_hw_renderer =
|
|
||||||
|
|
||||||
# Whether to use the Just-In-Time (JIT) compiler for shader emulation
|
|
||||||
# 0: Interpreter (slow), 1 (default): JIT (fast)
|
|
||||||
use_shader_jit =
|
|
||||||
|
|
||||||
# Aspect ratio
|
|
||||||
# 0: Default (16:9), 1: Force 4:3, 2: Force 21:9, 3: Stretch to Window
|
|
||||||
aspect_ratio =
|
|
||||||
|
|
||||||
# Anisotropic filtering
|
|
||||||
# 0: Default, 1: 2x, 2: 4x, 3: 8x, 4: 16x
|
|
||||||
max_anisotropy =
|
|
||||||
|
|
||||||
# Whether to enable V-Sync (caps the framerate at 60FPS) or not.
|
|
||||||
# 0 (default): Off, 1: On
|
|
||||||
use_vsync =
|
|
||||||
|
|
||||||
# Whether to use disk based shader cache
|
|
||||||
# 0 (default): Off, 1 : On
|
|
||||||
use_disk_shader_cache =
|
|
||||||
|
|
||||||
# Whether to use accurate GPU emulation
|
|
||||||
# 0 (default): Off (fast), 1 : On (slow)
|
|
||||||
use_accurate_gpu_emulation =
|
|
||||||
|
|
||||||
# Whether to use asynchronous GPU emulation
|
|
||||||
# 0 : Off (slow), 1 (default): On (fast)
|
|
||||||
use_asynchronous_gpu_emulation =
|
|
||||||
|
|
||||||
# The clear color for the renderer. What shows up on the sides of the bottom screen.
|
|
||||||
# Must be in range of 0.0-1.0. Defaults to 1.0 for all.
|
|
||||||
bg_red =
|
|
||||||
bg_blue =
|
|
||||||
bg_green =
|
|
||||||
|
|
||||||
[Layout]
|
|
||||||
# Layout for the screen inside the render window.
|
|
||||||
# 0 (default): Default Top Bottom Screen, 1: Single Screen Only, 2: Large Screen Small Screen
|
|
||||||
layout_option =
|
|
||||||
|
|
||||||
# Toggle custom layout (using the settings below) on or off.
|
|
||||||
# 0 (default): Off, 1: On
|
|
||||||
custom_layout =
|
|
||||||
|
|
||||||
# Screen placement when using Custom layout option
|
|
||||||
# 0x, 0y is the top left corner of the render window.
|
|
||||||
custom_top_left =
|
|
||||||
custom_top_top =
|
|
||||||
custom_top_right =
|
|
||||||
custom_top_bottom =
|
|
||||||
custom_bottom_left =
|
|
||||||
custom_bottom_top =
|
|
||||||
custom_bottom_right =
|
|
||||||
custom_bottom_bottom =
|
|
||||||
|
|
||||||
# Swaps the prominent screen with the other screen.
|
|
||||||
# For example, if Single Screen is chosen, setting this to 1 will display the bottom screen instead of the top screen.
|
|
||||||
# 0 (default): Top Screen is prominent, 1: Bottom Screen is prominent
|
|
||||||
swap_screen =
|
|
||||||
|
|
||||||
[Data Storage]
|
|
||||||
# Whether to create a virtual SD card.
|
|
||||||
# 1 (default): Yes, 0: No
|
|
||||||
use_virtual_sd =
|
|
||||||
|
|
||||||
[System]
|
|
||||||
# Whether the system is docked
|
|
||||||
# 1 (default): Yes, 0: No
|
|
||||||
use_docked_mode =
|
|
||||||
|
|
||||||
# Allow the use of NFC in games
|
|
||||||
# 1 (default): Yes, 0 : No
|
|
||||||
enable_nfc =
|
|
||||||
|
|
||||||
# Sets the seed for the RNG generator built into the switch
|
|
||||||
# rng_seed will be ignored and randomly generated if rng_seed_enabled is false
|
|
||||||
rng_seed_enabled =
|
|
||||||
rng_seed =
|
|
||||||
|
|
||||||
# Sets the current time (in seconds since 12:00 AM Jan 1, 1970) that will be used by the time service
|
|
||||||
# This will auto-increment, with the time set being the time the game is started
|
|
||||||
# This override will only occur if custom_rtc_enabled is true, otherwise the current time is used
|
|
||||||
custom_rtc_enabled =
|
|
||||||
custom_rtc =
|
|
||||||
|
|
||||||
# Sets the account username, max length is 32 characters
|
|
||||||
# yuzu (default)
|
|
||||||
username = yuzu
|
|
||||||
|
|
||||||
# Sets the systems language index
|
|
||||||
# 0: Japanese, 1: English (default), 2: French, 3: German, 4: Italian, 5: Spanish, 6: Chinese,
|
|
||||||
# 7: Korean, 8: Dutch, 9: Portuguese, 10: Russian, 11: Taiwanese, 12: British English, 13: Canadian French,
|
|
||||||
# 14: Latin American Spanish, 15: Simplified Chinese, 16: Traditional Chinese
|
|
||||||
language_index =
|
|
||||||
|
|
||||||
# The system region that yuzu will use during emulation
|
|
||||||
# -1: Auto-select (default), 0: Japan, 1: USA, 2: Europe, 3: Australia, 4: China, 5: Korea, 6: Taiwan
|
|
||||||
region_value =
|
|
||||||
|
|
||||||
[Miscellaneous]
|
|
||||||
# A filter which removes logs below a certain logging level.
|
|
||||||
# Examples: *:Debug Kernel.SVC:Trace Service.*:Critical
|
|
||||||
log_filter = *:Trace
|
|
||||||
|
|
||||||
[Debugging]
|
|
||||||
# Arguments to be passed to argv/argc in the emulated program. It is preferable to use the testing service datastring
|
|
||||||
program_args=
|
|
||||||
# Determines whether or not yuzu will dump the ExeFS of all games it attempts to load while loading them
|
|
||||||
dump_exefs=false
|
|
||||||
# Determines whether or not yuzu will dump all NSOs it attempts to load while loading them
|
|
||||||
dump_nso=false
|
|
||||||
|
|
||||||
[WebService]
|
|
||||||
# Whether or not to enable telemetry
|
|
||||||
# 0: No, 1 (default): Yes
|
|
||||||
enable_telemetry =
|
|
||||||
# URL for Web API
|
|
||||||
web_api_url = https://api.yuzu-emu.org
|
|
||||||
# Username and token for yuzu Web Service
|
|
||||||
# See https://profile.yuzu-emu.org/ for more info
|
|
||||||
yuzu_username =
|
|
||||||
yuzu_token =
|
|
||||||
|
|
||||||
[AddOns]
|
|
||||||
# Used to disable add-ons
|
|
||||||
# List of title IDs of games that will have add-ons disabled (separated by '|'):
|
|
||||||
title_ids =
|
|
||||||
# For each title ID, have a key/value pair called `disabled_<title_id>` equal to the names of the add-ons to disable (sep. by '|')
|
|
||||||
# e.x. disabled_0100000000010000 = Update|DLC <- disables Updates and DLC on Super Mario Odyssey
|
|
||||||
)";
|
|
||||||
}
|
|
|
@ -1,146 +0,0 @@
|
||||||
// Copyright 2019 yuzu Emulator Project
|
|
||||||
// Licensed under GPLv2 or any later version
|
|
||||||
// Refer to the license.txt file included.
|
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include <fmt/format.h>
|
|
||||||
|
|
||||||
#define SDL_MAIN_HANDLED
|
|
||||||
#include <SDL.h>
|
|
||||||
|
|
||||||
#include <glad/glad.h>
|
|
||||||
|
|
||||||
#include "common/logging/log.h"
|
|
||||||
#include "common/scm_rev.h"
|
|
||||||
#include "core/settings.h"
|
|
||||||
#include "input_common/main.h"
|
|
||||||
#include "yuzu_tester/emu_window/emu_window_sdl2_hide.h"
|
|
||||||
|
|
||||||
bool EmuWindow_SDL2_Hide::SupportsRequiredGLExtensions() {
|
|
||||||
std::vector<std::string> unsupported_ext;
|
|
||||||
|
|
||||||
if (!GLAD_GL_ARB_direct_state_access)
|
|
||||||
unsupported_ext.push_back("ARB_direct_state_access");
|
|
||||||
if (!GLAD_GL_ARB_vertex_type_10f_11f_11f_rev)
|
|
||||||
unsupported_ext.push_back("ARB_vertex_type_10f_11f_11f_rev");
|
|
||||||
if (!GLAD_GL_ARB_texture_mirror_clamp_to_edge)
|
|
||||||
unsupported_ext.push_back("ARB_texture_mirror_clamp_to_edge");
|
|
||||||
if (!GLAD_GL_ARB_multi_bind)
|
|
||||||
unsupported_ext.push_back("ARB_multi_bind");
|
|
||||||
|
|
||||||
// Extensions required to support some texture formats.
|
|
||||||
if (!GLAD_GL_EXT_texture_compression_s3tc)
|
|
||||||
unsupported_ext.push_back("EXT_texture_compression_s3tc");
|
|
||||||
if (!GLAD_GL_ARB_texture_compression_rgtc)
|
|
||||||
unsupported_ext.push_back("ARB_texture_compression_rgtc");
|
|
||||||
if (!GLAD_GL_ARB_depth_buffer_float)
|
|
||||||
unsupported_ext.push_back("ARB_depth_buffer_float");
|
|
||||||
|
|
||||||
for (const std::string& ext : unsupported_ext)
|
|
||||||
LOG_CRITICAL(Frontend, "Unsupported GL extension: {}", ext);
|
|
||||||
|
|
||||||
return unsupported_ext.empty();
|
|
||||||
}
|
|
||||||
|
|
||||||
EmuWindow_SDL2_Hide::EmuWindow_SDL2_Hide() {
|
|
||||||
// Initialize the window
|
|
||||||
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
|
|
||||||
LOG_CRITICAL(Frontend, "Failed to initialize SDL2! Exiting...");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
input_subsystem->Initialize();
|
|
||||||
|
|
||||||
SDL_SetMainReady();
|
|
||||||
|
|
||||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4);
|
|
||||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
|
|
||||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
|
|
||||||
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
|
|
||||||
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
|
|
||||||
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
|
|
||||||
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
|
|
||||||
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 0);
|
|
||||||
|
|
||||||
std::string window_title = fmt::format("yuzu-tester {} | {}-{}", Common::g_build_fullname,
|
|
||||||
Common::g_scm_branch, Common::g_scm_desc);
|
|
||||||
render_window = SDL_CreateWindow(window_title.c_str(),
|
|
||||||
SDL_WINDOWPOS_UNDEFINED, // x position
|
|
||||||
SDL_WINDOWPOS_UNDEFINED, // y position
|
|
||||||
Layout::ScreenUndocked::Width, Layout::ScreenUndocked::Height,
|
|
||||||
SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE |
|
|
||||||
SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_HIDDEN);
|
|
||||||
|
|
||||||
if (render_window == nullptr) {
|
|
||||||
LOG_CRITICAL(Frontend, "Failed to create SDL2 window! {}", SDL_GetError());
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
gl_context = SDL_GL_CreateContext(render_window);
|
|
||||||
|
|
||||||
if (gl_context == nullptr) {
|
|
||||||
LOG_CRITICAL(Frontend, "Failed to create SDL2 GL context! {}", SDL_GetError());
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!gladLoadGLLoader(static_cast<GLADloadproc>(SDL_GL_GetProcAddress))) {
|
|
||||||
LOG_CRITICAL(Frontend, "Failed to initialize GL functions! {}", SDL_GetError());
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!SupportsRequiredGLExtensions()) {
|
|
||||||
LOG_CRITICAL(Frontend, "GPU does not support all required OpenGL extensions! Exiting...");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
SDL_PumpEvents();
|
|
||||||
SDL_GL_SetSwapInterval(false);
|
|
||||||
LOG_INFO(Frontend, "yuzu-tester Version: {} | {}-{}", Common::g_build_fullname,
|
|
||||||
Common::g_scm_branch, Common::g_scm_desc);
|
|
||||||
Settings::LogSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
EmuWindow_SDL2_Hide::~EmuWindow_SDL2_Hide() {
|
|
||||||
input_subsystem->Shutdown();
|
|
||||||
SDL_GL_DeleteContext(gl_context);
|
|
||||||
SDL_Quit();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool EmuWindow_SDL2_Hide::IsShown() const {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
class SDLGLContext : public Core::Frontend::GraphicsContext {
|
|
||||||
public:
|
|
||||||
explicit SDLGLContext() {
|
|
||||||
// create a hidden window to make the shared context against
|
|
||||||
window = SDL_CreateWindow(NULL, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 0, 0,
|
|
||||||
SDL_WINDOW_HIDDEN | SDL_WINDOW_OPENGL);
|
|
||||||
context = SDL_GL_CreateContext(window);
|
|
||||||
}
|
|
||||||
|
|
||||||
~SDLGLContext() {
|
|
||||||
DoneCurrent();
|
|
||||||
SDL_GL_DeleteContext(context);
|
|
||||||
SDL_DestroyWindow(window);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MakeCurrent() override {
|
|
||||||
SDL_GL_MakeCurrent(window, context);
|
|
||||||
}
|
|
||||||
|
|
||||||
void DoneCurrent() override {
|
|
||||||
SDL_GL_MakeCurrent(window, nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
SDL_Window* window;
|
|
||||||
SDL_GLContext context;
|
|
||||||
};
|
|
||||||
|
|
||||||
std::unique_ptr<Core::Frontend::GraphicsContext> EmuWindow_SDL2_Hide::CreateSharedContext() const {
|
|
||||||
return std::make_unique<SDLGLContext>();
|
|
||||||
}
|
|
|
@ -1,37 +0,0 @@
|
||||||
// Copyright 2019 yuzu Emulator Project
|
|
||||||
// Licensed under GPLv2 or any later version
|
|
||||||
// Refer to the license.txt file included.
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "core/frontend/emu_window.h"
|
|
||||||
|
|
||||||
struct SDL_Window;
|
|
||||||
|
|
||||||
namespace InputCommon {
|
|
||||||
class InputSubsystem;
|
|
||||||
}
|
|
||||||
|
|
||||||
class EmuWindow_SDL2_Hide : public Core::Frontend::EmuWindow {
|
|
||||||
public:
|
|
||||||
explicit EmuWindow_SDL2_Hide();
|
|
||||||
~EmuWindow_SDL2_Hide();
|
|
||||||
|
|
||||||
/// Whether the screen is being shown or not.
|
|
||||||
bool IsShown() const override;
|
|
||||||
|
|
||||||
std::unique_ptr<Core::Frontend::GraphicsContext> CreateSharedContext() const override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
/// Whether the GPU and driver supports the OpenGL extension required
|
|
||||||
bool SupportsRequiredGLExtensions();
|
|
||||||
|
|
||||||
std::unique_ptr<InputCommon::InputSubsystem> input_subsystem;
|
|
||||||
|
|
||||||
/// Internal SDL2 render window
|
|
||||||
SDL_Window* render_window;
|
|
||||||
|
|
||||||
using SDL_GLContext = void*;
|
|
||||||
/// The OpenGL context associated with the window
|
|
||||||
SDL_GLContext gl_context;
|
|
||||||
};
|
|
|
@ -1,16 +0,0 @@
|
||||||
//{{NO_DEPENDENCIES}}
|
|
||||||
// Microsoft Visual C++ generated include file.
|
|
||||||
// Used by pcafe.rc
|
|
||||||
//
|
|
||||||
#define IDI_ICON3 103
|
|
||||||
|
|
||||||
// Next default values for new objects
|
|
||||||
//
|
|
||||||
#ifdef APSTUDIO_INVOKED
|
|
||||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
|
||||||
#define _APS_NEXT_RESOURCE_VALUE 105
|
|
||||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
|
||||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
|
||||||
#define _APS_NEXT_SYMED_VALUE 101
|
|
||||||
#endif
|
|
||||||
#endif
|
|
|
@ -1,115 +0,0 @@
|
||||||
// Copyright 2019 yuzu Emulator Project
|
|
||||||
// Licensed under GPLv2 or any later version
|
|
||||||
// Refer to the license.txt file included.
|
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include "common/string_util.h"
|
|
||||||
#include "core/core.h"
|
|
||||||
#include "core/hle/ipc_helpers.h"
|
|
||||||
#include "core/hle/service/service.h"
|
|
||||||
#include "core/hle/service/sm/sm.h"
|
|
||||||
#include "yuzu_tester/service/yuzutest.h"
|
|
||||||
|
|
||||||
namespace Service::Yuzu {
|
|
||||||
|
|
||||||
constexpr u64 SERVICE_VERSION = 0x00000002;
|
|
||||||
|
|
||||||
class YuzuTest final : public ServiceFramework<YuzuTest> {
|
|
||||||
public:
|
|
||||||
explicit YuzuTest(Core::System& system_, std::string data_,
|
|
||||||
std::function<void(std::vector<TestResult>)> finish_callback_)
|
|
||||||
: ServiceFramework{system_, "yuzutest"}, data{std::move(data_)}, finish_callback{std::move(
|
|
||||||
finish_callback_)} {
|
|
||||||
static const FunctionInfo functions[] = {
|
|
||||||
{0, &YuzuTest::Initialize, "Initialize"},
|
|
||||||
{1, &YuzuTest::GetServiceVersion, "GetServiceVersion"},
|
|
||||||
{2, &YuzuTest::GetData, "GetData"},
|
|
||||||
{10, &YuzuTest::StartIndividual, "StartIndividual"},
|
|
||||||
{20, &YuzuTest::FinishIndividual, "FinishIndividual"},
|
|
||||||
{100, &YuzuTest::ExitProgram, "ExitProgram"},
|
|
||||||
};
|
|
||||||
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
void Initialize(Kernel::HLERequestContext& ctx) {
|
|
||||||
LOG_DEBUG(Frontend, "called");
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
|
||||||
rb.Push(RESULT_SUCCESS);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GetServiceVersion(Kernel::HLERequestContext& ctx) {
|
|
||||||
LOG_DEBUG(Frontend, "called");
|
|
||||||
IPC::ResponseBuilder rb{ctx, 4};
|
|
||||||
rb.Push(RESULT_SUCCESS);
|
|
||||||
rb.Push(SERVICE_VERSION);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GetData(Kernel::HLERequestContext& ctx) {
|
|
||||||
LOG_DEBUG(Frontend, "called");
|
|
||||||
const auto size = ctx.GetWriteBufferSize();
|
|
||||||
const auto write_size = std::min(size, data.size());
|
|
||||||
ctx.WriteBuffer(data.data(), write_size);
|
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 3};
|
|
||||||
rb.Push(RESULT_SUCCESS);
|
|
||||||
rb.Push<u32>(static_cast<u32>(write_size));
|
|
||||||
}
|
|
||||||
|
|
||||||
void StartIndividual(Kernel::HLERequestContext& ctx) {
|
|
||||||
const auto name_raw = ctx.ReadBuffer();
|
|
||||||
|
|
||||||
const auto name = Common::StringFromFixedZeroTerminatedBuffer(
|
|
||||||
reinterpret_cast<const char*>(name_raw.data()), name_raw.size());
|
|
||||||
|
|
||||||
LOG_DEBUG(Frontend, "called, name={}", name);
|
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
|
||||||
rb.Push(RESULT_SUCCESS);
|
|
||||||
}
|
|
||||||
|
|
||||||
void FinishIndividual(Kernel::HLERequestContext& ctx) {
|
|
||||||
IPC::RequestParser rp{ctx};
|
|
||||||
|
|
||||||
const auto code = rp.PopRaw<u32>();
|
|
||||||
|
|
||||||
const auto result_data_raw = ctx.ReadBuffer();
|
|
||||||
const auto test_name_raw = ctx.ReadBuffer(1);
|
|
||||||
|
|
||||||
const auto data = Common::StringFromFixedZeroTerminatedBuffer(
|
|
||||||
reinterpret_cast<const char*>(result_data_raw.data()), result_data_raw.size());
|
|
||||||
const auto test_name = Common::StringFromFixedZeroTerminatedBuffer(
|
|
||||||
reinterpret_cast<const char*>(test_name_raw.data()), test_name_raw.size());
|
|
||||||
|
|
||||||
LOG_INFO(Frontend, "called, result_code={:08X}, data={}, name={}", code, data, test_name);
|
|
||||||
|
|
||||||
results.push_back({code, data, test_name});
|
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
|
||||||
rb.Push(RESULT_SUCCESS);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ExitProgram(Kernel::HLERequestContext& ctx) {
|
|
||||||
LOG_DEBUG(Frontend, "called");
|
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
|
||||||
rb.Push(RESULT_SUCCESS);
|
|
||||||
|
|
||||||
finish_callback(std::move(results));
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string data;
|
|
||||||
|
|
||||||
std::vector<TestResult> results;
|
|
||||||
std::function<void(std::vector<TestResult>)> finish_callback;
|
|
||||||
};
|
|
||||||
|
|
||||||
void InstallInterfaces(Core::System& system, std::string data,
|
|
||||||
std::function<void(std::vector<TestResult>)> finish_callback) {
|
|
||||||
auto& sm = system.ServiceManager();
|
|
||||||
std::make_shared<YuzuTest>(system, std::move(data), std::move(finish_callback))
|
|
||||||
->InstallAsService(sm);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Service::Yuzu
|
|
|
@ -1,25 +0,0 @@
|
||||||
// Copyright 2019 yuzu Emulator Project
|
|
||||||
// Licensed under GPLv2 or any later version
|
|
||||||
// Refer to the license.txt file included.
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <functional>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace Core {
|
|
||||||
class System;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace Service::Yuzu {
|
|
||||||
|
|
||||||
struct TestResult {
|
|
||||||
u32 code;
|
|
||||||
std::string data;
|
|
||||||
std::string name;
|
|
||||||
};
|
|
||||||
|
|
||||||
void InstallInterfaces(Core::System& system, std::string data,
|
|
||||||
std::function<void(std::vector<TestResult>)> finish_callback);
|
|
||||||
|
|
||||||
} // namespace Service::Yuzu
|
|
|
@ -1,268 +0,0 @@
|
||||||
// Copyright 2019 yuzu Emulator Project
|
|
||||||
// Licensed under GPLv2 or any later version
|
|
||||||
// Refer to the license.txt file included.
|
|
||||||
|
|
||||||
#include <chrono>
|
|
||||||
#include <iostream>
|
|
||||||
#include <memory>
|
|
||||||
#include <string>
|
|
||||||
#include <thread>
|
|
||||||
|
|
||||||
#include <fmt/ostream.h>
|
|
||||||
|
|
||||||
#include "common/common_paths.h"
|
|
||||||
#include "common/detached_tasks.h"
|
|
||||||
#include "common/file_util.h"
|
|
||||||
#include "common/logging/backend.h"
|
|
||||||
#include "common/logging/filter.h"
|
|
||||||
#include "common/logging/log.h"
|
|
||||||
#include "common/microprofile.h"
|
|
||||||
#include "common/scm_rev.h"
|
|
||||||
#include "common/scope_exit.h"
|
|
||||||
#include "common/string_util.h"
|
|
||||||
#include "common/telemetry.h"
|
|
||||||
#include "core/core.h"
|
|
||||||
#include "core/crypto/key_manager.h"
|
|
||||||
#include "core/file_sys/registered_cache.h"
|
|
||||||
#include "core/file_sys/vfs_real.h"
|
|
||||||
#include "core/hle/service/filesystem/filesystem.h"
|
|
||||||
#include "core/loader/loader.h"
|
|
||||||
#include "core/settings.h"
|
|
||||||
#include "core/telemetry_session.h"
|
|
||||||
#include "video_core/renderer_base.h"
|
|
||||||
#include "yuzu_tester/config.h"
|
|
||||||
#include "yuzu_tester/emu_window/emu_window_sdl2_hide.h"
|
|
||||||
#include "yuzu_tester/service/yuzutest.h"
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
// windows.h needs to be included before shellapi.h
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
#include <shellapi.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#undef _UNICODE
|
|
||||||
#include <getopt.h>
|
|
||||||
#ifndef _MSC_VER
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
extern "C" {
|
|
||||||
// tells Nvidia and AMD drivers to use the dedicated GPU by default on laptops with switchable
|
|
||||||
// graphics
|
|
||||||
__declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001;
|
|
||||||
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void PrintHelp(const char* argv0) {
|
|
||||||
std::cout << "Usage: " << argv0
|
|
||||||
<< " [options] <filename>\n"
|
|
||||||
"-h, --help Display this help and exit\n"
|
|
||||||
"-v, --version Output version information and exit\n"
|
|
||||||
"-d, --datastring Pass following string as data to test service command #2\n"
|
|
||||||
"-l, --log Log to console in addition to file (will log to file only "
|
|
||||||
"by default)\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
static void PrintVersion() {
|
|
||||||
std::cout << "yuzu [Test Utility] " << Common::g_scm_branch << " " << Common::g_scm_desc
|
|
||||||
<< std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void InitializeLogging(bool console) {
|
|
||||||
Log::Filter log_filter(Log::Level::Debug);
|
|
||||||
log_filter.ParseFilterString(Settings::values.log_filter);
|
|
||||||
Log::SetGlobalFilter(log_filter);
|
|
||||||
|
|
||||||
if (console)
|
|
||||||
Log::AddBackend(std::make_unique<Log::ColorConsoleBackend>());
|
|
||||||
|
|
||||||
const std::string& log_dir = Common::FS::GetUserPath(Common::FS::UserPath::LogDir);
|
|
||||||
Common::FS::CreateFullPath(log_dir);
|
|
||||||
Log::AddBackend(std::make_unique<Log::FileBackend>(log_dir + LOG_FILE));
|
|
||||||
#ifdef _WIN32
|
|
||||||
Log::AddBackend(std::make_unique<Log::DebuggerBackend>());
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Application entry point
|
|
||||||
int main(int argc, char** argv) {
|
|
||||||
Common::DetachedTasks detached_tasks;
|
|
||||||
Config config;
|
|
||||||
|
|
||||||
int option_index = 0;
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
int argc_w;
|
|
||||||
auto argv_w = CommandLineToArgvW(GetCommandLineW(), &argc_w);
|
|
||||||
|
|
||||||
if (argv_w == nullptr) {
|
|
||||||
std::cout << "Failed to get command line arguments" << std::endl;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
std::string filepath;
|
|
||||||
|
|
||||||
static struct option long_options[] = {
|
|
||||||
{"help", no_argument, 0, 'h'},
|
|
||||||
{"version", no_argument, 0, 'v'},
|
|
||||||
{"datastring", optional_argument, 0, 'd'},
|
|
||||||
{"log", no_argument, 0, 'l'},
|
|
||||||
{0, 0, 0, 0},
|
|
||||||
};
|
|
||||||
|
|
||||||
bool console_log = false;
|
|
||||||
std::string datastring;
|
|
||||||
|
|
||||||
while (optind < argc) {
|
|
||||||
int arg = getopt_long(argc, argv, "hvdl::", long_options, &option_index);
|
|
||||||
if (arg != -1) {
|
|
||||||
switch (static_cast<char>(arg)) {
|
|
||||||
case 'h':
|
|
||||||
PrintHelp(argv[0]);
|
|
||||||
return 0;
|
|
||||||
case 'v':
|
|
||||||
PrintVersion();
|
|
||||||
return 0;
|
|
||||||
case 'd':
|
|
||||||
datastring = argv[optind];
|
|
||||||
++optind;
|
|
||||||
break;
|
|
||||||
case 'l':
|
|
||||||
console_log = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
#ifdef _WIN32
|
|
||||||
filepath = Common::UTF16ToUTF8(argv_w[optind]);
|
|
||||||
#else
|
|
||||||
filepath = argv[optind];
|
|
||||||
#endif
|
|
||||||
optind++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
InitializeLogging(console_log);
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
LocalFree(argv_w);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
MicroProfileOnThreadCreate("EmuThread");
|
|
||||||
SCOPE_EXIT({ MicroProfileShutdown(); });
|
|
||||||
|
|
||||||
if (filepath.empty()) {
|
|
||||||
LOG_CRITICAL(Frontend, "Failed to load application: No application specified");
|
|
||||||
std::cout << "Failed to load application: No application specified" << std::endl;
|
|
||||||
PrintHelp(argv[0]);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
Core::System& system{Core::System::GetInstance()};
|
|
||||||
|
|
||||||
Settings::Apply(system);
|
|
||||||
|
|
||||||
const auto emu_window{std::make_unique<EmuWindow_SDL2_Hide>()};
|
|
||||||
|
|
||||||
bool finished = false;
|
|
||||||
int return_value = 0;
|
|
||||||
const auto callback = [&finished,
|
|
||||||
&return_value](std::vector<Service::Yuzu::TestResult> results) {
|
|
||||||
finished = true;
|
|
||||||
return_value = 0;
|
|
||||||
|
|
||||||
// Find the minimum length needed to fully enclose all test names (and the header field) in
|
|
||||||
// the fmt::format column by first finding the maximum size of any test name and comparing
|
|
||||||
// that to 9, the string length of 'Test Name'
|
|
||||||
const auto needed_length_name =
|
|
||||||
std::max<u64>(std::max_element(results.begin(), results.end(),
|
|
||||||
[](const auto& lhs, const auto& rhs) {
|
|
||||||
return lhs.name.size() < rhs.name.size();
|
|
||||||
})
|
|
||||||
->name.size(),
|
|
||||||
9ull);
|
|
||||||
|
|
||||||
std::size_t passed = 0;
|
|
||||||
std::size_t failed = 0;
|
|
||||||
|
|
||||||
std::cout << fmt::format("Result [Res Code] | {:<{}} | Extra Data", "Test Name",
|
|
||||||
needed_length_name)
|
|
||||||
<< std::endl;
|
|
||||||
|
|
||||||
for (const auto& res : results) {
|
|
||||||
const auto main_res = res.code == 0 ? "PASSED" : "FAILED";
|
|
||||||
if (res.code == 0)
|
|
||||||
++passed;
|
|
||||||
else
|
|
||||||
++failed;
|
|
||||||
std::cout << fmt::format("{} [{:08X}] | {:<{}} | {}", main_res, res.code, res.name,
|
|
||||||
needed_length_name, res.data)
|
|
||||||
<< std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::cout << std::endl
|
|
||||||
<< fmt::format("{:4d} Passed | {:4d} Failed | {:4d} Total | {:2.2f} Passed Ratio",
|
|
||||||
passed, failed, passed + failed,
|
|
||||||
static_cast<float>(passed) / (passed + failed))
|
|
||||||
<< std::endl
|
|
||||||
<< (failed == 0 ? "PASSED" : "FAILED") << std::endl;
|
|
||||||
|
|
||||||
if (failed > 0)
|
|
||||||
return_value = -1;
|
|
||||||
};
|
|
||||||
|
|
||||||
system.SetContentProvider(std::make_unique<FileSys::ContentProviderUnion>());
|
|
||||||
system.SetFilesystem(std::make_shared<FileSys::RealVfsFilesystem>());
|
|
||||||
system.GetFileSystemController().CreateFactories(*system.GetFilesystem());
|
|
||||||
|
|
||||||
SCOPE_EXIT({ system.Shutdown(); });
|
|
||||||
|
|
||||||
const Core::System::ResultStatus load_result{system.Load(*emu_window, filepath)};
|
|
||||||
|
|
||||||
switch (load_result) {
|
|
||||||
case Core::System::ResultStatus::ErrorGetLoader:
|
|
||||||
LOG_CRITICAL(Frontend, "Failed to obtain loader for {}!", filepath);
|
|
||||||
return -1;
|
|
||||||
case Core::System::ResultStatus::ErrorLoader:
|
|
||||||
LOG_CRITICAL(Frontend, "Failed to load ROM!");
|
|
||||||
return -1;
|
|
||||||
case Core::System::ResultStatus::ErrorNotInitialized:
|
|
||||||
LOG_CRITICAL(Frontend, "CPUCore not initialized");
|
|
||||||
return -1;
|
|
||||||
case Core::System::ResultStatus::ErrorVideoCore:
|
|
||||||
LOG_CRITICAL(Frontend, "Failed to initialize VideoCore!");
|
|
||||||
return -1;
|
|
||||||
case Core::System::ResultStatus::Success:
|
|
||||||
break; // Expected case
|
|
||||||
default:
|
|
||||||
if (static_cast<u32>(load_result) >
|
|
||||||
static_cast<u32>(Core::System::ResultStatus::ErrorLoader)) {
|
|
||||||
const u16 loader_id = static_cast<u16>(Core::System::ResultStatus::ErrorLoader);
|
|
||||||
const u16 error_id = static_cast<u16>(load_result) - loader_id;
|
|
||||||
LOG_CRITICAL(Frontend,
|
|
||||||
"While attempting to load the ROM requested, an error occurred. Please "
|
|
||||||
"refer to the yuzu wiki for more information or the yuzu discord for "
|
|
||||||
"additional help.\n\nError Code: {:04X}-{:04X}\nError Description: {}",
|
|
||||||
loader_id, error_id, static_cast<Loader::ResultStatus>(error_id));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
Service::Yuzu::InstallInterfaces(system, datastring, callback);
|
|
||||||
|
|
||||||
system.TelemetrySession().AddField(Common::Telemetry::FieldType::App, "Frontend",
|
|
||||||
"SDLHideTester");
|
|
||||||
|
|
||||||
system.GPU().Start();
|
|
||||||
|
|
||||||
void(system.Run());
|
|
||||||
while (!finished) {
|
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
|
||||||
}
|
|
||||||
void(system.Pause());
|
|
||||||
|
|
||||||
detached_tasks.WaitForAllTasks();
|
|
||||||
return return_value;
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
#include "winresrc.h"
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Icon
|
|
||||||
//
|
|
||||||
|
|
||||||
// Icon with lowest ID value placed first to ensure application icon
|
|
||||||
// remains consistent on all systems.
|
|
||||||
YUZU_ICON ICON "../../dist/yuzu.ico"
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// RT_MANIFEST
|
|
||||||
//
|
|
||||||
|
|
||||||
0 RT_MANIFEST "../../dist/yuzu.manifest"
|
|
Loading…
Reference in a new issue