Sonic and Sega Retro Message Board: Beginners Tutorials - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 2 Pages +
  • 1
  • 2
    Locked
    Locked Forum

Beginners Tutorials For newbs in distress.

#1 User is offline Syren 

Posted 12 September 2004 - 12:39 PM

  • Posts: 4331
  • Joined: 20-March 04
  • Gender:Male
  • Location:Teesside, UK
  • Project:Reintergration
Tutorial One: Pallet hacking.

This is a tutorial on Pallet editing with hex. I have written this tutorial because some newbies to the community might want to have a greater understanding of hex, or to build up their skill in hex editing.

Before people ask "Wouldn't this be redundant? There are pallet editing programs..." I am aware of that. I'm sure this could be handy to some people, and after all I do believe that a people like me shouldn't be dependant on programs instead of doing the manual work. :P

In this tutorial, I will be giving a complete explination of how to change pallets, and I will do this with two examples with the offsets to these examples.


Example ONE: Sonic's pallet. (Or Tela Titulo in ESE II.)


Sonic's pallet colours are located at various offsets in the ROM. The image below shows a picture containing the pallet and the hex codes for the specific colours:

Posted Image

The numbers on the pallet colours are for me to use when writing these offsets. And these offsets are:

1) 0133EC
2) 0133EE
3) 0133F0
4) 0133F2
5) 0133F4
6) 0133F6
7) 0133F8
8) 0133FA
9) 0133FC
10) 0133FE
11) 013400
12) 013402
13) 013404
14) 013406
15) 013408
16) 01340A

So basicaly, if you go to 0133EEC in a hex editor (And if anyone isn't sure of what to use, I reccomend Hex Workshop by Breakpoint Software.) And you will see that the numbers and letter at 0133EEC is 0E20. To change that, just write over it with the colour you want to use. (I will get on to that later.)

Example TWO: Spectial Stage One.
Again, the colour information is located at various places in the ROM, and I have made another picture for you all to show the offsets and hex for the colours.

Posted Image

The offsets in this pallet are:

1) 0031C2
2) 0031C4
3) 0031C6
4) 0031C8
5) 0031CA
6) 0031CC
7) 0031CE
8) 0031CF
9) 0031D0
10) 0031D2
11) 0031D4
12) 0031D6
13) 0031D8
14) 0031DA
15) 0031DC
16) 0031DE

Notice that they all go up in 2's. I don't know why they do, but I think it's worth noting.

Now that you have a decent example of two pallets, I'll write out a few more without detail so that anyone who reads this can do some of the work theirselves.

Metropolis Zone: Pallet starts at 002AE2. Since it has four lines of 16 colours on any pallet editor, some may get confused on which colour is at 002AE, so it's worth noting that the offsets for each colour go across, not down. Here's a rather poorly made picture to show what I mean.

Posted Image

Now, this is the part where I make less explinations but more pictures. The hex values of colours in the genesis are set out like this, 0BGR, which means that there is a 0 before ever colour in a pallet, ammount of Blue, ammount of Green, and then the ammount of Red.
Since you (being anyone who does this) are working in Hex, it's impossible to see what colour 0888 is (although I have heard of some hex editors that do that). So here's a picture of every colour in the Genny.

Ok, so maybe every colour in the Genny is a bit mutch for me to do. 1536 colours! So here's a picture of the main Red Green Blue values (Another note: All colour values go up in two. You'll see what I mean in the picture) :

Posted Image

Further notes: I have tried finding a website that lists all 1536 combinations, but I have failed. If anyone could post a link, it would be very usefull! :)

I hope this is of use to anyone. If I have made a mistake or left anything out that I haven't done intentionaly, please tell me! :(
This post has been edited by Soil: 15 September 2004 - 12:37 PM

#2 User is offline LOst 

Posted 12 September 2004 - 01:43 PM

  • Posts: 4886
  • Joined: 10-January 03
  • Gender:Male
  • Wiki edits:2
I would rather see screenshots of the hex editor.... How to find the offsets in the first place, and what is an offset?

#3 User is offline Syren 

Posted 12 September 2004 - 01:54 PM

  • Posts: 4331
  • Joined: 20-March 04
  • Gender:Male
  • Location:Teesside, UK
  • Project:Reintergration
Good point.

What is an offset?

An offset is a specific place in the ROM that holds certain data. Nothing more, nothing less. An example is the offsets for the pallets. To get to an offset, we use this in the above mentioned Hex Workshop:

Open the ROM in Hex workshop. I want to get to offset 0133EC, so I click Edit. then Goto.

Posted Image

When the Goto box comes up, I enter the offset in hex.

Posted Image

After I have done that, I click go. Hey presto, I'm at 0133EC.

Posted Image

#4 User is offline Quickman 

Posted 12 September 2004 - 02:17 PM

  • Posts: 5584
  • Joined: 03-December 03
  • Gender:Male
  • Location::x
  • Project:omg porjcet
  • Wiki edits:10

Soil, on Sep 12 2004, 05:39 PM, said:

Notice that they all go up in 2's. I don't know why they do, but I think it's worth noting.

This is because the data is stored exactly as you have shown it in your lovely little image, in groups of two bytes consecutively.

#5 User is offline LOst 

Posted 12 September 2004 - 02:18 PM

  • Posts: 4886
  • Joined: 10-January 03
  • Gender:Male
  • Wiki edits:2
I'm using Winhex. The basics are the same.

This is where you find the goto offset:
Posted Image

The offset is mostly showing up at the bottom status bar in any hex editing program:
Posted Image
Go to offset D382 to find the Sonic object's pointer in Sonic 1.

Posted Image
At the left side of the hex editor, you can see the offsets with a 16 byte boundary.
The sonic object is at offset 12BD8, so the Sonic 1 ROM declares the offset with a 4 byte pointer: 00 01 2B D8 as seen above.

#6 User is offline Syren 

Posted 12 September 2004 - 02:28 PM

  • Posts: 4331
  • Joined: 20-March 04
  • Gender:Male
  • Location:Teesside, UK
  • Project:Reintergration
Thanks Quick Man and LOst, it's great that I made something worth people adding to and caring about. :D
This post has been edited by Soil: 12 September 2004 - 02:39 PM

#7 User is offline Icy Guy 

Posted 12 September 2004 - 02:52 PM

  • Hedgehog. Sonic the Hedgehog.
  • Posts: 777
  • Joined: 23-November 03
  • Gender:Male
  • Location:California
  • Project:GoldenEye 007 level hack
  • Wiki edits:2

Soil, on Sep 12 2004, 10:39 AM, said:

Ok, so maybe every colour in the Genny is a bit mutch for me to do. 1536 colours!

1536? Don't you mean 512?

# of colors for red: 8
# of colors for green: 8
# of colors for blue: 8

8 x 8 x 8 = 512

Anyway, looks good, Soil. :) Even if you can do something in an editor, it's important to have at least some idea as to how to do it in a hex editor. Well, at least most of the time. :P

#8 User is offline Syren 

Posted 12 September 2004 - 03:08 PM

  • Posts: 4331
  • Joined: 20-March 04
  • Gender:Male
  • Location:Teesside, UK
  • Project:Reintergration

Icy Guy, on Sep 12 2004, 02:52 PM, said:

Soil, on Sep 12 2004, 10:39 AM, said:

Ok, so maybe every colour in the Genny is a bit mutch for me to do. 1536 colours!

1536? Don't you mean 512?

# of colors for red: 8
# of colors for green: 8
# of colors for blue: 8

8 x 8 x 8 = 512

Anyway, looks good, Soil. :) Even if you can do something in an editor, it's important to have at least some idea as to how to do it in a hex editor. Well, at least most of the time. :P

I thought it was that number, but Quick Man told me on IRC that it was 1536 including shading and whatnot. Either that's a mistake on his behlaf or someone's making me look like a monkey. :P

You're right about the importance of knowing vaguely how to do it by hand. I'm not the most informed, but I'm still learning and trying hard to break things down.

I remember way back (SirisDincht ring a bell?) when I downloaded a hex editor, opened up Sonic 2, and almost cried because I found it frustrating as hell. I didn't know what an offset was (and supprisingly I didn't include that with this untill it was brought to my attention! :o) and everything I read looked like random words strung together. Hence this tutorial topic.

