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 development > ndstool.exe : Change ARM9 RAM address?

#173933 - Chris2027 - Sun May 09, 2010 5:54 am

Hi all,

I seem to have a problem with ndstool.exe (I think).

My task is to change the ARM9 'RAM' and 'Entry' Addresses, both to 0x2000800.

making a change to the makefile allows me to change the "entry address" like so:

Code:
LDFLAGS   =   -specs=ds_arm9.specs -Wl,--section-start,.init=0x2000800 -g $(ARCH) -Wl,-Map,$(notdir $*.map)


then in the ds_rules I made a change to the ndstool line (just to test) by adding -r9 0x2000800

Code:
@ndstool -c $@ -9 $< -b $(GAME_ICON) "$(GAME_TITLE);$(GAME_SUBTITLE1);$(GAME_SUBTITLE2)" $(_ADDFILES) -r9 0x02000800


but this is not affecting the RAM address reporting by ndstool:

Code:
0x24    ARM9 entry address              0x2000800
0x28    ARM9 RAM address                0x2000000


however if I use an older ndstool.exe within the bin folder, it changes the RAM address BUT then the NDS ROM no longer works?

This worked in an earlier version of devkitpro ?

Any clue?

Many thanks!

#173948 - fincs - Sun May 09, 2010 5:18 pm

Add -e9 0x02000800 to the ndstool command line to fix the problem.

#173953 - Chris2027 - Sun May 09, 2010 10:27 pm

cheers for the reply fincs :)

I actually tried that, but it doesnt make any difference. The entry address is infact OK but the RAM address wont budge - unless i use an older ndstool.exe. however doing that causes the nds binary to not work.

I think something changed with ndstool.exe - the version I have with the latest devkitpro is:

Nintendo DS rom tool 1.47 - Mar 25 2010

#173960 - Chris2027 - Mon May 10, 2010 3:27 am

OK I've worked it out by using a different project with makefile.

I used the examples/nds/templates/combined/

now I'm getting somewhere :)

thanks all, please ignore this post now.

#174053 - wintermute - Sat May 15, 2010 6:18 pm

The latest ndstool converts directly from elf rather than going through the intermediate objcopy stage. This makes it much easier to mess around with the load and entry points than it is with straight binary.

Code:

LDFLAGS   =   -specs=ds_arm9.specs -Wl,--section-start,.init=0x2000800,--nmagic -g $(ARCH) -Wl,-Map,$(notdir $*.map)


is sufficient when ndstool is using elf.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog