How to make 60FPS .ips Patch for Nintendo Switch Game Ghidra Tutorial

Use FPSLocker on actual hardware or uncap framerate emulator and/or limit game speed to 200% to achieve the same result as this guide. No Ghidra or guide required now.

This is a basic guide to create an .ips that patches 'nvnWindowBuilderSetPresentInterval' and/or 'nvnWindowSetPresentInterval' for a game in order to make the game run at 60FPS. Some games need additional patches specific to that game for 60FPS and not only this method.
If you want to follow along the game I am using is Story of Seasons: A Wonderful Life v1.1 (JP) which I have made a patch for https://gbatemp.net/threads/story-of-seasons-a-wonderful-life-60fps-ips-patch.625672/

Thanks @systemdev for helping me with this game and indirectly this guide.

Instructions
1. Obtain the main of the game - you want to dump the one from the latest update of the game. For this I dump the exeFS of the game using nxdumptool after I've installed the game on my system although there are other ways. https://github.com/DarkMatterCore/nxdumptool/releases

2. Install https://github.com/NationalSecurityAgency/ghidra and https://github.com/Adubbz/Ghidra-Switch-Loader

3. Make a new project, put the main into Ghidra and analyze it (this will take a while)

4. On Switch two variables usually control the framerate target which are
'nvnWindowBuilderSetPresentInterval'
'nvnWindowSetPresentInterval'
Click Search->Search Memory (Search Program Text is an alternate option) and search for one or both of these - in my case I searched for 'nvnWindowSetPresentInterval'
Click on the search result that should come up and you should have found it!
1675544037305.png


5. Double click on the function circled in red - Ghidra should now analyze the function on the right side of the screen in a window. This might take a little bit.
1675544179425.png


6. Find nvnWindowSetPresentInterval and its corresponding DAT
1675544286652.png

7. Click on DAT_71010cb520 and you'll be taken a screen that looks this
1675545732259.png

You'll have to click on each function and examine if you can find the right ASM block. For me, it was the second one which is highlighted which looks like this when clicked on
1675545867720.png

8. Look at the highlight block above. We are going to edit the w1, #0x2. Right click on it and then click 'Patch Instruction'. Change the #0x2 to #0x1. For other games that #0x2 may be a w20 or another value, however in that case still change it to a #0x1.
1675546086229.png

9. IPS patch time! We are first going to make the .pchtxt file which will be turned into the IPS patch which are formatted like this

The NSOBID part contains the BID of the game. I use Tinfoil to easily find the full BID (Build ID) of a game. https://tinfoil.io/Title/0100936018EB4000
Include the flag offset_shift 0x100 so the patch is applied to the right place
Under @enabled your modified ASM will go. The left part is the address and the right part are the values you have modified at that address. Make sure you get rid of the first two digits '71' from the Ghidra address. Save this file as a .pchtxt file.
1675546158433.png


10. Install IPSwitch on your Switch. Copy the .pchtxt to sdmc:/switch/ipswitch/{patch_description}/{whatever_name}.pchtxt
Run IPSwitch and select the patch located into the folder and turn it into a .ips file which will be located at atmosphere/exefs_patches/{patch_description}/{BID of Patch}.ips

