melonDS-emu / melonDS

DS emulator, sorta
https://melonds.kuribo64.net
GNU General Public License v3.0
3.19k stars 527 forks source link

[Request] TMD file incorporation #1209

Open SamRohod opened 3 years ago

SamRohod commented 3 years ago

Hello Arisotura,

First, THIS "issue" in no longer relevant.

Second, giving the recent implementation of the title manager, the running of DSiWare games is streamlined, where in the title manager the TMD files can be either downloaded or loaded from a local source. I was wondering if it is possible to add a third (maybe default) option to use a in-application database of all the TMD files instead of having to download or load them.

There are no longer any new official DSiWare games/apps being made, and almost all the TMD files can be found in this thread: HERE , or inside the the "TOOLS" folder in the tool HERE. The entire collection is very small in size, which should mean that it won't hurt the portability of the emulator. But it would practically eliminate the need of external files to run DSiWare games/apps (other than NAND & system files)

Lastly, thank you for all the hard work you put in this beautiful emulator. Know that it is honestly appreciated.

RayyanAnsari commented 3 years ago

Why would we need to include every TMD file with the application when we can download any TMD we want straight from Nintendo's update servers? I don't see the point of including these files with the program. The TMD collection that you linked doesn't contain anything extra, and I'm pretty sure most files there were downloaded from NUS anyway.

But it would practically eliminate the need of external files

You aren't required to provide TMDs unless you want to with the current implementation.

SamRohod commented 3 years ago

Because Nintendo might shutdown their servers at any point, it could make getting these TMD files difficult in the future (especially for the average user). Therefore, incorporating the small-in-size-collection of TMD files in MelonDS could future-proof it against any Nintendo server shenanigans.

I don't understand what you meant by saying that the TMD files are not required. Wouldn't that cause problems for DSiWare games (showing-up in NAND, saving, ....etc). If not, then what's the point of them anyways?

Note: I don't know if incorporating the TMD files in MelonDS could legally cause problems for the emulator. If so, then I definitely would say that it is not worth it.

Arisotura commented 3 years ago

that gave me another idea: selecting a directory or archive full of TMDs, and automatically finding the right one...

SamRohod commented 3 years ago

You can find a more organized collection than before in HERE

mariomadproductions commented 2 years ago

The latest No-Intro DSi ROM set includes contents and TMDs. The way the DSi installs titles (basically) is by looking at the tmd and then finding the contents it refers to (in the same folder), so that's probably what MelonDS should do - allow the user to select the tmd, and then install the tmd and the relevant content files (although I don't think the DSi ever uses more than one content file for each title version).

Paecraft commented 2 years ago

Why would we need to include every TMD file with the application when we can download any TMD we want straight from Nintendo's update servers? I don't see the point of including these files with the program. The TMD collection that you linked doesn't contain anything extra, and I'm pretty sure most files there were downloaded from NUS anyway.

But it would practically eliminate the need of external files

You aren't required to provide TMDs unless you want to with the current implementation.

The problem is: Installing only the NDS or .app files of DSiWare will result on "An Error has occurred" message when trying to get in with the unexploited menu. You need to have Unlaunch's modded DSi Menu which does not change the UI, but removes the very satisfying startup and sounds. TMD files may help into fixing this problem directly.

CasualPokePlayer commented 9 months ago

The majority of the TMD file data is actually very easily re-creatable (most data either being constants or stuff which can derived from the .app file, also only the first 520 bytes are ever actually stored on the NAND).

The only thing which isn't easily re-creatable is the 256 byte RSA encrypted signature of the TMD. Re-creating this exactly requires Nintendo's private keys, which are of course, private. It could alternatively be possible to actually re-create the decrypted signature, then hook the BIOS swi RSA functions to leave a decrypted signature as-is to allow the decrypted signature to be considered "good" by the DSi launcher, thus completely preventing the need to acquire TMDs.

This would be beneficial to some kind of unlicensed DSiWare, without needing the user to use a dumped Unlaunch'd NAND (which I'm not even sure works in melonDS in the first place). This would also allow for "3DS only" DSiWare (which have a SHA256 instead of SHA1 in their 3DS TMD signature) to be used in melonDS without needing some dumped Unlaunch'd NAND.