What's new

Converting RGB5A BNR -> Windows BMP

LI9UID

New member
Hello everybody,
i'm trying to include in my app (made with c#)
a function that will convert my BNR (which ,should be in rgb5a)
into a a bitmap for windows.
There's my problem : i've searched the web for the BNR format
(how colors are packed in the file's bytes) but i couldn't find
anything ( i'm @ 1kb/s with a handphone ... :/ )

i thought that it could be like this : on 2 bytes (16bits) there's
5bits for Red , 5 for Green , 5 for Blue and the last one for Alpha...
i've tested shift operators and the &= operator to get
4bytes(RGB8A8 [bmp?]) with the only 2 ones from the BNR,
but it always gives me black pic with some green stuffs lol.

please help! :(

thanks in advance and sorry sorry sorry for my english
i'm french ....

li9uid

"farewell" lol

-----------------------------------------------------------------------
Hello to coding Gods => Crusader,Costis,Titanik,F|RES
 

Ross L.

Flash Animator
Sounds like fun. How about making it do all kinds of images (instead of that huge and shunned file type)? I wish I could help you out but I haven't the slighest clue where to begin. I wish you the best of luck though.
 

smcd

Active member
I would try www.wotsit.org but it appears it isn't listed (i searched BNR and RGB5a no luck) There is an RGBE file listed, however?


PS - why is this in the Dolphin forum and not Programming?
 

Knuckles

Active member
Moderator
The BNR is only the little banner for each game (what you can see in dolphin/dolwin/ect.). Also, you can already extract them using GC-Tool (get it on dextrose) look by yourself ( attachement)

This thread will be moved too.

Moved
 
OP
LI9UID

LI9UID

New member
thanks for your replys.

Ross.L >> yep , we can say it's fun (even when you get stuck like i am now for this bnr thing...) .
I'm not planning right now to have it converted in other image types,
all i want for the moment is to "decode" (can we say like this lol ?)
this bnr type and convert it in a "simple" image type (like bitmaps :/ )

sethmcdoogle >> well, i've searched a lot and all i can find is how to get the descriptiv text in those gamecube banners (which i allready know ...)
And huh.... i've posted it here because i simply didn't knew that there was a "programming" part in the emutalk forum :p , sorry sorry !!!
it's been a long time since i came here for the last time ( febuary !!).

Knuckles >> i know that i can extract it from some gc iso-tools but
i want to include it in my app (and make a function that everybody could use to easely get the icon in those gcm )

thanks again for your response and sorry again for posting it at the wrong place !! ;p

li9uid
guess i'll have to search more ... :/
 

Cyberman

Moderator
Moderator
What application creates BNR format? Are you sure it's R5G5B5A1?
I've never even heard of it!

Cyb
 

Gorxon

New member
Administrator
Hi,

I am sure you already have this information, but for the people interested:

14.1 BNR (Banner file format)
this is the format of the file 'opening.bnr' (file size: always 6.496 bytes) found in the root directory of every Gamecube disc. This file is the little image that is displayed in the cube menu when inserting a disc into the gamecube, when in menu mode.


start end size Description
0x0000 0x0003 0x0004 Magic Word "BNR1" (US/JP) or 'BNR2' (EU)
0x0004 0x001f padding zeroes
0x0020 0x181f 0x1800 Graphical Data (Pixel-format is RGB5A1)
0x1820 0x183f 0x0020 Gamename (*)
0x1840 0x185f 0x0020 Company/Developer (*)
0x1860 0x189f 0x0040 Full Game Title (*)
0x18a0 0x18df 0x0040 Company/Developer Full name, or description (*)
0x18e0 0x195f 0x0080 Game Description (*)


(*) All Text is all stored in either SHIFT-JIS or ASCII, depending on the region of the Game.

note: In the filesystem of european Games with multi-lingual text there may be several .bnr files (opening.bnr, openingUS.bnr, openingEU.bnr, openingJP.bnr). The opening.bnr is a BNR2 file, it is just like a regular BNR file, except that the metadata at the end repeats several times in different languages. 0x1820 through 0x1960 are the first, and it continues in blocks of 0x0140.

Pasted from the GC linux project: http://www.gc-linux.org/docs/yagcd/chap14.html

As you see the format is indeed RGB5A1. Dunno what that 1 number stands for. And you do remember to extract the data out from the bnr right? :p
Converting the whole .bnr could give strange results I am sure.

I remember trying to convert the data myself, but as I have quite limited knowlegde about it I never got very far. You can try searching and asking at the gcdev forum (http://www.gcdev.com).

Good luck!

-edit-

Found some relevant info:
http://www.gc-linux.org/docs/yagcd/chap15.html#sec15.6
 
Last edited:
OP
LI9UID

LI9UID

New member
thanks a lot Gorxon !

now i'm sure it's rgb5a1
(the "1" after the "A" is for the Bit that defines the color for alpha (transparency) )
i did extract the color data from the bnr in a stream and then worked with,
of course if i worked on the whole file it'll give something strange lol.

i'll ask in gcdev.com for more info.
thanks,
ciao!
 

Top