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 > "Does not have a dldi section"

#152708 - alcoran - Wed Mar 19, 2008 10:50 pm

Hi

My rom worked previously on the NDS device, and i added some code and libs, working with emulator. I want to try it again on the device, but now i get a "Does not have a dldi section" error message when patching my .nds file.

I didn't chnaged my the dldi tool nor the driver. Where should i look? is it because my rom is now too big or something like that?

thank you for your help

#152715 - josath - Thu Mar 20, 2008 12:27 am

either you aren't linking against libfat (or you're not using fatInitDefault() ), or something has gone horribly horribly wrong.

#152734 - ETkoala - Thu Mar 20, 2008 7:50 am

looks like you've done something wrong, copy your whole project and try this (after removing all your old fat stuff, so it doesn't mix with this etc.)

Initializing FAT:
1- make sure you have latest libnds (update with devkitpro)
2- open file 'source/main.c' --> #include <fat.h> should be at the top of your code
3- open file 'MakeFile' -> search for "LIBS :=", add -lfat before the -lnds9 if it doesn't have it. It should look like this:
LIBS := -lfat -lnds9
4- example with fat:
Code:

if (fatInitDefault()) printf("FAT is OK!");
else printf("FAT FAILED :(\n (Note: Wrong dldi patch?)");

u8* filedata;             //8 byte data
FILE* f = fopen ("myfile.txt", "rb");
fread(&filedata, sizeof(u8), 12345, f);    //12345 -> file lenght
fclose(f);

printf("\nValue on byte 500 from file is: %x", filedata[500]);


now it should work after you patch with dldi.
If you want to try in emulator you need to do a little more things:
Using DLDI with emulator (works on no$gba and desmume):

1- Download fcsrDLDI.zip and fcsrimage.zip from http://gpf.dcemu.co.uk/
(You will use fcsr.dldi to patch and fcsrimage to make an image of a folder you will like to add to your .nds file, so the emulator thinks it's reading a folder (fcsr.dldi patched))
2-extract fcsrimage into a folder
3- Make an image of your folder in cmd.exe/console by typing (in fcsrimage folder): build.bat name.img c:\yourfolder
Note: if you get an error message now, it's probably that your windows language is not English (that happened to me), you will have to open "build.bat" file and change the word findstr "Files" to findstr "something" (change 'something' to the word the console tells you how many files there are on that folder.. you can check it by simply typing dir)
4- You should have a file named name.img now, move name.img and dlditool.exe(dldi patcher) to your project folder and create a .bat file with this written in it:
Code:

padbin 512 myhomebrew.nds
cat myhomebrew.nds name.img > myhomebrew_FC.nds
dlditool.exe fcsr.dldi myhomebrew_FC.nds

(Change 'myhomebrew' to your real .nds file name)
5- run patch.bat
6- Et voil?!

(Note: if you get an error message like "padbin command not found", download it from here: http://www.pineight.com/gba/#gbfs , get the "GBFS distribution", it should be there, in /tools folder)


hope it helps![/code]


Last edited by ETkoala on Sat Mar 22, 2008 9:31 am; edited 1 time in total

#152825 - alcoran - Fri Mar 21, 2008 8:11 am

Thank you!

you were right because of a compilation flag mistake, i didn't called fatInitDefault() anymore :(.

#152835 - antiaverage - Fri Mar 21, 2008 2:01 pm

Great post ETkoala, that was really helpful. It helped me streamline my fat process. I appreciate it.

#152856 - alcoran - Fri Mar 21, 2008 8:06 pm

i confirm thank you very much

#152895 - ETkoala - Sat Mar 22, 2008 9:26 am

no problem ;)

it was a nightmare when I tried to figure out how it works in 200 different posts :s

#154370 - SevenString - Tue Apr 15, 2008 6:15 am

ETKoala, that was one of the most helpful things I have read in a long time.


As recently as today, I thought I had found what I was looking for in EFSLib. I was doing okay with it, and I even posted about it.

But I discovered that it wasn't what I needed after all, and after hunting around, I ran across your post.


Your instructions worked GREAT. Thanks again.
_________________
"Artificial Intelligence is no match for natural stupidity."

#157821 - doudou - Fri May 30, 2008 12:53 am

I have the same issue even if I followed these steps.

I had it working once by moving my
Code:
#include <fat.h>
. I'm not able to rollback to a working version and I don't quite understand why it has to be first as mentionned in this quote:

Quote:
2- open file 'source/main.c' --> #include <fat.h> should be at the top of your code

#158979 - doudou - Mon Jun 23, 2008 6:09 pm

Ok, I solved my problem. I was doing "cat" outside of msys and the windows "cat" isn't meant for binary files.