Homebrew RELEASE AmiiSwap - Amiibo switcher/manager for Emuiibo

  • Thread starter Thread starter FuryBaguette
  • Start date Start date
  • Views Views 86,309
  • Replies Replies 171
  • Likes Likes 24
Has anyone actually managed to do it? because I have not been able
It's still not updated to work with the latest emuiibo. If you want to use Amiiswap you'll need to use an earlier version of emuiibo and use .bin file instead of the new system (I would still suggest using the new emuiibo since it works better than before and doesn't need dumps anymore until AS is available). AmiiSwap should be updated start of september (Maybe just before)
 
  • Like
Reactions: lordelan
Yes, but the question is how to do it because the OP does not clarify it, and so far I have not found any tutorial with the new update. If he managed to get an amiibo but nothing else, he could not change amiibos as indicated by the dev

--------------------- MERGED ---------------------------

lol are you, I had not noticed
 
Last edited by enol,
First of all, thanks for the great project!

Unfortunately, I can't seem to enjoy its bloom yet, here is what I've done:

1- Extracted emuiibo v0.3 and Amiiswap v1.0 to the SD card
2- Generated the virtual Amiibo's JSON files using emuGUIibo (the desktop app) without random UUID and placed their folder in "SD:\emuiibo\amiibo"
3- Restarted Switch so emuiibo v0.3 can generate the BIN files to use later (emuiibo v0.2.1 can't seem to do this, hence I'm using v0.3)
4- After finding the generated BINs, I've replaced emuiibo v0.3 with emuiibo v0.2.1 since the former isn't supported by Amiiswap v1.0, which is the latest as of now
5- Went to Amiiswap, permanently activated emuiibo and selected one of the Amiibos, then exited using the + button (also tried with the Home button)
6- Opened a game, started scanning for Amiibos but none was detected, tried switching with Right stick button and up\right\left\down combo with no luck. Also went to the app and checked that emuiibo is active and the Amiibo is selected.

A fun fact is that I've tried with the unsupported emuiibo v0.3 which acts crazy but it kinda works with some games like Yoshi's Crafted World and partially SSBros. just by activating emuiibo and only placing one Amiibo on the SD card, since I can't select from many on the unsupported emuiibo v0.3

So my question is: can emuiibo v0.2.1 use the BINs generated by v0.3? If so, what am I doing wrong to not have it work?

Tested games are: BOTW, SSB and Yoshi's Crafted world

P.S. I don't care about the icons, thus I haven't included them in the steps

Any help is greatly appreciated
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    217.6 KB · Views: 189
First of all, thanks for the great project!

Unfortunately, I can't seem to enjoy its bloom yet, here is what I've done:

1- Extracted emuiibo v0.3 and Amiiswap v1.0 to the SD card
2- Generated the virtual Amiibo's JSON files using emuGUIibo (the desktop app) without random UUID and placed their folder in "SD:\emuiibo\amiibo"
3- Restarted Switch so emuiibo v0.3 can generate the BIN files to use later (emuiibo v0.2.1 can't seem to do this, hence I'm using v0.3)
4- After finding the generated BINs, I've replaced emuiibo v0.3 with emuiibo v0.2.1 since the former isn't supported by Amiiswap v1.0, which is the latest as of now
5- Went to Amiiswap, permanently activated emuiibo and selected one of the Amiibos, then exited using the + button (also tried with the Home button)
6- Opened a game, started scanning for Amiibos but none was detected, tried switching with Right stick button and up\right\left\down combo with no luck. Also went to the app and checked that emuiibo is active and the Amiibo is selected.

A fun fact is that I've tried with the unsupported emuiibo v0.3 which acts crazy but it kinda works with some games like Yoshi's Crafted World and partially SSBros. just by activating emuiibo and only placing one Amiibo on the SD card, since I can't select from many on the unsupported emuiibo v0.3

So my question is: can emuiibo v0.2.1 use the BINs generated by v0.3? If so, what am I doing wrong to not have it work?

Tested games are: BOTW, SSB and Yoshi's Crafted world

P.S. I don't care about the icons, thus I haven't included them in the steps

Any help is greatly appreciated
Its as if nobody reads threads. This has been asked several times within the last few pages.

Emuiibo 0.3 and Amiiswap 1.0 are incompatible. You're going to have to downgrade to Emuiibo 0.2.1 to use Amiiswap until Amiiswap is updated for the new 0.3 update.
 
Its as if nobody reads threads. This has been asked several times within the last few pages.

Emuiibo 0.3 and Amiiswap 1.0 are incompatible. You're going to have to downgrade to Emuiibo 0.2.1 to use Amiiswap until Amiiswap is updated for the new 0.3 update.

And its seems to me, that you've never read a complete post and always judge after reading 10 words!
He mentioned that he replaced the latest Emuiibo with the version that works with the latest AmiiSwap....
 
And its seems to me, that you've never read a complete post and always judge after reading 10 words!
He mentioned that he replaced the latest Emuiibo with the version that works with the latest AmiiSwap....
It seems my annoyances have gotten the best of me and I've become the asshole. I've read the "0.3 doesn't work, HELP!" comment so many times its deafening, so when I read that I jumped to a conclusion. So, Flocki1987, you are correct.
And to Barrytoo, my sincerest apologies.

I'm pretty sure that was emuiibo 0.3's selling point. That it was able to emulate all the other files besides the unique ID. It was completely rewritten to accommodate for that, so if 0.2.1 wasn't written to emulate those files, then the generated ID's using emuGUIibo wouldn't work properly. At least that's how I'd imagine it would work.

But what do I know. Did you turn it on before launching the game?
 
Last edited by 345742D,
AmiiSwap dosnt work with emuiibo 0.3 it needs updating dosnt matter if you use atmosphere 0.9.2 or 0.9.3 it is working with emuiibo 0.21

After two days of trying to get amiiswap working for the first time this was the fix for me. Thank you so much.
 
  • Like
Reactions: iamry4n
It seems my annoyances have gotten the best of me and I've become the asshole. I've read the "0.3 doesn't work, HELP!" comment so many times its deafening, so when I read that I jumped to a conclusion. So, Flocki1987, you are correct.
And to Barrytoo, my sincerest apologies.

I'm pretty sure that was emuiibo 0.3's selling point. That it was able to emulate all the other files besides the unique ID. It was completely rewritten to accommodate for that, so if 0.2.1 wasn't written to emulate those files, then the generated ID's using emuGUIibo wouldn't work properly. At least that's how I'd imagine it would work.

But what do I know. Did you turn it on before launching the game?

No worries, I get where you're coming from.

Regarding the issue, I've followed up on the Discord's support page and it seems that there's nothing to do right now to get it to works other than waiting for an update to fix it.

To answer your question, yes I tried all the scenarios including running it before the game starts.


And its seems to me, that you've never read a complete post and always judge after reading 10 words!
He mentioned that he replaced the latest Emuiibo with the version that works with the latest AmiiSwap....

Thanks for your fair judgment, it's all cool!
 
@FuryBaguette Are you going to update for Emuiibo v.3, wait for Emuiibo to support the latest ams or both? Was looking forward to your update and just wondering if the release of OFW 9.0 will change your efforts?

Thanks
 
@FuryBaguette Are you going to update for Emuiibo v.3, wait for Emuiibo to support the latest ams or both? Was looking forward to your update and just wondering if the release of OFW 9.0 will change your efforts?

Thanks
I currently have no time to work on it (it's partially updated for emuiibo) but it'll be updated for emuiibo v0.3 and fw 9.0
 
I currently have no time to work on it (it's partially updated for emuiibo) but it'll be updated for emuiibo v0.3 and fw 9.0

Nice, I've already modded your code and have it working for emuiibo v0.3 and the latest Atmosphere - only I didn't fix the search for images yet - but they work if you just put a png in the ammibo's folder and call it amiibo.icon. I was going to post it, but as your going to release anyway - I'll not bother.

Also on your github - on your MainLayout.cpp code - when you click on show selected - it crashes the app. I changed the code to this to fix that:

Code:
    void MainLayout::showSelected_Click()
    {
        char key[] = { 0 };
        char amiibo[FS_MAX_PATH] = { 0 };
        bool isOk;
        Result rs = nfpemuGetCurrentAmiibo(amiibo, &isOk);
        if(rs == 0 && R_FAILED(strcmp(key,amiibo)) && isOk) {
            std::string path = utils::trim_right_copy(std::string(amiibo));
            std::string amiiboName = utils::getLastFromPath(path);
            bool random = utils::isRandomUuid(path+"/register.json");
            mainapp->CreateShowDialog("Active amiibo: " + amiiboName, "Located in: " + path + "\nRandom UUID: " + ((random) ? "enabled":"disabled"), { "Close" }, true, path + "/amiibo.icon");
        } else {
            pu::overlay::Toast *toast = new pu::overlay::Toast("No active amiibo.", 20, {255,255,255,255}, {0,51,102,255});
            mainapp->StartOverlayWithTimeout(toast, 1500);
        }
    }

Also, when the app starts - in Utils.cpp, the EnsureDirectories void is never called, so these directories are never created. You could add this, somewhere to the start of your code to check those directories exist, if not create them.
Code:
utils::EnsureDirectories();

Example, in MainApplication.ccp - you could change to this:

    MainApplication::MainApplication() : pu::Application()
    {
        lang::Initialize();
        utils::EnsureDirectories(); //added here
        this->bootLayout = new BootLayout();
        this->LoadLayout(this->bootLayout);
        this->CallForRender();

Then in Utils.cpp - put some checks in - like this:

    void EnsureDirectories()
    {
        FILE * pFile;
        FILE * qFile;
        pFile = fopen ("sdmc:/switch/AmiiSwap/game_icons","r");
        pFile = fopen ("sdmc:/emuiibo","r");
      
        if (pFile==NULL)
        {
            CreateDirectory("sdmc:/switch/AmiiSwap/game_icons");
        }
      
        if (qFile==NULL)
        {
            CreateDirectory("sdmc:/emuiibo");
        }

        fclose (pFile);
        fclose (qFile);
    }

Anyway, I look forward to your updated code.
 
Last edited by mrdude,
Nice, I've already modded your code and have it working for emuiibo v0.3 and the latest Atmosphere - only I didn't fix the search for images yet - but they work if you just put a png in the ammibo's folder and call it amiibo.icon. I was going to post it, but as your going to release anyway - I'll not bother.

Also on your github - on your MainLayout.cpp code - when you click on show selected - it crashes the app. I changed the code to this to fix that:

Code:
    void MainLayout::showSelected_Click()
    {
        char key[] = { 0 };
        char amiibo[FS_MAX_PATH] = { 0 };
        bool isOk;
        Result rs = nfpemuGetCurrentAmiibo(amiibo, &isOk);
        if(rs == 0 && R_FAILED(strcmp(key,amiibo)) && isOk) {
            std::string path = utils::trim_right_copy(std::string(amiibo));
            std::string amiiboName = utils::getLastFromPath(path);
            bool random = utils::isRandomUuid(path+"/register.json");
            mainapp->CreateShowDialog("Active amiibo: " + amiiboName, "Located in: " + path + "\nRandom UUID: " + ((random) ? "enabled":"disabled"), { "Close" }, true, path + "/amiibo.icon");
        } else {
            pu::overlay::Toast *toast = new pu::overlay::Toast("No active amiibo.", 20, {255,255,255,255}, {0,51,102,255});
            mainapp->StartOverlayWithTimeout(toast, 1500);
        }
    }

Also, when the app starts - in Utils.cpp, the EnsureDirectories void is never called, so these directories are never created. You could add this, somewhere to the start of your code to check those directories exist, if not create them.
Code:
utils::EnsureDirectories();

Example, in MainApplication.ccp - you could change to this:

    MainApplication::MainApplication() : pu::Application()
    {
        lang::Initialize();
        utils::EnsureDirectories(); //added here
        this->bootLayout = new BootLayout();
        this->LoadLayout(this->bootLayout);
        this->CallForRender();

Then in Utils.cpp - put some checks in - like this:

    void EnsureDirectories()
    {
        FILE * pFile;
        FILE * qFile;
        pFile = fopen ("sdmc:/switch/AmiiSwap/game_icons","r");
        pFile = fopen ("sdmc:/emuiibo","r");
     
        if (pFile==NULL)
        {
            CreateDirectory("sdmc:/switch/AmiiSwap/game_icons");
        }
     
        if (qFile==NULL)
        {
            CreateDirectory("sdmc:/emuiibo");
        }

        fclose (pFile);
        fclose (qFile);
    }

Anyway, I look forward to your updated code.
The project is open-sourced on GitHub. Why not just fork and make a pull request?
 
I've actually already made some modifications, I'm just having libnx problems now

What problems are you having?

Also I've modded the code to fix toggling between Random UUID

Code:
    void AmiibosLayout::randomizeUuid_Click(std::string amiibo)
    {
        std::string amiiboName = amiibo;
        std::string amiiboPath = "sdmc:/emuiibo/" + amiibo;
        std::string jsonPath = amiiboPath + "/tag.json";
        size_t size = amiibo.find_last_of("/\\");
        if (size != std::string::npos)
            amiiboName = amiibo.substr(size + 1);
        bool randomStatus = utils::isRandomUuid(jsonPath);
        int sopt = mainapp->CreateShowDialog(lang::GetLabel(lang::Label::RANDOM_DIALOG_TITLE), utils::replace(utils::replace(lang::GetLabel(lang::Label::RANDOM_DIALOG_TEXT), "{{AMIIBO_NAME}}", amiiboName), "{{STATUS}}", (randomStatus ? lang::GetLabel(lang::Label::ENABLED) : lang::GetLabel(lang::Label::DISABLED))), { lang::GetLabel(lang::Label::TOGGLE), lang::GetLabel(lang::Label::CANCEL) }, true, amiiboPath + "/amiibo.icon");
        if(sopt == 0){
            toggleRandomUuid(jsonPath, !randomStatus);
            //pu::overlay::Toast *toast = new pu::overlay::Toast(utils::replace(utils::replace(lang::GetLabel(lang::Label::TOAST_RANDOM), "{{AMIIBO_NAME}}", amiiboName), "{{STATUS}}", (randomStatus ? lang::GetLabel(lang::Label::ENABLED) : lang::GetLabel(lang::Label::DISABLED))), 20, {255,255,255,255}, {0,51,102,255});
           
              std::ifstream ifs(jsonPath);
                  auto amiiboJson = json::parse(ifs);
                  if(ifs.is_open())
                      ifs.close();
                 
                  auto findsting = amiiboJson.find("randomUuid");
                  std::string myamiibo = ("%s", amiiboName);
                 
                  if (findsting != amiiboJson.end())
                      {
                          std::string message = "Random UUID Enabled for " + myamiibo;
                          pu::overlay::Toast *toast = new pu::overlay::Toast(("%s", message), 25, {0,0,0,0}, {0,255,0,0});
                          mainapp->StartOverlayWithTimeout(toast, 1500);
                      }
                  else
                      {
                          std::string message = "Random UUID Disabled for " + myamiibo;
                          pu::overlay::Toast *toast = new pu::overlay::Toast(("%s", message), 25, {255,255,255,255}, {255,0,0,0});
                          mainapp->StartOverlayWithTimeout(toast, 1500);
                      }
                 
                  std::ofstream ofs(jsonPath);
                  ofs << amiiboJson.dump(4);
                  if(ofs.is_open())
                      ofs.close();
        }
    }

    void AmiibosLayout::toggleRandomUuid(std::string jsonPath, bool toggle)
    {
        //added code
        #define STR_LEN 18
        unsigned char str[STR_LEN];
        const char *hex_digits = "0123456789ABCDEF";
        int i;
     
        for( i = 0 ; i < STR_LEN;) {
            str[i] = hex_digits[( rand() % 16 )];
            i++;
            }
     
        const char *hex = str;
        //end of added code
     
       
            std::ifstream ifs(jsonPath);
      auto amiiboJson = json::parse(ifs);
      if(ifs.is_open())
          ifs.close();
   
      auto findsting = amiiboJson.find("randomUuid");
   
      if (findsting != amiiboJson.end())
          {
              amiiboJson.erase("randomUuid");
              amiiboJson["uuid"] = hex;
          }
      else
          {
              amiiboJson.erase("uuid");
              amiiboJson["randomUuid"] = toggle;
          }
      std::ofstream ofs(jsonPath);
      ofs << amiiboJson.dump(4);
      if(ofs.is_open())
          ofs.close();
     
    }

    pu::element::Menu *AmiibosLayout::GetAmiibosMenu()
    {
        return (this->amiibosMenu);
    }
}

You can use that if you want to save some time,
 
Last edited by mrdude,
  • Like
Reactions: iriez and lordelan
Just wanted to put it out there that mrdude has been extremely cool and helpful and was able to get my fire emblem three houses amiibo's working thanks to mrdude and his contributions.
https://gbatemp.net/threads/amiiswap-mod-for-emuiibo-0-3.548465/#post-8816967


Im grateful to mrdude for having both the right attitude and the competence to quickly resolve the issues. Im also grateful to Fury for creating and open sourcing the application, but needs to get a handle on how he responds to people on his discord. If people are asking questions thats a good thing as its showing an interest into something you're obviously interested in too. Don't get offended when people ask questions within the scope of amiibo emulation as it relates to how amiiswap functions. Poor form.
 
Last edited by iriez,
Just wanted to put it out there that mrdude has been extremely cool and helpful and was able to get my fire emblem three houses amiibo's working thanks to mrdude and his contributions.
https://gbatemp.net/threads/amiiswap-mod-for-emuiibo-0-3.548465/#post-8816967


Im grateful to mrdude for having both the right attitude and the competence to quickly resolve the issues. Im also grateful to Fury for creating and open sourcing the application, but needs to get a handle on how he responds to people on his discord. If people are asking questions thats a good thing as its showing an interest into something you're obviously interested in too. Don't get offended when people ask questions within the scope of amiibo emulation as it relates to how amiiswap functions. Poor form.
I just want to say that you were mentioning someone on the discord who had nothing to do with AmiiSwap and emuiibo which is against the rules and most importantly annoying for that person, you got warned and still did it again. For your problems you just had to read a little and ask at the right place, we don't handle support for everything Switch related.
 
  • Like
Reactions: JonJaded

Site & Scene News

Popular threads in this forum