NESDev and Strangulation Records messageboards
Forum Index | FAQ | New User | Login | Search

Previous ThreadView All ThreadsNext Thread*Show in Threaded Mode


SubjectNES scrolling new  
Posted byelm_77
Posted on5/30/02 08:17 AM
From IP195.115.64.141  



Since I read you posts ( and mail archive ) regarding to NES scrolling, I'm completly lost ..

What I did before was, writting to VRAM regarding to the value of $2006 and scrolling between NT when CPU was writting to $2005. This was working well for most demos.

After reading the different docs, here is what I understood ( maybe I did understand completely wrong ) ...

In Vblank :

When CPU accesses $2007, we use $2006 as a reference of where to write.
Does that mean that we can not access VRAM this way out of VBlank ???

When CPU writes to $2005, what happens is that $2006 is updated and so there is no real scrolling but an update of where we read/write data in VRAM. Is that true ?

Out of VBlank :

We can not use the $2006 / $ 2007 method to access VRAM because when writting to 2006 there are some updates made to $2005 as described in Loopy's doc.

Vertical scrolling values are ignored out of Vblank ?


As you can see, it is not clear at all for me

Can someone explain ?

Thanks,
Elm







SubjectRe: NES scrolling  
Posted bymcmartin
Posted on5/31/02 04:32 AM
From IP12.234.128.26  



Are you approaching this from an "I want scrolling to work right in my emulator" sense?

There's an internal 16-bit pointer into VRAM which is modified by writes to $2000, $2005, and $2006. Loopy's documents show which bits in the even/odd writes to $2005/$2006 modify which bits of that pointer. It then discusses how the pointer is modified during non-VBLANK. All the Weird Scrolling Tricks wind up falling directly out of those patterns.




SubjectRe: NES scrolling new  
Posted byelm_77
Posted on5/31/02 08:05 AM
From IP195.115.64.141  



I try to understand correctly what happens regarding to scrolling.

Actually what I do is :

when CPU writes to $2006 twice , I get a 16 bits pointer that I use when accesses to $2007 are made.
when CPU writes to $2005, I scroll NT directly ( without modifying the 16 bits pointer )
and so I think that it is wrong ...

What I understood by reading different docs is,

when CPU write twice to $2006 I still got my 16 bits pointer but when it write to $2005, it does not scroll effectivelly but updates the 16 bits pointer in order to simulate a scroll and the same applies when writting to $2000

Is it the good interpretation or is it still totally false ?

Thanks for replies.




SubjectRe: NES scrolling new  
Posted bymcmartin
Posted on5/31/02 10:01 PM
From IP12.234.128.26  



That's close to my understanding of it. Writes to $2000 also change the value of your pointer, too - that's how it switches between name tables.

Studying Loopy's doc more closely, it appears that there are TWO pointers: the "real" pointer (which he calls v), and the "temp" one (which he calls t). Writing twice to $2006 sets everything in t and shoves the value into v (so even your current version does that right). Writing $2000 or $2005 do things to t, but not immediately to v. When it starts drawing the frame (that is, when VBLANK ends), t sends its value to v. At the beginning of each scan line, t puts part of its value into v.

t also seems to have extra bits in it controlling Y scroll values.




Previous ThreadView All ThreadsNext Thread*Show in Threaded Mode
Jump to

Memblers' homepage             Contact Me

Forums powered by WWWThreads Demo