SamSuka
vitorvilela
vitorvilela

patreon


Multiple Giant Sprites on SMW - How it works

The incoming new system for SA-1 Pack v1.40, the OAM MaxTile System automatically pushes the SNES sprite hardware to the limits by compressing all unused entries and discarding the offscreen tiles. With that you can have up to eight banzai bills, six big boos and much more.

SMW has a semi-fixed sprite buffer, where each object has a static mapping to it. This works great on the game, but it always gave a fixed amount of tiles you can render, which always limited each sprite to draw up to four 16x16 tiles (so one 32x32 sprite). It had special settings for some sprites, like the Big Boo or Banzai Bill where they could come to a slot that had more space available for filling the tiles. But using that method, you were able to only have one sprite of each since there was only one memory region that had more tiles available to use.

Keep in mind! Sprite on this article means a complete entity, like "Mario" or "Rex". Tile on this article means a piece of the sprite, like Mario's head or Big Boo's eyes.

Initially, there was a solution for that called NoMoreSpriteTileLimits. It works by transforming the shared general-purpose sprite memory into a stack, so each game would stack several tiles together them, giving a more efficient sprite storage. But still, around 60% of the sprite memory was still free but unusable because it was only possible to access by accessing another memory page and rewriting the rest of sprite types (player, extended, cluster, particles sprites, etc.). So a proper solution was never really made and we sticked with the NMSTL method for years.

The SA-1 MaxTile system however works by giving the entire sprite memory region to the sprite and when the rendering is done, it compresses and moves the rendered content to another much larger region and frees the sprite memory so allowing to all sprites have the entire memory free for rendering. It recycles the memory region so the sprites don't have to be changed internally but at the same time they have the entire space to work on, while the already rendered ones are saved on a separate storage so they won't interfer with the current one being rendered. On the end, everything is merged and compressed together (including the other sprite types, since on the end of the frame you are sure that all of them were rendered already) and sent to the hardware, allowing you to have as much tiles as the hardware allows for, which is 128 tiles. With that, it's possible to fill up to 57% of the entire SNES screen using sprites, while previously, using the NoMoreSpriteTileLimits patch for SMW (which theorically maxed out the tiles on the game for ROM hackers), you were able to fill only 22% of the SNES screen.

Summary on how SMW worked with sprites:

Summary on how SMW worked with NoMoreSpriteTileLimits patch (NMSTL):

Summary on how SA-1 MaxTile works:

Note that since I tried making the explanation a bit simple, there might be some inaccurate information the amount of reserved slots. But this is the summary of how MaxTile work and why it still works with everything. And of course, if 20 sprites attempt drawing 50 tiles each one, the SA-1 would discard the exceeded ones, because the hardware can only render 128 tiles.

Either way, MaxTile was an idea I had several weeks ago, but I only decided to give it a try after I was having trouble converting Contra III to SA-1. The stress I had on Contra III was the insight for me trying something new and that so far people are looking forward for it!

Multiple Giant Sprites on SMW - How it works

More Creators