|
BB2 C port
API reference: Blitz libraries in C and the shared code
|
Data Structures | |
| struct | viewlist |
Functions | |
| void | _initview (void) |
| void | _viewbitmap (void) |
| void | ridisplaylib_codeinit (void) |
| void | ridisplaylib_codefinit (void) |
| static void | codeinit_c (void) |
| init: open graphics.library 39. | |
| static void | codefinit_c (void) |
| finit: close graphics.library and free every copper list. | |
| static ULONG | initview_c (UWORD height, UWORD depth, UWORD sprites, UWORD colours) |
| InitView height,depth,numsprites,numcolours: allocate a copper list in chip memory and write its first four moves. | |
| static void | nothing_c (void) |
| ViewBitmap bitmap: no code (RTS). | |
Variables | |
| struct { | |
| ULONG viewsize | |
| UWORD * cop | |
| struct viewlist * lists | |
| } | vd = { 0, 0, 0 } |
| static struct Library * | gfxbase |
| void _initview | ( | void | ) |
| void _viewbitmap | ( | void | ) |
|
static |
finit: close graphics.library and free every copper list.
Closes the library if init opened it, and frees the lists of all InitViews, also without graphics.library (fixed (#891): the original frees only the last list, and nothing when init could not open the library; fixed (#888): it calls FreeMem(0, size) after a failed AllocMem).
|
static |
init: open graphics.library 39.
The base is only used by finit (to know that the library is open). Returns nothing (BL_NORET).
|
static |
InitView height,depth,numsprites,numcolours: allocate a copper list in chip memory and write its first four moves.
The size is 16*numsprites + 16*depth + 8*numcolours + 38, as a long (fixed (#890): the original's MOVE.w d0,d3 overwrites the colour count with the height before it is read, so its size is 8*height instead of 8*numcolours, computed as a word and sign-extended). The height is not part of the size. The four moves are DIWSTRT $2C81, DIWSTOP $2CC1, DDFSTRT $0038, DDFSTOP $00D0 (fixed (#889): the original's !cmoves read register and value from those absolute addresses, an address error on a 68000 at the odd ones). Without chip memory InitView returns 0, writes nothing and keeps the list before (fixed (#888): the original does not test AllocMem, the words go to address 0 and finit calls FreeMem(0, size)). Every call allocates a new list, behind a header of 8 bytes that chains it to the lists before; finit frees them all (fixed (#891): the original forgets the list before). The list is never installed.
| height | d0.w: the height (not used) |
| depth | d1.w: the depth (16 bytes per plane) |
| sprites | d2.w: the number of sprites (16 bytes each) |
| colours | d3.w: the number of colours (8 bytes each) |
|
static |
ViewBitmap bitmap: no code (RTS).
a0 = the bitmap object (!libs bitmaplib) is not used; d0 stays unchanged.
| void ridisplaylib_codefinit | ( | void | ) |
| void ridisplaylib_codeinit | ( | void | ) |
| UWORD* cop |
|
static |
| struct viewlist* lists |
| struct { ... } vd |
| ULONG viewsize |