early-access version 2186
This commit is contained in:
parent
9d2764d87f
commit
e7eaa74d41
@ -1,7 +1,7 @@
|
||||
yuzu emulator early access
|
||||
=============
|
||||
|
||||
This is the source code for early-access 2185.
|
||||
This is the source code for early-access 2186.
|
||||
|
||||
## Legal Notice
|
||||
|
||||
|
@ -9,7 +9,6 @@
|
||||
|
||||
#include <dynarmic/interface/A32/a32.h>
|
||||
#include <dynarmic/interface/A64/a64.h>
|
||||
#include <dynarmic/interface/exclusive_monitor.h>
|
||||
#include "common/common_types.h"
|
||||
#include "common/hash.h"
|
||||
#include "core/arm/arm_interface.h"
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "core/core_timing.h"
|
||||
#include "core/hardware_properties.h"
|
||||
#include "core/hle/kernel/k_process.h"
|
||||
#include "core/hle/kernel/k_scheduler.h"
|
||||
#include "core/hle/kernel/svc.h"
|
||||
#include "core/memory.h"
|
||||
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include "core/arm/dynarmic/arm_dynarmic_cp15.h"
|
||||
#include "core/core.h"
|
||||
#include "core/core_timing.h"
|
||||
#include "core/core_timing_util.h"
|
||||
|
||||
using Callback = Dynarmic::A32::Coprocessor::Callback;
|
||||
using CallbackOrAccessOneWord = Dynarmic::A32::Coprocessor::CallbackOrAccessOneWord;
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
|
||||
#include <dynarmic/interface/A32/coprocessor.h>
|
||||
|
@ -2,8 +2,6 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <cinttypes>
|
||||
#include <memory>
|
||||
#include "core/arm/dynarmic/arm_exclusive_monitor.h"
|
||||
#include "core/memory.h"
|
||||
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
|
||||
#include <dynarmic/interface/exclusive_monitor.h>
|
||||
|
@ -19,21 +19,17 @@
|
||||
#include "core/cpu_manager.h"
|
||||
#include "core/device_memory.h"
|
||||
#include "core/file_sys/bis_factory.h"
|
||||
#include "core/file_sys/card_image.h"
|
||||
#include "core/file_sys/mode.h"
|
||||
#include "core/file_sys/patch_manager.h"
|
||||
#include "core/file_sys/registered_cache.h"
|
||||
#include "core/file_sys/romfs_factory.h"
|
||||
#include "core/file_sys/savedata_factory.h"
|
||||
#include "core/file_sys/sdmc_factory.h"
|
||||
#include "core/file_sys/vfs_concat.h"
|
||||
#include "core/file_sys/vfs_real.h"
|
||||
#include "core/hardware_interrupt_manager.h"
|
||||
#include "core/hid/hid_core.h"
|
||||
#include "core/hle/kernel/k_client_port.h"
|
||||
#include "core/hle/kernel/k_process.h"
|
||||
#include "core/hle/kernel/k_scheduler.h"
|
||||
#include "core/hle/kernel/k_thread.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/kernel/physical_core.h"
|
||||
#include "core/hle/service/am/applets/applets.h"
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include <chrono>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include "common/microprofile.h"
|
||||
#include "common/scope_exit.h"
|
||||
#include "common/thread.h"
|
||||
#include "core/arm/exclusive_monitor.h"
|
||||
#include "core/core.h"
|
||||
#include "core/core_timing.h"
|
||||
#include "core/cpu_manager.h"
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include "common/assert.h"
|
||||
#include "core/crypto/ctr_encryption_layer.h"
|
||||
|
||||
namespace Core::Crypto {
|
||||
|
@ -10,14 +10,12 @@
|
||||
#include <locale>
|
||||
#include <map>
|
||||
#include <sstream>
|
||||
#include <string_view>
|
||||
#include <tuple>
|
||||
#include <vector>
|
||||
#include <mbedtls/bignum.h>
|
||||
#include <mbedtls/cipher.h>
|
||||
#include <mbedtls/cmac.h>
|
||||
#include <mbedtls/sha256.h>
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/fs/file.h"
|
||||
#include "common/fs/fs.h"
|
||||
#include "common/fs/path_util.h"
|
||||
@ -30,7 +28,6 @@
|
||||
#include "core/crypto/partition_data_manager.h"
|
||||
#include "core/file_sys/content_archive.h"
|
||||
#include "core/file_sys/nca_metadata.h"
|
||||
#include "core/file_sys/partition_filesystem.h"
|
||||
#include "core/file_sys/registered_cache.h"
|
||||
#include "core/hle/service/filesystem/filesystem.h"
|
||||
#include "core/loader/loader.h"
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/common_types.h"
|
||||
#include "core/crypto/partition_data_manager.h"
|
||||
#include "core/file_sys/vfs_types.h"
|
||||
|
||||
namespace Common::FS {
|
||||
class IOFile;
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include <cctype>
|
||||
#include <cstring>
|
||||
#include <mbedtls/sha256.h>
|
||||
#include "common/assert.h"
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/common_types.h"
|
||||
#include "common/hex_util.h"
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include "common/assert.h"
|
||||
#include "core/crypto/xts_encryption_layer.h"
|
||||
|
||||
namespace Core::Crypto {
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "core/file_sys/nca_metadata.h"
|
||||
#include "core/file_sys/partition_filesystem.h"
|
||||
#include "core/file_sys/submission_package.h"
|
||||
#include "core/file_sys/vfs_concat.h"
|
||||
#include "core/file_sys/vfs_offset.h"
|
||||
#include "core/file_sys/vfs_vector.h"
|
||||
#include "core/loader/loader.h"
|
||||
|
@ -5,7 +5,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/common_types.h"
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
#include <cstddef>
|
||||
#include <iterator>
|
||||
#include <string_view>
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/common_types.h"
|
||||
|
||||
|
@ -5,7 +5,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/common_types.h"
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include "common/assert.h"
|
||||
#include "common/common_types.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "core/file_sys/card_image.h"
|
||||
#include "core/file_sys/common_funcs.h"
|
||||
#include "core/file_sys/content_archive.h"
|
||||
#include "core/file_sys/nca_metadata.h"
|
||||
|
@ -5,8 +5,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "core/file_sys/vfs.h"
|
||||
#include "core/file_sys/vfs_types.h"
|
||||
#include "core/hle/result.h"
|
||||
|
||||
namespace Loader {
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include <string>
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/common_types.h"
|
||||
#include "common/swap.h"
|
||||
#include "core/file_sys/vfs.h"
|
||||
#include "core/hle/result.h"
|
||||
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include <string_view>
|
||||
|
||||
#include <fmt/ostream.h>
|
||||
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "core/file_sys/vfs_types.h"
|
||||
|
||||
namespace FileSys::SystemArchive {
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string_view>
|
||||
#include "core/file_sys/vfs.h"
|
||||
|
||||
namespace FileSys {
|
||||
|
@ -5,7 +5,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string_view>
|
||||
|
||||
#include "core/file_sys/vfs.h"
|
||||
|
||||
|
@ -44,26 +44,26 @@ void DefaultControllerApplet::ReconfigureControllers(std::function<void()> callb
|
||||
// Connect controllers based on the following priority list from highest to lowest priority:
|
||||
// Pro Controller -> Dual Joycons -> Left Joycon/Right Joycon -> Handheld
|
||||
if (parameters.allow_pro_controller) {
|
||||
controller->SetNpadType(Core::HID::NpadType::ProController);
|
||||
controller->SetNpadStyleIndex(Core::HID::NpadStyleIndex::ProController);
|
||||
controller->Connect();
|
||||
} else if (parameters.allow_dual_joycons) {
|
||||
controller->SetNpadType(Core::HID::NpadType::JoyconDual);
|
||||
controller->SetNpadStyleIndex(Core::HID::NpadStyleIndex::JoyconDual);
|
||||
controller->Connect();
|
||||
} else if (parameters.allow_left_joycon && parameters.allow_right_joycon) {
|
||||
// Assign left joycons to even player indices and right joycons to odd player indices.
|
||||
// We do this since Captain Toad Treasure Tracker expects a left joycon for Player 1 and
|
||||
// a right Joycon for Player 2 in 2 Player Assist mode.
|
||||
if (index % 2 == 0) {
|
||||
controller->SetNpadType(Core::HID::NpadType::JoyconLeft);
|
||||
controller->SetNpadStyleIndex(Core::HID::NpadStyleIndex::JoyconLeft);
|
||||
controller->Connect();
|
||||
} else {
|
||||
controller->SetNpadType(Core::HID::NpadType::JoyconRight);
|
||||
controller->SetNpadStyleIndex(Core::HID::NpadStyleIndex::JoyconRight);
|
||||
controller->Connect();
|
||||
}
|
||||
} else if (index == 0 && parameters.enable_single_mode && parameters.allow_handheld &&
|
||||
!Settings::values.use_docked_mode.GetValue()) {
|
||||
// We should *never* reach here under any normal circumstances.
|
||||
controller->SetNpadType(Core::HID::NpadType::Handheld);
|
||||
controller->SetNpadStyleIndex(Core::HID::NpadStyleIndex::Handheld);
|
||||
controller->Connect();
|
||||
} else {
|
||||
UNREACHABLE_MSG("Unable to add a new controller based on the given parameters!");
|
||||
|
@ -5,7 +5,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <optional>
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace Core::Frontend {
|
||||
|
@ -5,7 +5,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <thread>
|
||||
|
||||
#include "common/common_types.h"
|
||||
|
||||
|
@ -5,7 +5,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <string_view>
|
||||
|
||||
#include "core/hle/service/am/applets/applet_web_browser_types.h"
|
||||
|
||||
|
@ -2,7 +2,6 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <cmath>
|
||||
#include <mutex>
|
||||
#include "core/frontend/emu_window.h"
|
||||
|
||||
|
@ -5,7 +5,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
#include "common/common_types.h"
|
||||
#include "core/frontend/framebuffer_layout.h"
|
||||
|
@ -13,38 +13,38 @@ EmulatedController::EmulatedController(NpadIdType npad_id_type_) : npad_id_type(
|
||||
|
||||
EmulatedController::~EmulatedController() = default;
|
||||
|
||||
NpadType EmulatedController::MapSettingsTypeToNPad(Settings::ControllerType type) {
|
||||
NpadStyleIndex EmulatedController::MapSettingsTypeToNPad(Settings::ControllerType type) {
|
||||
switch (type) {
|
||||
case Settings::ControllerType::ProController:
|
||||
return NpadType::ProController;
|
||||
return NpadStyleIndex::ProController;
|
||||
case Settings::ControllerType::DualJoyconDetached:
|
||||
return NpadType::JoyconDual;
|
||||
return NpadStyleIndex::JoyconDual;
|
||||
case Settings::ControllerType::LeftJoycon:
|
||||
return NpadType::JoyconLeft;
|
||||
return NpadStyleIndex::JoyconLeft;
|
||||
case Settings::ControllerType::RightJoycon:
|
||||
return NpadType::JoyconRight;
|
||||
return NpadStyleIndex::JoyconRight;
|
||||
case Settings::ControllerType::Handheld:
|
||||
return NpadType::Handheld;
|
||||
return NpadStyleIndex::Handheld;
|
||||
case Settings::ControllerType::GameCube:
|
||||
return NpadType::GameCube;
|
||||
return NpadStyleIndex::GameCube;
|
||||
default:
|
||||
return NpadType::ProController;
|
||||
return NpadStyleIndex::ProController;
|
||||
}
|
||||
}
|
||||
|
||||
Settings::ControllerType EmulatedController::MapNPadToSettingsType(NpadType type) {
|
||||
Settings::ControllerType EmulatedController::MapNPadToSettingsType(NpadStyleIndex type) {
|
||||
switch (type) {
|
||||
case NpadType::ProController:
|
||||
case NpadStyleIndex::ProController:
|
||||
return Settings::ControllerType::ProController;
|
||||
case NpadType::JoyconDual:
|
||||
case NpadStyleIndex::JoyconDual:
|
||||
return Settings::ControllerType::DualJoyconDetached;
|
||||
case NpadType::JoyconLeft:
|
||||
case NpadStyleIndex::JoyconLeft:
|
||||
return Settings::ControllerType::LeftJoycon;
|
||||
case NpadType::JoyconRight:
|
||||
case NpadStyleIndex::JoyconRight:
|
||||
return Settings::ControllerType::RightJoycon;
|
||||
case NpadType::Handheld:
|
||||
case NpadStyleIndex::Handheld:
|
||||
return Settings::ControllerType::Handheld;
|
||||
case NpadType::GameCube:
|
||||
case NpadStyleIndex::GameCube:
|
||||
return Settings::ControllerType::GameCube;
|
||||
default:
|
||||
return Settings::ControllerType::ProController;
|
||||
@ -79,9 +79,9 @@ void EmulatedController::ReloadFromSettings() {
|
||||
|
||||
// Other or debug controller should always be a pro controller
|
||||
if (npad_id_type != NpadIdType::Other) {
|
||||
SetNpadType(MapSettingsTypeToNPad(player.controller_type));
|
||||
SetNpadStyleIndex(MapSettingsTypeToNPad(player.controller_type));
|
||||
} else {
|
||||
SetNpadType(NpadType::ProController);
|
||||
SetNpadStyleIndex(NpadStyleIndex::ProController);
|
||||
}
|
||||
|
||||
if (player.connected) {
|
||||
@ -306,7 +306,7 @@ void EmulatedController::DisableConfiguration() {
|
||||
if (is_connected) {
|
||||
Disconnect();
|
||||
}
|
||||
SetNpadType(tmp_npad_type);
|
||||
SetNpadStyleIndex(tmp_npad_type);
|
||||
}
|
||||
|
||||
// Apply temporary connected status to the real controller
|
||||
@ -569,10 +569,10 @@ void EmulatedController::SetButton(Common::Input::CallbackStatus callback, std::
|
||||
}
|
||||
}
|
||||
if (!is_connected) {
|
||||
if (npad_id_type == NpadIdType::Player1 && npad_type != NpadType::Handheld) {
|
||||
if (npad_id_type == NpadIdType::Player1 && npad_type != NpadStyleIndex::Handheld) {
|
||||
Connect();
|
||||
}
|
||||
if (npad_id_type == NpadIdType::Handheld && npad_type == NpadType::Handheld) {
|
||||
if (npad_id_type == NpadIdType::Handheld && npad_type == NpadStyleIndex::Handheld) {
|
||||
Connect();
|
||||
}
|
||||
}
|
||||
@ -880,7 +880,7 @@ void EmulatedController::Disconnect() {
|
||||
}
|
||||
|
||||
bool EmulatedController::IsConnected(bool get_temporary_value) const {
|
||||
if (get_temporary_value) {
|
||||
if (get_temporary_value && is_configuring) {
|
||||
return tmp_is_connected;
|
||||
}
|
||||
return is_connected;
|
||||
@ -896,14 +896,14 @@ NpadIdType EmulatedController::GetNpadIdType() const {
|
||||
return npad_id_type;
|
||||
}
|
||||
|
||||
NpadType EmulatedController::GetNpadType(bool get_temporary_value) const {
|
||||
if (get_temporary_value) {
|
||||
NpadStyleIndex EmulatedController::GetNpadStyleIndex(bool get_temporary_value) const {
|
||||
if (get_temporary_value && is_configuring) {
|
||||
return tmp_npad_type;
|
||||
}
|
||||
return npad_type;
|
||||
}
|
||||
|
||||
void EmulatedController::SetNpadType(NpadType npad_type_) {
|
||||
void EmulatedController::SetNpadStyleIndex(NpadStyleIndex npad_type_) {
|
||||
{
|
||||
std::lock_guard lock{mutex};
|
||||
|
||||
|
@ -142,23 +142,23 @@ public:
|
||||
YUZU_NON_MOVEABLE(EmulatedController);
|
||||
|
||||
/// Converts the controller type from settings to npad type
|
||||
static NpadType MapSettingsTypeToNPad(Settings::ControllerType type);
|
||||
static NpadStyleIndex MapSettingsTypeToNPad(Settings::ControllerType type);
|
||||
|
||||
/// Converts npad type to the equivalent of controller type from settings
|
||||
static Settings::ControllerType MapNPadToSettingsType(NpadType type);
|
||||
static Settings::ControllerType MapNPadToSettingsType(NpadStyleIndex type);
|
||||
|
||||
/// Gets the NpadIdType for this controller
|
||||
NpadIdType GetNpadIdType() const;
|
||||
|
||||
/// Sets the NpadType for this controller
|
||||
void SetNpadType(NpadType npad_type_);
|
||||
/// Sets the NpadStyleIndex for this controller
|
||||
void SetNpadStyleIndex(NpadStyleIndex npad_type_);
|
||||
|
||||
/**
|
||||
* Gets the NpadType for this controller
|
||||
* Gets the NpadStyleIndex for this controller
|
||||
* @param If true tmp_npad_type will be returned
|
||||
* @return NpadType set on the controller
|
||||
* @return NpadStyleIndex set on the controller
|
||||
*/
|
||||
NpadType GetNpadType(bool get_temporary_value = false) const;
|
||||
NpadStyleIndex GetNpadStyleIndex(bool get_temporary_value = false) const;
|
||||
|
||||
/// Sets the connected status to true
|
||||
void Connect();
|
||||
@ -351,14 +351,14 @@ private:
|
||||
void TriggerOnChange(ControllerTriggerType type, bool is_service_update);
|
||||
|
||||
NpadIdType npad_id_type;
|
||||
NpadType npad_type{NpadType::None};
|
||||
NpadStyleIndex npad_type{NpadStyleIndex::None};
|
||||
bool is_connected{false};
|
||||
bool is_configuring{false};
|
||||
f32 motion_sensitivity{0.01f};
|
||||
bool force_update_motion{false};
|
||||
|
||||
// Temporary values to avoid doing changes while the controller is on configuration mode
|
||||
NpadType tmp_npad_type{NpadType::None};
|
||||
NpadStyleIndex tmp_npad_type{NpadStyleIndex::None};
|
||||
bool tmp_is_connected{false};
|
||||
|
||||
ButtonParams button_params;
|
||||
|
@ -84,17 +84,24 @@ constexpr NpadIdType IndexToNpadIdType(size_t index) {
|
||||
}
|
||||
}
|
||||
|
||||
// This is nn::hid::NpadType
|
||||
enum class NpadType : u8 {
|
||||
// This is nn::hid::NpadStyleIndex
|
||||
enum class NpadStyleIndex : u8 {
|
||||
None = 0,
|
||||
ProController = 3,
|
||||
Handheld = 4,
|
||||
HandheldNES = 4,
|
||||
JoyconDual = 5,
|
||||
JoyconLeft = 6,
|
||||
JoyconRight = 7,
|
||||
GameCube = 8,
|
||||
Pokeball = 9,
|
||||
MaxNpadType = 10,
|
||||
NES = 10,
|
||||
SNES = 12,
|
||||
N64 = 13,
|
||||
SegaGenesis = 14,
|
||||
SystemExt = 32,
|
||||
System = 33,
|
||||
MaxNpadType = 34,
|
||||
};
|
||||
|
||||
// This is nn::hid::NpadStyleTag
|
||||
|
@ -4,8 +4,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace Kernel::Board::Nintendo::Nx::Smc {
|
||||
|
||||
enum MemorySize {
|
||||
|
@ -5,7 +5,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/kernel/physical_memory.h"
|
||||
|
@ -5,7 +5,6 @@
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
|
||||
#include <boost/range/algorithm_ext/erase.hpp>
|
||||
|
||||
@ -19,14 +18,9 @@
|
||||
#include "core/hle/kernel/k_handle_table.h"
|
||||
#include "core/hle/kernel/k_process.h"
|
||||
#include "core/hle/kernel/k_readable_event.h"
|
||||
#include "core/hle/kernel/k_scheduler.h"
|
||||
#include "core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h"
|
||||
#include "core/hle/kernel/k_server_session.h"
|
||||
#include "core/hle/kernel/k_thread.h"
|
||||
#include "core/hle/kernel/k_writable_event.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/kernel/svc_results.h"
|
||||
#include "core/hle/kernel/time_manager.h"
|
||||
#include "core/memory.h"
|
||||
|
||||
namespace Kernel {
|
||||
|
@ -20,8 +20,6 @@
|
||||
#include "core/hle/kernel/k_system_control.h"
|
||||
#include "core/hle/kernel/k_thread.h"
|
||||
#include "core/hle/kernel/k_transfer_memory.h"
|
||||
#include "core/hle/kernel/memory_types.h"
|
||||
#include "core/memory.h"
|
||||
|
||||
namespace Kernel::Init {
|
||||
|
||||
|
@ -4,14 +4,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
|
||||
#include <boost/intrusive/rbtree.hpp>
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/common_types.h"
|
||||
#include "common/intrusive_red_black_tree.h"
|
||||
#include "core/hle/kernel/k_auto_object.h"
|
||||
#include "core/hle/kernel/k_light_lock.h"
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
#include <atomic>
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "common/bit_util.h"
|
||||
#include "common/common_types.h"
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include "core/hle/kernel/k_server_session.h"
|
||||
#include "core/hle/kernel/k_session.h"
|
||||
#include "core/hle/kernel/k_thread.h"
|
||||
#include "core/hle/kernel/svc_results.h"
|
||||
#include "core/hle/result.h"
|
||||
|
||||
namespace Kernel {
|
||||
|
@ -4,11 +4,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "core/hle/kernel/k_auto_object.h"
|
||||
#include "core/hle/kernel/k_synchronization_object.h"
|
||||
#include "core/hle/kernel/slab_helpers.h"
|
||||
#include "core/hle/result.h"
|
||||
|
||||
|
@ -2,8 +2,6 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "core/arm/exclusive_monitor.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/kernel/k_condition_variable.h"
|
||||
|
@ -8,7 +8,6 @@
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "common/bit_field.h"
|
||||
#include "common/bit_util.h"
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/kernel/k_auto_object.h"
|
||||
#include "core/hle/kernel/k_spin_lock.h"
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/kernel/k_scheduler.h"
|
||||
#include "core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h"
|
||||
#include "core/hle/kernel/k_thread_queue.h"
|
||||
#include "core/hle/kernel/time_manager.h"
|
||||
|
||||
namespace Kernel {
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
#include <atomic>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/kernel/k_scoped_lock.h"
|
||||
|
||||
namespace Kernel {
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include <mutex>
|
||||
#include <tuple>
|
||||
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/kernel/k_page_heap.h"
|
||||
#include "core/hle/result.h"
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
#include "core/core.h"
|
||||
#include "core/hle/kernel/k_page_heap.h"
|
||||
#include "core/memory.h"
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
@ -5,12 +5,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <bit>
|
||||
#include <vector>
|
||||
|
||||
#include "common/alignment.h"
|
||||
#include "common/assert.h"
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/kernel/k_page_bitmap.h"
|
||||
#include "core/hle/kernel/memory_types.h"
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "common/common_types.h"
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include <cstddef>
|
||||
#include <list>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/kernel/k_address_arbiter.h"
|
||||
|
@ -5,7 +5,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "core/hardware_properties.h"
|
||||
#include "core/hle/kernel/k_spin_lock.h"
|
||||
#include "core/hle/kernel/k_thread.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
|
@ -7,7 +7,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include <concepts>
|
||||
#include <type_traits>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
@ -8,7 +8,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/kernel/k_handle_table.h"
|
||||
#include "core/hle/kernel/k_thread.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/kernel/time_manager.h"
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "core/hle/kernel/k_server_port.h"
|
||||
#include "core/hle/kernel/k_server_session.h"
|
||||
#include "core/hle/kernel/k_thread.h"
|
||||
#include "core/hle/kernel/svc_results.h"
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
@ -7,14 +7,11 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/intrusive/list.hpp>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/kernel/k_server_session.h"
|
||||
#include "core/hle/kernel/k_synchronization_object.h"
|
||||
#include "core/hle/result.h"
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "core/hle/kernel/hle_ipc.h"
|
||||
#include "core/hle/kernel/k_client_port.h"
|
||||
#include "core/hle/kernel/k_handle_table.h"
|
||||
#include "core/hle/kernel/k_port.h"
|
||||
#include "core/hle/kernel/k_process.h"
|
||||
#include "core/hle/kernel/k_scheduler.h"
|
||||
#include "core/hle/kernel/k_server_port.h"
|
||||
@ -22,6 +21,7 @@
|
||||
#include "core/hle/kernel/k_session.h"
|
||||
#include "core/hle/kernel/k_thread.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/kernel/service_thread.h"
|
||||
#include "core/memory.h"
|
||||
|
||||
namespace Kernel {
|
||||
|
@ -7,14 +7,11 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/intrusive/list.hpp>
|
||||
|
||||
#include "common/threadsafe_queue.h"
|
||||
#include "core/hle/kernel/hle_ipc.h"
|
||||
#include "core/hle/kernel/k_synchronization_object.h"
|
||||
#include "core/hle/kernel/service_thread.h"
|
||||
#include "core/hle/result.h"
|
||||
|
||||
namespace Core::Memory {
|
||||
|
@ -2,7 +2,6 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "core/hle/kernel/k_client_port.h"
|
||||
#include "core/hle/kernel/k_client_session.h"
|
||||
#include "core/hle/kernel/k_scoped_resource_reservation.h"
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "common/common_types.h"
|
||||
|
@ -4,12 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include <boost/intrusive/list.hpp>
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "core/hle/kernel/slab_helpers.h"
|
||||
|
||||
namespace Kernel {
|
||||
|
@ -13,8 +13,6 @@
|
||||
#include "common/common_types.h"
|
||||
#include "common/fiber.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "common/scope_exit.h"
|
||||
#include "common/thread_queue_list.h"
|
||||
#include "core/core.h"
|
||||
#include "core/cpu_manager.h"
|
||||
#include "core/hardware_properties.h"
|
||||
@ -31,11 +29,9 @@
|
||||
#include "core/hle/kernel/svc_results.h"
|
||||
#include "core/hle/kernel/time_manager.h"
|
||||
#include "core/hle/result.h"
|
||||
#include "core/memory.h"
|
||||
|
||||
#ifdef ARCHITECTURE_x86_64
|
||||
#include "core/arm/dynarmic/arm_dynarmic_32.h"
|
||||
#include "core/arm/dynarmic/arm_dynarmic_64.h"
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
@ -4,8 +4,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/common_funcs.h"
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
using namespace Common::Literals;
|
||||
|
@ -4,8 +4,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "core/hle/kernel/slab_helpers.h"
|
||||
#include "core/hle/kernel/svc_types.h"
|
||||
#include "core/hle/result.h"
|
||||
|
@ -39,9 +39,7 @@
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/kernel/physical_core.h"
|
||||
#include "core/hle/kernel/service_thread.h"
|
||||
#include "core/hle/kernel/svc_results.h"
|
||||
#include "core/hle/kernel/time_manager.h"
|
||||
#include "core/hle/lock.h"
|
||||
#include "core/hle/result.h"
|
||||
#include "core/hle/service/sm/sm.h"
|
||||
#include "core/memory.h"
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
|
||||
|
@ -9,15 +9,11 @@
|
||||
#include <vector>
|
||||
#include <queue>
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "common/scope_exit.h"
|
||||
#include "common/thread.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/kernel/k_session.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/kernel/service_thread.h"
|
||||
#include "core/hle/lock.h"
|
||||
#include "video_core/renderer_base.h"
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
@ -4,16 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/common_types.h"
|
||||
#include "common/intrusive_red_black_tree.h"
|
||||
#include "core/hle/kernel/k_auto_object.h"
|
||||
#include "core/hle/kernel/k_auto_object_container.h"
|
||||
#include "core/hle/kernel/k_light_lock.h"
|
||||
#include "core/hle/kernel/k_slab_heap.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
|
||||
namespace Kernel {
|
||||
|
@ -13,18 +13,11 @@
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/fiber.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "common/microprofile.h"
|
||||
#include "common/scope_exit.h"
|
||||
#include "common/string_util.h"
|
||||
#include "core/arm/exclusive_monitor.h"
|
||||
#include "core/core.h"
|
||||
#include "core/core_timing.h"
|
||||
#include "core/core_timing_util.h"
|
||||
#include "core/cpu_manager.h"
|
||||
#include "core/hle/kernel/k_address_arbiter.h"
|
||||
#include "core/hle/kernel/k_client_port.h"
|
||||
#include "core/hle/kernel/k_client_session.h"
|
||||
#include "core/hle/kernel/k_condition_variable.h"
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
#include "core/hle/kernel/k_handle_table.h"
|
||||
#include "core/hle/kernel/k_memory_block.h"
|
||||
@ -35,7 +28,6 @@
|
||||
#include "core/hle/kernel/k_resource_limit.h"
|
||||
#include "core/hle/kernel/k_scheduler.h"
|
||||
#include "core/hle/kernel/k_scoped_resource_reservation.h"
|
||||
#include "core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h"
|
||||
#include "core/hle/kernel/k_shared_memory.h"
|
||||
#include "core/hle/kernel/k_synchronization_object.h"
|
||||
#include "core/hle/kernel/k_thread.h"
|
||||
@ -47,10 +39,8 @@
|
||||
#include "core/hle/kernel/svc_results.h"
|
||||
#include "core/hle/kernel/svc_types.h"
|
||||
#include "core/hle/kernel/svc_wrap.h"
|
||||
#include "core/hle/kernel/time_manager.h"
|
||||
#include "core/hle/lock.h"
|
||||
#include "core/hle/result.h"
|
||||
#include "core/hle/service/service.h"
|
||||
#include "core/memory.h"
|
||||
#include "core/reporter.h"
|
||||
|
||||
|
@ -5,10 +5,7 @@
|
||||
#include "common/assert.h"
|
||||
#include "core/core.h"
|
||||
#include "core/core_timing.h"
|
||||
#include "core/core_timing_util.h"
|
||||
#include "core/hle/kernel/k_scheduler.h"
|
||||
#include "core/hle/kernel/k_thread.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/kernel/time_manager.h"
|
||||
|
||||
namespace Kernel {
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
|
@ -26,9 +26,7 @@
|
||||
#include "core/hle/service/acc/async_context.h"
|
||||
#include "core/hle/service/acc/errors.h"
|
||||
#include "core/hle/service/acc/profile_manager.h"
|
||||
#include "core/hle/service/glue/arp.h"
|
||||
#include "core/hle/service/glue/glue_manager.h"
|
||||
#include "core/hle/service/sm/sm.h"
|
||||
#include "core/loader/loader.h"
|
||||
|
||||
namespace Service::Account {
|
||||
|
@ -17,13 +17,11 @@
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
#include "core/hle/kernel/k_process.h"
|
||||
#include "core/hle/kernel/k_transfer_memory.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/service/acc/profile_manager.h"
|
||||
#include "core/hle/service/am/am.h"
|
||||
#include "core/hle/service/am/applet_ae.h"
|
||||
#include "core/hle/service/am/applet_oe.h"
|
||||
#include "core/hle/service/am/applets/applet_profile_select.h"
|
||||
#include "core/hle/service/am/applets/applet_software_keyboard.h"
|
||||
#include "core/hle/service/am/applets/applet_web_browser.h"
|
||||
#include "core/hle/service/am/applets/applets.h"
|
||||
#include "core/hle/service/am/idle.h"
|
||||
@ -37,7 +35,6 @@
|
||||
#include "core/hle/service/ns/ns.h"
|
||||
#include "core/hle/service/nvflinger/nvflinger.h"
|
||||
#include "core/hle/service/pm/pm.h"
|
||||
#include "core/hle/service/set/set.h"
|
||||
#include "core/hle/service/sm/sm.h"
|
||||
#include "core/hle/service/vi/vi.h"
|
||||
#include "core/memory.h"
|
||||
|
@ -2,8 +2,6 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "common/hex_util.h"
|
||||
#include "common/logging/log.h"
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/result.h"
|
||||
#include "core/hle/service/am/applets/applet_software_keyboard_types.h"
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include <filesystem>
|
||||
#include <optional>
|
||||
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/common_types.h"
|
||||
#include "core/file_sys/vfs_types.h"
|
||||
#include "core/hle/result.h"
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
#include "core/hle/kernel/k_process.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/service/aoc/aoc_u.h"
|
||||
#include "core/loader/loader.h"
|
||||
|
||||
@ -124,9 +123,14 @@ AOC_U::AOC_U(Core::System& system_)
|
||||
{8, &AOC_U::GetAddOnContentListChangedEvent, "GetAddOnContentListChangedEvent"},
|
||||
{9, nullptr, "GetAddOnContentLostErrorCode"},
|
||||
{10, &AOC_U::GetAddOnContentListChangedEventWithProcessId, "GetAddOnContentListChangedEventWithProcessId"},
|
||||
{11, &AOC_U::NotifyMountAddOnContent, "NotifyMountAddOnContent"},
|
||||
{12, &AOC_U::NotifyUnmountAddOnContent, "NotifyUnmountAddOnContent"},
|
||||
{13, nullptr, "IsAddOnContentMountedForDebug"},
|
||||
{50, &AOC_U::CheckAddOnContentMountStatus, "CheckAddOnContentMountStatus"},
|
||||
{100, &AOC_U::CreateEcPurchasedEventManager, "CreateEcPurchasedEventManager"},
|
||||
{101, &AOC_U::CreatePermanentEcPurchasedEventManager, "CreatePermanentEcPurchasedEventManager"},
|
||||
{110, nullptr, "CreateContentsServiceManager"},
|
||||
{200, nullptr, "SetRequiredAddOnContentsOnContentsAvailabilityTransition"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
@ -272,6 +276,27 @@ void AOC_U::GetAddOnContentListChangedEventWithProcessId(Kernel::HLERequestConte
|
||||
rb.PushCopyObjects(aoc_change_event->GetReadableEvent());
|
||||
}
|
||||
|
||||
void AOC_U::NotifyMountAddOnContent(Kernel::HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AOC, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void AOC_U::NotifyUnmountAddOnContent(Kernel::HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AOC, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void AOC_U::CheckAddOnContentMountStatus(Kernel::HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AOC, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void AOC_U::CreateEcPurchasedEventManager(Kernel::HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AOC, "(STUBBED) called");
|
||||
|
||||
|
@ -29,6 +29,9 @@ private:
|
||||
void PrepareAddOnContent(Kernel::HLERequestContext& ctx);
|
||||
void GetAddOnContentListChangedEvent(Kernel::HLERequestContext& ctx);
|
||||
void GetAddOnContentListChangedEventWithProcessId(Kernel::HLERequestContext& ctx);
|
||||
void NotifyMountAddOnContent(Kernel::HLERequestContext& ctx);
|
||||
void NotifyUnmountAddOnContent(Kernel::HLERequestContext& ctx);
|
||||
void CheckAddOnContentMountStatus(Kernel::HLERequestContext& ctx);
|
||||
void CreateEcPurchasedEventManager(Kernel::HLERequestContext& ctx);
|
||||
void CreatePermanentEcPurchasedEventManager(Kernel::HLERequestContext& ctx);
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/service/apm/apm.h"
|
||||
#include "core/hle/service/apm/apm_interface.h"
|
||||
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/service/audio/audout_u.h"
|
||||
#include "core/hle/service/audio/errors.h"
|
||||
#include "core/hle/service/kernel_helpers.h"
|
||||
|
@ -2,10 +2,8 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include <string_view>
|
||||
|
||||
#include "audio_core/audio_renderer.h"
|
||||
#include "common/alignment.h"
|
||||
@ -16,7 +14,6 @@
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/service/audio/audren_u.h"
|
||||
#include "core/hle/service/audio/errors.h"
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include <functional>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "core/file_sys/vfs_types.h"
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/k_process.h"
|
||||
#include "core/hle/kernel/k_readable_event.h"
|
||||
#include "core/hle/kernel/k_writable_event.h"
|
||||
#include "core/hle/service/bcat/backend/backend.h"
|
||||
#include "core/hle/service/bcat/bcat.h"
|
||||
#include "core/hle/service/bcat/bcat_module.h"
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/service/btdrv/btdrv.h"
|
||||
#include "core/hle/service/kernel_helpers.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/service/btm/btm.h"
|
||||
#include "core/hle/service/kernel_helpers.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include "core/file_sys/control_metadata.h"
|
||||
#include "core/file_sys/errors.h"
|
||||
#include "core/file_sys/mode.h"
|
||||
#include "core/file_sys/partition_filesystem.h"
|
||||
#include "core/file_sys/patch_manager.h"
|
||||
#include "core/file_sys/registered_cache.h"
|
||||
#include "core/file_sys/romfs_factory.h"
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/core.h"
|
||||
#include "core/file_sys/control_metadata.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/k_process.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include "common/common_types.h"
|
||||
#include "core/file_sys/control_metadata.h"
|
||||
#include "core/file_sys/romfs_factory.h"
|
||||
#include "core/hle/result.h"
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
#include "core/hle/kernel/k_readable_event.h"
|
||||
#include "core/hle/kernel/k_writable_event.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/service/hid/controllers/npad.h"
|
||||
#include "core/hle/service/kernel_helpers.h"
|
||||
|
||||
@ -94,7 +93,7 @@ bool Controller_NPad::IsNpadIdValid(u32 npad_id) {
|
||||
|
||||
bool Controller_NPad::IsDeviceHandleValid(const DeviceHandle& device_handle) {
|
||||
return IsNpadIdValid(device_handle.npad_id) &&
|
||||
device_handle.npad_type < Core::HID::NpadType::MaxNpadType &&
|
||||
device_handle.npad_type < Core::HID::NpadStyleIndex::MaxNpadType &&
|
||||
device_handle.device_index < DeviceIndex::MaxDeviceIndex;
|
||||
}
|
||||
|
||||
@ -135,7 +134,7 @@ void Controller_NPad::ControllerUpdate(Core::HID::ControllerTriggerType type,
|
||||
|
||||
auto& controller = controller_data[controller_idx];
|
||||
const auto is_connected = controller.device->IsConnected();
|
||||
const auto npad_type = controller.device->GetNpadType();
|
||||
const auto npad_type = controller.device->GetNpadStyleIndex();
|
||||
switch (type) {
|
||||
case Core::HID::ControllerTriggerType::Connected:
|
||||
case Core::HID::ControllerTriggerType::Disconnected:
|
||||
@ -162,9 +161,9 @@ void Controller_NPad::ControllerUpdate(Core::HID::ControllerTriggerType type,
|
||||
|
||||
void Controller_NPad::InitNewlyAddedController(std::size_t controller_idx) {
|
||||
auto& controller = controller_data[controller_idx];
|
||||
const auto controller_type = controller.device->GetNpadType();
|
||||
const auto controller_type = controller.device->GetNpadStyleIndex();
|
||||
auto& shared_memory = controller.shared_memory_entry;
|
||||
if (controller_type == Core::HID::NpadType::None) {
|
||||
if (controller_type == Core::HID::NpadStyleIndex::None) {
|
||||
controller.styleset_changed_event->GetWritableEvent().Signal();
|
||||
return;
|
||||
}
|
||||
@ -172,10 +171,10 @@ void Controller_NPad::InitNewlyAddedController(std::size_t controller_idx) {
|
||||
shared_memory.device_type.raw = 0;
|
||||
shared_memory.system_properties.raw = 0;
|
||||
switch (controller_type) {
|
||||
case Core::HID::NpadType::None:
|
||||
case Core::HID::NpadStyleIndex::None:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
case Core::HID::NpadType::ProController:
|
||||
case Core::HID::NpadStyleIndex::ProController:
|
||||
shared_memory.style_set.fullkey.Assign(1);
|
||||
shared_memory.device_type.fullkey.Assign(1);
|
||||
shared_memory.system_properties.is_vertical.Assign(1);
|
||||
@ -184,7 +183,7 @@ void Controller_NPad::InitNewlyAddedController(std::size_t controller_idx) {
|
||||
shared_memory.assignment_mode = NpadJoyAssignmentMode::Single;
|
||||
shared_memory.applet_footer.type = AppletFooterUiType::SwitchProController;
|
||||
break;
|
||||
case Core::HID::NpadType::Handheld:
|
||||
case Core::HID::NpadStyleIndex::Handheld:
|
||||
shared_memory.style_set.handheld.Assign(1);
|
||||
shared_memory.device_type.handheld_left.Assign(1);
|
||||
shared_memory.device_type.handheld_right.Assign(1);
|
||||
@ -194,7 +193,7 @@ void Controller_NPad::InitNewlyAddedController(std::size_t controller_idx) {
|
||||
shared_memory.assignment_mode = NpadJoyAssignmentMode::Dual;
|
||||
shared_memory.applet_footer.type = AppletFooterUiType::HandheldJoyConLeftJoyConRight;
|
||||
break;
|
||||
case Core::HID::NpadType::JoyconDual:
|
||||
case Core::HID::NpadStyleIndex::JoyconDual:
|
||||
shared_memory.style_set.joycon_dual.Assign(1);
|
||||
shared_memory.device_type.joycon_left.Assign(1);
|
||||
shared_memory.device_type.joycon_right.Assign(1);
|
||||
@ -204,7 +203,7 @@ void Controller_NPad::InitNewlyAddedController(std::size_t controller_idx) {
|
||||
shared_memory.assignment_mode = NpadJoyAssignmentMode::Dual;
|
||||
shared_memory.applet_footer.type = AppletFooterUiType::JoyDual;
|
||||
break;
|
||||
case Core::HID::NpadType::JoyconLeft:
|
||||
case Core::HID::NpadStyleIndex::JoyconLeft:
|
||||
shared_memory.style_set.joycon_left.Assign(1);
|
||||
shared_memory.device_type.joycon_left.Assign(1);
|
||||
shared_memory.system_properties.is_horizontal.Assign(1);
|
||||
@ -212,7 +211,7 @@ void Controller_NPad::InitNewlyAddedController(std::size_t controller_idx) {
|
||||
shared_memory.assignment_mode = NpadJoyAssignmentMode::Single;
|
||||
shared_memory.applet_footer.type = AppletFooterUiType::JoyLeftHorizontal;
|
||||
break;
|
||||
case Core::HID::NpadType::JoyconRight:
|
||||
case Core::HID::NpadStyleIndex::JoyconRight:
|
||||
shared_memory.style_set.joycon_right.Assign(1);
|
||||
shared_memory.device_type.joycon_right.Assign(1);
|
||||
shared_memory.system_properties.is_horizontal.Assign(1);
|
||||
@ -220,18 +219,35 @@ void Controller_NPad::InitNewlyAddedController(std::size_t controller_idx) {
|
||||
shared_memory.assignment_mode = NpadJoyAssignmentMode::Single;
|
||||
shared_memory.applet_footer.type = AppletFooterUiType::JoyRightHorizontal;
|
||||
break;
|
||||
case Core::HID::NpadType::GameCube:
|
||||
case Core::HID::NpadStyleIndex::GameCube:
|
||||
shared_memory.style_set.gamecube.Assign(1);
|
||||
// The GC Controller behaves like a wired Pro Controller
|
||||
shared_memory.device_type.fullkey.Assign(1);
|
||||
shared_memory.system_properties.is_vertical.Assign(1);
|
||||
shared_memory.system_properties.use_plus.Assign(1);
|
||||
break;
|
||||
case Core::HID::NpadType::Pokeball:
|
||||
case Core::HID::NpadStyleIndex::Pokeball:
|
||||
shared_memory.style_set.palma.Assign(1);
|
||||
shared_memory.device_type.palma.Assign(1);
|
||||
shared_memory.assignment_mode = NpadJoyAssignmentMode::Single;
|
||||
break;
|
||||
case Core::HID::NpadStyleIndex::NES:
|
||||
shared_memory.style_set.lark.Assign(1);
|
||||
shared_memory.device_type.fullkey.Assign(1);
|
||||
break;
|
||||
case Core::HID::NpadStyleIndex::SNES:
|
||||
shared_memory.style_set.lucia.Assign(1);
|
||||
shared_memory.device_type.fullkey.Assign(1);
|
||||
shared_memory.applet_footer.type = AppletFooterUiType::Lucia;
|
||||
break;
|
||||
case Core::HID::NpadStyleIndex::N64:
|
||||
shared_memory.style_set.lagoon.Assign(1);
|
||||
shared_memory.device_type.fullkey.Assign(1);
|
||||
shared_memory.applet_footer.type = AppletFooterUiType::Lagon;
|
||||
break;
|
||||
case Core::HID::NpadStyleIndex::SegaGenesis:
|
||||
shared_memory.style_set.lager.Assign(1);
|
||||
shared_memory.device_type.fullkey.Assign(1);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -308,7 +324,7 @@ void Controller_NPad::OnInit() {
|
||||
const auto& device = controller.device;
|
||||
if (device->IsConnected()) {
|
||||
const std::size_t index = Core::HID::NpadIdTypeToIndex(device->GetNpadIdType());
|
||||
AddNewControllerAt(device->GetNpadType(), index);
|
||||
AddNewControllerAt(device->GetNpadStyleIndex(), index);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -348,7 +364,7 @@ void Controller_NPad::RequestPadStateUpdate(u32 npad_id) {
|
||||
std::lock_guard lock{mutex};
|
||||
const auto controller_idx = NPadIdToIndex(npad_id);
|
||||
auto& controller = controller_data[controller_idx];
|
||||
const auto controller_type = controller.device->GetNpadType();
|
||||
const auto controller_type = controller.device->GetNpadStyleIndex();
|
||||
if (!controller.device->IsConnected()) {
|
||||
return;
|
||||
}
|
||||
@ -360,7 +376,7 @@ void Controller_NPad::RequestPadStateUpdate(u32 npad_id) {
|
||||
|
||||
using btn = Core::HID::NpadButton;
|
||||
pad_entry.npad_buttons.raw = btn::None;
|
||||
if (controller_type != Core::HID::NpadType::JoyconLeft) {
|
||||
if (controller_type != Core::HID::NpadStyleIndex::JoyconLeft) {
|
||||
constexpr btn right_button_mask = btn::A | btn::B | btn::X | btn::Y | btn::StickR | btn::R |
|
||||
btn::ZR | btn::Plus | btn::StickRLeft | btn::StickRUp |
|
||||
btn::StickRRight | btn::StickRDown;
|
||||
@ -368,7 +384,7 @@ void Controller_NPad::RequestPadStateUpdate(u32 npad_id) {
|
||||
pad_entry.r_stick = stick_state.right;
|
||||
}
|
||||
|
||||
if (controller_type != Core::HID::NpadType::JoyconRight) {
|
||||
if (controller_type != Core::HID::NpadStyleIndex::JoyconRight) {
|
||||
constexpr btn left_button_mask =
|
||||
btn::Left | btn::Up | btn::Right | btn::Down | btn::StickL | btn::L | btn::ZL |
|
||||
btn::Minus | btn::StickLLeft | btn::StickLUp | btn::StickLRight | btn::StickLDown;
|
||||
@ -376,17 +392,17 @@ void Controller_NPad::RequestPadStateUpdate(u32 npad_id) {
|
||||
pad_entry.l_stick = stick_state.left;
|
||||
}
|
||||
|
||||
if (controller_type == Core::HID::NpadType::JoyconLeft) {
|
||||
if (controller_type == Core::HID::NpadStyleIndex::JoyconLeft) {
|
||||
pad_entry.npad_buttons.left_sl.Assign(button_state.left_sl);
|
||||
pad_entry.npad_buttons.left_sr.Assign(button_state.left_sr);
|
||||
}
|
||||
|
||||
if (controller_type == Core::HID::NpadType::JoyconRight) {
|
||||
if (controller_type == Core::HID::NpadStyleIndex::JoyconRight) {
|
||||
pad_entry.npad_buttons.right_sl.Assign(button_state.right_sl);
|
||||
pad_entry.npad_buttons.right_sr.Assign(button_state.right_sr);
|
||||
}
|
||||
|
||||
if (controller_type == Core::HID::NpadType::GameCube) {
|
||||
if (controller_type == Core::HID::NpadStyleIndex::GameCube) {
|
||||
const auto& trigger_state = controller.device->GetTriggers();
|
||||
trigger_entry.l_analog = trigger_state.left;
|
||||
trigger_entry.r_analog = trigger_state.right;
|
||||
@ -407,9 +423,10 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8*
|
||||
auto& controller = controller_data[i];
|
||||
auto& npad = controller.shared_memory_entry;
|
||||
|
||||
const auto& controller_type = controller.device->GetNpadType();
|
||||
const auto& controller_type = controller.device->GetNpadStyleIndex();
|
||||
|
||||
if (controller_type == Core::HID::NpadType::None || !controller.device->IsConnected()) {
|
||||
if (controller_type == Core::HID::NpadStyleIndex::None ||
|
||||
!controller.device->IsConnected()) {
|
||||
// Refresh shared memory
|
||||
std::memcpy(data + NPAD_OFFSET + (i * sizeof(NpadInternalState)),
|
||||
&controller.shared_memory_entry, sizeof(NpadInternalState));
|
||||
@ -427,10 +444,14 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8*
|
||||
libnx_state.connection_status.raw = 0;
|
||||
libnx_state.connection_status.is_connected.Assign(1);
|
||||
switch (controller_type) {
|
||||
case Core::HID::NpadType::None:
|
||||
case Core::HID::NpadStyleIndex::None:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
case Core::HID::NpadType::ProController:
|
||||
case Core::HID::NpadStyleIndex::ProController:
|
||||
case Core::HID::NpadStyleIndex::NES:
|
||||
case Core::HID::NpadStyleIndex::SNES:
|
||||
case Core::HID::NpadStyleIndex::N64:
|
||||
case Core::HID::NpadStyleIndex::SegaGenesis:
|
||||
pad_state.connection_status.raw = 0;
|
||||
pad_state.connection_status.is_connected.Assign(1);
|
||||
pad_state.connection_status.is_wired.Assign(1);
|
||||
@ -440,7 +461,7 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8*
|
||||
npad.fullkey_lifo.ReadCurrentEntry().state.sampling_number + 1;
|
||||
npad.fullkey_lifo.WriteNextEntry(pad_state);
|
||||
break;
|
||||
case Core::HID::NpadType::Handheld:
|
||||
case Core::HID::NpadStyleIndex::Handheld:
|
||||
pad_state.connection_status.raw = 0;
|
||||
pad_state.connection_status.is_connected.Assign(1);
|
||||
pad_state.connection_status.is_wired.Assign(1);
|
||||
@ -458,7 +479,7 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8*
|
||||
npad.handheld_lifo.ReadCurrentEntry().state.sampling_number + 1;
|
||||
npad.handheld_lifo.WriteNextEntry(pad_state);
|
||||
break;
|
||||
case Core::HID::NpadType::JoyconDual:
|
||||
case Core::HID::NpadStyleIndex::JoyconDual:
|
||||
pad_state.connection_status.raw = 0;
|
||||
pad_state.connection_status.is_connected.Assign(1);
|
||||
pad_state.connection_status.is_left_connected.Assign(1);
|
||||
@ -470,7 +491,7 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8*
|
||||
npad.joy_dual_lifo.ReadCurrentEntry().state.sampling_number + 1;
|
||||
npad.joy_dual_lifo.WriteNextEntry(pad_state);
|
||||
break;
|
||||
case Core::HID::NpadType::JoyconLeft:
|
||||
case Core::HID::NpadStyleIndex::JoyconLeft:
|
||||
pad_state.connection_status.raw = 0;
|
||||
pad_state.connection_status.is_connected.Assign(1);
|
||||
pad_state.connection_status.is_left_connected.Assign(1);
|
||||
@ -480,7 +501,7 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8*
|
||||
npad.joy_left_lifo.ReadCurrentEntry().state.sampling_number + 1;
|
||||
npad.joy_left_lifo.WriteNextEntry(pad_state);
|
||||
break;
|
||||
case Core::HID::NpadType::JoyconRight:
|
||||
case Core::HID::NpadStyleIndex::JoyconRight:
|
||||
pad_state.connection_status.raw = 0;
|
||||
pad_state.connection_status.is_connected.Assign(1);
|
||||
pad_state.connection_status.is_right_connected.Assign(1);
|
||||
@ -490,7 +511,7 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8*
|
||||
npad.joy_right_lifo.ReadCurrentEntry().state.sampling_number + 1;
|
||||
npad.joy_right_lifo.WriteNextEntry(pad_state);
|
||||
break;
|
||||
case Core::HID::NpadType::GameCube:
|
||||
case Core::HID::NpadStyleIndex::GameCube:
|
||||
pad_state.connection_status.raw = 0;
|
||||
pad_state.connection_status.is_connected.Assign(1);
|
||||
pad_state.connection_status.is_wired.Assign(1);
|
||||
@ -503,7 +524,7 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8*
|
||||
npad.fullkey_lifo.WriteNextEntry(pad_state);
|
||||
npad.gc_trigger_lifo.WriteNextEntry(trigger_state);
|
||||
break;
|
||||
case Core::HID::NpadType::Pokeball:
|
||||
case Core::HID::NpadStyleIndex::Pokeball:
|
||||
pad_state.connection_status.raw = 0;
|
||||
pad_state.connection_status.is_connected.Assign(1);
|
||||
pad_state.sampling_number =
|
||||
@ -535,9 +556,10 @@ void Controller_NPad::OnMotionUpdate(const Core::Timing::CoreTiming& core_timing
|
||||
for (std::size_t i = 0; i < controller_data.size(); ++i) {
|
||||
auto& controller = controller_data[i];
|
||||
|
||||
const auto& controller_type = controller.device->GetNpadType();
|
||||
const auto& controller_type = controller.device->GetNpadStyleIndex();
|
||||
|
||||
if (controller_type == Core::HID::NpadType::None || !controller.device->IsConnected()) {
|
||||
if (controller_type == Core::HID::NpadStyleIndex::None ||
|
||||
!controller.device->IsConnected()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -558,10 +580,10 @@ void Controller_NPad::OnMotionUpdate(const Core::Timing::CoreTiming& core_timing
|
||||
}
|
||||
|
||||
switch (controller_type) {
|
||||
case Core::HID::NpadType::None:
|
||||
case Core::HID::NpadStyleIndex::None:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
case Core::HID::NpadType::ProController:
|
||||
case Core::HID::NpadStyleIndex::ProController:
|
||||
sixaxis_fullkey_state.attribute.raw = 0;
|
||||
if (sixaxis_sensors_enabled) {
|
||||
sixaxis_fullkey_state.attribute.is_connected.Assign(1);
|
||||
@ -571,7 +593,7 @@ void Controller_NPad::OnMotionUpdate(const Core::Timing::CoreTiming& core_timing
|
||||
sixaxis_fullkey_state.orientation = motion_state[0].orientation;
|
||||
}
|
||||
break;
|
||||
case Core::HID::NpadType::Handheld:
|
||||
case Core::HID::NpadStyleIndex::Handheld:
|
||||
sixaxis_handheld_state.attribute.raw = 0;
|
||||
if (sixaxis_sensors_enabled) {
|
||||
sixaxis_handheld_state.attribute.is_connected.Assign(1);
|
||||
@ -581,7 +603,7 @@ void Controller_NPad::OnMotionUpdate(const Core::Timing::CoreTiming& core_timing
|
||||
sixaxis_handheld_state.orientation = motion_state[0].orientation;
|
||||
}
|
||||
break;
|
||||
case Core::HID::NpadType::JoyconDual:
|
||||
case Core::HID::NpadStyleIndex::JoyconDual:
|
||||
sixaxis_dual_left_state.attribute.raw = 0;
|
||||
sixaxis_dual_right_state.attribute.raw = 0;
|
||||
if (sixaxis_sensors_enabled) {
|
||||
@ -601,7 +623,7 @@ void Controller_NPad::OnMotionUpdate(const Core::Timing::CoreTiming& core_timing
|
||||
sixaxis_dual_right_state.orientation = motion_state[1].orientation;
|
||||
}
|
||||
break;
|
||||
case Core::HID::NpadType::JoyconLeft:
|
||||
case Core::HID::NpadStyleIndex::JoyconLeft:
|
||||
sixaxis_left_lifo_state.attribute.raw = 0;
|
||||
if (sixaxis_sensors_enabled) {
|
||||
sixaxis_left_lifo_state.attribute.is_connected.Assign(1);
|
||||
@ -611,7 +633,7 @@ void Controller_NPad::OnMotionUpdate(const Core::Timing::CoreTiming& core_timing
|
||||
sixaxis_left_lifo_state.orientation = motion_state[0].orientation;
|
||||
}
|
||||
break;
|
||||
case Core::HID::NpadType::JoyconRight:
|
||||
case Core::HID::NpadStyleIndex::JoyconRight:
|
||||
sixaxis_right_lifo_state.attribute.raw = 0;
|
||||
if (sixaxis_sensors_enabled) {
|
||||
sixaxis_right_lifo_state.attribute.is_connected.Assign(1);
|
||||
@ -780,11 +802,11 @@ void Controller_NPad::VibrateController(const DeviceHandle& vibration_device_han
|
||||
}
|
||||
|
||||
// Some games try to send mismatched parameters in the device handle, block these.
|
||||
if ((controller.device->GetNpadType() == Core::HID::NpadType::JoyconLeft &&
|
||||
(vibration_device_handle.npad_type == Core::HID::NpadType::JoyconRight ||
|
||||
if ((controller.device->GetNpadStyleIndex() == Core::HID::NpadStyleIndex::JoyconLeft &&
|
||||
(vibration_device_handle.npad_type == Core::HID::NpadStyleIndex::JoyconRight ||
|
||||
vibration_device_handle.device_index == DeviceIndex::Right)) ||
|
||||
(controller.device->GetNpadType() == Core::HID::NpadType::JoyconRight &&
|
||||
(vibration_device_handle.npad_type == Core::HID::NpadType::JoyconLeft ||
|
||||
(controller.device->GetNpadStyleIndex() == Core::HID::NpadStyleIndex::JoyconRight &&
|
||||
(vibration_device_handle.npad_type == Core::HID::NpadStyleIndex::JoyconLeft ||
|
||||
vibration_device_handle.device_index == DeviceIndex::Left))) {
|
||||
return;
|
||||
}
|
||||
@ -877,11 +899,12 @@ void Controller_NPad::SignalStyleSetChangedEvent(u32 npad_id) const {
|
||||
controller.styleset_changed_event->GetWritableEvent().Signal();
|
||||
}
|
||||
|
||||
void Controller_NPad::AddNewControllerAt(Core::HID::NpadType controller, std::size_t npad_index) {
|
||||
void Controller_NPad::AddNewControllerAt(Core::HID::NpadStyleIndex controller,
|
||||
std::size_t npad_index) {
|
||||
UpdateControllerAt(controller, npad_index, true);
|
||||
}
|
||||
|
||||
void Controller_NPad::UpdateControllerAt(Core::HID::NpadType type, std::size_t npad_index,
|
||||
void Controller_NPad::UpdateControllerAt(Core::HID::NpadStyleIndex type, std::size_t npad_index,
|
||||
bool connected) {
|
||||
auto& controller = controller_data[npad_index];
|
||||
if (!connected) {
|
||||
@ -889,7 +912,7 @@ void Controller_NPad::UpdateControllerAt(Core::HID::NpadType type, std::size_t n
|
||||
return;
|
||||
}
|
||||
|
||||
controller.device->SetNpadType(type);
|
||||
controller.device->SetNpadStyleIndex(type);
|
||||
InitNewlyAddedController(npad_index);
|
||||
}
|
||||
|
||||
@ -972,13 +995,13 @@ void Controller_NPad::MergeSingleJoyAsDualJoy(u32 npad_id_1, u32 npad_id_2) {
|
||||
|
||||
// If the controllers at both npad indices form a pair of left and right joycons, merge them.
|
||||
// Otherwise, do nothing.
|
||||
if ((controller_1->GetNpadType() == Core::HID::NpadType::JoyconLeft &&
|
||||
controller_2->GetNpadType() == Core::HID::NpadType::JoyconRight) ||
|
||||
(controller_2->GetNpadType() == Core::HID::NpadType::JoyconLeft &&
|
||||
controller_1->GetNpadType() == Core::HID::NpadType::JoyconRight)) {
|
||||
if ((controller_1->GetNpadStyleIndex() == Core::HID::NpadStyleIndex::JoyconLeft &&
|
||||
controller_2->GetNpadStyleIndex() == Core::HID::NpadStyleIndex::JoyconRight) ||
|
||||
(controller_2->GetNpadStyleIndex() == Core::HID::NpadStyleIndex::JoyconLeft &&
|
||||
controller_1->GetNpadStyleIndex() == Core::HID::NpadStyleIndex::JoyconRight)) {
|
||||
// Disconnect the joycon at the second id and connect the dual joycon at the first index.
|
||||
DisconnectNpad(npad_id_2);
|
||||
AddNewControllerAt(Core::HID::NpadType::JoyconDual, npad_index_1);
|
||||
AddNewControllerAt(Core::HID::NpadStyleIndex::JoyconDual, npad_index_1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1001,8 +1024,8 @@ bool Controller_NPad::SwapNpadAssignment(u32 npad_id_1, u32 npad_id_2) {
|
||||
const auto npad_index_2 = NPadIdToIndex(npad_id_2);
|
||||
const auto& controller_1 = controller_data[npad_index_1].device;
|
||||
const auto& controller_2 = controller_data[npad_index_2].device;
|
||||
const auto type_index_1 = controller_1->GetNpadType();
|
||||
const auto type_index_2 = controller_2->GetNpadType();
|
||||
const auto type_index_1 = controller_1->GetNpadStyleIndex();
|
||||
const auto type_index_2 = controller_2->GetNpadStyleIndex();
|
||||
|
||||
if (!IsControllerSupported(type_index_1) || !IsControllerSupported(type_index_2)) {
|
||||
return false;
|
||||
@ -1040,9 +1063,9 @@ void Controller_NPad::SetAnalogStickUseCenterClamp(bool use_center_clamp) {
|
||||
void Controller_NPad::ClearAllConnectedControllers() {
|
||||
for (auto& controller : controller_data) {
|
||||
if (controller.device->IsConnected() &&
|
||||
controller.device->GetNpadType() != Core::HID::NpadType::None) {
|
||||
controller.device->SetNpadType(Core::HID::NpadType::None);
|
||||
controller.device->GetNpadStyleIndex() != Core::HID::NpadStyleIndex::None) {
|
||||
controller.device->Disconnect();
|
||||
controller.device->SetNpadStyleIndex(Core::HID::NpadStyleIndex::None);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1055,7 +1078,7 @@ void Controller_NPad::DisconnectAllConnectedControllers() {
|
||||
|
||||
void Controller_NPad::ConnectAllDisconnectedControllers() {
|
||||
for (auto& controller : controller_data) {
|
||||
if (controller.device->GetNpadType() != Core::HID::NpadType::None &&
|
||||
if (controller.device->GetNpadStyleIndex() != Core::HID::NpadStyleIndex::None &&
|
||||
!controller.device->IsConnected()) {
|
||||
controller.device->Connect();
|
||||
}
|
||||
@ -1064,8 +1087,8 @@ void Controller_NPad::ConnectAllDisconnectedControllers() {
|
||||
|
||||
void Controller_NPad::ClearAllControllers() {
|
||||
for (auto& controller : controller_data) {
|
||||
controller.device->SetNpadType(Core::HID::NpadType::None);
|
||||
controller.device->Disconnect();
|
||||
controller.device->SetNpadStyleIndex(Core::HID::NpadStyleIndex::None);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1073,8 +1096,8 @@ u32 Controller_NPad::GetAndResetPressState() {
|
||||
return press_state.exchange(0);
|
||||
}
|
||||
|
||||
bool Controller_NPad::IsControllerSupported(Core::HID::NpadType controller) const {
|
||||
if (controller == Core::HID::NpadType::Handheld) {
|
||||
bool Controller_NPad::IsControllerSupported(Core::HID::NpadStyleIndex controller) const {
|
||||
if (controller == Core::HID::NpadStyleIndex::Handheld) {
|
||||
const bool support_handheld =
|
||||
std::find(supported_npad_id_types.begin(), supported_npad_id_types.end(),
|
||||
NPAD_HANDHELD) != supported_npad_id_types.end();
|
||||
@ -1094,18 +1117,26 @@ bool Controller_NPad::IsControllerSupported(Core::HID::NpadType controller) cons
|
||||
[](u32 npad_id) { return npad_id <= MAX_NPAD_ID; })) {
|
||||
Core::HID::NpadStyleTag style = GetSupportedStyleSet();
|
||||
switch (controller) {
|
||||
case Core::HID::NpadType::ProController:
|
||||
case Core::HID::NpadStyleIndex::ProController:
|
||||
return style.fullkey;
|
||||
case Core::HID::NpadType::JoyconDual:
|
||||
case Core::HID::NpadStyleIndex::JoyconDual:
|
||||
return style.joycon_dual;
|
||||
case Core::HID::NpadType::JoyconLeft:
|
||||
case Core::HID::NpadStyleIndex::JoyconLeft:
|
||||
return style.joycon_left;
|
||||
case Core::HID::NpadType::JoyconRight:
|
||||
case Core::HID::NpadStyleIndex::JoyconRight:
|
||||
return style.joycon_right;
|
||||
case Core::HID::NpadType::GameCube:
|
||||
case Core::HID::NpadStyleIndex::GameCube:
|
||||
return style.gamecube;
|
||||
case Core::HID::NpadType::Pokeball:
|
||||
case Core::HID::NpadStyleIndex::Pokeball:
|
||||
return style.palma;
|
||||
case Core::HID::NpadStyleIndex::NES:
|
||||
return style.lark;
|
||||
case Core::HID::NpadStyleIndex::SNES:
|
||||
return style.lucia;
|
||||
case Core::HID::NpadStyleIndex::N64:
|
||||
return style.lagoon;
|
||||
case Core::HID::NpadStyleIndex::SegaGenesis:
|
||||
return style.lager;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ public:
|
||||
};
|
||||
|
||||
struct DeviceHandle {
|
||||
Core::HID::NpadType npad_type;
|
||||
Core::HID::NpadStyleIndex npad_type;
|
||||
u8 npad_id;
|
||||
DeviceIndex device_index;
|
||||
INSERT_PADDING_BYTES_NOINIT(1);
|
||||
@ -160,9 +160,10 @@ public:
|
||||
void SignalStyleSetChangedEvent(u32 npad_id) const;
|
||||
|
||||
// Adds a new controller at an index.
|
||||
void AddNewControllerAt(Core::HID::NpadType controller, std::size_t npad_index);
|
||||
void AddNewControllerAt(Core::HID::NpadStyleIndex controller, std::size_t npad_index);
|
||||
// Adds a new controller at an index with connection status.
|
||||
void UpdateControllerAt(Core::HID::NpadType controller, std::size_t npad_index, bool connected);
|
||||
void UpdateControllerAt(Core::HID::NpadStyleIndex controller, std::size_t npad_index,
|
||||
bool connected);
|
||||
|
||||
void DisconnectNpad(u32 npad_id);
|
||||
void DisconnectNpadAtIndex(std::size_t index);
|
||||
@ -496,7 +497,7 @@ private:
|
||||
std::array<VibrationData, 2> vibration{};
|
||||
bool unintended_home_button_input_protection{};
|
||||
bool is_connected{};
|
||||
Core::HID::NpadType npad_type{Core::HID::NpadType::None};
|
||||
Core::HID::NpadStyleIndex npad_type{Core::HID::NpadStyleIndex::None};
|
||||
|
||||
// Current pad state
|
||||
NPadGenericState npad_pad_state{};
|
||||
@ -513,7 +514,7 @@ private:
|
||||
|
||||
void ControllerUpdate(Core::HID::ControllerTriggerType type, std::size_t controller_idx);
|
||||
void InitNewlyAddedController(std::size_t controller_idx);
|
||||
bool IsControllerSupported(Core::HID::NpadType controller) const;
|
||||
bool IsControllerSupported(Core::HID::NpadStyleIndex controller) const;
|
||||
void RequestPadStateUpdate(u32 npad_id);
|
||||
void WriteEmptyEntry(NpadInternalState& npad);
|
||||
|
||||
|
@ -8,12 +8,10 @@
|
||||
#include "common/settings.h"
|
||||
#include "core/core.h"
|
||||
#include "core/core_timing.h"
|
||||
#include "core/frontend/emu_window.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/k_readable_event.h"
|
||||
#include "core/hle/kernel/k_shared_memory.h"
|
||||
#include "core/hle/kernel/k_transfer_memory.h"
|
||||
#include "core/hle/kernel/k_writable_event.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/service/hid/errors.h"
|
||||
#include "core/hle/service/hid/hid.h"
|
||||
@ -1133,18 +1131,18 @@ void Hid::GetVibrationDeviceInfo(Kernel::HLERequestContext& ctx) {
|
||||
Core::HID::VibrationDeviceInfo vibration_device_info;
|
||||
|
||||
switch (vibration_device_handle.npad_type) {
|
||||
case Core::HID::NpadType::ProController:
|
||||
case Core::HID::NpadType::Handheld:
|
||||
case Core::HID::NpadType::JoyconDual:
|
||||
case Core::HID::NpadType::JoyconLeft:
|
||||
case Core::HID::NpadType::JoyconRight:
|
||||
case Core::HID::NpadStyleIndex::ProController:
|
||||
case Core::HID::NpadStyleIndex::Handheld:
|
||||
case Core::HID::NpadStyleIndex::JoyconDual:
|
||||
case Core::HID::NpadStyleIndex::JoyconLeft:
|
||||
case Core::HID::NpadStyleIndex::JoyconRight:
|
||||
default:
|
||||
vibration_device_info.type = Core::HID::VibrationDeviceType::LinearResonantActuator;
|
||||
break;
|
||||
case Core::HID::NpadType::GameCube:
|
||||
case Core::HID::NpadStyleIndex::GameCube:
|
||||
vibration_device_info.type = Core::HID::VibrationDeviceType::GcErm;
|
||||
break;
|
||||
case Core::HID::NpadType::Pokeball:
|
||||
case Core::HID::NpadStyleIndex::Pokeball:
|
||||
vibration_device_info.type = Core::HID::VibrationDeviceType::Unknown;
|
||||
break;
|
||||
}
|
||||
|
@ -2,7 +2,6 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "common/swap.h"
|
||||
#include "core/core.h"
|
||||
#include "core/core_timing.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
|
@ -2,19 +2,16 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#include <optional>
|
||||
#include <unordered_map>
|
||||
#include <boost/container_hash/hash.hpp>
|
||||
#include "common/logging/log.h"
|
||||
#include "common/scope_exit.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/service/lm/lm.h"
|
||||
#include "core/hle/service/service.h"
|
||||
#include "core/memory.h"
|
||||
|
||||
namespace Service::LM {
|
||||
enum class LogSeverity : u8 {
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
#include <array>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/service/mii/mii_manager.h"
|
||||
|
||||
namespace Service::Mii::RawData {
|
||||
|
@ -9,8 +9,6 @@
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
#include "core/hle/kernel/k_thread.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/lock.h"
|
||||
#include "core/hle/service/nfp/nfp.h"
|
||||
#include "core/hle/service/nfp/nfp_user.h"
|
||||
|
@ -2,7 +2,6 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "common/settings.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/service/kernel_helpers.h"
|
||||
#include "core/hle/service/nim/nim.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
@ -5,7 +5,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace Service::Set {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user