Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > upscroll: fast code needed.
2012-03-31 10:58
Flavioweb

Registered: Nov 2011
Posts: 447
upscroll: fast code needed.

i'm coding a fullscreen smooth up scroller.
Actually i'm using some unrolled code to use minimum amount of cycles, but i want to know if there is a well-know method to achehive best results.
Someone can point me in the right direction?
2012-03-31 11:56
Didi

Registered: Nov 2011
Posts: 479
Secure possibility with NTSC compatibility would be to switch between 2 screenpages each time you need to move the screen up by one line. Then you even do not need to unroll the code because you have plenty time to copy the screen onto the hidden page and then just switch the page when it's needed.
2012-03-31 13:02
tlr

Registered: Sep 2003
Posts: 1724
Are we talking bitmap here or just screen ram + color ram?
2012-03-31 13:07
Flavioweb

Registered: Nov 2011
Posts: 447
Quote: Are we talking bitmap here or just screen ram + color ram?


only text and colors.
2012-03-31 15:07
tlr

Registered: Sep 2003
Posts: 1724
Then a combination of double buffering (i.e copying an eight of the screen mem each frame) like Didi says and a (partly?) unrolled piece of code moving color mem in one frame is a solution.

Note here that although moving the color mem has to be done in one frame, it only happens every eight frame.

You could perhaps also utilize the fact that usually the color isn't different for all characters on the screen.
2012-03-31 15:39
Bitbreaker

Registered: Oct 2002
Posts: 501
even easier: scroll up each line from top to bottom after it is displayed. Should be more than possible within one frame and without loop unrolling. No need to do that while the raster is off screen.
2012-03-31 16:05
Flavioweb

Registered: Nov 2011
Posts: 447
Quote: even easier: scroll up each line from top to bottom after it is displayed. Should be more than possible within one frame and without loop unrolling. No need to do that while the raster is off screen.

You mean that:

-start screen scroll using %xxxxx111 in $d011 and count down to %xxxxx000;

-starting from raster line $3b, move up line just displayed (reading data from next one) and go on like this, every 8 lines, until last text line

-put %xxxxx111 in $d011 (under bottom border?) and redo from start.

(of course, putting new content in last line as well...)

Is this what you mean?
2012-03-31 17:15
tlr

Registered: Sep 2003
Posts: 1724
@bitbreaker: If you mean a plain copy then it's not entierly obvious. He wants both screen + color.
lda $0428
sta $0400
lda $d828
sta $d800  ; =16 cycles
...which gives 16*1000 cycles for a full screen, unrolled.

One line unrolled (=40 chars) could work.
2012-04-01 02:19
ChristopherJam

Registered: Aug 2004
Posts: 1381
Only way you're going to get any faster than the techniques mentioned above is by doing something content-aware to take advantage of patterns in the data.

e.g. if your colour ram always has the same colour for adjacent pairs you can halve the number of LDA, or if you are using 2xN tiles where the right hand character IDs are always one higher than the (even) left hand, so you can do an ORA#1 instead of another LDA

Also - do you have "interesting" content the full width of the screen? Or are the first few/last few columns just a tiled background, or perhaps has some useful property like column 0 always having the same value as column 38?

(ps - just noticed that tlr alluded to taking advantage in common colours, so I guess this is not the first comment in this thread on content-aware scrolling after all :)
2012-04-01 04:35
Flavioweb

Registered: Nov 2011
Posts: 447
Quote: Only way you're going to get any faster than the techniques mentioned above is by doing something content-aware to take advantage of patterns in the data.

e.g. if your colour ram always has the same colour for adjacent pairs you can halve the number of LDA, or if you are using 2xN tiles where the right hand character IDs are always one higher than the (even) left hand, so you can do an ORA#1 instead of another LDA

Also - do you have "interesting" content the full width of the screen? Or are the first few/last few columns just a tiled background, or perhaps has some useful property like column 0 always having the same value as column 38?

(ps - just noticed that tlr alluded to taking advantage in common colours, so I guess this is not the first comment in this thread on content-aware scrolling after all :)


I need to scrool full screen width, but for the colors isn't really a problem, because at maximum the color change is done every 2 lines and for 2 lines with same color...
So not problem at all for this.

I coded a scroll like Bitbreaker sayd.
Works just fine. Quite ubeliveable...

Now i just test if can put other things (like music for eg.) because using Bitbreaker method, the cycles not taken from raster time, are distribuited all around the screen...

There are some "cycles" under the border, but i don't know if they are enough to do something...
2012-04-01 05:03
Didi

Registered: Nov 2011
Posts: 479
Play the music in the interrupt and put the move-up routine in normal code triggered by a flag from the interrupt. The rasterline you have to wait for to copy the next line must not be exacly hit and can be higher. Just check on greater not equal.
 
... 5 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Jetboy/Elysium
zscs
bluebirdpod
Apollyon/ALD
Moderators/CSDb Staff
Guests online: 105
Top Demos
1 Next Level  (9.8)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.6)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 No Bounds  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 Layers  (9.7)
2 It's More Fun to Com..  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Rainbow Connection  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Booze Design  (9.3)
3 Censor Design  (9.3)
4 Crest  (9.3)
5 Performers  (9.3)
Top Coders
1 Axis  (9.8)
2 Graham  (9.8)
3 Lft  (9.8)
4 Crossbow  (9.8)
5 HCL  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.066 sec.