Vertical scrolling in "Golf"

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
LilaQ
Posts: 29
Joined: Mon Sep 02, 2019 3:28 pm

Vertical scrolling in "Golf"

Post by LilaQ »

Hi guys,

I have a weird problem with Y-Scroll offsets in "Golf". Now, when I fired up Mesen, to see how it is supposed to look, Mesen seems to have something similar as well
(see the attached file). No matter what scanline / cycle I select, the viewport is always off (covering a big part of NT3, and a small part of NT1), but the actual image displayed is correct.

Can someone explain to me what's happening here? I hope I will be able to fix my weird Y-Scroll problem in Golf with more information
(the only reason I can see for a Y-Scroll would be to get rid of the one scanline offset from the prep-scanline)

Thanks in advance!
Attachments
golfscroll.png
User avatar
Dwedit
Posts: 5083
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: Vertical scrolling in "Golf"

Post by Dwedit »

https://wiki.nesdev.com/w/index.php/PPU ... ing_around
Coarse Y can be set out of bounds (> 29), which will cause the PPU to read the attribute data stored there as tile data. If coarse Y is incremented from 31, it will wrap to 0, but the nametable will not switch. For this reason, a write >= 240 to $2005 may appear as a "negative" scroll value, where 1 or 2 rows of attribute data will appear before the nametable's tile data is reached. (Some games use this to move the top of the nametable out of the Overscan area.)
So if you have Y scroll set to 240-255, it will stay on the same nametable when it reaches 256 and resets to 0. It only advances to the next nametable on the transition from 239 to 240, which also resets it to 0.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
LilaQ
Posts: 29
Joined: Mon Sep 02, 2019 3:28 pm

Re: Vertical scrolling in "Golf"

Post by LilaQ »

Thanks, exactly what I figured out in the meantime. Must have forgotten it, when I read the wiki. Works flawlessly now.
Post Reply