amiibo: GetModelInfo puts the series byte in the wrong place, so only Link/Zelda/Ganondorf amiibo are accepted #2489

Open
opened 2026-11-24 22:23:43 +00:00 by unstoppablekhaos · 2 comments

Longshot version

v3.1.1-dirty (source cdc9b8f7), built with LongshotBuilder nightly-672-e6196f0f. GetModelInfo in host/nn_nfp.c is unchanged in nightly-801-9046a8d7

Channel

Nightly

What kind of problem

Something else

What happened

With amiibo support on, Link, Zelda and Ganondorf amiibo (all variants, including the Smash Bros. ones) work. Every other Zelda-series amiibo shown as supported in the official overview trailer is rejected in game with "This amiibo is not supported": Wolf Link, the four Champions, Riju, Sidon, Tulin, Yunobo, Mineru's Construct, Guardian and Bokoblin.

The dumps load fine. The log shows the same path for working and rejected tags:

nfp: the game reads the NFC tag "[Breath of the Wild] Link (Archer)"
nfp: GetModelInfo -> 01 00 00 00 53 03 09
nfp: the game reads the NFC tag "Yunobo"
nfp: GetModelInfo -> 01 0c 00 00 a6 04 09

Cause

host/nn_nfp.c, GetModelInfo, copies tag bytes 0x54..0x5A in tag order: character (2), variant, figure type, model number, series.

nn::nfp::ModelInfo is laid out as characterId[3], seriesId, numberingId (u16), nfpType. Ryujinx uses the same layout. So the game reads the figure type (00) as the series, and the series (09) as the type.

romfs/Game/AmiiboSetting has per-character entries plus a series-wide entry (SeriesIDType, no specific character). The per-character entries still match, which is why Link/Zelda/Ganondorf work. The series-wide entry never matches, so every other character is rejected.

Confirmed

Swapping bytes 0x57 and 0x5A in the dump (so the straight copy comes out in the right order) makes the rejected amiibo work in game. Tested on nightly-672; GetModelInfo is unchanged in nightly-801.

Suggested fix

memcpy(m, tag + 0x54, 3);   /* character id + variant */
m[3] = tag[0x5a];           /* series */
m[4] = tag[0x59];           /* model number, native u16 (as in #1747) */
m[5] = tag[0x58];
m[6] = tag[0x57];           /* figure type */

Where in the game

Any amiibo scan (after the Great Deku Tree)

How often

Every time

Graphics card and driver version

NVIDIA GeForce RTX 5070, NVIDIA 621.24

CPU, RAM and operating system

AMD Ryzen 9 5950X, 64 GB, Windows 11 Pro

Changes from the defaults

No response

longshot_log.txt

Relevant lines only (not GPU-related).

Before, original dumps, rejected with "This amiibo is not supported":

nfp: the game reads the NFC tag "Yunobo"
nfp: GetModelInfo -> 01 0c 00 00 a6 04 09 (lr 83b842c0)

Working for comparison:

nfp: the game reads the NFC tag "[Breath of the Wild] Link (Archer)"
nfp: GetModelInfo -> 01 00 00 00 53 03 09 (lr 83b842c0)

After, same dumps with bytes 0x57 and 0x5A swapped, accepted in game:

nfp: the game reads the NFC tag "[TEST] BOTW Bokoblin"
nfp: GetModelInfo -> 01 41 00 09 5c 03 00 (lr 83b842c0)
nfp: the game reads the NFC tag "[TEST] BOTW Guardian"
nfp: GetModelInfo -> 01 40 00 09 55 03 00 (lr 83b842c0)

Screenshots or video

No response

Before you send it

  • The problem is still there on the newest release or nightly.
  • I searched the open issues for it.
  • I'm not attaching game files, keys, the game's executable, its .bin caches or saves.
