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 > No$GBA / libfat /DLDI

#121069 - Diddl - Thu Mar 08, 2007 5:20 pm

Don't know if everyone works with No$GBA?

Is it possible to debug a .ds.gba with libfat (dldi) support?

#121072 - GPFerror - Thu Mar 08, 2007 5:33 pm

yeah with FCSR images(FAT12) appended to .ds.gba you can use libfat in No$GBA and desmume and ideas.

http://forum.gbadev.org/viewtopic.php?p=114090&highlight=fcsr+dldi#114090

Troy(GPF)
http://gpf.dcemu.co.uk

#121074 - sirpoonga - Thu Mar 08, 2007 6:03 pm

The dldi file doesn't exist?

Also, can you put a file into that filesystem?

#121079 - Diddl - Thu Mar 08, 2007 6:54 pm

ah cool, - thanks!

would be nice to change something in no$gba to emulate a virtual slot 1 card with TF and FAT. or a slot 2 card with TF. then a virtual DLDI could do the interface ...

#121082 - GPFerror - Thu Mar 08, 2007 7:04 pm

not sure why directly linking isn't working any more for those files, but i have add them both to my left nav bar under Utilities. http://gpf.dcemu.co.uk

fcsrimage.zip Creates a FAT12 image file from a directory for windows command line, also includes davr's code/shell scripts for linux that mine is based off of.

fcsrDLDI.zip dldi patch for .ds.gba files to read from appended FCSR image.

Troy(GPF)

#121087 - sirpoonga - Thu Mar 08, 2007 7:58 pm

Hmmm, fatinitdefault fails.

I just want to be clear on the setup. Let's say I have come files in c:\files and my program is called program.nds.
build program.img c:\files
copy .img to folder with .nds.
cat program.nds program.img > program2.nds
dlditool fcsr.dldi program2.nds

Does this look right?
Code:

G:\emu\fcsrimage>dlditool.exe fcsr.dldi physics2.sc.nds
Dynamically Linked Disk Interface patch tool v1.23 by Michael Chisholm (Chishm)

Trying "fcsr.dldi"
Old driver:          Default (No interface)
New driver:          FlashCartSRam

Position in file:    0x0000E4C0
Position in memory:  0x0200E0C0
Patch base address:  0xBF800000
Relocation offset:   0x4280E0C0

Patched successfully

#121089 - GPFerror - Thu Mar 08, 2007 8:42 pm

sirpoonga wrote:
Hmmm, fatinitdefault fails.

I just want to be clear on the setup. Let's say I have come files in c:\files and my program is called program.nds.
build program.img c:\files
copy .img to folder with .nds.
cat program.nds program.img > program2.nds
dlditool fcsr.dldi program2.nds

Does this look right?
Code:

G:\emu\fcsrimage>dlditool.exe fcsr.dldi physics2.sc.nds
Dynamically Linked Disk Interface patch tool v1.23 by Michael Chisholm (Chishm)

Trying "fcsr.dldi"
Old driver:          Default (No interface)
New driver:          FlashCartSRam

Position in file:    0x0000E4C0
Position in memory:  0x0200E0C0
Patch base address:  0xBF800000
Relocation offset:   0x4280E0C0

Patched successfully


have to use the ds.gba file or at least i've never had any luck with the .nds file

also must padbin the file also

padbin 512 program.ds.gba
cat program.ds.gba program.img > program2.ds.gba
dlditool.exe fcsr.dldi program2.ds.gba

I usually add it to my makefile like this

Code:
$(TARGET).nds   :   $(TARGET).arm7 $(TARGET).arm9
   ndstool   -c $(TARGET).nds -7 $(TARGET).arm7 -9 $(TARGET).arm9
   dsbuild $(TARGET).nds
   padbin 512 $(TARGET).ds.gba
   cat $(TARGET).ds.gba duke.img  > $(TARGET)_fs.ds.gba
   dlditool fcsr.dldi $(TARGET)_fs.ds.gba
   dlditool mpcf.dldi $(TARGET).nds


just find this section in the Makefile if you use the combined template Makefile and add the lines to it.

Troy(GPF)

#121095 - sirpoonga - Thu Mar 08, 2007 9:03 pm

Ahhh, it worked. The .sc.nds is .ds.gba renamed for supercard. Got it to init and find a file. Sweet, this will help out alot.

I need to add this to the makefile.

#122969 - Tantrum - Sat Mar 24, 2007 12:51 am

GPFerror wrote:
fcsrimage.zip Creates a FAT12 image file from a directory for windows command line, also includes davr's code/shell scripts for linux that mine is based off of.


