I have a question about streaming in new object tiles.
Moderator: Moderators
Forum rules
- For making cartridges of your Super NES games, see Reproduction.
I have a question about streaming in new object tiles.
Are there any known ways to lower how much VRAM space each object tile takes up in order to be able to stream more of them in/out every frame than is typical on SNES, maybe by using them in some kind of unofficial lower-colour mode rather the normal 4bpp or something along those lines?
-
- Posts: 3140
- Joined: Wed May 19, 2010 6:12 pm
Re: I have a question about streaming in new object tiles.
Yes, you can do that. There is a DMA mode that skips every other byte. You can use that to animate 2bpp tiles, just as long as you leave every other byte blank.
Re: I have a question about streaming in new object tiles.
If it's only about vblank time and not about VRAM capacity, try this. It fits each object tile into 16 bytes, which should let you copy 10 tiles in a scanline instead of only 5, or 380 tiles in an unextended 60 Hz vblank instead of 190.
- Draw the sprite at 2bpp using only colors 0 (transparent), 1, 4, and 5, or only colors 0, 2, 8, and 10.
- Encode the tile in NES format (all 8 rows of plane 0 then all 8 rows of plane 1).
- Set VMAIN to increment when the low byte of VMDATA is written (if 0, 1, 4, and 5) or when the high byte of VMDATA is written (if 0, 2, 8, 10).
- DMA copy to the low byte (if 0, 1, 4, and 5) or to the high byte (if 0, 2, 8, 10) instead of the usual mode that writes low than high.
Re: I have a question about streaming in new object tiles.
Great. Thanks for both those answers.
Re: I have a question about streaming in new object tiles.
Follow up question: So, with this 2bpp approach for the objects, how are the object palettes now setup and used then in terms of how I would actually draw the sprite art to make sure they are using them correctly? Is it just the same as normal but I only use four colors from each of the 8 16-color palettes rather than the normal full 16 colors per palette, or do I get to use maybe 32 4-color palettes for the sprites now? I think part of the answer to this is maybe covered above, but I just want to be completely clear.
-
- Posts: 1565
- Joined: Tue Feb 07, 2017 2:03 am
Re: I have a question about streaming in new object tiles.
you can make a set with 0,1,4,5 and another with 0,2,8,10 as the colours. So you only get 16 palletes.
Re: I have a question about streaming in new object tiles.
You can write either the even bitplanes or the odd bitplanes. This means you can use two 2bpp (3-colour plus holes) subsubpalettes per 4bpp sprite subpalette. You cannot, however, switch a location in VRAM from one subsubpalette to the other without writing all four bitplanes, since the ones you aren't using need to be blank (the exception is if the sprite is completely solid, with no zero colour, in which case you can just set up the 4bpp subpalette so that it doesn't matter what's in the unused bits, like how Bad Apple for the Mega Drive got around the MD not having a 2bpp mode).
It occurs to me that one could do transparency between 2bpp sprites by filling in the full 15-colour subpalette with the appropriate combinations, and combining the sprites in software via bit shifting and row offset, with one sprite using the even bitplanes and the other using the odd bitplanes. 2bpp is a very restrictive colour depth for sprites, but since the S-PPU can only do one colour math operation per displayed pixel, and can't do colour math between sprites at all, it might be worth it in specific circumstances...
It occurs to me that one could do transparency between 2bpp sprites by filling in the full 15-colour subpalette with the appropriate combinations, and combining the sprites in software via bit shifting and row offset, with one sprite using the even bitplanes and the other using the odd bitplanes. 2bpp is a very restrictive colour depth for sprites, but since the S-PPU can only do one colour math operation per displayed pixel, and can't do colour math between sprites at all, it might be worth it in specific circumstances...
Re: I have a question about streaming in new object tiles.
As a clarification, you have 8 even and 8 odd palettes (for a total of 16) with 3 colors plus transparency. However, depending on if you write the 2bpp sprite data to the even or odd sprite bitplanes, the sprite can only use a palette from either the 8 even palettes or the 8 odd palettes.
Basically: Even sprites use the 8 even palettes, and odd sprites use the 8 odd palettes.
Basically: Even sprites use the 8 even palettes, and odd sprites use the 8 odd palettes.
Re: I have a question about streaming in new object tiles.
Thanks for all the information. Some good stuff to think about for sure.