It is currently Sat Jan 20, 2018 12:09 pm

 All times are UTC - 7 hours

 Page 1 of 1 [ 5 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Rough x/y split ?Posted: Fri Sep 01, 2017 11:27 am

Joined: Fri May 08, 2015 7:17 pm
Posts: 1910
Location: DIGDUG
Dumb question. Can you do a rough X/Y scroll split with 2 writes to \$2006.

(If I remember correctly, affecting all but the fine Y bits)

I've never tried it.

_________________
nesdoug.com -- blog/tutorial on programming for the NES

Top

 Post subject: Re: Rough x/y split ?Posted: Fri Sep 01, 2017 12:09 pm

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5982
Reference:
https://wiki.nesdev.com/w/index.php?title=PPU_scrolling#Summary

It doesn't set any of the fine X bits, and it sets the top bit of fine Y to 0.

Top

 Post subject: Re: Rough x/y split ?Posted: Fri Sep 01, 2017 12:24 pm

Joined: Fri May 08, 2015 7:17 pm
Posts: 1910
Location: DIGDUG
Ok, I see. So if your fine X is wrong, 2 writes to \$2006 might not be enough for...say...a HUD at the bottom of the screen?

LDA #0
STA \$2005
STA \$2005
LDA #something
STA \$2006
LDA #something
STA \$2006

(ie, during rendering, perhaps after a sprite zero hit)

_________________
nesdoug.com -- blog/tutorial on programming for the NES

Top

 Post subject: Re: Rough x/y split ?Posted: Fri Sep 01, 2017 12:36 pm

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6641
Location: Seattle
That makes the math easier, but makes the raster timing much worse. The first write to \$2005 will immediately cause glitches for the remainder of the drawn scanline.

In contrast, the 6-5-5-6 method requires more calculation, but only the last two writes need to be during horizontal blanking.

Top

 Post subject: Re: Rough x/y split ?Posted: Thu Sep 07, 2017 7:14 am

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7350
Location: Chexbres, VD, Switzerland
dougeff wrote:
Dumb question. Can you do a rough X/Y scroll split with 2 writes to \$2006.

Of course you can. Most games do it that way. My game does it that way too. Fine X scroll stays the same.

Quote:
LDA #0
STA \$2005
STA \$2005
LDA #something
STA \$2006
LDA #something
STA \$2006

(ie, during rendering, perhaps after a sprite zero hit)

This is the "standard" way to do it. All games does it that way. The 6-5-5-6 method was only decovered by the reverse-engineering retroscene in the 2000s.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 5 posts ]

 All times are UTC - 7 hours

Who is online

Users browsing this forum: Bing [Bot] and 14 guests

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

Search for:
 Jump to:  Select a forum ------------------ NES / Famicom    NESdev    NESemdev    NES Graphics    NES Music    Homebrew Projects       2017 NESdev Competition       2016 NESdev Competition       2014 NESdev Competition       2011 NESdev Competition    Newbie Help Center    NES Hardware and Flash Equipment       Reproduction    NESdev International       FCdev       NESdev China       NESdev Middle East Other    General Stuff    Membler Industries    Other Retro Dev       SNESdev       GBDev    Test Forum Site Issues    phpBB Issues    Web Issues    nesdevWiki