Skip to Content
Amiga Assembly Library v41.21 — Motorola 68020 shared library for Commodore Amiga

AllocRastPort

Synopsis

rp = AllocRastPort() D0

C Prototype

struct RastPort *AllocRastPort(void);

Description

Allocates a RastPort structure and initializes it using graphics.library/InitRastPort(). The allocation is performed in public memory, and no BitMap structure is attached to the RastPort. Use exec.library/FreeVec() to free the memory when it is no longer needed.

Inputs

None.

Result

  • rp — If NULL, an error occurred. Otherwise, it is the address of the allocated RastPort structure.

See Also

Implementation

The original 68020 assembly implementation:

; (25-Oct-1994) --- rp = AllocRastPort() _LVOAllocRastPort movem.l d2/a4-a6,-(sp) move.l #4+rp_SIZEOF,d0 ; Alloc My Raster Port structure move.l d0,d2 moveq #1,d1 swap d1 move.l ab_ExecBase(a5),a6 jsr _LVOAllocMem(a6) tst.l d0 beq.s ARP_FIN move.l d0,a4 move.l d2,(a4)+ move.l a4,a1 move.l ab_GfxBase(a5),a6 jsr _LVOInitRastPort(a6) move.l a4,d0 ARP_FIN movem.l (sp)+,d2/a4-a6 rts
Last updated on