News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

software pixel scroll mode 2

Started by arnoldemu, 10:55, 08 March 10

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

arnoldemu

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

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

arnoldemu

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 ;)
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

redbox

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

TFM

Expected to see pixel scrolling, hmm it's byte scrolling :-(
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

arnoldemu

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...
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

TFM

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!
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

nocash

> 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.

arnoldemu

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 :)

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Powered by SMFPacks Menu Editor Mod