Jo Engine  2024.04.28
Jo Sega Saturn Engine
Macros | Typedefs | Functions | Variables
core.h File Reference

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. More...
 
#define jo_core_set_screens_order(screen1, args...)
 Set scroll screen order between them. More...
 

Typedefs

typedef void(* jo_event_callback) (void)
 Function prototype for jo_core_add_callback() More...
 
typedef void(* jo_slave_callback) (void)
 Function prototype for jo_core_exec_on_slave() More...
 

Functions

void __jo_core_error (char *message, const char *function)
 
void jo_core_init (const jo_color back_color)
 Init the engine. More...
 
void jo_core_run (void)
 Run the game. More...
 
int jo_core_add_vblank_callback (const jo_event_callback callback)
 Add a callback during VBLANK interruption. More...
 
void jo_core_remove_vblank_callback (const int vblank_event_id)
 Remove a callback during VBLANK interruption. More...
 
int jo_core_add_callback (const jo_event_callback callback)
 Add a callback in the game loop on main CPU. More...
 
void jo_core_remove_callback (const int event_id)
 Remove a callback in the game loop from on main CPU. More...
 
int jo_core_add_slave_callback (const jo_event_callback callback)
 Add a callback in the game loop on slave CPU. More...
 
void jo_core_remove_slave_callback (const int event_id)
 Remove a callback in the game loop from on slave CPU. More...
 
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. More...
 
void jo_goto_boot_menu (void)
 Return to the boot menu. More...
 
void jo_core_exec_on_slave (jo_slave_callback callback)
 Execute a callback on the slave CPU. More...
 
void jo_core_wait_for_slave (void)
 Wait until slave callback is completed. More...
 
static __jo_force_inline void jo_core_disable_reset (void)
 Disable reset button. More...
 
static __jo_force_inline void jo_core_enable_reset (void)
 Enable reset button. More...
 
static __jo_force_inline void jo_core_tv_off (void)
 Turn OFF scroll drawing processing in the monitor. More...
 
static __jo_force_inline void jo_core_tv_on (void)
 Turn ON scroll drawing processing in the monitor. More...
 
static __jo_force_inline void jo_core_exit_to_multiplayer (void)
 Exit program and return to the Saturn multiplayer (CD player) screen. More...
 
static __jo_force_inline void jo_core_restart_saturn (void)
 Restart the Saturn. More...
 
void jo_core_suspend (void)
 Stop the execution until someone press Start. More...
 
static __jo_force_inline char * jo_get_last_error (void)
 Get last error. More...
 
void jo_dump_vdp1_registers (void)
 Dump VDP1 registers. More...
 
void jo_dump_vdp2_registers (void)
 Dump VDP2 registers. More...
 
void __jo_core_set_screens_order (jo_scroll_screen screen1,...)
 Screen order (Internal usage) More...
 

Variables

char __jo_last_error [JO_PRINTF_BUF_SIZE]
 Error handling (Internal usage) More...
 

Detailed Description

Jo Engine core function prototypes.

Author
Johannes Fetz
Bug:
No known bugs.

Macro Definition Documentation

◆ jo_core_error

#define jo_core_error (   ...)

◆ jo_core_set_screens_order

#define jo_core_set_screens_order (   screen1,
  args... 
)

Set scroll screen order between them.

Parameters
screen1First screen (high priority)
argsOther screens
Remarks
Default Jo Engine screen priority : NBG0 > SPR0 > SPR1 > RBG0 > NBG1 > NBG2 > NBG3

◆ JO_ENGINE_VERSION

#define JO_ENGINE_VERSION

Jo Engine Version.

Typedef Documentation

◆ jo_event_callback

typedef void(* jo_event_callback) (void)

Function prototype for jo_core_add_callback()

◆ jo_slave_callback

typedef void(* jo_slave_callback) (void)

Function prototype for jo_core_exec_on_slave()

Function Documentation

◆ __jo_core_error()

void __jo_core_error ( char *  message,
const char *  function 
)

◆ __jo_core_set_screens_order()

void __jo_core_set_screens_order ( jo_scroll_screen  screen1,
  ... 
)

Screen order (Internal usage)

Warning
Use jo_core_set_screens_order instead

◆ jo_core_add_callback()

int jo_core_add_callback ( const jo_event_callback  callback)

Add a callback in the game loop on main CPU.

Parameters
callbackFunction name with no parameters and no return value
Warning
Must be called before jo_core_run()
Returns
Event Id (usefull for jo_core_remove_callback())

◆ jo_core_add_slave_callback()

int jo_core_add_slave_callback ( const jo_event_callback  callback)

Add a callback in the game loop on slave CPU.

Parameters
callbackFunction name with no parameters and no return value
Warning
Must be called before jo_core_run()
Returns
Event Id (usefull for jo_core_remove_slave_callback())

◆ jo_core_add_vblank_callback()

int jo_core_add_vblank_callback ( const jo_event_callback  callback)

Add a callback during VBLANK interruption.

Parameters
callbackFunction name with no parameters and no return value
Returns
VBLANK Event Id (usefull for jo_core_remove_vblank_callback())

◆ jo_core_disable_reset()

static __jo_force_inline void jo_core_disable_reset ( void  )
static

Disable reset button.

◆ jo_core_enable_reset()

static __jo_force_inline void jo_core_enable_reset ( void  )
static

Enable reset button.

◆ jo_core_exec_on_slave()

void jo_core_exec_on_slave ( jo_slave_callback  callback)

Execute a callback on the slave CPU.

Parameters
callbackFunction name with no parameters and no return value

◆ jo_core_exit_to_multiplayer()

static __jo_force_inline void jo_core_exit_to_multiplayer ( void  )
static

Exit program and return to the Saturn multiplayer (CD player) screen.

Warning
Works but I didn't found documentation about it
Todo:
Investigate and give feedback to https://segaxtreme.net/threads/best-way-to-debug-saturn-bios.18644/

◆ jo_core_init()

void jo_core_init ( const jo_color  back_color)

Init the engine.

Parameters
back_colorDefault background color (colors.h)
Warning
Must be the first function called in jo_main()

◆ jo_core_remove_callback()

void jo_core_remove_callback ( const int  event_id)

Remove a callback in the game loop from on main CPU.

Parameters
event_idValue returned by jo_core_add_callback()

◆ jo_core_remove_slave_callback()

void jo_core_remove_slave_callback ( const int  event_id)

Remove a callback in the game loop from on slave CPU.

Parameters
event_idValue returned by jo_core_add_slave_callback()

◆ jo_core_remove_vblank_callback()

void jo_core_remove_vblank_callback ( const int  vblank_event_id)

Remove a callback during VBLANK interruption.

Parameters
vblank_event_idValue returned by jo_core_add_vblank_callback()

◆ jo_core_restart_saturn()

static __jo_force_inline void jo_core_restart_saturn ( void  )
static

Restart the Saturn.

Warning
Doesn't work in Yabause

◆ jo_core_run()

void jo_core_run ( void  )

Run the game.

Warning
Must be the last function called in jo_main()

◆ jo_core_set_restart_game_callback()

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.

Parameters
callbackFunction name with no parameters and no return value

◆ jo_core_suspend()

void jo_core_suspend ( void  )

Stop the execution until someone press Start.

◆ jo_core_tv_off()

static __jo_force_inline void jo_core_tv_off ( void  )
static

Turn OFF scroll drawing processing in the monitor.

◆ jo_core_tv_on()

static __jo_force_inline void jo_core_tv_on ( void  )
static

Turn ON scroll drawing processing in the monitor.

◆ jo_core_wait_for_slave()

void jo_core_wait_for_slave ( void  )

Wait until slave callback is completed.

◆ jo_dump_vdp1_registers()

void jo_dump_vdp1_registers ( void  )

Dump VDP1 registers.

◆ jo_dump_vdp2_registers()

void jo_dump_vdp2_registers ( void  )

Dump VDP2 registers.

◆ jo_get_last_error()

static __jo_force_inline char* jo_get_last_error ( void  )
static

Get last error.

Returns
Formated error

◆ jo_goto_boot_menu()

void jo_goto_boot_menu ( void  )

Return to the boot menu.

Variable Documentation

◆ __jo_last_error

char __jo_last_error[JO_PRINTF_BUF_SIZE]

Error handling (Internal usage)

Warning
MC Hammer: don't touch this