Tutorial  Updated

Internal modchip - SAMD21 (Trinket M0, Gemma M0, ItsyBitsy M0 Express) Guide, Files & Support

Notice: I am not receiving notifications for this thread. I didn`t realise people were still posting in it.

Please please accept my apologies if I haven`t replied to tags etc... I have no idea what is happening. I`m subscribed to this thread but I am not receiving notifications. Please inbox me if possible. Or tag me in another thread.

Its amazing that people are still checking all of this out. I thank you for all of the help and support I have received in this thread over this year.

Cheers. Matty.


A video showing a modchip in action. Thank you once again to @metaljay for providing this. This is what you can achieve by fitting a chip!



Section 1. Gather your software.

Get your chip software from THIS THREAD.
Follow the flashing instructions there...




Section 2. Removing USB port and unneeded LEDs. (Adafruit chips only)
  • Next, we need to remove the USB port from the modchip. I recommend a heatgun or a rework station. Heat up until the USB port just lifts off the modchip.
  • Do the same for the LED just to the right of the USB port.
See picture:
20181031_110415.jpg


You are now ready to fit your device. Proceed to Fitting section.





Section 3. Fitting modchip to your Switch.
New Universal Method. All SAMD-based internal chips. If your chip is not supported and you cannot work it out, PM me.

Trinket M0.
Solder as laid out in the following picture

trinketfinal.jpg

==================================================
Rebug SwitchME M0. Use Trinket files.
Solder as laid out in the following picture

rebugfinal.jpg

==================================================
RCMX86 - Internal modchip version.
Solder as laid out in the following picture

RCMX86-Internal-Final.jpg


==================================================
Gemma M0. Use Gemma files.
Solder as laid out in the following picture


gemma final.jpg

==================================================
ItsyBitsy M0 Express. Use ItsyBitsy files.
Solder as laid out in the following picture

itsybitsyfinal.jpg




==================================================
Feather M0 Express. Use Feather files.
Solder as laid out in the following picture

feather_final.jpg




BUILD YOUR OWN FROM A QFP ATSAMD21E18. Trinket equivalent pins.
Flash Trinket bootloader using OpenOCD via serial pins SWDIO / SWDCLK. Fit a reset switch somewhere... Or going to power / wake (aka method 2). If building for external use, it is good practice to fit a third capacitor between 3V & GND. This is deliberately vague and ambigious, as this needs research and you need to know what you are doing.

Link for setting the Pi up with OpenOCD: HERE
Raspberry Pi OpenOCD image in downloads section or HERE
SAMD pi connection.png



Alternative Solder Points

Credit to @consolex for original pic. I`ve added alternative points to solder to:
Alternatepoints.jpg


Credit to @pyorin for this much tidier version showing the same info as the above one!
Alternatepoints2.jpg

s-l1600.jpg

alternative3v.jpg




Replacement Parts List

Ok... So you have damaged your switch soldering your chip in. Not to worry.

First things first, DO NOT BRIDGE THE CONTACTS HOPING TO REVIVE YOUR SWITCH. With resistors, you may possibly get away with this, but with the capacitors listed below, if you jump these points, you will make a nice short-circuit to the PMIC and / or the M92T36, killing them instantly. Don`t do it.

OK... I`ll list these parts with METHOD 2 & 3 TRINKET PIN NUMBERS and the values of the components they solder to.

TRINKET 3V (POWER SUPPLY) - 2.2uF 0402 size MLCC capacitor. Voltage unimportant as long as it is over 6.3v
TRINKET PIN 2 (POWER ON RESET - goes to pin 5 on M92T36)- 4.7uF 0402 size MLCC capacitor. Voltage unimportant as long as it is over 6.3v
TRINKET PIN 0 (VOL+) - 150R (150 ohms) 0201 Thick Film resistor. 50mW
TRINKET RESET (SWITCH POWER BUTTON) - 150R (150 ohms) 0201 Thick Film resistor. 50mW


I recommend RS components.

FAQ

Q - How do I boot the switch into APX (RCM) mode?

