When forwarding is working to new server:
http://www.cpctech.org.uk/source/pixscrl.asm
Working source for pixel-by-pixel mode 2 scroll (software). Written a few years ago:
http://cpctech.cpc-live.com/source/pixscrl.asm
Quote from: arnoldemu on 10:55, 08 March 10
When forwarding is working to new server:
http://www.cpctech.org.uk/source/pixscrl.asm
Working source for pixel-by-pixel mode 2 scroll (software). Written a few years ago:
http://cpctech.cpc-live.com/source/pixscrl.asm
bump. this works now.
More code to follow soon as I convert it and check it. next up will be a software message scroller using LDI written in 1992 ;)
Quote from: arnoldemu on 13:56, 16 March 10
bump. this works now.
Nice scroll and assembled fine for me.
Will have to do some border colour changing to see how fast it is :D
Expected to see pixel scrolling, hmm it's byte scrolling :-(
Quote from: TFM/FS on 23:10, 16 March 10
Expected to see pixel scrolling, hmm it's byte scrolling :-(
?
It uses RL to shift the bits.
So it is pixel scrolling...
Quote from: arnoldemu on 10:33, 17 March 10
?
It uses RL to shift the bits.
So it is pixel scrolling...
Err, got it, took a look at the wrong code before... Sorry!
> rl (hl)
> dec hl
> rl (hl)
> dec hl
> rl (hl)
> dec hl
Why are you using DEC HL instead of DEC L? The scanlines are all aligned to 16-byte boundaries, so you'd need to do the slow DEC HL only on each 16th byte.
Quote from: nocash on 14:09, 20 March 10
> rl (hl)
> dec hl
> rl (hl)
> dec hl
> rl (hl)
> dec hl
Why are you using DEC HL instead of DEC L? The scanlines are all aligned to 16-byte boundaries, so you'd need to do the slow DEC HL only on each 16th byte.
The code did originally use DEC L ;) , but then I thought somebody may want to change the position or size of the scroll (e.g. they were learning to code on the cpc) so I changed it so it would still work.
So the scroll will work, but of course it's not optimal.
I have more code I plan to publish, some old stuff and some of it is not really optimal but is an example of how to do various effects and things.. I hope it will help others, or encourage others to program for cpc.
Lined up:
- software scroll using LDI
- transparent scroll
- hardware scrolling in all directions (message scroller)
- hardware scrolling a game map in 4 directions
- hardware scrolling using reg 3 and reg 5
Bits and pieces that are interesting.
Please feel free to hack it and improve it :)