gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS Misc > NDS Loading: Full application path?

#77732 - Lazy1 - Sun Apr 02, 2006 7:29 pm

I've been thinking, we really need a standardized way to get the full path where the .nds file was launched from.

For example, if I wanted to have multiple mods of wolf3d on my compactflash card I would need to know where the nds was started from.
Since there is currently no way ( atleast that I know of ) to get the application path that means 1 mod per cf card.
( Current method is to have game files in /wolf3d )

If the path was stored by the nds loader in an area of memory and kept safe just long enough, the current directory could be switched to where the .nds file is kept and allow multiple mods on the same card.

This would also allow other apps to keep their specific files in the same dir as the app rather than dumping everything either in a pre-determined folder or the card's root directory.

#77733 - Mighty Max - Sun Apr 02, 2006 7:39 pm

GBAMP Multiboot stores this at (char *)0x27FF810. This area is not wiped on a reboot and is used to stores the last browsed folder.

When another .nds reboots and this area is not 0, this is taken as the path to continue browsing.
_________________
GBAMP Multiboot

#77735 - Lazy1 - Sun Apr 02, 2006 7:47 pm

Excellent, now all we need is for every other nds loader to implement the same thing at the same address.

#77742 - Darkflame - Sun Apr 02, 2006 8:46 pm

Very much agreed.

Multiboot has lead the way....now to get Moonshell onboard and we will have a powerfull standard ;)

#77744 - Lazy1 - Sun Apr 02, 2006 9:26 pm

Mighty Max wrote:
GBAMP Multiboot stores this at (char *)0x27FF810. This area is not wiped on a reboot and is used to stores the last browsed folder.

When another .nds reboots and this area is not 0, this is taken as the path to continue browsing.


I just did a test and that location always seems to be zero.
Code:

   if ( *( ( char* ) 0x27FF810 ) == 0 )
      iprintf( "Path not available\n" );

#77751 - Mighty Max - Sun Apr 02, 2006 9:54 pm

Whoops indeed,

The path/filename is only set when the .nds is started via an data file. I.e. each *.txt opens dstxt.nds with the path to that file.

Just checked it, forgot this bahaviour. Maybe i should update the sources for the current devkit and put them open/fix that.
_________________
GBAMP Multiboot

#77781 - tepples - Mon Apr 03, 2006 12:00 am

We definitely need a standard for passing argc and argv to plug-ins. Passing the program's full path as argv[0] would be compatible with C on more familiar platforms.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#77820 - chishm - Mon Apr 03, 2006 8:57 am

If someone comes up with a standard, I'm more than willing to implement it into NDSMP. However, there's still the problem of all the supercard, m3 and flashcart user.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com

#77825 - Lazy1 - Mon Apr 03, 2006 10:05 am

We could just break backwards compatibility and only let stuff run on loaders that implement this feature, that way users can pressure the loader devs into conforming to the standard.