diff --git a/nx/include/switch/services/nfc.h b/nx/include/switch/services/nfc.h index 82567cef..6e7dea60 100644 --- a/nx/include/switch/services/nfc.h +++ b/nx/include/switch/services/nfc.h @@ -161,7 +161,7 @@ Result nfpuGetRegisterInfo(HidControllerID id, NfpuRegisterInfo *out); Result nfpuGetCommonInfo(HidControllerID id, NfpuCommonInfo *out); Result nfpuGetModelInfo(HidControllerID id, NfpuModelInfo *out); -Result nfpuOpenApplicationArea(HidControllerID id, NfpuAppId app_id); +Result nfpuOpenApplicationArea(HidControllerID id, NfpuAppId app_id, u32* area_size); Result nfpuGetApplicationArea(HidControllerID id, void* buf, size_t buf_size); /// Calls nfc:user. diff --git a/nx/source/services/nfc.c b/nx/source/services/nfc.c index 3b052ee9..7363207b 100644 --- a/nx/source/services/nfc.c +++ b/nx/source/services/nfc.c @@ -609,9 +609,9 @@ inline Result nfpuGetModelInfo(HidControllerID id, NfpuModelInfo *out) { return _nfpuInterfaceCmdInIdOutBuffer(&g_nfpuInterface, 16, id, out, sizeof(NfpuModelInfo)); } -Result nfpuOpenApplicationArea(HidControllerID id, NfpuAppId app_id) { +Result nfpuOpenApplicationArea(HidControllerID id, NfpuAppId app_id, u32* area_size) { if (id == CONTROLLER_P1_AUTO) - return nfpuOpenApplicationArea(g_controllerP1AutoID, app_id); + return nfpuOpenApplicationArea(g_controllerP1AutoID, app_id, area_size); IpcCommand c; ipcInitialize(&c); @@ -637,12 +637,16 @@ Result nfpuOpenApplicationArea(HidControllerID id, NfpuAppId app_id) { struct { u64 magic; u64 result; + u32 area_size; } *resp; serviceIpcParse(&g_nfpuInterface, &r, sizeof(*resp)); resp = r.Raw; - rc = resp->result; + rc = resp->result; + + if (R_SUCCEEDED(rc) && area_size) + *area_size = resp->area_size; } return rc;