A - You need to short out pin 10 on the right joycon rail to GND with a jig or modded joycon or paperclip (not recommended... Buy a jig you cheap-ass gyppo). Once shorted out, hold down vol+ and power. The switch screen should be off... Plug into your PC and it should recognise a APX device. Well done. You are in RCM.

Q - What glue should I use?
A - Only glue if necessary! Ideally if your soldering is of sufficient quality and your wire is thin enough, you don`t need glue. I use a bit because I am OCD. Anyway, use Epoxy. It`s what I use. Gives you some working time, is solid. Superglue makes a mess DO NOT USE SUPERGLUE. The only thing super about it is how it melts things. Epoxy won`t stick to the shield long-term, so bear that in mind. Pure Acetone will remove epoxy. Acetone tends to remove / melt anything to be warned. CHECK YOUR GLUE WON`T GO CONDUCTIVE OVER TIME - LOOKING AT YOU SCAMSUNG! The combination of heat cycles and absorbing of moisture can turn adhesive into a high-impedance connection!

Q - What size wire should I use?
A - I use AWG40 magnet wire or AWG30 Kynar. AWG40 goes onto components easier... And if you snap it, chances are the wire will snap and not the trace / component.
A2 - You can also use AWG30. I recommend Kynar wrapping wire but any will do. Looks nice, good resistance to elements, tidy. Nothing thicker than AWG30. You are just causing yourself more headaches. Trust me.

Q - Is AWG40 thick enough?
A - Yes. AWG40 is good for around 90mA.

Q - which methods do you recommend?
A - Connect all the straps...

Q - how do you recommend to set it up?
A - Fusee Suite. Search for Fusee Suite or go to link at top of this OP.

Q - My switch is flat and won't turn on.
A - Have you got the charger connected? Disconnect it or your switch won't boot! Boot to a payload (SX loader/Hekate), reconnect charger and leave on the payload menu and charge. Leave for 15 minutes and switch will start normally. It will continue charging one booted.

Disclaimer:
You have only yourself to blame. This voids warranty. This may or may not get you banned from online services. If it does, you got yourself banned. I`m not responsible if you kill your switch / your first-born with any of this in this post. I`m not infalliable. I`m partly senile. Do your own research. Kids, get bill payers permission before you attempt even using a screwdriver.
NUTSHELL: Don`t come having a go at me because you fooked your £300 console up. I`ll do my best to help you though if you do, Just don`t blame me.

Credits to Quantum-Cross, Atlas44, @Ninoh-FOX , @jcrorxp , @tecfreak, @mooglazer, @subcon959, @64Dp128k, @mikeleuskaldunak, @M-O-B, CTCaer, @evilsperm, @consolex and everyone else for valuable input.


IF YOU REQUIRE SUPPORT, IF YOUR CONSOLE ISN`T WORKING CORRECTLY... PLEASE POST A HIGH RESOLUTION PICTURE OF YOUR INSTALL. You might think it isn`t your soldering, but in all cases with the new methods, it is bad soldering. So, please post a picture.


A BRIEF WARNING - PLEASE READ
THIS MOD IS NOT FOR THE FEINT OF HEART. WE ARE SOLDERING TO TRACES AND COMPONENTS ON THE FRONT SIDE OF THE BOARD TO SAVE HAVING TO REMOVE THE BOARD AND SOLDER TO TESTPOINTS. IF YOU ARE STRUGGLING, OR THINK YOU ARE GOING TO STRUGGLE, PLEASE PLEASE SOLDER TO THE TEST POINTS NOTED IN THIS AND OTHER THREADS (YOU WILL NEED TO REMOVE THE MOTHERBOARD). DOUBLE - TRIPLE CHECK EVERYTHING. YOU HAVE BEEN WARNED!!!
Good soldering skills are needed!
A magnifying glass is needed!
Good soldering iron needed - ideally with a 0.3 conical tip. No more than 30w!
SECURE YOUR WIRES PRIOR TO SOLDERING. Stick them down with double-sided tape.
Only use glue if you need to and glue wires after soldering. Don`t glue the solder to the component!
Put the tiniest amount of glue on the PCB mask only. Never on components. Use a cocktail stick for more glue control!!!
Take a look at alternative solder points to get you out of the sh*t if you do rip something off the board
If you aren`t the best at soldering, then think very carefully about connecting to pin 6 capacitor (the one in these new methods). If you rip this pad, you WILL NEED TO REMOVE YOUR BOARD and run from a testpoint.
 

