|
| void | ricopperfxlib_libinit (void) |
| void | ricopperfxlib_libfinit (void) |
| void | ricopperfxlib_docolsplit (void) |
| void | redocolsplit (void) |
| void | splitreset2 (void) |
| void | splitreset (void) |
| void | EndSplit (void) |
| void | InfoBlock (void) |
| void | CustomCommand (void) |
| void | CustomMove (void) |
| void | CustomWait (void) |
| void | CustomSkip (void) |
| void | getccoffset (void) |
| void | CustomAGACol (void) |
| void | splitresethard (void) |
| void | splitbplcon3 (void) |
| void | colsplitchk (void) |
| static UWORD * | getcustom (void) |
| static UWORD | bank (UBYTE reg) |
| static UWORD | colourreg (UBYTE reg) |
| static UWORD | highnibbles (UWORD r, UWORD g, UWORD b) |
| static UWORD | lownibbles (UWORD r, UWORD g, UWORD b) |
| static void | gradient (struct grad *g, const struct colsplit *cols, UWORD numlines) |
| ULONG | c_docolsplit (const struct colsplit *cols, UWORD numlines, UBYTE reg) |
| | DoColSplit cols_adr,numlines,colour_register: a 24 bit colour gradient over numlines lines.
|
| void | c_redocolsplit (const struct colsplit *cols, UWORD numlines, ULONG ccoffset) |
| | RedoColSplit cols_adr,numlines,ccoffset: new colours for a split made by DoColSplit.
|
| void | c_splitreset (UWORD startline, UWORD ccoffset, struct bb_coplist *coplist) |
| | CopperReset coplist#,startline,ccoffset: use the custom copper space of a coplist.
|
| void | c_splitreset2 (UWORD startline, struct bb_coplist *coplist) |
| | CopperReset coplist#,startline: c_splitreset() with ccoffset 0.
|
| void | c_splitresethard (UBYTE *custom, UWORD startline) |
| | CopperResetAdr address,startline: use a custom copper space at an address.
|
| ULONG | c_getccoffset (void) |
| | GetCCOffset: the current offset in the custom space, in instructions.
|
| void | c_splitbplcon3 (UBYTE lo) |
| | ColSplitBplcon3 bplcon3: the low byte of BPLCON3 for the next DoColSplit.
|
| void | c_CustomCommand (UWORD ins1, UWORD ins2) |
| | CopperCommand copins1,copins2: write one copper instruction (two words).
|
| void | c_CustomMove (UWORD reg, UWORD value) |
| | CopperMove register,value: a MOVE instruction (bit 0 of the register cleared).
|
| void | c_CustomWait (UWORD x, UWORD y) |
| | CopperWait x,y: a WAIT instruction for the position x,y.
|
| void | c_CustomSkip (UWORD x, UWORD y) |
| | CopperSkip x,y: a SKIP instruction for the position x,y.
|
| void | c_EndSplit (void) |
| | CopperEnd: end the custom part: WAIT line $2c, DMA off, BPLCON3 bank 0, COLOR00 = 0.
|
| ULONG | c_CustomAGACol (ULONG col, UWORD r, UWORD g, UWORD b) |
| | CopperAGACol col#,r,g,b: set one 24 bit colour (4 instructions).
|
| ULONG | c_InfoBlock (void) |
| | CopperInfoBlock: the address of the state block (struct cfx, the original's layout).
|
| static void | c_libinit (void) |
| | init: no custom space, the state block cleared.
|
| static void | c_libfinit (void) |
| | finit: nothing (_libfinit is an RTS).
|
| static void | colsplitchk_c (ULONG numlines) |
| | The error check of DoColSplit and RedoColSplit (debugger only).
|
| ULONG c_CustomAGACol |
( |
ULONG | col, |
|
|
UWORD | r, |
|
|
UWORD | g, |
|
|
UWORD | b ) |
CopperAGACol col#,r,g,b: set one 24 bit colour (4 instructions).
BPLCON3 with the high nibbles of the colour's bank, the register, BPLCON3 with the low nibbles, the register.
- Parameters
-
| col | d0: the colour register (0-255) |
| r | d1: red (8 bit) |
| g | d2: green |
| b | d3: blue |
- Returns
- d0: -1 when the colour was written, 0 without a custom space (fixed #590: the original returned the col# argument, 1234 without a custom space)
| void c_CustomWait |
( |
UWORD | x, |
|
|
UWORD | y ) |
CopperWait x,y: a WAIT instruction for the position x,y.
The x position is ((x >> 1) & $FE) + 6, masked with $FE again: fixed (#591), the original adds the 6 as a word after the mask, so for x >= 500 it carried into the line bits (line y | 1, x 0-4); now the horizontal position wraps within its byte and the line stays y.
- Parameters
-
| x | d0: the x position |
| y | d1: the line |
| ULONG c_docolsplit |
( |
const struct colsplit * | cols, |
|
|
UWORD | numlines, |
|
|
UBYTE | reg ) |
DoColSplit cols_adr,numlines,colour_register: a 24 bit colour gradient over numlines lines.
Writes into the custom space from ccoffset on, per line: a WAIT for the line (startline, counted up), BPLCON3 (high nibbles), the colour register, BPLCON3 (low nibbles), the colour register; the bank of the register selects bits 13-15 of BPLCON3 (| ColSplitBplcon3's low byte). The colours run linearly from the start to the end r, g, b. Without a custom space only bplcon3LO/HI and colreg are set. numlines below 1 is the programmer's: with runtime error checking colsplitchk refuses it (fixed #589); without it 0 divides by zero (the exception as in the original) and a negative value runs up to 65536 lines (the DBRA counter as a word). The step (1 << 14) / numlines is a word quotient. The $FFE1FFFE wait (line 256) comes before a line whose low byte is 0 but not before line 0: fixed (#588), the original tested the low byte alone, so a split from line 0 waited for line 256 first.
- Parameters
-
| cols | d0: the colours (cols_adr) |
| numlines | d1: the number of lines |
| reg | d2: the colour register (0-255) |
- Returns
- d0: -1 when the split was written, 0 without a custom space (fixed #592: the original left the red step value, or cols_adr without a custom space)
init: no custom space, the state block cleared.
Fixed (#1126): the original's init is an RTS, so a second run of a program with the library still loaded (from the editor) started with the state of the run before: a command before CopperReset wrote into the custom space of the run before (perhaps a freed coplist), and its ColSplitBplcon3 byte stayed in effect. The whole block is cleared, as at the first load (Dc.l 0/Dc.w 0); stores to absolute addresses, no register changes.
| void c_redocolsplit |
( |
const struct colsplit * | cols, |
|
|
UWORD | numlines, |
|
|
ULONG | ccoffset ) |
RedoColSplit cols_adr,numlines,ccoffset: new colours for a split made by DoColSplit.
Starts at instruction ccoffset of the custom space, skips a line 256 WAIT, writes only the two colour values per line. Nothing without a custom space. The byte offset is ccoffset * 4 as a long: fixed (#594), the original's ASL.w #2 shifted only the low word and added the upper word unchanged. numlines as in DoColSplit (colsplitchk, fixed #589).
- Parameters
-
| cols | d0: the colours (cols_adr) |
| numlines | d1: the number of lines |
| ccoffset | d2: the split's offset in instructions (4 bytes) |
| void colsplitchk_c |
( |
ULONG | numlines | ) |
|
|
static |
The error check of DoColSplit and RedoColSplit (debugger only).
Fixed (#589), not in the original (ricopperfxlib had no error check area): both compute the colour step with DIVS by numlines and loop with DBRA on numlines - 1 as a word, without a look at numlines: 0 raised the divide-by-zero exception, a negative value wrote (DoColSplit) or rewrote (RedoColSplit) up to 65536 lines of 20 bytes behind the custom space. The release code is unchanged (an invalid argument, D-005).
Errors: "Colour split needs at least one line" (numlines, a word, below 1).
- Parameters
-
| numlines | d1: the number of lines (a word; the upper word is the caller's) |