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 > (Vertical) Scroller
2018-04-18 10:49
jamiefuller
Account closed

Registered: Mar 2018
Posts: 25
(Vertical) Scroller

Help!

I've been banging me head against the wall for sometime on this, i've read through so many forum posts but am really struggling so turning to you kind souls for advice.

I am trying to write a very simple scroller, that scrolls the screen downwards (think seuck)

The scroller will be 4 directional, (only ever one direction at a time) but needs to...

1) Scroll the full screen (1 char) every frame
2) not use double buffering (screen switching)

This scroller has to be full screen but doesn't have to worry about colour.

I have 3 of the directions working simply by using some speedcode and racing the raster, it still uses a lot of CPU but works fine for left, right and scrolling data upwards.

On the downward one I cannot race the raster as I need to copy from the bottom up.

So instead of dragging the screen data around I've been thinking about alternatives...

My best idea so far is to use an offscreen memory buffer (80*50) and simply copy from top to bottom, 40*25 chars onto the screen, this works but I am only just ahead of the raster, leaving no cpu for anything else, including adding the new chars.

my code looks like this

scroll_test2
        lda #$c0
        sta $d1
        lda #$00
        sta $d0
        lda #$04
        sta $d3
        lda #$00
        sta $d2
        ldx #$19
@loop   
        ldy #$00

        lda ($d0),y
        sta ($d2),y
        iny
	... the above three lines are repeated 39 time
        lda ($d0),y
        sta ($d2),y

        clc
        lda $d0
        adc #$50
        sta $d0
        bcc @lp1
        inc $d1
        clc
@lp1
        lda $d2
        adc #$28
        sta $d2
        bcc @lp2
        inc $d3
@lp2
        dex
        beq @loop2
        jmp @loop
@loop2
        rts


I'm happy to waste 6k of ram and complete unroll this loop if need be,

Please help me speed this up or give me some advice on how I can do it better?

Thanks
 
... 10 posts hidden. Click here to view all posts....
 
2018-04-18 17:38
jamiefuller
Account closed

Registered: Mar 2018
Posts: 25
Quote: Perhaps and #$0f instead of and $0f ?

Hahaha, I am forever doing that. Nicely spotted!
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
MCM/ONSLAUGHT
Mike
Copyfault/Extend^tsn..
Scrap/Genesis Project
MWR/Visdom
McMeatLoaf
katon/Lepsi De
t0m3000/hf^boom!^ibx
Chesser/Blazon
iAN CooG/HVSC
Walt/Bonzai
Magic/Nah-Kolor
saimo/RETREAM
Steffan/BOOM!
Andy/AEG
Freeze/Blazon
4gentE/ΤRIΛD
hedning/G★P
Guests online: 110
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 No Listen  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 hedning  (9.7)
4 Irata  (9.7)
5 Tim  (9.7)

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