Homebrew RELEASE AmiiSwap - Amiibo switcher/manager for Emuiibo

FuryBaguette

Well-Known Member
OP
Newcomer
Joined
Jan 6, 2019
Messages
57
Trophies
0
Age
27
XP
541
Country
France
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

enol

Member
Newcomer
Joined
May 30, 2017
Messages
24
Trophies
0
Age
36
XP
324
Country
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,

Barrytoo

Member
Newcomer
Joined
Apr 24, 2018
Messages
21
Trophies
0
Age
35
XP
296
Country
Jordan
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: 166

345742D

Member
Newcomer
Joined
Sep 14, 2009
Messages
23
Trophies
0
XP
354
Country
United States
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.
 

Flocki1987

Active Member
Newcomer
Joined
Nov 14, 2018
Messages
31
Trophies
0
Age
34
XP
387
Country
Germany
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....
 

345742D

Member
Newcomer
Joined
Sep 14, 2009
Messages
23
Trophies
0
XP
354
Country
United States
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,

Barrytoo

Member
Newcomer
Joined
Apr 24, 2018
Messages
21
Trophies
0
Age
35
XP
296
Country
Jordan
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!
 

kylum

Well-Known Member
Member
Joined
Dec 8, 2008
Messages
394
Trophies
1
XP
1,477
Country
United States
@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

Well-Known Member
OP
Newcomer
Joined
Jan 6, 2019
Messages
57
Trophies
0
Age
27
XP
541
Country
France
@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
 

mrdude

Developer
Developer
Joined
Dec 11, 2015
Messages
3,071
Trophies
1
Age
56
XP
8,227
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,

OrGoN3

Well-Known Member
Member
Joined
Apr 23, 2007
Messages
3,241
Trophies
1
XP
3,252
Country
United States
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?
 

mrdude

Developer
Developer
Joined
Dec 11, 2015
Messages
3,071
Trophies
1
Age
56
XP
8,227
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

iriez

Well-Known Member
Member
Joined
Oct 27, 2016
Messages
549
Trophies
0
Age
49
Website
www.xbins.org
XP
1,867
Country
United States
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,

FuryBaguette

Well-Known Member
OP
Newcomer
Joined
Jan 6, 2019
Messages
57
Trophies
0
Age
27
XP
541
Country
France
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

General chit-chat
Help Users
    SylverReZ @ SylverReZ: https://www.youtube.com/watch?v=pnRVIC7kS4s