early-access version 1892

This commit is contained in:
pineappleEA 2021-07-19 19:59:17 +02:00
parent 18220fc112
commit aa72fecca3
6 changed files with 134 additions and 67 deletions

View file

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 1891. This is the source code for early-access 1892.
## Legal Notice ## Legal Notice

View file

@ -60,7 +60,7 @@ Loader::ResultStatus NSP::GetProgramStatus() const {
u64 NSP::GetProgramTitleID() const { u64 NSP::GetProgramTitleID() const {
if (IsExtractedType()) { if (IsExtractedType()) {
return GetExtractedTitleID(); return GetExtractedTitleID() + program_index;
} }
auto program_id = expected_program_id; auto program_id = expected_program_id;
@ -142,12 +142,11 @@ NSP::GetNCAs() const {
return ncas; return ncas;
} }
std::shared_ptr<NCA> NSP::GetNCA(u64 title_id_, ContentRecordType type, std::shared_ptr<NCA> NSP::GetNCA(u64 title_id, ContentRecordType type, TitleType title_type) const {
TitleType title_type) const {
if (extracted) if (extracted)
LOG_WARNING(Service_FS, "called on an NSP that is of type extracted."); LOG_WARNING(Service_FS, "called on an NSP that is of type extracted.");
const auto title_id_iter = ncas.find(title_id_); const auto title_id_iter = ncas.find(title_id);
if (title_id_iter == ncas.end()) if (title_id_iter == ncas.end())
return nullptr; return nullptr;
@ -158,10 +157,10 @@ std::shared_ptr<NCA> NSP::GetNCA(u64 title_id_, ContentRecordType type,
return type_iter->second; return type_iter->second;
} }
VirtualFile NSP::GetNCAFile(u64 title_id_, ContentRecordType type, TitleType title_type) const { VirtualFile NSP::GetNCAFile(u64 title_id, ContentRecordType type, TitleType title_type) const {
if (extracted) if (extracted)
LOG_WARNING(Service_FS, "called on an NSP that is of type extracted."); LOG_WARNING(Service_FS, "called on an NSP that is of type extracted.");
const auto nca = GetNCA(title_id_, type, title_type); const auto nca = GetNCA(title_id, type, title_type);
if (nca != nullptr) if (nca != nullptr)
return nca->GetBaseFile(); return nca->GetBaseFile();
return nullptr; return nullptr;

View file

@ -112,6 +112,7 @@ void QtNXWebEngineView::LoadLocalWebPage(const std::string& main_url,
SetExitReason(Service::AM::Applets::WebExitReason::EndButtonPressed); SetExitReason(Service::AM::Applets::WebExitReason::EndButtonPressed);
SetLastURL("http://localhost/"); SetLastURL("http://localhost/");
StartInputThread(); StartInputThread();
FocusFirstLinkElement();
load(QUrl(QUrl::fromLocalFile(QString::fromStdString(main_url)).toString() + load(QUrl(QUrl::fromLocalFile(QString::fromStdString(main_url)).toString() +
QString::fromStdString(additional_args))); QString::fromStdString(additional_args)));
@ -128,6 +129,8 @@ void QtNXWebEngineView::LoadExternalWebPage(const std::string& main_url,
StartInputThread(); StartInputThread();
load(QUrl(QString::fromStdString(main_url) + QString::fromStdString(additional_args))); load(QUrl(QString::fromStdString(main_url) + QString::fromStdString(additional_args)));
FocusFirstLinkElement();
} }
void QtNXWebEngineView::SetUserAgent(UserAgent user_agent) { void QtNXWebEngineView::SetUserAgent(UserAgent user_agent) {
@ -208,7 +211,7 @@ void QtNXWebEngineView::HandleWindowFooterButtonPressedOnce() {
if (input_interpreter->IsButtonPressedOnce(button)) { if (input_interpreter->IsButtonPressedOnce(button)) {
page()->runJavaScript( page()->runJavaScript(
QStringLiteral("yuzu_key_callbacks[%1] == null;").arg(static_cast<u8>(button)), QStringLiteral("yuzu_key_callbacks[%1] == null;").arg(static_cast<u8>(button)),
[&](const QVariant& variant) { [this, button](const QVariant& variant) {
if (variant.toBool()) { if (variant.toBool()) {
switch (button) { switch (button) {
case HIDButton::A: case HIDButton::A:
@ -364,6 +367,20 @@ void QtNXWebEngineView::LoadExtractedFonts() {
Qt::QueuedConnection); Qt::QueuedConnection);
} }
void QtNXWebEngineView::FocusFirstLinkElement() {
QWebEngineScript focus_link_element;
constexpr char FOCUS_LINK_ELEMENT_SCRIPT[] =
R"(document.getElementsByTagName("a")[0].focus();)";
focus_link_element.setName(QStringLiteral("focus_link_element.js"));
focus_link_element.setSourceCode(QString::fromStdString(FOCUS_LINK_ELEMENT_SCRIPT));
focus_link_element.setWorldId(QWebEngineScript::MainWorld);
focus_link_element.setInjectionPoint(QWebEngineScript::Deferred);
focus_link_element.setRunsOnSubFrames(true);
default_profile->scripts()->insert(focus_link_element);
}
#endif #endif
QtWebBrowser::QtWebBrowser(GMainWindow& main_window) { QtWebBrowser::QtWebBrowser(GMainWindow& main_window) {

View file

@ -161,6 +161,9 @@ private:
/// Loads the extracted fonts using JavaScript. /// Loads the extracted fonts using JavaScript.
void LoadExtractedFonts(); void LoadExtractedFonts();
/// Brings focus to the first available link element.
void FocusFirstLinkElement();
InputCommon::InputSubsystem* input_subsystem; InputCommon::InputSubsystem* input_subsystem;
std::unique_ptr<UrlRequestInterceptor> url_interceptor; std::unique_ptr<UrlRequestInterceptor> url_interceptor;

View file

@ -292,6 +292,8 @@ void Config::ReadValues() {
ReadSetting("ControlsGeneral", Settings::values.motion_device); ReadSetting("ControlsGeneral", Settings::values.motion_device);
ReadSetting("ControlsGeneral", Settings::values.touch_device);
ReadSetting("ControlsGeneral", Settings::values.keyboard_enabled); ReadSetting("ControlsGeneral", Settings::values.keyboard_enabled);
ReadSetting("ControlsGeneral", Settings::values.debug_pad_enabled); ReadSetting("ControlsGeneral", Settings::values.debug_pad_enabled);
@ -414,11 +416,31 @@ void Config::ReadValues() {
} }
ReadSetting("System", Settings::values.language_index); ReadSetting("System", Settings::values.language_index);
ReadSetting("System", Settings::values.region_index);
ReadSetting("System", Settings::values.time_zone_index); ReadSetting("System", Settings::values.time_zone_index);
ReadSetting("System", Settings::values.sound_index);
// Core // Core
ReadSetting("Core", Settings::values.use_multi_core); ReadSetting("Core", Settings::values.use_multi_core);
// Cpu
ReadSetting("Cpu", Settings::values.cpu_accuracy);
ReadSetting("Cpu", Settings::values.cpu_debug_mode);
ReadSetting("Cpu", Settings::values.cpuopt_page_tables);
ReadSetting("Cpu", Settings::values.cpuopt_block_linking);
ReadSetting("Cpu", Settings::values.cpuopt_return_stack_buffer);
ReadSetting("Cpu", Settings::values.cpuopt_fast_dispatcher);
ReadSetting("Cpu", Settings::values.cpuopt_context_elimination);
ReadSetting("Cpu", Settings::values.cpuopt_const_prop);
ReadSetting("Cpu", Settings::values.cpuopt_misc_ir);
ReadSetting("Cpu", Settings::values.cpuopt_reduce_misalign_checks);
ReadSetting("Cpu", Settings::values.cpuopt_fastmem);
ReadSetting("Cpu", Settings::values.cpuopt_unsafe_unfuse_fma);
ReadSetting("Cpu", Settings::values.cpuopt_unsafe_reduce_fp_error);
ReadSetting("Cpu", Settings::values.cpuopt_unsafe_ignore_standard_fpcr);
ReadSetting("Cpu", Settings::values.cpuopt_unsafe_inaccurate_nan);
ReadSetting("Cpu", Settings::values.cpuopt_unsafe_fastmem_check);
// Renderer // Renderer
ReadSetting("Renderer", Settings::values.renderer_backend); ReadSetting("Renderer", Settings::values.renderer_backend);
ReadSetting("Renderer", Settings::values.renderer_debug); ReadSetting("Renderer", Settings::values.renderer_debug);
@ -440,6 +462,7 @@ void Config::ReadValues() {
ReadSetting("Renderer", Settings::values.use_nvdec_emulation); ReadSetting("Renderer", Settings::values.use_nvdec_emulation);
ReadSetting("Renderer", Settings::values.accelerate_astc); ReadSetting("Renderer", Settings::values.accelerate_astc);
ReadSetting("Renderer", Settings::values.use_fast_gpu_time); ReadSetting("Renderer", Settings::values.use_fast_gpu_time);
ReadSetting("Renderer", Settings::values.use_caches_gc);
ReadSetting("Renderer", Settings::values.bg_red); ReadSetting("Renderer", Settings::values.bg_red);
ReadSetting("Renderer", Settings::values.bg_green); ReadSetting("Renderer", Settings::values.bg_green);
@ -460,7 +483,6 @@ void Config::ReadValues() {
// Debugging // Debugging
Settings::values.record_frame_times = Settings::values.record_frame_times =
sdl2_config->GetBoolean("Debugging", "record_frame_times", false); sdl2_config->GetBoolean("Debugging", "record_frame_times", false);
ReadSetting("Debugging", Settings::values.program_args);
ReadSetting("Debugging", Settings::values.dump_exefs); ReadSetting("Debugging", Settings::values.dump_exefs);
ReadSetting("Debugging", Settings::values.dump_nso); ReadSetting("Debugging", Settings::values.dump_nso);
ReadSetting("Debugging", Settings::values.enable_fs_access_log); ReadSetting("Debugging", Settings::values.enable_fs_access_log);

View file

@ -65,6 +65,13 @@ button_screenshot=
lstick= lstick=
rstick= rstick=
# To use the debug_pad, prepend `debug_pad_` before each button setting above.
# i.e. debug_pad_button_a=
# Enable debug pad inputs to the guest
# 0 (default): Disabled, 1: Enabled
debug_pad_enabled =
# Whether to enable or disable vibration # Whether to enable or disable vibration
# 0: Disabled, 1 (default): Enabled # 0: Disabled, 1 (default): Enabled
vibration_enabled= vibration_enabled=
@ -73,6 +80,10 @@ vibration_enabled=
# 0 (default): Disabled, 1: Enabled # 0 (default): Disabled, 1: Enabled
enable_accurate_vibrations= enable_accurate_vibrations=
# Enables controller motion inputs
# 0: Disabled, 1 (default): Enabled
motion_enabled =
# for motion input, the following devices are available: # for motion input, the following devices are available:
# - "motion_emu" (default) for emulating motion input from mouse input. Required parameters: # - "motion_emu" (default) for emulating motion input from mouse input. Required parameters:
# - "update_period": update period in milliseconds (default to 100) # - "update_period": update period in milliseconds (default to 100)
@ -98,19 +109,30 @@ use_touch_from_button=
#touch_from_button_maps_0_bind_1=bar #touch_from_button_maps_0_bind_1=bar
# etc. # etc.
# Most desktop operating systems do not expose a way to poll the motion state of the controllers # List of Cemuhook UDP servers, delimited by ','.
# so as a way around it, cemuhook created a udp client/server protocol to broadcast the data directly # Default: 127.0.0.1:26760
# from a controller device to the client program. Citra has a client that can connect and read # Example: 127.0.0.1:26760,123.4.5.67:26761
# from any cemuhook compatible motion program. udp_input_servers =
# IPv4 address of the udp input server (Default "127.0.0.1") # Enable controlling an axis via a mouse input.
udp_input_address=127.0.0.1 # 0 (default): Off, 1: On
mouse_panning =
# Port of the udp input server. (Default 26760) # Set mouse sensitivity.
udp_input_port= # Default: 1.0
mouse_panning_sensitivity =
# The pad to request data on. Should be between 0 (Pad 1) and 3 (Pad 4). (Default 0) # Emulate an analog control stick from keyboard inputs.
udp_pad_index= # 0 (default): Disabled, 1: Enabled
emulate_analog_keyboard =
# Enable mouse inputs to the guest
# 0 (default): Disabled, 1: Enabled
mouse_enabled =
# Enable keyboard inputs to the guest
# 0 (default): Disabled, 1: Enabled
keyboard_enabled =
[Core] [Core]
# Whether to use multi-core for CPU emulation # Whether to use multi-core for CPU emulation
@ -118,6 +140,17 @@ udp_pad_index=
use_multi_core= use_multi_core=
[Cpu] [Cpu]
# Adjusts various optimizations.
# Auto-select mode enables choice unsafe optimizations.
# Accurate enables only safe optimizations.
# Unsafe allows any unsafe optimizations.
# 0 (default): Auto-select, 1: Accurate, 2: Enable unsafe optimizations
cpu_accuracy =
# Allow disabling safe optimizations.
# 0 (default): Disabled, 1: Enabled
cpu_debug_mode =
# Enable inline page tables optimization (faster guest memory access) # Enable inline page tables optimization (faster guest memory access)
# 0: Disabled, 1 (default): Enabled # 0: Disabled, 1 (default): Enabled
cpuopt_page_tables = cpuopt_page_tables =
@ -154,6 +187,31 @@ cpuopt_reduce_misalign_checks =
# 0: Disabled, 1 (default): Enabled # 0: Disabled, 1 (default): Enabled
cpuopt_fastmem = cpuopt_fastmem =
# Enable unfuse FMA (improve performance on CPUs without FMA)
# Only enabled if cpu_accuracy is set to Unsafe. Automatically chosen with cpu_accuracy = Auto-select.
# 0: Disabled, 1 (default): Enabled
cpuopt_unsafe_unfuse_fma =
# Enable faster FRSQRTE and FRECPE
# Only enabled if cpu_accuracy is set to Unsafe.
# 0: Disabled, 1 (default): Enabled
cpuopt_unsafe_reduce_fp_error =
# Enable faster ASIMD instructions (32 bits only)
# Only enabled if cpu_accuracy is set to Unsafe. Automatically chosen with cpu_accuracy = Auto-select.
# 0: Disabled, 1 (default): Enabled
cpuopt_unsafe_ignore_standard_fpcr =
# Enable inaccurate NaN handling
# Only enabled if cpu_accuracy is set to Unsafe. Automatically chosen with cpu_accuracy = Auto-select.
# 0: Disabled, 1 (default): Enabled
cpuopt_unsafe_inaccurate_nan =
# Disable address space checks (64 bits only)
# Only enabled if cpu_accuracy is set to Unsafe. Automatically chosen with cpu_accuracy = Auto-select.
# 0: Disabled, 1 (default): Enabled
cpuopt_unsafe_fastmem_check =
[Renderer] [Renderer]
# Which backend API to use. # Which backend API to use.
# 0 (default): OpenGL, 1: Vulkan # 0 (default): OpenGL, 1: Vulkan
@ -174,14 +232,6 @@ disable_shader_loop_safety_checks =
# Which Vulkan physical device to use (defaults to 0) # Which Vulkan physical device to use (defaults to 0)
vulkan_device = vulkan_device =
# 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 # Aspect ratio
# 0: Default (16:9), 1: Force 4:3, 2: Force 21:9, 3: Stretch to Window # 0: Default (16:9), 1: Force 4:3, 2: Force 21:9, 3: Stretch to Window
aspect_ratio = aspect_ratio =
@ -220,21 +270,20 @@ use_frame_limit =
frame_limit = frame_limit =
# Whether to use disk based shader cache # Whether to use disk based shader cache
# 0 (default): Off, 1 : On # 0: Off, 1 (default): On
use_disk_shader_cache = use_disk_shader_cache =
# Which gpu accuracy level to use # Which gpu accuracy level to use
# 0 (Normal), 1 (High), 2 (Extreme) # 0: Normal, 1 (default): High, 2: Extreme (Very slow)
gpu_accuracy = gpu_accuracy =
# Whether to use asynchronous GPU emulation # Whether to use asynchronous GPU emulation
# 0 : Off (slow), 1 (default): On (fast) # 0 : Off (slow), 1 (default): On (fast)
use_asynchronous_gpu_emulation = use_asynchronous_gpu_emulation =
# Forces VSync on the display thread. Usually doesn't impact performance, but on some drivers it can # Inform the guest that GPU operations completed more quickly than they did.
# so only turn this off if you notice a speed difference.
# 0: Off, 1 (default): On # 0: Off, 1 (default): On
use_vsync = use_fast_gpu_time =
# Whether to use garbage collection or not for GPU caches. # Whether to use garbage collection or not for GPU caches.
# 0 (default): Off, 1: On # 0 (default): Off, 1: On
@ -246,31 +295,6 @@ bg_red =
bg_blue = bg_blue =
bg_green = 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 =
[Audio] [Audio]
# Which audio output engine to use. # Which audio output engine to use.
# auto (default): Auto-select # auto (default): Auto-select
@ -317,10 +341,6 @@ gamecard_path =
# 1 (default): Yes, 0: No # 1 (default): Yes, 0: No
use_docked_mode = 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 # 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 will be ignored and randomly generated if rng_seed_enabled is false
rng_seed_enabled = rng_seed_enabled =
@ -332,10 +352,6 @@ rng_seed =
custom_rtc_enabled = custom_rtc_enabled =
custom_rtc = custom_rtc =
# Sets the account username, max length is 32 characters
# yuzu (default)
username = yuzu
# Sets the systems language index # Sets the systems language index
# 0: Japanese, 1: English (default), 2: French, 3: German, 4: Italian, 5: Spanish, 6: Chinese, # 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, # 7: Korean, 8: Dutch, 9: Portuguese, 10: Russian, 11: Taiwanese, 12: British English, 13: Canadian French,
@ -344,17 +360,25 @@ language_index =
# The system region that yuzu will use during emulation # 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 # -1: Auto-select (default), 0: Japan, 1: USA, 2: Europe, 3: Australia, 4: China, 5: Korea, 6: Taiwan
region_value = region_index =
# The system time zone that yuzu will use during emulation # The system time zone that yuzu will use during emulation
# 0: Auto-select (default), 1: Default (system archive value), Others: Index for specified time zone # 0: Auto-select (default), 1: Default (system archive value), Others: Index for specified time zone
time_zone_index = time_zone_index =
# Sets the sound output mode.
# 0: Mono, 1 (default): Stereo, 2: Surround
sound_index =
[Miscellaneous] [Miscellaneous]
# A filter which removes logs below a certain logging level. # A filter which removes logs below a certain logging level.
# Examples: *:Debug Kernel.SVC:Trace Service.*:Critical # Examples: *:Debug Kernel.SVC:Trace Service.*:Critical
log_filter = *:Trace log_filter = *:Trace
# Use developer keys
# 0 (default): Disabled, 1: Enabled
use_dev_keys =
[Debugging] [Debugging]
# Record frame time data, can be found in the log directory. Boolean value # Record frame time data, can be found in the log directory. Boolean value
record_frame_times = record_frame_times =
@ -364,6 +388,8 @@ dump_exefs=false
dump_nso=false dump_nso=false
# Determines whether or not yuzu will save the filesystem access log. # Determines whether or not yuzu will save the filesystem access log.
enable_fs_access_log=false enable_fs_access_log=false
# Enables verbose reporting services
reporting_services =
# Determines whether or not yuzu will report to the game that the emulated console is in Kiosk Mode # Determines whether or not yuzu will report to the game that the emulated console is in Kiosk Mode
# false: Retail/Normal Mode (default), true: Kiosk Mode # false: Retail/Normal Mode (default), true: Kiosk Mode
quest_flag = quest_flag =
@ -402,4 +428,4 @@ 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 '|') # 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 # e.x. disabled_0100000000010000 = Update|DLC <- disables Updates and DLC on Super Mario Odyssey
)"; )";
} } // namespace DefaultINI