Skeetendo

’Cause all games were better on the GBC

You are not logged in.

  • Index
  • → Help/Question
  • → 4 standard R/B Colors and Bytes: White, light shade, dark shade, black

#1 2012-11-18 06:40:18

SinisterHoodedFigure
Member
Registered: 2011-12-09
Post 11/66

4 standard R/B Colors and Bytes: White, light shade, dark shade, black

Does anyone know precisely how many bytes each standard color from Pokemon Red/Blue would take? In terms of either paint or compressed images? For the sake of making some new sprites take a bit less space in the rom.


Crystal Kaizo...
Not the hardest hack, but probably the most... Sinister
http://www.mediafire.com/download/q3o60 … +Kaizo.ips

Offline

#2 2012-11-18 14:13:19

Tauwasser
Member
Registered: 2010-10-16
Post 322/447

Re: 4 standard R/B Colors and Bytes: White, light shade, dark shade, black

Well, what do you mean exactly?

The Gameboy exclusively knows 2bpp graphics. However, the original DMG will allow you to switch which indices correspond to which shades for BG, OBJ0 and OBJ1, see FF47, FF48 and FF49 register descriptions.
In terms of CGB colors, you would have two bytes per palette entry per used palette. Same with SGB colors, but they are transferred in bulk, so you will have to transfer more than one.

If you're concerned about sprite size, don't be. The graphics are indexed always the same, with every image that has the same dimensions taking up the same space. However, compression will lead to different results and will yield best results if you have continuous runs of either 0 or 1-bits vertically in either (or both) of the color index planes. That means using a lot of the same color in a row in a column (nor pun intended :) ).

cYa,

Tauwasser

Offline

#3 2012-11-18 17:54:33

SinisterHoodedFigure
Member
Registered: 2011-12-09
Post 12/66

Re: 4 standard R/B Colors and Bytes: White, light shade, dark shade, black

The 4 colors based on 2bpp graphics, and I noticed a vague pattern with the some byte sizes and some colors. White appears to have the lowest amount of bytes, but the other colors like black don't seem to have a consistant byte size compared to the light shade and dark shade.

Say for example, I have this nice detailed gold sprite of machamp, and I want to replace the original rb machamp sprite with the new compressed byte data. The rb machamp sprite takes up 0x1F9 spaces (or 505 bytes). However, the new sprite takes about 260 spaces (or 608 bytes), so it cannot fit in the original space, and I'm forced to repoint to elsewhere within its bank. Sadly I can't seem to find within machamp's original bank a sufficient amount of space to fit that sprite so that I could repoint it there.

I was hoping to lower the byte size by changing certain colors, and because of some other sprites, I'm not sure which colors change the amount of bytes. I only got one guess of the amount of bytes from least to greatest based on previous analysis:  white, black, light shade, and dark shade, but I can't confirm if its true.


Crystal Kaizo...
Not the hardest hack, but probably the most... Sinister
http://www.mediafire.com/download/q3o60 … +Kaizo.ips

Offline

#4 2012-11-18 21:03:12

Tauwasser
Member
Registered: 2010-10-16
Post 323/447

Re: 4 standard R/B Colors and Bytes: White, light shade, dark shade, black

You will want to have continuous vertical runs of the same color (this is the best option) or have runs of white and the same shade or black and the same shade (both options will cost more in one of the planes).
However, I don't think tweaking this by hand will get you very far. Just repoint it to some other bank and move on.

cYa,

Tauwasser

Offline

  • Index
  • → Help/Question
  • → 4 standard R/B Colors and Bytes: White, light shade, dark shade, black

Board footer

Powered by FluxBB