Some ETAs

Post Reply
Sylus101
Posts: 179
Joined: Wed Dec 24, 2008 5:08 am

Some ETAs

Post by Sylus101 » Sat Feb 28, 2009 9:04 am

I'm just curious on possible time-frames for a couple of things...

1. Update to online docs... several (at least 2...) functions have new parameters from 1.3.1 to 1.3.2.

2. Example(s) for the new filesystem.

Also, is there any current knowledge of nitroFS' compatibility in emulators?
-Sylus "Not Stylus..." McFrederickson

Come visit my web site.

Tomdev
Posts: 82
Joined: Thu Jan 08, 2009 9:15 pm

Re: Some ETAs

Post by Tomdev » Sat Feb 28, 2009 1:27 pm

yes i can't wait for examples for the new filesystem! i looked up in the header but there was only an init function :lol:

WinterMute
Site Admin
Posts: 2003
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Some ETAs

Post by WinterMute » Wed Mar 04, 2009 4:13 pm

For future reference please do not play guessing games and make posts which modify files distributed with the toolchain. The integrity of information found on these boards is important. I have deleted all the offending posts and replies to them - if you're in that much of a rush then use #dsdev on irc.blitzed.org to ask. Generally you'll get better advice there if you're patient and ask the right questions.

The latest libnds docs are now online.

Examples for the nitro filesystem should be available in the next few days subject to further testing. Currently the code will work fine on no$gba and slot2 cards which copy the whole nds file to GBA cart space before execution. Slot1 support via FAT is supported but only through a launcher which supplies argv parameters - as yet none that we're aware of. A basic menu and launcher system is available in SVN @ http://devkitpro.svn.sourceforge.net/vi ... ebrewMenu/

The basics of adding files are as follows :-

Add a line at the top of the Makefile defining the directory to use, like this

Code: Select all

#---------------------------------------------------------------------------------
TARGET		:=	$(shell basename $(CURDIR))
BUILD		:=	build
SOURCES		:=	source
DATA		:=
INCLUDES	:=	include
NITRODATA	:=	nitrofiles
Later in the Makefile, within the ifneq ($(BUILD),$(notdir $(CURDIR))) block

Code: Select all

#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------

export OUTPUT	:=	$(CURDIR)/$(TARGET)

