BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
graphics.h
Go to the documentation of this file.
1
/* The safe forms of <inline/graphics.h> for the libraries
2
(cmake/ndk-calls.cmake, libs/include/ndk/functions.list): the NDK's
3
macro, the register variable on a3 replaced by an operand in a register
4
gcc chooses, which "exg" swaps with a3 around the jsr. a3 is back
5
afterwards (the OS keeps d2-d7/a2-a6); 4 bytes per call, no stack, the
6
condition codes untouched (the NDK's own technique for a5). */
7
8
#define __TextFit_base(__in_base, ___rp, ___string, ___strLen, ___textExtent, ___constrainingExtent, ___strDirection, ___constrainingBitWidth, ___constrainingBitHeight) ({\
9
struct RastPort * __p____rp = (struct RastPort *)(___rp);\
10
STRPTR __p____string = (STRPTR)(___string);\
11
UWORD __p____strLen = (UWORD)(___strLen);\
12
struct TextExtent * __p____textExtent = (struct TextExtent *)(___textExtent);\
13
struct TextExtent * __p____constrainingExtent = (struct TextExtent *)(___constrainingExtent);\
14
WORD __p____strDirection = (WORD)(___strDirection);\
15
UWORD __p____constrainingBitWidth = (UWORD)(___constrainingBitWidth);\
16
UWORD __p____constrainingBitHeight = (UWORD)(___constrainingBitHeight);\
17
register void * __p__in_base __asm("a6") = (void *)(__in_base);\
18
register ULONG __v_ret __asm("d0");\
19
register struct RastPort * __v0 __asm("a1") = __p____rp;\
20
register STRPTR __v1 __asm("a0") = __p____string;\
21
register ULONG __v2 __asm("d0") = __p____strLen;\
22
register struct TextExtent * __v3 __asm("a2") = __p____textExtent;\
23
register LONG __v5 __asm("d1") = __p____strDirection;\
24
register ULONG __v6 __asm("d2") = __p____constrainingBitWidth;\
25
register ULONG __v7 __asm("d3") = __p____constrainingBitHeight;\
26
__asm volatile (\
27
"exg %4,%/a3\n\tjsr %/a6@(-696:W)\n\texg %4,%/a3\n"\
28
: "=d"(__v_ret), "+a"(__v0), "+a"(__v1), "+d"(__v5), "+r"(__p____constrainingExtent)\
29
: "a"(__p__in_base), "d"(__v2), "a"(__v3), "d"(__v6), "d"(__v7)\
30
: "fp0", "fp1", "cc", "memory" );\
31
__v_ret;})
32
33
#define __ChangeExtSpriteA_base(__in_base, ___vp, ___oldsprite, ___newsprite, ___tags) ({\
34
struct ViewPort * __p____vp = (struct ViewPort *)(___vp);\
35
struct ExtSprite * __p____oldsprite = (struct ExtSprite *)(___oldsprite);\
36
struct ExtSprite * __p____newsprite = (struct ExtSprite *)(___newsprite);\
37
struct TagItem * __p____tags = (struct TagItem *)(___tags);\
38
register void * __p__in_base __asm("a6") = (void *)(__in_base);\
39
register LONG __v_ret __asm("d0");\
40
register struct ViewPort * __v0 __asm("a0") = __p____vp;\
41
register struct ExtSprite * __v1 __asm("a1") = __p____oldsprite;\
42
register struct ExtSprite * __v2 __asm("a2") = __p____newsprite;\
43
__asm volatile (\
44
"exg %3,%/a3\n\tjsr %/a6@(-1026:W)\n\texg %3,%/a3\n"\
45
: "=d"(__v_ret), "+a"(__v0), "+a"(__v1), "+r"(__p____tags)\
46
: "a"(__p__in_base), "a"(__v2)\
47
: "fp0", "fp1", "cc", "memory", "d1" );\
48
__v_ret;})
libs
include
ndk
safe
graphics.h
Generated by
1.16.1