BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
blitzcoplib.c File Reference
#include "blitzlib.h"
#include "blitzobj.h"
#include <graphics/gfxbase.h>

Macros

#define BLITZONLY   ((void *)1)
#define TOK_setcoplist   0xc205 /* switchlib: a0 = copper list */
#define TOK_c104   0xc104 /* intlib (Blitz mode), d0 = 0 */
#define CUSTOM   0xdff000
#define SHOWARGS   const struct bb_bitmap *bitmap BL_REG(a0), struct bb_slice *slice BL_REG(a1)

Functions

void doqslice (void)
void doslice (void)
void docoploc (void)
void docustomcop (void)
void doshow2 (void)
void doshow (void)
void doshowf2 (void)
void doshowf3 (void)
void doshowf (void)
void doshowb2 (void)
void doshowb3 (void)
void doshowb (void)
void docoplen (void)
void blitzcoplib_docolsplit (void)
void doshowblitz (void)
void dokillslices (void)
void dodisplayoff (void)
void dodisplayon (void)
void dosetbplcon0 (void)
void dosetblwait (void)
void blitzcoplib_doinit (void)
void freeslice (void)
 The slice object's free routine: does nothing (RTS).
void slicechk (void)
void slicechk2 (void)
void nshowchk (void)
void showfchk (void)
void showbchk (void)
void cspltst (void)
void blitzcoplib_sbchk (void)
static void custom_w (ULONG reg, UWORD v)
static void custom_l (ULONG reg, ULONG v)
static LONG muls16 (WORD a, WORD b)
static ULONG alloc (ULONG size, ULONG flags)
static void dealloc (ULONG mem, ULONG size)
static ULONG setcoplist (ULONG list)
static void dosetbplcon0_c (ULONG v)
 SetBPLCON0 BPLCON0 Default: the bits every later Slice ORs into BPLCON0.
static void dosetblwait_c (ULONG v)
 SetBLWait: the wait the copper list uses for line 256.
 BLITZ_ALIAS (dosetbplcon0, dosetbplcon0_c)
 BLITZ_ALIAS (dosetblwait, dosetblwait_c)
static void display (UWORD dmacon)
void dodisplayoff_c (void)
 DisplayOff: switch off bitplane and copper DMA (Blitz mode only).
void dodisplayon_c (void)
 DisplayOn: switch bitplane and copper DMA on (Blitz mode only).
 BLITZ_ALIAS (dodisplayoff, dodisplayoff_c)
 BLITZ_ALIAS (dodisplayon, dodisplayon_c)
static void makedumcop (void)
static void dokillslices_c (struct bb_slice *slice, UWORD n, struct GfxBase *gfx)
 FreeSlices: free all slices and the copper list.
 BLITZ_ALIAS (dokillslices, dokillslices_c)
static void doshowblitz_c (void)
 ShowBlitz: put the slices' copper list on the hardware (Blitz mode only).
 BLITZ_ALIAS (doshowblitz, doshowblitz_c)
static void doinit_c (struct bb_slice *base, UWORD max)
 The init routine: remember the slice objects, start the dummy copper list.
static ULONG docoploc_c (void)
 CopLoc: the address of the slices' copper list (chip memory).
static ULONG docoplen_c (void)
 CopLen: the length of the slices' copper list in bytes.
 BLITZ_ALIAS (docoploc, docoploc_c)
 BLITZ_ALIAS (docoplen, docoplen_c)
static ULONG inscop2 (ULONG *list, ULONG len, UWORD y)
static ULONG inscop3 (ULONG *list, ULONG len, UWORD y)
static ULONG inscop (ULONG *list, ULONG len, UWORD y)
static void doslice2 (const UWORD *args, UWORD flags, UWORD planes, UWORD sprites, UWORD colours, WORD used)
static void doslice2_c (const UWORD *args, ULONG flags, ULONG planes, ULONG sprites, ULONG colours, ULONG used)
 Slice Slice#,Y,Width,Hite,Flgs,Bitplns,Sprts,Colrs,Fscrnw,Bscrnw (Amiga mode).
