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 Misc > Reading NDS Rom banner

#164006 - viniciusfs - Sat Oct 18, 2008 4:56 am

Hi,

I'm a newbie programmer trying to make a rom manager just to improve my coding skill. I want read NDS Rom banner info, and convert pixel and palette data to any image format like PNG or GIF. I don't have docs about how pixel data are stored, anyone can help me providing tips or documentation?

Thanks!

#164022 - tepples - Sat Oct 18, 2008 10:51 pm

The best answer depends on how much you know already. Do you know how tile graphics work on most 2D game consoles? Or do you know how "text mode", which was common during the MS-DOS era, works on a PC?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#164032 - viniciusfs - Sun Oct 19, 2008 12:27 am

I'm new to graphics programming, so I don't know how tile graphics work. When you say 'text mode', do you mean 'writing pixel information direct to framebuffer'?

#164039 - tepples - Sun Oct 19, 2008 2:55 am

Most 2D game consoles and 8-bit home computers have at least one display mode that treats the screen as a grid of cells, large enough to hold one character. This is called text mode. (The first popular home computer without a text mode was Macintosh, in 1984.) But despite it being called "text mode", it was still popular to draw simple graphics by cleverly arranging glyphs; these are called ASCII art. If you replace half the in the computer's font with dingbats representing pieces of objects, you can draw more sophisticated graphics.

You might understand better if you read through TONC, at least up through chapter 9.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#164428 - viniciusfs - Sat Nov 01, 2008 5:56 am

I think I was not clear.

I just want to export this data [1] (bitmap and palette data) from DS rom file to a PNG image. I'm never worked with images formats before. Maybe anyone on DS scene can give details about format used to store game icon on DS rom and how convert it into something useful.

[1] http://nocash.emubase.de/gbatek.htm#dscartridgeicontitle

#164443 - DiscoStew - Sat Nov 01, 2008 10:05 pm

What tepples is trying to tell you is how text mode works, which the NDS banner pulls from more or less, though I'd point out that the banner is more like working with just the tile cels used for a text mode than the actual text mode itself.

Basically, you've got tile cels, which are small unique square pictures of equal width/height (8x8 in this case), aligned in a row from left to right, and top to bottom. Within each "cel" are pixels that are also aligned in a row from left to right, and top to bottom. Depending on the pixel format, it could be direct color values, it could be paletted (which the NDS banner uses), or other formats. For the NDS banner, each byte represents 2 pixels, indexed to the palette (which is why you see 4x8 bytes, even though the tile cel is 8x8 pixels) being only 4-bits each (0-15).
_________________
DS - It's all about DiscoStew