### Longshot version v3.1.1-dirty (source cdc9b8f7), built with LongshotBuilder nightly-672-e6196f0f. GetModelInfo in host/nn_nfp.c is unchanged in nightly-801-9046a8d7 ### Channel Nightly ### What kind of problem Something else ### What happened With amiibo support on, Link, Zelda and Ganondorf amiibo (all variants, including the Smash Bros. ones) work. Every other Zelda-series amiibo shown as supported in the official overview trailer is rejected in game with "This amiibo is not supported": Wolf Link, the four Champions, Riju, Sidon, Tulin, Yunobo, Mineru's Construct, Guardian and Bokoblin. The dumps load fine. The log shows the same path for working and rejected tags: ``` nfp: the game reads the NFC tag "[Breath of the Wild] Link (Archer)" nfp: GetModelInfo -> 01 00 00 00 53 03 09 nfp: the game reads the NFC tag "Yunobo" nfp: GetModelInfo -> 01 0c 00 00 a6 04 09 ``` ### Cause `host/nn_nfp.c`, `GetModelInfo`, copies tag bytes 0x54..0x5A in tag order: character (2), variant, figure type, model number, series. `nn::nfp::ModelInfo` is laid out as `characterId[3]`, `seriesId`, `numberingId` (u16), `nfpType`. Ryujinx uses the same layout. So the game reads the figure type (`00`) as the series, and the series (`09`) as the type. `romfs/Game/AmiiboSetting` has per-character entries plus a series-wide entry (`SeriesIDType`, no specific character). The per-character entries still match, which is why Link/Zelda/Ganondorf work. The series-wide entry never matches, so every other character is rejected. ### Confirmed Swapping bytes 0x57 and 0x5A in the dump (so the straight copy comes out in the right order) makes the rejected amiibo work in game. Tested on nightly-672; `GetModelInfo` is unchanged in nightly-801. ### Suggested fix ```c memcpy(m, tag + 0x54, 3); /* character id + variant */ m[3] = tag[0x5a]; /* series */ m[4] = tag[0x59]; /* model number, native u16 (as in #1747) */ m[5] = tag[0x58]; m[6] = tag[0x57]; /* figure type */ ``` ### Where in the game Any amiibo scan (after the Great Deku Tree) ### How often Every time ### Graphics card and driver version NVIDIA GeForce RTX 5070, NVIDIA 621.24 ### CPU, RAM and operating system AMD Ryzen 9 5950X, 64 GB, Windows 11 Pro ### Changes from the defaults _No response_ ### longshot_log.txt Relevant lines only (not GPU-related). Before, original dumps, rejected with "This amiibo is not supported": ``` nfp: the game reads the NFC tag "Yunobo" nfp: GetModelInfo -> 01 0c 00 00 a6 04 09 (lr 83b842c0) ``` Working for comparison: ``` nfp: the game reads the NFC tag "[Breath of the Wild] Link (Archer)" nfp: GetModelInfo -> 01 00 00 00 53 03 09 (lr 83b842c0) ``` After, same dumps with bytes 0x57 and 0x5A swapped, accepted in game: ``` nfp: the game reads the NFC tag "[TEST] BOTW Bokoblin" nfp: GetModelInfo -> 01 41 00 09 5c 03 00 (lr 83b842c0) nfp: the game reads the NFC tag "[TEST] BOTW Guardian" nfp: GetModelInfo -> 01 40 00 09 55 03 00 (lr 83b842c0) ``` ### Screenshots or video _No response_ ### Before you send it - [x] The problem is still there on the newest release or nightly. - [x] I searched the open issues for it. - [x] I'm not attaching game files, keys, the game's executable, its .bin caches or saves.
Member

Possibly related, for context:

  • PR #1747 fix(nfc): return the amiibo model number in native byte order — Merged NFC fix touches GetModelInfo field ordering, but specifically corrects the model-number byte order; this report identifies a distinct series/type field swap.
Possibly related, for context: - PR #1747 fix(nfc): return the amiibo model number in native byte order — Merged NFC fix touches GetModelInfo field ordering, but specifically corrects the model-number byte order; this report identifies a distinct series/type field swap.
Contributor

Claiming this one. Branch dazemc/Longshot:fix/nfp-model-info-field-order at 1a4a65065, on main 9046a8d75; no pull request yet.

Fix: host/nn_nfp.c GetModelInfo now returns the SDK layout characterId[3], seriesId, numberingId (native u16), nfpType from the tag's [character 2][variant][type][number 2 BE][series]: memcpy(m, tag + 0x54, 3), m[3] = tag[0x5a], m[4] = tag[0x59], m[5] = tag[0x58], m[6] = tag[0x57]. The big-endian-to-native number conversion from #1747 is unchanged.

