Jo Engine 2026.11.28
Jo Sega Saturn Engine
Loading...
Searching...
No Matches
Jo Engine API index

Generated by tools/make_api_index.py from jo_engine/jo/*.h (do not edit: run the script after a change of the headers). Each function, macro and type of the engine on one line, with its brief: search it (grep) before writing a function, the engine probably has it, made for the Saturn (fixed point, tables, the hardware). The full documentation of each one is its comment in the header.

1907 entries.

3d.h: Jo Engine 3D basics

In the makefile of the game: JO_COMPILE_WITH_3D_MODULE = 1.

audio.h: Jo Engine Function prototypes for audio

In the makefile of the game: JO_COMPILE_WITH_AUDIO_MODULE = 1.

background.h: Jo Engine Background definition and tools

  • jo_set_background_8bits_sprite(jo_img_8bits *img, int palette_id, bool vertical_flip) -> void: Add 8 bits background sprite
  • jo_set_background_sprite(const jo_img * const img, const short left, const short top) -> void: Add background sprite
  • jo_clear_background(const jo_color color) -> void: Clear the background
  • jo_move_background(const int x, const int y) -> void: Move background (scrolling)
  • jo_zoom_background2(const float width_factor, const float height_factor) -> void (float: emulated in software, slow): Zoom background width and height independently
  • jo_zoom_background(const float factor) -> void (float: emulated in software, slow): Zoom background
  • jo_draw_background_line(int x0, int y0, int x1, int y1, const jo_color color) -> void: Draw a line using Bresenham's line algorithm
  • jo_draw_background_square(const int x, const int y, const short width, const short height, const jo_color color) -> void: Draw a square on the background
  • jo_put_pixel_in_background(const int x, const int y, const jo_color color) -> void: Put pixel in background using color
  • jo_put_pixel_in_background_rgb(const int x, const int y, unsigned char r, unsigned char g, unsigned char b) -> void: Put pixel in background using composite color
  • jo_enable_background_3d_plane(jo_color background_color) -> void: Enable 3D planes
  • jo_disable_background_3d_plane(jo_color background_color) -> void: Disable 3D planes
  • jo_background_3d_plane_a_img(jo_img_8bits *img, int palette_id, bool repeat, bool vertical_flip) -> void: Setup plane A
  • jo_background_3d_plane_b_img(jo_img_8bits *img, int palette_id, bool repeat, bool vertical_flip) -> void: Setup plane B
  • jo_background_3d_plane_far_limit(const int max_zoom_out) -> void: Hide the farthest part of the 3D planes (the background color is visible instead)
  • jo_background_3d_plane_a_draw(const bool use_scroll_format_matrix) -> void: Draw plane A
  • jo_background_3d_plane_b_draw(const bool use_scroll_format_matrix) -> void: Draw plane B
  • jo_background_3d_plane_b_draw_flat(const int x, const int y) -> void: Draw plane B as a flat image, without perspective: a sky behind the plane A (sea, ground)
  • JO_SCROLL_TABLE_SIZE: 512 entries. One offset for each line because the background size is a 512x512 pixels by default.
  • jo_enable_background_horizontal_line_scroll(void) -> int *: Enable horizontal line scroll effect
  • jo_disable_background_horizontal_line_scroll(void) -> void: Disable horizontal line scroll effect
  • jo_compute_background_horizontal_line_scroll(unsigned short offset) -> void: Compute horizontal line scroll effect using specific offset

backup.h: Jo Engine saving features function prototypes

cell.h: Cells and portals

In the makefile of the game: JO_COMPILE_WITH_FS_MODULE, on by default; JO_COMPILE_WITH_3D_MODULE = 1.

colors.h: Jo Engine Standard colors

console.h: Jo Engine Console function prototypes

In the makefile of the game: JO_COMPILE_WITH_CONSOLE_SUPPORT = 1.

core.h: Jo Engine core function prototypes

dsp.h: SCU DSP: the third processor of the Saturn (about 14 MHz, one 32 x 32 bits multiply and accumulate per cycle)

effects.h: Jo Engine Function prototypes special effects (Laser beam, fire, smoke, flash, shake, etc)

In the makefile of the game: JO_COMPILE_WITH_EFFECTS_MODULE = 1.

entity.h: Entities

In the makefile of the game: JO_COMPILE_WITH_FS_MODULE, on by default; JO_COMPILE_WITH_3D_MODULE = 1.

font.h: Jo Engine Simple ASCII Font & print support

fs.h: Jo Engine File System function prototypes

In the makefile of the game: JO_COMPILE_WITH_FS_MODULE, on by default.

glow.h: Jo Engine glows

In the makefile of the game: JO_COMPILE_WITH_3D_MODULE = 1.

hitbox.h: Jo Engine Hitbox and tools

  • jo_hitbox_detection(const int sprite_id1, const int x1, const int y1, const int sprite_id2, const int x2, const int y2) -> bool: Fast method to get if two sprites intersects (HitBox processing)
  • jo_hitbox_detection_custom_boundaries(const int sprite_id1, const int x1, const int y1, const int x2, const int y2, const int w2, const int h2) -> bool: Fast method to get if the sprite intersects with the box (HitBox processing)

image.h: Jo Engine Image definition and tools

input.h: Jo Engine Gamepad functions

  • JO_INPUT_PORT1_FIRST_DEVICE: Index in jo_inputs of the first peripheral of each port (6 peripherals per port, see jo_get_inputs_vblank())
  • jo_gamepad_keys: Input keys
  • jo_gamepad_type: Input type
  • jo_input_axis: Input axis type
  • jo_get_input_type(const int port) -> jo_gamepad_type: Get input type for the given port
  • jo_is_input_analog(const int port) -> bool: Check if connected input is analog
  • jo_is_input_available(const int port) -> bool: Check if the input is available for the given port
  • jo_get_input_count(void) -> int: Get the number of input available
  • jo_get_player_input_port(const int player) -> int: The port (the index of jo_inputs) of the gamepad of a player: the devices of the port 1 are 0 to 5 (a multitap), those of the port 2 are 6 to 11; 2 gamepads without multitap: 0 and 6
  • jo_get_input_axis(const int port, const jo_input_axis axis) -> unsigned char: Get analog axis value
  • jo_get_input_axis_centered(const int port, const jo_input_axis axis) -> int: Get a centered analog axis (a stick or a wheel): 0 in the middle
  • jo_get_input_stick(const int port, const jo_input_axis axis, const int dead_zone) -> int: A stick or a wheel with a dead zone: 0 near the middle (a stick at rest is rarely at 128 exactly), then the whole range from the edge of the dead zone
  • jo_is_input_key_pressed(const int port, const jo_gamepad_keys key) -> bool: Check if the key is pressed for the given port
  • jo_get_input_direction_pressed(const int port) -> jo_8_directions: Get the direction pressed for the given port
  • jo_get_raw_input_key_pressed(const int port) -> unsigned short: Get raw input data for the given port
  • jo_is_input_key_down(const int port, const jo_gamepad_keys key) -> bool: Check if the key is down for the given port
  • jo_get_mouse_pos_x(const int port) -> int: Get mouse X position
  • jo_get_mouse_pos_y(const int port) -> int: Get mouse Y position
  • jo_get_input_gun_position(const int port, int * const x, int * const y) -> bool: Get the position on the screen where the light gun points
  • jo_calibrate_input_gun(const int port, const int target_x, const int target_y) -> bool: Calibrate a light gun: the player shoots at a target, the position read is moved onto the target
  • jo_is_pad1_available(void) -> bool: Check if the first gamepad is plugged
  • jo_is_pad2_available(void) -> bool: Check if the second gamepad is plugged (the second device: on the port 2, or on a multitap of the port 1)
  • jo_is_pad1_key_pressed(jo_gamepad_keys key) -> bool: Check if the key is pressed on the first gamepad
  • jo_is_pad1_key_down(jo_gamepad_keys key) -> bool: Check if the key is down on the first gamepad
  • jo_is_pad2_key_pressed(jo_gamepad_keys key) -> bool: Check if the key is pressed on the second gamepad
  • jo_is_pad2_key_down(jo_gamepad_keys key) -> bool: Check if the key is down on the second gamepad

keyboard.h: Jo Engine Keyboard function prototypes

In the makefile of the game: JO_COMPILE_WITH_KEYBOARD_SUPPORT = 1.

level.h: Levels (.JOL files)

In the makefile of the game: JO_COMPILE_WITH_FS_MODULE, on by default.

level_format.h

light.h: Jo Engine point lights

In the makefile of the game: JO_COMPILE_WITH_3D_MODULE = 1.

list.h: Jo Engine Linked list helper

malloc.h: Jo Engine Malloc

map.h: Jo Engine MAP file (sprite map)

math.h: Jo Engine Math tools

mode7.h: Jo Engine Mode7

model.h: 3D models (.JOM files)

In the makefile of the game: JO_COMPILE_WITH_3D_MODULE = 1.

palette.h: Jo Engine Palette Handling

physics.h: Jo Engine File Physics function prototypes

  • jo_sidescroller_physics_params: The physics of a side scroller: speeds in pixels per frame, accelerations in pixels per frame per frame (jo_fixed: no float, the SH-2 has no FPU)
  • jo_physics_apply_friction(jo_sidescroller_physics_params *physics) -> void: Friction computation: the speed goes to 0 by friction
  • jo_physics_jump(jo_sidescroller_physics_params *physics) -> void: Jump computation
  • jo_physics_apply_gravity(jo_sidescroller_physics_params *physics) -> void: Gravity computation
  • jo_physics_accelerate_right(jo_sidescroller_physics_params *physics) -> void: Acceleration computation when going to the right
  • jo_physics_accelerate_left(jo_sidescroller_physics_params *physics) -> void: Acceleration computation when going to the left
  • jo_physics_decelerate_left(jo_sidescroller_physics_params *physics) -> void: Deceleration computation when going to the right (pushed to the left): the speed goes down to 0
  • jo_physics_decelerate_right(jo_sidescroller_physics_params *physics) -> void: Deceleration computation when going to the left (pushed to the right): the speed goes up to 0
  • jo_physics_is_standing(jo_sidescroller_physics_params *physics) -> bool: Check if we doesn't move
  • jo_physics_is_almost_standing(jo_sidescroller_physics_params *physics, const jo_fixed tolerance) -> bool: Check if we almost doesn't move
  • jo_physics_is_going_on_the_right(jo_sidescroller_physics_params *physics) -> bool: Check if we going on the right
  • jo_physics_is_going_on_the_left(jo_sidescroller_physics_params *physics) -> bool: Check if we going on the left
  • jo_physics_should_brake(jo_sidescroller_physics_params *physics) -> bool: Check if we go fast enough to brake with an animation (a skid when the player pushes the other way)
  • jo_physics_init_for_sonic(jo_sidescroller_physics_params *physics) -> void: Init physics engine for a Sonic like game

profile.h: Jo Engine profiler

  • jo_profile_slot: Measures of the engine and of the program (jo_profile_begin(), jo_profile_end(), jo_profile_count())
  • JO_PROFILE_USER(N): Measure of the program
  • JO_PROFILE_FRAMES: Frames of the averages and of the maximums
  • jo_profile_cpu (JO_COMPILE_WITH_PROFILER_MODULE = 1): Measures of the master CPU and of the slave CPU (Internal usage)
  • jo_profile_ticks(void) -> unsigned int (JO_COMPILE_WITH_PROFILER_MODULE = 1): Get the free running timer of the current CPU
  • jo_profile_begin(const jo_profile_slot slot) -> void (JO_COMPILE_WITH_PROFILER_MODULE = 1): Start a measure on the current CPU
  • jo_profile_end(const jo_profile_slot slot) -> void (JO_COMPILE_WITH_PROFILER_MODULE = 1): End a measure started by jo_profile_begin() on the same CPU
  • jo_profile_count(const jo_profile_slot slot, const unsigned int value) -> void (JO_COMPILE_WITH_PROFILER_MODULE = 1): Add a count to a measure (commands, polygons, etc)
  • jo_profile_get(const jo_profile_slot slot, unsigned int *average, unsigned int *maximum) -> bool (JO_COMPILE_WITH_PROFILER_MODULE = 1): Get the average and the maximum of a measure
  • jo_profile_vdp1_last(void) -> unsigned int (JO_COMPILE_WITH_PROFILER_MODULE = 1): Ticks of the last drawing of the VDP1 (from the frame buffer change to the end of the drawing, see jo_profile_ticks(); JO_PROFILE_VDP1_DRAW sums the drawings as they end: read between 2 frames, the...
  • jo_profile_count_pixels(const bool enabled) -> void (JO_COMPILE_WITH_PROFILER_MODULE = 1): Count the pixels drawn by the VDP1 for the 3D polygons (JO_PROFILE_3D_PIXELS)
  • jo_profile_set_name(const jo_profile_slot slot, const char * const name) -> void (JO_COMPILE_WITH_PROFILER_MODULE = 1): Give a name to a measure of the program (shown by jo_profile_print())
  • jo_profile_print(const int x, const int y) -> void (JO_COMPILE_WITH_PROFILER_MODULE = 1): Print the measures with jo_printf(): average and maximum per frame
  • JO_PROFILE_SAMPLING_CODE_START (JO_COMPILE_WITH_PROFILER_MODULE = 1): Program counter sampling: first address of the code
  • JO_PROFILE_SAMPLING_BIN_SIZE (JO_COMPILE_WITH_PROFILER_MODULE = 1): Program counter sampling: bytes of code per counter: 16 (default), 8, 4 or 2. 2: a counter per instruction, to find the hot instructions of a loop (CCFLAGS += -DJO_PROFILE_SAMPLING_BIN_SIZE=2, with...
  • jo_profile_sampling_stop(void) -> void (JO_COMPILE_WITH_PROFILER_MODULE = 1): Stop the sampling of the program counter of the 2 CPUs (the histograms stay as they are: a measure over a known part of the program, the same from one run to the next)
  • jo_profile_sampling_start(unsigned int *master_histogram, unsigned int *slave_histogram) -> void (JO_COMPILE_WITH_PROFILER_MODULE = 1): Start sampling the program counter of the 2 CPUs: every JO_PROFILE_SAMPLING_INTERVAL ticks of its free running timer (about 17 000 times per second), each CPU adds 1 to the counter of the code...

render_to_image.h: Jo Engine render to image

In the makefile of the game: JO_COMPILE_WITH_3D_MODULE = 1.

sega_saturn.h: Jo Engine Sega Saturn constants (addresses, memory sizes, etc)

smpc.h: System Management & Peripheral Control

software_renderer.h: Fast Triangle based software renderer using fixed number

sprite_animator.h: Jo Engine Sprite Animator

  • jo_sprite_anim_action: Animation action
  • jo_sprite_anim: Internal animation struct
  • jo_get_sprite_anim_frame_rate(const int anim_id) -> unsigned char: Get animation frame rate
  • jo_get_sprite_anim_frame_count(const int anim_id) -> unsigned short: Get animation frame count
  • jo_get_sprite_anim_frame(const int anim_id) -> unsigned short: Get current animation frame
  • jo_set_sprite_anim_frame(const int anim_id, const unsigned short frame) -> void: Set animation frame
  • jo_start_sprite_anim_loop(const int anim_id) -> void: Start animation loop
  • jo_is_sprite_anim_stopped(const int anim_id) -> bool: Determine if the animation is stopped
  • jo_stop_sprite_anim(const int anim_id) -> void: Stop animation
  • jo_start_sprite_anim(const int anim_id) -> void: Start animation and stop it at the last frame
  • jo_reset_sprite_anim(const int anim_id) -> void: Stop animation and reset the animation to the first frame
  • jo_restart_sprite_anim(const int anim_id) -> void: Restart animation and stop it at the last frame
  • jo_get_anim_sprite(const int anim_id) -> int: Get the sprite to display according to the animation (current frame)
  • jo_get_anim_sprite_reverse(const int anim_id) -> int: Get the sprite to display according to the animation in reverse (current frame)
  • jo_set_sprite_anim_frame_rate(const int anim_id, const unsigned char framerate) -> int: Set animation framerate
  • jo_replace_sprite_anim(const int at, const unsigned short sprite_id, const unsigned short frame_count, const unsigned char frame_rate) -> int: Replace an existing animation
  • jo_create_sprite_anim(const unsigned short sprite_id, const unsigned short frame_count, const unsigned char frame_rate) -> int: Create an animation
  • jo_remove_sprite_anim(const int anim_id) -> void: Remove a specific animation by ID
  • jo_clear_all_sprite_anim(void) -> void: Clear all sprite animation

sprites.h: Jo Engine Sprite definition and tools

storyboard.h: Jo Engine Storyboard Animation function prototypes

In the makefile of the game: JO_COMPILE_WITH_STORYBOARD_MODULE = 1.

  • JO_STORYBOARD_INFINITE_DURATION: Specify that the animation is infinite
  • jo_storyboard_object_cache: Internal object cache
  • jo_animation: Object animation definition
  • jo_storyboard: Storyboard definition
  • jo_storyboard_create(const bool autoplay, const bool repeat) -> jo_storyboard *: Create an empty storyboard
  • jo_storyboard_destroy(jo_storyboard *const storyboard) -> void: Destroy the storyboard
  • jo_storyboard_create_animation(jo_storyboard * const storyboard, const unsigned char frame_skip, const unsigned int duration) -> jo_animation *: Create an empty animation
  • jo_storyboard_destroy_animation(jo_storyboard * const storyboard, const jo_animation * const animation) -> void: Destroy animation
  • jo_storyboard_repeat(jo_storyboard * const storyboard, bool repeat) -> void: Storyboard repeat control
  • jo_storyboard_suspend(jo_storyboard * const storyboard) -> void: Suspend all storyboard animation
  • jo_storyboard_resume(jo_storyboard * const storyboard) -> void: Resume all suspended storyboard animation
  • jo_storyboard_play(jo_storyboard * const storyboard) -> void: Play storyboard animation
  • jo_storyboard_toggle(jo_storyboard * const storyboard) -> void: Switch between resume and suspend
  • jo_storyboard_add_object(jo_storyboard *const storyboard, const void * const object) -> void: Add object in storyboard
  • jo_storyboard_remove_object(jo_storyboard *const storyboard, const void * const object) -> void: Remove object from storyboard
  • jo_storyboard_get_object_cache(jo_storyboard *const storyboard, const void * const object) -> jo_storyboard_object_cache *: Get object storyboard cache
  • jo_storyboard_reset_object_position(jo_storyboard * const storyboard, const void * const object) -> void: Reset object position
  • jo_storyboard_create_for_object(const bool autoplay, const bool repeat, const void * const object) -> jo_storyboard *: Create a new storyboard for the object
  • jo_storyboard_create_rotation_animation(jo_storyboard * const storyboard, const char speed, const unsigned int duration) -> jo_animation *: Create a rotation animation
  • jo_storyboard_create_translation_animation(jo_storyboard *const storyboard, const short angle, const char speed, const unsigned int duration) -> jo_animation *: Create a translation animation
  • jo_storyboard_create_translation_animation_using_direction(jo_storyboard * const storyboard, const jo_8_directions direction, const char speed, const unsigned int duration) -> jo_animation *: Create a translation animation using jo_8_directions enum
  • jo_storyboard_create_circle_animation(jo_storyboard * const storyboard, const short radius, const char speed, const unsigned int duration) -> jo_animation *: Create a circle rotation animation
  • jo_storyboard_rotate_object(const void * const object, const char speed, const unsigned int duration) -> jo_storyboard *: Create a rotation animation storyboard for a specific object
  • jo_storyboard_move_object(const void * const object, const short angle, const char speed, const unsigned int duration) -> jo_storyboard *: Create a translation animation storyboard for a specific object
  • jo_storyboard_move_object_in_direction(const void * const object, const jo_8_directions direction, const char speed, const unsigned int duration) -> jo_storyboard *: Create a translation animation storyboard for a specific object using jo_8_directions enum
  • jo_storyboard_move_object_in_circle(const void * const object, const short radius, const char speed, const unsigned int duration) -> jo_storyboard *: Create a circle rotation storyboard for a specific object

sun.h: Jo Engine sun

In the makefile of the game: JO_COMPILE_WITH_3D_MODULE = 1.

tga.h: Jo Engine Truevision Targa format support

In the makefile of the game: JO_COMPILE_WITH_TGA_MODULE = 1.

time.h: Time Management

tools.h: Jo Engine Tools (printf, etc,)

transparency.h: Jo Engine transparency layer

In the makefile of the game: JO_COMPILE_WITH_3D_MODULE = 1.

types.h: Jo Engine Types

vcd_card.h: WIP VCD Card support

vdp1_command_pipeline.h: VDP1 command table handling

vdp2.h: Jo Engine VDP2 definition and tools

vdp2_malloc.h: VDP2 memory allocation (cell, map, rotation, scroll, etc)

vehicle.h: Vehicles

In the makefile of the game: JO_COMPILE_WITH_FS_MODULE, on by default; JO_COMPILE_WITH_3D_MODULE = 1.

video.h: Jo Engine Video Player (Sega FILM/CPK File Format)

In the makefile of the game: JO_COMPILE_WITH_VIDEO_MODULE = 1.

voxel.h: Jo Engine Voxel renderer

  • jo_voxel_camera: Voxel camera definition
  • jo_voxel: Voxel main definition
  • jo_voxel_do_angle_computation(jo_voxel * const voxel_data) -> void: Do computation linked to camera angle
  • jo_voxel_redraw(const jo_voxel * const voxel_data) -> void: Draw voxels to gfx
  • jo_voxel_run(jo_voxel * const voxel_data) -> void: Draw voxels to gfx
  • jo_voxel_redraw_and_flush(const jo_voxel * const voxel_data) -> void: Draw voxels and flush the buffer
  • jo_voxel_set_scale(jo_voxel * const voxel_data, const jo_fixed scale) -> void: Set scale (camera.scale)
  • jo_voxel_increase_view_distance(jo_voxel * const voxel_data, const jo_fixed distance) -> void: Increase view distance (camera.zfar)
  • jo_voxel_decrease_view_distance(jo_voxel * const voxel_data, const jo_fixed distance) -> void: Decrease view distance (camera.zfar)
  • jo_voxel_horizon_up(jo_voxel * const voxel_data, const jo_fixed distance) -> void: Increase horizon height (camera.horizon)
  • jo_voxel_horizon_down(jo_voxel *const voxel_data, const jo_fixed distance) -> void: Decrease horizon height (camera.horizon)
  • jo_voxel_move_up(jo_voxel *voxel_data, const jo_fixed distance) -> void: Increase camera height (camera.height)
  • jo_voxel_move_down(jo_voxel * const voxel_data, const jo_fixed distance) -> void: Decrease camera height (camera.height)
  • jo_voxel_move_forward(jo_voxel * const voxel_data, const jo_fixed distance) -> void: Move camera forward (camera.x & camera.y)
  • jo_voxel_move_backward(jo_voxel * const voxel_data, const jo_fixed distance) -> void: Move camera backward (camera.x & camera.y)
  • jo_voxel_rotate_left(jo_voxel * const voxel_data, const jo_fixed angle_rad) -> void: Rotate camera on the left (camera.angle)
  • jo_voxel_rotate_right(jo_voxel * const voxel_data, const jo_fixed angle_rad) -> void: Rotate camera on the right (camera.angle)

water.h: Jo Engine water

In the makefile of the game: JO_COMPILE_WITH_3D_MODULE = 1; JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default.

weapon.h: Weapons of the player

In the makefile of the game: JO_COMPILE_WITH_FS_MODULE, on by default.