diff --git a/include/core/fs_ext.h b/include/core/fs_ext.h index 32618f9..8360272 100644 --- a/include/core/fs_ext.h +++ b/include/core/fs_ext.h @@ -77,7 +77,7 @@ typedef enum { typedef struct { u8 maker_code; ///< FsCardId1MakerCode. u8 memory_capacity; ///< Matches GameCardRomSize. - u8 reserved; ///< Known values: 0x00, 0x01, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0C, 0x0D, 0x0E, 0x80. + u8 reserved; ///< Known values: 0x00, 0x01, 0x02, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0C, 0x0D, 0x0E, 0x80. u8 memory_type; ///< FsCardId1MemoryType. } FsCardId1; @@ -108,9 +108,9 @@ NXDT_ASSERT(FsCardId3, 0x4); /// Returned by fsDeviceOperatorGetGameCardIdSet. typedef struct { - FsCardId1 id1; ///< Specifies maker code, memory capacity, and memory type - FsCardId2 id2; ///< Specifies card security number and card type - FsCardId3 id3; ///< Always zero (so far) + FsCardId1 id1; ///< Specifies maker code, memory capacity and memory type. + FsCardId2 id2; ///< Specifies card security number and card type. + FsCardId3 id3; ///< Always zero (so far). } FsGameCardIdSet; NXDT_ASSERT(FsGameCardIdSet, 0xC); @@ -121,7 +121,6 @@ Result fsOpenGameCardDetectionEventNotifier(FsEventNotifier *out); /// IDeviceOperator. Result fsDeviceOperatorUpdatePartitionInfo(FsDeviceOperator *d, const FsGameCardHandle *handle, u32 *out_title_version, u64 *out_title_id); -Result fsDeviceOperatorGetGameCardDeviceCertificate(FsDeviceOperator *d, const FsGameCardHandle *handle, FsGameCardCertificate *out); #ifdef __cplusplus } diff --git a/source/core/fs_ext.c b/source/core/fs_ext.c index 2bf77de..f86a410 100644 --- a/source/core/fs_ext.c +++ b/source/core/fs_ext.c @@ -63,18 +63,3 @@ Result fsDeviceOperatorUpdatePartitionInfo(FsDeviceOperator *d, const FsGameCard return rc; } - -Result fsDeviceOperatorGetGameCardDeviceCertificate(FsDeviceOperator *d, const FsGameCardHandle *handle, FsGameCardCertificate *out) -{ - const struct { - FsGameCardHandle handle; - u64 buf_size; - } in = { *handle, sizeof(FsGameCardCertificate) }; - - Result rc = serviceDispatchIn(&d->s, 206, in, - .buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_Out }, - .buffers = { { out, sizeof(FsGameCardCertificate) } } - ); - - return rc; -} diff --git a/source/core/gamecard.c b/source/core/gamecard.c index 1ac5b62..95afb77 100644 --- a/source/core/gamecard.c +++ b/source/core/gamecard.c @@ -379,7 +379,7 @@ bool gamecardGetCertificate(FsGameCardCertificate *out) if (!g_gameCardInterfaceInit || g_gameCardStatus != GameCardStatus_InsertedAndInfoLoaded || !g_gameCardHandle.value || !out) break; /* Read the gamecard certificate using the official IPC call. */ - Result rc = fsDeviceOperatorGetGameCardDeviceCertificate(&g_deviceOperator, &g_gameCardHandle, out); + Result rc = fsDeviceOperatorGetGameCardDeviceCertificate(&g_deviceOperator, &g_gameCardHandle, out, sizeof(FsGameCardCertificate), (s64)sizeof(FsGameCardCertificate)); if (R_FAILED(rc)) LOG_MSG_ERROR("fsDeviceOperatorGetGameCardDeviceCertificate failed! (0x%X)", rc); ret = R_SUCCEEDED(rc);