Attachments

  • Trinket equivalent.png
    Trinket equivalent.png
    118 KB · Views: 3,791
Last edited by mattytrog,

Chocola

GBAtemp Meowgular
Member
Joined
Sep 18, 2018
Messages
379
Trophies
0
Age
32
Location
Neko Paradise
XP
723
Country
Korea, South
Hi @mattytrog, on first place thanks for all documentation, usually I should check on various places to do things like this but your guide seems ultracomplete and I apreciate a lot the "Anti disaster replacement list".

Well, now that emunand are working, I'm planing to install a modchip to avoid the use of the jig and injector on each boot, I have experience on micro electronic so I think I can install them without problems, on my case I wan't the full instalation (Power button for OFW and Power + Vol+ for boot hekate), but I have three questions:

What chip you recomend to install? For now I doubt on Trinket M0 or Rebug modchip, as I can see the space are minimal and I don't want to make any modification on the retail hardware (like cut aluminium, block the air flow of the rear aluminium plate, etc etc...) only solder a little wires for the chip without touch the Switch hardware.

If I want to update the payload, I can do through Switch port? I see that your schemes point wires to D+ and D- of USB C, but reading the topic (fast, can't read the 138 pages on detail) I see how you say that avoid enter on RCM when it's connected to charger, dock or USB, if not I can use inmutable payload that chainload another from SD card to avoid open the Switch on each update, but if I can flash Hekate directly and update it through Switch port its awesome.

Can damage or produce any issue on Switch? I didn't check the software for now, but as I can see the instalation are clean and don't should produce any issue on the Switch hardware, but I ask this to be sure, if I have something to know before install it (charging/dock issues, usb connection issues, etc etc...) please advice me.

A lot of thanks! ^^
 

mattytrog

You don`t want to listen to anything I say.
OP
Member
Joined
Apr 27, 2018
Messages
3,708
Trophies
0
Age
48
XP
4,328
Country
United Kingdom
Hi @mattytrog, on first place thanks for all documentation, usually I should check on various places to do things like this but your guide seems ultracomplete and I apreciate a lot the "Anti disaster replacement list".

Well, now that emunand are working, I'm planing to install a modchip to avoid the use of the jig and injector on each boot, I have experience on micro electronic so I think I can install them without problems, on my case I wan't the full instalation (Power button for OFW and Power + Vol+ for boot hekate), but I have three questions:

OK... Let's do one at a time...

What chip you recomend to install? For now I doubt on Trinket M0 or Rebug modchip, as I can see the space are minimal and I don't want to make any modification on the retail hardware (like cut aluminium, block the air flow of the rear aluminium plate, etc etc...) only solder a little wires for the chip without touch the Switch hardware.

This is a false economy in my opinion.
1) you need to remove the heatsink and replace the thermal paste if doing the job correctly... As a result, some high quality aftermarket compound will equal or surpass the OEM stuff.

2) by modifying the shield, air flow is not reduced at all. Coupled with the fact you are replacing the heatsink compound, the end result is that the soc will probably run EVEN COOLER then stock.

3) furthermore... I'm assuming you don't want to modify the shield for warranty purposes etc etc...
I'll say this now...
Forget the warranty.

If you claim under warranty (even for joycons) the whole unit will be required and will come back as an ipatched unit. So forget the warranty. If you are forgetting the warranty, then I recommend modifying the shield.

In addition to the points above, if the shield is modified, you can remove later if required for servicing without desoldering the chip

The rigidity of the console is the same.
The cooling capacity of the shield is the same.

Also, when you are fitting without modifying the shield, airflow is (slightly) restricted. In practice, this matters little and is only a miniscule amount.
You also have to be careful manipulating the leads. There is a bigger potential to pull a freshly soldered lead off a component, possibly damaging a component or trace.

If I want to update the payload, I can do through Switch port? I see that your schemes point wires to D+ and D- of USB C, but reading the topic (fast, can't read the 138 pages on detail) I see how you say that avoid enter on RCM when it's connected to charger, dock or USB, if not I can use inmutable payload that chainload another from SD card to avoid open the Switch on each update, but if I can flash Hekate directly and update it through Switch port its awesome.

Yes. Not a problem.

Can damage or produce any issue on Switch? I didn't check the software for now, but as I can see the instalation are clean and don't should produce any issue on the Switch hardware, but I ask this to be sure, if I have something to know before install it (charging/dock issues, usb connection issues, etc etc...) please advice me.

A lot of thanks! ^^

Absolutely you can damage it.

The most common are the VOL+ function being damaged (it's a resistor that gets damaged)

The second most common is pin 5(or 6) smoothing capacitors bridged or damaged. This can lead to charging problems (flashing green led on dock) and system instability.

There is also the possibility of damaging the ram. If this happens, you are in deep trouble. You will have a blank screen when trying to boot anything, even Linux. And you will only have the IRAM availsble (memloader will give you a MTC_LOAD error, with 246400 bytes out instead of 43xxxxxxxxx)

Use the 3v pad. Do not use the regulator on the trinket.

Cheers
 
Last edited by mattytrog,
  • Like
Reactions: Chocola

Chocola

GBAtemp Meowgular
Member
Joined
Sep 18, 2018
Messages
379
Trophies
0
Age
32
Location
Neko Paradise
XP
723
Country
Korea, South
This is a false economy in my opinion.
1) you need to remove the heatsink and replace the thermal paste if doing the job correctly... As a result, some high quality aftermarket compound will equal or surpass the OEM stuff.

2) by modifying the shield, air flow is not reduced at all. Coupled with the fact you are replacing the heatsink compound, the end result is that the soc will probably run EVEN COOLER then stock.

3) furthermore... I'm assuming you don't want to modify the shield for warranty purposes etc etc...
I'll say this now...
Forget the warranty.

If you claim under warranty (even for joycons) the whole unit will be required and will come back as an ipatched unit. So forget the warranty. If you are forgetting the warranty, then I recommend modifying the shield.

In addition to the points above, if the shield is modified, you can remove later if required for servicing.

The rigidity of the console is the same.
The cooling capacity of the shield is the same.

Also, when you are during without modifying the shield, airflow is (slightly) restricted. In practice, this matters little and is only a miniscule amount.
You also have to be careful manipulating the leads. There is a bigger potential to pull a freshly donated lead off a component, passively damaging a component or trace.

Isn't for warranty purposes, just it's a gift with a lot of value for me then I want to have a method for comeback to it's retail state, so I think that I can buy a replacement rear plate and cut it to acomodate the chip.

Respect the thermal compound, I always use the Artic MX-4 on the computers, atleast for computers are good and have good performance, it's valid for Switch or I need a special one?

Yes. Not a problem.

Here I have another doubt, break the USB functionality of the device or can I use the same port for both? How I can swap between trinket flash mode and switch usb mode?

Absolutely you can damage it.

The most common are the VOL+ function being damaged (it's a resistor that gets damaged)

The second most common is pin 5(or 6) smoothing capacitors bridged or damaged. This can lead to charging problems (flashing green led on dock) and system instability.

There is also the possibility of damaging the ram. If this happens, you are in deep trouble. You will have a blank screen when trying to boot anything, even Linux. And you will only have the IRAM availsble (memloader will give you a MTC_LOAD error, with 246400 bytes out instead of 43xxxxxxxxx)

Use the 3v pad. Do not use the regulator on the trinket.

There im explain wrong (my English are so bad), I don't refer to damages that I can cause on install, I mean if the chip produce any issue, damage or break any function of the console.

A lot of thanks for the help ^^
 

cmcollander

Member
Newcomer
Joined
Jul 19, 2018
Messages
7
Trophies
0
Age
37
XP
120
Country
United States
There im explain wrong (my English are so bad), I don't refer to damages that I can cause on install, I mean if the chip produce any issue, damage or break any function of the console.

The chip itself won't cause any damage to your switch if installed properly. Any damage to the switch will be due to installation problems as described above.
 
  • Like
Reactions: Chocola

ZerOneX

Active Member
Newcomer
Joined
Dec 29, 2015
Messages
25
Trophies
0
XP
118
Country
Canada
Guys, sorry for the noob question, but I did not get properly where to solder the 'pink' pins checking the schematic.

Just to be double sure, should I just ground them? That is it?

Thank you all in advance.

Regards,

ZerO.
 

mattytrog

You don`t want to listen to anything I say.
OP
Member
Joined
Apr 27, 2018
Messages
3,708
Trophies
0
Age
48
XP
4,328
Country
United Kingdom
Guys, sorry for the noob question, but I did not get properly where to solder the 'pink' pins checking the schematic.

Just to be double sure, should I just ground them? That is it?

Thank you all in advance.

Regards,

ZerO.
The pink pins are extra functions. Leave disconnected.
 
  • Like
Reactions: ZerOneX

ZerOneX

Active Member
Newcomer
Joined
Dec 29, 2015
Messages
25
Trophies
0
XP
118
Country
Canada
@mattytrog I think I got everything now to start it.... my trinket is ready and flashed accordingly...

My only doubt is regading this part 'With BOTH UF2, permanent CFW booting is enabled, this saves your fuses. HOWEVER, if you are in UF2 update mode, or you press the reset switch on the back during a power-on / reboot, FUSES WILL BURN!!!'

How we avoid such scenario if we need (for some reason) to update an UF2 file? To preserve the fuses for me is a must have.

Thank you on more time and have a great day.

Regards,

ZerO.
 

Scettles

Active Member
Newcomer
Joined
Jul 4, 2018
Messages
32
Trophies
0
Age
33
XP
480
Country
United States
I bought a switchme last year.... I have done very poor soldering in my life. I'm curious where I could potentially take my switch to get it done or send it somewhere trustworthy.... Or come tips to get me practicing on some stuff for a while before attempting lol. I'm using an emunand dual boot where have to plug into my phone every time and etc... And dang kids keeps leaving switch on in autorcm mode and it dies and etc lol. So wanting to get a full vol strap install and everything done to have the truest form of dual boot.... Normal boot when power up... Hold vol... Emunand! :) Thanks in advance!
 

