Jump to content
IGNORED

Fine Scrolling


Recommended Posts

Vertical fine scrolls can be used by setting Bit 5 of each display list instruction and enabling VSCROL at $D405. Does that mean the LMS instruction too? And after setting up, do I scroll by adding or subtracting 40 to the top of the screen address (just like coarse scrolling)? Or is the scroll itself performed by poking to $D405?

Link to comment
Share on other sites

The fine scroll is done only by setting the $d405 register itself. If you want to scroll more than one gr. mode line (AFAIK you can't scroll more scanlines than the height of used graphic mode line), you have to use coarse scroll by changing LMS address.

Link to comment
Share on other sites

You set the vertical scroll bit on all mode lines you want to be scrolled except for the last one. This means you cannot smooth scroll a single mode line. The height of the scrolled region is one mode line less and one scan line more than if it weren't scrolled. For instance, if you have 15 mode 2 lines, the height is (15 - 1)*8+1 = 113 scanlines. This works by changing the height of the starting and ending mode lines, so any DLIs or horizontal scrolling you've got attached to mode lines in the scrolled region will shift as well.

 

The VSCROL register at $D405 sets the scroll amount in scanlines, with increasing values moving the region up by taking lines off the top and adding them at the bottom. VSCROL has four bits, but it should only be set from 0 up to one minus the normal mode height (7 for character modes). Setting it to other values will result in artifacts. You should adjust the screen address by a row at the same time that the VSCROL value wraps around to continue smoothly scrolling.

 

Don't try to set a DLI on the last line of the vertically scrolled region. This can be made to work, but the timing is usually so tight that it breaks.

Link to comment
Share on other sites

Ok, if I'm following, is it correct that you can only vertical fine scroll in one direction? That is, VSCROL lets you scroll zero to 16 scanlines (mode line dependent) but is there a provision to move up or down? Coarse scrolling allows both directions via adding or subtracting a line length. Maybe I'm not understanding how VSCROL works though.

Link to comment
Share on other sites

You can only scroll one way with fine vertical scrolling, but you can scroll the other way by combining it with coarse scrolling. Fine scroll by 7 scanlines one way and coarse scroll by an entire row the other way and you get one scanline of scroll in the other direction.

Link to comment
Share on other sites

You do fine scrolling up by changing VSCROL register to 0,1,2... and scrolling down by 7,6,5... or whatever is your gr. mode line height. Both combined with coarse scroll. For example text mode you want to scroll up so you do VSCROL 0,1,2... 7, then you set VSCROL back to 0 and set LMS to LMS+40 (depends on your screen layout). Vice versa when scrolling down, you have set VSCROL to 7 and LMS to LMS-40 and then changing VSCROL to 6,5,4..0 and then again 7 and LMS-40.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...