It is currently Mon Oct 23, 2017 6:37 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Scrolling
PostPosted: Sun Aug 14, 2016 12:30 pm 
Offline

Joined: Sat Jun 25, 2016 5:33 am
Posts: 66
Hello NES dev :D
I have a question about scrolling

I understood how the loopy_v and loopy_t makes scrolling possible, my question is from programmer point of view

as I understood, I f i will use vertical mirroring , I put the name table data in " a " name table and the hidden screen in the "b" name table section
http://wiki.nesdev.com/w/index.php/File ... iagram.png

then during programming , when I detect that the player is near the edge and pressing , I write the x and y of the top left tile to scroll in the next frame
first , am I right in what I said ?
second , if I am right, when I debugged a game to see this , I haven't seen that ! so why ?


Top
 Profile  
 
 Post subject: Re: Scrolling
PostPosted: Sun Aug 14, 2016 1:41 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7235
Location: Chexbres, VD, Switzerland
You are right, but the problem is that scrolling by giving the adress of tiles by $2006 only control coarse scrolling. This is largely inpractical, and this is normally used only in split-screen raster effects (aka scroll changes in the middle of the screen) because we have no choice. But when we do "plain" scrolling, we use $2005 and $2000 writes only, since this allow us to control not only the coarse scrolling, but also the fine scrolling (i.e. where to scroll within a 8x8 tile). I hope that made sense.


Top
 Profile  
 
 Post subject: Re: Scrolling
PostPosted: Sun Aug 14, 2016 1:50 pm 
Offline

Joined: Sat Jun 25, 2016 5:33 am
Posts: 66
ok this is good,
So why i didn't see this in emulator ppu debugger?


Top
 Profile  
 
 Post subject: Re: Scrolling
PostPosted: Sun Aug 14, 2016 1:59 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19116
Location: NE Indiana, USA (NTSC)
Which game are you trying? Try putting a breakpoint on writes to $2005.


Top
 Profile  
 
 Post subject: Re: Scrolling
PostPosted: Mon Aug 15, 2016 7:27 am 
Offline

Joined: Sat Jun 25, 2016 5:33 am
Posts: 66
I was trying in megaman game

I used an open source emulator to view the name tables but what I found that 2 name tables are similar ( due to mirroring ) and the other two are black ( I expected to see the next screen in them )


Top
 Profile  
 
 Post subject: Re: Scrolling
PostPosted: Mon Aug 15, 2016 10:58 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7235
Location: Chexbres, VD, Switzerland
Muhammad_R4 wrote:
I was trying in megaman game

I used an open source emulator to view the name tables but what I found that 2 name tables are similar ( due to mirroring ) and the other two are black ( I expected to see the next screen in them )

Oh then you tried a Mega Man in the 3-6 range. Those have a rather unconventional scrolling engine, where, like you observer, only one name table is used. They use the horizontal mirroring when scrolling horizontally and vertical mirroring when scrolling vertically, in order to never show the 2nd name table, which is reserved for special effects/animations and minibosses.

You can observe, for example, Mega Man or Mega Man 2 in order to see more convnetional scrolling in action.


Top
 Profile  
 
 Post subject: Re: Scrolling
PostPosted: Mon Aug 15, 2016 11:26 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19116
Location: NE Indiana, USA (NTSC)
That is, if you call Battletoads and Super Mario Bros. 3 "unconventional". But seeing as they were released later in the NES's life, perhaps they are.


Top
 Profile  
 
 Post subject: Re: Scrolling
PostPosted: Mon Aug 15, 2016 1:00 pm 
Offline

Joined: Sat Jun 25, 2016 5:33 am
Posts: 66
Alright
I have debugged megaman 2 and found u said

but what is the other way to scroll with only 1 nametable ?


Top
 Profile  
 
 Post subject: Re: Scrolling
PostPosted: Mon Aug 15, 2016 2:46 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19116
Location: NE Indiana, USA (NTSC)
Turn off the "display left 8 pixels" bits in PPUMASK. Then update single 8-pixel-wide columns of the nametable that enter this area. Because 16-pixel-wide attribute columns straddle this area, some artifacts are unavoidable unless you have 15 sprites to spare and not many per line. These artifacts can be seen at the far right of the screen in Super Mario Bros. 3, for instance.


Top
 Profile  
 
 Post subject: Re: Scrolling
PostPosted: Tue Aug 16, 2016 8:28 am 
Online
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10067
Location: Rio de Janeiro - Brazil
Alfred Chicken and Felix the Cat are examples of games that use a column of sprites on the far right of the screen, combined with background masking on the left side of the screen, to completely avoid horizontal scrolling glitches.

As a general rule, the tile map needs to be larger than the viewport by at least the width/height of 1 block of which scroll updates consist of, in order for there to be no scrolling glitches. On the NES, blocks are usually 16x16, since that's the smallest area affected by background attributes. Many capcom games use 32x32 blocks when updating the background, though, so those need more extra room for scroll updates.

Under normal circumstances, the NES has plenty of room for updates in one axis, which depends on the type of name table mirroring you use, but the other axis ends up with no extra space at all. Many games didn't care about this and just left the glitches there (or partially masked them), hoping that the televisions of the time wouldn't make them very obvious.

With 1 screen mirroring, you have to worry about glitches on both axes, since there's no extra room in any direction. You can either reduce the viewport and make room for the updates, by masking the leftmost 8 pixels and using sprites to hide the rightmost 8 pixels, in the case of horizontal scrolling, and/or disabling background rendering at the top and bottom 8 scanlines (Jurassic Park does this using CHR bankswitching and all black tiles), in the case of vertical scrolling. Or you can just leave the glitches there, like many developers back in the day did.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: lazerbeat, Nicole, Sumez, tokumaru, Yahoo [Bot] and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group