first game boot

This commit is contained in:
Narr the Reg 2023-08-13 15:18:57 -06:00
parent 5c6a5487c7
commit b65efa5823
4 changed files with 39 additions and 4 deletions

View File

@ -2,6 +2,14 @@
// SPDX-License-Identifier: GPL-3.0-or-later
#include "core/hle/service/hid/resource_manager.h"
#include "core/hle/service/hid/resource_manager/debug_pad.h"
#include "core/hle/service/hid/resource_manager/gesture.h"
#include "core/hle/service/hid/resource_manager/keyboard.h"
#include "core/hle/service/hid/resource_manager/mouse.h"
#include "core/hle/service/hid/resource_manager/npad.h"
#include "core/hle/service/hid/resource_manager/palma.h"
#include "core/hle/service/hid/resource_manager/sixaxis.h"
#include "core/hle/service/hid/resource_manager/touch_screen.h"
namespace Service::HID {
@ -59,7 +67,16 @@ namespace Service::HID {
return player_memory;
}*/
ResourceManager::ResourceManager(Core::System& system_) {}
ResourceManager::ResourceManager(Core::System& system_) {
debug_pad = std::make_shared<DebugPad>();
gesture = std::make_shared<Gesture>();
keyboard = std::make_shared<Keyboard>();
mouse = std::make_shared<Mouse>();
npad = std::make_shared<Npad>();
palma = std::make_shared<Palma>();
sixaxis = std::make_shared<SixAxis>();
touch_screen = std::make_shared<TouchScreen>();
}
ResourceManager::~ResourceManager() = default;

View File

@ -4,7 +4,7 @@
#pragma once
namespace Service::HID {
constexpr std::size_t ARUID_MAX = 0x20;
constexpr std::size_t ARUID_MAX = 0x2; // Console real limit is 0x20
constexpr std::size_t PLAYERS_MAX = 10;
constexpr std::size_t SUPPORTED_NPAD_TYPES_MAX = 11;

View File

@ -7,6 +7,7 @@
#include "core/hle/service/hid/hid_util.h"
#include "core/hle/service/hid/resource_manager/npad.h"
#pragma optimize("", off)
namespace Service::HID {
NpadControllerState::NpadControllerState() {}
@ -27,7 +28,11 @@ void NpadControllerState::SignalStyleSetUpdateEvent() {
style_set_update_event->Signal();
}
NpadState::NpadState() {}
NpadState::NpadState() {
for (auto npad : state) {
npad = std::make_shared<NpadControllerState>();
}
}
NpadState::~NpadState() = default;
@ -66,7 +71,17 @@ NpadStyleSet NpadState::GetSupportedNpadStyleSet() {
return supported_npad_style_set;
}
Npad::Npad() {}
Npad::Npad() {
for (auto& npad : npad_state) {
npad = std::make_shared<NpadState>();
}
std::array<u64, 1> aruid_list{};
GetAruidList(aruid_list);
active_aruid = aruid_list[0];
active_npad_state = npad_state[active_aruid];
}
Npad::~Npad() = default;
@ -288,3 +303,4 @@ u64 Npad::GetNpadActiveAruid() {
}
} // namespace Service::HID
#pragma optimize("", on)

View File

@ -18,6 +18,8 @@ enum class GyroscopeZeroDriftMode : u32;
struct SixAxisAccelerometerParameters;
struct SixAxisSensorFusionParameters;
struct SixAxisSensorHandle;
struct SixAxisSensorShiftAccelerometerCalibration;
struct SixAxisSensorShiftGyroscopeCalibration;
} // namespace Service::HID
namespace Service::HID {