mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
Add BreakType enum and more amiibo ID fields
This commit is contained in:
parent
e4f73f5337
commit
4ba2e20939
@ -108,6 +108,12 @@ typedef enum {
|
|||||||
NfpAmiiboFlag_ApplicationAreaExists = BIT(1), ///< Application area exists.
|
NfpAmiiboFlag_ApplicationAreaExists = BIT(1), ///< Application area exists.
|
||||||
} NfpAmiiboFlag;
|
} NfpAmiiboFlag;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
NfpBreakType_Flush = 0,
|
||||||
|
NfpBreakType_Break1 = 1,
|
||||||
|
NfpBreakType_Break2 = 2,
|
||||||
|
} NfpBreakType;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
u16 year;
|
u16 year;
|
||||||
u8 month;
|
u8 month;
|
||||||
@ -143,10 +149,16 @@ typedef struct {
|
|||||||
} NX_PACKED NfpCommonInfo;
|
} NX_PACKED NfpCommonInfo;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
u8 character_id[3];
|
union {
|
||||||
u8 series_id;
|
u8 character_id[3];
|
||||||
u16 numbering_id;
|
struct {
|
||||||
u8 nfp_type;
|
u16 game_character_id;
|
||||||
|
u8 character_variant;
|
||||||
|
} NX_PACKED;
|
||||||
|
};
|
||||||
|
u8 series_id; ///< Series.
|
||||||
|
u16 numbering_id; ///< Model number.
|
||||||
|
u8 nfp_type; ///< Figure type.
|
||||||
u8 reserved1[0x39];
|
u8 reserved1[0x39];
|
||||||
} NX_PACKED NfpModelInfo;
|
} NX_PACKED NfpModelInfo;
|
||||||
|
|
||||||
@ -298,21 +310,29 @@ Result nfcMfStartDetection(const NfcDeviceHandle *handle);
|
|||||||
Result nfcMfStopDetection(const NfcDeviceHandle *handle);
|
Result nfcMfStopDetection(const NfcDeviceHandle *handle);
|
||||||
|
|
||||||
/// Not available with ::NfpServiceType_System.
|
/// Not available with ::NfpServiceType_System.
|
||||||
|
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||||
Result nfpOpenApplicationArea(const NfcDeviceHandle *handle, u32 app_id);
|
Result nfpOpenApplicationArea(const NfcDeviceHandle *handle, u32 app_id);
|
||||||
|
|
||||||
/// Not available with ::NfpServiceType_System.
|
/// Not available with ::NfpServiceType_System.
|
||||||
|
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram, and the application area to be opened.
|
||||||
Result nfpGetApplicationArea(const NfcDeviceHandle *handle, void* buf, size_t buf_size, u32 *out_size);
|
Result nfpGetApplicationArea(const NfcDeviceHandle *handle, void* buf, size_t buf_size, u32 *out_size);
|
||||||
|
|
||||||
/// Not available with ::NfpServiceType_System.
|
/// Not available with ::NfpServiceType_System.
|
||||||
|
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram, and the application area to be opened.
|
||||||
Result nfpSetApplicationArea(const NfcDeviceHandle *handle, const void* buf, size_t buf_size);
|
Result nfpSetApplicationArea(const NfcDeviceHandle *handle, const void* buf, size_t buf_size);
|
||||||
|
|
||||||
|
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||||
Result nfpFlush(const NfcDeviceHandle *handle);
|
Result nfpFlush(const NfcDeviceHandle *handle);
|
||||||
|
|
||||||
Result nfpRestore(const NfcDeviceHandle *handle);
|
Result nfpRestore(const NfcDeviceHandle *handle);
|
||||||
|
|
||||||
/// Not available with ::NfpServiceType_System.
|
/// Not available with ::NfpServiceType_System.
|
||||||
|
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||||
Result nfpCreateApplicationArea(const NfcDeviceHandle *handle, u32 app_id, const void* buf, size_t buf_size);
|
Result nfpCreateApplicationArea(const NfcDeviceHandle *handle, u32 app_id, const void* buf, size_t buf_size);
|
||||||
|
|
||||||
/// Not available with ::NfpServiceType_System.
|
/// Not available with ::NfpServiceType_System.
|
||||||
/// Only available with [3.0.0+].
|
/// Only available with [3.0.0+].
|
||||||
|
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram, and the application area to be opened.
|
||||||
Result nfpRecreateApplicationArea(const NfcDeviceHandle *handle, u32 app_id, const void* buf, size_t buf_size);
|
Result nfpRecreateApplicationArea(const NfcDeviceHandle *handle, u32 app_id, const void* buf, size_t buf_size);
|
||||||
|
|
||||||
/// Not available with ::NfpServiceType_System.
|
/// Not available with ::NfpServiceType_System.
|
||||||
@ -325,10 +345,18 @@ Result nfpDeleteApplicationArea(const NfcDeviceHandle *handle);
|
|||||||
Result nfpExistsApplicationArea(const NfcDeviceHandle *handle, bool *out);
|
Result nfpExistsApplicationArea(const NfcDeviceHandle *handle, bool *out);
|
||||||
|
|
||||||
Result nfpGetTagInfo(const NfcDeviceHandle *handle, NfpTagInfo *out);
|
Result nfpGetTagInfo(const NfcDeviceHandle *handle, NfpTagInfo *out);
|
||||||
|
|
||||||
|
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||||
Result nfpGetRegisterInfo(const NfcDeviceHandle *handle, NfpRegisterInfo *out);
|
Result nfpGetRegisterInfo(const NfcDeviceHandle *handle, NfpRegisterInfo *out);
|
||||||
|
|
||||||
|
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||||
Result nfpGetCommonInfo(const NfcDeviceHandle *handle, NfpCommonInfo *out);
|
Result nfpGetCommonInfo(const NfcDeviceHandle *handle, NfpCommonInfo *out);
|
||||||
|
|
||||||
|
/// Requires the amiibo to be mounted with ::NfpMountTarget_Rom.
|
||||||
Result nfpGetModelInfo(const NfcDeviceHandle *handle, NfpModelInfo *out);
|
Result nfpGetModelInfo(const NfcDeviceHandle *handle, NfpModelInfo *out);
|
||||||
|
|
||||||
/// Not available with ::NfpServiceType_User.
|
/// Not available with ::NfpServiceType_User.
|
||||||
|
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||||
Result nfpGetAdminInfo(const NfcDeviceHandle *handle, NfpAdminInfo *out);
|
Result nfpGetAdminInfo(const NfcDeviceHandle *handle, NfpAdminInfo *out);
|
||||||
|
|
||||||
/// Only available with [4.0.0+].
|
/// Only available with [4.0.0+].
|
||||||
@ -381,25 +409,39 @@ Result nfcMfAttachAvailabilityChangeEvent(Event *out_event);
|
|||||||
Result nfpFormat(const NfcDeviceHandle *handle);
|
Result nfpFormat(const NfcDeviceHandle *handle);
|
||||||
|
|
||||||
/// Not available with ::NfpServiceType_User.
|
/// Not available with ::NfpServiceType_User.
|
||||||
|
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||||
Result nfpGetRegisterInfoPrivate(const NfcDeviceHandle *handle, NfpRegisterInfoPrivate *out);
|
Result nfpGetRegisterInfoPrivate(const NfcDeviceHandle *handle, NfpRegisterInfoPrivate *out);
|
||||||
|
|
||||||
/// Not available with ::NfpServiceType_User.
|
/// Not available with ::NfpServiceType_User.
|
||||||
|
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||||
Result nfpSetRegisterInfoPrivate(const NfcDeviceHandle *handle, const NfpRegisterInfoPrivate *register_info_private);
|
Result nfpSetRegisterInfoPrivate(const NfcDeviceHandle *handle, const NfpRegisterInfoPrivate *register_info_private);
|
||||||
|
|
||||||
/// Not available with ::NfpServiceType_User.
|
/// Not available with ::NfpServiceType_User.
|
||||||
|
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||||
Result nfpDeleteRegisterInfo(const NfcDeviceHandle *handle);
|
Result nfpDeleteRegisterInfo(const NfcDeviceHandle *handle);
|
||||||
|
|
||||||
/// Only available with ::NfpServiceType_Debug.
|
/// Only available with ::NfpServiceType_Debug.
|
||||||
|
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||||
Result nfpGetAll(const NfcDeviceHandle *handle, NfpData *out);
|
Result nfpGetAll(const NfcDeviceHandle *handle, NfpData *out);
|
||||||
|
|
||||||
/// Only available with ::NfpServiceType_Debug.
|
/// Only available with ::NfpServiceType_Debug.
|
||||||
|
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||||
Result nfpSetAll(const NfcDeviceHandle *handle, const NfpData *nfp_data);
|
Result nfpSetAll(const NfcDeviceHandle *handle, const NfpData *nfp_data);
|
||||||
|
|
||||||
/// Only available with ::NfpServiceType_Debug.
|
/// Only available with ::NfpServiceType_Debug.
|
||||||
|
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||||
Result nfpFlushDebug(const NfcDeviceHandle *handle);
|
Result nfpFlushDebug(const NfcDeviceHandle *handle);
|
||||||
|
|
||||||
/// Only available with ::NfpServiceType_Debug.
|
/// Only available with ::NfpServiceType_Debug.
|
||||||
Result nfpBreakTag(const NfcDeviceHandle *handle, u32 break_type);
|
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||||
|
Result nfpBreakTag(const NfcDeviceHandle *handle, NfpBreakType break_type);
|
||||||
|
|
||||||
/// Only available with ::NfpServiceType_Debug.
|
/// Only available with ::NfpServiceType_Debug.
|
||||||
Result nfpReadBackupData(const NfcDeviceHandle *handle, void* out_buf, size_t buf_size, u32 *out_size);
|
Result nfpReadBackupData(const NfcDeviceHandle *handle, void* out_buf, size_t buf_size, u32 *out_size);
|
||||||
|
|
||||||
/// Only available with ::NfpServiceType_Debug.
|
/// Only available with ::NfpServiceType_Debug.
|
||||||
Result nfpWriteBackupData(const NfcDeviceHandle *handle, const void* buf, size_t buf_size);
|
Result nfpWriteBackupData(const NfcDeviceHandle *handle, const void* buf, size_t buf_size);
|
||||||
|
|
||||||
/// Only available with ::NfpServiceType_Debug.
|
/// Only available with ::NfpServiceType_Debug.
|
||||||
Result nfpWriteNtf(const NfcDeviceHandle *handle, u32 write_type, const void* buf, size_t buf_size);
|
Result nfpWriteNtf(const NfcDeviceHandle *handle, u32 write_type, const void* buf, size_t buf_size);
|
||||||
|
|
||||||
|
@ -620,7 +620,7 @@ Result nfpFlushDebug(const NfcDeviceHandle *handle) {
|
|||||||
return _nfcCmdInDevhandleNoOut(&g_nfcInterface, handle, 202);
|
return _nfcCmdInDevhandleNoOut(&g_nfcInterface, handle, 202);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result nfpBreakTag(const NfcDeviceHandle *handle, u32 break_type) {
|
Result nfpBreakTag(const NfcDeviceHandle *handle, NfpBreakType break_type) {
|
||||||
if (g_nfpServiceType != NfpServiceType_Debug)
|
if (g_nfpServiceType != NfpServiceType_Debug)
|
||||||
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
|
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user