1
2 #ifndef __OSINLINE__
3 #define __OSINLINE__
4
5 #include <retro_inline.h>
6
7 /* What goes herein depends heavily on the OS. */
8
9 #define DIRTY_H 256
10 #define DIRTY_V 1600/16
11
12 extern char *dirty_new;
13 #define osd_mark_vector_dirty(x,y) dirty_new[(y)/16 * DIRTY_H + (x)/16] = 1
14
15 #if (IS_ARM)
16 #define vec_mult _vec_mult
_vec_mult(int x,int y)17 static INLINE int _vec_mult(int x, int y)
18 {
19 int res_hi, res_lo;
20
21 __asm__ __volatile__
22 ("smull\t%1,%0,%2,%3"
23 : "=r"(res_hi), "=r"(res_lo)
24 : "r"(x), "r"(y)
25 );
26
27 return res_hi;
28 }
29 #endif
30
31 #include "minimal.h"
32
33 //dst=(src>>1)+(dst>>1);
34 #if (IS_ARM)
35 #define mix_sample _mix_sample
36 #define _mix_sample(dst,src) \
37 __asm__ __volatile__ \
38 ( " mov %2, %2, asr #1 \n" \
39 " add %0, %1, %2 , asr #1 \n" \
40 : "=r" (dst) \
41 : "r" (src),"r" (dst) \
42 )
43 #endif
44
45 //if (x < -32768)
46 // x = -32768;
47 //else if (x > 32767)
48 // x = 32767;
49 #define clip_short _clip_short
50 #define _clip_short(x) { int sign = x >> 31; if (sign != (x >> 15)) x = sign ^ ((1 << 15) - 1); }
51
52 #define clip_short_ret _clip_short_ret
_clip_short_ret(int x)53 static INLINE int _clip_short_ret(int x) { _clip_short(x); return x; }
54
55
56 #endif /* __OSINLINE__ */
57