![]() |
Jo Engine 2026.11.1
Jo Sega Saturn Engine
|
Jo Engine Tools (printf, etc,). More...
Go to the source code of this file.
Data Structures | |
| struct | jo_datetime |
| DateTime struct. More... | |
Macros | |
| #define | JO_FIXED_TV_WIDTH |
| Fixed value of JO_TV_WIDTH. | |
| #define | JO_FIXED_TV_HEIGHT |
| Fixed value of JO_TV_HEIGHT. | |
| #define | jo_printf_debug(X, Y, fmt, args...) |
| #define | JO_NULL |
| NULL implementation. | |
| #define | JO_UNUSED_ARG(ARG) |
| Mark function argument as unused. | |
Enumerations | |
| enum | jo_language { English , Deutsch , French , Espanol , Italiano , Japanese } |
| Language type. More... | |
| enum | jo_horizontal_move { None , Left , Right } |
| Horizontal move. More... | |
Functions | |
| static __jo_force_inline short | jo_swap_endian_short (short value) |
| Swap Short endian. | |
| static __jo_force_inline unsigned short | jo_swap_endian_ushort (unsigned short value) |
| Swap Unsigned short endian. | |
| static __jo_force_inline unsigned int | jo_swap_endian_uint (unsigned int value) |
| Swap unsigned int endian. | |
| static __jo_force_inline int | jo_swap_endian_int (int value) |
| Swap int endian. | |
| static __jo_force_inline unsigned short | jo_read_big_endian_ushort (const unsigned char *const p) |
| Read a big endian unsigned short (16 bits) from any address (the bytes of a file, aligned or not). | |
| static __jo_force_inline unsigned int | jo_read_big_endian_uint (const unsigned char *const p) |
| Read a big endian unsigned int (32 bits) from any address (the bytes of a file, aligned or not). | |
| int | sprintf (char *str, const char *format,...) |
| sprintf prototypes | |
| int | jo_sprintf (char *const str, const char *const format,...) |
| A small sprintf of the engine (jo_printf()...): d i u x X c s %%, the flags - and 0, a width. Faster and smaller than the one of the C library (which handles the floats: f is not supported here, written as it is). | |
| int | jo_vsprintf (char *const str, const char *format, va_list args) |
| jo_sprintf() with a list of arguments | |
| void | jo_memcpy (void *const restrict dst, const void *const restrict src, unsigned int size) |
| Copies size bytes from the object pointed to by src to the object pointed to by dst. | |
| void | jo_dma_copy_async (const void *const src, void *const dest, const unsigned int size) |
| Start a copy with the DMA controller of the current CPU (the function doesn't wait for the end of the copy). | |
| void | jo_dma_wait (void) |
| Wait for the end of the copy started by jo_dma_copy_async() on the current CPU. | |
| void | jo_dma_copy (const void *const src, void *const dest, const unsigned int size) |
| Copy with the DMA controller of the current CPU and wait for the end of the copy. | |
| void | jo_dma_fill32 (void *const dest, const unsigned int value, const unsigned int size) |
| Fill memory with a 32 bits value using the DMA controller of the current CPU (waits for the end). | |
| void | __jo_dma_read_port32 (const volatile void *const port, void *const dest, const unsigned int size) |
| Read a 32 bits I/O port into memory with the DMA controller of the current CPU (Internal usage). | |
| static __jo_force_inline bool | jo_tools_is_whitespace (const char c) |
| Check if the character is a whitespace. | |
| static __jo_force_inline int | jo_4_char_hash (const char *const str) |
| Create an hash code based on the first four character of the string. | |
| jo_language | jo_get_current_language (void) |
| Get Sega saturn current language. | |
| void | jo_getdate (jo_datetime *now) |
| get current date and time | |
| int | jo_tools_atoi (const char *restrict str) |
| atoi implementation | |
| int | jo_strlen (const char *restrict str) |
| strlen implementation | |
| int | jo_strcmp (const char *restrict p1, const char *restrict p2) |
| strcmp implementation | |
| static __jo_force_inline bool | jo_string_equals (const char *restrict p1, const char *restrict p2) |
| Determine if two string equals. | |
| bool | jo_endwith (const char *restrict str, const char *restrict end) |
| determine if str end with a specific string | |
| void | jo_memset (const void *const restrict ptr, const int value, unsigned int num) |
| Sets the first num bytes of the block of memory pointed by ptr to the specified value (interpreted as an unsigned char). | |
| int | jo_memcmp (const void *const p1, const void *const p2, unsigned int num) |
| memcmp implementation | |
| static __jo_force_inline unsigned int | jo_lz_size (const unsigned char *const src) |
| Size of the data compressed by Compiler/COMMON/jo_lz.py (the 4 bytes at its start, big endian). | |
| unsigned int | jo_lz_decompress (const unsigned char *const src, unsigned char *const dst) |
| Decompress data compressed by Compiler/COMMON/jo_lz.py (LZSS: a byte of 8 flags, 1 a byte as it is, 0 a copy of 3 to 18 bytes from 1 to 4096 bytes before: 12 bits of distance, 4 bits of length). | |
| static __jo_force_inline void | jo_yield (void) |
| Little pause possible. | |
| static __jo_force_inline void | jo_spin_wait (int iterations) |
| Causes "a thread" to wait the number of times defined by the iterations parameter. | |
| void | jo_map_to_vram (unsigned short *restrict data, unsigned short *restrict vram_addr, unsigned short suuj, unsigned short suui, unsigned short palnum, unsigned int mapoff) |
| Copies the image map data to VRAM. | |
| static __jo_force_inline void | jo_cell_to_vram (unsigned char *restrict data, unsigned char *restrict vram_addr, unsigned int size) |
| Copies the image cel data to VRAM. | |
Variables | |
| char | __jo_sprintf_buf [JO_PRINTF_BUF_SIZE] |
| Internal sprintf buffer. | |
Jo Engine Tools (printf, etc,).
| struct jo_datetime |
| #define JO_FIXED_TV_HEIGHT |
Fixed value of JO_TV_HEIGHT.
| #define JO_FIXED_TV_WIDTH |
Fixed value of JO_TV_WIDTH.
| #define JO_NULL |
NULL implementation.
| #define jo_printf_debug | ( | X, | |
| Y, | |||
| fmt, | |||
| args... ) |
| #define JO_UNUSED_ARG | ( | ARG | ) |
Mark function argument as unused.
| enum jo_horizontal_move |
| enum jo_language |
| void __jo_dma_read_port32 | ( | const volatile void *const | port, |
| void *const | dest, | ||
| const unsigned int | size ) |
Read a 32 bits I/O port into memory with the DMA controller of the current CPU (Internal usage).
| port | Port address (the address doesn't change) |
| dest | Destination (4 bytes aligned) |
| size | Size in bytes (multiple of 4) |
|
static |
Create an hash code based on the first four character of the string.
| str | String |
|
static |
Copies the image cel data to VRAM.
| data | Data source |
| vram_addr | VRAM address |
| size | Data size |
| void jo_dma_copy | ( | const void *const | src, |
| void *const | dest, | ||
| const unsigned int | size ) |
Copy with the DMA controller of the current CPU and wait for the end of the copy.
| src | Data source |
| dest | Destination |
| size | Size in bytes |
| void jo_dma_copy_async | ( | const void *const | src, |
| void *const | dest, | ||
| const unsigned int | size ) |
Start a copy with the DMA controller of the current CPU (the function doesn't wait for the end of the copy).
| src | Data source |
| dest | Destination |
| size | Size in bytes |
| void jo_dma_fill32 | ( | void *const | dest, |
| const unsigned int | value, | ||
| const unsigned int | size ) |
Fill memory with a 32 bits value using the DMA controller of the current CPU (waits for the end).
| dest | Destination (4 bytes aligned) |
| value | Value |
| size | Size in bytes (multiple of 4) |
| void jo_dma_wait | ( | void | ) |
Wait for the end of the copy started by jo_dma_copy_async() on the current CPU.
| bool jo_endwith | ( | const char *restrict | str, |
| const char *restrict | end ) |
determine if str end with a specific string
| str | This is the string |
| end | The ending string |
| jo_language jo_get_current_language | ( | void | ) |
Get Sega saturn current language.
| void jo_getdate | ( | jo_datetime * | now | ) |
get current date and time
| now | result |
| unsigned int jo_lz_decompress | ( | const unsigned char *const | src, |
| unsigned char *const | dst ) |
Decompress data compressed by Compiler/COMMON/jo_lz.py (LZSS: a byte of 8 flags, 1 a byte as it is, 0 a copy of 3 to 18 bytes from 1 to 4096 bytes before: 12 bits of distance, 4 bits of length).
| src | Compressed data (the size first, see jo_lz_size()) |
| dst | Decompressed data (jo_lz_size() bytes) |
|
static |
Size of the data compressed by Compiler/COMMON/jo_lz.py (the 4 bytes at its start, big endian).
| src | Compressed data |
| void jo_map_to_vram | ( | unsigned short *restrict | data, |
| unsigned short *restrict | vram_addr, | ||
| unsigned short | suuj, | ||
| unsigned short | suui, | ||
| unsigned short | palnum, | ||
| unsigned int | mapoff ) |
Copies the image map data to VRAM.
| data | Data source |
| vram_addr | VRAM address |
| suui | SUUI |
| suuj | SUUJ |
| palnum | Palette number |
| mapoff | MapOff |
| int jo_memcmp | ( | const void *const | p1, |
| const void *const | p2, | ||
| unsigned int | num ) |
memcmp implementation
| p1 | First block of memory |
| p2 | Second block of memory |
| num | Number of bytes to compare |
| void jo_memcpy | ( | void *const restrict | dst, |
| const void *const restrict | src, | ||
| unsigned int | size ) |
Copies size bytes from the object pointed to by src to the object pointed to by dst.
| dst | Destination |
| src | Data source |
| size | Number of bytes to copy |
| void jo_memset | ( | const void *const restrict | ptr, |
| const int | value, | ||
| unsigned int | num ) |
Sets the first num bytes of the block of memory pointed by ptr to the specified value (interpreted as an unsigned char).
| ptr | Pointer to the block of memory to fill. |
| value | Value to be set. The value is passed as an int, but the function fills the block of memory using the unsigned char conversion of this value. |
| num | Number of bytes to be set to the value. |
|
static |
Read a big endian unsigned int (32 bits) from any address (the bytes of a file, aligned or not).
| p | Address of the first byte |
|
static |
Read a big endian unsigned short (16 bits) from any address (the bytes of a file, aligned or not).
| p | Address of the first byte |
|
static |
Causes "a thread" to wait the number of times defined by the iterations parameter.
| iterations | defines how long "a thread" is to wait |
| int jo_sprintf | ( | char *const | str, |
| const char *const | format, | ||
| ... ) |
A small sprintf of the engine (jo_printf()...): d i u x X c s %%, the flags - and 0, a width. Faster and smaller than the one of the C library (which handles the floats: f is not supported here, written as it is).
| str | String (big enough) |
| format | Format string |
| ... | Arguments |
| int jo_strcmp | ( | const char *restrict | p1, |
| const char *restrict | p2 ) |
strcmp implementation
| p1 | First string |
| p2 | Second string |
|
static |
Determine if two string equals.
| p1 | First string |
| p2 | Second string |
| int jo_strlen | ( | const char *restrict | str | ) |
strlen implementation
| str | This is the string |
|
static |
Swap int endian.
| value | Little or Big endian int |
|
static |
Swap Short endian.
| value | Little or Big endian short |
|
static |
Swap unsigned int endian.
| value | Little or Big endian unsigned int |
|
static |
Swap Unsigned short endian.
| value | Little or Big endian unsigned short |
| int jo_tools_atoi | ( | const char *restrict | str | ) |
atoi implementation
| str | This is the string representation of an integral number |
|
static |
Check if the character is a whitespace.
| c | variable of char type |
| int jo_vsprintf | ( | char *const | str, |
| const char * | format, | ||
| va_list | args ) |
jo_sprintf() with a list of arguments
| str | String (big enough) |
| format | Format string |
| args | Arguments |
|
static |
Little pause possible.
| int sprintf | ( | char * | str, |
| const char * | format, | ||
| ... ) |
sprintf prototypes
| str | String |
| format | Format string |
| ... | Arguments |
|
extern |
Internal sprintf buffer.