Next Generation Emulation banner

1 - 3 of 3 Posts

·
Registered
Joined
·
1 Posts
Discussion Starter #1
I've tried to decode the following bitmap using the background pallete scheme described at http://imrannazar.com/GameBoy-Emulation-in-JavaScript:-Graphics

CE ED 66 66 CC 0D 00 0B 03 73 00 83 00 0C 00 0D 00 08 11 1F 88 89 00 0E DC CC 6E E6 DD DD D9 99 BB BB 67 63 6E 0E EC CC DD DC 99 9F BB B9 33 3E

source: http://gbdev.gg8.se/wiki/articles/The_Cartridge_Header#0104-0133_-_Nintendo_Logo

But I only got something that resembles a noise.

In what direction should I go? Is it using compression? I can't find more information about this dump in the internet.

Best so far:

[FONT=Trebuchet MS, Helvetica, Arial, sans-serif]0
[FONT=Trebuchet MS, Helvetica, Arial, sans-serif]down vote[/FONT]
[FONT=Trebuchet MS, Helvetica, Arial, sans-serif]favorite[/FONT]
[FONT=Trebuchet MS, Helvetica, Arial, sans-serif]I've tried to decode the following bitmap using the background pallete scheme described athttp://imrannazar.com/GameBoy-Emulation-in-JavaScript:-Graphics[/FONT]
[FONT=Trebuchet MS, Helvetica, Arial, sans-serif]CE ED 66 66 CC 0D 00 0B 03 73 00 83 00 0C 00 0D 00 08 11 1F 88 89 00 0E DC CC 6E E6 DD DD D9 99 BB BB 67 63 6E 0E EC CC DD DC 99 9F BB B9 33 3E[/FONT]​
[FONT=Trebuchet MS, Helvetica, Arial, sans-serif]source: http://gbdev.gg8.se/wiki/articles/The_Cartridge_Header#0104-0133_-_Nintendo_Logo
But I only got something that resembles a noise.
In what direction should I go? Is it using compression? I can't find more information about this dump in the internet.
Best so far:
[/FONT]
[/FONT]
 

·
Registered
Joined
·
3 Posts
You did the decoding almost right. I can't really tell if you did the pixel unpacking correctlty, because you cropped the image to some weird size (19/20 pixels per pixel?). Anyway, you seem to expect a linear bitmap. However, this is tile data, so you have to arrange the parts in grids of 8x8 pixels (2bpp, unpacked, upsized) or 4x4 pixels (1bpp, packed) accordingly.



The logo is compressed to save space. It's 1bpp data which is scaled by 0.5 horizontally and vertically. So in order to decode:

Code:
foreach uint8_t d in logo_data

   // unpack horizontal data,
   // i.e. double each bit
   uint16_t hor_unpacked = 0x00u
   foreach uint1_t b in d (b7 --> b0)
     hor_unpacked <<= 1;
     hor_unpacked |= b;
     hor_unpacked <<= 1;
     hor_unpacked |= b;
   end
 
   // unpack vertical data and upscale to 2 bpp
   destination++ = (hor_unpacked >> 8) & 0xFFu;
   destination++ = 0x00u;
   destination++ = (hor_unpacked >> 8) & 0xFFu;
   destination++ = 0x00u;
 
   destination++ = hor_unpacked & 0xFFu;
   destination++ = 0x00u;
   destination++ = hor_unpacked & 0xFFu;
   destination++ = 0x00u;
end
cYa,

Tauwasser
 
1 - 3 of 3 Posts
Top