if the Pokegen is open, for starters, save as a SAV file somewhere else unrelated to Desmume.
Also, use PKHeX. PKHeX is able to edit DSVs directly.
Now, that you've saved elsewhere, you should be able to import battery file with desmume, using that SAV we just made.