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 > Problem with patching a project with fcsr.dldi

#161064 - Lachsen - Sun Jul 27, 2008 3:24 pm

Hi there,

I'm pretty new to DS Homebrew, I started just some days ago. Currently I try to create a project with libfat, but I have been stuck with that for quite some time, now.

I followed the steps from this site to create a Project with libfat that should run on NO$GBA.

Now I have the problem, that I cannot patch the rom containing the filesystem.

Here is the Batch-File I use for building the project:
Code:

@echo off
set OLDDIR=%CD%

echo build Project

make

echo create Filesystem

cd ..\fs_builder\

CALL build %OLDDIR%\MyProject.img %OLDDIR%\files

chdir /d %OLDDIR%

echo connect Game with Filesystem

padbin 512 MyProject.ds.gba

cat MyProject.ds.gba MyProject.img > MyProject_fs.ds.gba

dlditool fcsr.dldi MyProject_fs.ds.gba


When MyProject_fs.da.gba is patched with dlditool i get the following notice:

Quote:
Dynamically Linked Disk Interface patch tool v1.24 by Michael Chisholm (Chishm)

Trying "fcsr.dldi"
MyProject_fs.ds.gba does not have a DLDI section


One thing to note is, that the patching works, if I use the Rom without the filesystem (i.e. dlditool fcsr.dldi MyProject.ds.gba )

I included the libfat library and called fatInitDefault() in the main function, so I think there should be a DLDI section...

I searched quite a while in this forum but didn't find any solution for this problem (on the other hand I really tend to miss many things), so that's why I'm asking.

Can anyone help me with this?

Thanks

Lachsen

#161065 - Dark Knight ez - Sun Jul 27, 2008 3:36 pm

Just patch before even padding the .ds.gba?
_________________
AmplituDS website

#161066 - Lachsen - Sun Jul 27, 2008 3:45 pm

Dark Knight ez wrote:
Just patch before even padding the .ds.gba?

When I do this, the patching works, but when I start the resulting rom with no$gba I get the Message
"The rom-image has crashed".
So it's not running...

#161067 - Dwedit - Sun Jul 27, 2008 6:47 pm

The FCSR patcher adds a useless 512 byte "loader" for flash cartridges. I think it's completely useless since ndstool's generated NDS files already have a loader.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#161069 - silent_code - Sun Jul 27, 2008 8:32 pm

@ Dwedit: But it should work.

@ Lachsen: With which OS do you work? I assume (bause you use cat) it's Linux, right?
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.

#161078 - tepples - Sun Jul 27, 2008 11:11 pm

silent_code wrote:
@ Dwedit: But it should work.

@ Lachsen: With which OS do you work? I assume (bause you use cat) it's Linux, right?

'CALL' means it's probably a batch file for Windows Command Prompt. The 'cat' works because devkitPro Updater puts MSYS into %Path%, and MSYS provides a lot of "POSIX Shell and Utilities" programs such as 'cat'.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#161081 - silent_code - Sun Jul 27, 2008 11:27 pm

@ tepples: Ok, you're right.


Well, for me "copy /b" works all the time (I haven't even tried cat!) and I didn't have any issues with FCSR, yet. Only building the image caused broblems due to a localization issue in the batch file (I am on a german WinXP.)

Maybe you could try EFS 2.0 or NitroFS instead? They both run on hardware and in emulators with an appended file system (so, it's only one file - although that's a pro and a con - during development you don't want to write too much to your flash card every time you want to test on hardware... that brings us to the next point:), but you can still use libfat in parallel for accessing "regular" files.
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.

#161105 - Lachsen - Mon Jul 28, 2008 10:38 am

Hi again!

Thanks for all the answers.

My OS is Windows XP (also german).

The reason I want to use libfat is to store additional data (like sounds and graphics) for a game separately, such that it's not loaded to Main Memory (which is limited by 4 MB afaik). So if there are other ways to do this, I'd try them as well.

So maybe I will have a look at this EFS/NitroFS ...
But then I have no idea how you actually access the data without libfat. (Overall I'm still confused about accessing any data outside the program)

Is there any kind of example project with an file system (that is not loaded completely to Main Memory) out there, where I can see how accessing the files work? The only example project I found was one that uses gbfs... And as soon as I put too large files inside this filesystem I got an error, that some kind of memory limit was reached (I don't remember exactly what kind of memory, though) ...

@silent_code I had the same localization issues with the batch file. You mean that the string "File(s)" was searched, right?

Again, thanks for the answers

C ya

Lachsen

#161106 - silent_code - Mon Jul 28, 2008 11:31 am

EFS comes with an example project. Also, there is a simple example on libfat's official site.

You access data from a filesystem via the library's implementation of read and write (as well as others, like open, close, seek etc.) routines.
I think all of the recent libraries have implemented standard C and C++ file access, so it works just as on the PC. The only difference is, that you have to initialize the libraries before accessing any files.

The appended filesystems don't get loaded into main memory, despite the fact that they are in one file with the executable(s).

The actual memory limit is below 4MB (like 3.7 or so) and minus the size of the executables and their data (static and dynamic, as well as the stack).

Regarding the batch issue: Yes, that's what I meant. :^)

Greetings.

PS: You should set your location to Germany, as this may solve some language issues (so that people don't assume you are a native speaker and go easy on you. :^) )
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.