Page 1 of 1
Own ROM file finder for libfilesystem
Posted: Mon Mar 30, 2009 9:45 pm
by dop3j0e
G'day,
As part of my current pet project, I wrote code to find the own ROM file (for NitroFS access) if the flash linker used doesn't support argv handling. Features:
- well written and short, no useless bloat
- uses standard functions (namely ftw() which is not a part of libnds/newlib AFAIK, but provided in an extra file)
- prints output to the user when it's searching (so he/she doesn't think the DS crashed)
- saves the found name in the ROM file to not have to search again
- safe against false positive findings through compiled-in timestamp (no extra build tools needed)
If you guys are interested, I'd be happy to see this code incorporated into libfilesystem or wherever you see fit -- I just don't know where I should send the code. Any hints?
Cheers,
dop3j0e
Re: Own ROM file finder for libfilesystem
Posted: Mon Apr 06, 2009 3:22 pm
by WinterMute
Not interested, sorry.
One of the purposes of libfilesystem is to encourage support of the argv protocol used to find the nitroFS via FAT. Searching for the nds file on startup is a bad idea, even worse is saving the path of the nds file in the app. There are two scenarios where this approach will fail dramatically - when the user rearranges the filesystem so the nds file is no longer in the same place and when the user renames the nds file.
Re: Own ROM file finder for libfilesystem
Posted: Wed May 06, 2009 9:59 pm
by dop3j0e
Oh, in that case my code will just find it can't open the file (or if it can, find the fingerprint doesn't match) and rescan.
But I agree -- getting the linkers to support argv is the way to go, and searching the ROM is a kludge, so I understand your position.
I'd like to post my code to the public anyway; somewhere where others can easily find it. I'm rather new to the scene -- is there a good site where DS coders put up their code or should I just put it on my personal page and rely on Google?
Thanks for your reply and keep up the good work!
dop3j0e
Re: Own ROM file finder for libfilesystem
Posted: Thu May 07, 2009 7:44 pm
by WinterMute
Please don't post the code anywhere. There's already a basic menu system in SVN that supports argv, this will be extended further in due course. Scanning directories on startup is a bad idea.
Re: Own ROM file finder for libfilesystem
Posted: Thu May 07, 2009 10:09 pm
by vuurrobin
WinterMute, could you please tell me why you (or any of the moderators) removed my post without warning or message or anything? afaik, I didn't break any rules, the post was ontopic and it answers a question somebody has plus showing him/her a part of the ds community. if you disagree with my post, than you can state that, but deleting a post just because you disagree with it is wrong and abuse of your admin powers.
having a forum where you can't freely discuss things is counterproductive and not good for the community.
Re: Own ROM file finder for libfilesystem
Posted: Fri May 08, 2009 3:34 am
by WinterMute
Having a forum where bad advice and inappropriate answers to questions remain is counterproductive and bad for the community.
Code to scan directories for an nds file which may or may not exist is a ridiculous waste of resources. Some users have the biggest SD cards they can lay their hands on, filled with as many games as they can find - these users will experience extreme delays on startup due to scanning.
The only appropriate solution to that problem is the argv protocol as supported by the basic homebrew menu in SVN.