11. Run the game and see if its at 60FPS. Make sure you overclock using sys-clk (some games when modded to 60FPS, if they can't run at 60FPS they will drop to 30FPS, and need the extra performance from overclocking) or another program and check the FPS using Status Monitor. Congratulations, hopefully your game is at a silky smooth 60FPS like the example below!

1675546728064.png
 

Attachments

  • 1675545793968.png
    1675545793968.png
    11 KB · Views: 197
Last edited by ChanseyIsTheBest,

Maq47

Lord of Pyro
Member
Joined
Jan 7, 2012
Messages
1,390
Trophies
1
Location
Your basement
Website
idont.have.one
XP
3,674
Country
United States
https://github.com/masagrator/FPSLocker

Not all games unlock FPS easily. Sometimes they need extra work.
This method does not work for emulators, so making 60FPS cheats is still necessary. I don't know why everyone is saying "we have an easier way, so we no longer want to do the harder way, we'll just direct everyone to this easier way that won't work for everyone, and if they complain, we'll tell them to make the cheat themself, which isn't a valid answer, because you cannot easily make cheats on emulators like you can on a console.". This is the most lazy I have ever seen cheat makers be in over 2 decades, seriously.
 
  • Haha
Reactions: StevensND

masagrator

The patches guy
Developer
Joined
Oct 14, 2018
Messages
6,579
Trophies
3
XP
12,779
Country
Poland
This method does not work for emulators, so making 60FPS cheats is still necessary.
PC Emulators have builtin FPS unlocker that does exactly the same thing as this tutorial and FPSLocker without any patches. Only thing that doesn't have FPS Unlocker built in is yuzu on Android. It's even explained at the beginning of first post.

Use FPSLocker on actual hardware or uncap framerate emulator and/or limit game speed to 200% to achieve the same result as this guide. No Ghidra or guide required now.

I guess you chose the wrong place to complain.
Cheat makers prefer to spend time on actual issues (like patching games using engine specific FPS lock?) than something that can be solved by just adding switch (pun not intended) to emulator's UI. But yeah, complain on people that don't want to do exactly the same thing one thousand times when there are easier solutions available for years.

you cannot easily make cheats on emulators like you can on a console.

It doesn't help the fact that cheats made for Switch relying on pointers don't work on Yuzu, and vice versa. :rofl2:

This is the most lazy I have ever seen cheat makers be in over 2 decades, seriously.

Yeah, having almost all games possible to run at 60 FPS without game breaking bugs we are the peak of laziness. What a delusional take and place to complain :grog: Go back to making next save editor or something.
 
Last edited by masagrator,

StevensND

Well-Known Member
Member
Joined
Dec 26, 2017
Messages
203
Trophies
1
Age
28
Location
Spain
Website
github.com
XP
768
Country
Spain
This method does not work for emulators, so making 60FPS cheats is still necessary. I don't know why everyone is saying "we have an easier way, so we no longer want to do the harder way, we'll just direct everyone to this easier way that won't work for everyone, and if they complain, we'll tell them to make the cheat themself, which isn't a valid answer, because you cannot easily make cheats on emulators like you can on a console.". This is the most lazy I have ever seen cheat makers be in over 2 decades, seriously.

FYI and in case you didn't notice, I was replying to a person who plays on Switch, not on emulator. Just look at the mention of Atmosphere.

Lazy cheat makers?
. Well ... So tell me what I've been doing for the last year in 2 of my Github repositories ... It's not our fault that you don't know who makes cheat/mods for emulators.

First

Second

Or maybe what I've been doing on Gamebanana

Anyway, have a great day :yayswitch:
 

Maq47

Lord of Pyro
Member
Joined
Jan 7, 2012
Messages
1,390
Trophies
1
Location
Your basement
Website
idont.have.one
XP
3,674
Country
United States
PC Emulators have builtin FPS unlocker that does exactly the same thing as this tutorial and FPSLocker without any patches. Only thing that doesn't have FPS Unlocker built in is yuzu on Android. It's even explained at the beginning of first post.



I guess you chose the wrong place to complain.
Cheat makers prefer to spend time on actual issues (like patching games using engine specific FPS lock?) than something that can be solved by just adding switch (pun not intended) to emulator's UI. But yeah, complain on people that don't want to do exactly the same thing one thousand times when there are easier solutions available for years.



It doesn't help the fact that cheats made for Switch relying on pointers don't work on Yuzu, and vice versa. :rofl2:



Yeah, having almost all games possible to run at 60 FPS without game breaking bugs we are the peak of laziness. What a delusional take and place to complain :grog: Go back to making next save editor or something.
Okay, well, about 8 or 9 months ago someone requested a 60FPS cheat in the (improper, but still valid) AMS cheats thread for a game and stated that the game bugs out when running at 200% speed, and the cheat makers essentially gave the answer I am complaining about. Ryujinx and Yuzu both had support for 'uncapping' the FPS at the time (and Yuzu had yet to get taken down), and the person chose to just straight up not play the game at all on principle.

Emulators are not perfect, and Switch emulators are no exception. All games are different, and react to different things in different ways for different people. The 200% speed won't work for 100% of games; heck, even 75% compatibility is a stretch. In cases like these, cheat makers should continue to make 60FPS cheats until Ryujinx and Yuzu (and it's clones) reach 100% compatibility across the board, because of edge cases. But the cheat makers are choosing to stop doing those cheats, mainly due to laziness, as I said, brought about by a method existing that in itself is flawed, much like their perception of it.
 
  • Haha
Reactions: StevensND

Maq47

Lord of Pyro
Member
Joined
Jan 7, 2012
Messages
1,390
Trophies
1
Location
Your basement
Website
idont.have.one
XP
3,674
Country
United States
FYI and in case you didn't notice, I was replying to a person who plays on Switch, not on emulator. Just look at the mention of Atmosphere.

Lazy cheat makers?
. Well ... So tell me what I've been doing for the last year in 2 of my Github repositories ... It's not our fault that you don't know who makes cheat/mods for emulators.

First

Second

Or maybe what I've been doing on Gamebanana

Anyway, have a great day :yayswitch:
Clearly, you didn't take 2 minutes to see my post above. Lol
You're absolutely right. I absolutely did not read your links whatsoever. I see now that you have made several 60FPS patches and mods for Switch games, and continue to support many of them. I do apologize if I offended you by my overgeneralization of cheat code creators currently. However, you took my statement personally, when I wasn't calling you out specifically, but was rather stating the general mindset of cheat code creators these days, in other words, the majority, which it seems now that you are not a part of. The person that had the issue that caused me to think this way has a reason to rejoice now, though: because of your recent efforts, the game they were requesting a 60FPS cheat for, Triangle Strategy, now has a patch for 60FPS, although I would need to dig through a thread search for 'triangle strategy' to find the user themself. I will do so tomorrow and direct them to your GitHub, however, because you are doing God's work, seriously. I really do appreciate what you've done for the community. You really should make a post here in this thread and get it 'pinned' so that others that come here looking for fixes like yours will be more aware, that way you can get more recognition for your work. If you already created a thread, please post a link here, and I'll DM a mod to pin it so that others can find it easier. One thing is for sure, if you did create a thread, it does not show up on Google by searching for 'Nintendo Switch 60FPS', at least it didn't 9 months ago, I don't know about now.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: Having a good time lol