static void bdoslice_c (const UWORD *args, ULONG flags, ULONG planes, ULONG sprites, ULONG colours, ULONG used)
 Slice Slice#,Y,Width,... in Blitz mode: as in Amiga mode, then ShowBlitz.
static void doqslice2 (UWORD y, UWORD fl, WORD used, const struct GfxBase *gfx)
static void doqslice2_c (UWORD y, UWORD fl, ULONG used, const struct GfxBase *gfx)
 Slice Slice#,Y,Flags: a full screen slice (Amiga mode).
static void b_doqslice_c (UWORD y, UWORD fl, ULONG used, const struct GfxBase *gfx)
 Slice Slice#,Y,Flags in Blitz mode: as in Amiga mode, then ShowBlitz.
 BLITZ_ALIAS (b_doqslice, b_doqslice_c)
 BLITZ_ALIAS (bdoslice, bdoslice_c)
static ULONG customcop_c (ULONG str, UWORD y, const ULONG *lens)
 CustomCop Copins$,Y: insert copper instructions at line Y (Amiga mode).
static ULONG bdocustomcop_c (ULONG str, UWORD y, const ULONG *lens)
 CustomCop Copins$,Y in Blitz mode: as in Amiga mode, then the new list on COP1LC and switchlib $C205.
static ULONG a_colsplit (UWORD reg, UWORD r, UWORD g, UWORD b, UWORD y, const struct bb_slice *slice)
static ULONG a_colsplit_c (UWORD reg, UWORD r, UWORD g, UWORD b, UWORD y, const struct bb_slice *slice)
 ColSplit Colour Register,Red,Green,Blue,Y: a colour change at line Y of the used slice (Amiga mode).
static ULONG b_colsplit_c (UWORD reg, UWORD r, UWORD g, UWORD b, UWORD y, const struct bb_slice *slice)
 ColSplit ... in Blitz mode: as in Amiga mode, then the new list on COP1LC and switchlib $C205.
void customcop_a (void)
void bdocustomcop (void)
void a_colsplit_t (void)
void b_colsplit (void)
BL_ALWAYS_INLINE LONG calcoff (UWORD *x, WORD y, const struct bb_bitmap *bitmap, const struct bb_slice *slice)
BL_ALWAYS_INLINE void setplanes (const struct bb_bitmap *bitmap, UWORD *moves, LONG offset, WORD step)
BL_ALWAYS_INLINE void show (const struct bb_bitmap *bitmap, struct bb_slice *slice, UWORD x, WORD y)
BL_ALWAYS_INLINE void showf (const struct bb_bitmap *bitmap, struct bb_slice *slice, UWORD x, WORD y, UWORD x2)
BL_ALWAYS_INLINE void showb (const struct bb_bitmap *bitmap, struct bb_slice *slice, UWORD x, WORD y, UWORD x2)
static BLITZ_ENTRYPOINT void doshow2_c (const struct bb_bitmap *bitmap, struct bb_slice *slice)
 Show Bitmap#: show a bitmap in the used slice at 0,0.
static BLITZ_ENTRYPOINT void doshow_c (const struct bb_bitmap *bitmap, struct bb_slice *slice, UWORD x, UWORD y)
 Show Bitmap#,X,Y: show a bitmap in the used slice from X,Y.
static BLITZ_ENTRYPOINT void doshowf2_c (const struct bb_bitmap *bitmap, struct bb_slice *slice)
 ShowF Bitmap#: show a bitmap as the front playfield at 0,0.
static BLITZ_ENTRYPOINT void doshowf3_c (const struct bb_bitmap *bitmap, struct bb_slice *slice, UWORD x, UWORD y)
 ShowF Bitmap#,X,Y: show a bitmap as the front playfield from X,Y.
static BLITZ_ENTRYPOINT void doshowf_c (const struct bb_bitmap *bitmap, struct bb_slice *slice, UWORD x, UWORD y, UWORD x2)
 ShowF Bitmap#,X,Y,ShowB X: show a bitmap as the front playfield.
static BLITZ_ENTRYPOINT void doshowb2_c (const struct bb_bitmap *bitmap, struct bb_slice *slice)
 ShowB Bitmap#: show a bitmap as the back playfield at 0,0.