#9 User is offline Icy Guy 

Posted 12 September 2004 - 03:20 PM

  • Hedgehog. Sonic the Hedgehog.
  • Posts: 777
  • Joined: 23-November 03
  • Gender:Male
  • Location:California
  • Project:GoldenEye 007 level hack
  • Wiki edits:2

Soil, on Sep 12 2004, 01:08 PM, said:

I thought it was that number, but Quick Man told me on IRC that it was 1536 including shading and whatnot. Either that's a mistake on his behlaf or someone's making me look like a monkey. :P

IcyGuy900: 1536 colors on the MD, eh?
XinuX 2000: I was assuming that the shades from highlight/shadow were different to the ones for regular use.
XinuX 2000: So 0EEE will be inbetween 0CCC and 0EEE when shadowed, and brighter than 0EEE when highlighted.
IcyGuy900: So are they?
XinuX 2000: I dunno.
XinuX 2000: I can't find any data on highlight/shadow.

Guess that settles it, but after all: we're all still "only human." :)

EDIT: Apparently, 1536 colors at once IS possible, according to...Charles McDonald, I think. Check it.
This post has been edited by Icy Guy: 12 September 2004 - 04:00 PM

#10 User is offline Syren 

Posted 12 September 2004 - 04:50 PM

  • Posts: 4331
  • Joined: 20-March 04
  • Gender:Male
  • Location:Teesside, UK
  • Project:Reintergration

Icy Guy, on Sep 12 2004, 03:20 PM, said:

Soil, on Sep 12 2004, 01:08 PM, said:

I thought it was that number, but Quick Man told me on IRC that it was 1536 including shading and whatnot. Either that's a mistake on his behlaf or someone's making me look like a monkey. :P

IcyGuy900: 1536 colors on the MD, eh?
XinuX 2000: I was assuming that the shades from highlight/shadow were different to the ones for regular use.
XinuX 2000: So 0EEE will be inbetween 0CCC and 0EEE when shadowed, and brighter than 0EEE when highlighted.
IcyGuy900: So are they?
XinuX 2000: I dunno.
XinuX 2000: I can't find any data on highlight/shadow.

Guess that settles it, but after all: we're all still "only human." :)

EDIT: Apparently, 1536 colors at once IS possible, according to...Charles McDonald, I think. Check it.

It doesn't add up to me, there aren't that many combinations of 8 shades of 3 colours, is there?

#11 User is offline Quickman 

Posted 12 September 2004 - 05:07 PM

  • Posts: 5584
  • Joined: 03-December 03
  • Gender:Male
  • Location::x
  • Project:omg porjcet
  • Wiki edits:10

Soil, on Sep 12 2004, 09:50 PM, said:

It doesn't add up to me, there aren't that many combinations of 8 shades of 3 colours, is there?

Three shades of three shades of eight colours.

#12 User is offline Bleeding Cut 

Posted 12 September 2004 - 06:33 PM

  • Sweeter than heaven and hotter than hell.
  • Posts: 2388
  • Joined: 02-August 03
  • Gender:Female
  • Location:New York
Thank you Soil! Now hex doesn't look like a bunch of random numbers and letters to me! :)

I think it might be a good idea if this went into the E&RE Archive for future reference.
This post has been edited by Bleeding Cut: 12 September 2004 - 06:33 PM

#13 User is offline 8-Bit Dragon 

Posted 12 September 2004 - 07:06 PM

  • Posts: 839
  • Joined: 12-February 04
  • Gender:Male
  • Location:Charlotte, North Carolina
  • Project:Too many!
  • Wiki edits:2
Umm, this may be a dumb question, but how do you convert the rom's palette RGB values to real values. I'll explain why I am asking...

When I was trying to correct a palette for a sprite sheet, I originaly made the sheet using Gens' colors, but later I use Megasis to get cirtain sprites I couldn't in Gens and they were darker.

Okay, so maybe Gens' engine reads colors differently than Megasis, so I use SonED to sample colors... o_O Different again! Okay, lets try ESEII, OMFG!!! The same color on all 4 was a different shade/hue/brightness ><

