+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  How to hack the colour palettes
Pages: [1]
Author Topic: How to hack the colour palettes  (Read 2 times)
Thanatos-Zero
Guest
« on: November 08, 2008, 02:14:58 pm »

Currently I´m trying to hack colours, but I have problems to realize that.
1.For example I have the Value for the Colour B15F, R=31(248), G= 10(80) B= 12(96). So how do I come to this value named B15F, which is 45407?
If I calculate the values of R, G and B together I do not get the same result. So can someone explain me how to read and create colours properly?
2. I have the Adress 0x05000218, but I cannot find the Adress with Windhex, so what have I to do?

Please, explain it as easy as possible, I have already some headaches.
DarthNemesis
Guest
« Reply #1 on: November 08, 2008, 03:20:17 pm »

The color format appears to be ABGR; 5 bits per color channel with a 1-bit alpha channel.

ABBBBBGGGGGRRRRR

A = 1
B = 01100
G = 01010
R = 11111

1011000101011111 = B15F
Thanatos-Zero
Guest
« Reply #2 on: November 08, 2008, 04:05:29 pm »

According to the 16bit, I got out the exact value of 45407. Smiley
(Yeah! I can hack soon palettes Cheesy) Thank you my dear Sithlord.^^
Hmmm... I can get of the hex the dex, but unfortunatly I can not calculate the other way around.

I still need also to know how I can get to the adress with Windhex.

creaothceann
Guest
« Reply #3 on: November 08, 2008, 04:51:51 pm »

Quote from: Thanatos-Zero on November 08, 2008, 04:05:29 pm
Hmmm... I can get of the hex the dex, but unfortunatly I can not calculate the other way around.

Just use the Windows calculator in scientific mode.

Anyway...


Decimal to binary:
1. result is an empty string of digits
2. if the value is odd, put a "1" in front of the result, otherwise a "0"
3. divide the value by 2
4. if the value is not 0, goto step 2, otherwise you're finished.


Binary to decimal:
1. the result is 0
2. add the first binary digit to the value
3. cut this first digit off; if all digits have been removed then you're finished
4. multiply the result with 2
5. goto step 2

Alternatively, use the powers of 2:
01010 = 0 * 16 + 1 * 8 + 0 * 4 + 1 * 2 + 0 * 1 = 10


Decimal to hexadecimal:
Convert the value to binary, and use groups of 4 bits (starting from right) to get the hexadecimal digits.
Example: 582 => 1001000110 => 246
(hexadecimal digits are 0123456789ABCDEF)


Hexadecimal to decimal:
1. result is 0
2. get the index of the first digit of value (e.g. "F" is 15) and add it to result
3. remove this first digit; if all digits have been removed then you're finished
4. multiply result with 16
5. goto step 2

Alternatively, use the powers of 16:
A3D4 = 10 * 4096 + 3 * 256 + 13 * 16 + 4 * 1 = 41940


EDIT: One of the methods was faulty.
« Last Edit: November 09, 2008, 07:35:04 am by creaothceann »
Thanatos-Zero
Guest
« Reply #4 on: November 08, 2008, 07:22:15 pm »

Thanks to you, I have now calculated the values for my colours. The only thing what I need to know how to get access to a adress like 0x05000216 with the tool Windhex? Please! I want to try out my colours as soon as possible.
Thanatos-Zero
Guest
« Reply #5 on: November 09, 2008, 02:01:45 am »

I have finally found out to hack the palettes by myself.
http://rapidshare.com/files/162031775/Mega_Man_Zero_-Blacksith_Zero_Palette_Hack.zip.html

This is just a little demonstration, from what what I have learned.
For those, which use Windhex or other Hex Editors, put not the wanted value as 16bit in the HEX Searcher. If the wanted value is A9AC, put it this way in the searcher ACA9. The adresses goes from left to right and each adress has place for 255 bit. Now I am really tired of my work. I wish you like me good luck. Smiley
Nightcrawler
Guest
« Reply #6 on: November 10, 2008, 11:13:48 am »

Don't double post anymore. It's against the rules.
Thanatos-Zero
Guest
« Reply #7 on: November 11, 2008, 12:13:49 pm »

Sorry  Embarrassed.
It was for me a great experience and I have just simple forgotten for a moment in my joy the rules. It won´t happen again, I promise you Nightcrawler.
Tauwasser
Guest
« Reply #8 on: November 13, 2008, 07:37:10 am »

Other than that, to tell any future readers: The address 0x05000000 is the start of gba palette ram. You cannot find ram sections in the rom! The data that is in palette ram gets loaded there by the game, but those palettes are not necessarily a) uncompressed b) stored in a consecutive manner in the rom itself.
You will have to find the palettes again using different methods most of which can be found documented here on RHDN.

cYa,

Tauwasser
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC