Add associations of file extensions with NDS files #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Following the feedback on #5, I've implemented proposal 3.
This pull request adds a way to associate file extensions (e.g.
.mp3
or.m3u
) with an NDS file that can open them. Extension files should be named like<type>.ext
, where<type>
is an extension likemp3
orm3u
, and placed in/nds
. Their contents are formatted like.argv
files, with the first argument pointing to the NDS file to open and all of the arguments passed to the NDS file. The name of the data file will be appended to the argument list. A relative path for the NDS file is resolved to the /nds/ directory.So, for example, with the following file layout:
Results in the following:
.mp3
and.m3u
files will appear in file listings./song1.mp3
will result in music-player.nds being run with the arguments list/nds/music-player.nds
fat:/song1.mp3
.song2.mp3
will have the arguments list/nds/music-player.nds
fat:/music/song2.mp3
./playlist.m3u
will also open music-player.nds but with the arguments list/nds/music-player.nds
--list
fat:/playlist.m3u
.I've also done a bit of refactoring to make the implementation cleaner and easier.