mattytrog

You don`t want to listen to anything I say.
OP
Member
Joined
Apr 27, 2018
Messages
3,708
Trophies
0
Age
48
XP
4,328
Country
United Kingdom
@mattytrog I think I got everything now to start it.... my trinket is ready and flashed accordingly...

My only doubt is regading this part 'With BOTH UF2, permanent CFW booting is enabled, this saves your fuses. HOWEVER, if you are in UF2 update mode, or you press the reset switch on the back during a power-on / reboot, FUSES WILL BURN!!!'

How we avoid such scenario if we need (for some reason) to update an UF2 file? To preserve the fuses for me is a must have.

Thank you on more time and have a great day.

Regards,

ZerO.

The fuses are only checked at power on. The only way you could get into this scenario is if you double press reset while booted into update mode, then flash a BAD bootloader which would prevent the straps being pulled low, and powering on.

But...
1... You need to power off completely to restart the console, resulting in chip reset, resulting in straps dropped. Correct behaviour. So no chance of forgetting it is in bootloader mode as the trinket is power cycled, pulling straps low again.

It isn't a concern. As long as your soldering is good and you have done a QUALITY install, your fuses are safe forever.

Only by bricking the trinket will the fuses be compromised. And that can only happen if you change the Switchboot bootloader (part1)uf2 and it bricks or you flash incorrect file for your pinouts.

If you flash a faulty part 2 uf2, the bootloader will be unaffected and fuses are safe

I bought a switchme last year.... I have done very poor soldering in my life. I'm curious where I could potentially take my switch to get it done or send it somewhere trustworthy.... Or come tips to get me practicing on some stuff for a while before attempting lol. I'm using an emunand dual boot where have to plug into my phone every time and etc... And dang kids keeps leaving switch on in autorcm mode and it dies and etc lol. So wanting to get a full vol strap install and everything done to have the truest form of dual boot.... Normal boot when power up... Hold vol... Emunand! :) Thanks in advance!

Can fix it.

Drop me a pm.

Certainly is truest form of dual boot. No messy exploits!
 
Last edited by mattytrog,
  • Like
Reactions: ZerOneX

mattytrog

You don`t want to listen to anything I say.
OP
Member
Joined
Apr 27, 2018
Messages
3,708
Trophies
0
Age
48
XP
4,328
Country
United Kingdom
Last edited by mattytrog,
  • Like
