If everyone who used this site donated just $3/month, it could be a full time job for multiple people!
This guide helps you set up Desmume on a Windows PC. Mac and Linux users can try using Wine to run Desmume.exe, but this may not work. An updated CFW (Custom Firmware) 3DS console is needed to dump DS game data. Other methods for dumping DS games exist, but this guide won't cover them.
Load Godmode9 by holding Start while turning on the console.
Select [C:] GAMECART.
Choose the .nds file.
Select Copy to 0:/gm9/out.
Exit GodMode9 and transfer the .nds file from sdmc:\gm9\out to your PC.
Extracting Save
Load Checkpoint on your 3DS.
Dump the save from the DS cart.
The save is saved in sdmc:\3ds\Checkpoint\saves.
Setting Up Desmume
Download both Desmume and the lua dll.
Rename lua5.1.dll to lua51.dll.
Place the dll in the same folder as the Desmume executable.
Download the lua script for your game version.
Open Desmume and go to File, select Open ROM.
Open the .nds file extracted from the DS cart.
Go to Tools, select Lua Scripting, then New Lua Script Window....
Choose the Lua Script you downloaded earlier.
Desmume should now be running with your game and displaying RNG information.
Importing a Save
Go to File and select Import Backup Memory....
Load the .sav file extracted from the DS cart.
Exporting a Save
Go to File and select Export Backup Memory....
Name your .sav file and choose where to save it.
Everytime you restart the game, press the Restart button in the lua window.Every time you need to save or load a state, pause the game and hold Shift + F(n) / F(n) until you see the message Saved State (n) / Loaded State (n) appearing on the lower screen for less than a second.For example, Shift + F1 to save a state in slot 1 or F1 to load the state in slot 1.
Troubleshooting
lua 51.dll was not found.
Preview
If you see an error like the one above, the lua dll may be missing. Redownload the dll and ensure it is in the same folder as the Desmume executable. Verify that the dll was renamed correctly.