 |
Jo Engine
2023.08.26
Jo Sega Saturn Engine
|
Go to the documentation of this file.
35 #ifndef __JO_TOOLS_H__
36 # define __JO_TOOLS_H__
49 return ((((value) >> 8) & 0xff) | (((value) & 0xff) << 8));
58 return ((((value) >> 8) & 0xff) | (((value) & 0xff) << 8));
67 return ((((value) & 0xff000000) >> 24) | (((value) & 0x00ff0000) >> 8) | (((value) & 0x0000ff00) << 8) | (((value) & 0x000000ff) << 24));
76 return ((((value) & 0xff000000) >> 24) | (((value) & 0x00ff0000) >> 8) | (((value) & 0x0000ff00) << 8) | (((value) & 0x000000ff) << 24));
85 int sprintf(
char* str,
const char* format, ...);
89 #define jo_printf_debug(X, Y, fmt, args...) \
90 jo_printf(X, Y, "%s(%s)#%d : " fmt , \
91 __FILE__, __FUNCTION__, __LINE__, ## args)
100 #ifdef JO_COMPILE_WITH_PRINTF_SUPPORT
102 #if !JO_COMPILE_USING_SGL
103 extern unsigned char __jo_printf_current_palette_index;
111 void jo_print(
int x,
int y,
char * str);
118 # define jo_printf(X, Y, ...) do {sprintf(__jo_sprintf_buf, __VA_ARGS__); jo_print(X, Y, __jo_sprintf_buf); } while(0)
126 # 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)
131 static __jo_force_inline void jo_set_printf_color_index(
const unsigned char index)
133 #if JO_COMPILE_USING_SGL
136 __jo_printf_current_palette_index = index;
143 void jo_clear_screen(
void);
149 void jo_clear_screen_line(
const int y);
151 #endif // JO_COMPILE_WITH_PRINTF_SUPPORT
161 #if JO_COMPILE_USING_SGL
162 slDMACopy(src, dest, size);
164 slDMACopy(src, dest, size);
170 # define JO_NULL ((void *)0)
174 # define JO_UNUSED_ARG(ARG) ((void)ARG)
182 return c ==
'\n' || c ==
'\r' || c ==
'\t' || c ==
' ';
191 return (
int)str[0] | (((int)str[1]) << 8) | (((
int)str[2]) << 16) | (((int)str[3]) << 24);
255 int jo_strcmp(
const char * restrict p1,
const char * restrict p2);
272 bool jo_endwith(
const char * restrict str,
const char * restrict end);
280 void jo_memset(
const void *
const restrict ptr,
const int value,
unsigned int num);
305 void jo_map_to_vram(
unsigned short * restrict data,
unsigned short * restrict vram_addr,
306 unsigned short suuj,
unsigned short suui,
unsigned short palnum,
unsigned int mapoff);
315 while (size-- > 0) *(vram_addr++) = *(data++);
#define JO_PRINTF_BUF_SIZE
Max character in available in jo_printf()
Definition: conf.h:165
#define __jo_force_inline
force inline attribute (and prevent Doxygen prototype parsing bug)
Definition: types.h:39