Reactions: recgame77

recgame77

Well-Known Member
Member
Joined
Dec 25, 2015
Messages
182
Trophies
0
Age
45
XP
280
Country
Cameroon
While the console is operating and booted, it is in a deep sleep. When it is off, the chip is dead.

The __wfi instruction places unit into a coma.

Ha ok it was in the headers; big thanks.

Any idea when the PIN 2 on the trinket trigger for the interupt exactly ?
 

mrdude

Developer
Developer
Joined
Dec 11, 2015
Messages
3,071
Trophies
1
Age
56
XP
8,227
@mattytrog.

I don't know if you're using argon-nx mod I posted, I've modded gui_argon_menu.c and changed some code, when you press the about icon, if you press vol- at the same time it will generated the ini file needed if you're using sd card hidden emunand, this is the code I changed if you want to use it:

Code:
int tool_about() {
  bool emunand = btn_read() & BTN_VOL_DOWN;
  if (emunand)
      if (f_stat("emummc/emummc.ini", NULL)) {
          f_mkdir("emummc");
          sd_save_to_file("[emummc]\nemummc_enabled = 1\nemummc_sector = 0x2\nemummc_nintendo_path = Emutendo", 79, "emummc/emummc.ini");
          string = "emummc/emummc.ini created";
          text_centre();
          gfx_printf(&g_gfx_con, "%k%s%k", GREEN, string, MYBLUE);
      }
   
      else
      {
          string = "emummc/emummc.ini already exists";
          text_centre();
          gfx_printf(&g_gfx_con, "%k%s%k", colour_red, string, MYBLUE);   
      }
 
  else
      {
      string = "Property of MrDude";
      text_centre();
      gfx_printf(&g_gfx_con, "%k%s%k", MYBLUE, string, MYBLUE);
      }
   return 0;
}