static BLITZ_ENTRYPOINT void doshowb3_c (const struct bb_bitmap *bitmap, struct bb_slice *slice, UWORD x, UWORD y)
 ShowB Bitmap#,X,Y: show a bitmap as the back playfield from X,Y.
static BLITZ_ENTRYPOINT void doshowb_c (const struct bb_bitmap *bitmap, struct bb_slice *slice, UWORD x, UWORD y, UWORD x2)
 ShowB Bitmap#,X,Y,ShowF X: show a bitmap as the back playfield.
 BLITZ_ALIAS_EP (doshow2, doshow2_c)
 BLITZ_ALIAS_EP (doshow, doshow_c)
 BLITZ_ALIAS_EP (doshowf2, doshowf2_c)
 BLITZ_ALIAS_EP (doshowf3, doshowf3_c)
 BLITZ_ALIAS_EP (doshowf, doshowf_c)
 BLITZ_ALIAS_EP (doshowb2, doshowb2_c)
 BLITZ_ALIAS_EP (doshowb3, doshowb3_c)
 BLITZ_ALIAS_EP (doshowb, doshowb_c)
static void cspltst_c (UWORD reg, UWORD r, UWORD g, UWORD b, const struct bb_slice *slice)
static void slicechk_c (void)
static void slicechk2_c (const UWORD *args, UWORD flags)
static void showchk (const struct bb_bitmap *bitmap, const struct bb_slice *slice)
static void nshowchk_c (const struct bb_bitmap *bitmap, const struct bb_slice *slice)
static void showfchk_c (const struct bb_bitmap *bitmap, const struct bb_slice *slice)
static void showbchk_c (const struct bb_bitmap *bitmap, const struct bb_slice *slice)
static void sbchk_c (void)

Variables

ULONG mycop
static ULONG mycoplen
static struct bb_slice * slicebase
static UWORD maxslice
static UBYTE hwait [2]
static UWORD hstart = 0x81
static UWORD bplcon0 = 0x300
static ULONG blwait = 0xffe1fffe
static UWORD maxcop [202]
static const ULONG dumcop [2] = { 0x00960020, 0xfffffffe }
static ULONG colstuff
static UWORD aqslice [5]

Macro Definition Documentation

◆ BLITZONLY

#define BLITZONLY   ((void *)1)

◆ CUSTOM

#define CUSTOM   0xdff000

◆ SHOWARGS

#define SHOWARGS   const struct bb_bitmap *bitmap BL_REG(a0), struct bb_slice *slice BL_REG(a1)

◆ TOK_c104

#define TOK_c104   0xc104 /* intlib (Blitz mode), d0 = 0 */

◆ TOK_setcoplist

#define TOK_setcoplist   0xc205 /* switchlib: a0 = copper list */

Function Documentation

◆ a_colsplit()

ULONG a_colsplit ( UWORD reg,
UWORD r,
UWORD g,
UWORD b,
UWORD y,
const struct bb_slice * slice )
static

◆ a_colsplit_c()

ULONG a_colsplit_c ( UWORD reg,
UWORD r,
UWORD g,
UWORD b,
UWORD y,
const struct bb_slice * slice )
static

ColSplit Colour Register,Red,Green,Blue,Y: a colour change at line Y of the used slice (Amiga mode).

One colour move inserted with inscop at the slice's line + Y (+ 2 with flag bit 4, DMA off/on). Errors (debugger only, cspltst): "Unintialized Slice", "Colour Register out of range" (> 31), "RGB Components out of range" (> 15).

Parameters
regd0.w: the colour register
rd1.w: red
gd2.w: green
bd3.w: blue
yd4.w: the line in the slice
slicea1: the used slice (!libs{blitzcoplib,$1102})
Returns
d0: where the move is in the copper list (d1 = mycop)

◆ a_colsplit_t()

void a_colsplit_t ( void )

◆ alloc()

ULONG alloc ( ULONG size,
ULONG flags )
static

◆ b_colsplit()

void b_colsplit ( void )

◆ b_colsplit_c()

ULONG b_colsplit_c ( UWORD reg,
UWORD r,
UWORD g,
UWORD b,
UWORD y,
const struct bb_slice * slice )
static

