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 > Reading from SLOT-1

#145597 - The_Perfection - Sun Nov 18, 2007 8:31 pm

Currently I am working on something that would require me to be able to look into the SLOT-1 card and find the game icon and descriptions.

I have looked into libnds and found a section on cards, but I don't understand how to use the functions and even after leafing through the respective sections in GBATek do not understand the process enough to write my own functions.

Could someone explain to me how to use the card reading functions or how to make some myself?

#145609 - HyperHacker - Mon Nov 19, 2007 12:24 am

You would have to handle the card encryption and protocol yourself. I could give you a link to some code that does it licensed under GPL2, but the moderators here would just assume that you're going to use it for piracy and delete it.
_________________
I'm a PSP hacker now, but I still <3 DS.

#145611 - The_Perfection - Mon Nov 19, 2007 1:19 am

Hmm... well not being able to get the code because everyone is a suspect for piracy is rather annoying, but it's just like the laws of most countries - just because of those that would abuse it those that would use it (and yes, what I stated as my motive is exactly what I plan to do,) can't.

Oh well. Maybe I'll wait until I get my firmware clean enough for a release and then maybe I might be considered credible enough.

#145614 - tepples - Mon Nov 19, 2007 3:20 am

As far as I can tell, moderators have been editing the url out not because the code enables piracy but because the domain it was hosted on (starts with a g and ends with a p) enables piracy.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#145737 - The_Perfection - Wed Nov 21, 2007 5:33 am

Hey, wait a second... I just saw a function that came with hbfirmware that should do the trick. However, it's likely to work only if flashed to the DS, so I'll check that out later.

As a secondary question, is there a way to detect a SLOT-1 card?

#145764 - Lick - Wed Nov 21, 2007 7:32 pm

The_Perfection wrote:
As a secondary question, is there a way to detect a SLOT-1 card?

If you read from the Slot-1 using libnds' functions and there is no card inserted, all data returned will be 0xFFFFFFFF. That's the trick used in NitroHax.
_________________
http://licklick.wordpress.com

#145855 - HyperHacker - Fri Nov 23, 2007 10:15 pm

So now you're just silently deleting my posts? Are we not allowed to correct the moderators?
_________________
I'm a PSP hacker now, but I still <3 DS.

#145888 - The_Perfection - Sat Nov 24, 2007 10:22 pm

Okay, I'll test all that. It should work just fine. (I hope...)

And I did manage to see your post before it was deleted. My sister was quite happy that it linked to some AR codes for Pikmin 2. It's also nice to know that the card reading method will only work if flashed. Thanks!

#145901 - wintermute - Sun Nov 25, 2007 3:28 am

HyperHacker wrote:
So now you're just silently deleting my posts? Are we not allowed to correct the moderators?


Try not giving the address of a piracy supporting/enabling website.

It doesn't matter if it's hyperlinked or not, if it's piracy it doesn't belong here.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#145904 - dualscreenman - Sun Nov 25, 2007 5:20 am

Last time I checked the domain that begins with a K and ends with an x isn't a piracy site.
_________________
dualscreenman wrote:
What about Gaim DS? Gaim pretty much has support for all IM programs.
tepples wrote:
"Goshdammit, the DS is not a Gaim-boy! It's a third pillar!"

#145910 - crediar - Sun Nov 25, 2007 2:18 pm

you can get all the informations you want there gbatek

a better way to detect the card state:
Code:

   unsigned int *header=((void*)0x027FFE00);

   unsigned int c = header[0];

   iprintf("\x1b[2J");

   while(1)
   {
      swiWaitForVBlank();
      scanKeys();

      cardReadHeader(header);

      iprintf("\x1b[2J");

      if(c==0xFFFFFFFF)      //No card
         iprintf("Insert card!");
      else if(c!=header[0])   //card in state 2
         iprintf("Reinsert card!");
      else if(c==header[0])   //card in state 0
         break;

      c = header[0];
   }

#145941 - HyperHacker - Mon Nov 26, 2007 1:01 am

dualscreenman wrote:
Last time I checked the domain that begins with a K and ends with an x isn't a piracy site.
That, and just flat-out deleting posts without any explanation because it refers to what you think is a piracy site seems a bit silly. Whatever happened to "LINK REMOVED"?
_________________
I'm a PSP hacker now, but I still <3 DS.