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 > Could there be a dldi patch for DS emulators on PC?

#126358 - thundrestrike - Sun Apr 22, 2007 4:21 pm

Would it be possible to create a DLDI patch for some DS emulators on PC? Because then, it would be possible to run programs such as VGMDS on the emulator!

Is this a dream, or is it possible?
_________________
popcorn

#126365 - tepples - Sun Apr 22, 2007 5:59 pm

I think the patch you need is FCSR, which is similar to GBFS in that it puts the file system in GBA ROM space.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#126369 - ps2aich - Sun Apr 22, 2007 6:38 pm

tepples wrote:
I think the patch you need is FCSR, which is similar to GBFS in that it puts the file system in GBA ROM space.


I think he means something like emulator specific custom SWIs or similar
to 'breakout' the NDS sandbox and write to a sort of flash card image on
the PC.

Does Desmume provide custom SWI's?

#126372 - HyperHacker - Sun Apr 22, 2007 6:51 pm

What would probably be best is a plugin system, where you select a plugin for your slot-2 card. Whenever memory access is made to slot-2 the plugin handles it, so it could e.g. emulate a GBAMP or M3 or what have you. However, more important things are necessary in the field of DS emulation right now.

Currently FCSR is the only system I know of. I wonder if Nitro FAT could be used? Surely the emulators support that.
_________________
I'm a PSP hacker now, but I still <3 DS.

#126374 - tepples - Sun Apr 22, 2007 6:55 pm

Those wouldn't be needed. An emulator would just have to emulate an ATA adapter in SLOT-2, and the MMD or GBAMP CF interface would work. But then, it might be hard to load files on and off this disk image because unlike Linux (losetup), Mac OS X (DiskImageMounter), and even Mac OS classic (Disk Copy), Windows doesn't come with any sort of loopback driver that allows mounting of the disk image as a Windows volume between runs of the emulator. There exist third-party loopback drivers such as DAEMON Tools, but the copy authentication of some commercial PC games intentionally interferes with loopback drivers installed on the same machine.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#126376 - ps2aich - Sun Apr 22, 2007 7:03 pm

tepples wrote:
Those wouldn't be needed. An emulator would just have to emulate an ATA adapter in SLOT-2, and the MMD or GBAMP CF interface would work. But then, it might be hard to load files on and off this disk image because unlike Linux (losetup), Mac OS X (DiskImageMounter), and even Mac OS classic (Disk Copy), Windows doesn't come with any sort of loopback driver that allows mounting of the disk image as a Windows volume between runs of the emulator. There exist third-party loopback drivers such as DAEMON Tools, but the copy authentication of some commercial PC games intentionally interferes with loopback drivers installed on the same machine.


I agree with you, I also don't know a solution under Windows to easily
and transparently access a kind of 'FAT' disk image, but the general idea is interesting ....

#126380 - tepples - Sun Apr 22, 2007 7:13 pm

You could put the entire memory card in a USB reader and then translate ATA commands on the emulated hardware into direct sector I/O commands on the real memory card. The program would recognize that fatInitDefault() is being called, lock and unmount the disk using the OS, use sector I/O, and then mount and unlock the disk on fatUnmount() or power off.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#126384 - HyperHacker - Sun Apr 22, 2007 7:31 pm

Just emulating an ATA interface would work, sure, but plugins allow you to emulate nice things like motion sensors, extra RAM, etc. Basically emulating the actual slot-2 cards, rather than just providing a FAT interface.

Either way the disk image is a problem. You could provide a plugin for an imaginary slot-2 card that handles all the file I/O stuff itself at a high level, and a DLDI for it, that would just write things to GBA ROM to e.g. request a byte from a file, and the plugin would retrieve that byte and put it somewhere else in GBA ROM for the DLDI to read back. This way the plugin could use a directory structure on your hard disk instead of a disk image. Direct access to the card would have to fail, though.
_________________
I'm a PSP hacker now, but I still <3 DS.

#126388 - Ant6n - Sun Apr 22, 2007 7:44 pm

if there would be a plugin to emulate a certain hardware, maybe it would be possible to specify a directory that the plugin uses for hdd emulation. no need to use an actual drive image.

#126389 - tepples - Sun Apr 22, 2007 7:48 pm

HyperHacker wrote:
Just emulating an ATA interface would work, sure, but plugins allow you to emulate nice things like motion sensors, extra RAM, etc. Basically emulating the actual slot-2 cards, rather than just providing a FAT interface.

MAX Media Dock is just an ATA interface. As for motion sensors, how many people have a SIXAXIS or a Sidewinder Freestyle Pro?

Quote:
Either way the disk image is a problem. You could provide a plugin for an imaginary slot-2 card that handles all the file I/O stuff itself at a high level, and a DLDI for it

DLDI operates at the level of sectors. If you were to make a plug-in that operates at the level of files, it would need to be another devoptab driver (much like libfat itself) that gets linked into the program, not a DLDI file.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#126391 - ps2aich - Sun Apr 22, 2007 8:18 pm

tepples wrote:
You could put the entire memory card in a USB reader and then translate ATA commands on the emulated hardware into direct sector I/O commands on the real memory card. The program would recognize that fatInitDefault() is being called, lock and unmount the disk using the OS, use sector I/O, and then mount and unlock the disk on fatUnmount() or power off.


Or you simply implement direct sector wise access on a usb drive (or even a harddisk) in the Emulator-DLDI-Driver
I found this article

#126394 - Moby Disk - Sun Apr 22, 2007 8:43 pm

I asked this question in the DeSmuME forums. It supposedly works, but several people have had trouble. I tried asking in the no$gba forums since that is my favorite emulator, but the forums have vanished and I don't know enough german to ask the sysadmin to fix the link.

My post:
http://forums.desmume.org/viewtopic.php?pid=375

No$GBA:
http://nocash.emubase.de/gba.htm

#126397 - tepples - Sun Apr 22, 2007 9:22 pm

ps2aich wrote:
tepples wrote:
You could put the entire memory card in a USB reader and then translate ATA commands on the emulated hardware into direct sector I/O commands on the real memory card. The program would recognize that fatInitDefault() is being called, lock and unmount the disk using the OS, use sector I/O, and then mount and unlock the disk on fatUnmount() or power off.

Or you simply implement direct sector wise access on a usb drive (or even a harddisk) in the Emulator-DLDI-Driver

That's what I said. The emulator would need some way to detect when the program wants to read or write a sector on the drive, and emulating the ATA interface in the GBAMP or MMD would handle this. In addition, the user would expect to be able to read and write the drive after stopping the program, which is where the lock/mount stuff comes into play.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#126416 - thundrestrike - Mon Apr 23, 2007 3:33 am

yeuh, reading all this gave me a headache...

so is there a patch somewhere to let me use vgmds (that writes and loads files) on a pc emu such as desmume?
_________________
popcorn

#126426 - Lynx - Mon Apr 23, 2007 5:06 am

Well, prior to R20's touchscreen not working on Dualis, it supported GBA MP writing to the hard drive for testing. So I would guess you could have patched for GBA MP and it would have worked on Dualis. I know it worked with Tales of Dagur's saving to disk.
_________________
NDS Homebrew Roms & Reviews

#126430 - HyperHacker - Mon Apr 23, 2007 5:57 am

tepples wrote:
how many people have a SIXAXIS
I'm guessing about 2,909,080. Be a bit silly to buy a PS3 without a controller.
_________________
I'm a PSP hacker now, but I still <3 DS.

#126469 - tepples - Mon Apr 23, 2007 1:36 pm

OK, how many people have a SIXAXIS and a Bluetooth receiver and are willing to use their PC with a DS emulator and DS homebrew that supports the Motion Card?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#126495 - chuckstudios - Mon Apr 23, 2007 9:36 pm

tepples wrote:
OK, how many people have a SIXAXIS and a Bluetooth receiver and are willing to use their PC with a DS emulator and DS homebrew that supports the Motion Card?


I know one person. (not me)

#126535 - HyperHacker - Tue Apr 24, 2007 4:42 am

Who here has a SIXAXIS, Wiimote or other motion-sensitive controller and a Bluetooth adapter?
_________________
I'm a PSP hacker now, but I still <3 DS.

#127448 - masscat - Wed May 02, 2007 3:51 pm

tepples wrote:
Those wouldn't be needed. An emulator would just have to emulate an ATA adapter in SLOT-2, and the MMD or GBAMP CF interface would work. But then, it might be hard to load files on and off this disk image because unlike Linux (losetup), Mac OS X (DiskImageMounter), and even Mac OS classic (Disk Copy), Windows doesn't come with any sort of loopback driver that allows mounting of the disk image as a Windows volume between runs of the emulator. There exist third-party loopback drivers such as DAEMON Tools, but the copy authentication of some commercial PC games intentionally interferes with loopback drivers installed on the same machine.


Saw this thread and thought I would put some test code together for Desmume. More info over on the desmume forums.

#127504 - GPFerror - Thu May 03, 2007 12:47 am

masscat wrote:
tepples wrote:
Those wouldn't be needed. An emulator would just have to emulate an ATA adapter in SLOT-2, and the MMD or GBAMP CF interface would work. But then, it might be hard to load files on and off this disk image because unlike Linux (losetup), Mac OS X (DiskImageMounter), and even Mac OS classic (Disk Copy), Windows doesn't come with any sort of loopback driver that allows mounting of the disk image as a Windows volume between runs of the emulator. There exist third-party loopback drivers such as DAEMON Tools, but the copy authentication of some commercial PC games intentionally interferes with loopback drivers installed on the same machine.


Saw this thread and thought I would put some test code together for Desmume. More info over on the desmume forums.


why not just use FCSR dldi, basically same process but is appended to end of nds/ds.gba and needs FCSR.dldi applied.

#127510 - tepples - Thu May 03, 2007 12:59 am

How hard is it to use FCSR's write support? Specifically, given a ds.gba using FCSR and its corresponding .sav file, how hard is it extract a file that the program has written?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#127547 - GPFerror - Thu May 03, 2007 5:11 am

tepples wrote:
How hard is it to use FCSR's write support? Specifically, given a ds.gba using FCSR and its corresponding .sav file, how hard is it extract a file that the program has written?


Pretty difficult to create an image that can do it, not sure if there exist a program to automate the creation of an image that supports the SRAM part for writing. If there exists one, the fcsr.dldi patcher would need write support added to it.

Troy(GPF)

#127573 - masscat - Thu May 03, 2007 11:05 am

GPFerror wrote:
why not just use FCSR dldi, basically same process but is appended to end of nds/ds.gba and needs FCSR.dldi applied.

The GBAMP emulation is already in Desmume. The release and cvs versions desmume attempts to build a FAT file system from the directory the .nds file is in - no writing support and read sometimes does not work for me using linux. So it was a simple job to implement the disk image read and write functionality.

You can easily share the same disk image when running a number of homebrew programs (no appending to the .nds file).

Also I do not know what FCSR is and how it works on the target :).

#128141 - masscat - Tue May 08, 2007 11:44 pm

I have put together a java application for creating and copying files in and out of a FAT disk image.
Run as:
Code:
java -jar FATimageApp.jar

It is not fully featured (short names only and no delete).

#128155 - GPFerror - Wed May 09, 2007 2:02 am

masscat wrote:
GPFerror wrote:
why not just use FCSR dldi, basically same process but is appended to end of nds/ds.gba and needs FCSR.dldi applied.

The GBAMP emulation is already in Desmume. The release and cvs versions desmume attempts to build a FAT file system from the directory the .nds file is in - no writing support and read sometimes does not work for me using linux. So it was a simple job to implement the disk image read and write functionality.

You can easily share the same disk image when running a number of homebrew programs (no appending to the .nds file).

Also I do not know what FCSR is and how it works on the target :).


here is a thread that explains it pretty well,
http://forum.gbadev.org/viewtopic.php?t=10772&highlight=fcsr
basically its very similiar to the disk image you are creating except it has a added header and optionally an SRAM overlay can be create for write support. Is your disk image readonly? if not then its better then FCSR right now :) except that FCSR images can be run on almost any of the emulators and on hardware as well.

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

#128165 - masscat - Wed May 09, 2007 7:07 am

You can read and write the FAT disk image.

Desmume just read and writes the data to the corresponding sector (512 bytes) as requested through the GBAMP registers.

EDIT: The disk image created by the Java application is just a regular FAT disk image. You can do anything with it that you could any other FAT partition image, for example under Linux you can mount it and then read and write to it.
On the Desmume side the image file can be anything you want as Desmume makes not interpretation of it (just reads and writes). For example it could be a complete disk image with a MBR, a FAT partition and a ext2 partition or some experimental file system. This is the main thing I like about the simple GBAMP emulation approach, Desmume is dumb and therefore flexible and it is up to the NDS software and the disk image building tools to do the clear stuff.

#129031 - tondopie - Fri May 18, 2007 3:41 am

where is the FSCR DLDI driver? I can't find it on chishm's site... I need to test my app's FAT support...
_________________
Development Blog: http://teendev.org
Homebrew Podcast: http://homebrewcast.net
Web Design: http://xtendesign.net

#129033 - dantheman - Fri May 18, 2007 5:01 am

You can find the necessary files on http://gpf.dcemu.co.uk in the "Utilities" section. You'll need to use the .ds.gba version of the homebrew, padbinned to 512 bytes, combined with the image created with build.bat, then patched with fcsr.dldi.

#129101 - tondopie - Fri May 18, 2007 9:53 pm

oh, dang... I can't believe I didn't notice that.... just like the 'S' in gbaScreen....
_________________
Development Blog: http://teendev.org
Homebrew Podcast: http://homebrewcast.net
Web Design: http://xtendesign.net