Page 1 of 1

M/C routine for screen scroll

Posted: Mon Apr 27, 2009 11:56 pm
by vdc300
Hi

I'm after a good m/c routine to scroll pmode1 left/right, quite happy with 8 bit shift, but any would do.

Also m/c routine to do the same with the text screen.

If there is an article in a NDUG or up2date, even DU, then please point me in that direction.

Thanks

Re: M/C routine for screen scroll

Posted: Tue Apr 28, 2009 7:37 am
by sixxie
At its very simplest:

Code: Select all

left    ldx     #start
1       ldd     1,x
        std     ,x++
        cmpx    #end
        blo     1B
        rts

right   ldx     #end
1       ldd     -3,x
        std     ,--x
        cmpx    #start
        bhi     1B
        rts
Substitute text labels for the numeric back-referenced labels if your assembler won't do those.

For text mode, start=$0400, end=$0600. For PMODE1, start=$0600, end=$1200 (add $0600 to both if DOS is attached).

This can be made a *lot* faster with some additional complexity (or a *lot* slower if you want to scroll anything less than a byte at a time).

Re: M/C routine for screen scroll

Posted: Mon May 04, 2009 9:03 pm
by vdc300
Superb

Having fun with this already

Cheers