6 tile offset in "Duck Tales" when using a rope

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

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

6 tile offset in "Duck Tales" when using a rope

Post by LilaQ » Fri Sep 13, 2019 7:30 am

Hi guys,

I'm trying to figure out another problem, that has been keeping me busy for a few days now.
In "Duck Tales", whenever I use a rope / chain to go up or down, I get a weird 6-tile offset (see attached GIF).

When further investigating, the Y-Scroll value immediately starts at 6 when going down. First, I thought I might be doing something wrong, and that my value is wrong (even though Ice Climber works perfectly), but after a bit more research it turns out, Mesen has the same value(s) [read, the last writes to 2006]:

Code: Select all

2006 0x24  46  70   0000
2006 0xc0  46  91   2400
2005 0x00  46 130   24c0
2005 0x00  46 151   24c0
Rendering frame 
2006 0x24 246 189   0000
2006 0x00 246 213   2400
2006 0x24 251  14   2400  
2006 0x20 251  38   2400  
2006 0x27 255 180   2420
2006 0xc0 255 204   2720   
2005 0x00 257  26   27c0   
2005 0x00 257  47   27c0   
2006 0x24  46  78   0000  
2006 0xe0  46  99   2400
2005 0x00  46 138   24e0
2005 0x00  46 159   24e0
Rendering frame
24c0 -> Y-Scroll 6
24e0 -> Y-Scroll 7
etc.

This can also be seen, when looking at the PPU Viewer in Mesen, the viewport is actually lower than what is visible in the actual window.

These values are achieved through Loopy's scrolling docs, including v, t, x, w.

Can someone point out to me what I'm doing wrong? I already thought it has something to do with the UI (that seems to be 6 tiles high as well), but I can't come up with something logical.

Thank you so much in advance!
Attachments
Mesen - difference between PPU viewport and window display
Mesen - difference between PPU viewport and window display
6-tile offset (bugged) Y-scroll
6-tile offset (bugged) Y-scroll

User avatar
rainwarrior
Posts: 7841
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: 6 tile offset in "Duck Tales" when using a rope

Post by rainwarrior » Fri Sep 13, 2019 8:01 am

LilaQ wrote:This can also be seen, when looking at the PPU Viewer in Mesen, the viewport is actually lower than what is visible in the actual window.
The scroll position changes in the middle of the screen. At the bottom of Mesen's PPU viewer there is a "scanline" option. If you set this to 0, it will show you instead the scroll position for the top of the screen where the status bar is.
Last edited by rainwarrior on Fri Sep 13, 2019 8:06 am, edited 2 times in total.

LilaQ
Posts: 25
Joined: Mon Sep 02, 2019 3:28 pm

Re: 6 tile offset in "Duck Tales" when using a rope

Post by LilaQ » Fri Sep 13, 2019 8:06 am

Makes sense, it's static as the UI is always static. But how can I get rid of this 6 tile offset?

User avatar
rainwarrior
Posts: 7841
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: 6 tile offset in "Duck Tales" when using a rope

Post by rainwarrior » Fri Sep 13, 2019 8:07 am

Though, perhaps the problem is that when you split the Y scroll with $2006 you should be setting that position immediately? It is not relative to the top of the screen. If you set the Y scroll to 50 on scanline 70, you will see nametable line 50 on render scanline 70. It is not nametable line 50+70 as if it was relative to the top of the screen. It starts over at that split point.

LilaQ
Posts: 25
Joined: Mon Sep 02, 2019 3:28 pm

Re: 6 tile offset in "Duck Tales" when using a rope

Post by LilaQ » Fri Sep 13, 2019 8:18 am

That's actually exactly the same thing I was thinking about right now. So, I should set the Y-Scroll relative to the scanline it is being set on! I will try that, thanks!

LilaQ
Posts: 25
Joined: Mon Sep 02, 2019 3:28 pm

Re: 6 tile offset in "Duck Tales" when using a rope

Post by LilaQ » Fri Sep 13, 2019 9:32 am

I had to account for negative (relative) scrolling values, but now everything looks as it is supposed to be! Thanks you so much! :)
Attachments
dt_fixed_yscroll.gif

Post Reply