Tests, game-free: the existing tests/test_nfc_model_info.py asserted the wrong order (out[3] = tag 0x57, out[6] = tag 0x5a); it now asserts the SDK's order and fails on main. New tests/test_nfc_model_info_fields.py cuts the real HLE function and reads three synthetic tag blocks whose type and series differ, in the tag's order and out in the SDK's. On main 8aa5ab87 it fails with FAIL case 0: ModelInfo[3] series id is 0x00 (tag[0x57], the figure type), expected 0x09 (tag[0x5a], the series) and FAIL case 0: ModelInfo[6] nfp type is 0x09 (tag[0x5a], the series), expected 0x00 (tag[0x57], the figure type) (6 failed checks, exit 1); at the fix it passes. tests/test_nfc_list_cap.py, tests/test_nfc_scan_hint.py and tests/test_host_guest_writes.py also pass; the last needed its ALLOWED text for the 7-byte copy changed to the 3-byte one.

In game, no amiibo figure or reader: a 540-byte synthetic tag (01 0c 00 00 a6 04 09 at 0x54, i.e. Yunobo: type 0x00, number 0xa604, series 0x09; NTAG215 container F1 10 FF EE) was placed in a temporary NFC folder and tapped from the Insert menu's NFC tab. Windowed run of the fix runtime at 1a4a65065's tree, Hyrule Field save, amiibo enabled in Options, Items tab's amiibo icon, ZR: nfp: the game waits for an NFC tag: one is at the reader → nfp: the game reads the NFC tag "Yunobo synthetic", then the read completed and handy items appeared around Link. The same tag, save and steps on the main runtime at 8aa5ab87 show This amiibo is not supported. No dump, key or game file is part of the branch or this comment.

Claiming this one. Branch `dazemc/Longshot:fix/nfp-model-info-field-order` at `1a4a65065`, on `main` `9046a8d75`; no pull request yet. **Fix:** `host/nn_nfp.c` `GetModelInfo` now returns the SDK layout `characterId[3], seriesId, numberingId (native u16), nfpType` from the tag's `[character 2][variant][type][number 2 BE][series]`: `memcpy(m, tag + 0x54, 3)`, `m[3] = tag[0x5a]`, `m[4] = tag[0x59]`, `m[5] = tag[0x58]`, `m[6] = tag[0x57]`. The big-endian-to-native number conversion from #1747 is unchanged. **Tests, game-free:** the existing `tests/test_nfc_model_info.py` asserted the wrong order (`out[3]` = tag 0x57, `out[6]` = tag 0x5a); it now asserts the SDK's order and fails on main. New `tests/test_nfc_model_info_fields.py` cuts the real HLE function and reads three synthetic tag blocks whose type and series differ, in the tag's order and out in the SDK's. On main `8aa5ab87` it fails with `FAIL case 0: ModelInfo[3] series id is 0x00 (tag[0x57], the figure type), expected 0x09 (tag[0x5a], the series)` and `FAIL case 0: ModelInfo[6] nfp type is 0x09 (tag[0x5a], the series), expected 0x00 (tag[0x57], the figure type)` (6 failed checks, exit 1); at the fix it passes. `tests/test_nfc_list_cap.py`, `tests/test_nfc_scan_hint.py` and `tests/test_host_guest_writes.py` also pass; the last needed its `ALLOWED` text for the 7-byte copy changed to the 3-byte one. **In game, no amiibo figure or reader:** a 540-byte synthetic tag (`01 0c 00 00 a6 04 09` at 0x54, i.e. Yunobo: type 0x00, number 0xa604, series 0x09; NTAG215 container `F1 10 FF EE`) was placed in a temporary NFC folder and tapped from the Insert menu's NFC tab. Windowed run of the fix runtime at `1a4a65065`'s tree, Hyrule Field save, amiibo enabled in Options, Items tab's amiibo icon, ZR: `nfp: the game waits for an NFC tag: one is at the reader` → `nfp: the game reads the NFC tag "Yunobo synthetic"`, then the read completed and handy items appeared around Link. The same tag, save and steps on the `main` runtime at `8aa5ab87` show `This amiibo is not supported.` No dump, key or game file is part of the branch or this comment.
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot#2489
No description provided.