[comp.sys.amiga] Help needed on scrolling screens

frank@altera.UUCP (Frank Heile) (08/12/87)

I am trying to write a program which can automatically scroll screens up
and "down".  The scrolling "down" part works fine, but when I try to get
the screen to scroll "up", I get a weird jittery effect where one of the
bit maps seems to be offset relative to the other bit map.  A skeleton of
the code involved in the problem is as follows (from my memory since I don't
have a listing here at work):

    struct View view;
    struct ViewPort viewport;

    /* ... initialize everything ... */

    while (viewport.DyOffset > 0) {

        WaitTOF();

        viewport.DHeight++;     /* make the screen shorter */
        viewport.DyOffset--;    /* scroll this screen UP */

        MakeVPort(&view,&viewport); /* make copper list */
        MrgCop(&view);              /* merge it with other lists */
        LoadView(&view);            /* point copper to new list */
    }

Similar code which increments DyOffset and decrements DHeight scrolls this
screen "down" just fine.  My conjecture of why "down" works but "up" doesn't is
that at the instant of LoadView() the copper is sitting at the instruction
waiting for the beam position to get to DyOffset location so that changing
that to DyOffset++ doesn't cause a problem whereas changing that to
DyOffset-- screws something "up" (somehow).

One observation is that when it is scrolling "down" correctly, there is the
normal one (or two) black line(s) between the two screens where presumably
the copper is reloading the display registers and changing the color map.
When it is scrolling "up" incorrectly there is only a "one inch" black line
on the left hand side of the monitor between the two screens.  The second
screen (which has a depth of 2 bits) appears to have one of its bitmaps
shifted left 1/2 inch relative to the other one which is in the correct
position.

The "up" scrolling problem disappears when the DyOffset is within 30-50 lines
of the top of the display at which point the bitmap relative offset disappers
and everything looks normal.

All this looks to me like a vertical beam position vs. a changing copper
instruction list interaction problem.

What is going on?   How can I fix it?

Reply to the network or send mail to "pyramid!altera!frank".  Thanks!