I am noticing my emulator does not hide Link under the door frame when he transits through a top-of-screen or bottom-of-screen door in a dungeon. I originally thought it was a problem with sprite priorities and some kind of sprite overlay that hides Link behind, like the effect in BlasterMaster when the vehicle moves through an arch-way. However, I do not see any entries in OAM for sprites for this purpose.
What hides Link? I see other emulators hide him, and I know that not hiding him makes it look rather silly so is obviously wrong...
I should clarify I don't mean he isn't hidden while the screen is scrolling. I mean he isn't hidden as you walk toward the edge, so it looks like he's walking OVER the door frame instead of through the door.
There's 8 other (lower indexed, higher priority) sprites in the same row. Link is only properly hidden if you emulate the 8 sprite limit.
What about horizontal doors in both? I thought they put a higher-priority sprite below the background, so that it brought those background pixels in front of later sprites (including the player).
Also the top and bottom is off by one line too when link is hidden, wont line up correctly with the door. ( bug in zelda ? )
Left and right doors are the sprite masking effect that is used in Super Mario 3 to have sprites come out of pipes or blocks.
I hadn't heard about the vertical going doors using the 8 sprite per scanline limit but it seems that is so. I'm not aware of any other game using the limit like that.
Some of the Ninja Gaiden games use the 8-sprite limit on cutscenes.
Almost gives me a reason to implement that in my emulator now.
I'm pretty sure the left and right doors are made by simply turning Link's sprite priority to background, so that he is below the BG. When passing the right door, the right half of Link becomes behind BG while the left part is still in front of BG, and there is a 8-pixel window that is entierely black so it's impossible to see it.
This wasn't possible for top and bottom doors beacause Link is made of two 8x16 sprites. This would have been possible if he was made of four 8x8 sprites.
As far I know few games uses the sprite clipping trick on purpose. Castlevania (when entering the castle and falling into water + when secret items pops up from the ground), SMB3 (when items pops out of blocks) and Battletoads & Double Dragon (at the screen between stages 1 and 2) are the only ones I can think of.
Mega Man 2 uses it accidentally each other frame in Air Man stage if you jump into the life bar.
Gimmick! uses the 8-sprite limit to make him jump out of the portal at the start of the level.
Nightshade uses the background priority trick to have the character walk behind pillars. In fact, it appears to have a wide range of shapes to use as masks in the pattern table.
Bregalad wrote:
I'm pretty sure the left and right doors are made by simply turning Link's sprite priority to background, so that he is below the BG. When passing the right door, the right half of Link becomes behind BG while the left part is still in front of BG, and there is a 8-pixel window that is entierely black so it's impossible to see it.
I don't believe that is the case. In my emulator sprite priority is implemented and so is sprite masking as used by games like Castlevania and SMB3, but the 8 sprites per line limit is not. When I tested Zelda, traveling left and right through dungeon doors does mask Link like he is going under the tile. This does not happen when going up or down through doors.
EDit: Nevermind, confusion.
Bregalad wrote:
I'm pretty sure the left and right doors are made by simply turning Link's sprite priority to background, so that he is below the BG. When passing the right door, the right half of Link becomes behind BG while the left part is still in front of BG, and there is a 8-pixel window that is entierely black so it's impossible to see it.
Yes, this appears to be correct. The OAM attribute changes from 40h to 60h when moving through the left door.
Bregalad wrote:
This wasn't possible for top and bottom doors beacause Link is made of two 8x16 sprites. This would have been possible if he was made of four 8x8 sprites.
I had implemented the emulation of setting the PPUSTATUS overflow bit but not the behavior of NOT showing more than 8 sprites. Now that I have implemented that Link walks THROUGH doors instead of over them.
Thanks!
Gremlins 2 uses the 8 sprite limit to mask rows for the cutscenes.
These tricks are interesting for homebrew development too. Has anyone collected a few of these tricks as examples/guides or at least lists a few games and what tricks they use? While I don't object to disassembling a ROM to find out bits of what it does, my capacity to do that with more than a handful of games in a few months is limited.
If they're secret bits that nobody wants to share, I understand, but from the comments on this thread it seems somewhat common knowledge.
I especially like tricks that don't require an MMC5 or other sophisticated mappers. Mostly because I am only targeting UNROM and CNROM (edit: I think I mean ANROM, the one with just RAM and PRG that doesn't suck) type carts, and partially because I think it's better to know what a NES can do on its own before trying to dig into the complexities of a "modern" mapper.
AxROM is PRG-ROM and CHR-RAM, with One Screen Mirroring. UxROM is the same think except it has fixed Horizontal or Vertical Mirroring.
MottZilla wrote:
AxROM is PRG-ROM and CHR-RAM, with One Screen Mirroring. UxROM is the same think except it has fixed Horizontal or Vertical Mirroring.
And there is the big difference that AxROM uses 32KB PRG banks, while UxROM uses 16KB banks and has the last one hardwired to $C000-$FFFF, so they are more different than they are alike.
Basically what I was trying to say is that I only target discreet mappers (ie something with components that I can pick up at Jameco or Digikey). Not that I've made anything interesting as of yet, I do happen to have the parts handy just in my collect'o'stuff.
Indeed, I'm not sure why I forgot to mention that.
Jon, the RetroZone MMC1 clone is certainly available for you to use and MMC1 isn't bad at all.
MottZilla wrote:
Indeed, I'm not sure why I forgot to mention that.
Jon, the RetroZone MMC1 clone is certainly available for you to use and MMC1 isn't bad at all.
Yes. I have two. They are a bit more expensive and so far aren't necessary for anything I've written.
blargg wrote:
Some of the Ninja Gaiden games use the 8-sprite limit on cutscenes.
Sorry for the necrobump. Just noticed the wiki (
https://wiki.nesdev.com/w/index.php/Spr ... flow_games) was asking for more details on this, so I played through the game. This is the list of 8 sprite limit masking effects I found in the first Ninja Gaiden:
-In the intro, the zoomed in faces of Ryu's father and Malth are constrained to the black borders using 8 sprites.
-This same zoomed in face palette swapped for Ryu in between Acts 2 and 3 when running; the same for between Acts 3 and 4, and used not running in Foster's office. Finally, in between 6.3 and 6.4 with Ryu talking to his father.
-The ninja jumping after stealing the statue is confined to the black borders between Acts 3 and 4.
-The parachute scene between Acts 3 and 4 is also confined to the black borders, but I'm not sure this actually affects any sprites on screen.
Those are all the ones I found. All the other effects appear to be based on setting background priority.
@GreyRogue -- can you update the wiki with these details? Do you have a Wiki account? If not, please make one (Email validation will not work; server-side crap is broken, not your fault), and Tepples/Memblers/myself can approve the account for editing access. Thanks.