#155104 - yellowstar - Fri Apr 25, 2008 1:16 am
Does anybody know of a PC program that can view an .nds banner, icon, and description?
#155219 - Filb - Sat Apr 26, 2008 7:29 pm
Yes. "NDS Header Tool" can do that.
But it's only for reading them, not writing.
Screenshot: http://a.imagehost.org/0198/sample.png
Download: http://uploaded.to/?id=yknfb6
#155233 - yellowstar - Sat Apr 26, 2008 11:56 pm
It doesn't work. It won't work with the nds assembled by my wmb assembler. It works with homebrew .nds that don't even have a icon however. Suggested apps need to work with those .nds, as that's why I'm asking for such an app.
All I want is a program that can view the banner, with as a bare minim, the icon and description. A long time ago, I remember downloading a bunch of apps like this long ago. Unfortunately, I don't have them anymore. )-:
#155236 - Filb - Sun Apr 27, 2008 12:30 am
That sample screenshot *is* a captured DS Download Play nds file. Maybe your files aren't correctly assembled?
I don't know any other programs, sorry.
#157215 - Filb - Tue May 20, 2008 3:53 pm
Does anyone know how to read this data (icon, title, description) from a .nds/.srl file in PHP (or another langauge)?
I'm still a beginner at programming binary stuff. I looked at the raw data but don't know where to start.
How do I convert a 512 byte raw icon (and its palette) into... for example a BMP?
(How do I read the bytes and merge them with the 32 byte palette?)
Example icon and palette: http://uploaded.to/?id=tkmgcb
#157242 - yellowstar - Wed May 21, 2008 12:32 am
davr, the author of this web site, knows how to do that.(Displaying .nds banners in php)
I don't know php, but the general idea would be to first grab the banner data. Read the 4-byte integer at pos 0x68 in the header, then read the 1328-byte banner, by using the value you read. Next, you mainly need to convert the 16-bit NDS palette, to 32-bit. And once that's done, you need to convert the image from tiled, to linear. After that, you just need to convert to bmp.
#157255 - Filb - Wed May 21, 2008 6:21 am
I understood how to find the offset, but I wonder how to convert palettes from 16- to 32-bit and how to convert a tiled image to a linear one, etc.
Is there any good document or tutorial?
#157263 - tepples - Wed May 21, 2008 1:19 pm
Filb wrote: |
I understood how to find the offset, but I wonder how to convert palettes from 16- to 32-bit and how to convert a tiled image to a linear one, etc.
Is there any good document or tutorial? |
GBATEK should explain how all the image and color formats on the GBA and DS work.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#157290 - yellowstar - Wed May 21, 2008 8:26 pm
There's code in this topic for 16-bit to 32/24-bit conversions.(TGA can have alpha, BMP can't, but there's reserved field in BMP colors which makes the size 32-bit. So it's really 24-bit.)
For tiled-to-linear:
Well, I wrote code to draw to tiled backgrounds, as if they were linear extended rotation bgs. But, the images were distorted, so I'm not going to post my code. But, I'll share the general idea:
The first 8 bytes/pixels on the icon is the first 8 pixels in the image. However, the next 8 are the pixels directly below them. And the next ones are below the previous ones, and so on. However, once we hit 8x8 pixels, the next 8 are next to the top of the first tile, to the right, with the same deal as before. And this pattern keeps on repeating.
While linear, every pixel is to the right of the previous one. But, when we go off of the screen, and are out of bg width bounds, the pixels are rendered one scanline below. And that keeps repeating.
What to do?
Well, the athrogram goes something like this:
Go through every tile (1024 8x8 tiles in a 32x32 icon I think)
{
Keep track of positions. Calculate the x pos. I do this by setting x to zero before this code, and by incrementing it by 8 after the line code. I then increment the y variable if the x exceeds 32, and setting x to zero when that happens.
Go through every line in the tile
{
copy the data based on x, and y + line
}
}
#157459 - Filb - Sun May 25, 2008 12:31 am
I'm still working on the palette etc.
How do I find out if an icon has a transparent color?
And if so, how do I find out which one it is?
#157471 - strager - Sun May 25, 2008 4:26 am
Filb wrote: |
I'm still working on the palette etc.
How do I find out if an icon has a transparent color?
And if so, how do I find out which one it is? |
According to GBATek:
GBATek wrote: |
Color 0 is transparent, so the 1st palette entry is ignored |
#157487 - Filb - Sun May 25, 2008 5:01 pm
Thanks for your help.
It works now.