| |
8bitforever Account closed
Registered: Oct 2009 Posts: 48 |
Smooth horizontal bitmap scroller ($d016)
8bitforever is back after a 14 month coding break.
I´m trying hard to develop a $d016 bitmap (koala pic) scroller. But it flickers sporadicly.
The jitter/flicker is a 1 char movement of the bitmap.
<-<-<-<-<-
__________
|JJOKOKOK|
|JJOKOKOK|
|JJOKOKOK|
|JJOKOKOK|
__________
JJ=Jitter or flicker area. This can happen in 15-25% of the screen area.
OK=Perfect smooth scrolling of the bitmap (koala pic).
<-=Horizontal Scroll direction.
No VSP/HSP suggestions please.
1) Why do I have jitter/flicker in 15-25% of the screen area ?
2) Suggestions on how get rid of the jitter/flicker ?
|
|
| |
FATFrost Account closed
Registered: Sep 2003 Posts: 211 |
Did you check codebase64 for infos? maybe something there, if not just rip it and cred the original author, should be cool.
Also optimising will help a lot, and it will also help to look at other peoples scroller code to see what tricks are performed. ;) |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Stupid question, but I must ask since you drew that IJJOK-picture so nice: Have you set the display to 38-column mode? (bit 3 of $d016) |
| |
turtle Account closed
Registered: Mar 2005 Posts: 44 |
remember to not let the rutine eat ratertime there you scroll ($d016)
that was my problem then i made my bitmap scroller |
| |
8bitforever Account closed
Registered: Oct 2009 Posts: 48 |
Yes, Jackasser,
the display is set to 38-column mode (bit 3 of $d016).
I only touch the last bits 0-2 of $d016 to smooth scroll. |
| |
SIDWAVE Account closed
Registered: Apr 2002 Posts: 2238 |
copy the chars+colors at the correct time ?
also, use an unrolled loop. |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: Yes, Jackasser,
the display is set to 38-column mode (bit 3 of $d016).
I only touch the last bits 0-2 of $d016 to smooth scroll.
Ok good, also please notice that you can't scroll a full bitmap without glitches using only the CPU unless you double buffer it. remeber lda+sta = 8c. 8*10000 = 80000 cycles. So what you need to do is to copy 1/8 of that amount each frame and on the 8th frame switch buffer ($dd00). During the 8th frame you must also copy the whole $d800 memory in one quick go properly synced to the raster line otherwise you'll get color-glitches. |
| |
Ed
Registered: May 2004 Posts: 173 |
Quote: Ok good, also please notice that you can't scroll a full bitmap without glitches using only the CPU unless you double buffer it. remeber lda+sta = 8c. 8*10000 = 80000 cycles. So what you need to do is to copy 1/8 of that amount each frame and on the 8th frame switch buffer ($dd00). During the 8th frame you must also copy the whole $d800 memory in one quick go properly synced to the raster line otherwise you'll get color-glitches.
And it is even possible to load during meanwhile if you do it proper. I used to load demo parts with a 1-bit loader when I scrolled my bitmaps in Courtesy of Soviet.... |
| |
8bitforever Account closed
Registered: Oct 2009 Posts: 48 |
Jackasser,
Actually it´s only a four char high bitmap.
So I don´t undeerstand why I cannot get rid of the jitter/flicker ? |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: Jackasser,
Actually it´s only a four char high bitmap.
So I don´t undeerstand why I cannot get rid of the jitter/flicker ?
4 char high bitmap with colors = (320+80)*4 = 1600. lda+sta = 8c => 1600*8 = 12800 ~= 69% cpu usage completly unrolled. Are you 100% sure you copy fast enough and also do it behind the raster beam?
1) Copy fast, really fast.
2) Start the copy just when the raster beam have passed those 4 chars.
3) update $d016 before you reach the chars again. |
| |
8bitforever Account closed
Registered: Oct 2009 Posts: 48 |
Thanks Jackasser,
going to check the code tonight again. |
... 7 posts hidden. Click here to view all posts.... |
Previous - 1 | 2 - Next |