ROM Hacking Discussion / Re: Adding sprite data to a ROM & modifying color pallettes in attribute tables« on: Today at 05:04:04 pm »
The attribute table lies after the name table in the PPU's RAM. So if you know where your graphics are in VRAM, the attribute table is just after it. It's changed the same way anything in VRAM is changed: the CPU picks a value, picks the PPU address and writes to it, both using registers. So the debugger is how you find out how the game writes to the attribute table.
Every game does it a different way, depending on the programmers preference. Sometimes, the background uses the same palette for most of the screen, so the code could just say "start at the top, here's the value, now write it to everything". Sometimes a title screen is more complicated, so it says "start at the top, get the values in sequence from this place, and write them one after the other". Castlevania is probably the latter, but the way to find out is to (in FCEUX) make a write breakpoint for the part of the attribute table you're interested in, and see what happens.
First you should mess with the attribute table in the hex editor to see where you need to change it. Just type other values like 00 or FF, and find the part of the screen you need. Set the breakpoint on that, reset and see what happens. Often it's first written with something blank, then changed to the value that's needed. This is where a little assembly knowledge is needed, but it's actually not that complicated.
When it breaks at the point of storing the key value to that address, you can look in the debugger before it and see where that value came from. If you're lucky, it'll say something like LDA $XXXX, with X being somewhere above $8000 (the ROM). Then you can go there in RAM, click "go here in ROM file" and hey presto, you've probably got the list of values for the attribute table. You can try changing these in the ROM and see what happens.
If you need more info about how the attribute table actually works, better to go to nesdev, as I can't explain everything here. If anything doesn't make sense, just ask. Actually, I'll take a five minute look at Castlevania now, just to check...
EDIT: Hold on... you just said the SPRITE "nudged its way into another part of the attribute table and fudged with the colors". What? Sprites don't use the attribute table. It doesn't matter where they are on screen, they each have their own palette. Well, I hope what I wrote was informative, but now I don't understand what you mean.