Language…
20 users online: Alex No,  AmperSam, Anas,  Anorakun, DanMario24YT, GiraffeKiller, Golden Yoshi, Green, Green Jerry, h.carrell, Hammerer, JikissGamer, MaffYuu, Maw, Metal-Yoshi94, Ray Hamilton, Rykon-V73,  StayAtHomeStegosaurus, Tulip Time Scholarship Games, Zatara - Guests: 298 - Bots: 458
Users: 64,795 (2,369 active)
Latest user: mathew

SA-1 MaxTile - The End Of Sprite Limitations - And The Era Of Sprite Backgrounds

PatchSuper Mario WorldResource Release

SA-1 Pack v1.40 - MaxTile Edition

Hi! It's been a long time since I have participated on SMWC's C3. This time, I'm happy to bring something I was been working since the end of 2019 and it's a concept I initially thought in 2016.

...
_  _ ____ _  _ ___ _ _    ____ 
|\/| |__|  \/   |  | |    |___ 
|  | |  | _/\_  |  | |___ |___ 
...

A fact is we never had the opportunity to explore fully SMW's OAM table. Roughly 60% of it is completely hardcoded and the 40% remaining we can somewhat use with limitations using NMSTL, NoMoreSpriteTileLimits, which was revolutionary when it was released, but noways there's better solutions when the SA-1 chip is available.

MaxTile is here. Now you can use ALL the OAM slots available (128 total) and not just the 50-60 slots that the current patches used to allow.



But how about compatibility? We need to be careful with what kind of solution we can use. If we rewrite SMW's OAM allocation from scratch, you will have to pretty much port all vanilla sources and SMW Central resources to use, which is not very motivating -- you don't want to wait until all resources are converted before using them on your SMW hack.

For that reason, MaxTile was made to keep compatibility with all existing resources, specially custom sprites! This means that you can use MaxTile and use normally all your custom and vanilla sprites. It not just works normally, but also it does take benefit from using MaxTile. Now you can easily put 6 banzai bills, 5 big boos at the same time on the screen, without editing a single line of code, nor using their disassemblies -- SA-1 Pack does the work for you.


SA-1 MaxTile prototype video posted in 2019 - here you can see the vanilla sprites working fine with the system.

You can try with any custom resource as well! Custom sprites works fine with MaxTile, if the custom sprite used to work with SA-1 and PIXI before, it's very likely to keep working with MaxTile normally!

How?



MaxTile doesn't remap or removes anything. The $0200-$03FF OAM attribute table still works normally. The secret is that every time a sprite runs, MaxTile ensures that $0338+ is cleaned up and moved to another buffer before the next sprite writes though it.

All sprite tiles are copied to the "MaxTile Buffer", which at the end of the frame, the rest of the $0200-$03FF table is compressed, eliminating all previous unused slots. Then, the MaxTile buffer copies all tiles to $0200-$03FF, taking all unused slots that SMW leaves, keeping it 100% compatible with anything else that writes to the $0200-$03FF, because MaxTile does the copy exactly when the frame is done.


Video link - This is Erik's Giant Urchins, hosted there, absolutely no line was changed to make it work with MaxTile.

SA-1 Pack v1.40 - MaxTile also features a priority system, where you can (finally!) control if you sprite will appear in front or behind other sprites:


Normal sprite priority - appears behind Mario and other tiles (fireball)


High priority - appears in front of Mario but behind other tiles (fireball)


Highest priority - appears in front of everything.

The priority system is completely dynamic, that is, the only thing you need to change is the value you pass to MaxTile (0 - highest priority, 3 - lowest priority) and it will give you a pointer with requested priority. The only thing you need to worry is draw!

--
SA-1 MaxTile uses several SA-1 tricks to ensure performance. Copy buffers back and forth is slow, the SNES system does not have enough bandwidth for that and the 65c816 architecture is not favorable at all.

Even if you use the heaviest sprites in terms of tile - even if they were not made to work on MaxTile - you won't get slowdown.


video link - This uses Akaginite's ExBanzai Bill sprites to demonstrate the power of the MaxTile engine and - no slowdown - ! It's worth seeing that Mario cape and Yoshi still works fine even with tons of tiles.

In other words, SA-1 Pack now allows for you putting 22 sprites on screen, 255 sprites per level and you can use the maximum amount of tiles possible - 128 - the maximum that the SNES hardware, S-PPU, allows for!

So what are you waiting for? Ah, the download link...

Download - SA-1 Pack v1.40 + MaxTile

But wait!!

You might be thinking now "fine, more sprite spam!" or "I don't like putting so many enemies on my level, how can this be useful for me?"

The good news is that SA-1 MaxTile is not just about putting enemies or bosses on your ROM hack. Sprites are a purely visual thing that the SNES allows for, this means you can also draw things that are not enemies too.

The SNES Picture Processing Unit allows up to 128 sprite tiles on screen. Given they are 16x16, you can pretty much draw something as big as 256x128, 176x176 or well, 32,768 pixels on the screen without relying on Layer 1, Layer 2 or Layer 3.

This means that you can draw some simple background or animations as well! They are not enemies, but with creativity you can pretty much make your own sprite backgrounds or effects that normally requires HDMA or a dedicated layer.

For demonstration purposes, I decided to revive one of the very first codes I did in 2012, which is the snowfall effect on the overworld: https://www.youtube.com/watch?v=RGCs3KWyicA. It's simple, but because of the OAM limitations some tiles ended up disappearing or conflicting with the OW border part that is sprite (the panel behind Mario).

After almost 9 years, I decided to adjust the code to use SA-1 MaxTile and made it work on both levels and overworld via UberASM. Here is the result:


Much more dense and perfectly working snowfall - over 100 sprite tiles appearing on the screen at the same time. You can configure how many tiles to appear, whenever to enable or disable transparency, if it's just adapt for levels or overworld and much more.


The advantage of using sprites is exactly that - you have full freedom to control how many of them appear per time, density, speed, etc.

Download Snow UberASM Code

For the record, The Snowfall UberASM code uses SA-1 MaxTile Allocation Mode. It's one of the ways to use SA-1 MaxTile directly.

--
Another example I'd like to share is really, making sprite backgrounds. I thought in trees because they're vertical and they don't use many OAM tiles compared to a mountain or clouds.

Since they don't use many tiles, I made three layers of trees at once as you can see here:



If you combine creatively with layer 2 and layer 3, you are pretty much having six backgrounds on your level and you can parallax all of them together. And yet you can have 10 koopa troopas on the level without slowdown or getting out of sprite limits.

The system is a bit hardcoded but if you have reasonable ASM knowledge, you can customize it to add and remove layers, add and remove pillars or even completely make your own sprite background layers.

Download Tree UberASM Code
For the record, this code uses SA-1 MaxTile Direct Mode. It's another way of using MaxTile.

With MaxTile, I hope it becomes more common not just sprite backgrounds, but also larger platforms, larger sprites (including bosses) and more freedom in doing your SMW levels. I'd say this system is powerful enough to compete with Mario Maker, because you can pretty much make most of the screen filled with sprites and we have an huge amount of custom sprites available to use - and they should work normally with MaxTile - !

And of course, MaxTile was made thinking on the ASM programmer too. The system should not be hard to use on custom sprites and custom backgrounds, including on overworld and I took the time to write a complete documentation on how to make resources using MaxTile. Make sure to give it a read: here.

Happy hacking and let me know if it works cool!
GitHub - Twitter - YouTube - SnesLab Discord
Holy cow, I saw some of your tweets earlier of this. SMW at its maximum power. Brilliant work.
Wow. All of this is absolutely incredible and another big step in smw hacking for sure.
Epic. I'll give a read to the docs later but what you're showing here can be truly revolutionary and it doesn't even sound too difficult to use (and even compatible with pre-existing resources!). Great job. #smw{:TUP:}
Absolutely amazing work, vitor! Can't wait to see people use this and take SMW even further to its limits!
Neat, a warlock has descended from on high to deliver us his magicks.
This is an incredible feat to pull off, and it's exciting to think where the future of hacks is going to go!

That, or your name will be cursed for all time because you enabled Touhou-level dodge em ups with a billion particles to avoid.


Other Submissions of mine!
The most powerful SA-1 creation EVER!!!

Every time Vitor makes something powerful for C3, the event ends, and Vitor is the real winner.

Can't wait to use this big mutha in bajillion ROM hacks!
The Hacking of PuyoPuyo. Come join the fun, friends. 『いけいけ団長、頑張れ頑張れ団長!』
Help us raise funds for the Armed Forces of Ukraine. #ДопомагаємоРазом / #HelpTogether
“Even if you personally are so dissatisfied with life that you want the world to end, surely the cruel reality is that it will continue on, unchanging. All the better for someone perfectly content, like me.”
Aya Shameimaru, Touhou Suzunaan ~ Forbidden Scrollery
Very nice Vitor, with that and my dynamic sprite system I can do very crazy things, very well done.

Is it a stable version? i would like to test it and see what kind of crazy stuffs i can do with that.

------------------------------------------------------

Youtube
Twitter
SMWControlLibX GitHub
My Discord Server
Snestorage where you can download my resources
Wow. Kaizo makers will be pleased with this new update. Now they're going to make thousands bullet hell levels. Also, tons of possibilities for normal hacks as well. Superb work as always, Vitor. You're always making such great progress and making SMW go one thousand steps further. #smrpg{sick}


About time! This is truly revolutionary and powerful along with anonim's Dynamic Z. I remember beta-testing this a while ago and it was really fun. This should get number one as a game-changer.
My Mode 0 guide.

My Discord server. It has a lot of archived ASM stuff, so check that out!

This is incredible I can see allot of good use and potential for this later on in hacks


You are challenged by Champion Daisy!

LAYOUT FOOTER:
oh, ok.
Reading this made me very enthusiastic because it covered the part of "but wait I don't enemy spam", and I really lost my shit seeing this snow animation, along with the trees.

I believe, too, it will be game-changing technology over here. One may ask: Why haven't Nintendo boyes included such technology back in the 90s!

The level of dedication to work such topics seems unbeatable to me. I congratulate on that.

You know guys, I never actually readied myself to install the SA-1 in my romhack projects. And now this lol. I hope I can catch up and just understand how to set it up to work and not break the rom.
Vitor at it again revoluztionizing what's possible. Unlocking OAM like this is huge, dude!
Neat!

I'm glad i was able to help you out testing a little bit this update, which was one of my most wanted updates since 2019 when you made an article in SnesLab.

I'm looking forward to use it in my projects :P
This is pretty damn amazing. The ability to have so many massive sprites onscreen at once is one thing, but the idea of creating new "layers", and 4bpp ones at that, is really exciting to me. While I don't have any plans for a hack right now, if I do end up making one then I'll almost certainly be implementing this.
As someone who has messed with SMW's oam system for (too) long, I can definitely say that this is an outstanding achievement. Well done!
The SA-1 chip getting ported to SMW might as well be the most defining moment for our hacking community. Watching the chip achieve(?) its full potential has been quite surreal to watch.
You don't show up very often, but when you do, you're doing absolutely revolutionary stuff!
This is epic and even if I don't understand how it works, I am looking forward to trying this out.
I have no words to describe how amazed I am. You truly show again, that there are no limits for you! #smrpg{<3}










Congratulations Vitor Vilela you have revolutionized SMW hacking forever!
Every time you make a new SA-1 pack update, I say that it can't get any better, it's as good as it's gonna get. Then, you make an update that blows that preconception out of the water. Vitor, you are doing incredible work!
Currently working on:
Super Kekcroc World 4 (lol jk)

PatchSuper Mario WorldResource Release