Why two windows?

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Why two windows?

Post 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.
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Why two windows?

Post by dougeff »

How many do you need?
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
Drew Sebastino
Formerly Espozo
Posts: 3496
Joined: Mon Sep 15, 2014 4:35 pm
Location: Richmond, Virginia

Re: Why two windows?

Post 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
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Why two windows?

Post by tokumaru »

1 for each player? I don't know...
93143
Posts: 1717
Joined: Fri Jul 04, 2014 9:31 pm

Re: Why two windows?

Post 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...
Shonumi
Posts: 342
Joined: Sun Jan 26, 2014 9:31 am

Re: Why two windows?

Post 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.
niconii
Posts: 219
Joined: Sun Mar 27, 2016 7:56 pm

Re: Why two windows?

Post by niconii »

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.
Shonumi
Posts: 342
Joined: Sun Jan 26, 2014 9:31 am

Re: Why two windows?

Post 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.
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: Why two windows?

Post 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.
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Re: Why two windows?

Post 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.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Why two windows?

Post 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.
Shonumi
Posts: 342
Joined: Sun Jan 26, 2014 9:31 am

Re: Why two windows?

Post 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.
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Why two windows?

Post 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.
cornedgreens
Posts: 1
Joined: Thu Oct 17, 2019 8:25 pm

Re: Why two windows?

Post by cornedgreens »

tepples wrote: Sat Apr 06, 2019 6:58 am Perhaps the Super NES window doesn't need top and bottom variables because its HDMA is more versatile than that of the GBA.
Is this so? Please explain. Did it not have the DMA controller built into the CPU like the SNES did?

93143 wrote: Fri Apr 05, 2019 4:05 pm 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...
I know the Sega System 32 board supported four windows, each with their own x and y boundaries. A bit excessive but it was Sega's most powerful board so they could throw whatever they wanted at it.
Last edited by cornedgreens on Thu Jun 30, 2022 8:12 pm, edited 1 time in total.
iNCEPTIONAL

Re: Why two windows?

Post by iNCEPTIONAL »

tepples wrote: Fri Apr 05, 2019 11:31 am 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.
I know, given the particular way it works on SNES, that one window wouldn't have been very versitile. I don't know why there's not more than two. I do know there's a crap-load of games that use window/shape making on SNES in a multitude of very cool and creative ways. I know why I personally usually refer to them as "window/shape masks" rather than just "windows". I know the two windows will be used in my own game to do the rotating planet effect in the background, both for masking off the shape of the planet and also for the semi-transparent shadow shape on the planet (which I hope to animate rotating across the planet in the final game): https://youtu.be/IyrOCNQc_rs
Post Reply