M/C routine for screen scroll

Looking for a Dragon or CoCo game not already in the archive - Then request it here and hopefully it will either be uploaded to the archive or another member can upload it to this forum.
Post Reply
vdc300
Posts: 34
Joined: Mon Mar 30, 2009 11:17 am

M/C routine for screen scroll

Post 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
sixxie
Posts: 1348
Joined: Fri Jul 18, 2008 8:36 am
Location: Hertfordshire
Contact:

Re: M/C routine for screen scroll

Post 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).
vdc300
Posts: 34
Joined: Mon Mar 30, 2009 11:17 am

Re: M/C routine for screen scroll

Post by vdc300 »

Superb

Having fun with this already

Cheers
Post Reply