Sonic and Sega Retro Message Board: Pallete Editing with hex - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
Page 1 of 1
    Locked
    Locked Forum

Pallete Editing with hex For beginning hackers

#1 User is offline 3588897 

  Posted 08 August 2005 - 11:20 PM

  • Posts: 30
  • Joined: 17-December 04
  • Project:Sonic 2 Redone
Editing Palletes with Hex

Below I am going to explain how to edit palletes using hex without the use of any utilies at all. I got the below information while restoring my palletes due to the hack crashing. Now lets get started, shall we?

OK now to edit palletes you'll need to know the locations of them in the ROM. (I obtained the below using Hivepal). If you need to know the left is pallete name and the right is the offset of the pallete.
Sega Sonic 2902
Title Screen (Sonic) 133EC
Title Screen (Tails) 2942
Title Screen (Main) 1340C
Title Screen Water 1E5A
Sonic and Tails 29E2
Sonic to Super Sonic 2246
Super Sonic 2276
Title Cards 2A02
Emerald Hill 2A22
Emerald Hill/Aquatic Ruin Rotating Water 1E7A
Wood 2A82
Wood Conveyor Belts 1F1A
Metropolis 2AE2
Metropolis Cycle #1 1F2A
Metropolis Cycle #2 1F36
Metropolis Cycle #3 1F42
Wing Fortress 2B42
Wing Fortress Fire Cycle 20A2
Hill Top 2BA2
Hill Top Lava 1E9A
Hidden Palace 2C02
Hidden Palace (Sonic & Tails Under Water) 2C62
Hidden Palace Underwater Tiles Pallete 2C82
Hidden Palace Water Cycle 1F56
Hidden Palace Underwater Cycle 1F66
Oil Ocean (Do not edit or you'll get a huge mess unless you know how to fix it!) 2CE2
Oil Ocean Oil 1F76
Mystic Cave 2D42
Mystic Cave Lanterns 1F86
Casino Night 2DA2
Casino Night Cycle 1 1F8E
Casino Night Cycle 2 1FA0
Casino Night Cycle 3 1FB2
Casino Night Cycle 4 1FC4
Chemical Plant 2E02
Chemical Plant Sonic & Tails Underwater 2E62
Chemical Plant Underwater 2E82
Chemical Plant Underwater Sonic to Super Sonic 22C6
Chemical Plant Underwater Super Sonic 22F6
Chemical Plant Cycle 1 2022
Chemical Plant Cycle 2 2058
Chemical Plant Cycle 3 2082
Chemical Plant Cycle 4 20E2
Death Egg 2EE2
Aquatic Ruin 2F42
Sonic & Tails Underwater (Aquatic Ruin) 2FA2
Aquatic Ruin Underwater 2FC2
Sonic to Super Sonic Underwater (Aquatic Ruin) 2346
Aquatic Ruin Underwater Super Sonic 2376
Sky Chase 3022
Menus 30E2
Special Stage Main 3162
Special Stage Sonic 3182
Special Stage Tails 31A2
Special Stage 1 31C2
Special Stage 2 31E2
Special Stage 3 3202
Special Stage 4 3222
Special Stage 5 3242
Special Stage 6 3262
Special Stage 7 3282
Special Stag 1 2p 32A2
Special Stage 2 2p 32C2
Special Stage 3 2p 32E2
Special Stage Chaos Emerald 35F92
Special Stage Results Screen 3302
Emerald Hill Icon 9880
Metropolis Icon 98A0
Hill Top Icon 98C0
Hidden Palace Icon 98E0
Oil Ocean Icon 9900
Mystic Cave Icon 9920
Casino Night Icon 9940
Chemical Plant Icon 9960
Aquatic Ruin Icon 9980
Sky Chase Icon 99A0
Wing Fortress Icon 99C0
Death Egg Icon 99E0
Special Stage Icon 9A00
X 2 Player Versus Icon 9A20
Sound Test Icon 9A40
Ending Grey Cutscenes AD1E
Ending Main ACBE
Ending Sonic AC7E
Ending Tails AC9E
Ending Super Sonic AD3E
Unknown 1 3082
Unknown 2 30A2
Unknown 3 30C2


Now you'll need just a sonic 2 ROM and a hex editor. Now to exlplain how to edit:
First off leave that 0 there as the very first nibble on EVERYTHING! the last three nibbles are used as the RGB values. Now the higher you go the brighter the color. Like 0EEE would make a grey color 0000 would make black. 1EEE would most likely crash the ROM. Now if you use 0333 or 0111 it also won't work. You can only use even values. Even values are 0, 2, 4, 6, 8, A, C, and E. 1, 3, 5, 7, 9, B, D, and F don't work.Now when you reach the end of a pallete the bytes should be 0000 0000. Edit no further! If you edit any further than that you will be editing another level entirely. Now I'll say one more thing before you go away with new knowledge and start editing palletes. Now I'll explain what every nibble is. The first (should be 0) is I've no clue, the second is red, the third is green, and the last is blue.
This post has been edited by 3588897: 09 August 2005 - 01:16 AM

#2 User is offline Aurochs 

Posted 08 August 2005 - 11:25 PM

  • Единый, могучий Советский Союз!
  • Posts: 2343
  • Joined: 09-January 05
  • Gender:Male
  • Project:Whatever catches my fancy
  • Wiki edits:325
This has been explained better in Saxman's hacking guides, IIRC.

#3 User is offline Radio F Software 

Posted 08 August 2005 - 11:32 PM

  • How about a game of Gyromite?
  • Posts: 31
  • Joined: 05-December 04
  • Gender:Male
  • Location:Texas, USA
  • Project:Robot Combat
Hey, that's cool though that he figured out how to find all of that. :) It would make a handy "pocket reference" or something right? I don't know what all of the numbers and letters mean exactly, but it looks important. :P

#4 User is offline Heran Bago 

Posted 08 August 2005 - 11:35 PM

  • Ah! It's Puyo battle then.
  • Posts: 2949
  • Joined: 11-May 04
  • Gender:Male
  • Location:Foggy California
  • Project:勉強
  • Wiki edits:4
ICEknight explained it REALLY good this one time. Wish I had saved that.

edit; Oh yeah! It was when Rika made the pallete hack of MJ's moonwalker.
This post has been edited by Heran_Bago: 08 August 2005 - 11:35 PM

#5 User is offline Radio F Software 

Posted 08 August 2005 - 11:42 PM

  • How about a game of Gyromite?
  • Posts: 31
  • Joined: 05-December 04
  • Gender:Male
  • Location:Texas, USA
  • Project:Robot Combat
Moonwalker, of all games. :P

#6 User is offline ICEknight 

Posted 08 August 2005 - 11:58 PM

  • Posts: 10235
  • Joined: 11-January 03
  • Gender:Male
  • Location:Spain
  • Wiki edits:18

Heran_Bago, on Aug 8 2005, 11:35 PM, said:

ICEknight explained it REALLY good this one time. Wish I had saved that.

edit; Oh yeah! It was when Rika made the pallete hack of MJ's moonwalker.

Link here.
Copy/paste here:
===============
First of all, make sure your emulator can make screenshots using the correct colors. The RGB color values shouldn't be different than those the Genesis accepts (0,32,64,96,128,160,192,224).
If you're using the latest versions of Gens, you should have the following lines in the GENS.CFG file:
Contrast=90
Brightness=100

Then, take a look at the palette you want to find (in Gens, go to CPU->Debug->Genesis VDP) and make a screenshot of it. Now you'll have to find those colors in the ROM.

The MegaDrive palettes have the format 0BGR (Zero, Blue, Green, Red), etc, so you must look at the color values, convert each of them to the byte the MD uses for it and go to the next color you want to find. The bytes used for each color value are as follows:
E:224
C:192
A:160
8:128
6:96
4:64
2:32
0:0

So if you had a palette with the two consecutive colors "R:224 G:160 B:0" and "R:192 G:128 B:0" you should look for the hex values "00AE008C".
===============

I also had to explain it a couple of times at the SEGA Emulation Forums, if I remember correctly. =|
This post has been edited by ICEknight: 09 August 2005 - 12:04 AM

#7 User is offline Eclipse 

Posted 09 August 2005 - 12:31 AM

  • Posts: 9
  • Joined: 05-July 05
  • Gender:Male
  • Location:Canada
  • Wiki edits:2
Or do the easier way...Lightning's way that is short and easy...
Let's see If I can explain...

Needed stuff:
---------------
-DebuGens
-Hivepal
-Hex Editor (In this I use Hex Workshop)

-Open DebuGens and open your rom
-Make it so the thing you want to change is on the screen
-Dump the pallete with "GDump Palletes (CRAM)"   => This dumps the colors onto an oh-so-easy to read, .bin file
-Open your Hex Editor and HivePal
-Open your .bin file that you dumped the palletes on your Hex Editor and HivePal
-On HivePal count how many colors comes before the colors you want to change.
-Then on your Hex Editor skip 4 numbers for every color that comes before your colors
-Then with HivePal count how many colors there are you want to change
-Then with your Hex Editor HIGHLIGHT 4 numbers for every 1 color you want to change (REMEMBER: You skipped some digits)
-With the digits highlighted copy them
-Then open the rom you want to change
-Then find the digits you had highlighted and copied (ctrl+F opens find)
-It may or may not find it and it may find more than one result
-Open your rom you want to change in HivePal
-Put the offset in and you should see the pallete which you wanted to change!


Wow that was a lot of typing...
This should work...I'm pretty sure I didn't miss a step...

Lightning was my teacher on this...hope he doesn't mind me saying this or I'm screwed out of his kick ass teachings...

#8 User is offline ICEknight 

Posted 09 August 2005 - 09:23 AM

  • Posts: 10235
  • Joined: 11-January 03
  • Gender:Male
  • Location:Spain
  • Wiki edits:18
Ehh... I'm sure the other way is easier to understand.

Page 1 of 1
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users