ColSplit ... in Blitz mode: as in Amiga mode, then the new list on COP1LC and switchlib $C205.

The $A001 entry for Blitz mode; the parameters are those of a_colsplit_c. Returns what $C205 leaves.

◆ b_doqslice_c()

void b_doqslice_c ( UWORD y,
UWORD fl,
ULONG used,
const struct GfxBase * gfx )
static

Slice Slice#,Y,Flags in Blitz mode: as in Amiga mode, then ShowBlitz.

The $A001 entry for Blitz mode; the parameters are those of doqslice2_c.

◆ bdocustomcop()

void bdocustomcop ( void )

◆ bdocustomcop_c()

ULONG bdocustomcop_c ( ULONG str,
UWORD y,
const ULONG * lens )
static

CustomCop Copins$,Y in Blitz mode: as in Amiga mode, then the new list on COP1LC and switchlib $C205.

The $A001 entry for Blitz mode; the parameters are those of customcop_c. Returns what $C205 leaves.

◆ bdoslice_c()

void bdoslice_c ( const UWORD * args,
ULONG flags,
ULONG planes,
ULONG sprites,
ULONG colours,
ULONG used )
static

Slice Slice#,Y,Width,... in Blitz mode: as in Amiga mode, then ShowBlitz.

The $A001 entry for Blitz mode; the parameters are those of doslice2_c.

◆ BLITZ_ALIAS() [1/10]

BLITZ_ALIAS ( b_doqslice ,
b_doqslice_c  )

◆ BLITZ_ALIAS() [2/10]

BLITZ_ALIAS ( bdoslice ,
bdoslice_c  )

◆ BLITZ_ALIAS() [3/10]

BLITZ_ALIAS ( docoplen ,
docoplen_c  )

◆ BLITZ_ALIAS() [4/10]

BLITZ_ALIAS ( docoploc ,
docoploc_c  )

◆ BLITZ_ALIAS() [5/10]

BLITZ_ALIAS ( dodisplayoff ,
dodisplayoff_c  )

◆ BLITZ_ALIAS() [6/10]

BLITZ_ALIAS ( dodisplayon ,
dodisplayon_c  )

◆ BLITZ_ALIAS() [7/10]

BLITZ_ALIAS ( dokillslices ,
dokillslices_c  )

◆ BLITZ_ALIAS() [8/10]

BLITZ_ALIAS ( dosetblwait ,
dosetblwait_c  )

◆ BLITZ_ALIAS() [9/10]

BLITZ_ALIAS ( dosetbplcon0 ,
dosetbplcon0_c  )

◆ BLITZ_ALIAS() [10/10]

BLITZ_ALIAS ( doshowblitz ,
doshowblitz_c  )

◆ BLITZ_ALIAS_EP() [1/8]

BLITZ_ALIAS_EP ( doshow ,
doshow_c  )

◆ BLITZ_ALIAS_EP() [2/8]

BLITZ_ALIAS_EP ( doshow2 ,
doshow2_c  )

◆ BLITZ_ALIAS_EP() [3/8]

BLITZ_ALIAS_EP ( doshowb ,
doshowb_c  )

◆ BLITZ_ALIAS_EP() [4/8]

BLITZ_ALIAS_EP ( doshowb2 ,
doshowb2_c  )

◆ BLITZ_ALIAS_EP() [5/8]

BLITZ_ALIAS_EP ( doshowb3 ,
doshowb3_c  )

◆ BLITZ_ALIAS_EP() [6/8]

BLITZ_ALIAS_EP ( doshowf ,
doshowf_c  )

◆ BLITZ_ALIAS_EP() [7/8]

BLITZ_ALIAS_EP ( doshowf2 ,
doshowf2_c  )

◆ BLITZ_ALIAS_EP() [8/8]

BLITZ_ALIAS_EP ( doshowf3 ,
doshowf3_c  )

◆ blitzcoplib_docolsplit()

void blitzcoplib_docolsplit ( void )

◆ blitzcoplib_doinit()

void blitzcoplib_doinit ( void )

◆ blitzcoplib_sbchk()

void blitzcoplib_sbchk ( void )

◆ calcoff()

