Skip to content

amiibo Part B: Each game's page shows which amiibo do something in it, and brings in yours - #712

Open
davdxpx wants to merge 2 commits into
igawa6:mainfrom
davdxpx:amiibo-game-page
Open

davdxpx wants to merge 2 commits into
igawa6:mainfrom
davdxpx:amiibo-game-page

Conversation

@davdxpx

@davdxpx davdxpx commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

A player can't see today which amiibo a game takes, or what a figure does in it. This PR gives every game that uses amiibo an amiibo area on its page. The player sees there what each figure brings before playing, imports their own, and resets what a game saved on one.

Builds on Part A (#711, the stand), on main 0.1.8.

What players get

  • The tile sits after Controls, only for games that AmiiboAPI lists or that were seen looking for an amiibo. Its line counts the player's own amiibo and all the ones that fit.
  • The area shows the player's own amiibo that fit first, the last placed first, then every amiibo that fits the game. Each one is a square picture with its name. A search covers all amiibo, and Import takes .bin files, ZIP packs or a folder.
  • An amiibo's page shows:
    • the picture, series and type, and what the amiibo does in this game;
    • the game's data on it, with Reset game data (for that game only);
    • where it came from, and the other games that use it;
    • Remove from yours.
  • Pictures load when the area shows them. Offline, Peanuts' own card with the new stand icon stands in. B goes back from a page to the pictures.

Pictures

The tile The area An amiibo's page
01-tile 02-area 03-amiibo-page
Import Imported Phone width
04-game-data 05-import 06-phone

How it is built

  • dev.peanuts.amiibo.AmiiboPage builds the area and an amiibo's page. AmiiboFiles picks files or a folder through the system's picker.
  • GameAreas gets the AMIIBO area after CONTROLS, and GamePage has one hook for the tile and its result line.
  • The new outline icon pi_amiibo comes from peanuts/scripts/icons.py.

Tested

  • Emulator (Android 13, 1920 x 1080 and a phone's 1080 x 2340), with amiibo from generated .bin files:
    • the tile and its line, the area, the search, an amiibo's page, B back to the pictures;
    • Import through the system's file picker;
    • Reset game data and Remove, each asked first (the store's files checked after);
    • offline (airplane mode, no cached pictures): Peanuts' own card in place of each picture.
  • Imports of files, ZIP packs and folders are covered by AmiiboJvmTest (Part A).
  • peanuts/tests/test_amiibo.py (Page) and test_game_page.py (the ten areas).
  • upstream-update.sh --check, check-publish.sh, and check-min-api.py on the APK.

…eded

Games that read amiibo (Breath of the Wild's daily rewards, Super Mario
Odyssey's costumes, Smash's fighters) now find one: a virtual stand in
the host that the app places the player's amiibo on. GitHub issue igawa6#582.

- dm/peanuts/peanuts_amiibo.c takes over nn::nfc and nn::nfp in the
  Android host in place of hle_sdk16.c's block (PN_AMIIBO, one marked
  pair of lines). It sits above the figures' encryption: TagInfo,
  ModelInfo, CommonInfo, RegisterInfo and the application areas are
  plain, so no amiibo keys are asked for, read or shipped.
- The activate and deactivate events are signalled; mount, read,
  write, flush and create or recreate of an area answer as the SDK's;
  each game keeps an area of its own on an amiibo; a second after the
  game unmounts it the amiibo leaves the stand on its own. One placed
  in advance is found at the game's next search.
- The owner is the player's Mii, the nickname the character's name.
- dev.peanuts.amiibo: AmiiboAPI's table offline (MIT,
  peanuts/scripts/amiibo-db.py), the player's own amiibo, imports of
  .bin files, folders and ZIP packs (ID and UID only), pictures loaded
  on demand, and the adb control's game do=amiibo.

Tests: test_amiibo_host.py (the stand in C, made-up IDs),
test_amiibo.py (AmiiboJvmTest), test_ctl.py. Round 65.
…s yours

A game that uses amiibo now has an amiibo area on its page, so a player
sees which figures do something in it before playing, brings in their
own and resets what a game saved on one.

- The tile (after Controls) only for games AmiiboAPI lists or that were
  seen looking for an amiibo; its line counts yours and all that fit.
- The area: your own that fit first (the last placed first), then every
  amiibo that fits the game, as square pictures with names; a search
  over all of them; Import of .bin files, ZIP packs or a folder.
- An amiibo's page: picture, series, type, what it does in this game,
  the game's data on it with Reset game data (that game only), where it
  came from, the other games that use it, Remove from yours.
- Pictures load when the area shows them; Peanuts' own card (the new
  stand icon, pi_amiibo) stands in offline. B goes back to the pictures.

Tests: test_amiibo.py (Page), test_game_page.py (the ten areas).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant