Hi, I'm considuring using MMC5's extended attributes, but I've realized that there might be some downsides to the enhancement, so I figured I'd bounce it off you veterans before wasting my time running into this brick wall.
Now, from what I understand, normally each tile is painted by using one nametable byte and one attribute table byte (but the entire attribute table is a lot smaller so several tiles have to share the same attribute byte).
With Extended Attributes, the nametable byte works just like before, but the attribute table byte is no longer used. Instead, bytes from the expansion RAM is used as a substitute, but it behaves differently. First of all, there is no sharing between the tiles so you can now freely assign palettes per individual tile. Furthermore, the bottom 6 bits (plus the top two bits from $5130) are used to select between 4KB CHR banks, ignoring the normal CHR banking bits.
Sounds great! But here are my issues:
1. For some crazy reason you can only write to the Extended Attribute RAM during rendering. But the question becomes, can I just turn off Extended Attributes and put the Extended RAM in "ordinary RAM" mode to quickly edit it during vblank, and then change it back?
2. The Extended Attributes works as if it is 1-Screen mirrored. By also setting the nametables to 1-Screen mirrored mode in MMC5 you solve most potential problems related to scrolling. However, I'm thinking that if you do any sort of IRQ trickery, like split-screen, or the famous Super Mario Bros 3 "falling ceiling" or "rising water" IRQ tricks, you might run into trouble.
Even if you switch over from the first to the second nametable at a certain scanline, the Extended Attributes will be unchanged. This means the tile palettes at the split will end up being wrong unless the split happens exactly at the tile 8px tile boundary.
Could this be solved by not only switching to the second nametable but also turning off Extended Attributes during the split? Is that even allowed, having a partially extended viewport?
3. A lot of NES games uses the normal CHR banking bits for tile animations and other tricks, without needing to do expensive VRAM tile updates.
But it's not just animation, but also gameplay tricks. For instance, in Super Mario Bros 3 when you jump on top of one of those blue (P) switches, all bricks tiles turns into coins tiles and vice versa for a limited time
This trick doesn't work with Extended Attributes, as you can't globally change the CHR bank in the same way. I'm thinking you could still do something similar by changing the top two bits in $5130, but it would change ALL tiles and not just the ones you want to animate. You could duplicate the non-animated tiles, but you'd be limited to 4 animation frames, and it would be impossible to selectively animate tiles (SMB3 bricks would morph into coins and vice versa in order to keep other tiles animated).
Is there any other clever way you could animate tiles with Extended Attributes?
Now, from what I understand, normally each tile is painted by using one nametable byte and one attribute table byte (but the entire attribute table is a lot smaller so several tiles have to share the same attribute byte).
With Extended Attributes, the nametable byte works just like before, but the attribute table byte is no longer used. Instead, bytes from the expansion RAM is used as a substitute, but it behaves differently. First of all, there is no sharing between the tiles so you can now freely assign palettes per individual tile. Furthermore, the bottom 6 bits (plus the top two bits from $5130) are used to select between 4KB CHR banks, ignoring the normal CHR banking bits.
Sounds great! But here are my issues:
1. For some crazy reason you can only write to the Extended Attribute RAM during rendering. But the question becomes, can I just turn off Extended Attributes and put the Extended RAM in "ordinary RAM" mode to quickly edit it during vblank, and then change it back?
2. The Extended Attributes works as if it is 1-Screen mirrored. By also setting the nametables to 1-Screen mirrored mode in MMC5 you solve most potential problems related to scrolling. However, I'm thinking that if you do any sort of IRQ trickery, like split-screen, or the famous Super Mario Bros 3 "falling ceiling" or "rising water" IRQ tricks, you might run into trouble.
Even if you switch over from the first to the second nametable at a certain scanline, the Extended Attributes will be unchanged. This means the tile palettes at the split will end up being wrong unless the split happens exactly at the tile 8px tile boundary.
Could this be solved by not only switching to the second nametable but also turning off Extended Attributes during the split? Is that even allowed, having a partially extended viewport?
3. A lot of NES games uses the normal CHR banking bits for tile animations and other tricks, without needing to do expensive VRAM tile updates.
But it's not just animation, but also gameplay tricks. For instance, in Super Mario Bros 3 when you jump on top of one of those blue (P) switches, all bricks tiles turns into coins tiles and vice versa for a limited time
This trick doesn't work with Extended Attributes, as you can't globally change the CHR bank in the same way. I'm thinking you could still do something similar by changing the top two bits in $5130, but it would change ALL tiles and not just the ones you want to animate. You could duplicate the non-animated tiles, but you'd be limited to 4 animation frames, and it would be impossible to selectively animate tiles (SMB3 bricks would morph into coins and vice versa in order to keep other tiles animated).
Is there any other clever way you could animate tiles with Extended Attributes?