Author Topic: Metroid Fusion - Suit Color Palette Explained  (Read 13031 times)

0 Members and 1 Guest are viewing this topic.

Offline deathfun

  • 210
  • Hey man. Peace. *Car hits them* Frakking hippies
Re: Metroid Fusion - Suit Color Palette Explained
I was under the impression GBA was 32bit, not 16
"No"

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Metroid Fusion - Suit Color Palette Explained
thats probibly architecture, not graphics engine. even in modern games and hardware still use 16 bit textures. did you honestly think that dxt* textures were 24/32 bit? its 32 bit cause its running a 32-bit arm processor. reguardless of the cpu with a machine with limited resources, 16 mhz arm7, 128k vram and 256k wram. not a whole lot to work with, so youre not going to waste it on 24 bit gfx. on top of that i very much doubt the screen is 24 bit either, 12 or 16 bit is more probable. at 16 bit and a screen resolution of 240*160, you are using up 115200 bytes of ram which fits nicely into the vram, but doesnt allow space for a dual buffer. this is still workable however.

that said:

Quote from: wikipedia
The technical specifications of the original Game Boy Advance are, as provided by Nintendo:[5]
Length:    approximately 14.45 cm (5.69 in)
Width:    approximately 2.45 cm (0.96 in)
Height:    approximately 8.2 cm (3.2 in)
Mass:    approximately 140 g (4.9 oz)
Screen:    2.9 inches reflective thin-film transistor (TFT) color LCD
Power:    2 AA batteries
Battery life:    approximately 15 hours on average while playing Game Boy Advance games (also dependent on the Game Pak being played and the volume setting)[6]
CPU:    16.8 MHz 32-bit ARM7TDMI with embedded memory
Memory:    32 kilobyte + 96 kilobyte VRAM (internal to the CPU), 256 kilobyte WRAM (outside the CPU).
Resolution:    240 × 160 pixels (3:2 aspect ratio)
Color support:    15-bit RGB (16-bit color space using 5 bits depth per channel), capable of displaying 512 simultaneous colors in "character mode" and 32,768 (215) simultaneous colors in "bitmap mode"
Sound:    Dual 8-bit DAC for stereo sound (called Direct Sound), plus all legacy channels from Gameboy. The new DACs can be used to play back streams of wave data, or can be used to output multiple wave samples processed/mixed in software by the CPU.

this would indicate 15 bit color, where one bit is probibly reserved for sprite alpha. "character mode" is actually a way to compress backgrounds (very similar to how dxt* works), using tiny cells called characters where each one has a small pallet (usually 4 or 8 colors), which in turn are just references to entries in what seems like a 9 bit color table. so that the individual pixels only take up a couple of bits. this was the norm of how things worked in the 8 and 16 bit eras. bitmap mode is sprites, and so you need a transparency bit, so that bitmaps can be blitted correctly. when you deal with these tight architectures it comes down to the bits.

so even if the game system says 32 bits on it, it probibly just has a 32 bit cpu or gpu. do we forget the lessons learned durring the bit wars so easily? bits dont matter. case in point you can take an arduino and a gameduino and have amazing graphics while still staying in the 8 bit realm (seriously watch the graphics demos there, they are pretty awesome for 8 bit). its not the number of bits, its what you do with them that matters (and also the speed of your cpu clock and number of processors/cores/gpus you have).
« Last Edit: January 07, 2012, 06:43:31 pm by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Mongoose

  • Rikki-Tikki-Tavi
  • Global Moderator
  • 212
  • This brain for rent.
    • Steam
    • Something
Re: Metroid Fusion - Suit Color Palette Explained
I'll go ahead and point out, not for the first time, that FlamingCobra would be far better served posting on a forum that actually covers GBA ROM-hacking. :p

 

Offline deathfun

  • 210
  • Hey man. Peace. *Car hits them* Frakking hippies
Re: Metroid Fusion - Suit Color Palette Explained
@Nuke: I was referring to colour...
But no, that does clarify that. I am now aware
"No"

 

Offline FlamingCobra

  • An Experiment In Weaponised Annoyance
  • 28
Re: Metroid Fusion - Suit Color Palette Explained
its probably 16 bit color, like 5'6'5. 4 hex digits = 2 bytes.

you need to right shift the value 11 places to get the first channel
then rightshift 5 places and mask it (logical and) with 3f to get the second channel
third channel just requires masking with 1f (again logical and)

the reason the second digit looks brown is because its sharing some bits with both the 3rd channel (red) and the second (green). not sure about the endianness here , but the last digit contains the 4 least significant bits for red, while the second to last has a red most significant bit, and the 3 lsbs of green (the other 3 being in the second digit wit one of the blue bits). all signs point to 16 bit.

that assuming 5'6'5, some archaic implementations use a bit for alpha. it could be 1'5'5'5 or 5'5'5'1. this was common on sprite engines. the bit could also be completely ignored. these are the things you lear when you build a video card from scratch using 74xx series logic chips and some microcontrollers and srams.
Hang on, I'm trying to process this.

You're saying that the same results would be achieved if I used a hex editor to change the color palette? The game does color values the same way codebreaker does and codebreaker works by temporarily changing in-game data? This is what I believed at first but then I began to doubt it because Super Metroid does colors as hex triplets. I realize they are two different games on two different consoles that have different architectures.

you lost me when you started talking about shifting values, places, channels, and "logical and." Oh, and "masking it" oh and the apostrophe thingies

EDIT: Alright. Channel = RED GREEN BLUE

You're also saying that Digit 3 is not a "channel" in itself but it just overlaps with red and green.

I'm kind of a visual learner. Could you give examples?

Here's a yahoo article on it. http://answers.yahoo.com/question/index?qid=20090320085915AAVjZKk

but that doesn't really tell me anything.
« Last Edit: January 08, 2012, 12:24:28 pm by FlamingCobra »

 

Offline FireSpawn

  • 29
  • Lives in GenDisc
Re: Metroid Fusion - Suit Color Palette Explained
I love it when you guys talk coding......Do some more.
If you hit it and it bleeds, you can kill it. If you hit it and it doesn't bleed...You are obviously not hitting hard enough.

Greatest Pirate in all the Beach System.

Peace is a lie, there is only passion.
Through passion, I gain strength.
Through strength, I gain power.
Through power, I gain victory.
Through victory, my chains are broken.
The Force shall free me.

 
Re: Metroid Fusion - Suit Color Palette Explained
Hexadecimal is confusing you.   Stop using it for now, and look at the raw binary.


0000000000000000 to 1111111111111111



Now, of those 15 binary digits, there are 5 for each red, green and blue, plus 1 that says transparent.  Lets group them.  It's either

00000-00000-00000-0
Blue - Green - Red - Transparent


So, if I want bright blue that's not transparent, I want the number to be 11111-00000-00000-0.

If we remove the dashes, that becomes 1111100000000000.   We can convert that to hex easily, it becomes F800.




Now, there is one gotcha you need to know about - These numbers are clearly Little Endian based on what you've told us.  That means the rightmost digit is the largest one, not the smallest one.  You'll need to reverse the digits of the binary 5 sets before you put in your values.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Metroid Fusion - Suit Color Palette Explained
if youre on windows 7 play with calculator in programmer mode, very useful tool for this kinda work. makes it easy to do hex<->bin<->dec conversions, and gives you bitwise operations (such as logical and and shift operations). endianness is a huge point of confusion. so if you have bits that arent doing what you want them to do, flip your bytes.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Steam
Re: Metroid Fusion - Suit Color Palette Explained
There are also only 10 people who understand trinary
those that do, those that dont and those who get if confused with binary

I'd like to know what each value would mean in a if statement? Yes/No/Maybe ?
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 
Re: Metroid Fusion - Suit Color Palette Explained
0, 1 or 2.  Any meaning beyond that is solely a creation of a troubled mind.

  
Re: Metroid Fusion - Suit Color Palette Explained
:D this is great! you did a good job! i'll be using this to make some new suprise suits for my videos... :)