So then, to get a genuine palette, I began using the values in the rom, thank god they show a pattern! Now, I began constucting a palette in PSP using the values as values for html colors. For example, I would turn 0E44 into #4040E0 in html values. This is the way Megasis does it, but another program wrote these same values as #4444EE *head explodes*. WHICH IS THE RIGHT WAY TO CONVERT!?
This post has been edited by 8-Bit Dragon: 12 September 2004 - 07:08 PM

#14 User is offline Drakmyth 

Posted 12 September 2004 - 07:29 PM

  • Inspector Drakmyth Master at your service.
  • Posts: 420
  • Joined: 16-January 03
  • Location:In the void beneath the ancient maze...
  • Project:Sonic Eclipse 2, Return of the Hidden Palace, Unnamed Sonic 2 Hack

8-Bit Dragon, on Sep 12 2004, 07:06 PM, said:

Umm, this may be a dumb question, but how do you convert the rom's palette RGB values to real values. I'll explain why I am asking...

When I was trying to correct a palette for a sprite sheet, I originaly made the sheet using Gens' colors, but later I use Megasis to get cirtain sprites I couldn't in Gens and they were darker.

Okay, so maybe Gens' engine reads colors differently than Megasis, so I use SonED to sample colors... o_O Different again! Okay, lets try ESEII, OMFG!!! The same color on all 4 was a different shade/hue/brightness ><

So then, to get a genuine palette, I began using the values in the rom, thank god they show a pattern! Now, I began constucting a palette in PSP using the values as values for html colors. For example, I would turn 0E44 into #4040E0 in html values. This is the way Megasis does it, but another program wrote these same values as #4444EE *head explodes*. WHICH IS THE RIGHT WAY TO CONVERT!?

hmm... I'm not big into palette editing but here's two things you could do.

1.) Actually figure it out, probably via someone's post that will be appearing here in the future giving you the answer.

2.) Go to a place where no one knows you and demand they do it for you adding loads of turd talk.

I'm not sure what's wrong with me today. I just really feel the need to reply to posts with an answer that could be done but has almost no chance of working.

#15 User is offline 8-Bit Dragon 

Posted 12 September 2004 - 07:40 PM

  • Posts: 839
  • Joined: 12-February 04
  • Gender:Male
  • Location:Charlotte, North Carolina
  • Project:Too many!
  • Wiki edits:2

Drakmyth, on Sep 12 2004, 07:29 PM, said:

8-Bit Dragon, on Sep 12 2004, 07:06 PM, said:

Umm, this may be a dumb question, but how do you convert the rom's palette RGB values to real values. I'll explain why I am asking...

When I was trying to correct a palette for a sprite sheet, I originaly made the sheet using Gens' colors, but later I use Megasis to get cirtain sprites I couldn't in Gens and they were darker.

Okay, so maybe Gens' engine reads colors differently than Megasis, so I use SonED to sample colors...  o_O Different again! Okay, lets try ESEII, OMFG!!! The same color on all 4 was a different shade/hue/brightness ><

So then, to get a genuine palette, I began using the values in the rom, thank god they show a pattern! Now, I began constucting a palette in PSP using the values as values for html colors. For example, I would turn 0E44 into #4040E0 in html values. This is the way Megasis does it, but another program wrote these same values as #4444EE *head explodes*. WHICH IS THE RIGHT WAY TO CONVERT!?

hmm... I'm not big into palette editing but here's two things you could do.

1.) Actually figure it out, probably via someone's post that will be appearing here in the future giving you the answer.

2.) Go to a place where no one knows you and demand they do it for you adding loads of turd talk.

I'm not sure what's wrong with me today. I just really feel the need to reply to posts with an answer that could be done but has almost no chance of working.

turd talk? You mean newb talk right? Because if I go anywhere talking like a turd, I'll ether get teh ban or flamed ><. And why do that? I'm only a tad bid new to Sonic hacking, not hex editing or Sonic in general. So acting turd will get me nowhere. I'll just wait till someone posts a relavent response.

  • 2 Pages +
  • 1
  • 2
    Locked
    Locked Forum

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