nitrofs with combined template

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

nitrofs with combined template

Post by Tomdev » Thu Jun 11, 2009 7:18 pm

ok, so i'm using nitrofs for my game, and i decided to program with the combined template(with an arm9 & arm7 folder). everything compiles fine, but when i start the rom it cannot init nitrofs. how can you get nitrofs working with the combined template?

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

Re: nitrofs with combined template

Post by Tomdev » Fri Jun 12, 2009 6:23 pm

why's melw's post deleted, wanted to try it :oops:

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

Re: nitrofs with combined template

Post by WinterMute » Fri Jun 12, 2009 7:13 pm

The information was wrong.

Try this instead :-

Code: Select all

#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITARM)),)
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
endif

export TARGET		:=	$(shell basename $(CURDIR))
export TOPDIR		:=	$(CURDIR)
NITRODATA	:=	nitrofiles

#---------------------------------------------------------------------------------
icons := $(wildcard *.bmp)

ifneq (,$(findstring $(TARGET).bmp,$(icons)))
	export GAME_ICON := $(CURDIR)/$(TARGET).bmp
else
	ifneq (,$(findstring icon.bmp,$(icons)))
		export GAME_ICON := $(CURDIR)/icon.bmp
	endif
endif

ifneq ($(strip $(NITRODATA)),)
	export NITRO_FILES	:=	$(CURDIR)/$(NITRODATA)
endif

include $(DEVKITARM)/ds_rules


.PHONY: $(TARGET).arm7 $(TARGET).arm9

#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
all: $(TARGET).nds

#---------------------------------------------------------------------------------
$(TARGET).nds	:	$(TARGET).arm7 $(TARGET).arm9
	@ndstool -c $@ -7 $(TARGET).arm7 -9 $(TARGET).arm9 -b $(GAME_ICON) "$(GAME_TITLE);$(GAME_SUBTITLE1);$(GAME_SUBTITLE2)" $(_ADDFILES)
	@echo built ... $(notdir $@)

#---------------------------------------------------------------------------------
$(TARGET).arm7	: arm7/$(TARGET).elf
$(TARGET).arm9	: arm9/$(TARGET).elf

#---------------------------------------------------------------------------------
arm7/$(TARGET).elf:
	$(MAKE) -C arm7
	
#---------------------------------------------------------------------------------
arm9/$(TARGET).elf:
	$(MAKE) -C arm9

#---------------------------------------------------------------------------------
clean:
	$(MAKE) -C arm9 clean
	$(MAKE) -C arm7 clean
	rm -f $(TARGET).nds $(TARGET).arm7 $(TARGET).arm9
You'll need to add -lfilesystem -lfat to the LIBS in the arm9 Makefile before -lnds.

Please note: Use of the combined template is generally discouraged, future updates may break your code quite badly. Also: no support is provided for libraries not distributed by devkitPro.
Help keep devkitPro toolchains free, Donate today

Personal Blog

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

Re: nitrofs with combined template

Post by Tomdev » Fri Jun 12, 2009 7:33 pm

ok, i will use libfilesystem:) i used my own nitrofs because i didn't had the loader anymore and couldn't find it. and I need the combined template for nds rom booting. that can't be than on a other way or can it?

edit:

i get an error using this makefile: Makefile 39: ***missing separator
i'm definitely not good in makefiles and can't see what's wrong

Legolas
Posts: 10
Joined: Fri May 09, 2008 1:16 am

Re: nitrofs with combined template

Post by Legolas » Fri Jun 12, 2009 7:45 pm

Just use tabs instead of blank spaces in line 39

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

Re: nitrofs with combined template

Post by WinterMute » Fri Jun 12, 2009 10:38 pm

Sorry about that, just did a bit of phpbb hacking so the tabs aren't filtered in code boxes. Should work fine now.

FWIW, if you were planning on putting together a boot menu which loads assets from the nitro filesystem I'm not sure that's likely to be possible unless you have access to the card boot code in order to provide argv. It's probably better to keep assets in a root subdirectory to allow themes/user skinning anyway.
Help keep devkitPro toolchains free, Donate today

Personal Blog

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

Re: nitrofs with combined template

Post by Tomdev » Sat Jun 13, 2009 6:19 am

Ok, but it's a game and i put the game data in nitrofs, and the bootloader is for "soft-reset" so it doesn't load roms uot of nitrofs.

and what are the advantages of libfilesystem? i don't know the difference between nitrofs and libfilesystem

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

Re: nitrofs with combined template

Post by Sylus101 » Sun Jun 14, 2009 1:41 am

As I understand it, libfilesystem is a slightly modified/cleaned up version of nitroFS. One of the main differences, is that the method the original nitroFS used to locate the .nds filename (you having to provide it in your code) was not implemented because the method is disliked and issue prone (renaming the rom or putting it anywhere but the root causes obvious problems).

libfilesystem requires a loader that can use the argv parameter, and most slot 1 cards loaders don't. Wintermute posted a loader that works on slot 1 cards, but I have not have any luck with it and my R4... (it's not a fake one...).
-Sylus "Not Stylus..." McFrederickson

Come visit my web site.

Post Reply

Who is online

Users browsing this forum: No registered users and 29 guests