It is currently Fri Nov 17, 2017 7:58 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sat Nov 04, 2017 6:54 am 
Offline

Joined: Tue Apr 11, 2006 4:08 am
Posts: 248
I have a problem with scrolling two screens (two nametable in all 2KB VRAM). I just wish that at the end of the scrolling would ideally stay on the second nametable ($ 2400). Unfortunately, when the XSCROLL value reaches FF, the second screen is uneven (one pixel).

Two test roms, press any button to start scrolling.

Demo1 - inc scroll, when the value reaches FF, they stop scrolling.
Demo2 - inc scroll, when the value reaches FF, it stops scrolling and set a bit0 in $2000 to change the nametable to 2400. Here is everything ok, the screen stops evenly.

I would, however, without changing $2000 bit0, to do the scrolling so that the screen stopped perfectly on the second nametable. XSCROLL #$FF value secont screen is uneven, and once again the value of 00 is the beginning of the first nametable.

EDIT: Ok, thanks for the info, at least I'm sure now.


Attachments:
File comment: XSCROLL value FF - stopping at end is uneven
demo1.nes [256.02 KiB]
Downloaded 4 times
File comment: Here at the end of the scrolling I switched the nametable address to 2400 (bit0 in $2000)
demo2.nes [256.02 KiB]
Downloaded 6 times


Last edited by sdm on Mon Nov 06, 2017 2:15 am, edited 1 time in total.
Top
 Profile  
 
PostPosted: Sat Nov 04, 2017 7:02 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2981
Location: Tampere, Finland
Why?

(It's not possible. This is why the nametable bits in $2000 exist in the first place!)

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
PostPosted: Sat Nov 04, 2017 7:04 am 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1823
Location: DIGDUG
The scrolling registers are working exactly as they were designed.

With X scroll set to FF, it should be 1 pixel misaligned.

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


Top
 Profile  
 
PostPosted: Sat Nov 04, 2017 8:06 am 
Offline
User avatar

Joined: Wed Apr 02, 2008 2:09 pm
Posts: 1035
To elaborate:

0 shows 256 pixels of nametable 1, 0 pixels of nametable 2.
1 shows 255 pixels of nametable 1, 1 pixel of nametable 2.
2 shows 254 pixels of nametable 1, 2 pixels of nametable 2.
...
255 shows 1 pixel of nametable 1, 255 pixels of nametable 2.

That's the full range of a byte, there's not a value left for 0 pixels of nametable 1, 256 pixels of nametable 2 without changing $2000.

_________________
https://kasumi.itch.io/indivisible


Top
 Profile  
 
PostPosted: Sat Nov 04, 2017 8:29 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10112
Location: Rio de Janeiro - Brazil
The two name tables side by side create a 512-pixel wide area, with pixels numbered 0 through 511, which needs 9 bits to be represented. The scroll registers are only 8 bits, so they can't possibly cover the whole area by themselves. The lower bits of $2000 are effectively the "9th bits" of the scroll values, you absolutely need them if you want total control of the scroll, otherwise you'll run into situations like the one you're in right now, where you can't scroll to certain places.


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 6 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