blitzcoplib
In Blitz mode, a program builds its own display from slices. A slice
is a Blitz object, numbered from 0, for a horizontal band of the
screen with its own resolution, number of bitplanes, sprite channels
and colours. All slices, colour splits and custom copper instructions
together make up one copper list, the program of the Amiga’s copper
chip that builds the picture. Show, ShowF and ShowB show bitmaps
in the used slice; the palette and sprite commands also work on it.
BitMap 0,320,256,4
BLITZ
Slice 0,44,4
Show 0The quick form Slice Slice#,Y,Flags makes a slice the full width of
the screen, 256 lines high (200 on an NTSC Amiga), with 8 sprite
channels and 32 colours. Its Flags is the number of bitplanes, plus
8 for high resolution, 16 for a dual playfield and 32 for hold and
modify (HAM). Y is the line of the top of the slice; 44 is about the
top of the display.
The long form gives everything: the width and height in pixels, the
number of bitplanes, sprite channels (up to 8) and colours (up to 32),
and the widths of the bitmaps for the front and the back playfield,
which may be wider than the slice for scrolling. For a slice that is
not a dual playfield, give the same width twice. These values of its Flags give the usual slices:
| Flags | Slice | Bitplanes |
|---|---|---|
| $FFF8 | low resolution | up to 6 |
| $FFF9 | high resolution | up to 4 |
| $FFFA | low resolution, dual playfield | up to 6 |
| $FFFB | high resolution, dual playfield | up to 4 |
| $FFFC | hold and modify (HAM) | 6 |
Each bit of the flags adds a part to the slice’s copper instructions, so a slice can also change only some registers:
| Bit | What it adds |
|---|---|
| 0 | high resolution |
| 1 | dual playfield |
| 2 | HAM |
| 3 | smooth scrolling |
| 4 | two blank lines above the slice |
| 7, 8 | the modulos of the two playfields |
| 10 | the data fetch registers |
| 12 | the display window |
| 13 | the register BPLCON2 |
| 14 | the register BPLCON1 |
| 15 | the register BPLCON0 |
In a dual playfield slice, bit 15 of the number of bitplanes makes it show only a front bitmap, bit 14 only a back bitmap, so that a slice further down can change one playfield and leave the other.
Slices cannot be freed one by one; FreeSlices frees all of them.
Based on the blitzcoplib guide by Acid Software.
Library number 144. It manages Slice objects, by default at most 10 (the compiler options set the maximum).
Commands
ColSplit
Changes colour register Colour Register (0 to 31) to the components Red,Green,Blue (0 to 15) from line Y of the used slice on, so that a register can show other colours further down.
Statement. Help text: Colour Register,Red,Green,Blue,Y
Arguments: .w, .w, .w, .w, .w
CopLen
The length in bytes of the copper list of the slices.
Function, result .l. No help text.
No arguments.
CopLoc
The address of the copper list of the slices, in chip memory.
Function, result .l. No help text.
No arguments.
CustomCop
Adds the copper instructions in Copins$, four bytes each, at line Y of the display.
Statement. Help text: Copins$,Y
Arguments: $, .w
The instructions go into the copper list as given. A string shorter
than four bytes adds only the wait for line Y.
DisplayOff
Switches the display off, both the bitplanes and the copper, after waiting for the vertical blank. Blitz mode only.
Statement. No help text.
No arguments.
DisplayOn
Switches the display on again after DisplayOff, after waiting for the vertical blank. Blitz mode only.
Statement. No help text.
No arguments.
FreeSlices
Frees all slices and their copper list and gives the display back to the system.
Statement. No help text.
No arguments.
SetBLWait
The copper wait instruction the copper list uses to get past line 256; the start value is $FFE1FFFE.
Statement. Help text: Wait move for line 256 (eg:$ffe1fffe
Arguments: .l
SetBPLCON0
Bits that every slice made after it adds to its BPLCON0 register; 2 uses an external sync signal (for a genlock), 4 makes the display interlaced, 8 enables a light pen.
Statement. Help text: BPLCON0 Default
Arguments: .l
Show
Shows a bitmap in the used slice, from its point X,Y if it is given, else from its top left corner. The slice must not be one made to show only a front or only a back bitmap; with runtime error checking that is the error “Can’t Show in Slice”.
Statement. Help text: Bitmap#[,X,Y]
2 forms:
.w.w, .w, .w
A position helps with a bitmap larger than the slice: changing it scrolls the bitmap.
ShowB
Shows a bitmap as the back playfield of the used dual playfield slice, from its point X,Y if it is given.
Statement. Help text: Bitmap#[,X,Y[,ShowF X]]
3 forms:
.w.w, .w, .w.w, .w, .w, .w
ShowF X is the horizontal position of the front playfield, for a
slice made to show only a back bitmap.
ShowBlitz
Shows the slices again, for example after a visit to Amiga mode. Blitz mode only.
Statement. No help text.
No arguments.
ShowF
Shows a bitmap as the front playfield of the used dual playfield slice, from its point X,Y if it is given.
Statement. Help text: Bitmap#[,X,Y[,ShowB X]]
3 forms:
.w.w, .w, .w.w, .w, .w, .w
ShowB X is the horizontal position of the back playfield, for a
slice made to show only a front bitmap.
Slice
Makes a slice from line Y down, in the quick or the long form the introduction describes, and makes it the used slice. In Blitz mode the new display is shown at once.
Statement. Help text: [Slice#,Y,Flags]|[Slice#,Y,Width,Hite,Flgs,Bitplns,Sprts,Colrs,Fscrnw,Bscrnw]
2 forms:
.w, .w, .w.w, .w, .w, .w, .l, .w, .w, .w, .w, .w
With runtime error checking, a slice that is already in use is the error “Slice already in use”, and the width of a low resolution slice must be a multiple of 16, that of a high resolution slice a multiple of 32.