Golden Sun Hacking Community
December 15, 2017, 09:51:30 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
  Home   Forum   DC Wiki Help Search Calendar Downloads Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Palette info  (Read 3829 times)
0 Members and 1 Guest are viewing this topic.
Salanewt
His Sexiness
Mercury Clan

Oh yeah, baby!

Prodigy
*

Coins: 32
Offline Offline

I am: A part of the organization of Cool Cats, but more of a dog person in reality.
Emblems: Have a nice day.
Posts: 4565

« on: December 01, 2009, 07:29:57 PM »

Hello. Lately, I have been wondering how game handle palettes. For example, how does Golden Sun get its colours, and how many bytes are used?

I am only wondering this because Mario and Luigi uses four bytes per colour. I am still working it out for those who are interested (myself included), but a single colour is built like this (still not sure for tilesets, but I am very sure that this is the case). Sprites are also composed of 16 colours, no more.

BR BG

I can only guarantee the second two. Basically, we have Brown, Burgundy (this can be made into red with the first bit), Green, and Blue. I find this a bit confusing, so I was hoping that someone could give me some palette information if other games use similar colour systems, or hopefully even a place to enter byte combinations for colours (since finding the palette that I want is going to be hard just by trial and error). I have noticed that the very first colour might actually be shade? I doubt this, since F0 F0 is purple, not blue (although F0 0F seems to be a light green).

Have a nice day.


By the way, any palette information for hacking games should be acceptable here.
Logged

Oh yeah baby, £ me harder.

Fusion is just a cheap tactic to make weak Adepts stronger.

Yoshi's Lighthouse is a hacking website in progress. Why not check it out if you like Yoshi or the Mario & Luigi games?
View Profile WWW
Atrius
Programmer Extraordinaire
Web Host

Fear my blades

Veteran Member
*

Coins: 1
Offline Offline

Gender: Male
Emblems: Website Founder
Clan Position: Creation God of Sol
Posts: 1756

« Reply #1 on: December 01, 2009, 07:48:43 PM »

2 bytes, all GBA games use the same palette format which is only 2 bytes for each color in a palette.

1 hex value = 4 bits
1 byte = 8 bits
1 byte =  2 hex values

The actual data is formatted as such:

bits 0-4 : Red
bits 5-9 : Green
bits 10-14 : Blue
bit 15: Unused.  (This is why white is represented as 7FFF)

For example:

001F = Red
03E0 = Green
7C00 = Blue

(GBA is little endian, so when you combine two bytes into a single 16-bit value they get reversed)

It can be rather confusing if you don't understand how each bit falls into a hex value.
« Last Edit: December 01, 2009, 07:50:30 PM by Atrius » Logged

I'm shaking my head in general disapproval of everything
View Profile WWW
Salanewt
His Sexiness
Mercury Clan

Oh yeah, baby!

Prodigy
*

Coins: 32
Offline Offline

I am: A part of the organization of Cool Cats, but more of a dog person in reality.
Emblems: Have a nice day.
Posts: 4565

« Reply #2 on: December 01, 2009, 08:07:39 PM »

Thanks again Atrius! I always assumed that half of a byte was a bit, but... Lol. Anyway, thanks for clearing so much up for me! Now, with the knowledge of Palettes at my side, I can slowly work on customizing any character how I want. All GBA games work like this for how their palettes are constructed? Very nice to know.

Have a nice day.

Now to find my spriting scalpel.
Logged

Oh yeah baby, £ me harder.

Fusion is just a cheap tactic to make weak Adepts stronger.

Yoshi's Lighthouse is a hacking website in progress. Why not check it out if you like Yoshi or the Mario & Luigi games?
View Profile WWW
Atrius
Programmer Extraordinaire
Web Host

Fear my blades

Veteran Member
*

Coins: 1
Offline Offline

Gender: Male
Emblems: Website Founder
Clan Position: Creation God of Sol
Posts: 1756

« Reply #3 on: December 01, 2009, 08:25:13 PM »

Computers store data as 1's and 0's.  These are known as bits.

A single hex digit uses 4 bits, or 1's and 0's to store it's value.

bit 0 represents 1
bit 1 represents 2
bit 2 represents 4
bit 3 represents 8

By adding these values in different combinations you can get any number 0 to 15 in decimal, or 0 to F in hexadecimal

Basically, with the bits ordered from right to left as all digits are:

0 = 0000 = 0 = 0
1 = 0001 = 1 = 1
2 = 0010 = 2 = 2
3 = 0011 = 2+1 = 3
4 = 0100 = 4 = 4
5 = 0101 = 4+1 = 5
6 = 0110 = 4+2 = 6
7 = 0111 = 4+2+1 = 7
8 = 1000 = 8 = 8
9 = 1001 = 8+1 = 9
A = 1010 = 8+2 = 10
B = 1011 = 8+2+1 = 11
C = 1100 = 8+4 = 12
D = 1101 = 8+4+1 = 13
E = 1110 = 8+4+2 = 14
F = 1111 = 8+4+2+1 = 15
« Last Edit: December 01, 2009, 08:26:55 PM by Atrius » Logged

I'm shaking my head in general disapproval of everything
View Profile WWW
Salanewt
His Sexiness
Mercury Clan

Oh yeah, baby!

Prodigy
*

Coins: 32
Offline Offline

I am: A part of the organization of Cool Cats, but more of a dog person in reality.
Emblems: Have a nice day.
Posts: 4565

« Reply #4 on: December 01, 2009, 09:59:05 PM »

Yep, must love Binary, right? Well, thanks again! So that is the relationship between HEX and Binary... I wonder if there is a formula to convert Hexadecimal to Decimal without having to use a calculator/spend time thinking of it?

Thank you for all of your help.

Have a nice day.

Oh yes, is there any way that I can test colour values without trial and error, or not? I pretty much have the colours that I want, but I am not sure how to get them with the GBA's method of creating colours.
Logged

Oh yeah baby, £ me harder.

Fusion is just a cheap tactic to make weak Adepts stronger.

Yoshi's Lighthouse is a hacking website in progress. Why not check it out if you like Yoshi or the Mario & Luigi games?
View Profile WWW
Atrius
Programmer Extraordinaire
Web Host

Fear my blades

Veteran Member
*

Coins: 1
Offline Offline

Gender: Male
Emblems: Website Founder
Clan Position: Creation God of Sol
Posts: 1756

« Reply #5 on: December 02, 2009, 03:28:43 AM »

Your RGB values should all be 248 at the the highest.  Take each of them divide them by 8, and round it to the nearest number which should be between 0 and 31, if you use 32 it won't work.

Using windows calculator in scientific, or programmer mode (whichever your version actually has, and allows you to view values in hex) In decimal mode first put in the blue value, multiply by 32, add the green value, multiply by 32 again, and finally add the red value, then switch to hex mode to get your color value.
Logged

I'm shaking my head in general disapproval of everything
View Profile WWW
Salanewt
His Sexiness
Mercury Clan

Oh yeah, baby!

Prodigy
*

Coins: 32
Offline Offline

I am: A part of the organization of Cool Cats, but more of a dog person in reality.
Emblems: Have a nice day.
Posts: 4565

« Reply #6 on: December 02, 2009, 12:43:44 PM »

Wow, thanks again! Wait though, wouldn't I just be able to select the same colours from Golden Sun'a palette? Hm... Hard to say. It does seem that the other colours might work (and people tend to favour the brighter colours in Superstar Saga), but they do not display correctly? Well, it is time to see if the palette that I am using for a "surprise" will work, since the original came from a DS game. One last question for now. Do you know how I can find out the values for the colours that I am using?

Have a nice day.

Edit: If it were for the html based colour system, then I would know, but for the GBA system... I would rather not do trial and error, but I will if I must.
« Last Edit: December 03, 2009, 12:49:36 AM by Salanewt » Logged

Oh yeah baby, £ me harder.

Fusion is just a cheap tactic to make weak Adepts stronger.

Yoshi's Lighthouse is a hacking website in progress. Why not check it out if you like Yoshi or the Mario & Luigi games?
View Profile WWW

Regular Member
**

Coins: 0
Offline Offline

Posts: 195

« Reply #7 on: December 10, 2014, 10:05:49 AM »

Bumping because relevant topic.

How does one convert RGB to a 2-byte hex?

For example, what is the formula that goes into converting 26,9,16 to 413A?
Logged
View Profile
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2394

« Reply #8 on: December 10, 2014, 10:10:33 AM »

Formula?

Valid numbers for each color of RGB go from 0 to 31.
(blue * 0x400) + (green * 0x20) + (red)


In programming, it'd probably be better to do:
(blue << 10) Or (green << 5) Or (red)
« Last Edit: December 10, 2014, 10:15:28 AM by Fox » Logged

Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...
Did you know? In English, you are suppose to capitalize the languages. (e.g. English is a proper noun.) Subjects like math, science, history can be left lower-cased unless they are a title. (Kind of like how you can say either "my mom" or "Mom" in "I went with (X) to the store.", except that I don't think languages are ever lower-cased in English.) In Spanish, both subjects and languages are left lower-cased. (I put this here because I've noticed people make this mistake quite often. And am curious if they know about this, and whether they use their way because they believe this grammar usage should have never been a thing?

Remember kids! In getting a job, it's not about what you know, it's about WHO you know! So start making friends with the people that work where you want to work. :) (Friend of a friend and volunteering count too, so keep that in mind.)[/si
View Profile

Regular Member
**

Coins: 0
Offline Offline

Posts: 195

« Reply #9 on: December 10, 2014, 10:19:01 AM »

Formula?

Valid numbers for each color of RGB go from 0 to 31.
(blue * 0x400) + (green * 0x20) + (red)


In programming, it'd probably be better to do:
(blue << 10) Or (green << 5) Or (red)

I'm not sure how to apply the double "<<" symbol. It's never something I learned in math.


Using windows calculator in scientific, or programmer mode (whichever your version actually has, and allows you to view values in hex) In decimal mode first put in the blue value, multiply by 32, add the green value, multiply by 32 again, and finally add the red value, then switch to hex mode to get your color value.

This seems more up my alley, and now I understand it.

I'll put it into layman's terms for myself:

Atrius saying that each RGB color supported by the GBA can go up to 248.

To convert it to a value usable by the GBA, you must first convert each RGB color by dividing them each by 8. So 248/8 = 31

Then in Windows calculator, in Decimal Mode, you plug in the blue value, multiply by 32, add the green value, multiply by 32 again, then add red value. After, convert to hex. I should get the answer 7FFF.

For me, the formula would look like:
((31*32+31)*32)+31

Or otherwise

((blue*32+green)*32)+red

Okay, seems simple now.
« Last Edit: December 10, 2014, 10:33:13 AM by Lishy » Logged
View Profile
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2394

« Reply #10 on: December 10, 2014, 10:25:51 AM »

7FFF is white.

Quote
I would multiply in hex 31x400, 31x20, and 31x1?
Close, but not quite.  I used hex numbers, you just made them dec. The dec equivalent would be: 31x1024, 31x32, 31x1.

<< just shifts the bits left by the number of given bits.

"<< 10" shifts the number over to the left 10 bits... (Think in binary.)


@Lishy's edit: Yeah, Atrius's way is obviously easiest to remember. Good thing I linked this topic!
« Last Edit: December 10, 2014, 10:37:05 AM by Fox » Logged

Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...
Did you know? In English, you are suppose to capitalize the languages. (e.g. English is a proper noun.) Subjects like math, science, history can be left lower-cased unless they are a title. (Kind of like how you can say either "my mom" or "Mom" in "I went with (X) to the store.", except that I don't think languages are ever lower-cased in English.) In Spanish, both subjects and languages are left lower-cased. (I put this here because I've noticed people make this mistake quite often. And am curious if they know about this, and whether they use their way because they believe this grammar usage should have never been a thing?

Remember kids! In getting a job, it's not about what you know, it's about WHO you know! So start making friends with the people that work where you want to work. :) (Friend of a friend and volunteering count too, so keep that in mind.)[/si
View Profile
Pages: [1]   Go Up
  Print  
 
Jump to:  

Cbox
December 13, 2017, 09:19:38 PM
Fox: Okay, so that Summon Night games adds the fram number to the seed, before generating another seed via mul/add....  (GS1-GS3 never adds the fram number.) ... So um, that makes sense! ;  Summon Night:  ((seed + frame) * 0x343FD + 0x269E3C) >> 0x10 ; Which is also on the list here: https://en.wikipedia.org/wiki/Linear_congruential_generator
December 12, 2017, 11:10:45 PM
Fox: Yes, and there could be contests. Maybe ones where 1st/2nd/3rd place get a cash reward, but eh. Dunno.... Kind of thinking about making a topic about how people got their job, and what was their experience. (e.g. Did they use references of people already working in the job, and various other things.)
December 09, 2017, 04:24:14 AM
Majora: Import old forum posts for reference, perhaps take posts containing important info like documentation away from the old stickied forum post model and make them into their own pages on a site with an in-built search bar. Might help with SEO, too. If nothing else, perhaps whipping them into PDFs and hosting them via Scribd? The possibilities are boundless when it comes to restructuring a site
December 09, 2017, 04:20:02 AM
Majora: Just a nice idea to have even if it doesn't come to fruition. Updating, modernizing, always a good idea. Could probably do something pretty nifty using a good Wordpress theme
December 09, 2017, 04:15:45 AM
Majora: Would be kind of neat to do something like that for GSHC. Could change it up a bit to show all tweets/instagram posts/facebook posts/golden sun subreddit posts all in one sidebar. It would be cool in that it gives the site it's on (and the topic in general) appear more lively and active, which is a plus
December 09, 2017, 04:14:19 AM
Majora: That does sound interesting. One cool thing I've seen some sites use is a sort of unique take on a sidebar option that acts like a social media integration (like, "See GSHC's latest Tweets"). It displays activity from a variety of related sites, such as Reddit, Twitter, Instagram, etc.
December 09, 2017, 12:58:53 AM
Fox: And the way it'd work via code is not that all users would instantly get nicknames the minute you register... but rather, the moment you view a name if it doesn't have a nickname, it gets one. (My Thoughts.)
December 09, 2017, 12:53:55 AM
Fox: (I was thinking that it would be "Name (Nickname)" ... The nickname is what you first known the user as, and you can change that yourself... and the Name is what the user wants to be called... Something like that.
December 09, 2017, 12:47:56 AM
Fox: So like... for starters, one idea I had was to make it so anyone can name anyone... much like how it works on Skype, and you (the namer) would be the only one to see it, and such...
December 09, 2017, 12:45:02 AM
Fox: Would need to be carefully thought out and tested, though.
December 09, 2017, 12:43:02 AM
Fox: I'm thinking I could make it so that name changes can happen whenever... (Without any limit)... Since I believe there's a way to do it with minimum confusion. (I think.) Hmm....
December 09, 2017, 12:31:36 AM
Fox: (I mean an offline version... at least initially.)
December 09, 2017, 12:25:01 AM
Fox: Now that I have thought about it a bit more, would I be right to assume that GSHC would be one of the most interesting websites to administrate, or no? It's sad to see not much going on with it. == I almost want to make a concept website at some point. :D Anyway, how is everyone doing today?
December 06, 2017, 12:12:59 AM
Fox: Like... Start using Github or something... Do like how many of those other projects such as Citra (WIP 3DS Emulator) does. Etc.
December 06, 2017, 12:08:12 AM
Fox: No idea. I just wish OpenGoldenSun would release it as unfinished, but oh well.
December 05, 2017, 06:52:09 AM
MaxiPower: Bummed out that the open golden sun project is dead it seems with no actitivy in close to a year at this point. Is there any hope left in any other projects?
November 27, 2017, 10:25:28 AM
Fox: (When I say research, mainly refering to the data in the game, though checking websites can count to a degree.)
November 27, 2017, 09:52:27 AM
Fox: Maybe. But Dark Dawn is meh, hahah... I still research it, though, because data can be interesting.
November 27, 2017, 05:28:36 AM
Portakin: I'm here! This game is underrated!
November 25, 2017, 08:03:23 PM
Fox: .... and the email listed in that post makes me think we should just make a new rules topic with most of the same information. (So the old ones can be sort o archived.)

Affiliates
Temple of Kraden Golden Sunrise
Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.065 seconds with 22 queries.