[comp.sys.cbm] Another Smooth-Scrolling ML question

byrd@husc7.HARVARD.EDU (John "The Squid" Byrd) (12/05/89)

In article <3408@jarthur.Claremont.EDU> kfink@jarthur.Claremont.EDU (Kevin Fink) writes:

>I am still having problems getting smooth scrolling to work. I am using
>double-buffering but it is still flickering. I think I know why.

Are you sure?  Maybe I'm missing something, but I didn't see the double-
buffering portion of the program just typed in.  Double buffering
refers to maintaining two complete and separate screens in memory and
swapping them occasionally.  There was a long thread of articles explaining
why smooth scrolling is tough to do without double buffering (the screen
scroll must be completed in less than 1/60 of a second).

-------------------------------------------------------------------------------
John Byrd              ! 
byrd@husc7.harvard.edu !        "Uh, could you repeat the question?" 
Q-Link: John Byrd      !                         - Sid Vicious
CompuServe: 74506,3612 !
-------------------------------------------------------------------------------

kfink@jarthur.Claremont.EDU (Kevin Fink) (12/05/89)

My brother has another question.

-----------------------------------------------------------------------------

I am still having problems getting smooth scrolling to work. I am using
double-buffering but it is still flickering. I think I know why.

Try turning on the computer and typing this BASIC program:
10 Y=53265
20 X=X-1:IF X=-1 THEN X=7
30 POKE Y,(PEEK(Y) AND 248) + X : GOTO 20

Make sure you have plenty of garbage on the screen when you run this,
especially near the bottom. When I ran it, (1) a black line flickered up the
screen, and (2) the letters flickered. The area the letters flickered
'rolled' up the screen. The black line can be taken care of by turning the
screen black. I can't figure out why the letters are flickering, since I'm
only using the VIC-II chip's built-in scrolling. They don't only flicker
when jumping the seven bits, either.

I also modified line 20 to read:
20 X=X+1:IF X=8 THEN X=0

This scrolled the screen down instead of up. The screen flickered much less
this time.

I decided this was because of the position of the raster, so I wrote the
following assembly language program:
[ed. note: I think he's using the LADS assembler from some book or something.]

10 *=49152
11 .S
12 .O
20 X = 820
30 WEDGE SEI:LDA #<INT:STA $314:LDA #>INT:STA $315:LDA $D011:AND #$7F:STA
$D011
40 LDA #251:STA $D012:CLI:RTS
50 INT LDA $D011:AND #248:ORA X:STA $D011:JMP $EA31

That program scrolls the screen based on the contents of the memory location
820, but only when the raster is at the set value. The hexadecimal machine
code for the program is:
C000: 78 A9 1A 8D 14 03 A9 C0
C008: 8D 15 03 AD 11 D0 29 7F
C010: 8D 11 D0 A9 FB 8D 12 D0
C018: 58 60 AD 11 D0 29 F8 0D
C020: 34 03 8D 11 D0 4C 31 EA

To use this program, enter it into memory, then write the following BASIC
program:
1 X=PEEK(820):X=X-1:IF X=-1 THEN X=7
2 POKE 820,X:GOTO 1

This didn't help at all. By adjusting the raster position which caused the
interrupt, I could make the flickering get worse, but I couldn't improve it
much.

The demonstration program my reference guide lists scrolls up a line of
HELLOs, which don't flicker at all because when one flickers a 'shadow
image' down, it is indistinguishable from the HELLO below it. Is there some
way to eliminate the flickering, or will I have to use the same method?

-----------------------------------------------------------------------------

Once again I have no idea what he is talking about, but he'd appreciate a
response.

Thanks.

Kevin Fink

po87553@tut.fi (Ojala Pasi Juhani) (12/11/89)

You talked about scrolling the screen downwards.
I know what could be wrong in your approach. You see, VIC-chip is
not very complicated, in fact, it is quite silly..

It is fairly easy to make VIC think that it should do something it
wasn't designed to do. For example: opening borders, using more than
8 sprites, scrolling the whole screen FAST.. And this last
one is related to your 'problem'. I try to make clear how this
fast scroll is made and then you find out this problem also..

Just before VIC is going to start drawing the screen, we scroll it one
pixelline down, so VIC thinks it is not time to start drawing the
screen, and when the screen is scrolled to 7, the next value is 0,
and the poor VIC will never start to draw the screen.. So, you can
very fast scroll e.g. a hi-res picture off the screen, and I mean
FAST..

And if you change the y-scroll register when the VIC is drawing a
text-line, it won't start drawing another until it reaches that
line in scroll register (the lower 4 bits), so there may be some
space between those textlines. It is possible to change every line's
distance to the other and so on.



 -- Pasi Ojala, 39230 Osara, Finland --
-- 
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
 Pasi Ojala       Pasbox v2.6     Why does my signature keep changing??
 po87553@tut.fi   C64 forever     Am I doing something wrong?
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>