Page 1 of 1

Why two windows?

Posted: Fri Apr 05, 2019 11:31 am
by tepples
Asking on behalf of ant in gbdev Discord:

"Anyone have any insight into why the GBA Super NES S-PPU supports 2 windows? Was there a particular problem that Nintendo encountered that could be solved with exactly two windows? Why not more windows? Why not just one?"

Ant had asked the same question about the Game Boy Advance and I said the window count was probably inherited from the Super NES.

Re: Why two windows?

Posted: Fri Apr 05, 2019 11:50 am
by dougeff
How many do you need?

Re: Why two windows?

Posted: Fri Apr 05, 2019 3:17 pm
by Drew Sebastino
Are windows generally an SNES specific thing? I don't know of any other hardware that has them (I'm obviously not including the GBA); same with mosaic. Windowing could have been a lot more useful if there were more of them; they would have been great for a far silhouette background layer. Some games still make clever use of them though. DKC3 using large black windows behind high priority BG1 tiles in the tree levels is pretty clever.

Image

Re: Why two windows?

Posted: Fri Apr 05, 2019 3:55 pm
by tokumaru
1 for each player? I don't know...

Re: Why two windows?

Posted: Fri Apr 05, 2019 4:05 pm
by 93143
One is too restrictive. You wouldn't be able to draw a simple five-pointed star, or most of the numbers in Super Mario Kart. Or use two separate window effects on the same set of scanlines.

With more than two, the logic to deal with overlapping windows gets complicated. Also it takes more registers and die space, and is kinda starting to get away from the core concept of a tile-based graphics system...

Re: Why two windows?

Posted: Fri Apr 05, 2019 7:48 pm
by Shonumi
I'm going to go with 93143 and say that just one window may have been too limiting. It's fine for many, if not most cases, but giving access to two windows just about covers every other usage. One nice thing about two windows is that you can use them on two separate sections of the screen without resorting to Hblank tricks that change the window definition mid-screen.

I don't remember a bunch of GBA games using the two main windows at the same time, however. I know Sonic Advance (1st one) uses it to simulate two independent spotlight beams at the start of Zone 2 Act 1. I dunno about the SNES, but technically the GBA has 2.5 windows. I say that because OBJs can act as individual windows (3rd gen Pokemon uses this a lot to blend BGs with battle sprites for status affecting attacks, like Tail Whip or Growl). Super rare to see all of the windows used at once though.

Re: Why two windows?

Posted: Fri Apr 05, 2019 9:30 pm
by Nicole
Shonumi wrote:One nice thing about two windows is that you can use them on two separate sections of the screen without resorting to Hblank tricks that change the window definition mid-screen.
Well... on SNES, unlike GBA, there are no Y-coordinates for windows, so without any H-blank changes they always go from the very top to the very bottom of the screen. In other words, you'd pretty much always use those "tricks" on SNES regardless, even for a simple rectangular window.

Re: Why two windows?

Posted: Fri Apr 05, 2019 9:54 pm
by Shonumi
Nicole wrote:Well... on SNES, unlike GBA, there are no Y-coordinates for windows, so without any H-blank changes they always go from the very top to the very bottom of the screen. In other words, you'd pretty much always use those "tricks" on SNES regardless, even for a simple rectangular window.
Interesting, never knew that. Without mid-screen changes, I wonder what kind of top-to-bottom effects you could come up when using both windows simultaneously.

Re: Why two windows?

Posted: Fri Apr 05, 2019 11:15 pm
by Oziphantom
Its basically a scissor, so most Fixed Pipeline GPUs have support for a single scissor. As they can do N passes they only need 1.

Re: Why two windows?

Posted: Sat Apr 06, 2019 5:19 am
by Bregalad
Shonumi wrote: Interesting, never knew that. Without mid-screen changes, I wonder what kind of top-to-bottom effects you could come up when using both windows simultaneously.
Any effect that spawn in two vertical columns in the entire screen... Looks at Drew Sebastino's example above for instance.

Re: Why two windows?

Posted: Sat Apr 06, 2019 6:58 am
by tepples
Perhaps the Super NES window doesn't need top and bottom variables because its HDMA is more versatile than that of the GBA.

Re: Why two windows?

Posted: Sat Apr 06, 2019 7:43 am
by Shonumi
Bregalad wrote: Any effect that spawn in two vertical columns in the entire screen... Looks at Drew Sebastino's example above for instance.
Any more specific examples besides DKC3? I only ask because I know the GBA can wrap its windows, so on that system you could get away with just a single window. Just idle curiosity if any games on the SNES that use two top-to-bottom windows would need the same on the GBA.

Re: Why two windows?

Posted: Sun Apr 07, 2019 6:54 am
by Pokun
I always wondered why Nintendo called them windows, using the same term that they use for the Game Boy's second BG layer, which made sense as it can be used as an actual dialogue box window layer instead of just masking BG tiles like the SNES windows do. I guess window makes sense on SNES as well since they clip out holes like windows in the BG, but it had me confused when I first read about it.