Skip to content

Commit b405ed0

Browse files
author
N3xoX1
committed
OS: move NpadStyleIndex into operating_system.h
1 parent 03a7807 commit b405ed0

17 files changed

Lines changed: 171 additions & 171 deletions

File tree

‎src/nxemu-module-spec/operating_system.h‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,26 @@ enum class ButtonNames : uint32_t
151151
ButtonExtra,
152152
};
153153

154+
// This is nn::hid::NpadStyleIndex
155+
enum class NpadStyleIndex : uint8_t {
156+
None = 0,
157+
Fullkey = 3,
158+
Handheld = 4,
159+
HandheldNES = 4,
160+
JoyconDual = 5,
161+
JoyconLeft = 6,
162+
JoyconRight = 7,
163+
GameCube = 8,
164+
Pokeball = 9,
165+
NES = 10,
166+
SNES = 12,
167+
N64 = 13,
168+
SegaGenesis = 14,
169+
SystemExt = 32,
170+
System = 33,
171+
MaxNpadType = 34,
172+
};
173+
154174
__interface IProgramMetadata
155175
{
156176
bool Is64BitProgram() const = 0;

‎src/nxemu-os/core/hle/service/hid/irs.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ Result IRS::GetNpadIrCameraHandle(Out<Core::IrSensor::IrCameraHandle> out_camera
202202

203203
*out_camera_handle = {
204204
.npad_id = static_cast<u8>(HID::NpadIdTypeToIndex(npad_id)),
205-
.npad_type = Core::HID::NpadStyleIndex::None,
205+
.npad_type = NpadStyleIndex::None,
206206
};
207207

208208
LOG_INFO(Service_IRS, "called, npad_id={}, camera_npad_id={}, camera_npad_type={}", npad_id,
@@ -351,7 +351,7 @@ Result IRS::IsIrCameraHandleValid(const Core::IrSensor::IrCameraHandle& camera_h
351351
static_cast<u8>(HID::NpadIdTypeToIndex(NpadIdType::Handheld))) {
352352
return InvalidIrCameraHandle;
353353
}
354-
if (camera_handle.npad_type != Core::HID::NpadStyleIndex::None) {
354+
if (camera_handle.npad_type != NpadStyleIndex::None) {
355355
return InvalidIrCameraHandle;
356356
}
357357
return ResultSuccess;

‎src/yuzu_hid_core/hid_types.h‎

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -213,26 +213,6 @@ enum class NpadInterfaceType : u8 {
213213
Embedded = 4,
214214
};
215215

216-
// This is nn::hid::NpadStyleIndex
217-
enum class NpadStyleIndex : u8 {
218-
None = 0,
219-
Fullkey = 3,
220-
Handheld = 4,
221-
HandheldNES = 4,
222-
JoyconDual = 5,
223-
JoyconLeft = 6,
224-
JoyconRight = 7,
225-
GameCube = 8,
226-
Pokeball = 9,
227-
NES = 10,
228-
SNES = 12,
229-
N64 = 13,
230-
SegaGenesis = 14,
231-
SystemExt = 32,
232-
System = 33,
233-
MaxNpadType = 34,
234-
};
235-
236216
// This is nn::hid::NpadStyleSet
237217
enum class NpadStyleSet : u32 {
238218
None = 0,

‎src/yuzu_hid_core/hid_util.h‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ constexpr Result IsSixaxisHandleValid(const Core::HID::SixAxisSensorHandle& hand
4242

4343
constexpr Result IsVibrationHandleValid(const Core::HID::VibrationDeviceHandle& handle) {
4444
switch (handle.npad_type) {
45-
case Core::HID::NpadStyleIndex::Fullkey:
46-
case Core::HID::NpadStyleIndex::Handheld:
47-
case Core::HID::NpadStyleIndex::JoyconDual:
48-
case Core::HID::NpadStyleIndex::JoyconLeft:
49-
case Core::HID::NpadStyleIndex::JoyconRight:
50-
case Core::HID::NpadStyleIndex::GameCube:
51-
case Core::HID::NpadStyleIndex::N64:
52-
case Core::HID::NpadStyleIndex::SystemExt:
53-
case Core::HID::NpadStyleIndex::System:
45+
case NpadStyleIndex::Fullkey:
46+
case NpadStyleIndex::Handheld:
47+
case NpadStyleIndex::JoyconDual:
48+
case NpadStyleIndex::JoyconLeft:
49+
case NpadStyleIndex::JoyconRight:
50+
case NpadStyleIndex::GameCube:
51+
case NpadStyleIndex::N64:
52+
case NpadStyleIndex::SystemExt:
53+
case NpadStyleIndex::System:
5454
// These support vibration
5555
break;
5656
default:

‎src/yuzu_hid_core/irsensor/irs_types.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ static_assert(sizeof(PackedCameraConfig) == 0x10, "PackedCameraConfig is an inva
170170
// This is nn::irsensor::IrCameraHandle
171171
struct IrCameraHandle {
172172
u8 npad_id{};
173-
Core::HID::NpadStyleIndex npad_type{Core::HID::NpadStyleIndex::None};
173+
NpadStyleIndex npad_type{NpadStyleIndex::None};
174174
INSERT_PADDING_BYTES(2);
175175
};
176176
static_assert(sizeof(IrCameraHandle) == 4, "IrCameraHandle is an invalid size");

‎src/yuzu_hid_core/resource_manager.cpp‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -406,18 +406,18 @@ Result ResourceManager::GetVibrationDeviceInfo(Core::HID::VibrationDeviceInfo& d
406406
}
407407

408408
switch (handle.npad_type) {
409-
case Core::HID::NpadStyleIndex::Fullkey:
410-
case Core::HID::NpadStyleIndex::Handheld:
411-
case Core::HID::NpadStyleIndex::JoyconDual:
412-
case Core::HID::NpadStyleIndex::JoyconLeft:
413-
case Core::HID::NpadStyleIndex::JoyconRight:
409+
case NpadStyleIndex::Fullkey:
410+
case NpadStyleIndex::Handheld:
411+
case NpadStyleIndex::JoyconDual:
412+
case NpadStyleIndex::JoyconLeft:
413+
case NpadStyleIndex::JoyconRight:
414414
device_info.type = Core::HID::VibrationDeviceType::LinearResonantActuator;
415415
check_device_index = true;
416416
break;
417-
case Core::HID::NpadStyleIndex::GameCube:
417+
case NpadStyleIndex::GameCube:
418418
device_info.type = Core::HID::VibrationDeviceType::GcErm;
419419
break;
420-
case Core::HID::NpadStyleIndex::N64:
420+
case NpadStyleIndex::N64:
421421
device_info.type = Core::HID::VibrationDeviceType::N64;
422422
break;
423423
default:

‎src/yuzu_hid_core/resources/abstracted_pad/abstract_pad_holder.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ NpadJoyAssignmentMode NpadAbstractedPadHolder::GetAssignmentMode() const {
8989
}
9090

9191
std::size_t NpadAbstractedPadHolder::GetStyleIndexList(
92-
std::span<Core::HID::NpadStyleIndex> list) const {
92+
std::span<NpadStyleIndex> list) const {
9393
for (std::size_t i = 0; i < list_size; i++) {
9494
list[i] = assignment_list[i].device_type;
9595
}

‎src/yuzu_hid_core/resources/abstracted_pad/abstract_pad_holder.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct IAbstractedPad;
1717

1818
struct AbstractAssignmentHolder {
1919
IAbstractedPad* abstracted_pad;
20-
Core::HID::NpadStyleIndex device_type;
20+
NpadStyleIndex device_type;
2121
Core::HID::NpadInterfaceType interface_type;
2222
INSERT_PADDING_BYTES(0x6);
2323
u64 controller_id;
@@ -37,7 +37,7 @@ class NpadAbstractedPadHolder final {
3737
void SetAssignmentMode(const NpadJoyAssignmentMode& mode);
3838
NpadJoyAssignmentMode GetAssignmentMode() const;
3939

40-
std::size_t GetStyleIndexList(std::span<Core::HID::NpadStyleIndex> list) const;
40+
std::size_t GetStyleIndexList(std::span<NpadStyleIndex> list) const;
4141

4242
private:
4343
std::array<AbstractAssignmentHolder, 5> assignment_list{};

‎src/yuzu_hid_core/resources/abstracted_pad/abstract_properties_handler.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ Core::HID::NpadInterfaceType NpadAbstractPropertiesHandler::GetFullkeyInterfaceT
154154
if (!abstract_pad->internal_flags.is_connected) {
155155
continue;
156156
}
157-
if (abstract_pad->device_type != Core::HID::NpadStyleIndex::Fullkey) {
157+
if (abstract_pad->device_type != NpadStyleIndex::Fullkey) {
158158
continue;
159159
}
160160
if (abstract_pad->interface_type >= Core::HID::NpadInterfaceType::Embedded) {

0 commit comments

Comments
 (0)