Hi. I'm getting the following error when I try and construct an image. The error seems to be coming from BFI.EXE

Code:
InjectFile("stuff\woot5.txt") failed


Does anybody know what I'm doing wrong?

#122972 - Tantrum - Sat Mar 24, 2007 1:27 am

Tantrum wrote:
GPFerror wrote:
fcsrimage.zip Creates a FAT12 image file from a directory for windows command line, also includes davr's code/shell scripts for linux that mine is based off of.


Hi. I'm getting the following error when I try and construct an image. The error seems to be coming from BFI.EXE

Code:
InjectFile("stuff\woot5.txt") failed


Does anybody know what I'm doing wrong?


Ok, found it. It seems that the minimum size for the img is set to 10k when the files don't exeed that size in total, but BFI doesn't have enough room to work and barfs. I upped the 10000 in build.bat to 20000 and it works.

#135784 - Schyzophrenic - Thu Jul 26, 2007 8:41 am

Hi everyone,

I tried FCSR DLDI driver, but I have a question about it.

Does this DLDI driver manage both read/write ? I am currently developping a homebrew with DLDI support. The code works fine on supercard but I don't see any file creation (I am not talking about reading) when using no$gba.

Is there any special thing to do to enable writing? Where should the files be created ? And is it possible to write file through no$gba (like we do on hardware) ?

Thanks a lot for your help !

#135793 - Dwedit - Thu Jul 26, 2007 10:32 am

I don't know about FCSR here, but I independently made something very similar. I have hacked up gba_nds_fat to use the 64k of SRAM as writable space. You have your big read only FAT disk image, then 'unify' it with SRAM. The SRAM maintains a list of sectors which have changed from the disk image, so when you reads a sector, it either reads from SRAM or from ROM, and when you write to a sector, it writes to SRAM and updates the list of changed sectors. You can store just under 63.5k worth of changed sectors after overhead. This includes overhead coming from the directory entires sector, the FAT chain, and the file contents, so you can't fit a full 64k sized file there, but can store at least 60k worth of files safely.

Does FCSR also unify SRAM with the read only disk image, and perform writes the same way?

Note: watch out, NO$GBA limits SRAM size to 32k.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#135794 - Schyzophrenic - Thu Jul 26, 2007 10:52 am

The file I'd like to store is only a few kbs :)

#135823 - calcprogrammer1 - Thu Jul 26, 2007 6:14 pm

I think Desmume has some sort of FAT Slot-2 emulation. I used it to debug my file browser, it showed the list of files that were in the directory of the .nds file. I was able to delete, but it wouldn't change directory.
_________________
DS Firmware 1, Datel Games n' Music card / Chism's FW hacked GBA MP v2 CF

There's no place like 127.0.0.1.

#135825 - Ant6n - Thu Jul 26, 2007 6:35 pm

Dwedit wrote:
I don't know about FCSR here, but I independently made something very similar. I have hacked up gba_nds_fat to use the 64k of SRAM as writable space. You have your big read only FAT disk image, then 'unify' it with SRAM. The SRAM maintains a list of sectors which have changed from the disk image, so when you reads a sector, it either reads from SRAM or from ROM, and when you write to a sector, it writes to SRAM and updates the list of changed sectors. You can store just under 63.5k worth of changed sectors after overhead.
...

I've been looking for something like that, is there any way to get this (or something similar) working under libfat?

#135833 - masscat - Thu Jul 26, 2007 6:58 pm

calcprogrammer1 wrote:
I think Desmume has some sort of FAT Slot-2 emulation. I used it to debug my file browser, it showed the list of files that were in the directory of the .nds file. I was able to delete, but it wouldn't change directory.

Desmume simulates a GBAMP and attempts to create a FAT structure from the directory of the .nds file, as you say. There is no write support and, under Linux at least, it does get confused when using sub directories.
There is also another mode that allows full read/write access (since version 0.7.1), again simulating a GBAMP. It uses a disk image file which you pass to desmume using the --cflash=<path_to_disk_image_file> command line option (both on Windows and Linux). You can find Java application for creating, reading and writing the disk image over on the desmume forums.

#135837 - calcprogrammer1 - Thu Jul 26, 2007 7:27 pm

On windows it seems to be able to write to that directory, (my pasting routine showed up, maybe it didn't actually write anything though, but I think it deleted something too when I tested). It doesn't change directories though.
_________________
DS Firmware 1, Datel Games n' Music card / Chism's FW hacked GBA MP v2 CF

There's no place like 127.0.0.1.