BL_ALWAYS_INLINE LONG calcoff ( UWORD * x,
WORD y,
const struct bb_bitmap * bitmap,
const struct bb_slice * slice )

◆ cspltst()

void cspltst ( void )

◆ cspltst_c()

void cspltst_c ( UWORD reg,
UWORD r,
UWORD g,
UWORD b,
const struct bb_slice * slice )
static

◆ custom_l()

void custom_l ( ULONG reg,
ULONG v )
inlinestatic

◆ custom_w()

void custom_w ( ULONG reg,
UWORD v )
inlinestatic

◆ customcop_a()

void customcop_a ( void )

◆ customcop_c()

ULONG customcop_c ( ULONG str,
UWORD y,
const ULONG * lens )
static

CustomCop Copins$,Y: insert copper instructions at line Y (Amiga mode).

Inserted with inscop (the wait's horizontal position 7). The original returns d0 = position, d1 = mycop and keeps d2-d7/a1-a3 (inscop3's MOVEM). DIFF: a2 stays unchanged (the original leaves it decremented by 4). Fixed (#404): a string of 0-3 bytes inserts no instruction (the original copied 2^32 longs). Fixed (#406): with a Slice maximum of 0 the pointer loop makes no pass (the original: 65536). Fixed (#405): the string is copied as given (the original took a long $01FE1234 for Slice's marker).

Parameters
strd0: the copper instructions
yd1.w: the line
lensa2: the argument stack, -4(a2) = the string's length
Returns
d0: where the instructions start in the copper list

◆ dealloc()

void dealloc ( ULONG mem,
ULONG size )
static

◆ display()

void display ( UWORD dmacon)
static

◆ docoplen()

void docoplen ( void )

◆ docoplen_c()

ULONG docoplen_c ( void )
static

CopLen: the length of the slices' copper list in bytes.

Returns
d0: the length

◆ docoploc()

void docoploc ( void )

◆ docoploc_c()

ULONG docoploc_c ( void )
static

CopLoc: the address of the slices' copper list (chip memory).

Returns
d0: the address

◆ docustomcop()

void docustomcop ( void )

◆ dodisplayoff()

void dodisplayoff ( void )

◆ dodisplayoff_c()

void dodisplayoff_c ( void )

DisplayOff: switch off bitplane and copper DMA (Blitz mode only).

intlib $C104 with d0 = 0, then DMACON = $0180. Errors: Blitz mode only (err1 = 1).

◆ dodisplayon()

void dodisplayon ( void )

◆ dodisplayon_c()

void dodisplayon_c ( void )

DisplayOn: switch bitplane and copper DMA on (Blitz mode only).

intlib $C104 with d0 = 0, then DMACON = $8180. Errors: Blitz mode only (err1 = 1).

◆ doinit_c()

void doinit_c ( struct bb_slice * base,
UWORD max )
static

The init routine: remember the slice objects, start the dummy copper list.

The list starts as {DMACON $0020, end}; SetBLWait's value is reset to $FFE1FFFE.

Parameters
basea0: slice 0 (!libs{blitzcoplib,$1001})
maxd0: the maximum number of slices (!libs{blitzcoplib,$0003})

◆ dokillslices()

void dokillslices ( void )

◆ dokillslices_c()

void dokillslices_c ( struct bb_slice * slice,
UWORD n,
struct GfxBase * gfx )
static

FreeSlices: free all slices and the copper list.

Marks every slice unused, puts GfxBase->copinit back on COP1LC (through switchlib $C205) and strobes COPJMP1 (also in Amiga mode), frees the copper list and starts a new dummy list.

Parameters
slicea0: slice 0 (!libs{blitzcoplib,$1001})
nd0: the maximum number of slices (!libs{blitzcoplib,$0003})
gfxa1: GfxBase

◆ doqslice()

void doqslice ( void )

◆ doqslice2()

void doqslice2 ( UWORD y,
UWORD fl,
WORD used,
const struct GfxBase * gfx )
static

◆ doqslice2_c()

void doqslice2_c ( UWORD y,
UWORD fl,
ULONG used,
const struct GfxBase * gfx )
static

Slice Slice#,Y,Flags: a full screen slice (Amiga mode).

The long form with flags $FFF0 + hires/dual playfield/HAM from Flags, 8 sprites, 32 colours, width 320/640, height 256 (200 on NTSC: GfxBase DisplayFlags bit 0); its arguments go into aqslice. Errors (debugger only, slicechk): "Slice already in use".

Reads a3: the slice (!libs{blitzcoplib,$1380} from Slice# in d0).

Parameters
yd1.w: Y
fld2.w: Flags - bits 0-2 bitplanes, 3 hires, 4 dual playfield, 5 HAM
usedd6: the offset of the used slice variable (!libs{blitzcoplib,$0604})
gfxa0: GfxBase

◆ dosetblwait()

void dosetblwait ( void )

◆ dosetblwait_c()

void dosetblwait_c ( ULONG v)
static

SetBLWait: the wait the copper list uses for line 256.

Initially (and after every init) $FFE1FFFE.

Parameters
vd0: the copper wait instruction

◆ dosetbplcon0()

void dosetbplcon0 ( void )

◆ dosetbplcon0_c()

void dosetbplcon0_c ( ULONG v)
static

SetBPLCON0 BPLCON0 Default: the bits every later Slice ORs into BPLCON0.

Parameters
vd0: the default (the low word is used; initially $300)

◆ doshow()

void doshow ( void )

◆ doshow2()

void doshow2 ( void )

◆ doshow2_c()

BLITZ_ENTRYPOINT void doshow2_c ( const struct bb_bitmap * bitmap,
struct bb_slice * slice )
static

Show Bitmap#: show a bitmap in the used slice at 0,0.

Writes the bitplane pointers and BPLCON1 of the slice (see doshow_c).

Parameters
bitmapa0: the bitmap (!libs{bitmaplib,$1080} from Bitmap#)
slicea1: the used slice (!libs{blitzcoplib,$1102})

◆ doshow_c()

BLITZ_ENTRYPOINT void doshow_c ( const struct bb_bitmap * bitmap,
struct bb_slice * slice,
UWORD x,
UWORD y )
static

Show Bitmap#,X,Y: show a bitmap in the used slice from X,Y.

Writes the bitplane pointers (+ the offset of x,y) and BPLCON1 (the scroll value for both playfields) of the slice. The originals change d0-d7/a0/a2. Errors (debugger only, nshowchk): "Unintialized Slice", "Can't Show in Slice" (a dual playfield slice), "Uninitialized BitMap", "Too many Bit planes to Show". Fixed (#407): a slice without BPLCON1 gets the value written into its own +30 (the BPLCON1 copy); the original wrote it at a relocated 0 pointer.

Parameters
bitmapa0: the bitmap (!libs{bitmaplib,$1080} from Bitmap#)
slicea1: the used slice (!libs{blitzcoplib,$1102})
xd1.w: X
yd2.w: Y

◆ doshowb()

void doshowb ( void )

◆ doshowb2()

void doshowb2 ( void )

◆ doshowb2_c()

BLITZ_ENTRYPOINT void doshowb2_c ( const struct bb_bitmap * bitmap,
struct bb_slice * slice )
static

ShowB Bitmap#: show a bitmap as the back playfield at 0,0.

See doshowb_c.

Parameters
bitmapa0: the bitmap (!libs{bitmaplib,$1080} from Bitmap#)
slicea1: the used slice (!libs{blitzcoplib,$1102})

◆ doshowb3()

void doshowb3 ( void )

◆ doshowb3_c()

BLITZ_ENTRYPOINT void doshowb3_c ( const struct bb_bitmap * bitmap,
struct bb_slice * slice,
UWORD x,
UWORD y )
static

ShowB Bitmap#,X,Y: show a bitmap as the back playfield from X,Y.

See doshowb_c; ShowF X = 0.

Parameters
bitmapa0: the bitmap (!libs{bitmaplib,$1080} from Bitmap#)
slicea1: the used slice (!libs{blitzcoplib,$1102})
xd1.w: X
yd2.w: Y

◆ doshowb_c()

BLITZ_ENTRYPOINT void doshowb_c ( const struct bb_bitmap * bitmap,
struct bb_slice * slice,
UWORD x,
UWORD y,
UWORD x2 )
static

ShowB Bitmap#,X,Y,ShowF X: show a bitmap as the back playfield.

Writes the bitplane pointers of the back playfield and BPLCON1 with the scroll values of both playfields. Errors (debugger only, showbchk): "Unintialized Slice", "Uninitialized BitMap", "Too many Bit planes to Show", "Can't Show in Slice" (a dual playfield slice without bit 14 in its bitplanes). Fixed (#407): see Show.

Parameters
bitmapa0: the bitmap (!libs{bitmaplib,$1080} from Bitmap#)
slicea1: the used slice (!libs{blitzcoplib,$1102})
xd1.w: X
yd2.w: Y
x2d3.w: the X of the front playfield (for BPLCON1)

◆ doshowblitz()

void doshowblitz ( void )

◆ doshowblitz_c()

void doshowblitz_c ( void )
static

ShowBlitz: put the slices' copper list on the hardware (Blitz mode only).

COP1LC = the list (switchlib $C205 is told), strobe COPJMP1, FMODE = 0 and BPLCON3 = $C00 ("hires sprite kludge"). Errors (debugger only): "No Blitz Display Set up"; Blitz mode only.

◆ doshowf()

void doshowf ( void )

◆ doshowf2()

void doshowf2 ( void )

◆ doshowf2_c()

BLITZ_ENTRYPOINT void doshowf2_c ( const struct bb_bitmap * bitmap,
struct bb_slice * slice )
static

ShowF Bitmap#: show a bitmap as the front playfield at 0,0.

See doshowf_c.

Parameters
bitmapa0: the bitmap (!libs{bitmaplib,$1080} from Bitmap#)
slicea1: the used slice (!libs{blitzcoplib,$1102})

◆ doshowf3()

void doshowf3 ( void )

◆ doshowf3_c()

BLITZ_ENTRYPOINT void doshowf3_c ( const struct bb_bitmap * bitmap,
struct bb_slice * slice,
UWORD x,
UWORD y )
static

ShowF Bitmap#,X,Y: show a bitmap as the front playfield from X,Y.

See doshowf_c; ShowB X = 0.

Parameters
bitmapa0: the bitmap (!libs{bitmaplib,$1080} from Bitmap#)
slicea1: the used slice (!libs{blitzcoplib,$1102})
xd1.w: X
yd2.w: Y

◆ doshowf_c()

BLITZ_ENTRYPOINT void doshowf_c ( const struct bb_bitmap * bitmap,
struct bb_slice * slice,
UWORD x,
UWORD y,
UWORD x2 )
static

ShowF Bitmap#,X,Y,ShowB X: show a bitmap as the front playfield.

Writes the bitplane pointers of the front playfield (every second move of a dual playfield slice) and BPLCON1 with the scroll values of both playfields. Errors (debugger only, showfchk): "Unintialized Slice", "Uninitialized BitMap", "Too many Bit planes to Show", "Can't Show in Slice" (a dual playfield slice without bit 15 in its bitplanes). Fixed (#407): see Show.

Parameters
bitmapa0: the bitmap (!libs{bitmaplib,$1080} from Bitmap#)
slicea1: the used slice (!libs{blitzcoplib,$1102})
xd1.w: X
yd2.w: Y
x2d3.w: the X of the back playfield (for BPLCON1)

◆ doslice()

void doslice ( void )

◆ doslice2()

void doslice2 ( const UWORD * args,
UWORD flags,
UWORD planes,
UWORD sprites,
UWORD colours,
WORD used )
static

◆ doslice2_c()

void doslice2_c ( const UWORD * args,
ULONG flags,
ULONG planes,
ULONG sprites,
ULONG colours,
ULONG used )
static

Slice Slice#,Y,Width,Hite,Flgs,Bitplns,Sprts,Colrs,Fscrnw,Bscrnw (Amiga mode).

Builds the slice's copper instructions in maxcop from the flags (bit 0 hires, 1 dual playfield, 2 HAM, 3 smooth scrolling, 4 DMA off/on + end wait, 7 BPL2MOD, 8 BPL1MOD, 10 DDFSTRT/STOP, 12 DIWSTRT/STOP, 13 BPLCON2, 14 BPLCON1, 15 BPLCON0) and inserts them into the copper list at line Y (inscop3); the slice becomes the used one. The width checks (Lores/Hires multiple) are in the check routine only. Errors (debugger only, slicechk2): "Lores slice width MUST be multiple of 16", "Hires slice width MUST be multiple of 32", "Slice already in use". Fixed (#407): only pointers into maxcop are relocated; unused ones stay 0, and the BPLCON1 pointer of a slice without BPLCON1 points at its own +30, which Show writes anyway (the original relocated them all). The $01FE1234 marker is rewritten in maxcop itself (the library's buffer, built anew by every Slice); fixed (#405): only there.

Reads a3: the slice (!libs{blitzcoplib,$1380} from Slice# in d0).

Parameters
argsa2: the argument stack: -2 Y, -4 Width, -6 Hite, -8 Fscrnw, -10 Bscrnw (words)
flagsd1: Flgs
planesd2: Bitplns (bits 14/15: dual playfield half)
spritesd3: Sprts
coloursd4: Colrs
usedd6: the offset of the used slice variable (!libs{blitzcoplib,$0604})

◆ freeslice()

void freeslice ( void )

The slice object's free routine: does nothing (RTS).

◆ inscop()

ULONG inscop ( ULONG * list,
ULONG len,
UWORD y )
static

◆ inscop2()

ULONG inscop2 ( ULONG * list,
ULONG len,
UWORD y )
static

◆ inscop3()

ULONG inscop3 ( ULONG * list,
ULONG len,
UWORD y )
static

◆ makedumcop()

void makedumcop ( void )
static

◆ muls16()

LONG muls16 ( WORD a,
WORD b )
inlinestatic

◆ nshowchk()

void nshowchk ( void )

◆ nshowchk_c()

void nshowchk_c ( const struct bb_bitmap * bitmap,
const struct bb_slice * slice )
static

◆ sbchk_c()

void sbchk_c ( void )
static

◆ setcoplist()

ULONG setcoplist ( ULONG list)
static

◆ setplanes()

BL_ALWAYS_INLINE void setplanes ( const struct bb_bitmap * bitmap,
UWORD * moves,
LONG offset,
WORD step )

◆ show()

BL_ALWAYS_INLINE void show ( const struct bb_bitmap * bitmap,
struct bb_slice * slice,
UWORD x,
WORD y )

◆ showb()

BL_ALWAYS_INLINE void showb ( const struct bb_bitmap * bitmap,
struct bb_slice * slice,
UWORD x,
WORD y,
UWORD x2 )

◆ showbchk()

void showbchk ( void )

◆ showbchk_c()

void showbchk_c ( const struct bb_bitmap * bitmap,
const struct bb_slice * slice )
static

◆ showchk()

void showchk ( const struct bb_bitmap * bitmap,
const struct bb_slice * slice )
static

◆ showf()

BL_ALWAYS_INLINE void showf ( const struct bb_bitmap * bitmap,
struct bb_slice * slice,
UWORD x,
WORD y,
UWORD x2 )

◆ showfchk()

void showfchk ( void )

◆ showfchk_c()

void showfchk_c ( const struct bb_bitmap * bitmap,
const struct bb_slice * slice )
static

◆ slicechk()

void slicechk ( void )

◆ slicechk2()

void slicechk2 ( void )

◆ slicechk2_c()

void slicechk2_c ( const UWORD * args,
UWORD flags )
static

◆ slicechk_c()

void slicechk_c ( void )
static

Variable Documentation

◆ aqslice

UWORD aqslice[5]
static

◆ blwait

ULONG blwait = 0xffe1fffe
static

◆ bplcon0

UWORD bplcon0 = 0x300
static

◆ colstuff

ULONG colstuff
static

◆ dumcop

const ULONG dumcop[2] = { 0x00960020, 0xfffffffe }
static

◆ hstart

UWORD hstart = 0x81
static

◆ hwait

UBYTE hwait[2]
static

◆ maxcop

UWORD maxcop[202]
static

◆ maxslice

UWORD maxslice
static

◆ mycop

ULONG mycop

◆ mycoplen

ULONG mycoplen
static

◆ slicebase

struct bb_slice* slicebase
static