What is the best/recommended way of doing a static portion of the screen on a scrolling game?(say a HUD for a platformer)
Thanks!
Hud
Moderator: Moderators
Forum rules
- For making cartridges of your Super NES games, see Reproduction.
- Individualised
- Posts: 310
- Joined: Mon Sep 05, 2022 6:46 am
Re: Hud
That depends on the specifics of your game, what graphics mode you're planning to use, how much/what items you want to display on the HUD etc, there isn't a catch-all answer to this question. We need more details to be able to answer this properly.
Re: Hud
It depends on your requirements.
Many games just used a portion of Layer 3 for the HUD, and overlayed a few sprites on top. This gives you a non-opaque HUD, but has very few colors, and the HUD area can conflict with a possible other use for layer 3.
One example is Castlevania IV, where Layer 3 is used for both the HUD, and a second parallax layer via a horizontal split. Parallax layer does not scroll vertically, so it cannot conflict with the HUD.
If you are willing to have an opaque HUD, then you don't even need to use the same background mode as the rest of the screen. The other part can even be Mode 7.
Or you could build the HUD out of sprites, but that eats away at the number of other sprites you can use.
Many games just used a portion of Layer 3 for the HUD, and overlayed a few sprites on top. This gives you a non-opaque HUD, but has very few colors, and the HUD area can conflict with a possible other use for layer 3.
One example is Castlevania IV, where Layer 3 is used for both the HUD, and a second parallax layer via a horizontal split. Parallax layer does not scroll vertically, so it cannot conflict with the HUD.
If you are willing to have an opaque HUD, then you don't even need to use the same background mode as the rest of the screen. The other part can even be Mode 7.
Or you could build the HUD out of sprites, but that eats away at the number of other sprites you can use.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
Re: Hud
Yes, that's easy. It's probably unnecessary too, because of how flexible the SNES is in terms of tile count and tilemap sizes. But you can't use a BG layer for the HUD if the level uses all of the available layers in the same area of the screen the HUD appears in.
Mode 7 is particularly nasty because you only get one layer, so any overlaid HUD must be sprites. Mode 6 has this problem too, but no one uses Mode 6...
...
Technically you can do a vertical split with an H-IRQ, writing to scroll registers and even BGMODE mid-scanline and covering up (most of) any resulting garbage with sprites. This is not recommended if it isn't absolutely necessary, mostly due to the huge CPU cost of that many interrupts. Also, most emulators don't handle it properly, so your audience will be limited. Of the commercial games, AFAIK only Air Strike Patrol does this, and only with scroll registers, only for a tiny portion of the screen, with a huge transparent gap in the affected layer so it doesn't require glitch masking.
Mode 7 is particularly nasty because you only get one layer, so any overlaid HUD must be sprites. Mode 6 has this problem too, but no one uses Mode 6...
...
Technically you can do a vertical split with an H-IRQ, writing to scroll registers and even BGMODE mid-scanline and covering up (most of) any resulting garbage with sprites. This is not recommended if it isn't absolutely necessary, mostly due to the huge CPU cost of that many interrupts. Also, most emulators don't handle it properly, so your audience will be limited. Of the commercial games, AFAIK only Air Strike Patrol does this, and only with scroll registers, only for a tiny portion of the screen, with a huge transparent gap in the affected layer so it doesn't require glitch masking.
-
- Posts: 611
- Joined: Mon Jan 23, 2006 7:47 am
- Location: Germany
- Contact:
Re: Hud
You could set up a V-IRQ at that part of the screen and only then set up H-IRQs for the relevant line(s).
My current setup:
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
Re: Hud
Yes, you could. Like I said, ASP uses this for a small number of scanlines. It's also just for the mission start text, so the CPU load probably isn't all that important anyway.
I use it for a large number of scanlines. I have a 192-line playfield (that's usually Mode 7) next to a Mode 1 sidebar, and my extended VBlank is 58 lines at the moment, so nearly all of the free lines have interrupts. It's pretty brutal; if I hadn't already been using the Super FX I'd never have considered burning that much CPU time just to make a visually faithful port...
I use it for a large number of scanlines. I have a 192-line playfield (that's usually Mode 7) next to a Mode 1 sidebar, and my extended VBlank is 58 lines at the moment, so nearly all of the free lines have interrupts. It's pretty brutal; if I hadn't already been using the Super FX I'd never have considered burning that much CPU time just to make a visually faithful port...
- Individualised
- Posts: 310
- Joined: Mon Sep 05, 2022 6:46 am
Re: Hud
Doesn't Super Mario World do this?