(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
04-29-24 07:13 AM
0 users currently in ROM Hacking.
Acmlm's Board - I3 Archive - ROM Hacking - Megaman/Transformers Hack New poll | |
Add to favorites | Next newer thread | Next older thread
User Post
run
Newcomer


 





Since: 06-12-06

Last post: 6530 days
Last view: 6530 days
Posted on 06-12-06 05:02 PM Link | Quote
Hi there,

I've just started getting into ROM hacking and find it quite fun. I've done some basic graphic hacking and have been playing around with a hex editor changing pallets etc. So I'm a bit of a newbie. What I am trying to do is re-do megaman 1 with characters from the gen 1 transformers. All is going pretty well by I'm running into some pallet problems. This is where my question comes in. Is there a way to assign a particular tile, that may use one pallet, to use another pallet. Say for instance the current pallet I'm using for Prime/Megaman is Red,Blue,White and Transparent. But for some reason there is a piece of megamans face that uses a different pallet that is part of that graphic. Its white,black,tan and transparent. Now I can change this pallet to match the other one, but in doing so it changes the colors of the life bar, energy beam etc. So like I said how would you assign a partiular tile to use another pallet than the one its assigned.

Thanks in advance

Jigglysaint

Octoballoon








Since: 11-19-05

Last post: 6299 days
Last view: 6284 days
Posted on 06-12-06 10:19 PM Link | Quote
What you need to do is find the palete for Megaman's face in hex and change it. The task comes down to searching. At any given time, the NES can support 16 colours for background, and 16 for sprites. In this case, Megaman's face has a different palete value that needs to be found.

You could try this idea, but it might take some time. First, download a hex editor if ou didn't allready, Hex Workshop being the best. Second, download a tool called a Rom corruptor, and then make a backup of your rom.

Now, open the rom and look for the tile(s) that make up his face and note the hex value. In the rom corruptor, search for this value untill megaman's face changes from that tile to another one of your choosing. This will take a bit of time depending on how fast you can test. A rom corruptor allows you to load a rom and search for values by either changing large chunks of data to random bytes, or by searching for a single value and changing all instances of it inside a chunk. In this case, you would use the value of tile for his face, and a reasonable number to change it to would be one value below that(so if the value was AF, use AE as the value that will replace AF).

Once you find that, note it's position, and load the hex editor. Now, you are going to look arround this area for any data that could resemble palete data. If nothing pops out, you can corrupt the data arround there and see if it changes the palete. If you do make a change, narrow the search untill the one byte is found. I don't have knowlege of palete data, but I suspect that it would be between 00 and 03, but I could be wrong.

I hope this helps a bit. If not, www.romhacking.net has documents that have palete related info in them. documents are a very good source of information.
never-obsolete

Paragoomba








Since: 05-14-06
From: AZ

Last post: 6281 days
Last view: 6281 days
Posted on 06-13-06 12:46 AM Link | Quote

this may help if you don't want to duplicate palettes for two (or more) sprites that
use different palette sets, but you want them to use the same set in your project.

the palette loaded into nes vram is as follows (each letter is a byte):

txxx mxxx mxxx mxxx
mxxx mxxx mxxx mxxx

t = universal background color
m = mirror of t
x = values that can be changed and will show durring rendering

the first row is for backgrounds and the second is for sprites. each sprite (8x8
pixel tile) has 4 bytes that are written to sprite oam. these 4 bytes contain this
data:

0 - y position of the top sprite
1 - the tile number of the sprite (index into pattern table)
2 - attributes of the sprite (bits: 76543210)
bits 0 and 1 tell the ppu what palette entry to render the sprite with so:
xxxxxx00 = 1st sprite palette
xxxxxx01 = 2nd
xxxxxx10 = 3rd
xxxxxx11 = 4th
the 'x' bits do other stuff, but dont pertain to palettes
3 - x position of left of sprite

now trace the value in ram (probably somewhere in $0200-$02FF, though not
always) for the attribute byte of the sprite you wanna change. set a breakpoint
for when that address is written to so you can see where the game sets that value.
now change the value that is written to that address to reflect which palette you
want to be used durring rendering of that sprite. be sure all the 'x' bits are the same
in your new value or you will get some strange effects.

the 4 bytes will always be in the order listed above because more then likely the
game will use sprite dma to transfer all the values into sprite oam. so if the data
is stored at $0200 it will be in this order:

$0200 = sprite0_Y
$0201 = sprite0_T
$0202 = sprite0_A
$0203 = sprite0_X
$0204 = sprite1_Y
$0205 = sprite1_T
$0206 = sprite1_A
$0207 = sprite1_X
...etc...

hope this helps.



(edited by never-obsolete on 06-12-06 11:54 PM)
NetSplit

Paratroopa


 





Since: 11-18-05

Last post: 6441 days
Last view: 6441 days
Posted on 06-13-06 02:21 AM Link | Quote
Well, you could do all that...or you could just do this.

$18816 is the sprite frame data for Mega Man, bosses, and other such things (not enemies). The format is simple. You have a byte specifying how many tiles are in the sprite frame, a byte specifying which frame pattern data to use, and then pairs of bytes for each tile. The first byte of each pair is the ID of the tile to use. The second byte is the attribute value to use for that byte. The two lowest bits of that byte determine which of the 4 palettes that tile will use, and that's what you're looking to change (and the highest 2 bits determine horizontal and vertical mirroring). You're looking for face tiles, so you want to find the pairs that are 0001, since 00 is the face tile and 01 is the second palette with no sprite tile mirroring (you may also want to find 2001 pairs, which are the blinking face). Change the 01 to 00 in each of those pairs in order to make it use the same palette as the rest of Mega Man's sprite.

How do you find this kind of data in a ROM? Without assembly knowledge, it's still fairly easy. Just search for some tiles from a sprite in soem sort of logical order (usually left to right) where each tile ID is followed by an attributes value for which palette that tile uses. You could also search for the IDs themselves in a logical order (the attributes could be stored separately or there could be a single attribute for the entire sprite) if that doesn't work. Either of these methods would likely work pretty well.

Hope that helps.
Add to favorites | Next newer thread | Next older thread
Acmlm's Board - I3 Archive - ROM Hacking - Megaman/Transformers Hack |


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.012 seconds; used 367.22 kB (max 435.05 kB)