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, ...);
118int jo_sprintf(
char *
const str,
const char *
const format, ...);
126int jo_vsprintf(
char *
const str,
const char * format, va_list args);
130#define jo_printf_debug(X, Y, fmt, args...) \
131 jo_printf(X, Y, "%s(%s)#%d : " fmt , \
132 __FILE__, __FUNCTION__, __LINE__, ## args)
141#ifdef JO_COMPILE_WITH_PRINTF_SUPPORT
149void jo_print(
int x,
int y,
char * str);
156# define jo_printf(X, Y, ...) do {jo_sprintf(__jo_sprintf_buf, __VA_ARGS__); jo_print(X, Y, __jo_sprintf_buf); } while(0)
164# 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)
167extern unsigned short __jo_vdp2_printf_palette;
172static __jo_force_inline void jo_set_printf_color_index(
const unsigned char index)
174 __jo_vdp2_printf_palette = (
unsigned short)((index & 7) << 12);
180void jo_clear_screen(
void);
186void jo_clear_screen_line(
const int y);
196void jo_memcpy(
void *
const restrict dst,
const void *
const restrict src,
unsigned int size);
221void jo_dma_copy(
const void *
const src,
void *
const dest,
const unsigned int size);
228void jo_dma_fill32(
void *
const dest,
const unsigned int value,
const unsigned int size);
239# define JO_NULL ((void *)0)
243# define JO_UNUSED_ARG(ARG) ((void)ARG)
251 return c ==
'\n' || c ==
'\r' || c ==
'\t' || c ==
' ';
260 return (
int)str[0] | (((int)str[1]) << 8) | (((
int)str[2]) << 16) | (((int)str[3]) << 24);
324int jo_strcmp(
const char * restrict p1,
const char * restrict p2);
341bool jo_endwith(
const char * restrict str,
const char * restrict end);
349void jo_memset(
const void *
const restrict ptr,
const int value,
unsigned int num);
357int jo_memcmp(
const void *
const p1,
const void *
const p2,
unsigned int num);
365 return (((
unsigned int)src[0] << 24) | ((
unsigned int)src[1] << 16) | ((
unsigned int)src[2] << 8) | src[3]);
401void jo_map_to_vram(
unsigned short * restrict data,
unsigned short * restrict vram_addr,
402 unsigned short suuj,
unsigned short suui,
unsigned short palnum,
unsigned int mapoff);
411 while (size-- > 0) *(vram_addr++) = *(data++);
#define JO_PRINTF_BUF_SIZE
Max character in available in jo_printf().
Definition conf.h:157
#define __jo_force_inline
force inline attribute (and prevent Doxygen prototype parsing bug)
Definition types.h:39