You might need to change some idents - as the forum seems to mess them up.
 
Last edited by mrdude,

mattytrog

You don`t want to listen to anything I say.
OP
Member
Joined
Apr 27, 2018
Messages
3,708
Trophies
0
Age
48
XP
4,328
Country
United Kingdom
@mattytrog.

I don't know if you're using argon-nx mod I posted, I've modded gui_argon_menu.c and changed some code, when you press the about icon, if you press vol- at the same time it will generated the ini file needed if you're using sd card hidden emunand, this is the code I changed if you want to use it:

Code:
int tool_about() {
  bool emunand = btn_read() & BTN_VOL_DOWN;
  if (emunand)
      if (f_stat("emummc/emummc.ini", NULL)) {
          f_mkdir("emummc");
          sd_save_to_file("[emummc]\nemummc_enabled = 1\nemummc_sector = 0x2\nemummc_nintendo_path = Emutendo", 79, "emummc/emummc.ini");
          string = "emummc/emummc.ini created";
          text_centre();
          gfx_printf(&g_gfx_con, "%k%s%k", GREEN, string, MYBLUE);
      }
  
      else
      {
          string = "emummc/emummc.ini already exists";
          text_centre();
          gfx_printf(&g_gfx_con, "%k%s%k", colour_red, string, MYBLUE);  
      }
 
  else
      {
      string = "Property of MrDude";
      text_centre();
      gfx_printf(&g_gfx_con, "%k%s%k", MYBLUE, string, MYBLUE);
      }
   return 0;
}

You might need to change some idents - as the forum seems to mess them up.
Good work Sir!

I've been meaning to get back to doing a bit on argon but things always crop up. Bugs in other projects... Young son wanting to play etc...

I do have big plans for various stuff, but I'm trying to keep aligned with other peoples work (just create drop in replacements).

Will have a play tomorrow definitely.
 
  • Like
Reactions: mrdude and ELY_M

mrdude

Developer
Developer
Joined
Dec 11, 2015
Messages
3,071
Trophies
1
Age
56
XP
8,227
Cheers Mattytrog.

I've still got a function to write to show the status if emunand is enabled/disabled - and a switch to toggle it on and off. If I get time, I'll do that later today. I've got a lot on myself just now. - I'll post the code when I'm done.

Also I know you're busy and haven't been too well. Family comes first, so it's best to spend the time with the children and wife, and only mess about with code and stuff when you have time to burn - this is just a hobby after all and not really important compared to the other things in life that really matter.
 
  • Like
Reactions: ELY_M

mrdude

Developer
Developer
Joined
Dec 11, 2015
Messages
3,071
Trophies
1
Age
56
XP
8,227
@mattytrog, here's my modded code for argon-nx mod:

Hold V+ and tap the gear icon to generate ini file
Hold V- and tap gear icon to delete ini file
Power and tap gear icon - shows about info
Tap gear icon (without pressing any buttons) to show status - if ini files exists, shows emunand is enabled.

Code:
int tool_about() {
  bool emunand = btn_read() & BTN_VOL_UP;
  bool emunand2 = btn_read() & BTN_VOL_DOWN;
  bool Power = btn_read() & BTN_POWER;
 
  if (emunand)
      if (f_stat("emummc/emummc.ini", NULL)) {
          f_mkdir("emummc");
          sd_save_to_file("[emummc]\nemummc_enabled = 1\nemummc_sector = 0x2\nemummc_nintendo_path = Emutendo", 79, "emummc/emummc.ini");
          string = "emummc/emummc.ini created";
          text_centre();
          gfx_printf(&g_gfx_con, "%k%s%k", GREEN, string, MYBLUE);
      }
     
      else
      {
          string = "emummc/emummc.ini already exists";
          text_centre();
          gfx_printf(&g_gfx_con, "%k%s%k", colour_red, string, MYBLUE);     
      }
  else if (emunand2)
      {
          if (f_stat("emummc/emummc.ini", NULL)) {
              string = "emummc/emummc.ini doesn't exist";
              text_centre();
              gfx_printf(&g_gfx_con, "%k%s%k", colour_red, string, MYBLUE); 
          }
          else {
              f_unlink("emummc/emummc.ini");
              string = "emummc/emummc.ini deleted";
              text_centre();
              gfx_printf(&g_gfx_con, "%k%s%k", colour_red, string, MYBLUE);           
          }
      }
  else if (Power)
      {
          string = "Argon-NX Mod by MrDude";
          text_centre();
          gfx_printf(&g_gfx_con, "%k%s%k", MYBLUE, string, MYBLUE);   
      }
 
  else
      {
          if (f_stat("emummc/emummc.ini", NULL)) {
              string = "Emunand: Disabled";
              text_centre();
              gfx_printf(&g_gfx_con, "%kEmunand: %kDisabled%k", MYBLUE, colour_red, MYBLUE);
              }
          else {
              string = "Emunand: Enabled";
              text_centre();
              gfx_printf(&g_gfx_con, "%kEmunand: %kEnabled%k", MYBLUE, GREEN, MYBLUE);
          }
      }       
   
    return 0;
}

That might save you some time messing about - as I know you're busy.
 
Last edited by mrdude,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: https://gbatemp.net/profile-posts/163064/