Cheat File Support [Feature Request]
A few emulators and most flashcarts support the use of cheat code files. (.dat, .db, .xml etc.) Would be really nice to see this feature in melonDS as well.
I'd like to see a few of them so I can give it a try
I already have a usrcheat.dat, the format doesn't seem too complicated to parse
There are some other formats here that might have some easier ones to work with incase .dat ends up being problematic.
Any update on this?
~just sent ten Euros as a thanks
thanks :P
it wouldn't be difficult to import cheats, it's just matter of coding a thing for it; I've been having other things to worry about lately...
I did this in the meantime to help. https://github.com/Phosphorus-M/Cheat-Parser
At the moment it works with several games, so I gave it a try.
The original urcheats in format XML and the version in melonDS

I would open an issue for this but this had already opened, so I wanna remind that feature request. Plus having adjustable pane in cheat code editor and a hotkey for enabling/disabling cheats would be neat.
Perhaps if you don't mind using code from other projects:
- woodrpg has an implementation of the R4 CheatCode database (usrcheat.dat):
- https://github.com/lifehackerhansol/woodrpg/blob/main/akmenu4/arm9/source/cheatwnd.cpp
- https://github.com/lifehackerhansol/woodrpg/blob/main/akmenu4/arm9/source/cheatwnd.h
- (this has been reused quite a few times, notably in TWiLight Menu++)
- nitrohax has an XML implementation, though this may not be too useful as it's a human-readable XML: https://github.com/chishm/nitrohax/blob/master/arm9/source/cheat.cpp
The XML format is fairly simple; the gameid is sNDSHeader->gameCode + header CRC32 (iirc 0x200?)
The R4 database works similarly, but also a binary format. Unfortunately code is documentation for this one; no one has really laid out in plaintext how it works. It is more widely used than XML, though.
Hope this helps (if at all).
Just downloaded melonDS on my Galaxy S22 Ultra as I heard it has local multiplayer...
I'm sorry I scoured the internet for information but none of the answers seem to be working. I cannot seem to get the XML file for Pokémon White 2 to work as it crashes the game...
Specifically the game is Pokemon - White Version 2 (Experience + Trade Evolution Patched).nds
I keep seeing I need a dat file in the directory of the game but importing the xml with or without the dat file crashes the game... It's extremely possible it's my format of the xml file but I doubt it as it's the same xml file I use in other Emulators from the website gamehacking but codes from pokemoncoders.
My suggestion is adding the ability to add individual codes like many other emulators do... Even DrasticDS has an option to separately input individual codes.
the android port is not made by the same people here
Thanks for letting me know
Plus one to this. Right now we have to use Desmume as a cheat database parser, painstakingly copy and paste all the desired cheats from Desmume into MelonDS. There must be a better way.
@daninthemix As far as I know Desmume uses usrcheat.dat, you can also use https://www.gamebrew.org/wiki/R4_Cheat_Code_Editor to copy or edit cheat codes.
I did this in the meantime to help. Phosphorus-M/Cheat-Parser
At the moment it works with several games, so I gave it a try.
The original urcheats in format XML and the version in melonDS
How do I get this to work? Running Windows.
@Maverynthia
If you are not a programmer, you can download this exe and then in the same folder where download the exe execute the following with cmd:
cheat_parser.exe GAME_ID LOCATION_CHEATS_XML OUTPUT_MCH
Replace GAME_ID for the ID of the rom
Replace LOCATION_CHEATS_XML for the place where you put the cheats.xml file
Replace OUTPUT_MCH for the place where do you want to save the output, the output must end with the extension .mch