export VPATH	:=	$(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
					$(foreach dir,$(DATA),$(CURDIR)/$(dir))

export DEPSDIR	:=	$(CURDIR)/$(BUILD)

ifneq ($(strip $(NITRODATA)),)
	export NITRO_FILES	:=	$(CURDIR)/$(NITRODATA)
endif
simple directory example.

Code: Select all

#include <nds.h>
#include <nitrofs.h>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>


//---------------------------------------------------------------------------------
int main(int argc, char **argv) {
//---------------------------------------------------------------------------------
	
	// Initialise the console, required for printf
	consoleDemoInit();
	
	if (nitroFSInit()) {

		DIR *pdir;
		struct dirent *pent;
		struct stat statbuf;

		pdir=opendir("/");

		if (pdir){

			while ((pent=readdir(pdir))!=NULL) {
	    		stat(pent->d_name,&statbuf);
	    		if(strcmp(".", pent->d_name) == 0 || strcmp("..", pent->d_name) == 0)
	        		continue;
	    		if( S_ISDIR(statbuf.st_mode)) {
	        		iprintf("%s <dir>\n", pent->d_name);
				} else {
	        		iprintf("%s %ld\n", pent->d_name, statbuf.st_size);
				}
			}
			closedir(pdir);
		} else {
			iprintf ("opendir() failure; terminating\n");
		}

	} else {
		iprintf("nitroFSInit failure: terminating\n");
	}

	while(1) {
		swiWaitForVBlank();
	}

	return 0;
}
obviously adding -lfilesystem -lfat to your LIBS line, before -lnds9


The only emulator we test with is no$gba, the nitroFS support works fine there but unfortunately we can't guarantee this will work with other emulators. Generally you should be testing on hardware whenever possible - even no$ gets things a bit wrong sometimes.
Help keep devkitPro toolchains free, Donate today

Personal Blog

Tomdev
Posts: 82
Joined: Thu Jan 08, 2009 9:15 pm

Re: Some ETAs

Post by Tomdev » Wed Mar 04, 2009 5:27 pm

ok sorry about that :oops: i won't do it again. and i redownloaded devkitarm so i have no modified files distributed with the toolchain. i hope that everyone who read my post will do the same, as i did it totally wrong :oops:

edit why does ideas And my nds shows me a fat directory and no$gba not if i use the official lib? with my previous project and my deleted old lib it worked fine????

Sylus101
Posts: 179
Joined: Wed Dec 24, 2008 5:08 am

Re: Some ETAs

Post by Sylus101 » Wed Mar 04, 2009 7:06 pm

My apologies as well. My edits didn't include modifications to the base_rules or ds_rules, just my own makefile (which admittedly, though, is from the libnds examples) and were just an attempt to try to get it working until official means were posted.
WinterMute wrote: obviously adding -lfilesystem to your LIBS line, before -lnds9
This isn't obvious to me at all, I have very little experience at the the makefile level. Its starting to make more and more sense as time goes on... but would you be willing to explain why this order is important? If I were to have guessed wildly, I would have thought you want to list your primary library first...

Also, the NitroFS wiki page mentions that you have in initialize FAT as well. Is this changed in the version integrated with libnds?
Last edited by Sylus101 on Wed Mar 04, 2009 8:03 pm, edited 3 times in total.
-Sylus "Not Stylus..." McFrederickson

Come visit my web site.

Tomdev
Posts: 82
Joined: Thu Jan 08, 2009 9:15 pm

Re: Some ETAs

Post by Tomdev » Wed Mar 04, 2009 7:36 pm

yeah you didn't sylus, i thought ds_rules was a sort of a makefile and didn't thought about it that i'm not allowed to change that, for the second time, i'm so sorry Wintermute and the developers of devkitpro/devkitarm

WinterMute
Site Admin
Posts: 2003
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Some ETAs

Post by WinterMute » Thu Mar 05, 2009 1:00 pm

Sylus101 wrote:My apologies as well. My edits didn't include modifications to the base_rules or ds_rules, just my own makefile (which admittedly, though, is from the libnds examples) and were just an attempt to try to get it working until official means were posted.
It's ok, I understand people want to play - I'm just reluctant to allow posts here which involve modifying internals and other advice which may break the tools for inexperienced users. Like I said it's probably best to stop by IRC and ask there for a quicker response.
WinterMute wrote: obviously adding -lfilesystem to your LIBS line, before -lnds9
This isn't obvious to me at all, I have very little experience at the the makefile level. Its starting to make more and more sense as time goes on... but would you be willing to explain why this order is important? If I were to have guessed wildly, I would have thought you want to list your primary library first...
When the linker scans object files in archives it proceeds from left to right, fulfilling dependencies as it goes. If library A uses functions from library B then the link order must be -lA -lB otherwise you'll get link errors.
Also, the NitroFS wiki page mentions that you have in initialize FAT as well. Is this changed in the version integrated with libnds?
Yes, the point here is to avoid initialising features which may not be present. The filesystem library initialises the FAT layer only if it is required which simplifies user code.
Help keep devkitPro toolchains free, Donate today

Personal Blog

Sylus101
Posts: 179
Joined: Wed Dec 24, 2008 5:08 am

Re: Some ETAs

Post by Sylus101 » Fri Mar 06, 2009 7:36 pm

Thanks for that response, the more I learn the more dangerous I become. Just kidding...
WinterMute wrote: Examples for the nitro filesystem should be available in the next few days subject to further testing. Currently the code will work fine on no$gba and slot2 cards which copy the whole nds file to GBA cart space before execution. Slot1 support via FAT is supported but only through a launcher which supplies argv parameters - as yet none that we're aware of. A basic menu and launcher system is available in SVN @ http://devkitpro.svn.sourceforge.net/vi ... ebrewMenu/
I'm a little puzzled on this part. I tried what I had setup on hardware (R4, slot 1) for the first time and I guess as suspected it failed to work. What I'm not real clear on, is if the loader linked to is supposed to be an alternative that will work on slot 1 carts? It just gave a loading message and stayed hung there.

I will definitely hang tight and wait for some examples...
-Sylus "Not Stylus..." McFrederickson

Come visit my web site.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests