Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

NX-FPS Switch: Difference between revisions

From GameBrew
(Created page with "{{Infobox Switch Homebrews |title=NX-FPS |image=nxfpsswitch.png |description=SaltyNX Plugin collecting FPS data |author=masagrator |lastupdated=2023/04/02 |type=Plugins |version=1.2.1 |license=MIT |download=https://dlhb.gamebrew.org/switchhomebrews/nxfpsswitch.7z |website=https://gbatemp.net/threads/nx-fps-saltynx-plugin-collecting-fps-data.559065/ |source=https://github.com/masagrator/NX-FPS |donation=https://ko-fi.com/masagrator }} {{#seo: |title=Switch Homebrew Apps (...")
 
No edit summary
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Infobox Switch Homebrews
{{Infobox Switch Homebrews
|title=NX-FPS
|title=NX-FPS
|image=nxfpsswitch.png
|image=nxfps.png
|description=SaltyNX Plugin collecting FPS data
|description=SaltyNX plugin collecting FPS data.
|author=masagrator
|author=masagrator
|lastupdated=2023/04/02
|lastupdated=2023/07/02
|type=Plugins
|type=Plugins
|version=1.2.1
|version=1.5.5
|license=MIT
|license=MIT
|download=https://dlhb.gamebrew.org/switchhomebrews/nxfpsswitch.7z
|download=https://dlhb.gamebrew.org/switchhomebrews/nxfpsswitch.7z
Line 13: Line 13:
|donation=https://ko-fi.com/masagrator
|donation=https://ko-fi.com/masagrator
}}
}}
{{#seo:
{{obsolete}}
|title=Switch Homebrew Apps (Plugins) - GameBrew
NX-FPS is a [[SaltyNX Switch|SaltyNX]] plugin that collects FPS data in Nintendo Switch games.
|title_mode=append
 
|image=nxfpsswitch.png
'''Note:''' Since SaltyNX v0.7.0 NX-FPS is an intergral part of SaltyNX Core. Please delete NX-FPS plugin from SaltySD/plugins folder and update to SaltyNX 0.7.0+.
|image_alt=NX-FPS
 
}}
==Installation==
If you're looking to collect FPS data in Nintendo Switch games, NX-FPS is a great SaltyNX plugin to consider. To get started, you'll need to install my fork of SaltyNX 0.5.0+ from [https://github.com/masagrator/SaltyNX/releases here].
It requires the fork of [[SaltyNX Switch|SaltyNX]] 0.5.0+ installed.
 
To install NX-FPS, put the NX-FPS.elf file into <code>/SaltySD/plugins/</code>.
 
To read FPS data from the plugin, you can either use the [[Status Monitor Overlay Switch|Status Monitor Overlay 0.8.1+]] or make your own homebrew to use this.
 
==User guide==
Currently supports graphics APIs are:  
*NVN.
*EGL.
*Vulkan.
 
When game is booted, plugin outputs one file <code>/SaltySD/FPSoffset.hex</code>.
 
There is stored address, where you can find PFPS, FPS has address PFPS - 0x8.
*PFPS - Pushed Frames Per Second (u8), it counts how many frames were actually pushed to display in second that passed.
*FPS - Frames Per Second (float) calculated from averaged frametime, refreshed with each new frame.


Once you've installed the necessary software, simply put the NX-FPS.elf file into <code>/SaltySD/plugins</code>. This plugin currently supports graphics APIs such as NVN, EGL, and Vulkan.
If file is already there, it's rewritten by new address with each new game boot.


To read FPS data from the plugin, you can either use the Status Monitor Overlay 0.8.1+ from [https://github.com/masagrator/Status-Monitor-Overlay] or write your own code. If you're interested in writing your own code, I've provided instructions based on the Status Monitor Overlay code:
===Notes===
Plugin brings some instability to boot process for some games. It is recommended to not close game before ~10 seconds have passed from showing Nintendo logo, otherwise you risk Kernel panic, which results in crashing OS.


# You'll need to include the old ipc.h file from [https://github.com/masagrator/ReverseNX-RT/blob/master/Overlay/include/ipc.h] as well as SaltyNX.h from [https://github.com/masagrator/ReverseNX-RT/blob/master/Overlay/include/SaltyNX.h].
Not working games with this plugin (You can find games not compatible with SaltyNX [https://github.com/masagrator/SaltyNX/blob/master/README.md here])
# Connect to SaltyNX SharedMemory by connecting to SaltyNX, retrieving the SharedMemory handle, terminating the connection with SaltyNX, and then assigning SharedMemory to your homebrew.


==Media==
{| class="wikitable"
'''How to overclock the Nintendo Switch and view FPS - Sysclk & NX FPS Homebrew mods Atmosphere CFW - ([https://www.youtube.com/watch?v=0svgC4wuB18 Nevercholt])'''<br>
! Title||Version(s)||Why
<youtube>0svgC4wuB18</youtube>
|-
| Final Fantasy VIII Remastered||all||Framework stuff is included in NROs which SaltyNX doesn't support.
|-
| Final Fantasy X/X-2||all||Framework stuff is included in NROs which SaltyNX doesn't support.
|-
| LEGO Harry Potter Collection||all||Framework stuff is included in NROs which SaltyNX doesn't support.
|-
|}


==Screenshots==
=== Troubleshooting ===
https://dlhb.gamebrew.org/switchhomebrews/nxfpsswitch-01.pnga
'''Q. Why I got constantly 255?'''
https://dlhb.gamebrew.org/switchhomebrews/nxfpsswitch-02.pnga


== Troubleshooting ==
255 is default value before plugin starts counting frames. This may be a sign that:
'''Q: Why I got constantly 255?'''<br>
A: 255 is default value before plugin starts counting frames. This may be a sign that:
* Game is using different API or function than what is currently supported
* Game is using different API or function than what is currently supported
* Plugin missed symbol when initializing (for whatever reason)
* Plugin missed symbol when initializing (for whatever reason)
Line 44: Line 64:
Try first to run game again few times. If it's still 255, make an issue and state name of game. Next updates will include support for other graphics APIs.
Try first to run game again few times. If it's still 255, make an issue and state name of game. Next updates will include support for other graphics APIs.


==Changelog==  
==Screenshots==
'''1.2.1'''
https://dlhb.gamebrew.org/switchhomebrews/nxfps2.png
*Fix "main" address detection
 
'''1.2'''
==Media==
*Add support for nvnQueueAcquireTexture that was used with some old games (for example Outlast) before deprecation.
'''Resident Evil 5 (Nintendo Switch) - Status Monitor Overlay and NX-FPS ([https://www.youtube.com/watch?v=9RqGEk4talI Marek])'''<br>
'''1.1'''
<youtube>9RqGEk4talI</youtube>
*Allow loading LOCK bins produced by FPSLocker 1.1+
 
'''1.0'''
'''How to overclock the Nintendo Switch and view FPS - Sysclk & NX FPS Homebrew mods Atmosphere CFW ([https://www.youtube.com/watch?v=0svgC4wuB18 Nevercholt])'''<br>
*Allow manipulating FPS
<youtube>0svgC4wuB18</youtube>
'''0.4'''
 
==Changelog==
'''1.5.5 2023/07/02'''
* Add support for new Vulkan command:
** NvSwapchain::QueuePresentKHR(VkQueue_T*, const VkPresentInfoKHR*)
* It solves an issue with FPS Counter not working in Undead Horde 2.
'''1.5.4 2023/06/09'''
*Allow setting max available buffers in games that don't utilize all available buffers (for example We Love Katamari REROLL is reserving 3 buffers, but force game to use only 2. We can now force game to use all 3 buffers for smoother FPS drops)
'''1.5.3 2023/05/23'''
*Allow setting double buffer in games that are using triple buffer.
'''1.5.2 2023/05/20'''
* Fix migrating to other threads when delaying frames (fixes issue with long loading times in Tears of the Kingdom).
* Improve performance of Window Sync Semi-Enabled mode.
'''1.5.1 2023/05/20'''
*Add support for Semi-Enabled Window Sync Wait.
'''1.5.0 2023/05/15'''
* Support MASTER_WRITE entry in FPSLocker patches.
* Disable Sync Wait only if passed nvnSync to nvnSyncWait matches nvnSync passed to nvnWindowAcquireTexture (prevents games from crashing, enabling more games to unsync from double buffer vsync - f.e. The Legend of Zelda: Tears of the Kingdom).
'''1.4.1 2023/05/06'''
*Pull from NVN info about number of buffered frames.
'''1.4.0 2023/04/22'''
* Adjust dynamically FPS lock (fixing issue with CPU speed affecting lock's precision).
* Add array of last 10 frames timings to read from SharedMemory.
'''1.3.3 2023/04/16'''
*Fix NVN interval detection in games using more than 1 nvnWindow. Now f.e. WRC Generations can be unlocked with plugin alone.
'''1.3.2 2023/04/07'''
*Fixes loading patches for some games.
*If you have downloaded version 1.3.1, it's bugged more than 1.3. Update it.
'''1.3 2023/04/05'''
* Provide better API detection.
* Add support for eglSwapInterval.
* Fix eglSwapBuffers return.
'''1.2.1 2023/04/02'''
*Fix "main" address detection.
'''1.2 2023/04/01'''
*Add support for nvnQueueAcquireTexture that was used with some old games (for example <code>Outlast</code>) before deprecation.
'''1.1 2023/03/19'''
*Allow loading LOCK bins produced by FPSLocker 1.1+.
'''1.0 2023/03/08'''
*Allow manipulating FPS.
'''0.4 2023/03/03'''
*Move writing data into SaltyNX SharedMemory. Requires SaltyNX 0.5.0+ to work.
*Move writing data into SaltyNX SharedMemory. Requires SaltyNX 0.5.0+ to work.
*If you use Status Monitor Overlay, you must update it to version 0.8.1+ to use it.
*If you use Status Monitor Overlay, you must update it to version 0.8.1+ to use it.
'''0.3'''
'''0.3 2020/03/21'''
*Added support for Vulkan, so games like The Talos Principle and DOOM 64 are now supported.
*Added support for Vulkan, so games like The Talos Principle and DOOM 64 are now supported.
'''0.2'''
'''0.2 2020/03/01'''
*Added support for EGL, which means games like The Unholy Society and Layton's Mystery Journey: Katrielle and the Millionaires' Conspiracy are now supported.
*Added support for EGL, which means games like <code>The Unholy Society</code> and <code>Layton's Mystery Journey: Katrielle and the Millionaires' Conspiracy</code> are now supported.
'''0.1'''
'''0.1 2020/02/29'''
* First Release.
* First Release.


== Thanks to ==
== Credits ==
* RetroNX channel for help with coding stuff,
* RetroNX channel for help with coding stuff,
* CTCaer for providing many useful informations and convincing me to the end that I should target high precision,
* CTCaer for providing many useful informations and convincing me to the end that I should target high precision,
Line 69: Line 129:


== External links ==
== External links ==
* Official Website - https://gbatemp.net/threads/nx-fps-saltynx-plugin-collecting-fps-data.559065/
* GitHub - https://github.com/masagrator/NX-FPS
* Github - https://github.com/masagrator/NX-FPS
* GBAtemp - https://gbatemp.net/threads/nx-fps-saltynx-plugin-collecting-fps-data.559065/

Latest revision as of 09:25, 11 February 2024

NX-FPS
Nxfps.png
General
Authormasagrator
TypePlugins
Version1.5.5
LicenseMIT License
Last Updated2023/07/02
Links
Download
Website
Source
Support Author

NX-FPS is a SaltyNX plugin that collects FPS data in Nintendo Switch games.

Note: Since SaltyNX v0.7.0 NX-FPS is an intergral part of SaltyNX Core. Please delete NX-FPS plugin from SaltySD/plugins folder and update to SaltyNX 0.7.0+.

Installation

It requires the fork of SaltyNX 0.5.0+ installed.

To install NX-FPS, put the NX-FPS.elf file into /SaltySD/plugins/.

To read FPS data from the plugin, you can either use the Status Monitor Overlay 0.8.1+ or make your own homebrew to use this.

User guide

Currently supports graphics APIs are:

  • NVN.
  • EGL.
  • Vulkan.

When game is booted, plugin outputs one file /SaltySD/FPSoffset.hex.

There is stored address, where you can find PFPS, FPS has address PFPS - 0x8.

  • PFPS - Pushed Frames Per Second (u8), it counts how many frames were actually pushed to display in second that passed.
  • FPS - Frames Per Second (float) calculated from averaged frametime, refreshed with each new frame.

If file is already there, it's rewritten by new address with each new game boot.

Notes

Plugin brings some instability to boot process for some games. It is recommended to not close game before ~10 seconds have passed from showing Nintendo logo, otherwise you risk Kernel panic, which results in crashing OS.

Not working games with this plugin (You can find games not compatible with SaltyNX here)

Title Version(s) Why
Final Fantasy VIII Remastered all Framework stuff is included in NROs which SaltyNX doesn't support.
Final Fantasy X/X-2 all Framework stuff is included in NROs which SaltyNX doesn't support.
LEGO Harry Potter Collection all Framework stuff is included in NROs which SaltyNX doesn't support.

Troubleshooting

Q. Why I got constantly 255?

255 is default value before plugin starts counting frames. This may be a sign that:

  • Game is using different API or function than what is currently supported
  • Plugin missed symbol when initializing (for whatever reason)

Try first to run game again few times. If it's still 255, make an issue and state name of game. Next updates will include support for other graphics APIs.

Screenshots

nxfps2.png

Media

Resident Evil 5 (Nintendo Switch) - Status Monitor Overlay and NX-FPS (Marek)

How to overclock the Nintendo Switch and view FPS - Sysclk & NX FPS Homebrew mods Atmosphere CFW (Nevercholt)

Changelog

1.5.5 2023/07/02

  • Add support for new Vulkan command:
    • NvSwapchain::QueuePresentKHR(VkQueue_T*, const VkPresentInfoKHR*)
  • It solves an issue with FPS Counter not working in Undead Horde 2.

1.5.4 2023/06/09

  • Allow setting max available buffers in games that don't utilize all available buffers (for example We Love Katamari REROLL is reserving 3 buffers, but force game to use only 2. We can now force game to use all 3 buffers for smoother FPS drops)

1.5.3 2023/05/23

  • Allow setting double buffer in games that are using triple buffer.

1.5.2 2023/05/20

  • Fix migrating to other threads when delaying frames (fixes issue with long loading times in Tears of the Kingdom).
  • Improve performance of Window Sync Semi-Enabled mode.

1.5.1 2023/05/20

  • Add support for Semi-Enabled Window Sync Wait.

1.5.0 2023/05/15

  • Support MASTER_WRITE entry in FPSLocker patches.
  • Disable Sync Wait only if passed nvnSync to nvnSyncWait matches nvnSync passed to nvnWindowAcquireTexture (prevents games from crashing, enabling more games to unsync from double buffer vsync - f.e. The Legend of Zelda: Tears of the Kingdom).

1.4.1 2023/05/06

  • Pull from NVN info about number of buffered frames.

1.4.0 2023/04/22

  • Adjust dynamically FPS lock (fixing issue with CPU speed affecting lock's precision).
  • Add array of last 10 frames timings to read from SharedMemory.

1.3.3 2023/04/16

  • Fix NVN interval detection in games using more than 1 nvnWindow. Now f.e. WRC Generations can be unlocked with plugin alone.

1.3.2 2023/04/07

  • Fixes loading patches for some games.
  • If you have downloaded version 1.3.1, it's bugged more than 1.3. Update it.

1.3 2023/04/05

  • Provide better API detection.
  • Add support for eglSwapInterval.
  • Fix eglSwapBuffers return.

1.2.1 2023/04/02

  • Fix "main" address detection.

1.2 2023/04/01

  • Add support for nvnQueueAcquireTexture that was used with some old games (for example Outlast) before deprecation.

1.1 2023/03/19

  • Allow loading LOCK bins produced by FPSLocker 1.1+.

1.0 2023/03/08

  • Allow manipulating FPS.

0.4 2023/03/03

  • Move writing data into SaltyNX SharedMemory. Requires SaltyNX 0.5.0+ to work.
  • If you use Status Monitor Overlay, you must update it to version 0.8.1+ to use it.

0.3 2020/03/21

  • Added support for Vulkan, so games like The Talos Principle and DOOM 64 are now supported.

0.2 2020/03/01

  • Added support for EGL, which means games like The Unholy Society and Layton's Mystery Journey: Katrielle and the Millionaires' Conspiracy are now supported.

0.1 2020/02/29

  • First Release.

Credits

  • RetroNX channel for help with coding stuff,
  • CTCaer for providing many useful informations and convincing me to the end that I should target high precision,
  • Herbaciarz for providing video footage.

External links

Advertising: