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 > Is live DLDI patching on the DS feasible?

#132698 - TheMikaus - Thu Jun 28, 2007 7:54 pm

I know there are devices that prepatch the roms before they run them. I was wondering if it would be feasible to sort of store multiple dldi drivers in your program and when it first boots up have the user select which one to use and have it patch itself in memory to use the device.

Example idea. Is having a custom firmware on the DS that stores maybe three different DLDIs (that way if a person has multiple cards they don't have to reflash to use it) and when the DS boots up it lets the user select which one to use so that it can browse the card.

I would think it's feasible. I'm just wondering if every one else thinks so.

#132702 - Rajveer - Thu Jun 28, 2007 9:18 pm

If you flash the application with one DLDI driver, would it work with another cart if you reflashed it with the second carts DLDI driver?

Also, in your example, why would you not just store a copy of the application on each cart?

#132712 - TheMikaus - Thu Jun 28, 2007 9:44 pm

My example is more for firmware. So the firmware would boot and say the person owned a GBAMP, and an R4. So the firmware could contain the DLDI for both the GBAMP and R4 and the user could basically hotswap the DLDI depending on if they wanted to browse the GBAMP or the R4 also this could allow the firmware to autopatch the nds files before loading (one less step for the end user).

But in general you are correct you could just have everything prepatched for your one card.

#132723 - Lynx - Thu Jun 28, 2007 10:38 pm

I think a good question would be.. Is there room for DLDI drivers in the firmware at all?
_________________
NDS Homebrew Roms & Reviews

#132737 - tepples - Fri Jun 29, 2007 12:53 am

If you don't care about PictoChat and DS Download Play client, you can make a full custom firmware such as FWNITRO.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#132741 - HyperHacker - Fri Jun 29, 2007 1:38 am

Yes, but you only have 256K, and the patches can be up to 32K. I do like the idea, though, since it'd allow you to use Rebootlib to load a .nds file from the card without having to go through its menus and splash screens. (_BOOT_MP.NDS on any card.)
_________________
I'm a PSP hacker now, but I still <3 DS.

#132743 - tepples - Fri Jun 29, 2007 2:06 am

HyperHacker wrote:
Yes, but you only have 256K, and the patches can be up to 32K.

The DLDI patches are up to 32 KiB because the SmartMedia driver used by G6 Flash needs a 16 KiB lookup table. Most drivers aren't nearly that big, and RLE compression can take care of that.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#132760 - Ant6n - Fri Jun 29, 2007 5:05 am

so theoretically its possible to "patch" a firmware that then patches every .nds as needed; as oppossed to having to patch every .nds oneself?

#132776 - JLsoft - Fri Jun 29, 2007 7:49 am

Rajveer wrote:
If you flash the application with one DLDI driver, would it work with another cart if you reflashed it with the second carts DLDI driver?


Late reply, but yeah, you can re-DLDI-patch stuff that's been patched for something else no problem. It didn't used to work, but that was because of an old old version of dlditool...works fine now.

#132952 - Dood77 - Mon Jul 02, 2007 12:35 am

Without going for the whole custom firmware thing... why not have your preferred driver in a certain place on your card, and make a code library that accesses this driver and patches itself?
_________________
If I use a term wrong or something then feel free to correct, I?m not much of a programmer.

Original DS Phat obtained on day of release + flashme v7
Supercard: miniSD, Kingston 1GB, Kingston 2GB
Ralink chipset PCI NIC

#132955 - DragonMinded - Mon Jul 02, 2007 2:08 am

Because you would need the preferred driver to access the card...
_________________
Enter the mind of the dragon.

http://dragonminded.blogspot.com

Seriously guys, how hard is it to simply TRY something yourself?

#132959 - Ant6n - Mon Jul 02, 2007 3:25 am

except if that life updater is dldi patched

#132995 - wintermute - Mon Jul 02, 2007 2:20 pm

Ant6n wrote:
except if that life updater is dldi patched


Then what's the point of storing the dldi on the card?
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#133016 - Ant6n - Mon Jul 02, 2007 6:12 pm

well, if there is one program, like an nds loader that is dldi patched, which has the the ability to patch other .nds files, than that would that ... emm, i mean, that would be cool.. just dreamin' here

#133022 - DragonMinded - Mon Jul 02, 2007 7:39 pm

Kinda like how dso already does?
_________________
Enter the mind of the dragon.

http://dragonminded.blogspot.com

Seriously guys, how hard is it to simply TRY something yourself?

#133034 - TheMikaus - Mon Jul 02, 2007 9:15 pm

Well. My original intention was for a firmware replacement that would be able to browse multiple types of homebrew devices. So if you had a different device than your friend you could just have the firmware store the drivers for both and when it loads, you select the one you want to use (maybe even have automatic detection) and then it would patch itself in memory to use the correct DLDI. Patching the rom before loading would be optional and maybe unnecessary, but I think it would be useful.

Not that I'm going to work on it anytime soon, I was just curious.

#133047 - Dood77 - Mon Jul 02, 2007 10:19 pm

Wow, you guys are right. What a paradox :P
So I like the original idea of having all the patches in the .nds and being able to select which patch you want, granted it doesn't bloat the program too much.

DM, do you mean for the homebrew database? Or is there some other way to patch binaries that I'm just missing? It would be nice to DLDI patch within the file browser, is it possible to access whatever functions you use for this from the plug-in architecture?
_________________
If I use a term wrong or something then feel free to correct, I?m not much of a programmer.

Original DS Phat obtained on day of release + flashme v7
Supercard: miniSD, Kingston 1GB, Kingston 2GB
Ralink chipset PCI NIC

#133057 - HyperHacker - Mon Jul 02, 2007 11:18 pm

I think it auto-patches in memory as it's loading a program.
_________________
I'm a PSP hacker now, but I still <3 DS.

#133151 - tepples - Tue Jul 03, 2007 8:44 pm

wintermute wrote:
Ant6n wrote:
except if that life updater is dldi patched

Then what's the point of storing the dldi on the card?

To patch .nds files for other card models. For instance, a family might own a SuperCard SD, an R4, and a Games 'n' Music. (My family does.) All three can use microSD cards (the first through the SD adapter bundled with most microSD cards). The first two currently have DLDI drivers, and the last may have one by the end of the month.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#133154 - TheMikaus - Tue Jul 03, 2007 9:17 pm

Is there a way to tell what's plugged into the slots? Like which device the user has plugged in?

(posted here since this sort of goes along the same idea I was talking about earlier)

#133176 - ghOst - Tue Jul 03, 2007 10:47 pm

You can detect the name of the cardridge http://www.bottledlight.com/ds/index.php/Main/FileFormats

CycloDS evolution ( Slot-1 Card ) use dldi autopatching

#133178 - Dood77 - Tue Jul 03, 2007 11:05 pm

HyperHacker wrote:
I think it auto-patches in memory as it's loading a program.

Which boot methods do this? And which dldi does it use for my Supercard miniSD, the normal one, or the alternate moonshell code? One of my SD cards only works with scsd_moon.dldi.
_________________
If I use a term wrong or something then feel free to correct, I?m not much of a programmer.

Original DS Phat obtained on day of release + flashme v7
Supercard: miniSD, Kingston 1GB, Kingston 2GB
Ralink chipset PCI NIC

#133188 - Lick - Tue Jul 03, 2007 11:54 pm

Dood77 wrote:
HyperHacker wrote:
I think it auto-patches in memory as it's loading a program.

Which boot methods do this? And which dldi does it use for my Supercard miniSD, the normal one, or the alternate moonshell code? One of my SD cards only works with scsd_moon.dldi.

I believe it takes the DLDI patch from DSO and applies it on the booted program. Chishm's bootstub does this, although I'm not sure if DSO uses the same one!
_________________
http://licklick.wordpress.com