Blitz (88/213)

From:David McMinn
Date:17 May 2000 at 11:08:16
Subject:Re: Copper for bending the screen

Hi Wiremu

> How do you use the copper routines to bend the screen, instead of using
> DisplayScroll(?) I mean using CWait or that mki$($120)+blahablah...

Most of my explanation will only be valid for AGA, with <AGA you only get
fetchmode 0 and the lower 8 bits of the BPLCON1 register.

All displayscroll does is set new delay values (BPLCON1) and bitplane modulus
(BPLxMOD). It sets the modulus before the end of the current line so that the
next line is fetched from an address which is not directly "under" (in bitmap
pixel terms) the previous line. The delay is also done before the end of the
line so that the next line is shifted by a number of pixels to the right.

The distance you can shift pixels with BPLCON1 depends on the fetchmode and
resolution of your copperlist. Its a really screwy system.

Fetchmode Number of SHires pixels that can be shifted by
0 64
1 128 \ there's something else strange about these two fmodes
2 128 / but I can't remember what. maybe they use different bits
3 256 from BPLCON1 or something.

But you have to remember that to shift 1 full pixel in lowres, you need to
shift by 4 shires pixels and for 1 pixel in hires it is 2 shires pixels.

Not only that, but the format of the BPLCON1 register is this:

+------+---------+---------------------------------------------------------+
| BIT# | BPLCON1 | DESCRIPTION |
+------+---------+---------------------------------------------------------+
| 15 | PF2H7=0 | (PF2Hx =) Playfield 2 horizontal scroll code, x=0-7 |
| 14 | PF2H6=0 | |
| 13 | PF2H1=0 | |
| 12 | PF2H0=0 | |
| 11 | PF1H7=0 | (PF1Hx =) Playfield 1 horizontal scroll code, x=0-7 |
| 10 | PF1H6=0 | where PFyH0=LSB=35ns SHRES pixel (bits have been |
| 09 | PF1H1=0 | renamed, old PFyH0 now PFyH2, ect). Now that the scroll |
| 08 | PF1H0=0 | range has been quadrupled to allow for wider (32 or |
| | | 64 bits) bitplanes. |
| 07 | PF2H5 | |
| 06 | PF2H4 | |
| 05 | PF2H3 | |
| 04 | PF2H2 | |
| 03 | PF1H5 | |
| 02 | PF1H4 | |
| 01 | PF1H3 | |
| 00 | PF1H2 | |
+------+---------+---------------------------------------------------------+

The lower 8 bits (7-0) are lowres pixel shifts for playfield 1 and playfield 2,
giving you a possible number of 16 different shift positions. The xH1 and xH0
bits give you the four possible SHires pixels shifts within one lowres pixel
position and the xH7 and xH6 bits give you the extra range (64 or 32 pixels)
for the higher fetchmodes.

If you only have a single playfield, the values for both playfields should be
the same (in both BPLCON1 and BPLxMOD), unless you want some strange bitplane
splitting effects.

An alternative would be to set new bitplane pointers, although that might screw
up the current line as it is being displayed and you may not be able to set all
the pointers fast enough (would require 16 copper MOVE instructions for an 8
plane screen).

> I want to scroll two parts of one playfield.

Well, if the two parts are arranged vertically (i.e. you want to scroll the top
and bottom parts of the playfield) then that should be fairly easy.

You would just set the different modulos at the different lines, something like
this:

COP$=mki$(#BPLCON1)+mki$(shift value)
COP$+mki$(#BPLMOD1)+mki$(new line modulues)
COP$+mki$(#BPLMOD2)+mki$(new line modulues)

COP2$=mki$(#BPLCON1)+mki$(shift value)
COP2$+mki$(#BPLMOD1)+mki$(new line modulues)
COP2$+mki$(#BPLMOD2)+mki$(new line modulues)

DisplayUser coplist,COP$,yline
DisplayUser coplist,COP2$,yline



|) /\ \/ ][ |) |\/| c |\/| ][ |\| |\| | dave@satanicdreams.com
http://members.xoom.com/David_McMinn | ICQ=16827694
Everybody is somebody else's weirdo

---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie