Author Topic: software pixel scroll mode 2  (Read 3153 times)

0 Members and 1 Guest are viewing this topic.

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
    • Awards
software pixel scroll mode 2
« on: 11: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

« Last Edit: 23:53, 15 March 10 by arnoldemu »
like
0
No reactions
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
    • Awards
Re: software pixel scroll mode 2
« Reply #1 on: 14:56, 16 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 ;)
like
0
No reactions
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline redbox

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.793
  • Country: gb
    • redbox
    • Awards
Re: software pixel scroll mode 2
« Reply #2 on: 15:45, 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
like
0
No reactions

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
    • Awards
Re: software pixel scroll mode 2
« Reply #3 on: 00:10, 17 March 10 »
Expected to see pixel scrolling, hmm it's byte scrolling :-(
like
0
No reactions
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
    • Awards
Re: software pixel scroll mode 2
« Reply #4 on: 11:33, 17 March 10 »
Expected to see pixel scrolling, hmm it's byte scrolling :-(
?
It uses RL to shift the bits.
So it is pixel scrolling...
like
0
No reactions
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
    • Awards
Re: software pixel scroll mode 2
« Reply #5 on: 21:10, 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!
like
0
No reactions
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Offline nocash

  • 464 Plus
  • *****
  • Posts: 352
    • Awards
Re: software pixel scroll mode 2
« Reply #6 on: 15: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.
like
0
No reactions

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
    • Awards
Re: software pixel scroll mode 2
« Reply #7 on: 12:08, 22 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 :)

like
0
No reactions
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource