HID services: Difference between revisions

No edit summary
No edit summary
Line 1,102: Line 1,102:
This is exclusive to S2.
This is exclusive to S2.


Takes a PID, a TransferMemory handle, an u8, two u32s, an [[AM_services|AppletResourceUserId]], an u64 tmem_size, no output.
Takes a PID, a TransferMemory handle, an u8, two s32s (width/height), an [[AM_services|AppletResourceUserId]], an u64 tmem_size, no output.
 
Official sw converts the input [[#NmouseStateRange|NmouseStateRange]] to the relevant s32s (the s32s are not directly exposed).
 
Official sw passes value 0 for the u8.
 
After official sw finishes using this, it also uses [[#SetMergedNmouseSourceTypes|SetMergedNmouseSourceTypes]] with value 0x6.
 
The input TransferMemory is created with permissions = R--. The user-process later reads from the buffer used with this.


== FinalizeNmouse ==
== FinalizeNmouse ==
Line 1,112: Line 1,120:
This is exclusive to S2.
This is exclusive to S2.


Takes a PID, an s32, an s32, an [[AM_services|AppletResourceUserId]], no output.
Takes a PID, two s32s (width/height), an [[AM_services|AppletResourceUserId]], no output.


This is also exposed as SetNmouseStateRanges, with the input NmouseStateRange being converted to the relevant s32s.
This is also exposed as SetNmouseStateRanges, with the input [[#NmouseStateRange|NmouseStateRange]] being converted to the relevant s32s.


== GetNmousePointerRanges ==
== GetNmousePointerRanges ==
This is exclusive to S2.
This is exclusive to S2.


Takes a PID, an [[AM_services|AppletResourceUserId]], returns two output s32s.
Takes a PID, an [[AM_services|AppletResourceUserId]], returns two output s32s (width/height).


This is also exposed as GetNmouseStateRanges, with the output data being compared to determine the output NmouseStateRange.
This is also exposed as GetNmouseStateRanges, with the output data being compared to determine the output [[#NmouseStateRange|NmouseStateRange]].


== EnableShowingCursor ==
== EnableShowingCursor ==
Line 1,131: Line 1,139:
This is exclusive to S2.
This is exclusive to S2.


Takes a PID, an [[AM_services|AppletResourceUserId]], an u64, no output.
Takes a PID, an [[AM_services|AppletResourceUserId]], a [[#NmouseButtonConfigJoyLeftJcms|NmouseButtonConfigJoyLeftJcms]], no output.


== SetNmouseButtonConfigJoyRightJcms ==
== SetNmouseButtonConfigJoyRightJcms ==
This is exclusive to S2.
This is exclusive to S2.


Takes a PID, an [[AM_services|AppletResourceUserId]], an u64, no output.
Takes a PID, an [[AM_services|AppletResourceUserId]], a [[#NmouseButtonConfigJoyRightJcms|NmouseButtonConfigJoyRightJcms]], no output.


== SetMergedNmouseSourceTypes ==
== SetMergedNmouseSourceTypes ==
Line 1,144: Line 1,152:


Official sw masks the u32 with bitmask 0x6.
Official sw masks the u32 with bitmask 0x6.
The input u32 is a 32bit BitFlagSet of [[#NmouseType|NmouseType]].


== InitializeNmouse2 ==
== InitializeNmouse2 ==
Line 1,150: Line 1,160:
This is exclusive to S2.
This is exclusive to S2.


Takes a PID, a TransferMemory handle, an u8, an u32 width, an u32 height, an u32, an [[AM_services|AppletResourceUserId]], an u64 tmem_size, no output.
Takes a PID, a TransferMemory handle, a [[#NmousePointerType|NmousePointerType]], a s32 width, a s32 height, an u32, an [[AM_services|AppletResourceUserId]], an u64 tmem_size, no output.


The input TransferMemory is created with permissions = R--. The user-process later reads from the buffer used with this.
The input TransferMemory is created with permissions = R--. The user-process later reads from the buffer used with this (same as with [[#InitializeNmouse|InitializeNmouse]]).


Official sw passes value 1 for the last u32.
Official sw passes value 1 for the last u32.
Line 1,161: Line 1,171:
This is exclusive to S2.
This is exclusive to S2.


Takes a PID, two s32s, an [[AM_services|AppletResourceUserId]], an u64, no output.
Takes a PID, two s32s, an [[AM_services|AppletResourceUserId]], a [[#NmouseHandle|NmouseHandle]], no output.


== EnableNmousePointer ==
== EnableNmousePointer ==
This is exclusive to S2.
This is exclusive to S2.


Takes a PID, a bool, an [[AM_services|AppletResourceUserId]], an u64, no output.
Takes a PID, a bool, an [[AM_services|AppletResourceUserId]], a [[#NmouseHandle|NmouseHandle]], no output.


== RestrictNmousePointer ==
== RestrictNmousePointer ==
Line 8,891: Line 8,901:
|-
|-
| 1 ||  
| 1 ||  
|}
= NmouseHandle =
This is "nn::hid::NmouseHandle".
This is a 0x8-byte struct.
This is exclusive to S2.
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
|}
= NmousePointerType =
This is u8 enum "nn::hid::NmousePointerType".
This is exclusive to S2.
{| class="wikitable" border="1"
!  Value
!  Description
|-
|}
= NmouseType =
This is "nn::hid::NmouseType".
This is exclusive to S2.
{| class="wikitable" border="1"
|-
! Bit
! Description
|-
| 1 ||
|-
| 2 ||
|}
= NmouseButtonConfigJoyLeftJcms =
This is "nn::hid::NmouseButtonConfigJoyLeftJcms".
This is a 0x8-byte struct.
This is exclusive to S2.
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
|}
= NmouseButtonConfigJoyRightJcms =
This is "nn::hid::NmouseButtonConfigJoyRightJcms".
This is a 0x8-byte struct.
This is exclusive to S2.
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
|}
= NmouseStateRange =
This is u8 enum "nn::hid::NmouseStateRange".
This is exclusive to S2.
{| class="wikitable" border="1"
!  Value
!  Description
|-
| 0 || 1280x720
|-
| 1 || 1920x1080
|-
| 2 || 2560x1440
|-
| 3 || 3840x2160
|}
|}