Author Topic: Simple(?) horizontal pixel scrolling with CRTC  (Read 1810 times)

0 Members and 1 Guest are viewing this topic.

Offline Microprofessor

  • CPC464
  • **
  • Posts: 6
  • Country: de
  • The Z of ICs & Logic
    • Simulationsraum
  • Liked: 0
  • Likes Given: 0
Hi,

I would like to ask for some help/assistance with a little programming question: I want to use the CRTC hardware scrolling in mode 2 for scrolling horizontally a complete (or maybe 50 lines of a) screen with some (BASIC drawn) graphics on it 255 pixels to the left.
 
The problem is: I am only a starter in programming Z80 assembly and don't know the technical specs of the CPC and its CRTC good enough to solve this problem within the next days. (I have got a little presentation in which I want to show the visible difference between "pure" Z80 assembly shifting Bits on the screen and the much softer scrolling with the CRTC).

So, can anybody give me a working assembly script?

Thaks!
µP
P.S. I promise I will learn to write this kind of hardware orientated programs by myself as soon as possilbe! :D

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2278
  • Likes Given: 3478
Re: Simple(?) horizontal pixel scrolling with CRTC
« Reply #1 on: 00:54, 04 June 12 »
Hi,

I would like to ask for some help/assistance with a little programming question: I want to use the CRTC hardware scrolling in mode 2 for scrolling horizontally a complete (or maybe 50 lines of a) screen with some (BASIC drawn) graphics on it 255 pixels to the left.
 
The problem is: I am only a starter in programming Z80 assembly and don't know the technical specs of the CPC and its CRTC good enough to solve this problem within the next days. (I have got a little presentation in which I want to show the visible difference between "pure" Z80 assembly shifting Bits on the screen and the much softer scrolling with the CRTC).

So, can anybody give me a working assembly script?

Thaks!
µP
P.S. I promise I will learn to write this kind of hardware orientated programs by myself as soon as possilbe! :D
You ask for something which is not easy ;)

Pixel by Pixel scrolling in horizontal is a task I will try to solve so others can learn from it. I will publish all my code soon.

On Amstrad Plus it is easy (we have extra hardware for this) (all directions shown here):
http://www.cpctech.org.uk/source/vscroll1p.asm

On CPC it is much harder.
Normal CPC scroll is 16 pixels (in mode 2) horizontal rate. Vertical it is 8 lines.

This code shows this:
http://www.cpctech.org.uk/source/vscroll1.asm

Now it becomes more complex.

For only horizontal (use R3 trick to scroll 8 pixels horizontal rate in mode 2):
http://www.cpctech.org.uk/source/scrlhrz.asm

To move at 8 pixels (in mode 2) horizontal rate and  1 pixel at a time vertical rate:
More complex now to include vertical:
http://www.cpctech.org.uk/source/mess2.asm
This example needs a cpc monitor to work 100%.

The other way needs 8 screens, each is moved by 1 pixel and you cycle through these and use vscroll1.asm example too.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline Microprofessor

  • CPC464
  • **
  • Posts: 6
  • Country: de
  • The Z of ICs & Logic
    • Simulationsraum
  • Liked: 0
  • Likes Given: 0
Re: Simple(?) horizontal pixel scrolling with CRTC
« Reply #2 on: 08:07, 04 June 12 »
Hi,

thanks! The theory about 1 pixel scrolling I learned a few days ago and also found these codes. But how do I do this thing with the 8 screens? Is there a code for this anywhere, too?

µP

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2278
  • Likes Given: 3478
Re: Simple(?) horizontal pixel scrolling with CRTC
« Reply #3 on: 13:35, 05 June 12 »
Hi,

thanks! The theory about 1 pixel scrolling I learned a few days ago and also found these codes. But how do I do this thing with the 8 screens? Is there a code for this anywhere, too?

µP
no code yet, I did not write it.
I will write it, but not in time for you. sorry.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource