News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Puresox

Dummies guide to Amstrads scrolling abilities....

Started by Puresox, 22:02, 09 December 16

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Puresox

I am trying to understand what the CPC's scrolling capabilities are, as I really am not sure on Whats what with it.? As I am not a programmer I am not familiar with these things.
When I was a kid I thought that the CPC didn't have hardware scrolling abilities and the sight of plenty of jerky games confirmed this. However since coming onto the CPCWiki forum ,I've heard people state 'crertain games are utilising the CPC's hardware scroll'.
Any chance of giving a run down on why hardware scroll was not used in plenty of games,
-was it because people were not aware of it?
-Or was it due to limitations?
- Does the hardware scroll work in the same Fashion Vertically as well as Horizontally
- Are the speed of the scroll limited,or is it highly variable ?
Thanks.

genesis8

#1
Hardware scroll only on CPC+ range of computers, not the first three models (464, 664 and 6128).

B-Asic v3.4 by longshot permits to use hardware scrolls with basic (rsx commands) on Amstrad CPC+.

Programmers are better now at using CPC hardware.
____________
Amstrad news site at Genesis8 Amstrad Page

AMSDOS


I don't have all the answers to that, there are probably games written in the past which could have used one scrolling routine over another. Hardware scrolling isn't necessarily smooth, Wonderboy for example has a Hardware Scroll.
Harrier Attack on the other hand is a series of Loops and a LDIR instruction to shift the position of the screen, your Plane in that game blinks because the plane needs to be deleted and redrawn as you travel through the game.
The 2 game variations of Get The Cash I made the early version I made uses the firmware SCR SW ROLL to Selectively Roll a portion of the screen Top to Bottom, this is described as a Software Scroll, unlike SCR HW ROLL which rolls the whole screen which has been described as a Hardware Scroll, though both Roll the screen the Height of a Text Cursor (which is 8 lines). Because I was physically moving the screen, objects in my game were flickering, so my later version uses a fake scroll to have the code move the money bags & brick walls through the playing field. Using this approach the screen doesn't move whatsoever, however if you get to the end of the game, the end of game sequence is using Software Roll to move the characters up and down the screen & on the Opening Loading Sequence I'm using similar technique as well as SCR GET LOCATION & SCR SET OFFSET for the Horizontal effect. That effect moves the whole screen, so it works best is nothing else is on the screen, it only survives I think because it's basic way to Horizontally Move the screen.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Puresox

#3

Quote from: genesis8 on 23:52, 09 December 16
Hardware scroll only on CPC+ range of computers, not the first three models (464, 664 and 6128).

B-Asic v3.4 by longshot permits to use hardware scrolls with basic (rsx commands) on Amstrad CPC+.

Programmers are better now at using CPC hardware.
Right, so it is true then the ordinary CPC  didn't have scrolling. I wanted to check because a guy was making a point regarding Operation Wolf on the Atari St , he seemed to rate The ST version of OP Wolf , but I reckoned that the ST could have produced a far better game. I then mentioned how superb the CPC version was which Is a computer which doesn't have Hard Scroll. The guy insisted that CPC had the ability . So at that point I shut up cos wasn't sure whether I was wrong. I'm certain  that it has been mentioned in the forum that there is a form of Hard scroll for the standard CPC.
So as we stand the standard CPC does not have hardware scroll.
Posted this at the same time as AMSDOS,s reply so amended as Amsdos tells us that Hardware scroll is available

AMSDOS

Unfortunately I don't have a lot of detailed knowledge about the CPC+. In a sense it has Hardware Sprites (the CPC has not), so the Hardware Scrolling @genesis8 is referring to, is seperate from the Hardware Scrolling in a CPC, so I'm presuming the CPC+ Hardware Scroll gives the programmer a set of tool to easily code it into ones program, on a CPC the coder has to worry about all the other things which need to happen as a result of moving the screen, which is probably where most coders have a different approach to the same problem.
I'm just going by the Information from the Unofficial Amstrad WWW Resource which details "A list of games that use demo programming techniques.", but it also talks about SCR HW ROLL as being a Hardware Scroll in the Source Code, which rolls the screen either up or down. That particular instruction is a part of the Firmware, so in a sense is a tool for the programmer, but as I mentioned earlier it shifts everything either up or down 8 pixels (one cursor line) and the coder has to delete/redraw anything they don't want to move, but I would have imagined that to be happening on a Plus, though it probably has better management of moving scenery across the screen and not having to worry about it appearing on the other side of the screen and perhaps more versatile on the size of the area to move and what direction to move it?
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

andycadley


Quote from: Puresox on 00:13, 10 December 16
Right, so it is true then the ordinary CPC  didn't have scrolling.


No. Although from a gaming perspective, it's mostly true.


The ordinary CPC models are arranged so that there screen display fits within one of four 16K blocks of main memory. How far into that memory block it starts can be configured in Mode 1 sized character chunks (with the screen "wrapping" around inside the block). Adjusting this value will therefore cause the screen to scroll in Mode 1 sized amounts in any direction - adding one causes the screen to shift to the left, subtracting one to the right, adding 40 scrolls up etc. This is why BASIC, for example, is always responsive in scrolling program listings - it's letting the hardware do all the work and not actually shifting any data around at all.


It works very well for text screens but less so for games. For one thing it's usually too big a movement for playable games since you either have to shift the screen around so quickly nobody has chance to react or you only scroll every few frames at which point everything seems to jerk about anyway and the benefits of "hardware scrolling" are lost. There is also that "wrapping" issue, which makes screen addressing on a shifted screen display more complicated than usual, potentially complicating things like sprite routines and there isn't much benefit to scrolling smoothly if the entire game is slowed down by more complicated sprite logic.


That said, there are certain hardware tricks that can be used to improve the resolution of the scroll beyond what it is supposed to be able to do, Mission Genocide being a fine example of how well it can work when done right. The downside of such tricks is that they're more complicated to program and aren't necessarily universally compatible. Some don't entirely work on different CRTCs (or need subtly different values programmed), some don't always work on TVs through a modulator etc.


The Plus range augment the scrolling capabilities via a new (and confusingly named) Soft Scroll Control Register in the ASIC. This allows you to shift the screen up to 16 Mode 2 pixels horizontally and 7 Mode 2 pixels vertically and thus is more reminiscent of the hardware scrolling in machines like the C64, allowing shifting the display by up to a Mode 1 character in either direction. By combining the two methods you actually go one better than the C64 and can pixel scroll the display in any direction without ever having to actually move anything around in memory at all. Hardware sprites are a major boon in this instance because they aren't affected by the screen addressing changes making the whole thing just a lot nicer and removing much of the display complexity around wrapping.

andycadley


Quote from: AMSDOS on 01:44, 10 December 16
That particular instruction is a part of the Firmware, so in a sense is a tool for the programmer, but as I mentioned earlier it shifts everything either up or down 8 pixels (one cursor line) and the coder has to delete/redraw anything they don't want to move, but I would have imagined that to be happening on a Plus, though it probably has better management of moving scenery across the screen and not having to worry about it appearing on the other side of the screen and perhaps more versatile on the size of the area to move and what direction to move it?
Hardware scrolling always affects the entire screen display, in both the original and Plus variants. The trick if you want a static section is to hardware scroll the screen and then "software scroll" the static section back in the opposite direction so that it appears static (assuming of course that your scrolling region is larger than your static one!) Anything too fancy, like scrolling a Window in BASIC, is generally better done with software scrolling routines.


The Plus however, has a few more tricks up it's sleeve. Firstly you can adjust the SSCR at any point in the display and the effect takes place instantly. So if you want to reset the scrolling at a certain point you just need to wait for that scan line and reprogram the register, something made considerably easier by the fact you can configure raster interrupts to fire on specific scanlines rather than the fixed points of the original models. Secondly you can start a new screen display coming from a separate 16K bank on any given scanline (like "rupture splitting" only a lot easier), so that any character scrolling in effect won't move your fixed screen section nor will you have to worry about screen wrapping causing issues.

roudoudou

CPC+ offer a pixel precise shift into the first memory word displayed and a split screen facility.


This is still not a true scrolling management
My pronouns are RASM and ACE

Axelay

Quote from: andycadley on 06:21, 10 December 16

No. Although from a gaming perspective, it's mostly true.


It works very well for text screens but less so for games. For one thing it's usually too big a movement for playable games since you either have to shift the screen around so quickly nobody has chance to react or you only scroll every few frames at which point everything seems to jerk about anyway and the benefits of "hardware scrolling" are lost. There is also that "wrapping" issue, which makes screen addressing on a shifted screen display more complicated than usual, potentially complicating things like sprite routines and there isn't much benefit to scrolling smoothly if the entire game is slowed down by more complicated sprite logic.




I don't really agree with this.  If the question was about CPC hardware scrolling being as versatile as on say the C64, or can 50fps mutli-directional scrolling be achieved in any given case, then of course the answer is no.  But the comparison that is relevant in my view, is how does the CPC hardware scrolling compare to software scrolling as it was often ported from the spectrum, and in many cases, those games have tiny play areas, single digit frame rates, and as often as not, actually scroll in character steps, just like the hardware scroll anyway!


So even ignoring more advanced CRTC use for fine scrolling and sticking with the coarse scroll, I think there are benefits to the CPC hardware scroll in games.  Not throwing buckets of cpu time at shifting the screen means you have plenty for those more complex sprite routines, and if you can make the same game work with a 50%+ bigger play area and up to double the frame rate, I see that as only a good thing for the game play.  I think games like 5th axis, Boulder Dash, Eagles Nest and Monty Python all show examples of how simple coarse scrolls can work well.  Not everyone will be a fan of those scrolling implementations, or the games for that matter, and of course these approaches would not suit every game, but to me those larger 12-16kb play areas and generally higher frame rates than you get in most software scrolling games is an obvious benefit to those games.

arnoldemu

Quote from: roudoudou on 08:22, 10 December 16
CPC+ offer a pixel precise shift into the first memory word displayed and a split screen facility.


This is still not a true scrolling management
In that case the c64 doesn't have a true scrolling management.

It can pixel shift the graphics but then you still need to move all the graphics after you have used all the shifts.

Some c64 games make this quicker because they use chars for the display.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

arnoldemu

#10
Yes the CPC has hardware scrolling. It does this by changing the start address for the screen and the graphics wrap at 16KB.
For horizontal, you add/subtract 1 from the start address.
For vertical you add/subtract 40 from the start address (based on the default screen width).

Do this over and over and you have vertical or horizontal scrolling or both.

Some games use it but not a lot.

It has limitations.

Normally it's 8 lines vertical movement and mode 1 char horizontally.
So it's fast and chunky. This often makes it unsuitable.

To use it you update the screen start, then draw a column and/or row (depending on if you are scrolling horizontally, vertically or both).

It operates on the entire screen too.

Demo programmers showed that you can overcome some limitations:
1. some part scrolling, some part static
2. 1 scan-line scrolling vertically (ok on all monitors and televisions)
3. 1/2 a mode 1 char horizontally (monitor/television response permitting)

A lot of game programmers either didn't know how to do the demo tricks, or they couldn't make them work with all cpcs, or they couldn't make them stable or it was too fast a scroll.

Also, hardware scrolling has one other complication:

At the point of screen wrapping the calculations for drawing sprites are a bit more complex.

So I think it comes down to:
- it was too fast and they didn't want it that fast
- they didn't know how to make it smoother
- they were porting from spectrum and just converted it's software scrolling.

Plus gives extras to help.

C64 in comparison:

- you can shift the screen by 8 pixels
- if you want to scroll the screen you then need to copy the graphics (bitmap mode and about 8K) OR copy chars (much less ~1K)
- if copying chars they split it over multiple frames to reduce time
- they could easily split the screen into scrolling and static.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

arnoldemu

looking at a lot of the commercial games that used cpc's hardware scrolling it seems like the programmers didn't know how to use it or didn't have time to use it properly.

They do stupid things like pause all the action while scrolling, or if you need to move diagonally they move horizontal THEN vertical when both can be done. This really gave a bad impression.





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

reidrac

Quote from: arnoldemu on 12:18, 10 December 16
In that case the c64 doesn't have a true scrolling management.

It can pixel shift the graphics but then you still need to move all the graphics after you have used all the shifts.

Some c64 games make this quicker because they use chars for the display.

I guess people refer as "hardware scroll" when the hardware provides some sort of assistance; then CRTC tricks or changing the video memory address could get into this category; but I don't think was designed as a away to do scroll, I see them like the tricks you can do in the speccy to get more colours in a 8x8 char; that doesn't mean the platform supports more colours.

Because of that I agree with the idea that the CPC range (not the CPC+) don't have that hardware assistance, and hence "no hardware scroll".

I don't see this a big deal to be honest. You can make games that show more colours that in any other 8-bit home system, and that has value; even if that means you're limited when trying to implement scroll. Use the strengths and get the best you can from the weaknesses.
Released The Return of Traxtor, Golden Tail, Magica, The Dawn of Kernel, Kitsune`s Curse, Brick Rick and Hyperdrive for the CPC.

If you like my games and want to show some appreciation, you can always buy me a coffee.

andycadley


Quote from: Axelay on 12:15, 10 December 16But the comparison that is relevant in my view, is how does the CPC hardware scrolling compare to software scrolling as it was often ported from the spectrum, and in many cases, those games have tiny play areas, single digit frame rates, and as often as not, actually scroll in character steps, just like the hardware scroll anyway!
I'm not sure that's entirely fair on many conversions. Look at the good example like Batman The Movie, Robocop etc and they're just not something that's feasible using only character based scrolling. That said, I was mostly thinking of the kinds of (mostly) continuous scrolling shooters etc, where getting a consistent fluid scroll is most important - certainly there are other varieties of game where coarser scrolling is not so bad and there are plenty of games that could have benefitted from it rather than using a quick port from the speccy.

arnoldemu

Quote from: reidrac on 12:36, 10 December 16
I guess people refer as "hardware scroll" when the hardware provides some sort of assistance; then CRTC tricks or changing the video memory address could get into this category; but I don't think was designed as a away to do scroll, I see them like the tricks you can do in the speccy to get more colours in a 8x8 char; that doesn't mean the platform supports more colours.
Interesting.

To me, changing the screen address to do the scroll is a simple thing that can be done easily and has no tricks to it. The screen moves. You need to do some drawing with the cpu to plot graphics to scroll a map, but the same is true of the Plus and c64.

So does the Plus have hardware scrolling?

And does the C64 have it?

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

andycadley


Quote from: arnoldemu on 12:46, 10 December 16
To me, changing the screen address to do the scroll is a simple thing that can be done easily and has no tricks to it. The screen moves. You need to do some drawing with the cpu to plot graphics to scroll a map, but the same is true of the Plus and c64.
What's more, I'm pretty sure that feature exists in hardware precisely to give the ability to scroll text based screens easily.

arnoldemu

Quote from: andycadley on 12:46, 10 December 16
.. That said, I was mostly thinking of the kinds of (mostly) continuous scrolling shooters etc, where getting a consistent fluid scroll is most important - certainly there are other varieties of game where coarser scrolling is not so bad and there are plenty of games that could have benefitted from it rather than using a quick port from the speccy.

MSX Nemesis:


Is it more that we can't accept the chunky scroll on CPC?
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

arnoldemu

Quote from: reidrac on 12:36, 10 December 16
I don't see this a big deal to be honest.
To me it is. People say the CPC can't do scrolling and people say it doesn't have hardware scrolling.

From my criteria and perspective it does so I disagree with you and say it does.

My point is it does but people chose not to use it. I can think of reasons why, but I wish I could ask them to find out why they didn't consider it.


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

reidrac

Quote from: arnoldemu on 12:46, 10 December 16
Interesting.

To me, changing the screen address to do the scroll is a simple thing that can be done easily and has no tricks to it. The screen moves. You need to do some drawing with the cpu to plot graphics to scroll a map, but the same is true of the Plus and c64.

So does the Plus have hardware scrolling?

And does the C64 have it?

Well, because the CPC can do 4 bit per pixel in mode 0 you could argue in the same way that it support bit planes and hence fast blitting of sprites ;)

You can use hardware to implement some types of scroll, but I don't think that's hardware scrolling.
Released The Return of Traxtor, Golden Tail, Magica, The Dawn of Kernel, Kitsune`s Curse, Brick Rick and Hyperdrive for the CPC.

If you like my games and want to show some appreciation, you can always buy me a coffee.

andycadley


Quote from: reidrac on 12:55, 10 December 16
Well, because the CPC can do 4 bit per pixel in mode 0 you could argue in the same way that it support bit planes and hence fast blitting of sprites ;)

You can use hardware to implement some types of scroll, but I don't think that's hardware scrolling.
Not really, the memory layout of the display on the CPC isn't planar so you can't really say it supports bit planes in any sense.


As to whether you think it counts, I guess that's up to you. But if you exclude it, you kinda have to also say machines like the C64, Master System and NES also don't have hardware scrolling because all of those basically work in a similar fashions....

Axelay

Quote from: andycadley on 12:46, 10 December 16
I'm not sure that's entirely fair on many conversions. Look at the good example like Batman The Movie, Robocop etc and they're just not something that's feasible using only character based scrolling. That said, I was mostly thinking of the kinds of (mostly) continuous scrolling shooters etc, where getting a consistent fluid scroll is most important - certainly there are other varieties of game where coarser scrolling is not so bad and there are plenty of games that could have benefitted from it rather than using a quick port from the speccy.


Well I did say many cases, not all, and that it would not suit all games.  So I agree there were some great software scrolling games, but I would argue that games such as those you have mentioned form a significant minority, personally.


On the subject of continuous scrolling shooters though, I like to think I've already made some arguments about that previously.  ;)

andycadley


Quote from: arnoldemu on 12:49, 10 December 16
Is it more that we can't accept the chunky scroll on CPC?
That somehow doesn't look quite as bad as I'd expect (maybe the starfield effect is helping counter it to some extent?) - it'd certainly be something interesting to try out. R-Type on the Speccy is also character based but has the advantage of a very slow scroll speed and moving enemies more frequently than the background, so there are certainly some things that could be worth trying out.

Overflow

Nice reading.


CPC-power has some useful tags about HW-scroll. I suggest you guys check (for games with HW-scroll):
http://www.cpc-power.com/index.php?page=database&lemot=Scroll%20Hard%20vertical
http://www.cpc-power.com/index.php?page=database&lemot=Scroll%20Hard%20horizontal
http://www.cpc-power.com/index.php?page=database&lemot=Scroll%20Hard%20multidirectional


For those who might not understand what's going on, I'll try with less text.
CPC screen might be set to start anywhere in 16 KB video-ram.
Precision is not pixel but characters.
One could say: we have a scrolling 40x25 screen/windows within 1024 characters from VRAM.
Since only 2 registers changes from HW (i.e. CRTC) are required, we coud write: this is an HW-scroll.


Below:
windows with red border is the 1024=&400 characters VRAM.
windows with white border is the 40x25 screen; also seen on right side.


Scrolling +40characters

Scrolling +1character
Unregistered from CPCwiki forum.

roudoudou

Quote from: Overflow on 14:30, 10 December 16

CPC screen might be set to start anywhere in 16 KB video-ram.


CPC screen start adress has only 1024 positions in a 16kb bank as the CRTC start adress is everytime in the first 2K block of a bank (word precision).


With some nasty tricks you may add insivible lines to cheat and start everywhere (still word precision) but later after the screen begun (as far as i remember)

My pronouns are RASM and ACE

Overflow


Am I trolling? I would like to like this explanation twice.

Quote from: arnoldemu on 12:26, 10 December 16
Yes the CPC has hardware scrolling. It does this by changing the start address for the screen and the graphics wrap at 16KB.
For horizontal, you add/subtract 1 from the start address.
For vertical you add/subtract 40 from the start address (based on the default screen width).

Do this over and over and you have vertical or horizontal scrolling or both.

Some games use it but not a lot.

It has limitations.

Normally it's 8 lines vertical movement and mode 1 char horizontally.
So it's fast and chunky. This often makes it unsuitable.

To use it you update the screen start, then draw a column and/or row (depending on if you are scrolling horizontally, vertically or both).

It operates on the entire screen too.

Demo programmers showed that you can overcome some limitations:
1. some part scrolling, some part static
2. 1 scan-line scrolling vertically (ok on all monitors and televisions)
3. 1/2 a mode 1 char horizontally (monitor/television response permitting)

A lot of game programmers either didn't know how to do the demo tricks, or they couldn't make them work with all cpcs, or they couldn't make them stable or it was too fast a scroll.

Also, hardware scrolling has one other complication:

At the point of screen wrapping the calculations for drawing sprites are a bit more complex.

So I think it comes down to:
- it was too fast and they didn't want it that fast
- they didn't know how to make it smoother
- they were porting from spectrum and just converted it's software scrolling.

Plus gives extras to help.

C64 in comparison:

- you can shift the screen by 8 pixels
- if you want to scroll the screen you then need to copy the graphics (bitmap mode and about 8K) OR copy chars (much less ~1K)
- if copying chars they split it over multiple frames to reduce time
- they could easily split the screen into scrolling and static.
Unregistered from CPCwiki forum.

Powered by SMFPacks Menu Editor Mod