![]() |
Jo Engine 2026.11.1
Jo Sega Saturn Engine
|
Jo Engine core function prototypes. More...
Go to the source code of this file.
Macros | |
| #define | jo_core_error(...) |
| #define | JO_ENGINE_VERSION |
| Jo Engine Version. | |
| #define | jo_core_set_screens_order(screen1, args...) |
| Set scroll screen order between them. | |
Typedefs | |
| typedef void(*) | jo_event_callback(void) |
| Function prototype for jo_core_add_callback(). | |
| typedef void(*) | jo_interrupt_handler(void) |
| Function prototype for interrupt handlers (Internal usage). | |
| typedef void(*) | jo_slave_callback(void) |
| Function prototype for jo_core_exec_on_slave(). | |
| typedef void(*) | jo_slave_job_function(void *argument) |
| Function of a job of the slave CPU (Internal usage). | |
Functions | |
| void | __jo_core_error (char *message, const char *function) |
| void | __jo_core_errorf (const char *function, const char *format,...) __attribute__((cold |
| The message formatted, then __jo_core_error() (Internal usage): one call at each of the hundreds of jo_core_error() (the formatting at each of them was about 4 KB of code), out of the hot code (cold). | |
| void | jo_core_init (const jo_color back_color) |
| Init the engine. | |
| void | jo_core_run (void) |
| Run the game. | |
| int | jo_core_add_vblank_callback (const jo_event_callback callback) |
| Add a callback during VBLANK interruption. | |
| void | jo_core_remove_vblank_callback (const int vblank_event_id) |
| Remove a callback during VBLANK interruption. | |
| int | jo_core_add_callback (const jo_event_callback callback) |
| Add a callback in the game loop on main CPU. | |
| void | jo_core_remove_callback (const int event_id) |
| Remove a callback in the game loop from on main CPU. | |
| int | jo_core_add_slave_callback (const jo_event_callback callback) |
| Add a callback in the game loop on slave CPU. | |
| void | jo_core_remove_slave_callback (const int event_id) |
| Remove a callback in the game loop from on slave CPU. | |
| void | jo_core_set_restart_game_callback (const jo_event_callback callback) |
| Add a callback when A+B+C+Start is pressed on the first control pad. | |
| void | jo_goto_boot_menu (void) |
| Return to the boot menu. | |
| void | jo_core_exec_on_slave (jo_slave_callback callback) |
| Execute a callback on the slave CPU. | |
| void | jo_core_wait_for_slave (void) |
| Wait until all the callbacks given to jo_core_exec_on_slave() are completed. | |
| int | jo_core_slave_idle_time (void) |
| Balance of the CPUs in the last frame (between the 2 last calls of jo_core_wait_for_slave()). | |
| bool | __jo_core_is_slave_running (void) |
| Check if the slave CPU started (Internal usage). | |
| void | __jo_core_add_slave_job (const jo_slave_job_function function, void *argument) |
| Add a job to the queue of the slave CPU (Internal usage). | |
| static __jo_force_inline void | jo_core_disable_reset (void) |
| Disable reset button. | |
| static __jo_force_inline void | jo_core_enable_reset (void) |
| Enable reset button. | |
| void | jo_core_tv_off (void) |
| Turn OFF scroll drawing processing in the monitor. | |
| void | jo_core_tv_on (void) |
| Turn ON scroll drawing processing in the monitor. | |
| static __jo_force_inline int | jo_core_get_refresh_rate (void) |
| Get the refresh rate of the console. | |
| static __jo_force_inline void | jo_core_exit_to_multiplayer (void) |
| Exit program and return to the Saturn multiplayer (CD player) screen. | |
| static __jo_force_inline void | jo_core_restart_saturn (void) |
| Restart the Saturn. | |
| void | jo_core_suspend (void) |
| Stop the execution until someone press Start. | |
| static __jo_force_inline char * | jo_get_last_error (void) |
| Get last error. | |
| void | jo_dump_vdp1_registers (void) |
| Dump VDP1 registers. | |
| void | jo_dump_vdp2_registers (void) |
| Dump VDP2 registers. | |
| void | __jo_core_set_screens_order (jo_scroll_screen screen1,...) |
| Screen order (Internal usage). | |
| static __jo_force_inline unsigned int | jo_core_get_vblank_count (void) |
| Get the number of VBLANK since startup (60 per second in NTSC, 50 in PAL). | |
| void | __jo_core_synch (void) |
| Wait for the end of the current frame (Internal usage). | |
| void | __jo_core_set_interrupt_handler (const unsigned int vector, jo_interrupt_handler handler) |
| Set an interrupt handler in the vector table (Internal usage). | |
| void | __jo_core_enable_scu_interrupts (const unsigned int mask) |
| Unmask SCU interrupts (Internal usage). | |
| void | __jo_core_restore_scu_mask (void) |
| Write the SCU interrupt mask again at the end of a SCU interrupt handler (Internal usage). | |
| static __jo_force_inline unsigned int | __jo_core_get_sr (void) |
| Get CPU status register (Internal usage). | |
| static __jo_force_inline void | __jo_core_set_sr (const unsigned int sr) |
| Set CPU status register (Internal usage). | |
| static __jo_force_inline unsigned int | __jo_core_disable_interrupts (void) |
| Mask all interrupts (Internal usage). | |
| static __jo_force_inline void | __jo_core_restore_interrupts (const unsigned int sr) |
| Restore interrupts masked by __jo_core_disable_interrupts() (Internal usage). | |
Variables | |
| char | __jo_last_error [JO_PRINTF_BUF_SIZE] |
| Error handling (Internal usage). | |
| void | noinline |
| volatile unsigned int | __jo_core_vblank_count |
| Number of VBLANK since startup (Internal usage). | |
Jo Engine core function prototypes.
| #define jo_core_error | ( | ... | ) |
| #define jo_core_set_screens_order | ( | screen1, | |
| args... ) |
Set scroll screen order between them.
| screen1 | First screen (high priority) |
| args | Other screens |
| #define JO_ENGINE_VERSION |
Jo Engine Version.
| typedef void(*) jo_event_callback(void) |
Function prototype for jo_core_add_callback().
| typedef void(*) jo_interrupt_handler(void) |
Function prototype for interrupt handlers (Internal usage).
| typedef void(*) jo_slave_callback(void) |
Function prototype for jo_core_exec_on_slave().
| typedef void(*) jo_slave_job_function(void *argument) |
Function of a job of the slave CPU (Internal usage).
| void __jo_core_add_slave_job | ( | const jo_slave_job_function | function, |
| void * | argument ) |
Add a job to the queue of the slave CPU (Internal usage).
| function | Function executed by the slave CPU |
| argument | Argument of the function |
|
static |
Mask all interrupts (Internal usage).
| void __jo_core_enable_scu_interrupts | ( | const unsigned int | mask | ) |
Unmask SCU interrupts (Internal usage).
| mask | Interrupts (JO_SCU_INT_VBLANK_IN, etc) |
| void __jo_core_error | ( | char * | message, |
| const char * | function ) |
| void __jo_core_errorf | ( | const char * | function, |
| const char * | format, | ||
| ... ) |
The message formatted, then __jo_core_error() (Internal usage): one call at each of the hundreds of jo_core_error() (the formatting at each of them was about 4 KB of code), out of the hot code (cold).
|
static |
Get CPU status register (Internal usage).
| bool __jo_core_is_slave_running | ( | void | ) |
Check if the slave CPU started (Internal usage).
|
static |
Restore interrupts masked by __jo_core_disable_interrupts() (Internal usage).
| sr | Value returned by __jo_core_disable_interrupts() |
| void __jo_core_restore_scu_mask | ( | void | ) |
Write the SCU interrupt mask again at the end of a SCU interrupt handler (Internal usage).
| void __jo_core_set_interrupt_handler | ( | const unsigned int | vector, |
| jo_interrupt_handler | handler ) |
Set an interrupt handler in the vector table (Internal usage).
| vector | Interrupt vector number (JO_VECTOR_VBLANK_IN, etc) |
| handler | Function declared with attribute((interrupt_handler)) |
| void __jo_core_set_screens_order | ( | jo_scroll_screen | screen1, |
| ... ) |
Screen order (Internal usage).
|
static |
Set CPU status register (Internal usage).
| sr | Status register value (JO_SH2_SR_INTERRUPT_MASK bits: interrupt mask level) |
| void __jo_core_synch | ( | void | ) |
Wait for the end of the current frame (Internal usage).
| int jo_core_add_callback | ( | const jo_event_callback | callback | ) |
Add a callback in the game loop on main CPU.
| callback | Function name with no parameters and no return value |
| int jo_core_add_slave_callback | ( | const jo_event_callback | callback | ) |
Add a callback in the game loop on slave CPU.
| callback | Function name with no parameters and no return value |
| int jo_core_add_vblank_callback | ( | const jo_event_callback | callback | ) |
Add a callback during VBLANK interruption.
| callback | Function name with no parameters and no return value |
|
static |
Disable reset button.
|
static |
Enable reset button.
| void jo_core_exec_on_slave | ( | jo_slave_callback | callback | ) |
Execute a callback on the slave CPU.
| callback | Function name with no parameters and no return value |
|
static |
Exit program and return to the Saturn multiplayer (CD player) screen.
|
static |
Get the refresh rate of the console.
|
static |
Get the number of VBLANK since startup (60 per second in NTSC, 50 in PAL).
| void jo_core_init | ( | const jo_color | back_color | ) |
Init the engine.
| back_color | Default background color (colors.h) |
| void jo_core_remove_callback | ( | const int | event_id | ) |
Remove a callback in the game loop from on main CPU.
| event_id | Value returned by jo_core_add_callback() |
| void jo_core_remove_slave_callback | ( | const int | event_id | ) |
Remove a callback in the game loop from on slave CPU.
| event_id | Value returned by jo_core_add_slave_callback() |
| void jo_core_remove_vblank_callback | ( | const int | vblank_event_id | ) |
Remove a callback during VBLANK interruption.
| vblank_event_id | Value returned by jo_core_add_vblank_callback() |
|
static |
Restart the Saturn.
| void jo_core_run | ( | void | ) |
Run the game.
| void jo_core_set_restart_game_callback | ( | const jo_event_callback | callback | ) |
Add a callback when A+B+C+Start is pressed on the first control pad.
| callback | Function name with no parameters and no return value |
| int jo_core_slave_idle_time | ( | void | ) |
Balance of the CPUs in the last frame (between the 2 last calls of jo_core_wait_for_slave()).
| void jo_core_suspend | ( | void | ) |
Stop the execution until someone press Start.
| void jo_core_tv_off | ( | void | ) |
Turn OFF scroll drawing processing in the monitor.
| void jo_core_tv_on | ( | void | ) |
Turn ON scroll drawing processing in the monitor.
| void jo_core_wait_for_slave | ( | void | ) |
Wait until all the callbacks given to jo_core_exec_on_slave() are completed.
| void jo_dump_vdp1_registers | ( | void | ) |
Dump VDP1 registers.
| void jo_dump_vdp2_registers | ( | void | ) |
Dump VDP2 registers.
|
static |
Get last error.
| void jo_goto_boot_menu | ( | void | ) |
Return to the boot menu.
|
extern |
Number of VBLANK since startup (Internal usage).
|
extern |
Error handling (Internal usage).
| void noinline |