Thanks for the comments people!
Originally posted by Mathos
Originally posted by Vitor Vilela
Honestly, my brain is having a hard time processing how awesome this is. While I did know the SNES could actually show lots of sprite tiles, I would've certainly never imagined it could show enough for rendering a decently complex FG. I'm also amazed by the Mode 7 BG itself: using the mode for a simple rotation/zoom effect is already quite hard, but projection is downright maddening for me, personally. I'd like to know how much time this took you to setup correctly. Also, looking up to a way to use it with your tool if I understood correctly what you're planning for it.
The SNES PPU can display up to 128 sprite tiles on screen. If each tile is 16x16, this means you can fill pretty much half of the screen (256x128 to be exact), making it an reasonable amount for some FG and sprites. Of course sprite and the foreground share these tiles, so you need to keep some balance between the two or part of the tiles will disappear or cause some slowdown. You also need to pay attention that the SNES can only display 32 sprite tiles per scanline, anything after it, it will get cut off. So I can't have a straight line FG and a green parakoopa flying inside it. Additionally, forget FG<->sprite layer priority if there's too many FG tiles.
It took some months to figure out how Mode 7 projection worked exactly, after analyzing how DSP-1 generates the matrix HDMA table. Or actually some years, if you count also the time I spent until I figured how a mode 7 matrix worked and how the tilemap is rendered to the screen.
The tool I made so far lets you put a script which determines exactly the mode 7 matrix parameters per scanline, but I have plans for putting some known projection tricks (like the DSP-1 projection) into the tool, allowing to you generate your own tables (or generation formula, which is way slower and has mandatory SA-1). I don't have plans for releasing for now though, specially since it's still a long, work in progress tool concept.
Anyway, back on the topic of the sprite FG, I'm also curious as to what is the basis of your system. I'm guessing you're using the tilemap data then performing an upload to the OAM after reading tile numbers and taking scrolling into account ? I wonder how much flexible the system could become in the future (like, with a table telling which sprite tiles to use for which FG tiles), if it's not enough already.
The FG rendering routine runs at end of the frame, after everything has set to the OAM. So I can use all free OAM tiles to whatever I can without risk of getting overwritten. The routine reads $7E/$7F:C800-FFFF table and draws the FG tiles based on the current camera position and earthquake status. So it has all features that a horizontal level can do: vertical scrolling, 0x20 screens, etc. During the rendering, there's a lookup table (using binary search method) that does the conversion between FG map16 number and sprite tile/YXPPCCCT, so it's pretty much a very complete thing. You can also have ExAnimations normally, just animate the sprite tiles instead of FG tiles.
Anyway, congrats Vitor. You just revolutionised SMW hacking AGAIN
Maybe... I didn't thought on that.
Originally posted by Erik557
damn I remembered the WIP of it you posted on Discord and while I didn't comment I wanted to see how the finished product would look like. It's very amazing! Did you code your own OAM system (for everything)?
Like I said, the code runs at end of the frame so it gets all free, unused OAM slots for the frame.
That OAM "leftover" system is the same used for the Touhou Mario 2 bosses, so it's a very stable and reliable system.
also first use of EXTBG I've ever seen. Like, in any SNES game. I don't even know if it was used in any official games.
It doesn't use EXTBG. There's five HDMA channels, where one of them changes the mode from 1 to 7 between the clouds and the main background, so you can still have the status bar and layer 1/2 above the horizon.
EXTBG doesn't exactly work as most of the people think. The second mode 7 layer uses the same tilemap, graphics and scroll registers as first mode 7 layer, except you can have layer priority with it and CGADSUB behaves slight different for it.
Originally posted by MarioSonicGamer
Originally posted by Vitor Vilela
Can't even begin to express how amazed I am by this. I get more and more excited for this hack the more and more I see and hear about it. Keep up the good work.
It's still the beginning.
- SnesLab Discord