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 > NDS icons?

#139372 - spinal_cord - Wed Sep 05, 2007 12:16 pm

I have put together a small piece of code to read the icon from a .nds file. The only problem I have right now, is that some .nds files seem not to have icons in them (I just get noise). Is there a way (in code) to tell if a .nds file has an icon or not, so it can be replaced by a default image?
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage

#139383 - Lick - Wed Sep 05, 2007 5:33 pm

In the cartridge header:
Quote:
Header Overview (loaded from ROM Addr 0 to Main RAM 27FFE00h on Power-up)
...
068h 4 Icon_title_offset (0=None) (8000h and up)
...


So try if (*(u32*)0x27FFE68 != 0) {}
_________________
http://licklick.wordpress.com

#139414 - spinal_cord - Wed Sep 05, 2007 11:41 pm

Thanks Lick, I knew it'd be simple.
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage

#139421 - tondopie - Thu Sep 06, 2007 1:06 am

I think I have a nice little C source file sittin' on my FTP that will do the trick and all here:

ftp://ftp.drivehq.com/teendev/nds

#139451 - spinal_cord - Thu Sep 06, 2007 10:06 am

Currently the code I have done, shows a lits of .nds files and their icons using sprites. I am however having a little trouble copying the three lines of title info to some strings to be displayed. Not to worry though, I'll figure out where i've gone wrong. It usually ends up I'm trying to use the wrong size variable, stupid C.
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage

#139519 - josath - Thu Sep 06, 2007 11:50 pm

note that the title is in unicode. you can convert the english titles to ascii pretty easily by skipping every other byte (which are all 0)

#139520 - spinal_cord - Fri Sep 07, 2007 12:17 am

I have it all working in a different project, the icon, palette, and thre lines of text, but i'm not any good with strings in c, I just had the code put the characters on by one on the screen. But I think Ill skip that stage, and just use the .nds filename.
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage

#139533 - HyperHacker - Fri Sep 07, 2007 6:01 am

josath wrote:
note that the title is in unicode. you can convert the english titles to ascii pretty easily by skipping every other byte (which are all 0)
You can do even better by printing a question mark if that byte isn't zero, so foreign names don't show up as garbage.
_________________
I'm a PSP hacker now, but I still <3 DS.

#139536 - spinal_cord - Fri Sep 07, 2007 9:56 am

I'm only reading the english name, is there likely to be foreign info in the english part?
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage

#139547 - tepples - Fri Sep 07, 2007 11:36 am

spinal_cord wrote:
I'm only reading the english name, is there likely to be foreign info in the english part?

Yes. There are tens of thousands of different characters even in the basic multilingual plane of Unicode, and not all of them are used exclusively in languages other than English. For example, the first four miscellaneous symbols are in the DS firmware font, and .nds titles can use these characters. On Wikipedia, see Unicode and UTF-16/UCS-2.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#139575 - spinal_cord - Fri Sep 07, 2007 6:09 pm

I think I'll stick with the filename for now.
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage