I tried the ones in the main NESdev.com site, They do not have any good way of attribute rendering!
Does anyone have an ''Up-to-date Renderer'' with Update (Sub)routines for Attributes? I really need one for a project.
NOTE: It has to be rendering in the style of 16x16, not just 32x32
NOTE2: The project is a SMB1 ROM hack (It is going to be a patch distrobution, Not a pirated ROM)
What's the problem? You don't know how to set the attributes for tiles? If you know the X and Y of a tile on a name table you can figure out which byte in the attribute table it is by shifting bits left or right to multiply. Then you just need to know which bits you need to change which would have to figure out based on which 16x16 block area it is if I recall.
Why should anyone do the work for you though? You should figure it out yourself. If you need help with it, that's fine. But it seems a bit rude to ask someone else to do your work for you.
MottZilla wrote:
What's the problem? You don't know how to set the attributes for tiles? If you know the X and Y of a tile on a name table you can figure out which byte in the attribute table it is by shifting bits left or right to multiply. Then you just need to know which bits you need to change which would have to figure out based on which 16x16 block area it is if I recall.
Why should anyone do the work for you though? You should figure it out yourself. If you need help with it, that's fine. But it seems a bit rude to ask someone else to do your work for you.
I want some help. But this is really not a request.
Well, generally when you update the tile index in the pattern table, you'll want to update the attributes at the same time. But since you're wanting to modify a game you don't have the source code to/didn't make yourself that complicates things.
All I can gather from what you said is you need to know how to set a 16x16 area of pixels to use a certain palette index. As I just told you, through some multiplying or dividing you can figure out which tile uses which bits of the attribute table. I can't give you any code because I didn't make any NES games so I never had to write any.
MottZilla wrote:
Well, generally when you update the tile index in the pattern table, you'll want to update the attributes at the same time. But since you're wanting to modify a game you don't have the source code to/didn't make yourself that complicates things.
All I can gather from what you said is you need to know how to set a 16x16 area of pixels to use a certain palette index. As I just told you, through some multiplying or dividing you can figure out which tile uses which bits of the attribute table. I can't give you any code because I didn't make any NES games so I never had to write any.
Actually, It was Disassembed fully with Comments by Doppleganger, And I still use it. You can find it in Romhacking.Net under SMBDIS!
Individual attribute updates are one of the more mind-bending problems I remember running into. It seems like I needed a copy of the attribute table in RAM, or would have to read from VRAM (very impractical).
Here's what I came up with when I needed it to work, and didn't care how.
It's the subroutine "draw_metatile". Since it writes to the PPU registers (rather than to a buffer), it's not as useful. It's ridiculously overcomplicated.
http://www.parodius.com/~memblers/nes/neslib.asm
Hamtaro126, I doubt you'll find something ready to use. This kind of job will certainly require you to study the game code so that you know exactly what you have to modify.
A basic routine that does what you want can probably be coded pretty quickly, but the hard part is exactly incorporating it to the specific game you want. That's because the attribute data has to come from somewhere, and that's specific to each game. Also, the time taken for the new updates must fit inside the remaining VBlank time (if any), and that time depends largely on what the game does during VBlank.
So I guess there is no other way, you'll have to figure out how SMB handles attributes, and rewrite whatever needs changing. You could start out by commenting out whatever seems related to attributes, effectively disabling attribute rendering altogether. Once that's done, and the game is still working correctly (except for the resulting color issues), you can start writing your own routines to handle attributes as you wish.