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.