36# define __JO_TOOLS_H__
45#define JO_FIXED_TV_WIDTH JO_INT_TO_FIXED(JO_TV_WIDTH)
47#define JO_FIXED_TV_HEIGHT JO_INT_TO_FIXED(JO_TV_HEIGHT)
55 return ((((value) >> 8) & 0xff) | (((value) & 0xff) << 8));
64 return ((((value) >> 8) & 0xff) | (((value) & 0xff) << 8));
73 return ((((value) & 0xff000000) >> 24) | (((value) & 0x00ff0000) >> 8) | (((value) & 0x0000ff00) << 8) | (((value) & 0x000000ff) << 24));
82 return ((((value) & 0xff000000) >> 24) | (((value) & 0x00ff0000) >> 8) | (((value) & 0x0000ff00) << 8) | (((value) & 0x000000ff) << 24));
91 return ((
unsigned short)((p[0] << 8) | p[1]));
100 return (((
unsigned int)p[0] << 24) | ((
unsigned int)p[1] << 16) | ((
unsigned int)p[2] << 8) | p[3]);
109int sprintf(
char* str,
const char* format, ...);
119int jo_sprintf(
char *
const str,
const char *
const format, ...);
127int jo_vsprintf(
char *
const str,
const char * format, va_list args);
136int jo_snprintf(
char *
const str,
const unsigned int size,
const char *
const format, ...);
145int jo_vsnprintf(
char *
const str,
const unsigned int size,
const char * format, va_list args);
149#define jo_printf_debug(X, Y, fmt, args...) \
150 jo_printf(X, Y, "%s(%s)#%d : " fmt , \
151 __FILE__, __FUNCTION__, __LINE__, ## args)
160#ifdef JO_COMPILE_WITH_PRINTF_SUPPORT
170void jo_print(
int x,
int y,
char * str);
177# define jo_printf(X, Y, ...) do {jo_snprintf(__jo_sprintf_buf, JO_PRINTF_BUF_SIZE, __VA_ARGS__); jo_print(X, Y, __jo_sprintf_buf); } while(0)
185# define jo_printf_with_color(X, Y, COLOR_INDEX, ...) do { jo_set_printf_color_index(COLOR_INDEX); jo_printf(X, Y, __VA_ARGS__); } while(0)
188extern unsigned short __jo_vdp2_printf_palette;
193static __jo_force_inline void jo_set_printf_color_index(
const unsigned char index)
195 __jo_vdp2_printf_palette = (
unsigned short)((index & 7) << 12);
204void jo_set_printf_outline(
const bool enabled,
const jo_color color);
209void jo_clear_screen(
void);
215void jo_clear_screen_line(
const int y);
225void jo_memcpy(
void *
const restrict dst,
const void *
const restrict src,
unsigned int size);
250void jo_dma_copy(
const void *
const src,
void *
const dest,
const unsigned int size);
257void jo_dma_fill32(
void *
const dest,
const unsigned int value,
const unsigned int size);
261# define JO_NULL ((void *)0)
265# define JO_UNUSED_ARG(ARG) ((void)ARG)
273 return c ==
'\n' || c ==
'\r' || c ==
'\t' || c ==
' ';
283 const unsigned char *
const s = (
const unsigned char *)str;
290 hash |= (
unsigned int)s[1] << 8;
293 hash |= (
unsigned int)s[2] << 16;
295 hash |= (
unsigned int)s[3] << 24;
362int jo_strcmp(
const char * restrict p1,
const char * restrict p2);
379bool jo_endwith(
const char * restrict str,
const char * restrict end);
387void jo_memset(
const void *
const restrict ptr,
const int value,
unsigned int num);
395int jo_memcmp(
const void *
const p1,
const void *
const p2,
unsigned int num);
403 return (((
unsigned int)src[0] << 24) | ((
unsigned int)src[1] << 16) | ((
unsigned int)src[2] << 8) | src[3]);
440 unsigned short suuj,
unsigned short suui,
unsigned short palnum,
unsigned int mapoff);
449 while (size-- > 0) *(vram_addr++) = *(
data++);
#define JO_PRINTF_BUF_SIZE
Max character in available in jo_printf().
Definition conf.h:146
void * data
Definition entity.h:19
#define __jo_force_inline
force inline attribute (and prevent Doxygen prototype parsing bug)
Definition types.h:39
unsigned short jo_color
15 bits color type
Definition types.h:53