24#include <exec/types.h>
31#define BL_ALWAYS_INLINE static inline __attribute__((always_inline))
37#define BL_SETW(r, v) ((r) = ((r) & 0xffff0000UL) | (UWORD)(v))
38#define BL_SETB(r, v) ((r) = ((r) & 0xffffff00UL) | (UBYTE)(v))
39#define BL_EXTL(r) ((ULONG)(LONG)(WORD)(r))
40#define BL_SWAP(r) ((ULONG)(r) << 16 | (ULONG)(r) >> 16)
48 __asm__(
"divu.w %1,%0" :
"+d"(
d) :
"dmi"(s) :
"cc");
54 __asm__(
"divs.w %1,%0" :
"+d"(
d) :
"dmi"(s) :
"cc");
65 __asm__(
"mulu.w %1,%0" :
"+d"(r) :
"dmi"(b) :
"cc");
73 __asm__(
"muls.w %1,%0" :
"+d"(r) :
"dmi"(b) :
"cc");
95#define BL_STRCOPY_B_(d, s) do { \
97 __asm__("" : "+a"(d), "+a"(s)); \
99#define BL_STRCOPY(d, s, len) do { \
102 if ((len) < 0x10000 && !(((ULONG)(s) - (ULONG)(d)) & 1)) { \
103 if ((ULONG)(d) & 1) { \
104 BL_STRCOPY_B_(d, s); \
107 n_ = (UWORD)(((len) >> 2) - 1); \
109 *(ULONG *)(d) = *(const ULONG *)(s); \
112 __asm__("" : "+a"(d), "+a"(s)); \
113 } while ((WORD)--n_ != -1); \
115 } else if ((len) < 0x80000) { \
116 n_ = (UWORD)(((len) >> 3) - 1); \
118 BL_STRCOPY_B_(d, s); BL_STRCOPY_B_(d, s); \
119 BL_STRCOPY_B_(d, s); BL_STRCOPY_B_(d, s); \
120 BL_STRCOPY_B_(d, s); BL_STRCOPY_B_(d, s); \
121 BL_STRCOPY_B_(d, s); BL_STRCOPY_B_(d, s); \
122 } while ((WORD)--n_ != -1); \
128 n_ = (UWORD)((len) - 1); \
130 BL_STRCOPY_B_(d, s); \
131 while ((WORD)--n_ != -1); \
134 ULONG hi_ = ((len) - 1) >> 16; \
135 n_ = (UWORD)((len) - 1); \
138 BL_STRCOPY_B_(d, s); \
139 while ((WORD)--n_ != -1); \
140 } while (hi_-- != 0); \
155 (*(const ULONG *)((sp) = (const void *)((const UBYTE *)(sp) - 4)))
157 (*(const UWORD *)((sp) = (const void *)((const UBYTE *)(sp) - 2)))
165#define BL_CUSTOM ((UBYTE *)0xdff000)
166#define BL_CUSTOMW(cb, o) (*(volatile UWORD *)((UBYTE *)(cb) + (o)))
167#define BL_CUSTOML(cb, o) (*(volatile ULONG *)((UBYTE *)(cb) + (o)))
169#define BL_BLITBUSY(cb) (*(volatile UBYTE *)((UBYTE *)(cb) + 2) & 0x40)
172#define BL_BLITWAIT(cb) do { (void)BL_BLITBUSY(cb); while (BL_BLITBUSY(cb)) ; } while (0)
177#define BL_BLITWAIT_TST(cb) do { \
178 __asm__ volatile("tst.b 2(%0)" : : "a"(cb) : "cc"); \
179 while (BL_BLITBUSY(cb)) ; \
190 __asm__(
"muls.w %2,%0\n\tasr.w #3,%1\n\text.l %1\n\tadd.l %1,%0"
191 :
"=d"(off),
"+d"(
x) :
"m"(*bpr),
"0"(
y) :
"cc");
195#define BL_INTENA (*(volatile UWORD *)0xdff09a)
196#define BL_INTS_OFF() (BL_INTENA = 0x4000)
197#define BL_INTS_ON() (BL_INTENA = 0xc000)
204#define LVO_SPFix (-30)
205#define LVO_SPFlt (-36)
206#define LVO_SPCmp (-42)
207#define LVO_SPTst (-48)
208#define LVO_SPAbs (-54)
209#define LVO_SPNeg (-60)
210#define LVO_SPAdd (-66)
211#define LVO_SPSub (-72)
212#define LVO_SPMul (-78)
213#define LVO_SPDiv (-84)
214#define LVO_SPFloor (-90)
215#define LVO_SPCeil (-96)
221#define TOK_localloc 0xc000
222#define TOK_locfree 0xc001
223#define TOK_globalloc 0xc002
224#define TOK_globfree 0xc003
225#define TOK_getvbr 0xc31d
226#define TOK_ctrlcend 0xc321
228#define TOK_endjmp 0xc800
229#define TOK_lmultiply 0xca01
230#define TOK_ldivide 0xcb01
231#define TOK_strcomp2 0xce02
232#define TOK_qutofl 0xd300
234#define TOK_fltoqu 0xd301
235#define TOK_setint 0xc100
237#define TOK_clrint 0xc101
238#define TOK_vwait 0xc104
239#define TOK_allocst 0xcf01
240#define TOK_freest 0xcf02
244#define TOK_setin ((LIB_inputoutputlib << 7) + 3)
245#define TOK_setout ((LIB_inputoutputlib << 7) + 4)
246#define TOK_iogetsingle ((LIB_inputoutputlib << 7) + 5)
247#define TOK_iogetstring ((LIB_inputoutputlib << 7) + 6)
248#define TOK_iooutsingle ((LIB_inputoutputlib << 7) + 7)
249#define TOK_iooutstring1 ((LIB_inputoutputlib << 7) + 8)
250#define TOK_iooutstring2 ((LIB_inputoutputlib << 7) + 9)
251#define TOK_ioctrlcout ((LIB_inputoutputlib << 7) + 12)
253#define TOK_ioctrlcin ((LIB_inputoutputlib << 7) + 13)
254#define TOK_ustr ((LIB_printlib << 7) + 6)
255#define TOK_val ((LIB_vallib << 7) + 1)
256#define TOK_exists ((LIB_fileiolib << 7) + 21)
258#define TOK_execversion ((LIB_environlib << 7) + 7)
259#define TOK_setevfilter ((LIB_windowslib << 7) + 58)
260#define TOK_extbitmap ((LIB_bitmaplib << 7) + 4)
262#define TOK_getpal ((LIB_palettelib << 7) + 3)
263#define TOK_getpal2 ((LIB_palettelib << 7) + 4)
264#define TOK_showsprite ((LIB_spriteslib << 7) + 2)
267#define TOK_convertkey ((LIB_rawkeylib << 7) + 1)
268#define TOK_unconvert ((LIB_rawkeylib << 7) + 2)
269#define TOK_qconvertkey ((LIB_rawkeylib << 7) + 3)
271#define TOK_iffopen ((LIB_iffiolib << 7) + 1)
272#define TOK_iffclose ((LIB_iffiolib << 7) + 2)
273#define TOK_iffbyte ((LIB_iffiolib << 7) + 3)
274#define TOK_iffword ((LIB_iffiolib << 7) + 4)
275#define TOK_ifflong ((LIB_iffiolib << 7) + 5)
276#define TOK_ifffind ((LIB_iffiolib << 7) + 6)
277#define TOK_iffskip ((LIB_iffiolib << 7) + 7)
278#define TOK_iffread ((LIB_iffiolib << 7) + 8)
280#define TOK_ilbminit ((LIB_ilbmifflib << 7) + 1)
281#define TOK_ilbmgetbyte ((LIB_ilbmifflib << 7) + 2)
282#define TOK_ilbmbitmap ((LIB_ilbmifflib << 7) + 3)
287#define MEMBASE_localloc 0
288#define MEMBASE_locfree 4
289#define MEMBASE_globalloc 8
290#define MEMBASE_globfree 12
ULONG x
Definition 2dlib.c:2491
WORD y
Definition 2dlib.c:285
static ULONG bl_mulu_w(UWORD a, UWORD b)
Definition blitzhelp.h:61
static LONG bl_muls_w(WORD a, WORD b)
Definition blitzhelp.h:69
#define BL_ALWAYS_INLINE
Definition blitzhelp.h:31
BL_ALWAYS_INLINE ULONG bl_blitoff(const UWORD *bpr, WORD x, WORD y)
Definition blitzhelp.h:186
static ULONG bl_divu_w(ULONG d, UWORD s)
Definition blitzhelp.h:46
static ULONG bl_divs_w(ULONG d, WORD s)
Definition blitzhelp.h:52
static struct @065163037313156332013005143365272036211065172003 d