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 Flash Equipment > supercard lite + libfat

#117230 - _koGi_ - Fri Feb 02, 2007 4:03 pm

Hi

Is it possible to read and write data using chishm's libfat and a supercard lite ?

EDIT: obviously the answer is yes http://chishm.drunkencoders.com/DLDI/

#117237 - Diddl - Fri Feb 02, 2007 6:36 pm

I don't have one, but I'm sure it will

#117250 - _koGi_ - Fri Feb 02, 2007 9:19 pm

Quote:
I don't have one, but I'm sure it will


Sure, but for now it doesn't !!

Here is the code I compiled ;

Code:

         if (fatInitDefault())
   {
      PA_OutputText(1, 0, counter++, "init successful");
   }
   else
   {
      PA_OutputText(1, 0, counter++, "init failed");
   }
   
   FILE* file = fopen ("test.txt","w+");
   PA_OutputText(1, 0, counter++, "fopen() = %d",file);
   char* myTest = "123456";
   int number = fwrite(myTest,sizeof(char),6+1,file);

   int close = fclose(file);
   if(close)
   {
      PA_OutputText(1, 0, counter++, "close successful");
   }
   else
   {
      PA_OutputText(1, 0, counter++, "close failed");
   }
   PA_OutputText(1, 0, counter++, "flag from close = %d",close);


Then I DLDIed the .nds :

Code:

Dynamically Linked Disk Interface patch tool v1.10 by Michael Chisholm (Chishm)

Old driver:          Default (No interface)
New driver:          SuperCard Lite(TransFlash MicroSD)

Position in file:    0x0001E040
Position in memory:  0x02000000
Patch base address:  0xBF800000
Relocation offset:   0x4281DE40

Patched successfully


And finally added the loader for Supercard :

Code:
cat ndsmall.bin NDS_fait_maison.nds > my_NDS_fait_maison.sc.nds


But the program hangs, displaying :

Code:

init successful
fopen() = 34335204


I am using the 20061225 archive of libfat and last summer version of libnds. I think I will install the newest one before coming back here.

#117277 - GrizzlyAdams - Sat Feb 03, 2007 1:52 am

why on earth would you add a .ds.gba header? those havent been needed for months.

#117278 - dantheman - Sat Feb 03, 2007 1:59 am

They are needed if you:
1. Are using a GBA flash cart
2. are using a Supercard, which works best with .ds.gba homebrew renamed to .nds (usually renamed to .sc.nds to avoid confusion)
3. other uses I'm probably forgetting

For my personal experience with a Supercard miniSD, I usually have to use .ds.gba or else it won't run. If the homebrew only comes in .nds format, I usually drag and drop it onto the Supercard Magic Homebrew Patcher, which checks to see if a header is present, adds one if it isn't, and spits out a *.sc.nds file.

#117286 - chishm - Sat Feb 03, 2007 5:29 am

Make sure you use DevkitARM r19b for libfat versions from before this year. For libfat vesions from this year, use DKA r20+.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com

#117385 - _koGi_ - Sun Feb 04, 2007 3:48 pm

With the latest libnds and libfat there is no problem. It works !!