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 > Playing/Debugging DLDI games on emulator

#124019 - Lupi - Mon Apr 02, 2007 2:39 pm

Well, I'm trying to get some screens and videos with no$gba in Windows XP of NeoFlash Games. The problem is that some of the games require DLDI and they won't work on emulator.

I have found this:
http://forum.gbadev.org/viewtopic.php?t=12654%3C/blockquote%3E%3C/div%3E

But I can't get it to work. Any ideas?

#124022 - Diddl - Mon Apr 02, 2007 3:21 pm

problem is that this solution does only append alle files on poor NDS file and make it bigger and bigger.

memory on a NDS is only 4MB and if NDS file has 1 the sum of all files may not increase 3 MB (in case of 3MB there would be no working RAM for application!)

-----

the only way would be, if a creator of the emul would support pluggable Slot 1 support. like vice makes this for C64 cartridges. within emu application should be a menu "mount slot 1" and you give a directory of your harddisk or a whole drive as parameter. or maybe only a big file (FAT image).

#124023 - GPFerror - Mon Apr 02, 2007 3:32 pm

Lupi wrote:
Well, I'm trying to get some screens and videos with no$gba in Windows XP of NeoFlash Games. The problem is that some of the games require DLDI and they won't work on emulator.

I have found this:
http://forum.gbadev.org/viewtopic.php?t=12654%3C/blockquote%3E%3C/div%3E

But I can't get it to work. Any ideas?


Whats not working?

#124025 - Lupi - Mon Apr 02, 2007 3:47 pm

I get the .ds.gba (or .sc.nds)

Then I downloaded the dldi that they talk about in that post
This one:
http://gpf.dcemu.co.uk/files/pc/fcsrDLDI.zip

I use DLDItool GUI for windows that detects that dldi, I select it (FlashCartSRam), then load the .ds.gba and click on Patch.

Once it has finished, I load the .ds.gba in no$gba but it fails libfat inicialization.

#124027 - Quirky - Mon Apr 02, 2007 4:32 pm

Desmume has some limited flash support, but not with a patched .nds file. At least IME the emulator doesn't load files when the .nds has been patched for the ez-flash 5.

Perhaps try a different patch, or use the default (unpatched) ROM file.

#124033 - GPFerror - Mon Apr 02, 2007 5:24 pm

Lupi wrote:
I get the .ds.gba (or .sc.nds)

Then I downloaded the dldi that they talk about in that post
This one:
http://gpf.dcemu.co.uk/files/pc/fcsrDLDI.zip

I use DLDItool GUI for windows that detects that dldi, I select it (FlashCartSRam), then load the .ds.gba and click on Patch.

Once it has finished, I load the .ds.gba in no$gba but it fails libfat inicialization.


make sure and padbin 512 the ds.gba file before appending the fcsr image to it, and then dldi patch

FCSR images work in desmume, no$gba and ideas and should work on hardware for some cards as well.

Troy(GPF)

#124039 - Lupi - Mon Apr 02, 2007 6:07 pm

Ok, What I do, for example, with Warcraft Tower Defense, I make an image of the maps folder:

Code:
build.bat maps.img maps


Then I padbin the .ds.gba

Code:
padbin 512 TowerDefense.ds.gba


Next, I add the image to the end of the original rom

Code:
cat TowerDefense.ds.gba maps.img > TD.sd.gba


And lastly, I patch woth DLDI

Code:
dlditool.exe fcsr.dldi TD.ds.gba



WHAT I GET:
The Fat starts correctly, but it say the folder maps can't be found

#124063 - GPFerror - Mon Apr 02, 2007 11:04 pm

Lupi wrote:
Ok, What I do, for example, with Warcraft Tower Defense, I make an image of the maps folder:

Code:
build.bat maps.img maps


Then I padbin the .ds.gba

Code:
padbin 512 TowerDefense.ds.gba


Next, I add the image to the end of the original rom

Code:
cat TowerDefense.ds.gba maps.img > TD.sd.gba


And lastly, I patch woth DLDI

Code:
dlditool.exe fcsr.dldi TD.ds.gba



WHAT I GET:
The Fat starts correctly, but it say the folder maps can't be found


put the maps folder under a another directory.

fcsrdir/map

build.bat maps.img fcsrdir

so that the map directory is included in the image, otherwise it will only contains stuff under the map directory.

Troy(GPF)

#124066 - sirpoonga - Mon Apr 02, 2007 11:59 pm

GPFerror wrote:
Lupi wrote:

Code:
build.bat maps.img maps

put the maps folder under a another directory.

fcsrdir/map

build.bat maps.img fcsrdir

so that the map directory is included in the image, otherwise it will only contains stuff under the map directory.

In case that is confusing I will reword it. The parameter you send in to build.bat is the root folder. So if i have c:\files and do a build.bat maps.img c:\files, the contents of c:\files become the root folder for the gba program.
In fact, my current c:\files looks like
c:\files\settings.maz
c:\files\mazes\testmaze.txt
So after building the image the settings.maz is in the root (/) folder of the fscr image.

So with your command you aren't adding the maps folder to the image, you are making the maps folder the root folder of the image.

#124130 - Lupi - Tue Apr 03, 2007 11:28 am

Hmm, it seems the build.bat is not working correctly

Code:

