|
BB2 C port
API reference: Blitz libraries in C and the shared code
|
Data Structures | |
| struct | modeent |
Macros | |
| #define | COP (BL_IA3|BL_PD0) /* #displaylib,$1380: a3 = coplist */ |
| #define | W(p, o) |
| #define | L(p, o) |
| #define | B(p, o) |
| #define | CMOFF(m) |
| #define | CM(p, m) |
| #define | DMAOFF 0x00960120 |
| #define | DMAON 0x00968120 |
| #define | WAITBH 0xffe1fffe |
| #define | NOWCOP 0x01fe0000 |
| #define | COPNOP 0x01fe0000 |
| #define | WAITEND 0xfffffffe |
| #define | STROBE1 0x008a0001 |
| #define | TOK_setcoplist 0xc205 |
| #define | SHIFTOP(name, insn) |
| #define | OPAQUE(x) |
| #define | GOTO(label) |
| #define | NORET __attribute__((noreturn)) |
| #define | OVERRUN(cop, ins) |
| #define | T(maxbp, fetchwid, xmask, xrshift, adjwid, adjstop, fmode, diwstrt, diwstop, ddfstrt, ddfstop, bplcon0) |
| #define | BP1(i) |
| #define | CMAT(m, o) |
| #define | STORE() |
| #define | SWAPMODS() |
| #define | MESSAGE(label, text) |
Functions | |
| void | _initcoplist2 (void) |
| void | _initcoplist (void) |
| void | _createdisplay (void) |
| void | _displaybmap (void) |
| DisplayBitMap CopList#,bmap: shows a bitmap. | |
| void | _displaybmap2 (void) |
| DisplayBitMap CopList#,bmap,x,y: shows a bitmap at a position. | |
| void | _displaydbmap (void) |
| void | _displaydbmap2 (void) |
| void | _displaysprite (void) |
| DisplaySprite CopList#,Sprite#,X,Y,Sprite Channel: shows a sprite on one or more channels. | |
| void | _displaypalette (void) |
| void | _displaypalette2 (void) |
| void | _displaypalette3 (void) |
| void | _dobplcons (void) |
| void | _doadjust (void) |
| void | _customcols2 (void) |
| void | _customcols (void) |
| void | _customstring (void) |
| void | _displaydblscan0 (void) |
| void | _displaydblscan (void) |
| void | _displayrainbow0 (void) |
| void | _displayrainbow (void) |
| void | _displayrgb0 (void) |
| void | _displayrgb (void) |
| void | _displayuser0 (void) |
| void | _displayuser (void) |
| void | _displayscroll0 (void) |
| void | _displayscroll (void) |
| void | _customsprites (void) |
| void | _customchunky (void) |
| void | _customchunky2 (void) |
| void | _customchunkysize (void) |
| void | _setgenlock (void) |
| void | displaylib_codeinit (void) |
| void | _checkcoplist (void) |
| void | _freecoplist (void) |
| Free CopList: frees the list's memory (memlib globfree). | |
| static void | _codefinit (void) |
| Library finit: nothing. | |
| static ULONG | mulu16 (UWORD a, UWORD b) |
| void | maxbperr (void) |
| static ULONG | globalloc (ULONG size, ULONG flags) |
| static ULONG * | putwait (ULONG *ins, UWORD line, UWORD prev, UBYTE h) |
| static void | _codeinit_c (void) |
| Library init: allocates the blank sprite and checks for AGA. | |
| static void | _doadjust_c (UWORD fetchwid, UWORD ddfstrt, UWORD ddfstop, UWORD diwstrt, UWORD diwstop) |
| DisplayAdjust CopList#,fetchwid,ddfstrt,ddfstop,diwstrt,diwstop: adds the values to the coplist's fetch width and to the DDF and DIW moves of its list. | |
| BLITZ_ALIAS (_doadjust, _doadjust_c) | |
| static void | _dobplcons_c (UWORD bplcon2, UWORD bplcon3, UWORD bplcon4) |
| DisplayControls CopList#,BPLCON2,BPLCON3,BPLCON4: changes the BPLCON2/3/4 moves of the list. | |
| BLITZ_ALIAS (_dobplcons, _dobplcons_c) | |
| static void | _setgenlock_c (UWORD v) |
| DisplayGenlock BPLCON0: bits that later InitCopLists OR into their BPLCON0 move (2 = external sync, 4 = interlace). | |
| BLITZ_ALIAS (_setgenlock, _setgenlock_c) | |
| static void | initcoplist (ULONG ypos, ULONG height, ULONG type, ULONG sprites, ULONG colours, const UWORD *args, const UWORD *sprmode, WORD used) |
| static void | _initcoplist_c (ULONG ypos, ULONG height, ULONG type, ULONG sprites, ULONG colours, ULONG used, const UWORD *args, const UWORD *sprmode) |
| InitCopList CopList#,ypos,height,type,sprites,colors,numcustoms: builds the coplist's copper list. | |
| static void | _initcoplist2_c (ULONG type, ULONG height, ULONG used, const UWORD *sprmode) |
| InitCopList CopList#,type: the quick form of InitCopList. | |
| BLITZ_ALIAS (_initcoplist, _initcoplist_c) | |
| BLITZ_ALIAS (_initcoplist2, _initcoplist2_c) | |
| static void | _createdisplay_c (UWORD count, const UWORD *args, UBYTE *coplists) |
| CreateDisplay CopList#[,CopList#..]: shows one or more coplists (Blitz mode only). | |
| BLITZ_ALIAS (_createdisplay, _createdisplay_c) | |
| BL_ALWAYS_INLINE UWORD * | setptr (UWORD *a2, ULONG v) |
| CMAT (colors, 8) | |
| CMAT (sprites, 12) | |
| CMAT (bplanes, 20) | |
| CMAT (dob, 32) | |
| CMAT (numbp, 38) | |
| CMAT (fetchwid, 42) | |
| CMAT (xand, 44) | |
| CMAT (xshift, 46) | |
| CMAT (ypos, 48) | |
| CMAT (height, 50) | |
| CMAT (res, 52) | |
| CMAT (numsprites, 54) | |
| CMAT (numcols, 56) | |
| CMAT (x0, 62) | |
| CMAT (x1, 66) | |
| CMAT (bplcon3, 70) | |
| CMAT (aga, 72) | |
| CMAT (resshift, 74) | |
| CMAT (spif, 84) | |
| CMAT (sspwid, 88) | |
| CMAT (ham8, 90) | |
| CMAT (csprites, 92) | |
| CMAT (spri, 126) | |
| static void | displaydbmap2 (UBYTE *cop, const UBYTE *bm1, const UBYTE *bm2, ULONG xoff1, ULONG yoff1, ULONG xoff2, ULONG yoff2) |
| static void | _displaydbmap2_c (const UBYTE *bm1, const UBYTE *bm2, ULONG x1, ULONG y1, ULONG x2, const UWORD *args) |
| DisplayBitMap CopList#,bmap,x,y,bmap,x,y: shows two bitmaps (dual playfield) at positions. | |
| static void | _displaydbmap_c (const UBYTE *bm1, const UBYTE *bm2) |
| DisplayBitMap CopList#,bmap,bmap: shows two bitmaps (dual playfield). | |
| BLITZ_ALIAS (_displaydbmap, _displaydbmap_c) | |
| BLITZ_ALIAS (_displaydbmap2, _displaydbmap2_c) | |
| static void | simple (UBYTE *cop, const UBYTE *pal, ULONG *ins, UWORD count) |
| static void | complex2 (UBYTE *cop, const UBYTE *pal, ULONG *ins, ULONG bankmove, UWORD count) |
| static const UBYTE * | paldata (const UBYTE *palobj) |
| void | displaypalette (void) |
| DisplayPalette CopList#,Palette#: puts a palette into the list's colour moves. | |
| static void | customcols (UWORD ccoffset, UWORD ypos, const UBYTE *pal, UWORD startcol, UWORD numcols) |
| static void | _customcols_c (UWORD ccoffset, UWORD ypos, const UBYTE *pal, UWORD startcol, UWORD numcols) |
| CustomColors CopList#,CCOffset,YPos,Palette,startcol,numcols: colour changes at a line in the custom area. | |
| static void | _customcols2_c (UWORD ccoffset, UWORD ypos, const UBYTE *pal, UWORD startcol, UWORD numcols, UWORD thru256) |
| CustomColors CopList#,CCOffset,YPos,Palette,startcol,numcols, thru256flag: as CustomColors, then bot = 257 for a flag other than 0. | |
| BLITZ_ALIAS (_customcols, _customcols_c) | |
| BLITZ_ALIAS (_customcols2, _customcols2_c) | |
| static void | _customstring_c (UWORD ccoffset, UWORD ypos, const ULONG *s, const ULONG *lens) |
| CustomString CopList#,CCOffset,YPos,Copper$: copper instructions from a string at a line in the custom area. | |
| BLITZ_ALIAS (_customstring, _customstring_c) | |
| static void | dblscan (UWORD mode, UWORD off) |
| static void | _displaydblscan0_c (UWORD mode) |
| DisplayDblScan CopList#,Mode: line doubling with modulo moves in the per line custom area. | |
| static void | _displaydblscan_c (UWORD mode, UWORD off) |
| DisplayDblScan CopList#,Mode,copoffset: as DisplayDblScan, at an offset in each line's custom area. | |
| BLITZ_ALIAS (_displaydblscan0, _displaydblscan0_c) | |
| BLITZ_ALIAS (_displaydblscan, _displaydblscan_c) | |
| static void | _customsprites_c (UWORD ccoffset, UWORD ypos, UWORD count) |
| CustomSprites CopList#,CCOffset,YPos,NumSprites: more sprite moves at a line in the custom area. | |
| BLITZ_ALIAS (_customsprites, _customsprites_c) | |
| static void | rainbow (UWORD reg, const UBYTE *pal, UWORD off) |
| static void | _displayrainbow0_c (UWORD reg, const UBYTE *pal) |
| DisplayRainbow CopList#,Register,Palette: one colour per line from a palette, in the per line custom area. | |
| static void | _displayrainbow_c (UWORD reg, const UBYTE *pal, UWORD off) |
| DisplayRainbow CopList#,Register,Palette,copoffset: as DisplayRainbow, at an offset in each line's custom area. | |
| BLITZ_ALIAS (_displayrainbow0, _displayrainbow0_c) | |
| BLITZ_ALIAS (_displayrainbow, _displayrainbow_c) | |
| static void | rgb (UWORD reg, UWORD line, UWORD red, UWORD green, UWORD blue, UWORD off) |
| static void | _displayrgb0_c (UWORD reg, UWORD line, UWORD red, UWORD green, UWORD blue) |
| DisplayRGB CopList#,Register,line,r,g,b: one colour change at a line, in the per line custom area. | |
| static void | _displayrgb_c (UWORD reg, UWORD line, UWORD red, UWORD green, UWORD blue, const UWORD *args) |
| DisplayRGB CopList#,Register,line,r,g,b,copoffset: as DisplayRGB, at an offset in the line's custom area. | |
| BLITZ_ALIAS (_displayrgb0, _displayrgb0_c) | |
| BLITZ_ALIAS (_displayrgb, _displayrgb_c) | |
| static void | user (UWORD line, const ULONG *s, UWORD off, ULONG len) |
| static void | _displayuser0_c (UWORD line, const ULONG *text, const ULONG *lens) |
| DisplayUser CopList#,Line,String: copper instructions from a string into a line's custom area. | |
| static void | _displayuser_c (UWORD line, const ULONG *text, UWORD off, const ULONG *lens) |
| DisplayUser CopList#,Line,String,Offset: as DisplayUser, at an offset in the line's custom area. | |
| BLITZ_ALIAS (_displayuser0, _displayuser0_c) | |
| BLITZ_ALIAS (_displayuser, _displayuser_c) | |
| static void | scroll (const LONG *xpos1, const LONG *xpos2, UWORD off, ULONG callerd0) |
| static void | _displayscroll0_c (ULONG callerd0, const LONG *xpos1, const LONG *xpos2) |
| DisplayScroll CopList#,&xpos.q(n),&xpos.q(n): per line horizontal scrolling of the two playfields. | |
| static void | _displayscroll_c (ULONG callerd0, const LONG *xpos1, const LONG *xpos2, UWORD off) |
| DisplayScroll CopList#,&xpos.q(n),&xpos.q(n),Offset: as DisplayScroll, at an offset in each line's custom area. | |
| BLITZ_ALIAS (_displayscroll0, _displayscroll0_c) | |
| BLITZ_ALIAS (_displayscroll, _displayscroll_c) | |
| static ULONG | _customchunkysize_c (ULONG width, UWORD height) |
| CustomChunkySize(width,height): the custom copper space that CustomChunky needs. | |
| BLITZ_ALIAS (_customchunkysize, _customchunkysize_c) | |
| static void | customchunky (UWORD ccoffset, UWORD ypos, UWORD width, UWORD height, UWORD res) |
| static void | _customchunky_c (UWORD ccoffset, UWORD ypos, UWORD width, UWORD height, UWORD res) |
| CustomChunky CopList#,CCOffset,YPos,width,height,res: a copper chunky area (AGA) in the custom area. | |
| static void | _customchunky2_c (UWORD ccoffset, UWORD ypos, UWORD width, UWORD height, UWORD res, const UWORD *args) |
| CustomChunky CopList#,CCOffset,YPos,width,height,res,splitpos: as CustomChunky, split into two parts at splitpos. | |
| BLITZ_ALIAS (_customchunky, _customchunky_c) | |
| BLITZ_ALIAS (_customchunky2, _customchunky2_c) | |
| void | errors (void) |
| MESSAGE (mess1, "Illegal Number of BitPlanes for Resolution") | |
| MESSAGE (mess2, "Uninitialised CopList") | |
| MESSAGE (mess3, "Uninitialised Palette") | |
| MESSAGE (mess4, "Uninitialised Sprite") | |
| MESSAGE (mess5, "Custom Copper String Must Be Multiple Of 4 Bytes Silly!") | |
| MESSAGE (mess6, "Not Enough Custom Copper Space") | |
| MESSAGE (mess7, "Need AGA palette mode ($10000) for this many colors") | |
| MESSAGE (mess8, "CustomChunky must start at ypos greater than res") | |
| MESSAGE (mess9, "Not Enough Custom Cops") | |
| MESSAGE (mess10, "Not Enough Sprite Channels") | |
| BLITZ_ERRCHK_ASM (checkcoplist, " .globl __checkcoplist\n" "__checkcoplist:\n" " tst.l (a3)\n" " beq.w _uniniterr\n" " rts") | |
Variables | |
| struct { | |
| UWORD genlock | |
| UWORD slup [3] | |
| UWORD shup [3] | |
| UWORD swup [3] | |
| UWORD agaflag | |
| ULONG mysprite | |
| UWORD agamac | |
| } | d = { 0, { 0, 4, 12 }, { 2, 1, 0 }, { 8, 16, 32 }, 0, 0, 0 } |
| static const UWORD | bpb [16] |
| static const ULONG | bcp [6] |
| static ULONG | spp [4] = { 0x01400000, 0x01420000, 0x01200000, 0x01220000 } |
| static const struct modeent | table [12] |
| static const UWORD | bp1 [256] |
| struct { | |
| UWORD lastwait | |
| ULONG topcop | |
| } | cd |
| struct { | |
| UWORD dloop [5] | |
| UWORD loopd | |
| } | dl = { { 0, 1, 5, 13, 29 }, 0 } |
| struct { | |
| UWORD mods [2] | |
| UWORD ycont | |
| } | sc |
| static const UWORD | shifs [8] = { 1, 4, 2, 5, 2, 5, 3, 6 } |
| static const UBYTE | flups [4] = { 0, 1, 1, 2 } |
| static const UWORD | blah [1] = { 0 } |
| #define B | ( | p, | |
| o ) |
| #define BP1 | ( | i | ) |
| #define CM | ( | p, | |
| m ) |
| #define CMAT | ( | m, | |
| o ) |
| #define CMOFF | ( | m | ) |
| #define COPNOP 0x01fe0000 |
| #define DMAOFF 0x00960120 |
| #define DMAON 0x00968120 |
| #define GOTO | ( | label | ) |
| #define L | ( | p, | |
| o ) |
| #define MESSAGE | ( | label, | |
| text ) |
| #define NORET __attribute__((noreturn)) |
| #define NOWCOP 0x01fe0000 |
| #define OVERRUN | ( | cop, | |
| ins ) |
| #define SHIFTOP | ( | name, | |
| insn ) |
| #define STORE | ( | ) |
| #define STROBE1 0x008a0001 |
| #define SWAPMODS | ( | ) |
| #define T | ( | maxbp, | |
| fetchwid, | |||
| xmask, | |||
| xrshift, | |||
| adjwid, | |||
| adjstop, | |||
| fmode, | |||
| diwstrt, | |||
| diwstop, | |||
| ddfstrt, | |||
| ddfstop, | |||
| bplcon0 ) |
| #define TOK_setcoplist 0xc205 |
| #define W | ( | p, | |
| o ) |
| #define WAITBH 0xffe1fffe |
| #define WAITEND 0xfffffffe |
| void _checkcoplist | ( | void | ) |
|
static |
Library finit: nothing.
|
static |
Library init: allocates the blank sprite and checks for AGA.
mysprite = 32 bytes of cleared chip memory (memlib globalloc); its address goes into the sprite move template spp. agamac = -1 if LISAID ($DFF07C) has 248 in the low byte, else 0. BUG(orig) (#413): the address goes into the data words of the SPR0POS/SPR0CTL moves (spp+6/spp+2), not into SPR0PTH/PTL.
| void _createdisplay | ( | void | ) |
|
static |
CreateDisplay CopList#[,CopList#..]: shows one or more coplists (Blitz mode only).
Fills the waits of every list (start - setup lines, the display start, the display end), links the lists with COP2LC/COPJMP2 moves, ends the last with a wait for the end, waits for the blitter and puts the first list on COP1LC (and switchlib's coplist, $C205). a3 is left on the last coplist (not a bug: the compiler reloads it). Errors: an uninitialised coplist ("Uninitialised CopList"); fixed: in the normal code (#412).
| void _customchunky | ( | void | ) |
| void _customchunky2 | ( | void | ) |
|
static |
CustomChunky CopList#,CCOffset,YPos,width,height,res,splitpos: as CustomChunky, split into two parts at splitpos.
The description is copied to the second one (cchunky2...): the first part gets the height splitpos, the second the rest, starting splitpos lines later. Fixed (#949): 14 bytes are copied; the original's 16 byte copy overwrote spri (see below).
|
static |
CustomChunky CopList#,CCOffset,YPos,width,height,res: a copper chunky area (AGA) in the custom area.
A wait for the line, then per chunky line width colour moves (registers from $1BE down, a bank move before every 32), a wait for the next line (res lines on) and a BPLCON4 move; position, size and modulo are remembered in the coplist (cchunky, chy, chw, chh, chr, chc). Space: CustomChunkySize. Errors: YPos lower than res ("CustomChunky must start at ypos greater than res"), an overrun; fixed: in the normal code (#412).
| void _customchunkysize | ( | void | ) |
|
static |
| void _customcols | ( | void | ) |
| void _customcols2 | ( | void | ) |
|
static |
CustomColors CopList#,CCOffset,YPos,Palette,startcol,numcols, thru256flag: as CustomColors, then bot = 257 for a flag other than 0.
bot = 257 means that the next wait does not add the line 256 wait. Fixed (#951): a flag of 0 leaves bot as the form without the flag does; the original did not read the flag (0 acted as 1).
| ccoffset | d1: the offset in the custom area (longs) |
| ypos | d2: the line |
| pal | a0: the palette (!libs {palettelib,$1083}) |
| startcol | d4: the first colour |
| numcols | d5: the number of colours |
| thru256 | d6: thru256flag |
|
static |
CustomColors CopList#,CCOffset,YPos,Palette,startcol,numcols: colour changes at a line in the custom area.
At CCOffset (longs) in the custom area: a wait for the line (with the line 256 wait if needed), then the colour moves of numcols colours from startcol (ECS 1 per colour, AGA with bank moves and both nibbles). Space: ECS 2+n, AGA 2+n+n+n/16 copper instructions. Errors: an uninitialised palette, an overrun ("Not Enough Custom Cops"); fixed: in the normal code (#412).
| ccoffset | d1: the offset in the custom area (longs) |
| ypos | d2: the line (from the display's ypos) |
| pal | a0: the palette (!libs {palettelib,$1083}) |
| startcol | d4: the first colour |
| numcols | d5: the number of colours |
| void _customsprites | ( | void | ) |
|
static |
CustomSprites CopList#,CCOffset,YPos,NumSprites: more sprite moves at a line in the custom area.
A wait for the line, then NumSprites x 4 moves of the template spp (channels from numsprites on for DisplaySprite). Space: 4n+2. Fixed (#324): d1 is CCOffset, the offset CCOffset * 4 bytes (the original's declaration had DisplaySprite's !libs: d1 was CCOffset * 16, the offset CCOffset * 64 bytes). Fixed (#413): the moves of an unused channel point at the blank sprite. Errors: an overrun ("Not Enough Custom Cops"); fixed: in the normal code (#412).
| ccoffset | d1: CCOffset (longs) |
| ypos | d2: the line |
| count | d3: the number of sprite channels |
| void _customstring | ( | void | ) |
|
static |
CustomString CopList#,CCOffset,YPos,Copper$: copper instructions from a string at a line in the custom area.
A wait for the line, then the string's longs. Space: 2+n (n = Len(Copper$)/4). Errors: a length that is 0 or not a multiple of 4 ("Custom Copper String Must Be Multiple Of 4 Bytes Silly!"), an overrun; fixed: in the normal code (#412).
| ccoffset | d1: the offset in the custom area (longs) |
| ypos | d2: the line |
| s | d3: the string |
| lens | a2: the argument stack, the string length below it |
| void _displaybmap | ( | void | ) |
DisplayBitMap CopList#,bmap: shows a bitmap.
Sets the modulos and the bitplane pointers (HAM8: planes 7 and 8 first); with smooth scrolling in the type (bit 4) the x,y form at 0,0. Fixed (#411): without smooth scrolling x0/x1 (DisplayScroll's start) are 0 too; the original stored the caller's d2/d3 there. Errors (debugger only): uninitialised coplist.
| void _displaybmap2 | ( | void | ) |
DisplayBitMap CopList#,bmap,x,y: shows a bitmap at a position.
Sets the modulos, the BPLCON1 scroll value (bp1 table) and the bitplane pointers (HAM8: planes 7 and 8 first) for the position, and remembers x in x0/x1 for DisplayScroll. a3 is left on the bp1 table (not a bug: the compiler reloads it). Errors (debugger only): uninitialised coplist.
| void _displaydblscan | ( | void | ) |
| void _displaydblscan0 | ( | void | ) |
|
static |
DisplayDblScan CopList#,Mode: line doubling with modulo moves in the per line custom area.
Two modulo moves per line: mode 0 clears them (NOPs), mode 1 swaps the doubling modulos (-fetchwid) and the normal ones every line, modes 2-5 after runs set by the dloop table (1, 5, 13, 29 lines). Errors: not enough space per line ("Not Enough Custom Copper Space"); fixed: in the normal code (#412).
| mode | d1: the mode |
|
static |
DisplayDblScan CopList#,Mode,copoffset: as DisplayDblScan, at an offset in each line's custom area.
| mode | d1: the mode |
| off | d2: the offset in the line's custom area (longs) |
| void _displaydbmap | ( | void | ) |
| void _displaydbmap2 | ( | void | ) |
|
static |
DisplayBitMap CopList#,bmap,x,y,bmap,x,y: shows two bitmaps (dual playfield) at positions.
As the single form, the planes alternate between the two bitmaps; the BPLCON1 value combines both scroll values. a3 is left on the bp1 table. Errors (debugger only): uninitialised coplist.
| bm1 | a0: the first bitmap (!libs {bitmaplib,$1081}) |
| bm2 | a1: the second bitmap (!libs {bitmaplib,$1184}) |
| x1 | d2: the first x position (quick) |
| y1 | d3: the first y position |
| x2 | d5: the second x position (quick) |
| args | a2: the argument stack, the second y below it |
|
static |
DisplayBitMap CopList#,bmap,bmap: shows two bitmaps (dual playfield).
The modulos and the bitplane pointers, alternating between the two bitmaps; x0/x1 = 0. With smooth scrolling (type bit 4) the x,y form at 0,0. Errors (debugger only): uninitialised coplist.
| bm1 | a0: the first bitmap (!libs {bitmaplib,$1081}) |
| bm2 | a1: the second bitmap (!libs {bitmaplib,$1182}) |
| void _displaypalette | ( | void | ) |
| void _displaypalette2 | ( | void | ) |
| void _displaypalette3 | ( | void | ) |
| void _displayrainbow | ( | void | ) |
| void _displayrainbow0 | ( | void | ) |
|
static |
DisplayRainbow CopList#,Register,Palette: one colour per line from a palette, in the per line custom area.
Colour register Register gets palette entry n on line n. ECS 1, AGA 4 moves per line (bank moves and both nibbles). Errors: not enough space per line, an overrun; fixed: in the normal code (#412).
| reg | d1: the colour register |
| pal | a2: the palette (!libs {palettelib,$1282}) |
|
static |
DisplayRainbow CopList#,Register,Palette,copoffset: as DisplayRainbow, at an offset in each line's custom area.
| reg | d1: the colour register |
| pal | a2: the palette (!libs {palettelib,$1282}) |
| off | d3: the offset in the line's custom area (longs) |
| void _displayrgb | ( | void | ) |
| void _displayrgb0 | ( | void | ) |
|
static |
DisplayRGB CopList#,Register,line,r,g,b: one colour change at a line, in the per line custom area.
ECS 1 move, AGA 4 (bank moves, high and low nibbles). Errors: not enough space per line, an overrun; fixed: in the normal code (#412).
|
static |
| void _displayscroll | ( | void | ) |
| void _displayscroll0 | ( | void | ) |
|
static |
DisplayScroll CopList#,&xpos.q(n),&xpos.q(n): per line horizontal scrolling of the two playfields.
Per line a BPLCON1 move and the two modulo moves (3 moves): from the positions x0/x1 of the last DisplayBitMap, each line adds the next value of the two arrays. Errors: not enough space per line ("Not Enough Custom Copper Space"); fixed: in the normal code (#412).
| callerd0 | d0: the caller's d0 (its upper bytes go into the resolution bits, as in the original) |
| xpos1 | d1: the first array (quick, one per line) |
| xpos2 | d2: the second array |
|
static |
DisplayScroll CopList#,&xpos.q(n),&xpos.q(n),Offset: as DisplayScroll, at an offset in each line's custom area.
| callerd0 | d0: the caller's d0 |
| xpos1 | d1: the first array (quick, one per line) |
| xpos2 | d2: the second array |
| off | d3: the offset in the line's custom area (longs) |
| void _displaysprite | ( | void | ) |
DisplaySprite CopList#,Sprite#,X,Y,Sprite Channel: shows a sprite on one or more channels.
Computes SPRxPOS/SPRxCTL from the position minus the handle (the x handle scaled by spri), clips at the top and the bottom of the display and writes position, control and data pointers into the channel's sprite moves (attached sprites: two channels per part); channels from numsprites on are those of CustomSprites. A sprite completely above or below the display gets the blank sprite (spriteoff). Every register is reused; the word loads into d2/d3 keep the upper word of the caller's register (BL_SETW below). Fixed (#414): the channels of the sprite must fit into the bank of its first channel (the original checked them against both banks together, so a sprite spanning the last normal channel and the CustomSprites bank overwrote the BPLCON moves). Fixed (#949): spri stays after CustomChunky's split form (the original: 0). Errors: an uninitialised sprite ("Uninitialised Sprite"), not enough channels in the bank ("Not Enough Sprite Channels"); fixed: in the normal code (#412).
| void _displayuser | ( | void | ) |
| void _displayuser0 | ( | void | ) |
|
static |
DisplayUser CopList#,Line,String: copper instructions from a string into a line's custom area.
Errors: not enough space per line, a length that is not a multiple of 4, an overrun; fixed: in the normal code (#412).
|
static |
| void _doadjust | ( | void | ) |
|
static |
DisplayAdjust CopList#,fetchwid,ddfstrt,ddfstop,diwstrt,diwstop: adds the values to the coplist's fetch width and to the DDF and DIW moves of its list.
The moves are the control moves behind the list's start (coppos+8). a3 = the coplist (!libs {displaylib,$1380}). Errors (debugger only): uninitialised coplist ("Uninitialised CopList").
| fetchwid | d1: added to the fetch width |
| ddfstrt | d2: added to the DDFSTRT data |
| ddfstop | d3: added to the DDFSTOP data |
| diwstrt | d4: added to the DIWSTRT data |
| diwstop | d5: added to the DIWSTOP data |
| void _dobplcons | ( | void | ) |
|
static |
DisplayControls CopList#,BPLCON2,BPLCON3,BPLCON4: changes the BPLCON2/3/4 moves of the list.
The values are XORed into the data of the three moves (and BPLCON3 into the coplist's copy, which the palette routines use for their bank moves). a3 = the coplist. Errors (debugger only): uninitialised coplist.
| bplcon2 | d1: XORed into the BPLCON2 data |
| bplcon3 | d2: XORed into the BPLCON3 data |
| bplcon4 | d3: XORed into the BPLCON4 data |
| void _freecoplist | ( | void | ) |
Free CopList: frees the list's memory (memlib globfree).
Also called by InitCopList before it builds a new list. Nothing happens for an uninitialised coplist (size 0); size and cpline are cleared. a3 = the coplist.
| void _initcoplist | ( | void | ) |
| void _initcoplist2 | ( | void | ) |
|
static |
InitCopList CopList#,type: the quick form of InitCopList.
ypos 44, height 256, 8 sprites, no custom area; the colours come from the number of bitplanes (colup: 2^n, 256 for 8 and more), halved with type bit 5, 32 with type bit 6. d1 arrives as the type and becomes the ypos (only its low word is set). Errors: as the long form.
|
static |
InitCopList CopList#,ypos,height,type,sprites,colors,numcustoms: builds the coplist's copper list.
Frees an old list, then allocates (chip, cleared) and builds the list (see initcoplist): 2 NOPs (later the start wait), FMODE/DIW/DDF/ BPLCON0 from the mode table (resolution x fetch mode of the type), colour NOPs (AGA: with the bank moves), sprite moves, BPLCON2/3/4/1 and BPL1/2MOD, the bitplane pointers, a wait + DMA on, the custom area (numcustoms NOPs, or for negative numcustoms per line a wait $e1 and cpline/4-1 NOPs), a wait + DMA off. The coplist becomes the used one. a3 = the coplist (!libs {displaylib,$1380}). Errors: more bitplanes than the resolution allows ("Illegal Number of BitPlanes for Resolution"); fixed: in the normal code (#412).
| ypos | d1: the first line of the display |
| height | d2: the number of lines |
| type | d3: bitplanes (bits 0-3), resolution, fetch mode, sprite resolution and AGA flags |
| sprites | d4: the number of sprite channels |
| colours | d5: the number of colours |
| used | d6: the offset of the "used" variable (!libs {displaylib,$0604}) |
| args | a2: the argument stack, numcustoms below it |
| sprmode | a0: spriteslib's value (the sprite mode) |
| void _setgenlock | ( | void | ) |
|
static |
DisplayGenlock BPLCON0: bits that later InitCopLists OR into their BPLCON0 move (2 = external sync, 4 = interlace).
| v | d0: the BPLCON0 bits |
| BLITZ_ALIAS | ( | _createdisplay | , |
| _createdisplay_c | ) |
| BLITZ_ALIAS | ( | _customchunky | , |
| _customchunky_c | ) |
| BLITZ_ALIAS | ( | _customchunky2 | , |
| _customchunky2_c | ) |
| BLITZ_ALIAS | ( | _customchunkysize | , |
| _customchunkysize_c | ) |
| BLITZ_ALIAS | ( | _customcols | , |
| _customcols_c | ) |
| BLITZ_ALIAS | ( | _customcols2 | , |
| _customcols2_c | ) |
| BLITZ_ALIAS | ( | _customsprites | , |
| _customsprites_c | ) |
| BLITZ_ALIAS | ( | _customstring | , |
| _customstring_c | ) |
| BLITZ_ALIAS | ( | _displaydblscan | , |
| _displaydblscan_c | ) |
| BLITZ_ALIAS | ( | _displaydblscan0 | , |
| _displaydblscan0_c | ) |
| BLITZ_ALIAS | ( | _displaydbmap | , |
| _displaydbmap_c | ) |
| BLITZ_ALIAS | ( | _displaydbmap2 | , |
| _displaydbmap2_c | ) |
| BLITZ_ALIAS | ( | _displayrainbow | , |
| _displayrainbow_c | ) |
| BLITZ_ALIAS | ( | _displayrainbow0 | , |
| _displayrainbow0_c | ) |
| BLITZ_ALIAS | ( | _displayrgb | , |
| _displayrgb_c | ) |
| BLITZ_ALIAS | ( | _displayrgb0 | , |
| _displayrgb0_c | ) |
| BLITZ_ALIAS | ( | _displayscroll | , |
| _displayscroll_c | ) |
| BLITZ_ALIAS | ( | _displayscroll0 | , |
| _displayscroll0_c | ) |
| BLITZ_ALIAS | ( | _displayuser | , |
| _displayuser_c | ) |
| BLITZ_ALIAS | ( | _displayuser0 | , |
| _displayuser0_c | ) |
| BLITZ_ALIAS | ( | _doadjust | , |
| _doadjust_c | ) |
| BLITZ_ALIAS | ( | _dobplcons | , |
| _dobplcons_c | ) |
| BLITZ_ALIAS | ( | _initcoplist | , |
| _initcoplist_c | ) |
| BLITZ_ALIAS | ( | _initcoplist2 | , |
| _initcoplist2_c | ) |
| BLITZ_ALIAS | ( | _setgenlock | , |
| _setgenlock_c | ) |
| BLITZ_ERRCHK_ASM | ( | checkcoplist | , |
| " .globl __checkcoplist\n" "__checkcoplist:\n" " tst.l (a3)\n" " beq.w _uniniterr\n" " rts" | ) |
| CMAT | ( | aga | , |
| 72 | ) |
| CMAT | ( | bplanes | , |
| 20 | ) |
| CMAT | ( | bplcon3 | , |
| 70 | ) |
| CMAT | ( | colors | , |
| 8 | ) |
| CMAT | ( | csprites | , |
| 92 | ) |
| CMAT | ( | dob | , |
| 32 | ) |
| CMAT | ( | fetchwid | , |
| 42 | ) |
| CMAT | ( | ham8 | , |
| 90 | ) |
| CMAT | ( | height | , |
| 50 | ) |
| CMAT | ( | numbp | , |
| 38 | ) |
| CMAT | ( | numcols | , |
| 56 | ) |
| CMAT | ( | numsprites | , |
| 54 | ) |
| CMAT | ( | res | , |
| 52 | ) |
| CMAT | ( | resshift | , |
| 74 | ) |
| CMAT | ( | spif | , |
| 84 | ) |
| CMAT | ( | spri | , |
| 126 | ) |
| CMAT | ( | sprites | , |
| 12 | ) |
| CMAT | ( | sspwid | , |
| 88 | ) |
| CMAT | ( | x0 | , |
| 62 | ) |
| CMAT | ( | x1 | , |
| 66 | ) |
| CMAT | ( | xand | , |
| 44 | ) |
| CMAT | ( | xshift | , |
| 46 | ) |
| CMAT | ( | ypos | , |
| 48 | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
| void displaylib_codeinit | ( | void | ) |
| void displaypalette | ( | void | ) |
DisplayPalette CopList#,Palette#: puts a palette into the list's colour moves.
numcols colours from colour 0; ECS: one move per colour (simple), AGA (aga bit 15): per bank of 32 colours a bank move and the high and low nibbles (complex2). Errors: an uninitialised palette ("Uninitialised Palette"), a list overrun ("Not Enough Custom Cops"); fixed: in the normal code (#412).
DisplayPalette CopList#,Palette#,coloroffset: as DisplayPalette, from the palette's colour coloroffset.
DisplayPalette CopList#,Palette#,coloroffset,bankoffset: as DisplayPalette, from colour coloroffset into colour bank bankoffset (AGA).
| void errors | ( | void | ) |
|
static |
|
static |
| void maxbperr | ( | void | ) |
| MESSAGE | ( | mess1 | , |
| "Illegal Number of BitPlanes for Resolution" | ) |
| MESSAGE | ( | mess10 | , |
| "Not Enough Sprite Channels" | ) |
| MESSAGE | ( | mess2 | , |
| "Uninitialised CopList" | ) |
| MESSAGE | ( | mess3 | , |
| "Uninitialised Palette" | ) |
| MESSAGE | ( | mess4 | , |
| "Uninitialised Sprite" | ) |
| MESSAGE | ( | mess5 | , |
| "Custom Copper String Must Be Multiple Of 4 Bytes Silly!" | ) |
| MESSAGE | ( | mess6 | , |
| "Not Enough Custom Copper Space" | ) |
| MESSAGE | ( | mess8 | , |
| "CustomChunky must start at ypos greater than res" | ) |
| MESSAGE | ( | mess9 | , |
| "Not Enough Custom Cops" | ) |
|
inlinestatic |
|
static |
|
static |
|
static |
|
static |
|
static |
| BL_ALWAYS_INLINE UWORD * setptr | ( | UWORD * | a2, |
| ULONG | v ) |
|
static |
|
static |
| UWORD agaflag |
| UWORD agamac |
|
static |
|
static |
|
static |
|
static |
| struct { ... } cd |
| struct { ... } d |
| struct { ... } dl |
| UWORD dloop[5] |
|
static |
| UWORD genlock |
| UWORD lastwait |
| UWORD loopd |
| UWORD mods[2] |
| ULONG mysprite |
| struct { ... } sc |
|
static |
| UWORD shup[3] |
| UWORD slup[3] |
|
static |
| UWORD swup[3] |
|
static |
| ULONG topcop |
| UWORD ycont |