mirror of
https://gitea.tendokyu.moe/ppc/amnet.git
synced 2026-09-28 09:47:57 +03:00
fix idm value passing
This commit is contained in:
+10
-4
@@ -111,7 +111,7 @@ public static class DllMain
|
||||
}
|
||||
|
||||
[UnmanagedCallersOnly(EntryPoint = "aime_io_nfc_get_felica_id")]
|
||||
public static int GetFelicaId(byte unitNo, IntPtr idm)
|
||||
public static unsafe int GetFelicaId(byte unitNo, ulong* idm)
|
||||
{
|
||||
if (!Config.PhysicalCardUseIDm || unitNo != 0)
|
||||
{
|
||||
@@ -123,9 +123,15 @@ public static class DllMain
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
Marshal.Copy(card.IDm, 0, idm, sizeof(ulong));
|
||||
App.Logger.LogInformation("FeliCa IDm read: {idm}", CardPresenter.FormatHexCode(card.IDm));
|
||||
|
||||
ulong idmValue = 0;
|
||||
for (var i = 0 ; i < 8 ; i++) {
|
||||
idmValue = (idmValue << 8) | card.IDm[i];
|
||||
}
|
||||
|
||||
*idm = idmValue;
|
||||
|
||||
App.Logger.LogInformation("FeliCa IDm read: {idm} ({value})", CardPresenter.FormatHexCode(card.IDm), idmValue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user