Builds a FAT disk image from a given directory.
64
Creating image
creating FAT12 image size = 0.01 MB's


Working[]DoneInjectFile("C:\files\duke3d\DEFS.CON") [b]failed[/b]
Blessing image
OK - start1:0 size1:0
"FAT12 image built as DATA.img from /C:\files"


The file is in there, and I'm setting C:\files as the "root" I will add later. Why does it fail?

#124146 - GPFerror - Tue Apr 03, 2007 3:54 pm

Lupi wrote:
Hmm, it seems the build.bat is not working correctly

Code:

Builds a FAT disk image from a given directory.
64
Creating image
creating FAT12 image size = 0.01 MB's


Working[]DoneInjectFile("C:\files\duke3d\DEFS.CON") [b]failed[/b]
Blessing image
OK - start1:0 size1:0
"FAT12 image built as DATA.img from /C:\files"


The file is in there, and I'm setting C:\files as the "root" I will add later. Why does it fail?


It seems i miscalculated the smallest file size that mkdosfs.exe would take, edit the build.bat line
Code:
if /I %size% LSS 10000  (                      set /A size="10000" )


change to

Code:
if /I %size% LSS 300000  (                      set /A size="300000" )


Also based on your example above you forgot to put your duke3d.grp file in the directory otherwise it would have been large enough to build the FAT12 file :)

Troy(GPF)

#124152 - Lupi - Tue Apr 03, 2007 5:14 pm

Nothing, I even tried with 11000000 so it can have like 10 MB of data (the duke3d.grp is that big), padbin, then cat, last dldi and I a extrange advice telling me the CON files weren't found or something, asking me if I wanted to create them, but the execution stops...

I give up, I will just record my DS screen with a webcam to make the videos, thanks anyway :)

#124179 - tyraen - Tue Apr 03, 2007 9:56 pm

I'm getting the same error, after changing references to 10000 to 300000. I'm trying to get DSO to run on my comp so I can test out my plugin, although this way would still be a little annoying. I guess it might be ok to set up a script to it all... isn't there an emu that emulates file structures differently? (goes looking)

UPDATE: Actually, I tried adding my plugin, now the directory structure is like this:
temp\
temp\DSOrganize
temp\DSOrganize\RESOURCES
temp\DSOrganize\RESOURCES\resource0.bin
temp\DSOrganize\PLUGINS\dsoBib.dsp
temp\bib\kjv.bib

Anyways, when I enter the browser of DSO, the directory structure looks like this:
\bib
\bib\kjv.bib
\DSOrganize
\DSOrganize\resource0.bin

I'm building this in Windows, maybe that's the problem *sigh*

UPDATE2: Also, I don't get that error anymore. When I remove the bib directory, the error returns. The file the error says it has a problem with is the resource0.bin file. Strange...

#124272 - sirpoonga - Wed Apr 04, 2007 7:22 pm

Does fat12 have naming restrictions?

#124279 - tepples - Wed Apr 04, 2007 9:08 pm

The only difference among FAT12, FAT16, and FAT32 is the number of clusters on the disk (<4000, 4100-65500, or 65600+). File and folder name restrictions don't depend on the number of clusters on the disk. They depend only on whether the operating system vendor has licensed the VFAT patents from Microsoft (in jurisdictions that grant patents on algorithms).
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#124320 - HyperHacker - Thu Apr 05, 2007 2:27 am

Isn't FAT16 (and I would imagine FAT12) limited to 255 file entries in the root directory? (And since long file names use multiple entries, that can be less than 255 files.) I found that with my MP3 player, formatted as FAT32 I could fill it right up (and it was faster too :D).
_________________
I'm a PSP hacker now, but I still <3 DS.

#124332 - tepples - Thu Apr 05, 2007 3:56 am

HyperHacker wrote:
Isn't FAT16 (and I would imagine FAT12) limited to 255 file entries in the root directory?

What root directory? I thought homebrew programs were supposed to store their Application Data in the /data folder.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#124479 - HyperHacker - Fri Apr 06, 2007 6:16 am

I'm just saying there are some restrictions in FAT16 that aren't there in FAT32. At least, that's what I was told, and it seemed to be true in my case.
_________________
I'm a PSP hacker now, but I still <3 DS.

#124727 - dantheman - Sun Apr 08, 2007 12:25 am

If it helps at all, I've found that adding a few random files to the new "root" of the image makes it work correctly if the homebrew you are using relies on only a specific folder being present. For instance, if I'm using SNEmulDS and simply put my "SNES" folder in the folder specified in build.bat, it will fail. If I add a few files so that the root directory has file1.abc and file2.abc and the "SNES" directory, it works.

To help clarify, if I have this directory structure:

fcsrimage
--fcsr
----snes
------game1.smc
------game2.smc
--build.bat
--other building files

And type
Code:
build.bat image.img fcsr

and continue the rest of the process for creating a DLDI patched file, it fails.

If I have this directory structure:

fcsrimage
--fcsr
----snes
------game1.smc
------game2.smc
----random1.file
----random2.file
--build.bat
--other building files

And type the same command, SNEmulDS recognizes the filesystem and shows the list of games.

Granted, this is using an older version of SNEmulDS that doesn't require the snemul.cfg file to be in the root directory. I'm guessing that the newer versions would work fine as a result, but I have not tested it.