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.
- JO_3D_PLANE_VERTICES(SIZE): Plane vertice table
- JO_3D_TRIANGLE_VERTICES(SIZE): Triangle vertice table
- JO_3D_CUBE_VERTICES(SIZE): Cube vertice table
- typedef jo_pos3D jo_vertice: Vertice structure
- JO_3D_QUAD_VERTEX_COUNT: Vertex count of a quad (jo_3d_create_mesh_from_vertices() takes 4 vertices for each quad)
- jo_3d_set_quad_vertices(jo_vertice * const vertices, const jo_vertice * const center, const jo_vertice * const right, const jo_vertice * const down) -> void: Fill the 4 vertices of a quad (a parallelogram) from its center and 2 half edges, in the order of JO_3D_PLANE_VERTICES(): center - right - down, center + right - down, center + right + down, center -...
- JO_3D_DEFAULT_PERSPECTIVE_ANGLE: Default perspective angle in degree (see jo_3d_perspective_angle())
- JO_3D_DEFAULT_DISPLAY_LEVEL: Default display level (see jo_3d_display_level())
- JO_3D_SORT_PREVIOUS: Polygon sort: same depth as the previous polygon
- JO_3D_SORT_MIN: Polygon sort: depth of the nearest vertex
- JO_3D_SORT_MAX: Polygon sort: depth of the farthest vertex
- JO_3D_SORT_CENTER: Polygon sort: average depth of the 4 vertices
- JO_3D_SORT_MASK: Polygon sort mask
- JO_3D_SINGLE_PLANE: Polygon hidden when seen from the back
- JO_3D_DUAL_PLANE: Polygon always displayed
- JO_3D_NO_OPTION: Polygon option: no option
- JO_3D_USE_TEXTURE: Polygon option: textured polygon
- JO_3D_USE_LIGHT: Polygon option: lighting (see jo_3d_light())
- JO_3D_USE_PALETTE: Polygon option: the color is a palette (no lighting)
- JO_3D_NO_TEXTURE: No texture
- jo_3d_polygon: Polygon (quadrilateral, a triangle repeats the last vertex)
- jo_3d_polygon_attribute: Polygon attribute
- jo_3d_polygon_data: Polygon data (3D model)
- jo_3d_polygon_range: Range of polygons of a mesh (see jo_3d_mesh_draw_ranges())
- JO_3D_ATTRIBUTE(PLANE, SORT, TEXTURE, COLOR, GOURAUD, DRAW_MODE, DIRECTION, OPTIONS): Polygon attribute initializer
- JO_3D_NORMAL(X, Y, Z): Polygon normal initializer
- JO_3D_VERTICES(A, B, C, D): Polygon vertices initializer
- jo_camera: Camera structure
- jo_3d_quad: Quadrilateral shape structure
- jo_3d_mesh: Mesh structure
- JO_3D_AXIS_X: X axis for __jo_3d_rotate()
- JO_3D_AXIS_Y: Y axis for __jo_3d_rotate()
- JO_3D_AXIS_Z: Z axis for __jo_3d_rotate()
- jo_3d_set_front_layer(const int shift) -> void: The next 3D polygons (of the master CPU) are a front layer: drawn after (over) all the other polygons, sorted among themselves with the depth divided by 2^shift (a rear-view mirror: its content is...
- jo_3d_part: Points of a mesh transformed by their own matrix (see __jo_3d_draw_parts())
- jo_3d_camera_set_viewpoint(jo_camera * const cam, const int x, const int y, const int z) -> void: Set the viewpoint of the camera (where the cameraman is)
- jo_3d_camera_set_target(jo_camera * const cam, const int x, const int y, const int z) -> void: Set the target of the camera (where the scene is located)
- jo_3d_camera_set_z_angle(jo_camera * const cam, const int angle) -> void: Set the angle of the camera
- jo_3d_camera_init(jo_camera * const cam) -> void: Initialize the camera with default values
- jo_3d_camera_look_at(jo_camera * const cam) -> void: look at the camera
- jo_3d_get_polygon_count(void) -> unsigned int: Get polygon count (visible and not visible)
- jo_3d_get_vertices_count(void) -> unsigned int: Get vertice count
- jo_3d_get_displayed_polygon_count(void) -> unsigned int: Get displayed polygon count
- jo_3d_create_mesh_from_vertices_and_normals(const unsigned int quad_count, jo_vertice * const vertices, jo_vector * const normals) -> jo_3d_mesh *: Create a mesh programmatically from vertices
- jo_3d_create_mesh_from_vertices(const unsigned int quad_count, jo_vertice * const vertices) -> jo_3d_mesh *: Create a mesh programmatically from vertices
- jo_3d_create_mesh(const unsigned int quad_count) -> jo_3d_mesh *: Create a mesh programmatically from vertices
- jo_3d_create_sphere(const int radius, const unsigned int slices, const unsigned int stacks) -> jo_3d_mesh *: Create a sphere (UV sphere)
- jo_3d_free_mesh(const jo_3d_mesh * const mesh) -> void: Free a mesh created with jo_3d_create_mesh()
- jo_3d_set_polygon_indexes(const jo_3d_polygon_data * const pdata) -> bool: Copy the vertex indexes of the polygons apart: the polygon loop reads 8 bytes per polygon instead of the 20 bytes of a polygon (its normal is read only for the light): fewer cache misses, in the slow...
- jo_3d_free_polygon_indexes(const jo_3d_polygon_data * const pdata) -> void: Free the copy of the vertex indexes of jo_3d_set_polygon_indexes() (nothing if there is none)
- jo_3d_set_light_bands(const int count) -> void (JO_COMPILE_WITH_3D_CEL_SHADING_MODULE = 1): The light of the engine (jo_3d_light()) in bands: each lit polygon (JO_3D_USE_LIGHT, the material option jo_light 1) takes one level for its whole band instead of its own level: flat shades, no...
- jo_3d_outline_edge (JO_COMPILE_WITH_3D_CEL_SHADING_MODULE = 1): An edge of an outline (see jo_3d_create_outline()): its 2 vertices, its 2 polygons
- jo_3d_outline (JO_COMPILE_WITH_3D_CEL_SHADING_MODULE = 1): The edges of a mesh for its outline (jo_3d_create_outline())
- jo_3d_create_outline(const jo_3d_polygon_data * const pdata) -> jo_3d_outline * (JO_COMPILE_WITH_3D_CEL_SHADING_MODULE = 1): Find the edges of a mesh for its outline (when it is loaded: a sort of its edges)
- jo_3d_free_outline(jo_3d_outline * const outline) -> void (JO_COMPILE_WITH_3D_CEL_SHADING_MODULE = 1): Free an outline of jo_3d_create_outline()
- jo_3d_draw_outline(jo_3d_outline * const outline, const jo_color color, const int thickness) -> int (JO_COMPILE_WITH_3D_CEL_SHADING_MODULE = 1): Draw the outline of the object just drawn (jo_3d_mesh_draw(), jo_3d_model_draw(), jo_3d_model_draw_morph(), jo_3d_model_draw_pose()): VDP1 lines on its silhouette, the edges between a polygon facing...
- jo_3d_create_plane(jo_3d_quad * const quad, jo_vertice * const vertices) -> void: Create a four vertices polygon (Quadrilateral shape)
- jo_3d_create_cube(jo_3d_quad * array, jo_vertice * const vertices) -> void: Create a cube
- jo_3d_create_triangle(jo_3d_quad * const quad, jo_vertice * const vertices) -> void: Create a triangle
- jo_3d_get_sprite_quad(const int sprite_id) -> jo_3d_quad *: Get sprite quad
- jo_3d_free_sprite_quad(const int sprite_id) -> void: Delete sprite quad
- jo_3d_set_mesh_polygon_texture(jo_3d_mesh * const mesh, const int sprite_id, const unsigned int index) -> void: Set a texture on one polygon on the mesh
- jo_3d_set_mesh_polygon_texture_bank(jo_3d_mesh * const mesh, const int sprite_id, const jo_palette * const palette, const int bank, const unsigned int index) -> void: Set a texture of 16 colors on one polygon, its colors taken in a bank of 16 colors of a palette (in place of its color lookup table): a polygon of the palette lighting (see...
- jo_3d_set_mesh_polygon_texture_palette(jo_3d_mesh * const mesh, const int sprite_id, const jo_palette * const palette, const unsigned int index) -> void: Set a texture of 256 colors on one polygon, its colors taken in a palette (its pixel value n: the color n of the palette): opaque over a see-through bottom where the MSB of the colors is cleared, see...
- jo_3d_set_mesh_texture(jo_3d_mesh * const mesh, const int sprite_id) -> void: Set a texture on the mesh
- jo_3d_set_texture(jo_3d_quad * const quad, const int sprite_id) -> void: Set a texture on the quadrilateral
- jo_3d_set_mesh_polygon_wireframe(jo_3d_mesh * const mesh, const unsigned int index, bool wireframe) -> void: Set wireframe mode on the mesh
- jo_3d_set_mesh_polygon_palette(jo_3d_mesh * const mesh, const int palette_id, const unsigned int index) -> void: Set a palette on the mesh
- jo_3d_set_mesh_palette(jo_3d_mesh * const mesh, const int palette_id) -> void: Set a palette on one polygon on the mesh
- jo_3d_set_palette(jo_3d_quad * const quad, const int palette_id) -> void: Set a palette on the quadrilateral
- jo_3d_set_sprite_palette(const int sprite_id, const int palette_id) -> bool: Set a palette on a sprite (3D)
- jo_3d_set_mesh_polygon_high_speed_shrink(jo_3d_mesh * const mesh, const bool enabled, const unsigned int index) -> void: Enable/Disable High Speed Shrink on one polygon on the mesh
- jo_3d_set_mesh_high_speed_shrink(jo_3d_mesh * const mesh, const bool enabled) -> void: Enable/Disable High Speed Shrink on the mesh
- jo_3d_set_high_speed_shrink(const bool enabled) -> void: High speed shrink for every textured polygon drawn from now on (models, meshes, levels), whatever their own setting (default: on); can be changed at any time (a scene, a view)
- jo_3d_set_mesh_vertice(jo_3d_mesh * const mesh, const jo_fixed x, const jo_fixed y, const jo_fixed z, const unsigned int index) -> void: Set vertice position in mesh
- jo_3d_set_mesh_normal(jo_3d_mesh * const mesh, const jo_fixed x, const jo_fixed y, const jo_fixed z, const unsigned int index) -> void: Set quad normal in mesh
- jo_3d_light(const int x, const int y, const int z) -> void: Use a light source
- jo_3d_light_fixed(const jo_fixed x, const jo_fixed y, const jo_fixed z) -> void: Use a light source: its direction as a unit vector
- jo_3d_set_palette_light(const int levels, const int stride) -> void: Palette lighting (the light of jo_3d_light() without the RGB colors: the only lighting of the 640 and 704 pixels modes): a lit polygon of a palette color (or a texture of 16 colors with a color bank)...
- jo_3d_set_mesh_polygon_light(jo_3d_mesh * const mesh, const bool enabled, const unsigned int index) -> void: Enable/Disable light on one polygon on the mesh
- jo_3d_set_mesh_light(jo_3d_mesh * const mesh, const bool enabled) -> void: Enable/Disable light on the mesh
- jo_3d_set_mesh_smooth_light(const jo_3d_mesh * const mesh, const bool enabled) -> bool (JO_COMPILE_WITH_3D_SMOOTH_LIGHT_MODULE = 1): Light a mesh at its vertices: the light of the engine (jo_3d_light()) on each vertex (the mean of the normals of its lit polygons), blended over each polygon by the gouraud shading of the VDP1 (a...
- jo_3d_set_smooth_light_tables(const unsigned int polygons) -> bool (JO_COMPILE_WITH_3D_SMOOTH_LIGHT_MODULE = 1): Gouraud tables for the light at the vertices (see jo_3d_set_mesh_smooth_light()): the polygons lit at their vertices that all the objects drawn in a frame can have (both CPUs)
- jo_3d_set_light(jo_3d_quad *const quad, const bool enabled) -> void: Enable/Disable light on the quad
- jo_3d_set_mesh_polygon_transparency(jo_3d_mesh * const mesh, const bool enabled, const unsigned int index) -> void: Enable/Disable transparency on one polygon on the mesh
- jo_3d_set_mesh_transparency(jo_3d_mesh * const mesh, const bool enabled) -> void: Enable/Disable transparency on the mesh
- jo_3d_set_transparency(jo_3d_quad *const quad, const bool enabled) -> void: Enable/Disable transparency on the quadrilateral
- jo_3d_set_mesh_polygon_screen_doors(jo_3d_mesh * const mesh, const bool enabled, const unsigned int index) -> void: Enable/Disable screen doors transparency on one polygon on the mesh
- jo_3d_set_mesh_screen_doors(jo_3d_mesh * const mesh, const bool enabled) -> void: Enable/Disable screen doors transparency on the mesh
- jo_3d_set_screen_doors(jo_3d_quad *const quad, const bool enabled) -> void: Enable/Disable screen doors transparency on the quad
- jo_3d_set_mesh_polygon_gouraud(jo_3d_mesh * const mesh, const unsigned short table, const unsigned int index) -> void: Give a gouraud table to one polygon of the mesh (the color of each of its 4 vertices is added to its color)
- jo_3d_set_mesh_gouraud(jo_3d_mesh * const mesh, const jo_color * const tables) -> unsigned short: Gouraud shading of the whole mesh: one table of 4 colors per polygon (a color per vertex, in the order of the vertices of the polygon), added to the VRAM (see jo_3d_add_gouraud_tables())
- jo_3d_fog_curve (JO_COMPILE_WITH_3D_FOG_MODULE = 1): Shape of the fog between its start and its end (see jo_3d_set_fog_curve())
- JO_3D_FOG_CURVE_STEPS (JO_COMPILE_WITH_3D_FOG_MODULE = 1): Steps of a curve of the fog (see jo_3d_set_fog_custom_curve()): its values at the start, after each step and at the end
- JO_3D_FOG_OPAQUE (JO_COMPILE_WITH_3D_FOG_MODULE = 1): Fog factor of the color of the fog only (see jo_3d_get_fog_factor())
- JO_3D_FOG_DEFAULT_POLYGONS (JO_COMPILE_WITH_3D_FOG_MODULE = 1): Polygons in the fog per frame by default (see jo_3d_set_fog())
- jo_3d_set_fog(const jo_color color, const jo_fixed start, const jo_fixed end, const unsigned int max_polygons) -> bool (JO_COMPILE_WITH_3D_FOG_MODULE = 1): Fog of the 3D polygons
- jo_3d_disable_fog(void) -> void (JO_COMPILE_WITH_3D_FOG_MODULE = 1): Stop the fog (see jo_3d_set_fog()): its gouraud tables stay reserved for the next jo_3d_set_fog()
- jo_3d_set_fog_curve(const jo_3d_fog_curve curve) -> void (JO_COMPILE_WITH_3D_FOG_MODULE = 1): Shape of the fog between its start and its end (JO_3D_FOG_LINEAR by default)
- jo_3d_set_fog_custom_curve(const unsigned short factors[JO_3D_FOG_CURVE_POINTS]) -> void (JO_COMPILE_WITH_3D_FOG_MODULE = 1): Shape of the fog given by its values (see jo_3d_set_fog_curve())
- jo_3d_set_fog_culling(const bool enabled) -> void (JO_COMPILE_WITH_3D_FOG_MODULE = 1): Drop the polygons beyond the end of the fog (all their vertices): the VDP1 doesn't draw them (true by default). The back of the screen must be of the color of the fog then
- jo_3d_get_fog_factor(const jo_fixed depth) -> int (JO_COMPILE_WITH_3D_FOG_MODULE = 1): Fog factor of a depth (the fog of a sprite, of a screen of the VDP2 at this distance...)
- jo_3d_get_fog_polygon_count(void) -> unsigned int (JO_COMPILE_WITH_3D_FOG_MODULE = 1): Polygons that had a gouraud table of the fog in the last frame (both CPUs, see jo_3d_set_fog())
- jo_3d_set_mesh_polygon_color_ex(jo_3d_mesh * const mesh, const jo_color color, const unsigned int index, bool wireframe) -> void: Set the color on one polygon on the mesh with wireframe option
- jo_3d_set_mesh_polygon_single_plane(jo_3d_mesh * const mesh, const bool single, const unsigned int index) -> void: Draw one polygon of a mesh on its front face only (its corners clockwise on the screen), or on both faces
- jo_3d_set_mesh_polygon_color(jo_3d_mesh * const mesh, const jo_color color, const unsigned int index) -> void: Set the color on one polygon on the mesh
- jo_3d_set_mesh_color(jo_3d_mesh * const mesh, const jo_color color) -> void: Set the color on the mesh
- jo_3d_set_mesh_color_ex(jo_3d_mesh * const mesh, const jo_color color, bool wireframe) -> void: Set the color on the mesh
- jo_3d_set_color(jo_3d_quad * const quad, const jo_color color) -> void: Set the color on the quadrilateral
- jo_3d_push_matrix(void) -> void: Push 3D matrix
- jo_3d_pop_matrix(void) -> void: Pop 3D matrix
- jo_3d_rotate_matrix(short x, short y, short z) -> void: Rotate 3D matrix using degree
- jo_3d_rotate_matrix_x(short x) -> void: Rotate 3D matrix using degree (X axis)
- jo_3d_rotate_matrix_y(short y) -> void: Rotate 3D matrix using degree (Y axis)
- jo_3d_rotate_matrix_z(short z) -> void: Rotate 3D matrix using degree (Z axis)
- jo_3d_rotate_matrix_rad(float x, float y, float z) -> void (float: emulated in software, slow): Rotate 3D matrix using radian
- jo_3d_rotate_matrix_rad_x(float x) -> void (float: emulated in software, slow): Rotate 3D matrix using radian (X axis)
- jo_3d_rotate_matrix_rad_y(float y) -> void (float: emulated in software, slow): Rotate 3D matrix using radian (Y axis)
- jo_3d_rotate_matrix_rad_z(float z) -> void (float: emulated in software, slow): Rotate 3D matrix using radian (Z axis)
- jo_3d_rotate_matrix_angle(const jo_angle x, const jo_angle y, const jo_angle z) -> void: Rotate 3D matrix using jo_angle (0x10000 = 360 degrees: a fraction of degree, no float)
- jo_3d_rotate_matrix_angle_x(const jo_angle x) -> void: Rotate 3D matrix using jo_angle (X axis)
- jo_3d_rotate_matrix_angle_y(const jo_angle y) -> void: Rotate 3D matrix using jo_angle (Y axis)
- jo_3d_rotate_matrix_angle_z(const jo_angle z) -> void: Rotate 3D matrix using jo_angle (Z axis)
- jo_3d_translate_matrixf(float x, float y, float z) -> void (float: emulated in software, slow): Translate 3D matrix (using floating numbers)
- jo_3d_translate_matrix_fixed(jo_fixed x, jo_fixed y, jo_fixed z) -> void: Translate 3D matrix
- jo_3d_translate_matrix(int x, int y, int z) -> void: Translate 3D matrix
- jo_3d_translate_matrix_x(int x) -> void: Translate 3D matrix (X axis)
- jo_3d_translate_matrix_y(int y) -> void: Translate 3D matrix (Y axis)
- jo_3d_translate_matrix_z(int z) -> void: Translate 3D matrix (Z axis)
- jo_3d_draw(jo_3d_quad *const quad) -> void: Draw a quadrilateral
- jo_3d_mesh_draw(jo_3d_mesh *const mesh) -> void: Draw a mesh
- jo_3d_mesh_draw_ranges(const jo_3d_mesh * const mesh, const unsigned int point_count, const jo_3d_polygon_range * const ranges, const int range_count) -> bool: Draw some ranges of polygons of a mesh, without copying them (the points are transformed once)
- jo_3d_add_polygon_range(jo_3d_polygon_range * const ranges, int * const range_count, const int first, const int count) -> void: Add polygons to a list of ranges (see jo_3d_mesh_draw_ranges()): joined to the last range when they follow it
- jo_3d_get_mesh_polygon_count(jo_3d_mesh * const mesh) -> unsigned int: Get polygon count on the mesh
- jo_3d_draw_list(jo_list *const list) -> void: Draw a list of quadrilateral
- jo_3d_draw_array(jo_3d_quad * const array, int array_size) -> void: Draw an array of quadrilateral
- jo_3d_draw_sprite(const int sprite_id) -> bool: Draw a sprite
- jo_3d_draw_sprite_at(const int sprite_id, const int x, const int y, const int z) -> void: Draw a sprite
- jo_3d_draw_billboard(const int sprite_id, const int x, const int y, const int z) -> void: Draw billboard
- jo_3d_draw_scaled_billboard(const int sprite_id, const int x, const int y, const int z, const int scale) -> void: Draw billboard with a specific scale
- jo_3d_set_scalef(const float x, const float y, const float z) -> void (float: emulated in software, slow): Change scale using floating number
- jo_3d_set_scale(const int x, const int y, const int z) -> void: Change scale
- jo_3d_set_scale_fixed(const jo_fixed x, const jo_fixed y, const jo_fixed z) -> void: Change scale using fixed number
- jo_3d_restore_scale(void) -> void: Scale of 1 (nothing changes): the scale of jo_3d_set_scale() is in the current matrix, jo_3d_pop_matrix() restores the matrix before it (jo_3d_push_matrix(), jo_3d_set_scale(), draw,...
- jo_3d_window(const int left, const int top, const int right, const int bottom, const int z_limit, const int center_x, const int center_y) -> bool: Sets up a window region on the projection surface
- jo_3d_window_clip(const bool clip) -> void: The 3D polygons drawn in the current window are clipped by the VDP1 to its rectangle (user clipping: a mirror, a rear-view mirror, a view of a split screen), or not (default: the whole screen)
- JO_3D_NEAR_WINDOW: Near window (default) for jo_3d_select_window()
- JO_3D_FAR_WINDOW: Far window for jo_3d_select_window()
- JO_3D_FAR_WINDOW_2: Second far window for jo_3d_select_window() (a second mirror)
- JO_3D_LAYER_WINDOW: Window of the transparency layer (see jo/transparency.h): selected by jo_3d_transparency_begin()
- jo_3d_select_window(const int window) -> void: Select the window used by jo_3d_window() and by the next drawings
- jo_3d_set_windows_apart(const bool apart) -> void: The windows do not overlap (a split screen: a view per player in its window): the commands of each window are drawn together, window after window (window 0 first), sorted by depth in their window;...
- jo_3d_perspective_angle(const int angle) -> void: Set the perspective angle
- jo_3d_set_perspective(const jo_angle angle) -> void: Set the perspective angle using jo_angle (a fraction of degree, as slPerspective() of the SGL)
- jo_3d_display_level(const unsigned short level) -> void: Set the display level of the viewing volume
- jo_3d_enable_dsp(const bool slave_cpu) -> void: Transform the vertices with the SCU DSP (the third processor of the Saturn)
- jo_3d_disable_dsp(void) -> void: Stop using the SCU DSP to transform the vertices (see jo_3d_enable_dsp())
- JO_3D_MAX_GUARD_BAND: Biggest guard band around the screen (pixels): the coordinates of the VDP1 are limited
- JO_3D_DEFAULT_GUARD_BAND: Default guard band around the screen (pixels, see jo_3d_set_guard_band()): only the polygons that go very far outside of the screen are clipped by the CPU
- jo_3d_set_guard_band(const int pixels) -> void: Set the guard band around the screen used by the clipping of the polygons drawn after this call
- jo_3d_set_wireframe(const bool enabled) -> void: Wireframe mode: the polygons and the standing sprites (distorted sprites) are drawn as their outline, in one color; the normal and scaled sprites (a HUD for instance) are drawn as they are
- jo_3d_is_wireframe(void) -> bool: Check the wireframe mode (see jo_3d_set_wireframe())
- jo_3d_set_depth_bias(const int bias) -> void: Set a depth added to the polygons and sprites drawn after this call, to sort them (the farthest are drawn first)
- jo_3d_get_depth_bias(void) -> int: Get the depth added to the polygons and sprites (see jo_3d_set_depth_bias())
- jo_3d_transform_point(const jo_pos3D_fixed * const in, jo_pos3D_fixed *out) -> void: Transform a point by the current matrix (for instance a world position into the view space, after jo_3d_camera_look_at() or the rotations and translations of the camera)
- jo_3d_transform_point_by(const jo_fixed (* const m)[3], const jo_pos3D_fixed * const in, jo_pos3D_fixed * const out) -> void: Transform a point by a matrix (see jo_3d_transform_point(): the same result with the current matrix)
- jo_3d_slave_select_window(const int window) -> void: Select the window of the next drawings of the slave CPU (call it on the slave CPU; jo_3d_slave_begin() selects the window of the master CPU, see jo_3d_select_window())
- jo_3d_get_matrix(jo_fixed *m) -> void: Copy the current matrix
- jo_3d_reflect_matrix(const jo_pos3D_fixed * const normal, const jo_fixed distance) -> void: Multiply the current matrix by a reflection through a plane (a mirror: the camera matrix of the reflected view)
- jo_3d_set_mirror(const bool mirror) -> void: The next polygons of the master CPU are seen in a mirror: their front faces are counterclockwise on the screen
- jo_3d_get_projection_distance(void) -> jo_fixed: Get the projection distance (distance of the projection plane, in pixels)
- jo_3d_is_sphere_visible(const jo_pos3D_fixed * const center, const jo_fixed radius, const jo_fixed max_distance) -> bool: Check if a sphere (in the view space) can be seen (view frustum of the screen)
- jo_3d_slave_is_sphere_visible(const jo_pos3D_fixed * const center, const jo_fixed radius, const jo_fixed max_distance) -> bool: jo_3d_is_sphere_visible() for the slave CPU: with the rectangle of jo_3d_set_view_rect() as it was at jo_3d_slave_begin() (the master CPU can change it while the slave CPU draws)
- jo_3d_is_bounding_sphere_seen(const jo_pos3D_fixed * const center, const jo_fixed radius) -> bool: Check if the bounding sphere of an object (in its own space) can be seen with the current matrix in the current window: in front of the near plane, nearer than the depth limit of the window (see...
- jo_3d_slave_is_bounding_sphere_seen(const jo_pos3D_fixed * const center, const jo_fixed radius) -> bool: jo_3d_is_bounding_sphere_seen() for the slave CPU: its matrix, its window, its projection (see jo_3d_slave_begin())
- jo_3d_rect: A rectangle of the screen (pixels, the edges are in it)
- jo_3d_set_view_rect(const jo_3d_rect * const rect) -> void: The objects are seen only in a rectangle of the screen: jo_3d_is_sphere_visible() is false for the spheres outside of it (the camera is in a building: the outside is seen only through its door, see...
- jo_3d_get_view_rect(jo_3d_rect * const rect) -> bool: The rectangle of jo_3d_set_view_rect()
- jo_3d_mesh_get_bounding_sphere(const jo_3d_mesh * const mesh, jo_pos3D_fixed * const center) -> int: Bounding sphere of the points of a mesh (the sphere around their bounding box)
- jo_3d_ray_plane: Plane of a polygon for the rays (see jo_3d_mesh_create_ray_planes()): the normal and its distance, without the vertices (the models are in the slow work RAM)
- jo_3d_mesh_ray_hit(const jo_3d_mesh * const mesh, const jo_pos3D_fixed * const origin, const jo_pos3D_fixed * const dir, jo_fixed * const best, jo_pos3D_fixed * const normal) -> bool: First polygon of a mesh hit by a ray (the bullets: the walls of a building, the rooms of a level...)
- jo_3d_mesh_create_ray_planes(const jo_3d_mesh * const mesh) -> jo_3d_ray_plane *: The planes of the polygons of a mesh for jo_3d_mesh_ray_hit_with_planes() (the rays are faster: the most polygons are rejected by their plane)
- jo_3d_mesh_ray_hit_with_planes(const jo_3d_mesh * const mesh, const jo_3d_ray_plane * const planes, const jo_pos3D_fixed * const origin, const jo_pos3D_fixed * const dir, jo_fixed * const best, jo_pos3D_fixed * const normal) -> bool: jo_3d_mesh_ray_hit() with the planes of the polygons of the mesh (the same result, faster)
- jo_3d_draw_standing_sprite(const int sprite_id, const jo_pos3D_fixed * const foot, const jo_fixed width, const jo_fixed height, const jo_fixed sway, const bool flip) -> bool: Draw a sprite standing on the ground and facing the camera (trees, grass, characters far away...)
- JO_3D_FADE_LEVELS: Levels of the fade (the color calculation ratios 1 to 3 of the sprites, see jo_vdp2_set_sprite_blend_ratios())
- JO_3D_FADE_LEVEL_SHIFT: Bit of the level in the color code of a sprite (sprite type 3: its color calculation bits 12 and 11)
- jo_3d_set_sprite_fade(const int sprite_id, const jo_palette * const palette, const int bank) -> bool: A standing sprite that fades with the distance (see jo_3d_set_fade_distances()): its 16 colors copied in a bank of a palette, used beyond the start of the fade
- jo_3d_set_fade_distances(const jo_fixed start, const jo_fixed end) -> void: The distances of the fade of the standing sprites (see jo_3d_set_sprite_fade()): opaque up to start, then JO_3D_FADE_LEVELS levels more and more transparent up to end (beyond: the most transparent;...
- jo_3d_create_indexed_mesh(const unsigned int point_count, const unsigned int polygon_count) -> jo_3d_mesh *: Create an empty mesh made of shared points and polygons (indexes of the points)
- jo_3d_set_texture_subdivision(const int sprite_id) -> bool: Draw the polygons that use a texture in parts when they are near the camera (2 x 2 or 4 x 4 parts, each part with its tile of the texture)
- jo_3d_set_texture_subdivision_fine(const int sprite_id) -> bool: Add finer tiles to the tiles of a texture (see jo_3d_set_texture_subdivision()): 8 x 8 and 16 x 16 tiles, for the parts of its polygons cut in 4 x 4 parts that cross the near plane, go very far...
- jo_3d_set_texture_subdivision_near_only(const int sprite_id) -> bool: Like jo_3d_set_texture_subdivision(), but only the polygons that cross the near plane (or go very far outside of the screen) are drawn in parts: a model already cut in small quads when it was made...
- jo_3d_set_texture_subdivision_depth(const int sprite_id, const jo_fixed depth) -> void: Draw in parts (see jo_3d_set_texture_subdivision()) only the polygons of a texture whose nearest vertex is nearer than a depth: the ground next to the camera, where its texture slides the most...
- jo_3d_set_texture_subdivision_error(const int sprite_id, const int pixels) -> void: Distortion of a texture over which its polygons are drawn in parts (see jo_3d_set_texture_subdivision()): a pattern with straight lines (a tiled floor) shows the distortion more, the lines bend where...
- jo_3d_set_fewer_parts(const bool enabled) -> void: Draw the polygons in parts only where it is needed to draw them at all (see jo_3d_set_texture_subdivision()): the polygons that cross the near plane, and those beyond the guard band in 2 x 2 parts...
- jo_3d_set_texture_mipmaps(const int sprite_id) -> bool: Create smaller copies of a texture (half and quarter size, "mipmaps") used when the texture is drawn small
- jo_3d_set_texture_mipmap_copies(const int sprite_id, const int half_id, const int levels) -> bool: Give a texture its smaller copies made beforehand (see jo_3d_set_texture_mipmaps()): for the textures it can't reduce itself (256 colors: their palette is chosen per polygon), or reduced better by a...
- jo_3d_slave_begin(void) -> void (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): Prepare the 3D drawing of the slave CPU (call it on the master CPU, before jo_core_exec_on_slave())
- jo_3d_slave_set_depth_bias(const int bias) -> void (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): Change the depth bias of the objects drawn by the slave CPU (call it on the slave CPU)
- jo_3d_slave_set_guard_band(const int pixels) -> void (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): Change the guard band of the objects drawn by the slave CPU (call it on the slave CPU, see jo_3d_set_guard_band())
- jo_3d_slave_transform_point(const jo_pos3D_fixed * const in, jo_pos3D_fixed *out) -> void (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): Transform a point by the matrix of the slave CPU (call it on the slave CPU, see jo_3d_transform_point())
- jo_3d_slave_push_matrix(void) -> bool (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): Push the matrix of the slave CPU (call it on the slave CPU, see jo_3d_push_matrix())
- jo_3d_slave_pop_matrix(void) -> void (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): Pop the matrix of the slave CPU (call it on the slave CPU, see jo_3d_pop_matrix())
- jo_3d_slave_translate_matrix_fixed(const jo_fixed x, const jo_fixed y, const jo_fixed z) -> void (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): Translate the matrix of the slave CPU (call it on the slave CPU, see jo_3d_translate_matrix_fixed())
- jo_3d_slave_rotate_matrix(const int x, const int y, const int z) -> void (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): Rotate the matrix of the slave CPU (call it on the slave CPU, see jo_3d_rotate_matrix())
- jo_3d_slave_rotate(const int axis, const jo_angle angle) -> void (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): Rotate the matrix of the slave CPU around an axis by a precise angle (call it on the slave CPU): a slow turn (a big wheel, a fan) moves by less than a degree per frame
- jo_3d_slave_set_scale_fixed(const jo_fixed x, const jo_fixed y, const jo_fixed z) -> void (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): Scale the matrix of the slave CPU (call it on the slave CPU, see jo_3d_set_scale_fixed())
- jo_3d_slave_mesh_draw_ranges(const jo_3d_mesh * const mesh, const unsigned int point_count, const jo_3d_polygon_range * const ranges, const int range_count) -> bool (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): Draw some ranges of polygons of a mesh on the slave CPU, without copying them (see jo_3d_mesh_draw_ranges())
- jo_3d_slave_mesh_draw(const jo_3d_mesh * const mesh) -> bool (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): Draw a mesh on the slave CPU (call it on the slave CPU, between jo_3d_slave_begin() and jo_3d_slave_end())
- jo_3d_slave_get_command_count(void) -> int (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): VDP1 commands used by the slave CPU in the last frame (see jo_3d_slave_end())
- jo_3d_slave_draw_standing_sprite(const int sprite_id, const jo_pos3D_fixed * const foot, const jo_fixed width, const jo_fixed height, const jo_fixed sway, const bool flip) -> bool (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): Draw a sprite standing on the ground and facing the camera on the slave CPU (see jo_3d_draw_standing_sprite())
- jo_3d_slave_set_fade_distances(const jo_fixed start, const jo_fixed end) -> void (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): The distances of the fade of the standing sprites of the slave CPU (see jo_3d_set_fade_distances()), until the next jo_3d_slave_begin() (call it on the slave CPU)
- jo_3d_slave_get_current_command_count(void) -> int (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): Commands drawn by the slave CPU since jo_3d_slave_begin() (0 after jo_3d_slave_end())
- jo_3d_slave_get_max_commands(void) -> int (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): Commands the slave CPU can draw in a frame (the others are dropped, jo_3d_slave_mesh_draw() returns false)
- jo_3d_slave_get_max_vertices(void) -> int (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): Points of the biggest object the slave CPU can draw (a bigger object is not drawn)
- jo_3d_slave_end(void) -> void (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): Add the polygons drawn by the slave CPU to the frame (call it on the master CPU, after jo_core_wait_for_slave())
- jo_3d_slave_set_kept_commands(const int count) -> void (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): VDP1 commands kept for what is drawn after jo_3d_slave_end() (the weapon, the HUD): the polygons of the slave CPU don't take them. Without it, a frame full of polygons left no room for the HUD (and...
- jo_3d_add_gouraud_tables(const jo_color * const tables, const unsigned int count) -> unsigned short: Add gouraud tables in the VDP1 VRAM (4 colors per table, one per vertex of a polygon)
- jo_3d_free_gouraud_tables(const unsigned short adr, const unsigned int count) -> void: Give back gouraud tables of jo_3d_add_gouraud_tables() (jo_3d_free_model() gives back the tables of a model)
- jo_3d_set_tint(const int r, const int g, const int b) -> void: Tint the next meshes drawn by the master CPU: added to the colors of their gouraud tables (the light of a lamp on a character, see jo_3d_point_lights_sample()), jo_3d_set_tint(0, 0, 0) to stop
- jo_3d_get_tint(void) -> unsigned short: The tint of the master CPU, packed (see jo_3d_set_tint()): 5 bits per component (signed, steps of 2), 0: none
- jo_3d_set_packed_tint(const unsigned short tint) -> void: Tint the next meshes drawn by the master CPU (see jo_3d_set_tint())
- jo_3d_slave_set_tint(const unsigned short tint) -> void: Tint the next meshes drawn by the slave CPU (call it on the slave CPU)
- jo_3d_prepare_tint(const jo_3d_mesh * const mesh) -> void: Make the tinted copy of the gouraud tables of a mesh for the current tint of the master CPU (see jo_3d_set_tint()), for the slave CPU to draw it with this tint (jo_3d_slave_set_tint())
- jo_3d_set_mesh_environment(jo_3d_mesh * const mesh, const int sprite_id, const int tiles) -> bool: Environment map of a mesh (a reflection, like the paint of a car): its polygons set by jo_3d_set_mesh_polygon_environment() show a tile of a picture of the surroundings, the tile of the direction of...
- jo_3d_set_mesh_polygon_environment(jo_3d_mesh * const mesh, const unsigned int index) -> bool: A polygon shows the environment map of its mesh (see jo_3d_set_mesh_environment()): its gouraud table tints the reflection (16: the picture as it is); a picture of 256 colors: its colors as they are,...
audio.h: Jo Engine Function prototypes for audio
In the makefile of the game: JO_COMPILE_WITH_AUDIO_MODULE = 1.
- JO_SOUND_MAX_CHANNEL: Channels of sounds (2 slots of the SCSP each; the slots 16 and 17 take the CD audio; the last channel plays the sound of a movie while it plays, see jo_video_play())
- JO_DEFAULT_AUDIO_VOLUME: Default audio volume
- JO_MAX_AUDIO_VOLUME: Max audio volume available for jo_audio_set_volume()
- JO_MIN_AUDIO_VOLUME: Min audio volume available for jo_audio_set_volume()
- jo_audio_init(void) -> void (JO_COMPILE_WITH_FS_MODULE, on by default): Start the sound again as jo_core_init() does: the program of the 68000 (the sound driver, or its idle loop), the slots keyed off, the sounds loaded forgotten
- jo_audio_play_cd_track(const int from_track, const int to_track, const bool repeat_infinitely) -> void (JO_COMPILE_WITH_FS_MODULE, on by default): Play a track from the CD
- jo_audio_stop_cd(void) -> void (JO_COMPILE_WITH_FS_MODULE, on by default): Stop playing audio track
- jo_audio_pause_cd(void) -> void (JO_COMPILE_WITH_FS_MODULE, on by default): Pause the audio track played by jo_audio_play_cd_track()
- jo_audio_resume_cd(void) -> void (JO_COMPILE_WITH_FS_MODULE, on by default): Resume the audio track paused by jo_audio_pause_cd()
- jo_audio_is_cd_paused(void) -> bool (JO_COMPILE_WITH_FS_MODULE, on by default): Check if the CD audio is paused (see jo_audio_pause_cd())
- jo_audio_is_cd_playing(void) -> bool (JO_COMPILE_WITH_FS_MODULE, on by default): Check if the CD drive is playing
- jo_audio_set_volume(const unsigned char vol) -> void: Set the audio volume
- JO_AUDIO_CD_VOLUME_MAX: Maximum level of the CD audio (see jo_audio_set_cd_volume()), the default
- jo_audio_set_cd_volume(const unsigned char level) -> void: Set the level of the CD audio in the mix (the music tracks of the CD, see jo_audio_play_cd_track())
- jo_audio_is_channel_playing(const unsigned char channel) -> bool: Checks whether a given audio channel is currently playing a sound
- jo_audio_play_sound_on_channel(jo_sound * const sound, const unsigned char channel) -> void: Play a sound on a specific channel
- jo_audio_play_sound_loop_on_channel(jo_sound * const sound, const unsigned char channel) -> void: Play a sound again and again on a specific channel, until the channel is stopped (an engine for instance)
- jo_audio_set_channel_sample_rate(const unsigned char channel, const unsigned int sample_rate) -> void: Change the sampling rate of the sound played on a channel (its pitch: a faster engine for instance)
- jo_audio_set_channel_volume(const unsigned char channel, const unsigned char volume) -> void: Change the volume of the sound played on a channel
- jo_audio_set_channel_reverb(const unsigned char channel, const unsigned char level) -> void: Change the send of the sound played on a channel to the reverberation (JO_COMPILE_WITH_AUDIO_DSP_MODULE)
- jo_audio_reverb (JO_COMPILE_WITH_AUDIO_DSP_MODULE = 1): The reverberation of a room (the DSP of the SCSP: jo_audio_set_reverb())
- jo_audio_set_reverb(const jo_audio_reverb * const reverb) -> void (JO_COMPILE_WITH_AUDIO_DSP_MODULE = 1): Set the reverberation of the DSP of the SCSP (a room: the sounds whose field reverb is not 0 go there)
- JO_AUDIO_DRIVER_IMA_MAX_RATE (JO_COMPILE_WITH_AUDIO_DRIVER_MODULE = 1): The 68000 decodes the IMA ADPCM of the music and of the stream up to this rate (samples per second, of all the channels: 48000 is 48000 Hz mono or 24000 Hz stereo), the SH-2 beyond. Its decoder takes...
- jo_tone_waveform (JO_COMPILE_WITH_AUDIO_DRIVER_MODULE = 1): Waveform of a tone
- jo_audio_tone (JO_COMPILE_WITH_AUDIO_DRIVER_MODULE = 1): A tone made by the SCSP (no sample: a sine, FM, or the noise generator), see jo_audio_play_tone()
- jo_audio_play_tone(const jo_audio_tone * const tone, const unsigned char channel) -> void (JO_COMPILE_WITH_AUDIO_DRIVER_MODULE = 1): Play a tone made by the SCSP on a channel (FM, glide, tremolo, noise: no sample in the sound RAM)
- jo_audio_note (JO_COMPILE_WITH_AUDIO_DRIVER_MODULE = 1): A note of a tune of tones (see jo_audio_play_tune())
- jo_audio_play_tune(const jo_audio_note * const notes, const unsigned char count, const unsigned char channel) -> void (JO_COMPILE_WITH_AUDIO_DRIVER_MODULE = 1): Play a short tune of tones made by the SCSP on a channel (the jingle of a pickup, of a coin, of a menu, a siren): no sample in the sound RAM
- jo_audio_play_sound(jo_sound * const sound) -> void: Play a sound on first available channel
- jo_audio_stop_sound(const jo_sound * const sound) -> void: Stop a sound
- jo_audio_stop_channel(const unsigned char channel) -> void: Stop the sound played on a channel
- jo_audio_load_pcm(const char * const filename, const jo_sound_mode mode, jo_sound *sound) -> bool (JO_COMPILE_WITH_FS_MODULE, on by default): Load PCM file from CD
- jo_audio_load_pcm_async(const char * const filename, const jo_sound_mode mode, jo_sound *sound) -> bool (JO_COMPILE_WITH_FS_MODULE, on by default): Load PCM file from CD asynchronously
- jo_audio_load_wav(const char * const filename, jo_sound *sound) -> bool (JO_COMPILE_WITH_FS_MODULE, on by default): Load a WAV file from CD (PCM, 8 or 16 bits, mono or stereo, any sample rate: the sound gets its mode and its sample rate from the file)
- jo_audio_play_music(const char * const filename, const bool loop) -> bool (JO_COMPILE_WITH_FS_MODULE, on by default): Play a music streamed from a WAV file of the CD (only a few seconds of it in memory)
- jo_audio_stop_music(void) -> void (JO_COMPILE_WITH_FS_MODULE, on by default): Stop the music (jo_audio_play_music())
- jo_audio_pause_music(void) -> void (JO_COMPILE_WITH_FS_MODULE, on by default): Pause the music (jo_audio_play_music())
- jo_audio_resume_music(void) -> void (JO_COMPILE_WITH_FS_MODULE, on by default): Resume the music paused by jo_audio_pause_music()
- jo_audio_is_music_playing(void) -> bool (JO_COMPILE_WITH_FS_MODULE, on by default): Check if the music is playing (jo_audio_play_music())
- jo_audio_is_music_paused(void) -> bool (JO_COMPILE_WITH_FS_MODULE, on by default): Check if the music is paused (jo_audio_pause_music())
- jo_audio_set_music_volume(const unsigned char volume) -> void (JO_COMPILE_WITH_FS_MODULE, on by default): Set the volume of the music (jo_audio_play_music())
- jo_audio_get_music_underruns(void) -> unsigned int (JO_COMPILE_WITH_FS_MODULE, on by default): Count the times the music had no data to play (the drive was too late: a silence of about 0.1 s)
- jo_audio_stream_format (JO_COMPILE_WITH_FS_MODULE, on by default): The samples of a stream (see jo_audio_stream_write())
- jo_audio_stream_open(const jo_audio_stream_format format, const int channels, const int rate, const int ring_samples) -> bool (JO_COMPILE_WITH_FS_MODULE, on by default): Open a stream: a ring of samples in the sound RAM, played in a loop by the SCSP, that the game fills at its pace (the sound of a video, voices read from the CD, sounds made by the game)
- jo_audio_stream_write(const void * const data, const unsigned int samples) -> bool (JO_COMPILE_WITH_FS_MODULE, on by default): Add samples after the ones written (they play after them)
- jo_audio_stream_room(void) -> unsigned int (JO_COMPILE_WITH_FS_MODULE, on by default): Samples per channel that can be written now (jo_audio_stream_write())
- jo_audio_stream_play(void) -> void (JO_COMPILE_WITH_FS_MODULE, on by default): Start to play the stream, from its first sample (the samples written before play first)
- jo_audio_stream_played(void) -> unsigned int (JO_COMPILE_WITH_FS_MODULE, on by default): Samples per channel played since jo_audio_stream_play(): the clock of the stream (a video shows its frames at the time of its sound)
- jo_audio_stream_written(void) -> unsigned int (JO_COMPILE_WITH_FS_MODULE, on by default): Samples per channel written since jo_audio_stream_open()
- jo_audio_stream_set_volume(const unsigned char volume) -> void (JO_COMPILE_WITH_FS_MODULE, on by default): Set the volume of the stream
- jo_audio_stream_close(void) -> void (JO_COMPILE_WITH_FS_MODULE, on by default): Stop the stream and free its place in the sound RAM
- jo_audio_make_resident(jo_sound *sound) -> bool: Keep a sound in the sound RAM (512 KB) and free its copy in the work RAM (the jo_malloc() memory)
- jo_audio_free_resident(void) -> void: Forget all the resident sounds (a new level): their room in the sound RAM is free again
- jo_audio_free_pcm(jo_sound *sound) -> void: Free pcm sound loaded with jo_audio_load_pcm()
- jo_audio_usage_percent(void) -> int: Get audio channel usage
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
- JO_BACKUP_MAX_FILENAME_LENGTH: Max backup filename length
- JO_BACKUP_MAX_FILE: Max backup file in device
- JO_BACKUP_MAX_COMMENT_LENGTH: Max backup file comment length
- jo_backup_device: Backup device type
- jo_backup_status: Backup status
- jo_backup: Backup File struct
- jo_backup_mount(const jo_backup_device backup_device) -> bool: Mount the backup device (must be the first call)
- jo_backup_unmount(const jo_backup_device backup_device) -> bool: Unmount the backup device (optional)
- jo_backup_read_device(const jo_backup_device backup_device, jo_list * const filenames) -> bool: Read backup device
- jo_backup_file_exists(const jo_backup_device backup_device, const char * const fname) -> bool: Check if file exists
- jo_backup_format_device(const jo_backup_device backup_device) -> bool: Format the device (all data is lost)
- jo_backup_init_file(jo_backup * file) -> void: Initialize a backup file in order to save it
- jo_backup_save(jo_backup * file) -> bool: Save file contents to the backup device (if the file exists it will be overwritten)
- jo_backup_save_file_contents(const jo_backup_device backup_device, char * const fname, char * const comment, void *contents, unsigned int content_size) -> bool: Save file contents to the backup device (if the file exists it will be overwritten)
- jo_backup_delete_file(const jo_backup_device backup_device, const char * const fname) -> bool: Delete file on the backup device
- jo_backup_get_file_last_modified_date(const jo_backup_device backup_device, const char * const fname, jo_datetime *datetime) -> bool: Get file last modified date on the backup device
- jo_backup_get_file_size(const jo_backup_device backup_device, const char * const fname, unsigned int* const num_bytes, unsigned int* const num_blocks) -> bool: Get file size in bytes and blocks
- jo_backup_get_file_info(const jo_backup_device backup_device, const char * const fname, char* const comment, unsigned char* const language_num, unsigned int* const date, unsigned int* const num_bytes, unsigned int* const num_blocks) -> bool: Get file comment, language, date, and size in bytes and blocks
- jo_backup_load_file_comment(const jo_backup_device backup_device, const char * const fname) -> unsigned char *: Load file comment from the backup device
- jo_backup_load_file_contents(const jo_backup_device backup_device, const char * const fname, unsigned int *length) -> void *: Load file contents from the backup device
- jo_backup_get_file_partition(const jo_backup_device backup_device, const char * const fname) -> unsigned short: Get the partition number where the file is located
- jo_backup_get_free_block_count(const jo_backup_device backup_device) -> int: Get free block count on the backup device
- jo_backup_get_total_block_count(const jo_backup_device backup_device) -> int: Get total block count on the backup device
- jo_backup_get_last_status(const jo_backup_device backup_device) -> jo_backup_status: Get last backup status (error details)
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.
- JO_CELL_MAX: Cells at most
- JO_CELL_MAX_PORTALS: Portals at most
- JO_CELL_MAX_DRAWN: Cells drawn in a frame at most
- jo_cell: A cell
- jo_cell_portal: A portal: an opening of a cell toward another cell
- jo_cells_load(jo_level * const level) -> int: Create the cells of a level (sections CELL and PRTL): the previous ones are freed
- jo_cells_free(void) -> void: Free the cells (and their models)
- jo_cells_count(void) -> int: Number of cells
- jo_cells_have_exits(void) -> bool: Check if a cell has a door or a window to the outside (the level is not an inside level: there is a world around the cells)
- jo_cells_get(const int index) -> const jo_cell *: A cell
- jo_cells_outside_view(jo_3d_rect * const rect) -> int: Rectangle of the screen where the outside is seen (after jo_cells_prepare()): the portals of the cells seen that go to the outside (PRTL.cell NO_INDEX: the door of a building on a terrain). Give it...
- jo_cell_floor(const jo_cell * const cell, const int x, const int z) -> int: Floor of a cell at a position (its slope)
- jo_cells_find(const jo_fixed x, const jo_fixed y, const jo_fixed z, const int step) -> int: Cell of a position: its box has the position, its floor is under it (the highest one)
- jo_cells_floor(const jo_fixed x, const jo_fixed y, const jo_fixed z, const int step, int * const floor) -> bool: Floor under a position
- jo_cells_is_walkable(const jo_fixed x, const jo_fixed y, const jo_fixed z, const int radius, const int step) -> bool: Check if the player can stand at a position: a circle around it is in the box of a cell, the floor of the cell is under the feet (or a step over them)
- jo_cells_draw(const jo_pos3D_fixed * const camera) -> int: Draw the cells seen from the camera (the camera matrix is the current matrix, see jo_3d_set_depth_bias())
- jo_cells_prepare(const jo_pos3D_fixed * const camera) -> int: Find the cells seen from the camera (the camera matrix is the current matrix): jo_cells_draw() in 2 parts, to draw them on the slave CPU (the master CPU finds them, the slave CPU draws them while the...
- jo_cells_draw_prepared(const bool slave) -> void: Draw the cells found by jo_cells_prepare()
- jo_cells_draw_prepared_part(const bool slave, const int part, const int handicap) -> void: Draw a part of the cells found by jo_cells_prepare(): the 2 CPUs draw them together (the meshes split in 2 parts with about as many polygons, the same split on both CPUs)
- jo_cells_draw_prepared_share(const bool slave, const int part, const int share) -> void: Draw a part of the cells found by jo_cells_prepare(): the 2 CPUs draw them together, the polygons split at a share (a mesh can be split: the CPUs can be balanced at each frame, see...
- JO_CELLS_DEFAULT_SHARE: Share of the polygons of the cells drawn by the master CPU at the start (0 to 1024, see jo_cells_draw_prepared_on_both_cpus())
- JO_CELLS_DEFAULT_MAX_SHARE: Highest share of the master CPU by default (all the cells: the slave CPU may draw the entities)
- jo_cells_prepared_polygon_count(void) -> int: Polygons of the cells found by jo_cells_prepare() (the polygons of the chunks seen of the meshes seen: the share of each CPU is cut in them, see jo_cells_draw_prepared_share())
- jo_cells_draw_prepared_on_both_cpus(void (* const slave_before)(void), const int slave_polygons) -> void: Draw the cells found by jo_cells_prepare() on the 2 CPUs: the slave CPU draws its part (a job, see jo_core_exec_on_slave()) while the master CPU draws the other part. The share of each CPU: half of...
- jo_cells_balance_share(void) -> void: Balance the share of the CPUs for the next frame (see jo_cells_draw_prepared_on_both_cpus()): more polygons to the slave CPU when it waited in the last frame, fewer when the master CPU waited for it...
- jo_cells_set_share_limits(const int min, const int max) -> void: Limits of the share of the master CPU (see jo_cells_draw_prepared_on_both_cpus())
- jo_cells_get_share(void) -> int: Share of the polygons of the cells drawn by the master CPU in the next frame (0 to 1024)
- jo_cells_draw_mirror(void (*draw_more)(void)) -> bool: Draw the mirror seen by the camera (in the cell of the camera or in a cell seen through a door), when jo_cells_prepare() found one (a portal MIRROR): its cell is drawn again with the camera reflected...
- jo_cells_mirror_is_floor(void) -> bool: The mirror drawn now (in draw_more of jo_cells_draw_mirror()) is a polished floor (a horizontal portal MIRROR under a half transparent floor), not a mirror on a wall (in draw_more of...
- jo_cells_set_window_distance(const int distance) -> void: Distance from the outside under which a cell is seen through its windows (portals JO_LEVEL_PORTAL_WINDOW to the outside): farther, the cell is not drawn through them (a window is small on the screen,...
- jo_cells_view_rect_at(const jo_pos3D_fixed * const position, jo_3d_rect * const rect) -> bool: The rectangle of the screen where a point is seen (the cell of the point seen through the doors, see jo_cells_prepare(): after it). For an effect drawn over the 3D view that the walls don't hide (a...
- jo_cells_seen_through(const int index, jo_3d_rect * const rect) -> bool: The rectangle of the screen where a cell is seen from the outside (through its doors and its near windows, see jo_cells_set_window_distance()), after jo_cells_prepare(): the program can draw what is...
- jo_cells_seen_through_window(const int index) -> bool: Check if a cell is seen from the outside through one of its windows in this frame (see jo_cells_set_window_distance(); or from its doorway: the whole screen)
- jo_cells_is_drawn(const int index) -> bool: Check if a cell was drawn in the last call of jo_cells_draw() or jo_cells_prepare() (the objects in the other cells are hidden). The camera outside of the cells: a cell with doors to the outside is...
- jo_cells_close_portals(const jo_fixed x, const jo_fixed z, const int radius, const bool closed) -> int: Close the portals of a door (JO_LEVEL_PORTAL_DOOR) whose middle is near a point: the cells behind them are not drawn through them (a closed door: its panel hides the room behind it), or open them...
- jo_cells_depth_bias_at(const jo_fixed x, const jo_fixed y, const jo_fixed z) -> int: Depth bias of an object in the cells (see jo_cells_draw()): the cells seen through more portals are drawn behind, the objects in them too (else they are seen through the walls of the nearer cells)
- jo_cells_object_cell(const jo_fixed x, const jo_fixed y, const jo_fixed z) -> int: Cell of an object (see jo_cells_depth_bias_at())
- jo_cells_set_portal_clipping(const bool enabled) -> void: The cells seen through the portals are drawn in the far window (JO_3D_FAR_WINDOW), clipped by the VDP1 to the union of the rectangles of the portals on the screen (default: on). A room seen through a...
- jo_cells_set_occluders(const bool enabled) -> void: A polygon of the cell of the camera that covers the whole screen (the camera near a wall, facing it, or a bench against it) hides everything behind it: the polygons behind it are not drawn (the depth...
- jo_cells_window_of(const int bias) -> int: The window of an object drawn with a depth bias of the cells (see jo_cells_depth_bias_at(), jo_cells_set_portal_clipping()): select it with jo_3d_select_window() (jo_3d_slave_select_window() on the...
- jo_cells_depth_bias_of(const int cell) -> int: Depth bias of an object in a cell (see jo_cells_depth_bias_at())
- jo_cells_generation(void) -> unsigned short: Generation of the cells: it changes when cells are loaded or freed (the cells found before are then stale)
- jo_cells_ray_hit(const jo_pos3D_fixed * const origin, const jo_pos3D_fixed * const dir, const jo_fixed max_t, jo_fixed * const t, jo_pos3D_fixed * const normal) -> bool: First wall (polygon of a cell) hit by a ray (the bullets)
- jo_cells_add_point_light_meshes(const bool shadows) -> int: The models of the cells are lit by the point lights (see jo/light.h): their meshes are added, and with shadows the walls of the cells stop the light (it goes through the doors)
colors.h: Jo Engine Standard colors
- JO_COLOR_Transparent: Transparent color
- JO_COLOR_SATURN(C): Internal, you should not use this macro.
- JO_COLOR_SATURN_RGB(R,G,B): Internal, you should not use this macro.
- JO_COLOR_SATURN_MSB: MSB of a Saturn color (RGB color flag)
- JO_COLOR_RGB(R,G,B): Get jo_color type from RGB additive color model
- jo_color_mix(const jo_color a, const jo_color b, const int t) -> jo_color: A color between 2 colors (each component interpolated)
- jo_set_screen_color_filter_a(const jo_scroll_screen screens, const short r, const short g, const short b) -> void: Set color filter A for scroll screen
- jo_set_screen_color_filter_b(const jo_scroll_screen screens, const short r, const short g, const short b) -> void: Set color filter A for scroll screen
- jo_disable_screen_color_filter(const jo_scroll_screen screens) -> void: Disable color filter for scroll screen
- jo_fade_screens(const jo_scroll_screen screens, const short from, const short to, const int frames) -> void: Fade scroll screens: their color filter A from a level to another, a step at each VBLANK (waits for the end)
- jo_disable_all_screen_color_filter(void) -> void: Disable color filter for all scroll screen
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
- 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) (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): Function prototype for jo_core_exec_on_slave()
- jo_main(void) -> void: The entry point of the game: defined by the game, called by the engine (C linkage: a game in C++ defines it after including jo/jo.h, without extern "C")
- jo_core_init(const jo_color back_color) -> void: Init the engine
- jo_core_run(void) -> void: Run the game
- jo_core_add_vblank_callback(const jo_event_callback callback) -> int: Add a callback during VBLANK interruption
- jo_core_remove_vblank_callback(const int vblank_event_id) -> void: Remove a callback during VBLANK interruption
- jo_core_add_callback(const jo_event_callback callback) -> int: Add a callback in the game loop on main CPU
- jo_core_remove_callback(const int event_id) -> void: Remove a callback in the game loop from on main CPU
- jo_core_add_slave_callback(const jo_event_callback callback) -> int (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): Add a callback in the game loop on slave CPU
- jo_core_remove_slave_callback(const int event_id) -> void (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): Remove a callback in the game loop from on slave CPU
- jo_core_set_restart_game_callback(const jo_event_callback callback) -> void: Add a callback when A+B+C+Start is pressed on the first control pad (called at each frame while they are pressed)
- jo_core_set_cd_tray_open_callback(const jo_event_callback callback) -> void: Add a callback when the tray of the CD is opened
- jo_goto_boot_menu(void) -> void: Return to the boot menu
- jo_core_exec_on_slave(jo_slave_callback callback) -> void (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): Execute a callback on the slave CPU
- jo_core_wait_for_slave(void) -> void (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): Wait until all the callbacks given to jo_core_exec_on_slave() are completed
- jo_core_slave_idle_time(void) -> int (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): Balance of the CPUs in the last frame (between the 2 last calls of jo_core_wait_for_slave())
- jo_core_master_wait_time(void) -> int (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): The time the master CPU waited for the slave CPU in the last jo_core_wait_for_slave()
- typedef void (*jo_slave_job_function)(void *argument) (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): Function of a job of the slave CPU (Internal usage)
- typedef void (*jo_core_rows_function)(const int first_row, const int end_row, void *data) (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): The work of jo_core_split_rows() on rows (lines of a picture, lines of blocks, any list of items)
- jo_core_split (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): A work shared by the 2 CPUs (see jo_core_split_rows()): keep it from a call to the next (zeroed at the start: the first split is the half)
- jo_core_split_rows(jo_core_split * const split, const jo_core_rows_function function, void *data, const int rows) -> void (JO_COMPILE_WITH_DUAL_CPU_MODULE, on by default): Share a work on rows between the 2 CPUs: the master CPU takes the first rows, the slave CPU the last ones, the split moves at each call to give the same time to the 2 CPUs (the time per row of each...
- jo_core_disable_reset(void) -> void: Disable reset button
- jo_core_enable_reset(void) -> void: Enable reset button (see jo_core_disable_reset())
- jo_core_tv_off(void) -> void: Turn OFF scroll drawing processing in the monitor
- jo_core_tv_on(void) -> void: Turn ON scroll drawing processing in the monitor
- jo_core_set_screen_resolution(const int width, const int height) -> bool: Change the resolution of the screen while the game runs
- jo_core_set_screen_single_interlace(const bool enabled) -> void: Single density interlace: the image of 224 to 256 lines is displayed in the 2 fields, the second one half a line lower (the look of the games that use it on a CRT: no dark lines between the lines, a...
- jo_core_get_screen_width(void) -> int: Get the width of the screen
- jo_core_get_screen_height(void) -> int: Get the height of the screen
- jo_core_set_screen_palette(const int palette_id) -> void: Choose the palette of the sprites in the 640 and 704 pixels modes (the frame buffer of the VDP1 has 8 bits per pixel: one palette of 256 colors for all the sprites)
- jo_core_get_refresh_rate(void) -> int: Get the refresh rate of the console
- jo_core_exit_to_multiplayer(void) -> void: Exit program and return to the Saturn multiplayer (CD player) screen
- jo_core_restart_saturn(void) -> void: Restart the Saturn
- jo_core_set_screens_order(screen1, args...): Set scroll screen order between them
- jo_core_suspend(void) -> void (JO_DEBUG only): Stop the execution until someone press Start
- typedef void (*jo_core_error_handler)(const char *message, const char *function) (JO_DEBUG only): Function called by jo_core_error() (see jo_core_set_error_handler())
- jo_core_set_error_handler(const jo_core_error_handler handler) -> void (JO_DEBUG only): Call a function instead of the error screen (JO_DEBUG): automated tests count the errors and go on
- jo_get_last_error(void) -> char * (JO_DEBUG only): Get last error
- jo_dump_vdp1_registers(void) -> void (JO_DEBUG only): Dump VDP1 registers
- jo_dump_vdp2_registers(void) -> void (JO_DEBUG only): Dump VDP2 registers
- jo_core_get_vblank_count(void) -> unsigned int: Get the number of VBLANK since startup (60 per second in NTSC, 50 in PAL)
- JO_CORE_MAX_FRAMERATE: The highest frame rate value of jo_core_set_framerate() (VBLANKs per frame: 10 images per second in NTSC)
- jo_core_set_framerate(const int framerate) -> bool: Change the frame rate while the program runs (60 images per second in some scenes, 30 in others)
- jo_core_get_framerate(void) -> int: The frame rate (see jo_core_set_framerate())
- jo_core_get_fps(void) -> int: Get the frames per second really shown, measured over the last 2 seconds
- jo_core_get_late_frame_count(void) -> unsigned int: Get the count of the late frames since startup
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.
- jo_homing_laser: Homing laser effect definition
- jo_init_homing_laser(jo_homing_laser * const homing_laser, const int sprite_id, const unsigned short thickness, const int z, const unsigned short nb_sections) -> void: Init jo_homing_laser struct
- jo_draw_homing_laser(jo_homing_laser * const homing_laser) -> void: Draw homing laser effect
- JO_EFFECT_MAX (JO_COMPILE_WITH_3D_MODULE = 1): Effects at the same time (the oldest one is reused)
- JO_EFFECT_MAX_FRAMES (JO_COMPILE_WITH_3D_MODULE = 1): Frames of the animation of an effect at most
- JO_EFFECT_HALF_TRANSPARENT (JO_COMPILE_WITH_3D_MODULE = 1): The sprite is mixed with what is behind (VDP1 half transparency: costly, for small sprites only)
- JO_EFFECT_STANDING (JO_COMPILE_WITH_3D_MODULE = 1): The sprite stands on its position (else it is centered on it)
- JO_EFFECT_RANDOM_FLIP (JO_COMPILE_WITH_3D_MODULE = 1): The sprite is flipped at random (the effects don't look the same)
- jo_effect_def (JO_COMPILE_WITH_3D_MODULE = 1): Definition of an effect (shared by the effects of the same kind)
- jo_effect_add(const jo_effect_def * const def, const jo_pos3D_fixed * const position, const int delay) -> void (JO_COMPILE_WITH_3D_MODULE = 1): Add an effect
- jo_effects_clear(void) -> void (JO_COMPILE_WITH_3D_MODULE = 1): Remove all the effects, the flash and the shake
- jo_effects_update(void) -> void (JO_COMPILE_WITH_3D_MODULE = 1): Animate the effects, the flash and the shake: once per frame of the game
- jo_effects_draw(void) -> int (JO_COMPILE_WITH_3D_MODULE = 1): Draw the effects (in the world: the camera matrix is the current matrix, see jo_3d_set_depth_bias())
- jo_effect_flash(const int r, const int g, const int b, const int frames) -> void (JO_COMPILE_WITH_3D_MODULE = 1): Flash of the screen: the color offset of the VDP2 is added to all the screens, it fades to 0
- jo_effect_fade(const int darkness, const int frames) -> void (JO_COMPILE_WITH_3D_MODULE = 1): Fade of the screen to black (or back): the color offset of the VDP2 (see jo_effect_flash())
- jo_effect_tint(const jo_scroll_screen screens, const int r, const int g, const int b) -> void (JO_COMPILE_WITH_3D_MODULE = 1): A lasting tint of some screens: the light of a place (the orange of a dusk, the blue of the snow, the dark of a night), with the flash and the fade over it (the color offset B of the VDP2 for these...
- jo_effect_is_fading(void) -> bool (JO_COMPILE_WITH_3D_MODULE = 1): Check if the fade is not finished (see jo_effect_fade())
- jo_effect_shake(const int amount, const int frames) -> void (JO_COMPILE_WITH_3D_MODULE = 1): Shake of the camera
- jo_effect_get_shake(jo_pos3D_fixed * const offset) -> void (JO_COMPILE_WITH_3D_MODULE = 1): Offset of the camera of the shake (add it to the position of the eyes)
entity.h: Entities
In the makefile of the game: JO_COMPILE_WITH_FS_MODULE, on by default; JO_COMPILE_WITH_3D_MODULE = 1.
- JO_ENTITY_MAX: Entities at most (they are allocated with their count when a level is loaded)
- JO_ENTITY_MAX_CLASSES: Classes at most (the engine uses 8)
- JO_ENTITY_MAX_PENDING: Actions waiting for their delay at most
- JO_ENTITY_MAX_MODELS: Different models of the entities at most (the models of the classes too: the things broken, the pieces)
- JO_ENTITY_WAKE_DISTANCE: The entities farther from the player are not updated (world units), unless they wait for something (timer), see jo_entities_set_wake()
- JO_ENTITY_DRAW_DISTANCE: The models of the entities farther are not drawn (world units), see the property draw_distance
- JO_ENTITY_FAR_DISTANCE: The far model of the entities is drawn farther (world units), see the properties far_model and far_distance
- JO_ENTITY_FLAG_DISABLED: Flags of an entity: the ones of the level (ENTITY_FLAG_xxx of the schema)
- JO_ENTITY_FLAG_SOLID: A solid entity (the collisions, the bullets): set it with jo_entity_set_solid(); set in the flags directly, it is solid from the next jo_entities_update() (the collisions read a list of the solid...
- JO_ENTITY_FLAG_DEAD: Flags of an entity: the state
- JO_ENTITY_FLAG_DOORWAY: Flag of an entity set by its class: in a doorway between 2 cells (a door), drawn when one of the cells around it (its position +- its radius on X and Z) is drawn (its position alone: a cell hidden...
- jo_entity_class: Class of entities: its callbacks (JO_NULL: nothing to do)
- typedef void (*jo_entity_area_damage_callback)(const jo_pos3D_fixed * const center, const int radius, const int damage, jo_entity * const source): Damage around a point given to the game (the player is not an entity)
- jo_entity_register_class(const jo_entity_class * const cls) -> void: Register a class of the game (before jo_entities_load())
- jo_entity_class_set_parallel_draw(const jo_entity_class * const cls, const bool parallel) -> void: Let the master CPU draw the entities of a class (its draw callback) while the slave CPU draws others of the same class (its draw_slave callback), see jo_entities_draw()
- jo_entities_load(jo_level * const level) -> int: Create the entities of a level (sections ENTI, PROP, LINK): the previous ones are freed
- jo_entities_free(void) -> void: Free the entities (and their models)
- jo_entities_update(const jo_pos3D_fixed * const player, const int elapsed) -> void: Update the entities: the delayed actions, the classes, the trigger zones
- jo_entities_set_wake(const int distance, const bool when_seen) -> void: The entities updated by jo_entities_update(): the ones that wait for something (timer > 0), the ones near the player, and the ones seen
- jo_entities_prepare_draw(const int slave_share) -> void: Prepare the drawing of the entities of the frame (the camera matrix is the current matrix, see jo_3d_set_depth_bias()): the ones seen, their tint (the light of the lamps, see...
- jo_entities_draw(void) -> int: Draw the entities of the master CPU (the camera matrix is the current matrix, see jo_3d_set_depth_bias())
- jo_entities_draw_slave(void) -> int: Draw the entities of the slave CPU (call it on the slave CPU, in the job between jo_3d_slave_begin() and jo_3d_slave_end(), see jo_entities_prepare_draw()): first the ones with a draw_slave callback,...
- jo_entities_slave_wait_time(void) -> int: Time the master CPU waited for the entities of the slave CPU in the last frame (see jo_entities_draw())
- jo_entities_polygon_count(const bool slave) -> int: Polygons of the entities of a CPU in the frame (see jo_entities_prepare_draw(): the polygons of their models, plus 8 each), to balance the CPUs
- jo_entity_count(void) -> int: Number of entities
- jo_entity_get(const int index) -> jo_entity *: An entity
- jo_entity_find(const char * const name) -> jo_entity *: Find an entity by its name
- jo_entity_send(jo_entity * const target, const int action, const int param, jo_entity * const source) -> void: Send an action to an entity now
- jo_entity_fire(jo_entity * const source, const int event, const int param) -> void: Fire an event of an entity: its links send their actions (now or after their delay)
- jo_entity_damage(jo_entity * const entity, const int damage, jo_entity * const source) -> void: Damage an entity: EVENT_DAMAGE, or the death (class death(), EVENT_DEATH) when its health reaches 0
- jo_entities_damage_area(const jo_pos3D_fixed * const center, const int radius, const int damage, jo_entity * const source) -> void: Damage everything around a point: the entities (their foot) and the game (see jo_entities_set_area_damage_callback())
- jo_entities_set_area_damage_callback(const jo_entity_area_damage_callback callback) -> void: Give the damage around a point to the game (the player)
- jo_entities_ray_hit(const jo_pos3D_fixed * const origin, const jo_pos3D_fixed * const dir, const jo_fixed max_t, jo_fixed * const t, jo_pos3D_fixed * const normal) -> jo_entity *: First solid entity hit by a ray (its cylinder)
- jo_entities_is_blocked(const jo_fixed x, const jo_fixed z, const int radius) -> bool: Check if a circle on the ground is in a solid entity (collisions of the player)
- jo_entities_is_blocked_at(const jo_fixed x, const jo_fixed y, const jo_fixed z, const int radius, const int height, const jo_entity * const except) -> bool: Like jo_entities_is_blocked(), with the heights: a solid entity blocks only a body at its level (a low piece of furniture doesn't block the player in a duct over it)
- jo_entity_set_solid(jo_entity * const entity, const bool solid) -> void: Make an entity solid or not (see JO_ENTITY_FLAG_SOLID)
- jo_entities_get_blocking(const jo_fixed x, const jo_fixed z, const int radius, const jo_entity * const except) -> jo_entity *: The solid entity in a circle on the ground (collisions of a vehicle)
- jo_entity_get_int(const jo_entity * const entity, const char * const key, const int default_value) -> int: Property of an entity (PROP)
- jo_entities_get_zone_request(const char ** const level, const char ** const spawn) -> bool: Change of level asked by an entity zone_link (the player went in it): the game fades the screen, loads the level (jo_entities_load(), jo_cells_load()...), puts the player on the entity spawn, then...
- jo_entities_clear_zone_request(void) -> void: The change of level is done (see jo_entities_get_zone_request())
- jo_entity_load_model(const char * const filename) -> jo_3d_mesh *: Load a model for the entities (loaded once: shared by all the entities)
- jo_entity_get_model(const char * const filename) -> jo_3d_model *: Load a model for the entities (loaded once: shared by all the entities)
- jo_entity_set_mesh(jo_entity * const entity, jo_3d_mesh * const mesh) -> void: Change the model of an entity (the dead model of an explosive...)
- jo_entity_view_distance(const jo_entity * const entity) -> int: Check if the model of an entity is drawn (near enough, in the view)
- jo_entities_set_lod_scale(const int scale) -> void: A magnified view (binoculars, a sniper scope): the entities are drawn and detailed as far as they look
- jo_entity_turn_to(jo_entity * const entity, const jo_fixed x, const jo_fixed z, const int max_step) -> int: Turn an entity toward a point on the ground (its model looks toward +Z turned by its yaw: the direction (sin yaw, cos yaw))
- typedef void (*jo_actor_bone_callback)(jo_entity * const entity, const int bone, const jo_fixed (* const matrix)[3]): Called when an actor is drawn, after each bone (a weapon in a hand, a muzzle flash)
- jo_actor: Data of an actor (the first member of the data of a class of actors)
- jo_actor_spawn(jo_entity * const entity) -> void: Create the actor of an entity: its model (the model of the entity, it has a skeleton), the animation of its property animation ("idle" by default)
- jo_actor_set_shadow(jo_entity * const entity, const int radius) -> void: The shadow of an actor on the ground: a dark disc under its position (its feet), drawn with its model by jo_actor_draw() and jo_actor_draw_slave() (the VDP1 darkens the pixels under it: 1 to 3...
- jo_actor_update(jo_entity * const entity, const int elapsed) -> void: Advance the animation of an actor
- jo_actor_draw(jo_entity * const entity) -> void: Draw an actor (its model in the pose of its animation) at its position, turned by its yaw
- jo_actor_draw_slave(jo_entity * const entity, const int far_distance, const unsigned int hidden_bones) -> void: Draw an actor on the slave CPU (call it on the slave CPU, see jo_entities_draw_slave()): its model in the pose of its animation at its position, turned by its yaw, with the distance and the tint...
- jo_actor_play(jo_entity * const entity, const char * const name, const int blend) -> bool: Play an animation (nothing if it is already played)
- jo_actor_restart(jo_entity * const entity, const char * const name, const int blend) -> bool: Play an animation again from its start
- jo_actor_is_done(const jo_entity * const entity) -> bool: Check if the animation of an actor is at its end (the last key of an animation that doesn't loop)
- jo_actor_is_playing(const jo_entity * const entity, const char * const name) -> bool: Check which animation an actor plays
font.h: Jo Engine Simple ASCII Font & print support
- jo_font_printf(F, X, Y, S, ...): Print arguments using a specific font (using top-left screen coordinates)
- jo_font_printf_centered(F, X, Y, S, ...): Print arguments using a specific font (using screen center coordinates)
- jo_font_load(const char * const sub_dir, const char * const filename, const jo_color transparent_color, const int letter_width, const int letter_height, const int letter_spacing, const char * const mapping) -> jo_font * (JO_COMPILE_WITH_FS_MODULE, on by default): Load a font
- jo_font_print(const jo_font * const font, int x, int y, float scale, char * str) -> void (float: emulated in software, slow): Print a string using a specific font (using top-left screen coordinates)
- jo_font_print_centered(const jo_font * const font, int x, int y, float scale, char * str) -> void (float: emulated in software, slow): Print a string using a specific font (using screen center coordinates)
- jo_font_free(jo_font * const font) -> void: Free a font loaded with jo_font_load()
fs.h: Jo Engine File System function prototypes
In the makefile of the game: JO_COMPILE_WITH_FS_MODULE, on by default.
- JO_ROOT_DIR: Specify the root directory (on the CD) for jo_fs_read_file(), jo_map_load_from_file(), etc.
- JO_CURRENT_DIR: Specify the current directory (on the CD) for jo_fs_read_file(), jo_map_load_from_file(), etc.
- JO_PARENT_DIR: Specify the parent directory for jo_fs_read_file(), jo_map_load_from_file(), etc.
- typedef void (*jo_fs_async_read_callback)(char *contents, int length, int optional_token): Function prototype for ()
- jo_fs_cd(const char *const sub_dir) -> bool: Change the current directory (equivalent of Unix cd command)
- jo_fs_file_exists(const char *const filename) -> bool: Check if a file is in the current directory of the CD (no error printed when it is not: an optional file)
- jo_fs_read_file_in_dir(const char *const filename, const char *const sub_dir, int *len) -> char*: Read a file on the CD
- jo_fs_read_file_ptr(const char *const filename, void *buf, int *len) -> char *: Read a file on the CD and put the contents to "buf"
- jo_fs_get_read_stats(unsigned int * const vblanks, unsigned int * const bytes, unsigned int * const files, const bool reset) -> void: Statistics of the files read by jo_fs_read_file_ptr() (the time of a loading: the CD or the CPU)
- jo_fs_read_file(const char *const filename, int *len) -> char*: Read a file on the CD
- jo_fs_read_file_async_ptr(const char *const filename, jo_fs_async_read_callback callback, int optional_token, void *buf) -> bool: Read a file on the CD asynchronously and put the contents to "buf"
- jo_fs_wait_background_jobs(void) -> void: Wait for the end of the reads of jo_fs_read_file_async() (their callbacks called, the files they start too)
- jo_fs_read_file_async(const char *const filename, jo_fs_async_read_callback callback, int optional_token) -> bool: Read a file on the CD asynchronously
- jo_fs_open(jo_file * const file, const char *const filename) -> bool: Open a file
- jo_fs_close(jo_file * const file) -> void: Close a file
- jo_fs_set_read_sector_count(const int count) -> void: Set the size of the read buffer of the files opened by jo_fs_open()
- jo_fs_get_read_sector_count(void) -> int: Get the size of the read buffer of the files opened by jo_fs_open() (see jo_fs_set_read_sector_count()): a loader that changes it for its file puts it back after jo_fs_open()
- jo_fs_read_next_bytes(jo_file * const file, char *buffer, unsigned int nbytes) -> int: Read bytes from a file
- jo_fs_read_available(jo_file * const file, void * const buffer, unsigned int nbytes) -> int: Read bytes from a file without waiting for the drive: only the bytes already read by the CD drive (it reads ahead while the game runs: a stream read a piece per frame never stops the game)
- jo_fs_read_exact(jo_file * const file, void * const buffer, const unsigned int nbytes) -> bool: Read bytes from a file: all of them
- jo_fs_seek_forward(jo_file * const file, unsigned int nbytes) -> bool: Seek forward from current position of a file
- JO_FS_RECORDS_MAX: Most records read ahead in a jo_fs_records
- jo_fs_records: A file of records read ahead in a ring (see jo_fs_records_open()). A record: its size (32 bits, big endian, these 4 bytes included), then its data. The records are read in a ring of the game while it...
- jo_fs_records_open(jo_fs_records * const records, const char * const filename, void * const ring, const unsigned int ring_size) -> bool: Open a file of records (see jo_fs_records)
- jo_fs_records_read(jo_fs_records * const records, const int ahead, const bool wait) -> bool: Read the next record in the ring (a part of it if the drive didn't read the rest yet: the next calls go on)
- jo_fs_records_first(const jo_fs_records * const records, unsigned int * const size) -> const unsigned char *: The oldest record read (its size field first)
- jo_fs_records_take(jo_fs_records * const records) -> void: The oldest record is done: its place in the ring is free for the next ones
- jo_fs_records_count(const jo_fs_records * const records) -> int: Records read and not taken yet
- jo_fs_records_ended(const jo_fs_records * const records) -> bool: The end of the file was reached (no more record will be read)
- jo_fs_records_close(jo_fs_records * const records) -> void: Close the file (the records in the ring are lost)
- JO_CD_DRIVE_PAUSE: Drive status: the drive is paused
- JO_CD_DRIVE_PLAY: Drive status: the drive is playing (audio or data)
glow.h: Jo Engine glows
In the makefile of the game: JO_COMPILE_WITH_3D_MODULE = 1.
- JO_3D_GLOW_MAX: Max glows (lamps)
- jo_3d_glow_shape: Shapes of the glows (see jo_3d_glow_set_shape())
- jo_3d_glow_mode: Where the glows are drawn (see jo_3d_glows_set_mode())
- jo_3d_glow_add(const jo_pos3D_fixed * const position, const unsigned char r, const unsigned char g, const unsigned char b, const int radius, const int intensity) -> int: Add a glow
- jo_3d_glow_set_shape(const int id, const jo_3d_glow_shape shape, const int width, const int height) -> void: Change the shape of a glow
- jo_3d_glow_set_anchor(const int id, const bool anchor) -> void: Place a glow to the pixel: the scroll of the layer puts the grid of the cells on it (the glow seen the most otherwise); for a rectangle that must stay on its lamps (the rear lamps of a car: a...
- jo_3d_glow_set_radius(const int id, const int radius) -> void: Change the size of a glow
- jo_3d_glow_set_intensity(const int id, const int intensity) -> void: Change the intensity of a glow (a lamp that flickers, an alarm)
- jo_3d_glow_set_position(const int id, const jo_pos3D_fixed * const position) -> void: Move a glow
- jo_3d_glow_set_color(const int id, const unsigned char r, const unsigned char g, const unsigned char b) -> void: Change the color of a glow
- jo_3d_glows_clear(void) -> void: Remove all the glows
- jo_3d_glows_set_rays(const int light, const int diagonal_light) -> void: The light of the rays of the glows (the star around the disc), before jo_3d_glows_enable() (its characters are built then)
- jo_3d_glows_set_mode(const jo_3d_glow_mode mode) -> void: Where the glows are drawn, before jo_3d_glows_enable() (or the glows turned off and on again)
- JO_3D_GLOW_LAYER_SHOWN: Glows drawn at the same time in the layer (JO_3D_GLOW_LAYER), the brightest ones
- JO_3D_GLOW_LAYER_RECTS: Rectangles of clip in a frame in the layer (JO_3D_GLOW_LAYER, see jo_3d_glows_set_clip()): the glows clipped by another rectangle are not drawn
- jo_3d_glows_enable(const bool enabled) -> bool: Turn the glows on or off: the VDP2 layers (see the remarks of this file: the 3D planes are hidden while they are on)
- jo_3d_glows_set_occlusion(bool (*hit)(const jo_pos3D_fixed * const origin, const jo_pos3D_fixed * const dir, const jo_fixed max_t)) -> void: The walls hide the glows behind them (a ray from the camera to the lamp, a few each frame)
- jo_3d_glows_set_clip(bool (*clip)(const jo_pos3D_fixed * const position, jo_3d_rect * const rect)) -> void: The glows are seen only in a rectangle of the screen: the rectangle where the place of the lamp is seen (a lamp in a room seen through a door: its glow stays in the door, see...
- jo_3d_glows_draw(const jo_pos3D_fixed * const camera) -> void: Place the glows seen from the camera (once per frame, after the camera: its matrix is the current matrix)
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
- JO_TILE_COUNT(TILE_TABLE): Get tile count in table (see Tileset Demo)
- jo_replace_color(const jo_img * const img, const jo_color src_color, const jo_color dest_color) -> void: Add a sprite
- jo_bin_loader(jo_img *img, const char * const sub_dir, const char *const filename, const jo_color transparent_color) -> bool (JO_COMPILE_WITH_FS_MODULE, on by default): Load a BIN image
- jo_sprite_add_bin_tileset(const char * const sub_dir, const char * const filename, const jo_color transparent_color, const jo_tile * const tileset, const unsigned int tile_count) -> int (JO_COMPILE_WITH_FS_MODULE, on by default): Add tileset sprites from a BIN file
- jo_sprite_add_bin(const char * const sub_dir, const char * const filename, const jo_color transparent_color) -> int (JO_COMPILE_WITH_FS_MODULE, on by default): Add a sprite from a BIN file
- jo_sprite_add_bin_4bits_lut(const char * const sub_dir, const char * const filename, const jo_color transparent_color) -> int (JO_COMPILE_WITH_FS_MODULE, on by default): Add a sprite from a BIN file as a 16 colors texture with its color lookup table when it has 14 colors at most (the index 15 is the end code) (see jo_sprite_add_image_4bits_lut(): 4 times less VRAM),...
- jo_sprite_add_image_pack(const char * const sub_dir, const char * const filename, const jo_color transparent_color) -> int (JO_COMPILE_WITH_FS_MODULE, on by default): Add a set of image from a TEX file format
- jo_sprite_add_pack(const char * const filename) -> int (JO_COMPILE_WITH_FS_MODULE, on by default): Add the sprites of a sprite pack: the colors of the tables are RGB (drawn like RGB textures: gouraud shading, half transparency)
- jo_sprite_add_pack_palette(const char * const filename, const int palette_code) -> int (JO_COMPILE_WITH_FS_MODULE, on by default): Add the sprites of a sprite pack whose tables hold palette indexes (1 to 255: the colors of a palette, see jo_palette_load()): the VDP1 writes palette codes, the VDP2 shows them with the colors of...
- jo_sprite_add_pack_bank(const char * const filename, const int palette_code, unsigned short * const color_codes, const int max_count) -> int (JO_COMPILE_WITH_FS_MODULE, on by default): Add the sprites of a sprite pack in color bank mode: no table in the VRAM, the first color of the table of each texture in the file is its sub-palette of 16 colors (0 to 127 of a palette)
- jo_sprite_replace_pack(const char * const filename, const int first_sprite_id) -> bool (JO_COMPILE_WITH_FS_MODULE, on by default): Put the textures of a sprite pack in the place of sprites of the same sizes (another player's colors and face, another set of frames): their pixels, their tables and their anchors, no new sprite
- jo_sprite_add_pack_from_memory(const void * const data, const int length) -> int: Add the sprites of a sprite pack already in the memory (read beforehand by jo_fs_read_file(), kept to be added again quickly: the sprites of a boss freed and added again in the middle of a level)
- jo_bin_loader_from_stream(jo_img *img, char *stream, const jo_color transparent_color) -> bool: Load a BIN image from stream
- jo_sprite_add_bin_from_stream(char *stream, const jo_color transparent_color) -> int: Add a sprite from a BIN file
- jo_free_img(void * const img) -> void: Free an image loaded from CD
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.
- JO_LEVEL_MAX_COPIES: Maximum number of normalized copies of headers and records of a level (older files, see jo_level_get_records())
- jo_level: A loaded level
- jo_level_load(const char * const filename) -> jo_level *: Load a level file (in the current directory of the CD, see jo_fs_cd())
- jo_level_free(jo_level * const level) -> void: Free a level (the pointers given by the functions below are not valid any more)
- jo_level_find_section(const jo_level * const level, const unsigned int id) -> const jo_level_directory_entry *: Find a section (also a section of the game: identifier with a lowercase letter)
- jo_level_section_data(const jo_level * const level, const unsigned int id) -> const void *: Start of a section in the file
- jo_level_get_header(jo_level * const level, const unsigned int id, const unsigned int size, const void * const defaults) -> const void *: Header of a section, with the fields of this engine
- jo_level_get_records(jo_level * const level, const unsigned int id, const unsigned int size, const void * const defaults, unsigned int * const count) -> const void *: Records of a section, with the fields of this engine
- jo_level_get_array(const jo_level * const level, const unsigned int id, const unsigned int offset) -> const void *: Array of a section (an offset field of its header)
- jo_level_string(const jo_level * const level, const unsigned int offset) -> const char *: A string of the level (field of type string)
- JO_LEVEL_HEADER(LEVEL, ID, NAME): Read a header of a section (typed): jo_level_xxx_header *h = JO_LEVEL_HEADER(level, TERR, terr)
- JO_LEVEL_RECORDS(LEVEL, ID, NAME, COUNT): Read the records of a section (typed): jo_level_xxx_record *r = JO_LEVEL_RECORDS(level, PLNT, plnt, &count)
- jo_level_set_textures16_palette(jo_level * const level, const jo_palette * const palette) -> bool: Copy the palette of the textures of 16 colors of a level in a palette
- jo_level_add_textures16(jo_level * const level, const jo_palette * const palette, const int first, const int count, int * const sprite_ids) -> bool: Make the sprites of textures of 16 colors of a level, each one with its color lookup table
- jo_level_set_textures8_palette(jo_level * const level, const jo_palette * const palette) -> bool: Copy the palette of the textures of 256 colors of a level in a palette
- jo_level_add_textures8(jo_level * const level, const int first, const int count, int * const sprite_ids) -> bool: Make the sprites of textures of 256 colors of a level, and of their smaller copies (the sprites after each texture, given to jo_3d_set_texture_mipmap_copies() with the 3D support)
level_format.h
- JO_LEVEL_MAGIC: File magic
- JO_LEVEL_FORMAT_VERSION: Version of the file format (header and directory)
- JO_LEVEL_FLAG_REQUIRED: A reader that doesn't know this section must refuse the file
- JO_LEVEL_NO_STRING: No string (field of type string)
- JO_LEVEL_NO_INDEX: No record (field of type index)
- JO_LEVEL_ID(A, B, C, D): Identifier of a section from its 4 characters
- jo_level_file_header: File header (16 bytes)
- jo_level_directory_entry: Directory entry (one per section, after the file header) (24 bytes)
- jo_level_info_header: Level: header (8 bytes)
- JO_LEVEL_INFO_HEADER_DEFAULTS: Default values (the fields missing in an older file, see jo_level_get_records())
- jo_level_terr_header: Terrain: header (28 bytes)
- JO_LEVEL_TERR_HEADER_DEFAULTS: Default values (the fields missing in an older file, see jo_level_get_records())
- jo_level_plnt_record: Plants: record (20 bytes)
- JO_LEVEL_PLNT_RECORD_DEFAULTS: Default values (the fields missing in an older file, see jo_level_get_records())
- jo_level_modl_record: Models: record (20 bytes)
- JO_LEVEL_MODL_RECORD_DEFAULTS: Default values (the fields missing in an older file, see jo_level_get_records())
- jo_level_mbox_record: Collision boxes: record (8 bytes)
- JO_LEVEL_MBOX_RECORD_DEFAULTS: Default values (the fields missing in an older file, see jo_level_get_records())
- jo_level_inst_record: Instances: record (24 bytes)
- JO_LEVEL_INST_RECORD_DEFAULTS: Default values (the fields missing in an older file, see jo_level_get_records())
- jo_level_decl_record: Decals: record (16 bytes)
- JO_LEVEL_DECL_RECORD_DEFAULTS: Default values (the fields missing in an older file, see jo_level_get_records())
- jo_level_enti_record: Entities: record (44 bytes)
- JO_LEVEL_ENTI_RECORD_DEFAULTS: Default values (the fields missing in an older file, see jo_level_get_records())
- jo_level_prop_record: Properties: record (12 bytes)
- JO_LEVEL_PROP_RECORD_DEFAULTS: Default values (the fields missing in an older file, see jo_level_get_records())
- jo_level_link_record: Links: record (12 bytes)
- JO_LEVEL_LINK_RECORD_DEFAULTS: Default values (the fields missing in an older file, see jo_level_get_records())
- jo_level_cell_record: Cells: record (40 bytes)
- JO_LEVEL_CELL_RECORD_DEFAULTS: Default values (the fields missing in an older file, see jo_level_get_records())
- jo_level_prtl_record: Portals: record (52 bytes)
- JO_LEVEL_PRTL_RECORD_DEFAULTS: Default values (the fields missing in an older file, see jo_level_get_records())
- jo_level_weap_record: Weapons: record (76 bytes)
- JO_LEVEL_WEAP_RECORD_DEFAULTS: Default values (the fields missing in an older file, see jo_level_get_records())
- jo_level_tx16_header: Textures of 16 colors: header (16 bytes)
- JO_LEVEL_TX16_HEADER_DEFAULTS: Default values (the fields missing in an older file, see jo_level_get_records())
- jo_level_tx16_record: Textures of 16 colors: record (44 bytes)
- JO_LEVEL_TX16_RECORD_DEFAULTS: Default values (the fields missing in an older file, see jo_level_get_records())
- jo_level_tx08_header: Textures of 256 colors: header (16 bytes)
- JO_LEVEL_TX08_HEADER_DEFAULTS: Default values (the fields missing in an older file, see jo_level_get_records())
- jo_level_tx08_record: Textures of 256 colors: record (12 bytes)
- JO_LEVEL_TX08_RECORD_DEFAULTS: Default values (the fields missing in an older file, see jo_level_get_records())
- JO_LEVEL_EVENT_TRIGGER: Events of an entity (LINK.event): what happened to the source
- JO_LEVEL_ACTION_TRIGGER: Actions sent to an entity (LINK.action): what the target does
- JO_LEVEL_CELL_SLOPE_FLAT: Floors of the cells (CELL.slope)
- JO_LEVEL_PORTAL_DOOR: Kinds of portals (PRTL.kind)
- JO_LEVEL_PROPERTY_INT: Types of the properties of the entities (PROP.type)
- JO_LEVEL_ENTITY_FLAG_DISABLED: Flags of the entities (ENTI.flags)
light.h: Jo Engine point lights
In the makefile of the game: JO_COMPILE_WITH_3D_MODULE = 1.
- JO_MAX_POINT_LIGHTS: Point lights at most
- JO_MAX_POINT_LIGHT_MESHES: Meshes lit by the point lights at most
- JO_POINT_LIGHT_STRENGTH_DEFAULT: Strength of a light that doubles the color of a polygon in front of it (gouraud: 16 is the color of the texture, a light of this strength adds 16)
- jo_3d_point_light_add(const jo_pos3D_fixed * const position, const unsigned char r, const unsigned char g, const unsigned char b, const int radius, const int strength) -> int: Add a point light
- jo_3d_point_light_set_intensity(const int id, const int intensity) -> void: Intensity of a light (a flicker, a pulse: cheap)
- jo_3d_point_light_set_color(const int id, const unsigned char r, const unsigned char g, const unsigned char b) -> void: Color of a light (cheap)
- jo_3d_point_light_set_position(const int id, const jo_pos3D_fixed * const position) -> void: Move a light (its light is computed again on all the meshes: costly)
- jo_3d_point_light_set_spot(const int id, const jo_pos3D_fixed * const direction, const int angle) -> void: A spot light (a torch, a lamp with a shade): the light goes in a cone; or all around (a bulb, the default)
- jo_3d_point_light_set_shadows(const int id, const bool shadows) -> void: Shadows of a light (on by default when jo_3d_point_lights_set_occlusion() is set): off for a light that moves at each frame (a muzzle flash, an explosion): its light is computed again faster (no ray)
- jo_3d_point_light_set_sampled(const int id, const bool sampled) -> void: Light of a light seen by jo_3d_point_lights_sample() (the objects, the weapon of the player): on by default; off for a light that is only a sheen on the walls (a torch on the camera would light the...
- jo_3d_point_light_enable(const int id, const bool enabled) -> void: Switch a light on or off (cheap)
- jo_3d_point_lights_enable(const bool enabled) -> void: The point lights on or off (off: the meshes get their colors back)
- jo_3d_point_lights_add_mesh(jo_3d_mesh * const mesh) -> bool: Add a mesh lit by the point lights: its points in world coordinates (a mesh drawn without a matrix of its own), its polygons with gouraud tables (JO_VDP1_COLOR_CALC_GOURAUD). Its gouraud tables are...
- jo_3d_point_lights_set_mesh_seen(const jo_3d_mesh * const mesh, const bool seen) -> void: A mesh is seen or not in this frame (for instance the cells drawn, see jo_cells_prepare()): the light changes of the meshes not seen are applied when they are seen again (a light that pulses costs...
- jo_3d_point_lights_set_occlusion(bool (*hit)(const jo_pos3D_fixed * const origin, const jo_pos3D_fixed * const dir, const jo_fixed max_t)) -> void: Shadows: a function that tells if a ray hits a wall (for instance the walls of the cells, see jo_cells_add_point_light_meshes()), JO_NULL: no shadow
- jo_3d_point_lights_update(void) -> void: Write the gouraud tables changed by the lights (computes the light of the lights added or moved first): once per frame, before the meshes are drawn
- jo_3d_point_lights_sample(const jo_pos3D_fixed * const position, int * const r, int * const g, int * const b) -> void: The light of the lights at a point (for an object that moves: a character, a weapon, see jo_3d_set_tint())
- jo_3d_point_lights_clear(void) -> void: Remove the lights and the meshes (the gouraud tables get their colors back): before the meshes are freed
list.h: Jo Engine Linked list helper
- typedef struct __jo_node jo_node: Node type
- typedef void (*jo_node_callback)(jo_node *node): Callback for jo_list_foreach()
- typedef bool (*jo_node_any_callback)(jo_node *node, void *extra): Callback for jo_list_any()
- jo_list_data: Node data (4 bytes)
- jo_list: List struct
- jo_list_init(jo_list * const list) -> void: Init a list
- jo_list_insert_at(jo_list * const list, const jo_list_data data, const int index) -> jo_node *: Insert an item on the list at specific index
- jo_list_add(jo_list * const list, const jo_list_data data) -> jo_node *: Add an item on the list
- jo_list_add_ptr(jo_list * const list, void *ptr) -> jo_node *: Add a pointer on the list
- jo_list_remove(jo_list * const list, const jo_node * const node_to_delete) -> void: Remove an item on the list
- jo_list_at(jo_list * const list, int index) -> jo_node *: Get node at index
- jo_list_remove_at(jo_list * const list, const int index) -> void: Remove an item on the list from index
- jo_list_free_and_remove(jo_list * const list, const jo_node * const node_to_delete) -> void: Free node pointer and remove the item from the list
- jo_list_free_and_clear(jo_list * const list) -> void: Free node pointers and remove all item
- jo_list_free_and_remove_last(jo_list * const list) -> void: Free and remove the last item from the list
- jo_list_remove_last(jo_list * const list) -> void: Free and remove the last item from the list
- jo_list_free_and_remove_first(jo_list * const list) -> void: Free and remove the first item from the list
- jo_list_remove_first(jo_list * const list) -> void: Free and remove the first item from the list
- jo_list_clear(jo_list * const list) -> void: Remove all item
- jo_list_first(jo_list * const list) -> jo_node *: Get first item
- jo_list_last(jo_list * const list) -> jo_node *: Get last item
- jo_list_foreach(jo_list * const list, jo_node_callback callback) -> void: Iterate on the list
- jo_list_any(jo_list * const list, jo_node_any_callback callback, void *extra) -> bool: Find if any element of the list satisfy the condition (callback)
- jo_list_set_allocation_behaviour(jo_list * const list, jo_malloc_behaviour behaviour) -> void: Set list memory allocation behaviour
- jo_list_remove_first_value(jo_list * const list, jo_list_data data) -> bool: Remove the first item on the list that match DATA
- jo_list_remove_all_value(jo_list * const list, jo_list_data data) -> void: Remove all items on the list that match DATA
- jo_list_append(const jo_list * const list, jo_list * const output) -> void: Append all items on the list to output list
malloc.h: Jo Engine Malloc
- JO_MALLOC_MAX_MEMORY_ZONE: Define the total of memory zone available through jo_add_memory_zone()
- jo_extended_ram_cartridge_type: Extended RAM cartridge type
- jo_malloc_behaviour: Malloc behaviour JO_MALLOC_TRY_REUSE_SAME_BLOCK_SIZE | ^ | | Speed efficiency | | V | JO_MALLOC_TRY_REUSE_BLOCK | ^ | | Speed efficiency | | V | JO_FAST_ALLOCATION
- jo_malloc_with_behaviour(unsigned int n, const jo_malloc_behaviour behaviour) -> void *: dynamic memory allocator with specific behaviour
- jo_malloc(unsigned int n) -> void *: dynamic memory allocator
- jo_free(const void * const p) -> void: function frees the memory space pointed to by p
- jo_realloc(void *p, unsigned int n) -> void *: Change the size of a block, its content kept (the smaller of the 2 sizes)
- jo_malloc_aligned(unsigned int n, const unsigned int alignment) -> void *: Allocate a block at an address multiple of an alignment (a buffer read by a DMA, a line of the cache)
- jo_malloc_memory: The memories of jo_malloc_largest_free_block()
- jo_malloc_largest_free_block(const jo_malloc_memory memory) -> unsigned int: The biggest size jo_malloc() can give now in a memory (instead of halving sizes with jo_malloc() and jo_free())
- typedef void (*jo_malloc_walker)(const void *ptr, unsigned int size, bool used, const void *caller, void *user): A block given to the function of jo_malloc_walk()
- jo_malloc_walk(const jo_malloc_walker walker, void * const user) -> void: Call a function for each block of the zones, in their order (a list of the blocks still allocated: the leaks)
- jo_malloc_check(void) -> bool: Check the blocks of the zones: their headers, the free blocks and their lists, the end of the blocks in use (JO_DEBUG: a block written past its end, with an error)
- jo_arena: Arena: a block of jo_malloc() given in parts, all of them freed at once (the data of a level: no fragmentation, no jo_free() for each part)
- jo_arena_create(jo_arena * const arena, const unsigned int size, const jo_malloc_behaviour behaviour) -> bool: Allocate the block of an arena
- jo_arena_alloc(jo_arena * const arena, const unsigned int n) -> void *: Take bytes from an arena (aligned on 4 bytes)
- jo_arena_mark(const jo_arena * const arena) -> void *: The place of an arena now, for jo_arena_release()
- jo_arena_release(jo_arena * const arena, const void * const mark) -> void: Free all the bytes taken from an arena after a mark
- jo_arena_reset(jo_arena * const arena) -> void: Free all the bytes taken from an arena (its block is kept)
- jo_arena_get_free(const jo_arena * const arena) -> unsigned int: Bytes left in an arena
- jo_arena_destroy(jo_arena * const arena) -> void: Give the block of an arena back to jo_malloc()
- jo_reduce_memory_fragmentation(void) -> void: Obsolete and useless (a warning of the compiler for each call): jo_free() already merges a block with the free blocks before and after it, remove the call
- jo_malloc_set_slow_memory_first(const bool enabled) -> void: The next allocations take the slower memories first (the low work RAM, the RAM cartridge given by jo_add_memory_zone()), then the high work RAM when they are full
- jo_add_memory_zone(unsigned char *ptr, const unsigned int size_in_bytes) -> void: Register a memory segment for jo_malloc() usage
- jo_get_extended_ram_cartridge_type(void) -> jo_extended_ram_cartridge_type (JO_COMPILE_WITH_RAM_CARD_MODULE, on by default): Get the extended RAM cartridge type if available
- jo_memory_usage_percent(void) -> int: Get memory usage percent
- jo_memory_fragmentation(void) -> int: Get memory fragmentation (Number of fragment in memory)
map.h: Jo Engine MAP file (sprite map)
- JO_MAP_NO_COLLISION: Value returned by jo_map_hitbox_detection_custom_boundaries();
- jo_map_per_pixel_vertical_collision(const unsigned int layer, int x, int y, unsigned char *attribute) -> int: Method to get vertical distance between our point (x, y) and the surface of the map (example: hill)
- jo_map_hitbox_detection_custom_boundaries(const unsigned int layer, const int x, const int y, const int w, const int h) -> int: Fast method to get if a square intersects with the map (HitBox processing) based on screen coord
- jo_map_load_from_file(const unsigned int layer, const short depth, const char * const sub_dir, const char * const filename) -> bool (JO_COMPILE_WITH_FS_MODULE, on by default): Load a sprite map on a specific layer using MAP file format
- jo_map_create(const unsigned int layer, const unsigned short max_tile_count, const short depth) -> bool: Create a new sprite map
- jo_map_add_tile(const unsigned int layer, const short x, const short y, #if JO_MAX_SPRITE > 255 const unsigned short sprite_id, #else const unsigned char sprite_id, #endif const unsigned char attribute) -> void: Add a tile on the specific layer
- jo_map_add_animated_tile(const unsigned int layer, const short x, const short y, const unsigned char anim_id, const unsigned char attribute) -> void: Add an animated tile on the specific layer
- jo_map_free(const unsigned int layer) -> void: Destroy the specific layer
- jo_map_draw(const unsigned int layer, const short screen_x, const short screen_y) -> void: Display the specific layer
- jo_map_draw_background(const unsigned int layer, const short x, const short y) -> void: Draw the specific layer on the background (NBG1)
- jo_vdp2_map_draw_nbg1(const unsigned int layer, const short x, const short y) -> void: Draw the specific layer on the background (NBG1)
- jo_map_scroll_background(const unsigned int layer, const short x, const short y, const jo_color clear_color) -> void: Draw the specific layer on the background (NBG1) using the hardware scroll (no flickering)
- jo_vdp2_map_scroll_nbg1(const unsigned int layer, const short x, const short y, const jo_color clear_color) -> void: Draw the specific layer on the background (NBG1) using the hardware scroll (no flickering)
- jo_map_move_tiles_by_attribute(const unsigned int layer, const unsigned char attribute_filter, const short incr_x, const short incr_y) -> void: Move specific tiles by their attributes
math.h: Jo Engine Math tools
- JO_PI: PI value
- JO_PI_2: PI/2 value
- JO_MULT_BY_2(X): Multiply a variable by 2
- JO_MULT_BY_4(X): Multiply a variable by 4
- JO_MULT_BY_8(X): Multiply a variable by 8
- JO_MULT_BY_16(X): Multiply a variable by 16
- JO_MULT_BY_32(X): Multiply a variable by 32
- JO_MULT_BY_64(X): Multiply a variable by 64
- JO_MULT_BY_128(X): Multiply a variable by 128
- JO_MULT_BY_256(X): Multiply a variable by 256
- JO_MULT_BY_512(X): Multiply a variable by 512
- JO_MULT_BY_1024(X): Multiply a variable by 1024
- JO_MULT_BY_2048(X): Multiply a variable by 2048
- JO_MULT_BY_4096(X): Multiply a variable by 4096
- JO_MULT_BY_32768(X): Multiply a variable by 32768
- JO_MULT_BY_65536(X): Multiply a variable by 65536
- JO_DIV_BY_2(X): Divide a variable by 2
- JO_DIV_BY_4(X): Divide a variable by 4
- JO_DIV_BY_8(X): Divide a variable by 8
- JO_DIV_BY_16(X): Divide a variable by 16
- JO_DIV_BY_32(X): Divide a variable by 32
- JO_DIV_BY_64(X): Divide a variable by 64
- JO_DIV_BY_128(X): Divide a variable by 128
- JO_DIV_BY_256(X): Divide a variable by 256
- JO_DIV_BY_512(X): Divide a variable by 512
- JO_DIV_BY_1024(X): Divide a variable by 1024
- JO_DIV_BY_32768(X): Divide a variable by 32768
- JO_DIV_BY_65536(X): Divide a variable by 65536
- JO_DIV_BY_2147483648(X): Divide a variable by 2147483648
- JO_ZERO(X): Set a variable to zero
- JO_MOD_POW2(N, M): Fast modulo of a power of 2
- JO_IS_POW2(N): Fast check if N of a power of 2
- JO_ABS(X): Get the absolute value of X
- JO_FABS(X): Get the absolute value of X
- JO_MIN(A, B): Get the smaller value between A and B
- JO_MAX(A, B): Get the bigger value between A and B
- JO_CLAMP(X, MIN, MAX): Keep X between MIN and MAX
- JO_CHANGE_SIGN(X): Change the sign of X
- JO_FLOAT_EPSILON: Float minimum positive value
- JO_FLOAT_NEARLY_EQUALS(A, B): Check if A and B is nearly the same value
- JO_IS_FLOAT_NULL(A): Check if A nearly equals zero
- JO_RAD_TO_DEG(A): Convert radians to degrees
- JO_DEG_TO_RAD(A): Convert degrees to radians
- JO_IS_ODD(A): Check if A is odd
- JO_SWAP(A, B): Swap A and B values
- JO_OPAQUE(VAR): Hide the value of a variable from the optimizer of the compiler (no instruction)
- JO_PERCENT_USED(TOTAL, FREE): Compute percent ((TOTAL - FREE) x 100 / TOTAL, rounded down)
- JO_SQUARE(A): Square computation (x²)
- JO_BCD_INT(BCD): BCD to integer
- JO_SET_FLAGS(BYTEFIELD, FLAGS): Set flags in bytefield
- JO_SET_ALL_FLAGS(BYTEFIELD): Set all flags in bytefield
- JO_ADD_FLAG(BYTEFIELD, FLAG): Add flag in bytefield
- JO_REMOVE_FLAG(BYTEFIELD, FLAG): Remove flag in bytefield
- JO_REMOVE_ALL_FLAGS(BYTEFIELD): Remove all flags in bytefield
- JO_HAS_FLAG(BYTEFIELD, FLAG): Check if flag is checked in bytefield
- JO_FIXED_0: Fixed floating point value for 0
- JO_FIXED_1_DIV_2: Fixed floating point value for 0.5
- JO_FIXED_ALMOST_1: Fixed floating point value for 0.999
- JO_FIXED_1: Fixed floating point value for 1
- JO_FIXED_2: Fixed floating point value for 2
- JO_FIXED_3: Fixed floating point value for 3
- JO_FIXED_4: Fixed floating point value for 4
- JO_FIXED_8: Fixed floating point value for 8
- JO_FIXED_16: Fixed floating point value for 16
- JO_FIXED_32: Fixed floating point value for 32
- JO_FIXED_120: Fixed floating point value for 120
- JO_FIXED_150: Fixed floating point value for 150
- JO_FIXED_180: Fixed floating point value for 180
- JO_FIXED_360: Fixed floating point value for 360
- JO_FIXED_MIN: Fixed floating point value for -32767.99998
- JO_FIXED_MAX: Fixed floating point value for +32767.99998
- JO_FIXED_EPSILON: Jo Fixed minimum positive value
- JO_FIXED_OVERFLOW: Indicate an overflow error
- JO_FIXED_PI: Fixed value of PI
- JO_FIXED_PI_2: Fixed value of 2 PI
- JO_FIXED_180_DIV_PI: Fixed value of 180/PI
- JO_FIXED_PI_DIV_180: Fixed value of PI/180
- JO_FIXED_PI_DIV_2: Fixed value of PI/2
- JO_FIXED_PI_OVER_2: Fixed value of PI/2
- JO_FIXED_3_PI_OVER_2: Fixed value of 3 PI / 2
- JO_FIXED_1_DIV: Fixed value of 1/65536
- JO_INT_TO_FIXED(X): Convert int to jo_fixed
- JO_FIXED_TO_INT(X): Convert jo_fixed to int
- JO_FIXED_DECIMAL_MASK: Decimal part mask of a jo_fixed
- JO_FLOAT_TO_FIXED(X): Convert a float to jo_fixed
- JO_DEG_TO_ANGLE(X): Convert a degree to jo_angle
- JO_ANGLE_TURN: A whole turn in jo_angle units (65536: a jo_angle wraps around after it)
- JO_RAD_TO_ANGLE(X): Convert a radian to jo_angle
- jo_int2fixed(const int x) -> jo_fixed: Convert int to jo engine fixed
- jo_fixed2int(const jo_fixed x) -> int: Convert jo engine fixed to int
- jo_float2fixed(const float x) -> jo_fixed (float: emulated in software, slow): Convert float to jo engine fixed (avoid usage of GCC Soft Float)
- jo_fixed2float(const jo_fixed x) -> float (float: emulated in software, slow): Convert jo engine fixed to float
- jo_fixed_wrap_to_pi(jo_fixed rad) -> jo_fixed: Wrap rad in [−pi pi]
- jo_fixed_wrap_to_180(jo_fixed deg) -> jo_fixed: Wrap deg in [-180 180]
- jo_fixed_pow(jo_fixed x, jo_fixed y) -> jo_fixed: x raised to the power of the integer part of y
- jo_fixed_mult(const jo_fixed x, const jo_fixed y) -> jo_fixed: Multiply to fixed number
- jo_fixed_mult_to_int(const jo_fixed x, const jo_fixed y) -> int: Multiply to fixed number and keep the integer part: jo_fixed2int(jo_fixed_mult(x, y)), without overflow
- jo_fixed_dot(const jo_fixed ptA[3], const jo_fixed ptB[3]) -> jo_fixed: Dot product two fixed 3D points
- jo_fixed_div(const jo_fixed dividend, const jo_fixed divisor) -> jo_fixed: Divide fixed-point numbers (expresses dividend / divisor)
- jo_int_div(const int dividend, const int divisor) -> int: Divide 2 integers (dividend / divisor, rounded toward 0 as in C)
- jo_uint_div(const unsigned int dividend, const unsigned int divisor) -> unsigned int: Divide 2 unsigned integers (dividend / divisor, rounded down)
- jo_shift_right8(const int x) -> int: Arithmetic right shift by 8 bits (x >> 8, rounded toward minus infinity) of any value
- jo_shift_right8_small(const int x) -> int: Arithmetic right shift by 8 bits (x >> 8) of a value in [-2^23, 2^23) (a 16 bits value x 0 to 256 for example)
- jo_fixed_div_start(const jo_fixed dividend, const jo_fixed divisor) -> void: Start a fixed-point division in the background (see jo_fixed_div_result())
- jo_fixed_div_result(void) -> jo_fixed: Get the result of the division started by jo_fixed_div_start()
- jo_fixed_deg2rad(const jo_fixed deg) -> jo_fixed: Convert fixed degree to fixed radian
- jo_fixed_rad2deg(const jo_fixed rad) -> jo_fixed: Convert fixed radian to fixed degree
- jo_fixed_ceil(const jo_fixed x) -> jo_fixed: Returns the smallest (fixed) integer value greater than or equal to x
- jo_fixed_floor(const jo_fixed x) -> jo_fixed: Returns the largest (fixed) integer value less than or equal to x
- extern int jo_random_seed: Get or set current random seed
- jo_random(int max) -> int: Get a random number
- jo_random_using_multiple(int max, int multiple) -> int: Get a random number with a specific multiple
- jo_random_seeded(unsigned int * const seed) -> int: Get a random number of a sequence of its own (the effects of a game: the same at each run, whatever the other calls of jo_random())
- jo_highest_bit(unsigned int x) -> unsigned int: Index of the highest bit set in a value (31 - number of leading zeros)
- jo_fixed_sqrt(jo_fixed value) -> jo_fixed: Fast Square root using fixed number
- jo_sqrt(unsigned int value) -> unsigned int: Fast square root
- jo_sqrtf(float value) -> float (float: emulated in software, slow): Fast Square root using floating number
- jo_fixed_rsqrt(jo_fixed value) -> jo_fixed: Fast Reciprocal Square root using fixed number
- jo_rsqrt(float value) -> float (float: emulated in software, slow): Fast Reciprocal Square root using floating number
- jo_DEGtoANG(const float deg) -> jo_angle (float: emulated in software, slow): Convert a degree to jo_angle using floating number
- jo_DEGtoANG_int(const int deg) -> jo_angle: Convert a degree to jo_angle using integer
- jo_fixed_rad2ANGLE(const jo_fixed rad) -> jo_angle: Convert fixed radian to jo_angle
- jo_sin_angle(const jo_angle angle) -> jo_fixed: Sinus of an angle (table lookup, fast)
- jo_cos_angle(const jo_angle angle) -> jo_fixed: Cosinus of an angle (table lookup, fast)
- jo_sincos_angle(const jo_angle angle, jo_fixed * const sin_value, jo_fixed * const cos_value) -> void: Sinus and cosinus of the same angle (table lookup, fast)
- jo_fixed_deg2ANGLE(const jo_fixed deg) -> jo_angle: Convert fixed degree to jo_angle
- jo_fixed_sin(const jo_fixed rad) -> jo_fixed: Fast sinus computation using fixed number
- jo_sin(const int deg) -> jo_fixed: Fast sinus computation
- jo_sinf(const int deg) -> float (float: emulated in software, slow): Sinus computation
- jo_sin_rad(const float rad) -> jo_fixed (float: emulated in software, slow): Sinus computation
- jo_sin_radf(const float rad) -> float (float: emulated in software, slow): Sinus computation
- jo_sin_mult(const int value, const int deg) -> int: Fast sinus multiplication
- jo_sinf_mult(const float value, const int deg) -> float (float: emulated in software, slow): Fast sinus multiplication
- jo_fixed_cos(const jo_fixed rad) -> jo_fixed: Fast cosinus computation using fixed number
- jo_cos(const int deg) -> jo_fixed: Fast cosinus computation
- jo_sincos(const int deg, jo_fixed * const sin_value, jo_fixed * const cos_value) -> void: Sinus and cosinus of the same angle in degree (table lookup, fast)
- jo_cosf(const int deg) -> float (float: emulated in software, slow): Cosinus computation
- jo_cos_rad(const float rad) -> jo_fixed (float: emulated in software, slow): Cosinus computation
- jo_cos_radf(const float rad) -> float (float: emulated in software, slow): Cosinus computation
- jo_cos_mult(const int value, const int deg) -> int: Fast cosinus multiplication
- jo_cosf_mult(const float value, const int deg) -> float (float: emulated in software, slow): Fast cosinus multiplication
- jo_tan(const int deg) -> jo_fixed: Fast tangent computation
- jo_tan_angle(const jo_angle angle) -> jo_fixed: Fast tangent of a jo_angle (table lookup and the division unit)
- jo_tanf(const float deg) -> float (float: emulated in software, slow): Tangent computation
- jo_tan_rad(const float rad) -> jo_fixed (float: emulated in software, slow): Tangent computation
- jo_tan_radf(const float rad) -> float (float: emulated in software, slow): Tangent computation
- jo_acos_radf(const float angle) -> float (float: emulated in software, slow): Fast Arc Cosinus computation
- jo_atan2f_rad(const float y, const float x) -> float (float: emulated in software, slow): Fast ATAN2 computation in radian
- jo_atan2f(const float y, const float x) -> int (float: emulated in software, slow): Fast ATAN2 computation in degree
- jo_atan2_angle(const float y, const float x) -> jo_angle (float: emulated in software, slow): ATAN2 as a jo_angle (65536 per turn, like jo_sin_angle() and the rotations of the 3D)
- jo_atan2_fixed(const jo_fixed y, const jo_fixed x) -> jo_angle: ATAN2 as a jo_angle without floating point (fixed numbers)
- jo_atan2_degrees(const jo_fixed y, const jo_fixed x) -> int: ATAN2 in degree without floating point (fixed numbers)
- jo_turn_toward(const int angle, const int target, const int max_step) -> int: Turn an angle toward another angle, by the shortest way
- jo_angle_turn_toward(const jo_angle angle, const jo_angle target, const jo_angle max_step) -> jo_angle: Turn a jo_angle toward another one, by the shortest way
- jo_angle_to_direction(const jo_angle angle, const int directions, bool * const flip) -> int: The sprite of an angle among sprites drawn in directions directions, the left half mirrored (a vehicle, a character seen from above): the sprites 0 to directions / 2 go from the angle 0 to a half...
- jo_vector_fixed_compute_bezier_point(const jo_fixed t, jo_vector_fixed p0, jo_vector_fixed p1, jo_vector_fixed p2, jo_vector_fixed p3, jo_vector_fixed *result) -> void: Compute cubic bezier curve point for vectors (using fixed numbers)
- jo_vector_fixed_add(const jo_vector_fixed * const a, const jo_vector_fixed * const b, jo_vector_fixed * const result) -> void: Add 2 vectors (using fixed numbers)
- jo_vector_fixed_muls(const jo_vector_fixed * const a, const jo_fixed s, jo_vector_fixed * const result) -> void: Multiply value to vector (using fixed numbers)
- jo_vector_fixed_sub(const jo_vector_fixed * const a, const jo_vector_fixed * const b, jo_vector_fixed * const result) -> void: Subtract 2 vectors (using fixed numbers)
- jo_vector_fixed_dot(const jo_vector_fixed * const a, const jo_vector_fixed * const b) -> jo_fixed: Dot product of 2 vectors (using fixed numbers)
- jo_vector_fixed_cross(const jo_vector_fixed * const a, const jo_vector_fixed * const b, jo_vector_fixed * const result) -> void: Cross product of 2 vectors (using fixed numbers)
- jo_vector_fixed_length(const jo_vector_fixed * const a) -> jo_fixed: Length of a vector (using fixed numbers)
- jo_vector_fixed_normalize(const jo_vector_fixed * const a, jo_vector_fixed * const result) -> void: Normalize a vector (using fixed numbers)
- jo_vector4_fixed_add(const jo_vector4_fixed * const a, const jo_vector4_fixed * const b, jo_vector4_fixed * const result) -> void: Add 2 vectors4 (using fixed numbers)
- jo_vector4_fixed_sub(const jo_vector4_fixed * const a, const jo_vector4_fixed * const b, jo_vector4_fixed * const result) -> void: Subtract 2 vectors4 (using fixed numbers)
- jo_vector4_fixed_cross(const jo_vector4_fixed * const a, const jo_vector4_fixed * const b, jo_vector4_fixed * const result) -> void: Cross product of 2 vectors4 (using fixed numbers)
- jo_vector4_fixed_dot(const jo_vector4_fixed * const a, const jo_vector4_fixed * const b) -> jo_fixed: Dot product of 2 vectors4 (using fixed numbers)
- jo_vector4_swap(jo_vector4_fixed * const a, jo_vector4_fixed * const b) -> void: Swap 2 vectors4 (using fixed numbers)
- jo_vectorf_compute_bezier_point(const float t, jo_vectorf p0, jo_vectorf p1, jo_vectorf p2, jo_vectorf p3, jo_vectorf *result) -> void (float: emulated in software, slow): Compute cubic bezier curve point for vectors (using floating numbers)
- jo_vectorf_add(const jo_vectorf * const a, const jo_vectorf * const b, jo_vectorf * const result) -> void: Add 2 vectors (using floating numbers)
- jo_vectorf_adds(const jo_vectorf * const a, const float s, jo_vectorf * const result) -> void (float: emulated in software, slow): Add value to vector (using floating numbers)
- jo_vectorf_sub(const jo_vectorf * const a, const jo_vectorf * const b, jo_vectorf * const result) -> void: Subtract 2 vectors (using floating numbers)
- jo_vectorf_subs(const jo_vectorf * const a, const float s, jo_vectorf * const result) -> void (float: emulated in software, slow): Subtract value to vector (using floating numbers)
- jo_vectorf_mul(const jo_vectorf * const a, const jo_vectorf * const b, jo_vectorf * const result) -> void: Multiply 2 vectors (using floating numbers)
- jo_vectorf_muls(const jo_vectorf * const a, const float s, jo_vectorf * const result) -> void (float: emulated in software, slow): Multiply value to vector (using floating numbers)
- jo_vectorf_div(const jo_vectorf * const a, const jo_vectorf * const b, jo_vectorf * const result) -> void: Divide 2 vectors (using floating numbers)
- jo_vectorf_divs(const jo_vectorf * const a, const float s, jo_vectorf * const result) -> void (float: emulated in software, slow): Divide value to vector (using floating numbers)
- jo_vectorf_length(const jo_vectorf * const a) -> float (float: emulated in software, slow): Get the length of a vector (using floating numbers)
- jo_vectorf_dot(const jo_vectorf * const a, const jo_vectorf * const b) -> float (float: emulated in software, slow): Get the dot product of 2 vectors (using floating numbers)
- jo_vectorf_normalize(const jo_vectorf * const a, jo_vectorf * const result) -> void: Normalize a vector (using floating numbers)
- jo_vectorf_proj(const jo_vectorf * const v, const jo_vectorf * const onto, jo_vectorf * const result) -> void: Compute projection vector (using floating numbers)
- jo_vectorf_cross(const jo_vectorf * const a, const jo_vectorf * const b, jo_vectorf * const result) -> void: Cross 2 vectors (using floating numbers)
- jo_vectorf_angle_between_radf(const jo_vectorf * const a, const jo_vectorf * const b) -> float (float: emulated in software, slow): Get the angle between 2 vectors (using floating numbers)
- jo_matrix_identity(jo_matrix * const result) -> void: Creates the identity matrix (using fixed numbers)
- jo_matrixf_identity(jo_matrixf * const result) -> void: Creates the identity matrix (using floating numbers)
- jo_matrix_translation(const jo_vector_fixed * const offset, jo_matrix * const result) -> void: Creates translation matrix (using fixed numbers)
- jo_matrixf_translation(const jo_vectorf * const offset, jo_matrixf * const result) -> void: Creates translation matrix (using floating numbers)
- jo_matrix_scaling(const jo_vector_fixed * const scale, jo_matrix * const result) -> void: Creates scaling matrix (using fixed numbers)
- jo_matrixf_scaling(const jo_vectorf * const scale, jo_matrixf * const result) -> void: Creates scaling matrix (using floating numbers)
- jo_matrix_rotation_x_angle(const jo_angle angle, jo_matrix * const result) -> void: Rotation matrix around the X axis (using fixed numbers)
- jo_matrix_rotation_x_rad(const float angle_in_rad, jo_matrix * const result) -> void (float: emulated in software, slow): Rotation matrix around the X axis (radian, using floating numbers: converted, then jo_matrix_rotation_x_angle())
- jo_matrixf_rotation_x_rad(const float angle_in_rad, jo_matrixf * const result) -> void (float: emulated in software, slow): Creates rotating matrix (X axis) (using floating numbers)
- jo_matrix_rotation_y_angle(const jo_angle angle, jo_matrix * const result) -> void: Rotation matrix around the Y axis (using fixed numbers)
- jo_matrix_rotation_y_rad(const float angle_in_rad, jo_matrix * const result) -> void (float: emulated in software, slow): Rotation matrix around the Y axis (radian, using floating numbers: converted, then jo_matrix_rotation_y_angle())
- jo_matrixf_rotation_y_rad(const float angle_in_rad, jo_matrixf * const result) -> void (float: emulated in software, slow): Creates rotating matrix (Y axis) (using floating numbers)
- jo_matrix_rotation_z_angle(const jo_angle angle, jo_matrix * const result) -> void: Rotation matrix around the Z axis (using fixed numbers)
- jo_matrix_rotation_z_rad(const float angle_in_rad, jo_matrix * const result) -> void (float: emulated in software, slow): Rotation matrix around the Z axis (radian, using floating numbers: converted, then jo_matrix_rotation_z_angle())
- jo_matrixf_rotation_z_rad(const float angle_in_rad, jo_matrixf * const result) -> void (float: emulated in software, slow): Creates rotating matrix (Z axis) (using floating numbers)
- jo_matrix_transpose(const jo_matrix * const matrix, jo_matrix * const result) -> void: Creates transpose matrix (using fixed numbers)
- jo_matrixf_transpose(const jo_matrixf * const matrix, jo_matrixf * const result) -> void: Creates transpose matrix (using floating numbers)
- jo_matrix_mul_vector4(const jo_matrix * const m, const jo_vector4_fixed * const v, jo_vector4_fixed * const result) -> void: Multiply a matrix by a vector4 (using fixed numbers)
- jo_matrix_mul(const jo_matrix * const a, const jo_matrix * const b, jo_matrix * const result) -> void: Multiply 2 matrix (using fixed numbers)
- jo_matrixf_mul(const jo_matrixf * const a, const jo_matrixf * const b, jo_matrixf * const result) -> void: Multiply 2 matrix (using floating numbers)
- jo_matrixf_rotation(const float angle_in_rad, const jo_vectorf * const axis, jo_matrixf * const result) -> void (float: emulated in software, slow): Creates a matrix to rotate around an axis by a given angle in radiant (using floating numbers)
- jo_matrixf_ortho(const float left, const float right, const float bottom, const float top, const float back, const float front, jo_matrixf * const result) -> void (float: emulated in software, slow): Creates an orthographic projection matrix (using floating numbers)
- jo_matrixf_perspective(const float vertical_field_of_view_in_deg, const float aspect_ratio, const float near_view_distance, const float far_view_distance, jo_matrixf * const result) -> void (float: emulated in software, slow): Creates a perspective projection matrix for a camera (using floating numbers)
- jo_matrixf_look_at(const jo_vectorf * const from, const jo_vectorf * const to, const jo_vectorf * const up, jo_matrixf * const result) -> void: Builds a transformation matrix for a camera (using floating numbers)
- jo_matrixf_invert_affine(const jo_matrixf * const matrix, jo_matrixf * const result) -> void: Inverts an affine transformation matrix (using floating numbers)
- jo_matrixf_mul_pos(const jo_matrixf * const matrix, const jo_vectorf * const position, jo_vectorf * const result) -> void: Multiplies a 4x4 matrix with a 3D vector representing a point in 3D space (using floating numbers)
- jo_matrixf_mul_dir(const jo_matrixf * const matrix, const jo_vectorf * const direction, jo_vectorf * const result) -> void: Multiplies a 4x4 matrix with a 3D vector representing a direction in 3D space (using floating numbers)
- jo_lerp(const jo_fixed v0, const jo_fixed v1, const jo_fixed t) -> jo_fixed: Linear interpolation which guarantees v = v1 when t = 1
- jo_is_float_equals_zero(const float f) -> bool (float: emulated in software, slow): Check if float almost equals 0
- jo_square_intersect(const int x1, const int y1, const int w1, const int h1, const int x2, const int y2, const int w2, const int h2) -> bool: Fast method to get if two square intersects (HitBox processing)
- jo_gcd(int a, int b) -> int: Get the greatest common divisor
- jo_planar_rotate(const jo_pos2D * const point, const jo_pos2D * const origin, const int angle, jo_pos2D * const result) -> void: Rotate a point on the plan with a specific origin
- jo_direction_to_angle(const jo_8_directions direction) -> short: Convert jo_8_directions to angle in degree
mode7.h: Jo Engine Mode7
model.h: 3D models (.JOM files)
In the makefile of the game: JO_COMPILE_WITH_3D_MODULE = 1.
- JO_3D_MODEL_VERSION: Version of the JOM files read by this engine
- JO_3D_MATERIAL_DUAL_PLANE: Material: drawn on both sides (JO_3D_DUAL_PLANE)
- JO_3D_MATERIAL_SORT_MIN: Material: sorted with the nearest point (JO_3D_SORT_MIN)
- JO_3D_MATERIAL_SORT_MAX: Material: sorted with the farthest point (JO_3D_SORT_MAX)
- JO_3D_MATERIAL_SORT_PREVIOUS: Material: sorted with the depth of the previous polygon of the model (JO_3D_SORT_PREVIOUS): a decal drawn over the face before it (a grille, a sign), whatever their nearest points
- JO_3D_MATERIAL_GOURAUD: Material: gouraud shading with the vertex colors ("GOUR" chunk)
- JO_3D_MATERIAL_HALF_TRANSPARENT: Material: half transparent
- JO_3D_MATERIAL_SCREEN_DOORS: Material: screen doors (mesh)
- JO_3D_MATERIAL_LIGHT: Material: lit by the light of the engine (jo_3d_light())
- JO_3D_MATERIAL_FLIP_H: Material: texture flipped horizontally
- JO_3D_MATERIAL_FLIP_V: Material: texture flipped vertically
- JO_3D_MATERIAL_END_CODES: Material: the texture stops each line after its last visible pixel (jo_sprite_add_end_codes())
- JO_3D_MATERIAL_MIPMAPS: Material: smaller copies of the texture far away (jo_3d_set_texture_mipmaps())
- JO_3D_MATERIAL_SUBDIVISION: Material: the polygons near the camera are drawn in parts (jo_3d_set_texture_subdivision())
- JO_3D_MATERIAL_SUBDIVISION_NEAR: Material: only the polygons that cross the near plane are drawn in parts (jo_3d_set_texture_subdivision_near_only(), MTL: jo_subdivision 2)
- JO_3D_MATERIAL_HIGH_SPEED_SHRINK: Material: the VDP1 reads every other texel of a texture drawn smaller than it is (JO_VDP1_HIGH_SPEED_SHRINK, MTL: jo_high_speed_shrink 1; all the textures: jo_3d_set_high_speed_shrink())
- JO_3D_MATERIAL_USER(N): First flag of the program (bits 16 to 31, MTL: jo_user)
- jo_3d_material: Material of a model (the same layout as the file: 32 bytes)
- jo_3d_model_group: Group of a model: OBJ o or g (the same layout as the file: 24 bytes)
- JO_3D_MAX_BONES: Bones of a model at most (jo_3d_pose)
- JO_3D_BONE_NO_GROUP: jo_3d_bone.group: the bone has no polygons
- JO_3D_ANIMATION_LOOP: jo_3d_animation.flags: the last key goes back to the first one
- JO_3D_ANIMATION_TICKS_PER_SECOND: Ticks of the animations per second (the time of jo_3d_model_get_pose())
- jo_3d_bone: Bone of a rigid skeleton (the same layout as the file: 32 bytes)
- jo_3d_animation: Animation of a skeleton (the same layout as the file: 28 bytes)
- JO_3D_MORPH_LOOP: jo_3d_morph.flags: the last frame goes back to the first one
- JO_3D_MORPH_NORMALS: Directions of the normals of the vertex animations (see jo_3d_morph_normal())
- jo_3d_morph: Vertex animation (morph targets: the position of each point at each frame, the same layout as the file: 28 bytes). Unlike a skeleton, the surface bends (a knee, a cloth, a face): see...
- JO_3D_SKIN_ONE: jo_3d_skin_point.weight: 1.0
- jo_3d_skin_point: A point of a skeleton that follows 2 bones (the same layout as the file: 8 bytes): drawn by the bone of its group, moved toward where the other bone puts it (the knee between the thigh and the shin)
- jo_3d_pose: Pose of a skeleton: the angles of the bones (see jo_3d_model_get_pose() and jo_3d_model_draw_pose())
- typedef void (*jo_3d_bone_callback)(const int bone, void * const param, const jo_fixed (* const matrix)[3]): Called by jo_3d_model_draw_pose() after each bone is drawn, with the matrix of the bone (the program draws a weapon in a hand, a muzzle flash...)
- jo_3d_model: 3D model loaded from a JOM file
- jo_3d_create_model_from_memory(const unsigned char * const data, const unsigned int size) -> jo_3d_model *: Create a model from the content of a JOM file
- jo_3d_create_model_in_place(const unsigned char * const data, const unsigned int size) -> jo_3d_model *: Create a model that uses the content of a JOM file in place (like jo_3d_load_model(): the points, the polygons, the materials are not copied): much faster than jo_3d_create_model_from_memory() for...
- jo_3d_model_find_chunk(const void * const data, const char * const tag, unsigned int * const size) -> const unsigned char *: Find a chunk in the content of a JOM file (a chunk of the program too: the loader skips the chunks it doesn't know)
- jo_3d_model_file_gouraud_colors(const void * const data, const unsigned int polygon_count) -> const unsigned short *: The gouraud colors of the polygons in the content of a JOM file ("GOUR" chunk)
- jo_3d_model_gouraud_colors(const jo_3d_model * const model) -> const unsigned short *: The gouraud colors of a model as they were loaded: a game that writes its gouraud tables again (a light on a car) starts from them (its tables in the VRAM may not be written yet)
- jo_3d_model_set_environment(jo_3d_model * const model, const int sprite_id, const int tiles, const unsigned int material_flags) -> bool: Environment map on the polygons of a model whose material has a flag (the paint and the glass of a car, see jo_3d_set_mesh_environment())
- JO_3D_MODEL_POOL_MAX_BLOCKS (JO_COMPILE_WITH_FS_MODULE, on by default): Maximum of memory blocks of a pool of models
- jo_3d_model_pool (JO_COMPILE_WITH_FS_MODULE, on by default): Models read one after the other from a file (the parts of a level) into big memory blocks, used in place (jo_3d_create_model_in_place()): no copy, no small memory blocks for each model. Measured (a...
- jo_3d_model_pool_init(jo_3d_model_pool * const pool, const unsigned int block_size, const unsigned int bytes) -> void (JO_COMPILE_WITH_FS_MODULE, on by default): Start a pool of models
- jo_3d_model_pool_read(jo_3d_model_pool * const pool, jo_file * const file, const unsigned int size) -> jo_3d_model * (JO_COMPILE_WITH_FS_MODULE, on by default): Read the next model of a file (the content of a JOM file, see jo_3d_create_model_in_place()) into a pool
- jo_3d_model_pool_free(jo_3d_model_pool * const pool) -> void (JO_COMPILE_WITH_FS_MODULE, on by default): Free the memory blocks of a pool (after its models: jo_3d_free_model())
- jo_3d_load_model(const char * const filename) -> jo_3d_model * (JO_COMPILE_WITH_FS_MODULE, on by default): Load a model (JOM file) from the current directory of the CD
- jo_3d_model_set_smooth_light(const jo_3d_model * const model, const bool enabled) -> bool (JO_COMPILE_WITH_FS_MODULE, on by default, JO_COMPILE_WITH_3D_SMOOTH_LIGHT_MODULE = 1): Light a model at its vertices: a round shape without the steps of a level of light per polygon (see jo_3d_set_mesh_smooth_light(), JO_COMPILE_WITH_3D_SMOOTH_LIGHT_MODULE = 1 in the makefile)
- jo_3d_set_unique_gouraud_tables(const bool unique) -> void (JO_COMPILE_WITH_FS_MODULE, on by default): The next models created or loaded get a gouraud table per polygon, in the order of the polygons (default: the polygons with the same 4 colors share a table): for a model whose tables the game writes...
- jo_3d_set_neutral_gouraud_skipped(const bool skipped) -> void (JO_COMPILE_WITH_FS_MODULE, on by default): The next models created or loaded draw without gouraud only the polygons whose 4 gouraud colors leave the texels as they are (16, 16, 16 each): the same picture (see...
- jo_3d_set_uniform_gouraud_skipped(const bool skipped) -> void (JO_COMPILE_WITH_FS_MODULE, on by default): The next models created or loaded draw without gouraud the polygons whose 4 gouraud colors are the same (a flat light), the light put in their color: the same picture, the VDP1 draws them faster...
- jo_3d_model_texture(const char * const filename) -> int (JO_COMPILE_WITH_FS_MODULE, on by default): Get the sprite id of a texture of the models (loaded the first time: a texture shared by several models, or by the program, is loaded once)
- jo_3d_model_loaded_texture(const char * const name) -> int (JO_COMPILE_WITH_FS_MODULE, on by default): Get the sprite id of a texture already loaded by the models (embedded in a model, or loaded by jo_3d_model_texture()), without loading it
- jo_3d_free_model(jo_3d_model * const model) -> void: Free a model (the textures stay loaded)
- jo_3d_model_free_textures_from(const int sprite_id) -> void: Free the sprites added since a sprite (the textures of the models loaded since, their tiles and smaller copies, their gouraud tables, the sprites added by the program): the VRAM of the VDP1 is given...
- jo_3d_model_find_group(const jo_3d_model * const model, const char * const name) -> const jo_3d_model_group *: Find a group of a model
- jo_3d_model_find_bone(const jo_3d_model * const model, const char * const name) -> int: Find a bone of a model
- jo_3d_model_find_animation(const jo_3d_model * const model, const char * const name) -> int: Find an animation of a model
- jo_3d_model_is_animation(const jo_3d_model * const model, const int animation, const char * const name) -> bool: Check if an animation is the one jo_3d_model_find_animation() finds for a name (faster: the name of this one is compared, the ones before it only when it matches)
- jo_3d_model_animation_duration(const jo_3d_model * const model, const int animation) -> int: Duration of an animation
- jo_3d_model_get_pose(const jo_3d_model * const model, const int animation, int time, jo_3d_pose * const pose) -> void: Pose of a skeleton at a time of an animation (the keys are interpolated)
- jo_3d_pose_blend(const jo_3d_model * const model, jo_3d_pose * const pose, const jo_3d_pose * const other, const int weight) -> void: Blend 2 poses (a smooth change of animation)
- jo_3d_model_draw_pose(const jo_3d_model * const model, const jo_3d_pose * const pose, const jo_3d_bone_callback callback, void * const param) -> void: Draw a model with a skeleton with the current matrix
- jo_3d_slave_model_draw_pose(const jo_3d_model * const model, const jo_3d_pose * const pose, const jo_3d_bone_callback callback, void * const param, const unsigned int hidden_bones) -> void: Draw a model with a skeleton in a pose on the slave CPU (call it on the slave CPU, see jo_3d_model_draw_pose())
- jo_3d_model_set_hidden_bones(const unsigned int mask) -> void: Bones not drawn by the next jo_3d_model_draw_pose() (a hat shot off the head of a character: its bone hidden, the hat drawn alone where it falls: the other bones hidden)
- jo_3d_model_find_morph(const jo_3d_model * const model, const char * const name) -> int: Find a vertex animation of a model
- jo_3d_model_morph_duration(const jo_3d_model * const model, const int morph) -> int: Duration of a vertex animation
- jo_3d_model_draw_morph(const jo_3d_model * const model, const int morph, const int time) -> void: Draw a model with the current matrix, its points at a time of a vertex animation (the 2 frames around it are interpolated)
- jo_3d_slave_model_draw_morph(const jo_3d_model * const model, const int morph, const int time) -> bool: jo_3d_model_draw_morph() on the slave CPU (call it on the slave CPU: its own buffer, the master CPU can draw the same model at the same time)
- jo_3d_morph_normal(const int index, jo_pos3D_fixed * const normal) -> void: Direction of a normal of the vertex animations (the frames give the normal of each polygon as one byte)
- jo_3d_model_use_fast_memory(jo_3d_model * const model) -> bool: Move what the drawing of a model reads for each vertex, polygon and bone (its points, its polygons, their attributes, its bones and their groups) to the high work RAM, when it is in a slower memory...
- jo_3d_set_model_culling(const bool enabled) -> void: jo_3d_model_draw() skips the models whose bounding sphere can't be seen (see jo_3d_model_is_seen())
- jo_3d_model_is_seen(const jo_3d_model * const model) -> bool: Check if the bounding sphere of a model (see jo_3d_model) can be seen with the current matrix in the current window (see jo_3d_is_bounding_sphere_seen())
- jo_3d_set_model_polygon_indexes(const bool enabled) -> void: The models created from now on get a copy of the vertex indexes of their polygons (see jo_3d_set_polygon_indexes()): 8 bytes per polygon, fewer cache misses for the polygons drawn often (the track of...
- jo_3d_model_draw(const jo_3d_model * const model) -> void: Draw a model with the current matrix
palette.h: Jo Engine Palette Handling
- JO_PALETTE_MAX_COLORS: Define the maximum of color entry available on each palette
- jo_create_palette(jo_palette * const output) -> void: Create a new palette with 255 entries maximum
- jo_palette_load(const char * const filename, jo_palette * const palette) -> bool (JO_COMPILE_WITH_FS_MODULE, on by default): Read the colors of a palette file ("JPL1", written by Compiler/COMMON/jo_sprite_pack.py, see Documentation/sprite_pack_format.md) into a palette: the colors of the sprite packs whose tables hold...
- jo_palette_set_light_shades(jo_palette * const palette, const int first, const jo_color * const colors, const int count, const int levels) -> void: Write the shades of colors in a palette for the palette lighting (see jo_3d_set_palette_light()): the shade s (0 = the darkest, levels - 1 = the brightest) of the color i is the index first + s *...
- JO_PALETTE_LIGHT_COLOR(PALETTE_ID, FIRST, I): Color code of the color i of the shades written by jo_palette_set_light_shades() (its darkest shade)
- jo_palette_color(const jo_palette * const palette, const int index) -> jo_color: Color code of a color of a palette: a polygon of this color (jo_3d_set_mesh_polygon_color()) has the color of the palette, in all the modes
- jo_palette_set_colors(const jo_palette * const palette, const int index, const jo_color * const colors, const int count) -> void: Change colors of a palette with the image of the frame: in a callback of jo_core_run(), the colors are written in the color RAM at the VBLANK where the VDP1 displays the sprites of this frame (1 or 2...
- jo_palette_to_cram(unsigned short * restrict data, unsigned short * restrict cram_addr, unsigned int size) -> void: Copies the image palette data to CRAM
- jo_create_palette_from(jo_palette * const output, unsigned short *data, unsigned int size) -> void: Create a new palette from existing data
- jo_palette_set_subpalette(const jo_palette * const palette, const int subpalette_id, const jo_color * const colors) -> void: Write the colors of a sub-palette of 16 colors of a palette, for the 16 colors sprites in color bank mode (jo_sprite_add_4bits_image(), jo_sprite_set_palette_4bits())
- jo_set_palette_register(const unsigned short palette_index, const jo_color color) -> void: Set palette index color
- jo_get_palette_register(const unsigned short palette_index) -> jo_color: Get palette color from index
- jo_set_printf_palette_color(const unsigned short index, const unsigned short color) -> void (JO_COMPILE_WITH_PRINTF_MODULE, on by default): Set foreground palette color for the specific index
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)
- JO_VDP1_VRAM: VDP1 VRAM (512 kilobytes)
- JO_VDP1_FB: VDP1 Frame buffer (256 kilobytes)
- JO_VDP1_FB_WIDTH: Width of a line of the VDP1 frame buffer (pixels, 16 bits per pixel), whatever the width of the screen
- JO_VDP1_REG: VDP1 I/O register address
- JO_VDP1_LAST_REG: Last VDP1 I/O register address
- JO_VDP1_TVMR: TV mode selection
- JO_VDP1_FBCR: Controls the frame buffer
- JO_VDP1_PTMR: Plot trigger
- JO_VDP1_EWDR: Erase/write color
- JO_VDP1_EWLR: Erase/write upper-left position
- JO_VDP1_EWRR: Erase/write lower-right position
- JO_VDP1_ENDR: Force draw end
- JO_VDP1_EDSR: Transfer end status
- JO_VDP1_LOPR: Return the last command table processed
- JO_VDP1_COPR: Return the current command table processed
- JO_VDP1_MODR: Mode status
- JO_VDP1_USER_AREA_SIZE: VDP1 user area size
- JO_VDP1_USER_AREA_END_ADDR: VDP1 user area end address
- JO_VDP1_TEXTURE_DEF_BASE_ADDRESS: VDP1 Sprite base address
- JO_VDP2_REG: VDP2 I/O register address
- JO_VDP2_LAST_REG: Last VDP2 I/O register address
- JO_VDP2_VRAM: VDP2 VRAM (512 kilobytes) = A0 + A1 + B0 + B1
- JO_VDP2_VRAM_A0: VDP2 VRAM Bank A0 (128 kilobytes)
- JO_VDP2_VRAM_A1: VDP2 VRAM Bank A1 (128 kilobytes)
- JO_VDP2_VRAM_B0: VDP2 VRAM Bank B0 (128 kilobytes)
- JO_VDP2_VRAM_B1: VDP2 VRAM Bank B1 (128 kilobytes)
- JO_VDP2_CRAM: VDP2 Color RAM (4 kilobytes)
- JO_PALETTE_MAX: Define the maximum of palette (the 256 colors palettes of the color RAM)
- JO_PALETTE_SUBPALETTE_COLORS: Colors of a sub-palette: a palette is JO_PALETTE_SUBPALETTES sub-palettes of 16 colors, for the 16 colors sprites in color bank mode (jo_sprite_add_4bits_image(), jo_sprite_set_palette_4bits(),...
- JO_PALETTE_SUBPALETTES: Sub-palettes of a palette
- JO_VDP2_BANK_SIZE: VDP2 VRAM Bank size (128 kilobytes)
- JO_VDP2_TVSTAT_PAL: TVSTAT: PAL console (50 Hz)
- JO_VDP2_TVSTAT_ODD: TVSTAT: odd field of an interlace mode
- JO_VDP2_TVSTAT_EXLTFG: TVSTAT: HCNT and VCNT were latched by the external signal (a light gun) since the last read of TVSTAT (the read clears it)
- JO_VDP2_EXTEN_EXLTEN: EXTEN: HCNT and VCNT are latched by the external signal (the light sensor of a light gun, see the EXLE register of the SMPC) instead of the reads of EXTEN
- JO_VDP2_CRAOFB_SPRITE_OFFSET_MASK: CRAOFB: sprite color RAM address offset bits
- JO_VDP2_CRAOFB_SPRITE_OFFSET(N): CRAOFB: sprite color RAM address offset value (0 to 7)
- JO_WORK_RAM_HIGH: High work RAM (1 MB): the fastest memory of the CPUs
- JO_WORK_RAM_LOW: Low work RAM (1 MB): read much slower by the CPUs, no SCU DMA
- JO_WORK_RAM_SIZE: Size of the high or low work RAM
- JO_WORK_RAM_BOOT_ROM: ROM BIOS functions
- JO_WORK_RAM_SLAVE_CPU_STACK_AREA: Slave CPU stack
- JO_WORK_RAM_MASTER_CPU_DEFAULT_STACK: Master CPU stack (used by the boot ROM)
- JO_WORK_RAM_UNKNOWN_USAGE: IP.BIN and boot ROM work area
- JO_WORK_RAM_USER_PROGRAM_AND_DATA: User area
- extern unsigned int _jo_work_start: Start of the engine work area (VDP1 command lists, 3D buffers, etc): after the program and its data (see jo.linker)
- JO_WORK_RAM_USER_PROGRAM_AND_DATA_END: End of the user area (the free high work RAM after the engine work area is given to jo_malloc())
- JO_WORK_RAM_STACK_TOP: Master CPU stack (top)
- JO_WORK_RAM_STACK_BOTTOM: Master CPU stack (bottom, 16 KB, see jo.linker)
- JO_WORK_RAM_SLAVE_STACK_TOP: Slave CPU stack (top)
- JO_RAM_CARTRIDGE_ID: Extended RAM cartridge identifier
- JO_RAM_CARTRIDGE_ID_8MBITS: Extended RAM cartridge identifier: 1 MB (8 Mbits)
- JO_RAM_CARTRIDGE_ID_32MBITS: Extended RAM cartridge identifier: 4 MB (32 Mbits)
- JO_RAM_CARTRIDGE_ENABLE: Extended RAM cartridge: write 1 to enable the RAM (16 bits write)
- JO_RAM_CARTRIDGE_ADDRESS: Extended RAM cartridge: RAM address
- JO_RAM_CARTRIDGE_8MBITS_BANK2_ADDRESS: Extended RAM cartridge 1 MB: second bank address
- JO_RAM_CARTRIDGE_8MBITS_BANK_SIZE: Extended RAM cartridge 1 MB: size of a bank
- JO_RAM_CARTRIDGE_32MBITS_SIZE: Extended RAM cartridge 4 MB: size
- JO_RAM_CARTRIDGE_ASR0: A-bus timings for the extended RAM cartridge (JO_SCU_ASR0)
- JO_RAM_CARTRIDGE_AREF: A-bus refresh for the extended RAM cartridge (JO_SCU_AREF)
- JO_WORK_RAM_ENGINE_WORK_SECTION: Put a variable in the engine work area (not cleared by the program loader, cleared at startup)
- JO_WORK_RAM_ENGINE_WORK_ALIGNED_SECTION: Engine work area, for a buffer aligned on a big boundary (placed first: no hole in the work area)
- JO_SCU_IMS: SCU interrupt mask register
- JO_BIOS_SCU_IMS: Copy of the SCU interrupt mask kept by the BIOS (SYS_GETSCUIM): the interrupt handlers of the BIOS write it to JO_SCU_IMS when they return, it must always be equal to the mask written to JO_SCU_IMS
- JO_BIOS_CHANGE_SYSTEM_CLOCK(CLOCK): Boot ROM routine that changes the system clock (SYS_CHGSYSCK): 0 = 26.8 MHz (320 and 640 pixels width), 1 = 28.6 MHz (352 and 704 pixels width). The VDPs, the SCU and the slave CPU are reset
- JO_BIOS_SYSTEM_CLOCK_320: System clock of the 320 and 640 pixels width modes (see JO_BIOS_CHANGE_SYSTEM_CLOCK())
- JO_BIOS_SYSTEM_CLOCK_352: System clock of the 352 and 704 pixels width modes (see JO_BIOS_CHANGE_SYSTEM_CLOCK())
- JO_SCU_IST: SCU interrupt status register
- JO_SCU_ASR0: SCU A-bus set register 0 (CS0 and CS1 access timings)
- JO_SCU_AREF: SCU A-bus refresh register
- JO_SCU_DMA_READ(N): SCU DMA level N (0 to 2): read address, write address (or indirect table), byte count, address add, enable, mode
- JO_SCU_DMA_STATUS: SCU DMA status register
- JO_SCU_DMA_STATUS_BUSY(N): SCU DMA status: level N in operation
- JO_SCU_DMA_ADD_READ4_WRITE2: SCU DMA add: read address + 4, write address + 2 (B-bus: VDP1, VDP2, sound)
- JO_SCU_DMA_ENABLE_START: SCU DMA enable: enabled and started
- JO_SCU_DMA_MODE_DIRECT: SCU DMA mode: direct mode, started by JO_SCU_DMA_ENABLE_START
- JO_SCU_DMA_MODE_INDIRECT: SCU DMA mode: indirect mode (table of transfers: byte count, write address, read address | 0x80000000 for the last one)
- JO_SCU_DMA_INDIRECT_END: SCU DMA indirect table: end of the table (read address of the last transfer)
- JO_SCU_DMA_INDIRECT_WORDS: SCU DMA indirect table: words of a transfer (byte count, write address, read address)
- JO_SCU_DMA_ADD_READ4_WRITE4: SCU DMA add: read address + 4, write address + 4 (A-bus, work RAM)
- JO_SCU_DMA_ENABLE_ONLY: SCU DMA enable: enabled, started by its start factor (see the modes below)
- JO_SCU_DMA_MODE_INDIRECT_SPRITE_END: SCU DMA mode: indirect mode, started when the VDP1 ends its drawing (start factor "sprite draw end")
- JO_SCU_ADDRESS(ADDR): Address of a memory for the SCU DMA: its physical address (without the cache bits)
- JO_SCU_INT_VBLANK_IN: SCU interrupt mask bits
- JO_VECTOR_VBLANK_IN: SH-2 interrupt vectors used by the SCU
- JO_CACHE_THROUGH(ADDR): Cache-through mirror of an address (to share data between the two CPU)
- JO_SH2_CCR: Cache control register
- JO_SH2_CCR_CACHE_ENABLE: CCR: cache enabled
- JO_SH2_CCR_CACHE_PURGE: CCR: cache purge (all entries invalidated)
- JO_SHARED(VAR): A variable shared by the 2 CPU, read or written through its cache-through mirror (each CPU has its own cache: a value the other CPU wrote may be older in it): JO_SHARED(count) += 1;
- jo_cpu_cache_purge(void) -> void: Purge the whole cache of the CPU that calls it: the data the other CPU wrote are read again from the memory (the cache is write-through: nothing is lost; the cache is disabled while it is purged)
- JO_SH2_SR_INTERRUPT_MASK: Status register: interrupt mask bits (level 15 = all interrupts masked)
- JO_SH2_SR_INTERRUPTS_ON: Status register: all interrupts enabled
- JO_SH2_FRT_TIER: Free running timer: interrupt enable register
- JO_SH2_FRT_FTCSR: Free running timer: control/status register
- JO_SH2_FRT_TIER_NO_INTERRUPT: TIER: all FRT interrupts disabled (bit 0 is always 1)
- JO_SH2_FRT_FTCSR_ICF: FTCSR: input capture flag
- JO_SH2_FRT_FTCSR_OCFA: FTCSR: output compare flag A
- JO_SH2_FRT_TIER_ICIE: TIER: input capture interrupt enabled
- JO_SH2_FRT_TIER_OCIAE: TIER: output compare interrupt A enabled
- JO_SH2_FRT_OCRAH: Free running timer: output compare register A (high byte, see JO_SH2_FRT_TOCR)
- JO_SH2_FRT_OCRAL: Free running timer: output compare register A (low byte, written last)
- JO_SH2_FRT_TOCR: Free running timer: timer output compare control register
- JO_SH2_FRT_TOCR_OCRA: TOCR: output compare register A selected (bits 7 to 5 are always 1)
- JO_SH2_IPRB: Interrupt controller: interrupt priority level setting register B (bits 11 to 8: free running timer)
- JO_SH2_VCRC: Interrupt controller: vector number setting register C (bits 6 to 0: free running timer output compare)
- JO_SH2_DVSR: Division unit: divisor register
- JO_SH2_DVDNT: Division unit: dividend register (32 bits division)
- JO_SH2_DVDNTH: Division unit: dividend register high (64 bits division)
- JO_SH2_DVDNTL: Division unit: dividend register low (64 bits division, writing starts the division, the quotient is read here)
- jo_cpu_pause(void) -> void: A pause of about 40 cycles in a busy wait loop of a CPU that has nothing to do: the CPU waits for a division of its division unit, without any access to the bus (the other CPU, the DMA and the VDP...
- JO_SH2_SAR0: DMA controller channel 0: source address
- JO_SH2_DAR0: DMA controller channel 0: destination address
- JO_SH2_TCR0: DMA controller channel 0: transfer count (in transfer units)
- JO_SH2_CHCR0: DMA controller channel 0: channel control register
- JO_SH2_DMAOR: DMA controller: operation register
- JO_SH2_CHCR_DEST_INCREMENT: CHCR: destination address incremented
- JO_SH2_CHCR_SRC_INCREMENT: CHCR: source address incremented
- JO_SH2_CHCR_SIZE_8: CHCR: transfer unit (byte)
- JO_SH2_CHCR_SIZE_16: CHCR: transfer unit (word)
- JO_SH2_CHCR_SIZE_32: CHCR: transfer unit (long word)
- JO_SH2_CHCR_AUTO_REQUEST: CHCR: auto request (the transfer starts as soon as the channel is enabled, cycle steal mode)
- JO_SH2_CHCR_TRANSFER_END: CHCR: transfer end flag
- JO_SH2_CHCR_ENABLE: CHCR: channel enabled
- JO_SH2_DMAOR_ENABLE: DMAOR: DMA enabled for all the channels
- JO_SH2_CACHE_PURGE_AREA: Cache: associative purge of the line of an address (write 0 at JO_SH2_CACHE_PURGE_AREA | address)
- JO_SH2_CACHE_LINE_SIZE: Cache: line size
- JO_SH2_CACHE_SIZE: Cache: size (bytes)
- JO_SOUND_RAM: Sound RAM (512 kilobytes)
- JO_SCSP_SLOT(SLOT, OFFSET): SCSP slot register
- JO_SCSP_COMMON(OFFSET): SCSP common control register
- JO_SCSP_SLOT_COUNT: SCSP slot count
- JO_SCSP_SLOT_CONTROL: Key on, loop control, 8 bits PCM, start address (high bits)
- JO_SCSP_SLOT_START_ADDRESS: Start address (low 16 bits)
- JO_SCSP_SLOT_LOOP_START: Loop start address (in samples)
- JO_SCSP_SLOT_LOOP_END: Loop end address (in samples)
- JO_SCSP_SLOT_ENVELOPE_ATTACK: Envelope: decay 2 rate, decay 1 rate, attack rate
- JO_SCSP_SLOT_ENVELOPE_RELEASE: Envelope: key rate scaling, decay level, release rate
- JO_SCSP_SLOT_TOTAL_LEVEL: Total level (attenuation)
- JO_SCSP_SLOT_MODULATION: Modulation
- JO_SCSP_SLOT_PITCH: Pitch (octave and frequency number)
- JO_SCSP_SLOT_LFO: LFO
- JO_SCSP_SLOT_DSP_INPUT: DSP input
- JO_SCSP_SLOT_MIXER: Direct and effect send levels and pans
- JO_SCSP_KEY_ON_EXECUTE: Execute key on/off for all slots
- JO_SCSP_KEY_ON: Key on
- JO_SCSP_KEY_MASK: Bits not related to the key on/off
- JO_SCSP_LOOP_NORMAL: Normal loop
- JO_SCSP_PCM_8BITS: 8 bits PCM (16 bits otherwise)
- JO_SCSP_START_ADDRESS_HIGH(ADDR): Start address high bits (address >> 16)
- JO_SCSP_START_ADDRESS_LOW(ADDR): Start address low bits
- JO_SCSP_SOURCE_NOISE: Sound source: the noise generator (SSCTL = 1) instead of the sound RAM
- JO_SCSP_ENVELOPE_ATTACK(AR, D1R, D2R): Envelope register 0x08: decay 2 rate (bits 15-11), decay 1 rate (bits 10-6), attack rate (bits 4-0)
- JO_SCSP_ENVELOPE_RELEASE(RR): Envelope register 0x0A: no key rate scaling (KRS = 0xF: the rates don't depend on the pitch), decay level 0, release rate
- JO_SCSP_MODULATION(MDL, X, Y): Modulation register: modulation level (MDL, 0 to 15: 5 and more modulate), the 2 inputs (MDXSL, MDYSL: the stack of the outputs of the slots: 32 + n is the slot + n, one sample before)
- JO_SCSP_LFO(LFOF, ALFOWS, ALFOS): LFO register: frequency (LFOF: 0 to 31, 0.17 to 96 Hz), the waveform and the depth of the amplitude LFO
- JO_SCSP_LFO_TRIANGLE: LFO waveform: triangle
- JO_SCSP_DSP_SEND(ISEL, IMXL): DSP input register: the mix of the DSP the slot goes to (ISEL, 0 to 15) and its level (IMXL: 0 none, 1 to 7: -36 to 0 dB)
- JO_SCSP_ATTACK_RATE_MAX: Envelope: attack rate maximum (no attack)
- JO_SCSP_RELEASE_RATE_MAX: Envelope: release rate maximum (immediate release)
- JO_SCSP_PITCH(OCT, FNS): Pitch register value
- JO_SCSP_FNS_MAX: Maximum frequency number
- JO_SCSP_FNS_PER_OCTAVE: Frequency number count per octave
- JO_SCSP_BASE_SAMPLING_RATE: Sampling rate at octave 0 and frequency number 0 (Hz)
- JO_SCSP_TOTAL_LEVEL(VOLUME): Total level register value (attenuation) from a volume
- JO_SCSP_DIRECT_LEVEL(LEVEL): Direct send level (0 to 7)
- JO_SCSP_DIRECT_PAN(PAN): Direct pan (5 bits, see JO_SCSP_PAN_xxx)
- JO_SCSP_EFFECT_LEVEL(LEVEL): Effect send level (0 to 7)
- JO_SCSP_EFFECT_PAN(PAN): Effect pan (5 bits, see JO_SCSP_PAN_xxx)
- JO_SCSP_PAN_CENTER: Pan: center
- JO_SCSP_PAN_LEFT_SIDE: Pan: left side flag (bits 3-0: attenuation of the other side)
- JO_SCSP_PAN_RIGHT: Pan: full right
- JO_SCSP_PAN_LEFT: Pan: full left
- JO_SCSP_LEVEL_MAX: Maximum send level
- JO_SCSP_CDDA_LEFT_SLOT: Slot used for the CD audio left channel (EXTS input)
- JO_SCSP_CDDA_RIGHT_SLOT: Slot used for the CD audio right channel (EXTS input)
- JO_SCSP_COMMON_MASTER_VOLUME: Master volume register (MVOL bits 0-3, 16 bits DAC, 4 Mbits sound RAM)
- JO_SCSP_COMMON_RING_BUFFER: Ring buffer of the DSP: its length (bits 8-7: 8K, 16K, 32K, 64K words) and its address (bits 6-0: 8 KB units)
- JO_SCSP_COMMON_MONITOR: Monitor register: the slot monitored (MSLC, bits 15-11, written) and the 4096 samples block it plays (CA, bits 10-7, read)
- JO_SCSP_COMMON_MAIN_INTERRUPT_PENDING: The interrupts of the SCSP pending for the main CPU (MCIPD; the bits are set even when the interrupt isn't enabled)
- JO_SCSP_COMMON_MAIN_INTERRUPT_RESET: Reset of the interrupts of the SCSP pending for the main CPU (MCIRE: a bit written to 1 clears it in MCIPD)
- JO_SCSP_INTERRUPT_SAMPLE: Interrupt of the SCSP at each sample (44.1 kHz; bit of MCIPD and MCIRE)
- JO_SCSP_MONITOR_SLOT(SLOT): The slot monitored (JO_SCSP_COMMON_MONITOR)
- JO_SCSP_MONITOR_BLOCK(VALUE): The 4096 samples block played by the slot monitored (JO_SCSP_COMMON_MONITOR)
- JO_SCSP_DSP_AREA: The registers of the DSP of the SCSP: coefficients (0x700), memory addresses (0x780), program (0x800, 128 steps of 4 words)
- JO_SCSP_DSP_COEF: The coefficients of the DSP (64 words: 13 bits, bits 15-3), offset in JO_SCSP_DSP_AREA
- JO_SCSP_DSP_ADDRESS: The memory addresses of the DSP (32 words), offset in JO_SCSP_DSP_AREA
- JO_SCSP_DSP_PROGRAM: The program of the DSP (128 steps of 4 words), offset in JO_SCSP_DSP_AREA
- JO_SCSP_DSP_FLOAT_ZERO: 0 in the float format of the ring buffer of the DSP (exponent 12; 0x0000 is +0.5)
- JO_SCSP_RING_BUFFER(WORDS, ADDR): The ring buffer register (JO_SCSP_COMMON_RING_BUFFER)
- JO_SCSP_MEMORY_4MBITS: Register 0x400: the sound RAM of 4 Mbits (512 KB). Without it the SCSP addresses 2 Mbits (256 KB): the slots and the DSP read and write the upper half in the lower half (Yabause, Kronos: the sounds...
- JO_SCSP_MASTER_VOLUME_MASK: Master volume bits
- JO_SCSP_MASTER_VOLUME_MAX: Maximum master volume
- JO_MEMORY_AREA_MASK: The bits of an address that tell its memory (the cache-through mirror 0x2... gives the same memory)
- JO_IS_PTR_IN_HIGH_WORK_RAM(PTR): Check if the pointer is in the high work RAM, the fastest memory of the CPUs (cached or not)
- JO_IS_PTR_INSIDE_USER_RAM_AREA(PTR): Check if the pointer is inside user area WORK RAM
- JO_IS_ARRAY_INSIDE_USER_RAM_AREA(ARRAY): Check if the array is inside user area WORK RAM
smpc.h: System Management & Peripheral Control
software_renderer.h: Fast Triangle based software renderer using fixed number
- jo_software_renderer_draw_mode: Draw mode
- jo_software_renderer_face_culling_mode: Face culling mode
- jo_software_renderer_depth_mode: Z-BUFFER Computation mode
- jo_software_renderer_gfx: This is the main struct that handle everything for drawing
- jo_software_renderer_vertex: Vertex
- jo_software_renderer_create_ex(unsigned short width, unsigned short height, const jo_scroll_screen screen, const bool enable_zbuffer) -> jo_software_renderer_gfx *: Create a full-color rendering surface
- jo_software_renderer_create(unsigned short width, unsigned short height, const jo_scroll_screen screen) -> jo_software_renderer_gfx *: Create a full-color rendering surface
- jo_software_renderer_free(jo_software_renderer_gfx * const gfx) -> void: Free the rendering surface
- jo_software_renderer_flush(jo_software_renderer_gfx * const gfx) -> void: Copy the buffer into VDP1/2 VRAM
- jo_software_renderer_clear(const jo_software_renderer_gfx * const gfx, const jo_color color) -> void: Clear the buffer with the given color
- jo_software_renderer_draw_pixel2D(const jo_software_renderer_gfx * const gfx, const jo_fixed x, const jo_fixed y, const jo_color color) -> void: Draw a pixel without handling the Z-Buffer
- jo_software_renderer_draw_pixel3D(const jo_software_renderer_gfx * const gfx, const jo_fixed x, const jo_fixed y, const jo_fixed z, const jo_color color) -> void: Draw a pixel
- jo_software_renderer_draw_line3D(const jo_software_renderer_gfx * const gfx, jo_fixed x0, jo_fixed y0, jo_fixed z0, jo_fixed x1, jo_fixed y1, jo_fixed z1, const jo_color color0, const jo_color color1) -> void: Draw a line
- jo_software_renderer_triangle: Triangle definition
- jo_software_renderer_draw_triangle_wireframe(const jo_software_renderer_gfx * const gfx, const jo_software_renderer_triangle * const triangle) -> void: Draw a triangle in wireframe
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
- jo_sprite_draw(const int sprite_id, const jo_pos3D * const pos, const bool centered_style_coordinates, const bool billboard) -> void: (internal engine usage)
- jo_sprite_draw_rotate(const int sprite_id, const jo_pos3D * const pos, const int angle, const bool centered_style_coordinates, const bool billboard) -> void: (internal engine usage)
- jo_get_last_sprite_id(void) -> int: Get last Sprite Id
- jo_sprite_add(const jo_img * const img) -> int: Add a sprite
- jo_sprite_add_rgb(const jo_color * const pixels, const unsigned short width, const unsigned short height) -> int: Add a sprite from its pixels (jo_sprite_add() without the image struct: a texture in an array of the program)
- jo_sprite_add_8bits_image(const jo_img_8bits * const img) -> int: Add a 8 bits sprite
- jo_sprite_add_4bits_lut(const unsigned char * const pixels, const unsigned short width, const unsigned short height, const jo_color * const lut) -> int: Add a 16 colors texture with its color lookup table: 4 bits per pixel (4 times less VRAM than an RGB texture), drawn like an RGB texture (the colors of the table are RGB: gouraud shading, half...
- jo_sprite_add_image_4bits_lut(const jo_img * const img) -> int: Add an RGB image of 14 colors at most (the index 15 is the end code of the VDP1) as a 16 colors texture with its color lookup table (see jo_sprite_add_4bits_lut()): the same pixels for 4 times less...
- jo_sprite_add_4bits_image(const jo_img_4bits * const img) -> int: Add a 16 colors sprite in color bank mode: 4 bits per pixel, its colors are a sub-palette of 16 colors of the color RAM chosen when it is drawn (jo_sprite_set_palette_4bits()): the same pixels in...
- jo_sprite_replace(const jo_img * const img, const int sprite_id) -> int: Replace a sprite
- jo_sprite_replace_4bits_image(const jo_img_4bits * const img, const int sprite_id) -> int: Replace the pixels of a 16 colors sprite (jo_sprite_add_4bits_image() or jo_sprite_add_4bits_lut(): its table is kept)
- jo_sprite_add_end_codes(const int sprite_id) -> bool: Write the VDP1 end codes after the last visible pixel of each line of a sprite (RGB, 16 colors and 256 colors sprites)
- jo_sprite_free_from(const int sprite_id) -> void: Free all sprites from the given sprite_id
- jo_sprite_free_all(void) -> void: Free all sprites
- jo_sprite_name2id(const char *const filename) -> int (JO_COMPILE_WITH_SPRITE_HASHTABLE): Retrieve the Sprite Id from filename based on the four first character in the filename
- jo_sprite_enable_screen_doors_filter(void) -> void: Activate screen doors filter for every sprite displayed after this call
- jo_sprite_disable_screen_doors_filter(void) -> void: Disable screen doors filter for every sprite displayed after this call
- jo_sprite_enable_half_transparency(void) -> void: Activate half transparency for every sprite displayed after this call
- jo_sprite_disable_half_transparency(void) -> void: Disable half transparency for every sprite displayed after this call
- jo_sprite_enable_shadow_filter(void) -> void: Activate shadow filter for every sprite displayed after this call
- jo_sprite_disable_shadow_filter(void) -> void: Disable shadow filter for every sprite displayed after this call
- jo_sprite_enable_dark_filter(void) -> void: Activate dark filter for every sprite displayed after this call
- jo_sprite_disable_dark_filter(void) -> void: Disable dark filter for every sprite displayed after this call
- JO_NO_GOURAUD_COLOR: Value used to keep the original color for jo_set_gouraud_shading_colors()
- jo_set_gouraud_shading_colors(const jo_color topleft_color, const jo_color topright_color, const jo_color bottomright_color, const jo_color bottomleft_color) -> void: Change Gouraud Shading colors (a new table for the sprites displayed after this call with jo_sprite_enable_gouraud_shading(): up to 32 tables per frame, the last one is reused after them)
- jo_sprite_enable_gouraud_shading(void) -> void: Activate Gouraud Shading for every sprite displayed after this call
- jo_sprite_disable_gouraud_shading(void) -> void: Disable Gouraud Shading for every sprite displayed after this call
- jo_sprite_set_gouraud_table(const unsigned short table) -> void: Gouraud table of the sprites displayed after this call with jo_sprite_enable_gouraud_shading() (instead of the last table of jo_set_gouraud_shading_colors(): the tables given by...
- JO_DEFAULT_BRIGHTNESS: Default brightness for jo_set_gouraud_shading_brightness()
- JO_MAX_BRIGHTNESS: Maximum brightness value for jo_set_gouraud_shading_brightness()
- jo_set_gouraud_shading_brightness(const unsigned char brightness) -> void: Change Gouraud Shading brightness
- jo_sprite_enable_vertical_flip(void) -> void: Activate vertical flip for every sprite displayed after this call
- jo_sprite_disable_vertical_flip(void) -> void: Disable vertical flip for every sprite displayed after this call
- jo_sprite_enable_horizontal_flip(void) -> void: Activate horizontal flip for every sprite displayed after this call
- jo_sprite_disable_horizontal_flip(void) -> void: Disable horizontal flip for every sprite displayed after this call
- JO_NO_ZOOM: Value used to keep the original scale (1.0 in jo_fixed)
- jo_sprite_change_sprite_scale_fixed(const jo_fixed scale) -> void: Change scale for every sprite displayed after this call using fixed number
- jo_sprite_change_sprite_scale(const float scale) -> void (float: emulated in software, slow): Change scale for every sprite displayed after this call
- jo_sprite_change_sprite_scale_xy(const float scale_x, const float scale_y) -> void (float: emulated in software, slow): Change scale for every sprite displayed after this call
- jo_sprite_change_sprite_scale_xy_fixed(const jo_fixed scale_x, const jo_fixed scale_y) -> void: Change scale for every sprite displayed after this call using fixed number
- jo_sprite_restore_sprite_scale(void) -> void: Restore default scale for every sprite displayed after this call
- jo_sprite_set_palette(int palette_id) -> void: Change palette for every 8 bits sprite displayed after this call
- jo_sprite_set_additive_palette(int palette_id) -> void: Change palette for every 8 bits sprite displayed after this call: their light is added to the image under them (see jo_enable_additive_sprites())
- jo_sprite_set_palette_4bits(const int palette_id, const int subpalette_id) -> void: Choose the sub-palette of 16 colors of every 16 colors sprite in color bank mode (jo_sprite_add_4bits_image()) displayed after this call
- jo_sprite_set_palette_code(const unsigned short code) -> void: Choose the color code of every palette sprite (16 colors in color bank mode, 256 colors) displayed after this call, with the bits above the color that the sprite type of the VDP2 reads: their...
- jo_sprite_draw3D_and_rotate(const int sprite_id, const int x, const int y, const int z, const int angle) -> void: Display a sprite in 3 dimensional space
- jo_sprite_draw3D(const int sprite_id, const int x, const int y, const int z) -> void: Display a sprite in 3 dimensional space
- jo_sprite_draw3D_and_rotate2(const int sprite_id, const int x, const int y, const int z, const int angle) -> void: Display a sprite in 3 dimensional space
- jo_sprite_draw3D2(const int sprite_id, const int x, const int y, const int z) -> void: Display a sprite in 3 dimensional space
- jo_sprite_draw_4p_fixed(const int sprite_id, const jo_pos2D_fixed * const four_points, const jo_fixed z, const bool centered_style_coordinates) -> void: Display a sprite on 4 points (distorted sprite)
- jo_sprite_draw_rotated_fixed(const int sprite_id, const jo_fixed x, const jo_fixed y, const jo_fixed z, const jo_fixed half_width, const jo_fixed half_height, const int angle) -> void: Display a sprite turned on the screen (any angle: the 4 corners are computed, the sprite is distorted by the VDP1)
- jo_sprite_draw_segment_fixed(const int sprite_id, const jo_fixed x0, const jo_fixed y0, const jo_fixed x1, const jo_fixed y1, const jo_fixed half_width, const jo_fixed z, const bool centered_style_coordinates) -> void: Display a sprite stretched along a segment on the screen (a beam, a bolt, a rope, a trail): its width across the segment, its height along it (its top at the start)
- jo_sprite_set_anchor(const int sprite_id, const int x, const int y) -> void: Set the anchor of a sprite
- jo_sprite_get_anchor_x(const int sprite_id) -> int: Get the horizontal position of the anchor of a sprite (see jo_sprite_set_anchor())
- jo_sprite_get_anchor_y(const int sprite_id) -> int: Get the vertical position of the anchor of a sprite (see jo_sprite_set_anchor()): how far its top is above the anchor (the height of a character above its feet)
- jo_sprite_draw_anchored(const int sprite_id, const int x, const int y, const int z, const bool flip, const bool centered_style_coordinates) -> void: Display a sprite with its anchor at a position (see jo_sprite_set_anchor())
- jo_sprite_draw_anchored_scaled_fixed(const int sprite_id, const jo_fixed x, const jo_fixed y, const jo_fixed z, const jo_fixed scale_x, const jo_fixed scale_y, const bool flip, const bool centered_style_coordinates) -> void: Display a sprite scaled around its anchor (see jo_sprite_set_anchor()): a shadow that shrinks, an explosion that grows, a parachute that opens, a door that turns (a horizontal scale only)
- jo_sprite_draw_turned_fixed(const int sprite_id, const jo_fixed x, const jo_fixed y, const jo_fixed z, const jo_fixed pivot_x, const jo_fixed pivot_y, const jo_angle angle, const bool centered_style_coordinates) -> void: Display a sprite turned around a point of its texture (any angle: the 4 corners are computed, the sprite is distorted by the VDP1)
- jo_sprite_draw_anchored_turned_fixed(const int sprite_id, const jo_fixed x, const jo_fixed y, const jo_fixed z, const jo_angle angle, const bool centered_style_coordinates) -> void: Display a sprite turned around its anchor (see jo_sprite_set_anchor()): a blade around its hub, an arm around its shoulder, a hanging load around its hook
- jo_sprite_draw_rectangle(const int x, const int y, const int width, const int height, const jo_color color, const int z) -> void: Draw a rectangle of one color (no texture): a health bar, a frame, a window of text, a fade to black
- jo_sprite_draw_color_4p_fixed(const jo_pos2D_fixed * const four_points, const jo_color color, const jo_fixed z, const bool centered_style_coordinates) -> void: Draw a quadrilateral of one color (no texture) on 4 points: jo_sprite_draw_4p_fixed() with a color instead of a sprite
- jo_sprite_enable_clipping(bool outside) -> void: Activate sprite clipping for every sprite displayed after this call
- jo_sprite_disable_clipping(void) -> void: Disable sprite clipping for every sprite displayed after this call
- jo_sprite_set_clipping_area(const unsigned int x, const unsigned int y, const unsigned int width, const unsigned int height, const int depth) -> void: Set user clipping area
- jo_sprite_set_system_clipping_area(const unsigned int width, const unsigned int height) -> void: Set the VDP1 drawing area (system clipping)
- jo_sprite_get_pixel_color(const jo_color * const data, const unsigned int x, const unsigned int y, const unsigned int image_width) -> jo_color: Get a specific pixel color from image bytes
- jo_sprite_get_pixel_palette_index(const unsigned char * const data, const unsigned int x, const unsigned int y, const unsigned int image_width) -> unsigned char: Get a specific pixel palette index from image bytes
- jo_sprite_is_pixel_transparent(const jo_color * const data, const unsigned int x, const unsigned int y, const unsigned int image_width) -> bool: Get if a specific pixel is transparent (JO_COLOR_Transparent) in image bytes
- jo_sprite_get_width(const int sprite_id) -> int: Get sprite width
- jo_sprite_get_height(const int sprite_id) -> int: Get sprite height
- jo_sprite_get_raw_data(const int sprite_id) -> void *: Get sprite raw image contents
- jo_sprite_get_lut(const int sprite_id) -> jo_color *: Get the color lookup table of a 16 colors texture (jo_sprite_add_4bits_lut()): its 16 entries in the VRAM. The game writes them to change the colors of the texture (an animation of its colors, all...
- jo_sprite_set_lut(const int sprite_id, const jo_color * const lut) -> void: Draw a 16 colors texture with another color lookup table (until it is set back): a palette swap (the same pixels in other colors: a second player, an enemy of another rank) or the shape of a texture...
- jo_sprite_count(void) -> int: Get sprite count
- jo_sprite_usage_percent(void) -> int: Get sprite memory usage
- jo_sprite_free_memory(void) -> unsigned int: Get the free sprite memory (VDP1 VRAM)
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.
- typedef jo_palette* (*jo_tga_palette_handling_callback)(void): Function prototype for ()
- t_tga_error_code: tga error code
- JO_TGA_TRANSPARENT_INDEX(INDEX): The transparent_color of a 8 bits TGA to make a color of its palette transparent
- jo_set_tga_palette_handling(jo_tga_palette_handling_callback callback) -> void: Set the callback to handle TGA palette for 8 bits image
- jo_set_tga_default_palette(jo_palette *palette) -> void: Set the palette to use for 8 bits image
- jo_tga_loader_from_stream(jo_img *img, char *stream, const jo_color transparent_color) -> t_tga_error_code: Load a TGA image from stream
- jo_sprite_add_tga_from_stream(char *stream, const jo_color transparent_color) -> int: Add a sprite from a TGA stream
- jo_sprite_add_tga(const char * const sub_dir, const char * const filename, const jo_color transparent_color) -> int (JO_COMPILE_WITH_FS_MODULE, on by default): Add a sprite from a TGA file
- jo_tga_loader(jo_img *img, const char * const sub_dir, const char *const filename, const jo_color transparent_color) -> t_tga_error_code (JO_COMPILE_WITH_FS_MODULE, on by default): Load a TGA image
- jo_set_background_tga(const char * const sub_dir, const char * const filename, const jo_color transparent_color) -> bool (JO_COMPILE_WITH_FS_MODULE, on by default): Load a TGA image (15, 24 or 32 bits) and show it on the background (NBG1) at the top left of the screen
- jo_tga_8bits_loader(jo_img_8bits *img, const char * const sub_dir, const char * const filename, const int transparent_color_index_in_palette) -> t_tga_error_code (JO_COMPILE_WITH_FS_MODULE, on by default): Load a 8 bits 255 colors max TGA image
- jo_tga_8bits_loader_from_stream(jo_img_8bits *img, char *stream, const int transparent_color_index_in_palette) -> t_tga_error_code (JO_COMPILE_WITH_FS_MODULE, on by default): Load a 8 bits 255 colors max TGA image
- jo_tga_8bits_tileset_loader(const char * const sub_dir, const char * const filename, const jo_color transparent_color, const jo_tile * const tileset, const unsigned int tile_count, jo_raw_img *output_tiles) -> t_tga_error_code (JO_COMPILE_WITH_FS_MODULE, on by default): Load a tileset TGA image
- jo_sprite_add_tga_tileset(const char * const sub_dir, const char * const filename, const jo_color transparent_color, const jo_tile * const tileset, const unsigned int tile_count) -> int (JO_COMPILE_WITH_FS_MODULE, on by default): Add tileset sprites from a TGA file
time.h: Time Management
tools.h: Jo Engine Tools (printf, etc,)
- JO_FIXED_TV_WIDTH: Fixed value of JO_TV_WIDTH
- JO_FIXED_TV_HEIGHT: Fixed value of JO_TV_HEIGHT
- jo_swap_endian_short(short value) -> short: Swap Short endian
- jo_swap_endian_ushort(unsigned short value) -> unsigned short: Swap Unsigned short endian
- jo_swap_endian_uint(unsigned int value) -> unsigned int: Swap unsigned int endian
- jo_swap_endian_int(int value) -> int: Swap int endian
- jo_read_big_endian_ushort(const unsigned char * const p) -> unsigned short: Read a big endian unsigned short (16 bits) from any address (the bytes of a file, aligned or not)
- jo_read_big_endian_uint(const unsigned char * const p) -> unsigned int: Read a big endian unsigned int (32 bits) from any address (the bytes of a file, aligned or not)
- sprintf(char* str, const char* format, ...) -> int: sprintf prototypes
- jo_sprintf(char * const str, const char * const format, ...) -> int: A small sprintf of the engine (jo_printf()...): d i u x X c s %%, the flags - 0 + and space, a width, a precision (%.3d: 3 digits at least, %.5s: 5 characters at most), both can be arguments...
- jo_vsprintf(char * const str, const char * format, va_list args) -> int: jo_sprintf() with a list of arguments
- jo_snprintf(char * const str, const unsigned int size, const char * const format, ...) -> int: jo_sprintf() with the size of the string: size - 1 characters at most, then the null character
- jo_vsnprintf(char * const str, const unsigned int size, const char * format, va_list args) -> int: jo_snprintf() with a list of arguments
- jo_print(int x, int y, char * str) -> void (JO_COMPILE_WITH_PRINTF_MODULE, on by default): Print implementation
- jo_printf(X, Y, ...) (JO_COMPILE_WITH_PRINTF_MODULE, on by default): printf implementation
- jo_printf_with_color(X, Y, COLOR_INDEX, ...) (JO_COMPILE_WITH_PRINTF_MODULE, on by default): printf implementation
- jo_set_printf_color_index(const unsigned char index) -> void (JO_COMPILE_WITH_PRINTF_MODULE, on by default): Set printf foreground color index
- jo_set_printf_outline(const bool enabled, const jo_color color) -> void (JO_COMPILE_WITH_PRINTF_MODULE, on by default): The characters of jo_printf() with an outline (like the text of the arcade games: readable over any image)
- jo_clear_screen(void) -> void (JO_COMPILE_WITH_PRINTF_MODULE, on by default): Clear screen (useful for printf)
- jo_clear_screen_line(const int y) -> void (JO_COMPILE_WITH_PRINTF_MODULE, on by default): Clear single screen line (useful for printf)
- jo_memcpy(void * const restrict dst, const void * const restrict src, unsigned int size) -> void: Copies size bytes from the object pointed to by src to the object pointed to by dst
- jo_dma_copy_async(const void * const src, void * const dest, const unsigned int size) -> void: Start a copy with the DMA controller of the current CPU (the function doesn't wait for the end of the copy)
- jo_dma_wait(void) -> void: Wait for the end of the copy started by jo_dma_copy_async() on the current CPU
- jo_dma_copy(const void * const src, void * const dest, const unsigned int size) -> void: Copy with the DMA controller of the current CPU and wait for the end of the copy
- jo_dma_fill32(void * const dest, const unsigned int value, const unsigned int size) -> void: Fill memory with a 32 bits value using the DMA controller of the current CPU (waits for the end)
- JO_NULL: NULL implementation
- JO_UNUSED_ARG(ARG): Mark function argument as unused
- JO_COUNT_OF(ARRAY): Number of elements of an array (an array, not a pointer: computed by the compiler)
- jo_tools_is_whitespace(const char c) -> bool: Check if the character is a whitespace
- jo_4_char_hash(const char * const str) -> int: Create an hash code based on the first four character of the string
- jo_datetime: DateTime struct
- jo_language: Language type
- jo_horizontal_move: Horizontal move
- jo_get_current_language(void) -> jo_language: Get Sega saturn current language
- jo_getdate(jo_datetime *now) -> void: get current date and time
- jo_tools_atoi(const char * restrict str) -> int: atoi implementation
- jo_strlen(const char * restrict str) -> int: strlen implementation
- jo_strcmp(const char * restrict p1, const char * restrict p2) -> int: strcmp implementation
- jo_string_equals(const char * restrict p1, const char * restrict p2) -> bool: Determine if two string equals
- jo_endwith(const char * restrict str, const char * restrict end) -> bool: determine if str end with a specific string
- jo_memset(const void * const restrict ptr, const int value, unsigned int num) -> void: Sets the first num bytes of the block of memory pointed by ptr to the specified value (interpreted as an unsigned char)
- jo_memcmp(const void * const p1, const void * const p2, unsigned int num) -> int: memcmp implementation
- jo_lz_size(const unsigned char * const src) -> unsigned int: Size of the data compressed by Compiler/COMMON/jo_lz.py (the 4 bytes at its start, big endian)
- jo_lz_decompress(const unsigned char * const src, unsigned char * const dst) -> unsigned int: 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)
- jo_yield(void) -> void: Little pause possible
- jo_spin_wait(int iterations) -> void: Causes "a thread" to wait the number of times defined by the iterations parameter.
- 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) -> void: Copies the image map data to VRAM
- jo_cell_to_vram(unsigned char * restrict data, unsigned char * restrict vram_addr, unsigned int size) -> void: Copies the image cel data to VRAM
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
- jo_vdp1_command: VDP1 command (32 bytes)
- JO_VDP1_CMD_NORMAL_SPRITE: VDP1 command types (CMDCTRL)
- JO_VDP1_FUNCTION_SPRITE: Normal sprite
- JO_VDP1_FUNCTION_TEXTURE: Textured polygon (distorted sprite)
- JO_VDP1_FUNCTION_POLYGON: Polygon
- JO_VDP1_FUNCTION_POLYLINE: Polyline
- JO_VDP1_FUNCTION_LINE: Line
- JO_VDP1_FUNCTION_USER_CLIP: User clipping area
- JO_VDP1_FUNCTION_SYSTEM_CLIP: System clipping area
- JO_VDP1_FUNCTION_LOCAL_COORDINATES: Local coordinates
- JO_VDP1_DIRECTION_FUNCTION_MASK: Drawing function mask of the direction attribute
- JO_VDP1_DIRECTION_FLIP_MASK: Flip mask of the direction attribute (CMDCTRL layout)
- JO_VDP1_H_FLIP: Horizontal flip bit of the direction attribute (CMDCTRL layout)
- JO_VDP1_MSB_ON: Write the MSB of the frame buffer (shadow)
- JO_VDP1_HIGH_SPEED_SHRINK: High speed shrink
- JO_VDP1_PRE_CLIPPING_DISABLE: Pre-clipping disabled: for a command entirely inside of the clipping area (the VDP1 tests each line of a command against the clipping area before it draws it: about 4 cycles per line, for nothing...
- JO_VDP1_NO_WINDOW: No clipping window
- JO_VDP1_WINDOW_IN: Draw inside the user clipping area
- JO_VDP1_WINDOW_OUT: Draw outside the user clipping area
- JO_VDP1_MESH: Mesh (screen door)
- JO_VDP1_NO_MESH: No mesh
- JO_VDP1_END_CODE_DISABLE: Disable end code (texture)
- JO_VDP1_RGB_END_CODE: End code of the RGB textures: the VDP1 stops drawing a line after 2 end codes (see jo_sprite_add_end_codes())
- JO_VDP1_4BITS_END_CODE: End code of the 16 colors textures (the color 15)
- JO_VDP1_8BITS_END_CODE: End code of the 256 colors textures (the color 255)
- JO_VDP1_TRANSPARENT_PIXEL_DISABLE: Disable transparent pixel (texture)
- JO_VDP1_COLOR_MODE_16_BANK: Texture color mode: 16 colors (color bank)
- JO_VDP1_COLOR_MODE_16_LOOKUP: Texture color mode: 16 colors (lookup table)
- JO_VDP1_COLOR_MODE_64_BANK: Texture color mode: 64 colors (color bank)
- JO_VDP1_COLOR_MODE_128_BANK: Texture color mode: 128 colors (color bank)
- JO_VDP1_COLOR_MODE_256_BANK: Texture color mode: 256 colors (color bank)
- JO_VDP1_COLOR_MODE_RGB: Texture color mode: RGB (32768 colors)
- JO_VDP1_COLOR_MODE_MASK: Color mode mask
- JO_VDP1_COLOR_CALC_REPLACE: Color calculation: replace
- JO_VDP1_COLOR_CALC_SHADOW: Color calculation: shadow
- JO_VDP1_COLOR_CALC_HALF_LUMINANCE: Color calculation: half luminance
- JO_VDP1_COLOR_CALC_HALF_TRANSPARENT: Color calculation: half transparent
- JO_VDP1_COLOR_CALC_GOURAUD: Color calculation: gouraud shading
- JO_VDP1_COLOR_CALC_MASK: Color calculation mask
- JO_VDP1_NO_GOURAUD: No gouraud table
- JO_VDP1_NO_PALETTE: No palette (color)
- JO_VDP1_TEXTURE_SIZE_SHIFT_16_COLORS: Texture size shift for 16 colors textures (4 bits per pixel)
- JO_VDP1_TEXTURE_SIZE_SHIFT_256_COLORS: Texture size shift for 64, 128 and 256 colors textures (8 bits per pixel)
- JO_VDP1_TEXTURE_SIZE_SHIFT_32K_COLORS: Texture size shift for RGB textures (16 bits per pixel)
- JO_VDP1_OPTION_USE_TEXTURE: Option (bits 16-23 of the direction attribute): the polygon is textured
- JO_VDP1_SPRITE_NO_FLIP: Textured sprite without flip
- JO_VDP1_SPRITE_H_FLIP: Textured sprite with horizontal flip
- JO_VDP1_SPRITE_V_FLIP: Textured sprite with vertical flip
- JO_VDP1_SPRITE_HV_FLIP: Textured sprite with horizontal and vertical flip
- JO_VDP1_POLYGON: Flat color polygon
- JO_VDP1_POLYLINE: Flat color polyline
- JO_VDP1_LINE: Flat color line
- JO_VDP1_DIRECTION_COMMAND(DIRECTION): Command bits of a direction attribute (drawing function and flip)
- JO_VDP1_DIRECTION_OPTIONS(DIRECTION): Options of a direction attribute (JO_VDP1_OPTION_USE_TEXTURE)
- JO_VDP1_DIRECTION_DRAW_MODE(DIRECTION): Draw mode bits of a direction attribute (JO_VDP1_END_CODE_DISABLE, JO_VDP1_TRANSPARENT_PIXEL_DISABLE)
- jo_vdp1_sprite_attribute: Sprite attribute
- JO_VDP1_SPRITE_ATTRIBUTE(TEXTURE, COLOR, GOURAUD, DRAW_MODE, DIRECTION): Sprite attribute initializer
- jo_vdp1_sprite_position: Sprite position (internal usage)
- JO_VDP1_LIGHT_TABLE_OFFSET: Gouraud tables used for 3D lighting (32 brightness levels, 16 is neutral)
- JO_VDP1_CLIP_GOURAUD_TABLE_OFFSET: Gouraud tables of the parts of the 3D polygons clipped by the near plane or subdivided near the camera (2 sets: one per frame)
- JO_VDP1_CLIP_GOURAUD_TABLE_COUNT: Gouraud tables of the clipped and subdivided 3D polygons (8 bytes each)
- jo_vdp1_window: 3D window (internal usage)
- JO_VDP1_WINDOW_COUNT: Number of 3D windows: near (default), far, a second far window and the window of the transparency layer (see jo_3d_select_window())
- JO_VDP1_OFF_SCREEN_WINDOW: The window that draws beyond the screen (the frame buffer at its right: the transparency layer, see jo/transparency.h): the system clipping of the other windows stays on the screen, whatever the...
- jo_vdp1_redraw_last_frame(void) -> void: Draw the last frame again (from a VBLANK callback while the main loop doesn't run: a loading). A texture of this frame changed by the callback is seen (the sand of an hourglass)
- JO_VDP1_MAX_KEY: Biggest depth key
- jo_3d_set_depth_limit(const int z) -> void: Depth limit of the current window (the far clipping distance of jo_3d_window()): the polygons beyond it are not drawn (all their vertices farther, in the view space). A wall that fills the screen:...
- jo_3d_set_frame_clear(const bool enabled) -> void: Clear the frame buffer at the start of each frame (the default), or not
- jo_vdp1_command_count(void) -> int: VDP1 commands of the last frame (the polygons, their parts, the sprites: see jo_vdp1_command_max())
- jo_vdp1_frame_command_count(void) -> int: VDP1 commands of the frame being made now by the master CPU (the polygons, their parts, the sprites added since the start of the frame, see jo_vdp1_command_count() for the last frame and...
- jo_vdp1_command_max(void) -> int: Most VDP1 commands in a frame (the next ones are not drawn)
vdp2.h: Jo Engine VDP2 definition and tools
- sprintf(char* str, const char* format, ...) -> int: sprintf prototypes
- jo_set_displayed_screens(const jo_scroll_screen scroll_screen_flags) -> void: Set displayed screens
- jo_set_default_background_color(const jo_color background_color) -> void: Set default background color
- jo_set_background_line_colors(const jo_color * const colors) -> void: Set a color for each line of the back screen (visible where no scroll screen is displayed)
- jo_vdp2_set_border_uses_background_color(const bool enabled) -> void: Set the color of the border (the area of the TV outside the display area)
- jo_nbg2_print(int x, int y, char * str) -> void: NBG2 Print implementation
- jo_nbg2_printf(X, Y, ...): NBG2 printf implementation (jo_set_nbg2_8bits_font must be called before)
- jo_vdp2_set_nbg2_8bits_font(jo_img_8bits *img, char *mapping, int palette_id, bool vertical_flip, bool enabled) -> void: Set 8 bits NBG2 font image
- jo_nbg2_clear(void) -> void: Clear NBG2
- jo_nbg3_print(int x, int y, char * str) -> void: NBG3 Print implementation
- jo_nbg3_printf(X, Y, ...): NBG3 printf implementation (jo_set_nbg3_8bits_font must be called before)
- jo_vdp2_set_nbg3_8bits_font(jo_img_8bits *img, char *mapping, int palette_id, bool vertical_flip, bool enabled) -> void: Set 8 bits NBG3 font image
- jo_nbg3_clear(void) -> void: Clear NBG3
- jo_vdp2_set_nbg1_8bits_image(jo_img_8bits *img, int palette_id, bool vertical_flip) -> void: Add 8 bits NBG1 image
- jo_vdp2_set_nbg1_8bits_image_repeat(jo_img_8bits *img, int palette_id, bool vertical_flip, bool repeat) -> void: Add 8 bits NBG1 image, repeated or not
- jo_vdp2_set_nbg0_8bits_image(jo_img_8bits *img, int palette_id, bool vertical_flip, bool enabled) -> void: Set 8 bits NBG0 image
- jo_vdp2_set_nbg2_8bits_image(jo_img_8bits *img, int palette_id, bool vertical_flip, bool enabled) -> void: Set 8 bits NBG2 image
- jo_vdp2_set_nbg3_8bits_image(jo_img_8bits *img, int palette_id, bool vertical_flip, bool enabled) -> void: Set 8 bits NBG3 image
- jo_vdp2_set_nbg1_8bits_bitmap(const int palette_id) -> bool: The NBG1 bitmap in 256 colors at the resolution of the screen (one pixel of the bitmap = one pixel of the screen, not zoomed): 1024 x 256 pixels, 512 x 512 pixels in the 448 to 512 lines modes (in...
- jo_vdp2_set_nbg1_16bits_bitmap(void) -> void: The NBG1 bitmap in 32768 colors again (see jo_vdp2_set_nbg1_8bits_bitmap()): draw it again
- jo_vdp2_get_nbg1_8bits_bitmap_width(void) -> int: Width of the 256 colors NBG1 bitmap (see jo_vdp2_set_nbg1_8bits_bitmap())
- jo_vdp2_get_nbg1_8bits_bitmap_height(void) -> int: Height of the 256 colors NBG1 bitmap (see jo_vdp2_set_nbg1_8bits_bitmap())
- jo_vdp2_clear_bitmap_nbg1_8bits(const unsigned char index) -> void: Fill the 256 colors NBG1 bitmap (see jo_vdp2_set_nbg1_8bits_bitmap())
- jo_vdp2_put_pixel_bitmap_nbg1_8bits(const int x, const int y, const unsigned char index) -> void: Put a pixel in the 256 colors NBG1 bitmap (see jo_vdp2_set_nbg1_8bits_bitmap())
- jo_vdp2_draw_bitmap_nbg1_8bits_image(const jo_img_8bits * const img, const int x, const int y) -> void: Copy an image in the 256 colors NBG1 bitmap (see jo_vdp2_set_nbg1_8bits_bitmap())
- jo_vdp2_set_nbg1_image(const jo_img * const img, short left, short top) -> void: Set NBG1 bitmap image
- jo_vdp2_clear_bitmap_nbg1(const jo_color color) -> void: Clear NBG1 bitmap
- jo_vdp2_enable_nbg1_double_buffer(void) -> bool: Double buffer of the NBG1 bitmap: the drawing functions of NBG1 draw in a hidden bitmap, displayed by jo_vdp2_swap_nbg1_bitmap() with the sprites of the same frame (a new background without tearing,...
- jo_vdp2_swap_nbg1_bitmap(void) -> void: Display the hidden NBG1 bitmap (see jo_vdp2_enable_nbg1_double_buffer()), the next drawings are in the other one
- jo_vdp2_nbg1_swap_pending(void) -> bool: The bitmap of the last jo_vdp2_swap_nbg1_bitmap() is not displayed yet
- jo_vdp2_get_nbg1_swap_vblank(void) -> unsigned int: The VBLANK when the bitmap of the last jo_vdp2_swap_nbg1_bitmap() was displayed
- jo_vdp2_disable_nbg1_double_buffer(void) -> void: One NBG1 bitmap again (see jo_vdp2_enable_nbg1_double_buffer()): the banks B0 and B1 are free
- jo_vdp2_move_nbg1(const int x, const int y) -> void: Move NBG1 (scrolling)
- jo_vdp2_move_nbg2(const int x, const int y) -> void: Move NBG2 (scrolling by whole pixels: NBG2 and NBG3 have no fraction and no zoom)
- jo_vdp2_move_nbg3(const int x, const int y) -> void: Move NBG3 (see jo_vdp2_move_nbg2())
- jo_vdp2_move_nbg1_fixed(const jo_fixed x, const jo_fixed y) -> void: Scroll NBG1 with a fraction of pixel (fixed point: 8 bits of fraction are used)
- jo_vdp2_zoom_nbg1f(const float width_factor, const float height_factor) -> void (float: emulated in software, slow): Zoom NBG1 width and height independently
- jo_vdp2_zoom_nbg1_fixed(const jo_fixed width_factor, const jo_fixed height_factor) -> void: Zoom NBG1 (fixed point: without the float functions of libgcc)
- jo_vdp2_zoom_nbg1(const float factor) -> void (float: emulated in software, slow): Zoom NBG1
- jo_vdp2_move_nbg0(const int x, const int y) -> void: Move NBG0 (scrolling)
- jo_vdp2_zoom_nbg0f(const float width_factor, const float height_factor) -> void (float: emulated in software, slow): Zoom NBG0 width and height independently
- jo_vdp2_zoom_nbg0_fixed(const jo_fixed width_factor, const jo_fixed height_factor) -> void: Zoom NBG0 (fixed point: without the float functions of libgcc)
- jo_vdp2_move_nbg0_fixed(const jo_fixed x, const jo_fixed y) -> void: Scroll NBG0 with a fraction of pixel (fixed point: 8 bits of fraction are used)
- jo_vdp2_zoom_nbg0(const float factor) -> void (float: emulated in software, slow): Zoom NBG0
- jo_vdp2_draw_bitmap_nbg1_line(int x0, int y0, int x1, int y1, const jo_color color) -> void: Draw a NBG1 line using Bresenham's line algorithm
- jo_vdp2_draw_bitmap_nbg1_square(const int x, const int y, const short width, const short height, const jo_color color) -> void: Draw a square on NBG1
- jo_vdp2_put_pixel_bitmap_nbg1(const int x, const int y, const jo_color color) -> void: Put pixel in NBG1 using color
- jo_vdp2_put_pixel_bitmap_nbg1_rgb(const int x, const int y, unsigned char r, unsigned char g, unsigned char b) -> void: Put pixel in NBG1 using composite color
- jo_vdp2_enable_rbg0(void) -> void: Enable 3D planes
- jo_vdp2_set_rbg0_far_limit(const int max_zoom_out) -> void: Hide the farthest part of the 3D planes (the back screen is visible instead)
- jo_vdp2_disable_rbg0(void) -> void: Disable 3D planes
- jo_vdp2_set_rbg0_plane_a_8bits_image(jo_img_8bits *img, int palette_id, bool repeat, bool vertical_flip) -> void: Setup plane A
- jo_vdp2_set_rbg0_plane_a_8bits_island(jo_img_8bits *img, int palette_id, bool vertical_flip) -> void: Setup plane A as an island: the image once, its top left cell (8 x 8 pixels) repeated around it to the infinite (a ring in the sea, a field in a desert)
- jo_vdp2_set_rbg0_plane_b_8bits_image(jo_img_8bits *img, int palette_id, bool repeat, bool vertical_flip) -> void: Setup plane B
- jo_vdp2_replace_rbg0_plane_a_8bits_image(jo_img_8bits *img, bool vertical_flip) -> void: Replace plane A image
- jo_vdp2_replace_rbg0_plane_b_8bits_image(jo_img_8bits *img, bool vertical_flip) -> void: Replace plane B image
- jo_vdp2_draw_rbg0_plane_a(const bool use_scroll_format_matrix) -> void: Draw plane A
- jo_vdp2_draw_rbg0_plane_b(const bool use_scroll_format_matrix) -> void: Draw plane B
- jo_vdp2_draw_rbg0_plane_b_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_enable_screen_mozaic(const jo_scroll_screen screens, short x, short y) -> void: Enable mozaic effect for scroll screen
- jo_disable_all_screen_mozaic(void) -> void: Disable mozaic effect for all scroll screen
- JO_NBG1_SCROLL_TABLE_SIZE: 512 entries. One offset for each line because the background size is a 512x512 pixels by default.
- jo_vdp2_enable_nbg1_line_scroll(void) -> int *: Enable NBG1 horizontal line scroll effect
- jo_vdp2_disable_nbg1_line_scroll(void) -> void: Disable NBG1 horizontal line scroll effect
- JO_NBG1_SCROLL_XY_TABLE_LINES: Lines of the table of jo_vdp2_enable_nbg1_line_scroll_xy()
- jo_vdp2_enable_nbg1_line_scroll_xy(void) -> int *: Enable the NBG1 horizontal and vertical line scroll: each line of the screen shows its own part of the image (a split screen: each view its own sky)
- JO_NBG1_SCROLL_XY_FRAME_TABLES: Tables of jo_vdp2_next_nbg1_line_scroll_xy(): the one displayed, the ones of the frames waiting for their image (the CPUs are up to 3 frames ahead of it), the one being written
- jo_vdp2_next_nbg1_line_scroll_xy(void) -> int *: The table of jo_vdp2_enable_nbg1_line_scroll_xy() for the current frame, displayed with its image, like the scroll registers set by the frame: a ground scrolled by the table goes with the sprites and...
- jo_vdp2_compute_nbg1_line_scroll(unsigned short offset) -> void: Compute NBG1 horizontal line scroll effect using specific offset
- JO_NBG1_VERTICAL_CELL_SCROLL_TABLE_SIZE: Entries of the NBG1 vertical cell scroll table: one for each column of 8 pixels on the screen (and one more when the screen is scrolled by a fraction of a column)
- jo_vdp2_enable_nbg1_vertical_cell_scroll(void) -> int *: Enable the NBG1 vertical cell scroll: each column of 8 pixels of the screen is moved vertically by its own offset (added to the vertical scroll of the screen)
- jo_vdp2_disable_nbg1_vertical_cell_scroll(void) -> void: Disable the NBG1 vertical cell scroll and free its table
- JO_NBG0_SCROLL_TABLE_SIZE: 512 entries. One offset for each line because the background size is a 512x512 pixels by default.
- jo_vdp2_enable_nbg0_line_scroll(void) -> int *: Enable NBG0 horizontal line scroll effect
- jo_vdp2_disable_nbg0_line_scroll(void) -> void: Disable NBG0 horizontal line scroll effect
- jo_vdp2_compute_nbg0_line_scroll(unsigned short offset) -> void: Compute NBG0 horizontal line scroll effect using specific offset
- jo_disable_all_screens_transparency(void) -> void: Disable all screens transparency
- jo_enable_screen_transparency(const jo_scroll_screen screen, const unsigned short transparency_level) -> void: Enable screen transparency
- JO_VDP2_ADDITIVE_SPRITE_BANK: Color bank bits of an additive sprite (see jo_enable_additive_sprites(), jo_sprite_set_additive_palette()): the priority register 3 of the sprites (sprite type 3: bits 14 and 13 of a palette pixel)
- jo_enable_additive_sprites(void) -> void: The light of the additive sprites is added to the image under them (the VDP2 color calculation "add", like the glows, see jo/glow.h): a halo without edge (the sun, a flare) drawn by the VDP1. An...
- jo_disable_additive_sprites(void) -> void: The additive sprites are opaque again (see jo_enable_additive_sprites())
- JO_VDP2_WINDOW_0: Window 0 (see jo_vdp2_set_window())
- JO_VDP2_WINDOW_1: Window 1 (see jo_vdp2_set_window())
- jo_vdp2_window_area: Where the screens of a window are shown (see jo_vdp2_enable_window())
- jo_vdp2_set_window(const int window, int x, int y, int width, int height) -> void: Set a rectangle window
- JO_VDP2_LINE_WINDOW_TABLES: Line window tables of a window (see jo_vdp2_set_window_lines()): the one displayed, the ones of the frames waiting for their image (the CPUs are up to 3 frames ahead of it), the one being written
- jo_vdp2_set_window_lines(const int window, const int top, const int count, const short * const left, const short * const right) -> bool: Set a window of any shape: its left and right pixels on each line
- jo_vdp2_set_window_circle(const int window, const int x, const int y, const int radius) -> bool: Set a round window (a spotlight, a transition)
- jo_vdp2_enable_window(const jo_scroll_screen screens, const int window, const jo_vdp2_window_area area) -> void: Show screens only inside a window, or hide them there
- jo_vdp2_disable_window(const jo_scroll_screen screens) -> void: The screens are shown on all the screen again (see jo_vdp2_enable_window())
- jo_vdp2_blend_mode: How the screens are mixed with the image under them (see jo_vdp2_set_blend_mode())
- JO_VDP2_BLEND_RATIO_MAX: Maximum ratio of jo_vdp2_enable_blend()
- jo_vdp2_set_blend_mode(const jo_vdp2_blend_mode mode) -> void: Set how the screens are mixed (jo_vdp2_enable_blend()): the same for all the screens
- jo_vdp2_enable_blend(const jo_scroll_screen screens, unsigned char ratio) -> void: Mix screens with the image under them
- jo_vdp2_blend_rgb_sprites_only(const bool rgb_only) -> void: Mix only the RGB pixels of the sprites (jo_vdp2_enable_blend(JO_SPRITE_SCREEN, ratio)): the palette pixels stay opaque (example: see-through RGB water with opaque objects in palette colors over it)
- jo_vdp2_blend_sprites_of_priority(const unsigned char priority) -> void: Mix only the sprites of one priority (jo_vdp2_enable_blend(JO_SPRITE_SCREEN, ratio)), in the blend mode of the other screens: lights or smoke drawn as palette sprites with a priority register of...
- jo_vdp2_disable_blend(const jo_scroll_screen screens) -> void: The screens are opaque again (see jo_vdp2_enable_blend())
- JO_VDP2_LINE_COLOR_LINES: Lines of a line color table (the most lines of a screen, see jo_vdp2_set_line_colors())
- JO_VDP2_LINE_COLOR(PALETTE_ID, INDEX): Color code of a line color: the color INDEX of the palette PALETTE_ID (jo_create_palette(): its color palette.data[k] is the index k + 1)
- jo_vdp2_set_line_colors(const unsigned short * const colors, const int count) -> bool: Set one color for each line of the line color screen
- jo_vdp2_set_line_color(const unsigned short color) -> bool: Set one color for the whole line color screen
- jo_vdp2_enable_line_color(const jo_scroll_screen screens) -> void: Mix screens with the line color screen instead of the image under them (as slLineColDisp() of the SGL)
- jo_vdp2_disable_line_color(const jo_scroll_screen screens) -> void: The screens are no longer mixed with the line color screen (see jo_vdp2_enable_line_color())
- jo_vdp2_enable_blur(const jo_scroll_screen screen) -> bool: Blur a screen horizontally where it is mixed: under a transparent screen (jo_vdp2_enable_blend()), or where it is transparent itself (water, glass, heat)
- jo_vdp2_disable_blur(void) -> void: No blur (see jo_vdp2_enable_blur()): the color RAM has 2048 colors again
- jo_vdp2_hires_sprite_mode: What the 2 highest bits of the color index of a sprite choose in the 640 and 704 pixels modes
- jo_vdp2_set_hires_sprite_mode(const jo_vdp2_hires_sprite_mode mode) -> void: Choose what the color index of the sprites gives in the 640 and 704 pixels modes (sprite types F, E and D)
- jo_vdp2_set_sprite_priorities(const unsigned char p0, const unsigned char p1, const unsigned char p2, const unsigned char p3) -> void: The priorities of the sprites (by default all the sprites have the priority of jo_core_set_screens_order()): chosen by the color of a sprite (its bits 14-13 in palette mode, its 2 highest bits in the...
- jo_vdp2_set_sprite_blend_ratios(const unsigned char r0, const unsigned char r1, const unsigned char r2, const unsigned char r3) -> void: The 4 blend ratios of the sprites (jo_vdp2_enable_blend() gives the same ratio to all of them), chosen by the color of a sprite (its bits 12-11 in palette mode, its 2 highest bits in the 640 and 704...
- JO_VDP2_SPECIAL_COLOR(INDEX): The special color code of the palette colors whose index ends with c (index & 15 = c): c and c ^ 1 share a code (see jo_vdp2_set_special_colors())
- jo_vdp2_set_special_colors(const unsigned char codes) -> void: Choose the special colors of the screens (see jo_vdp2_enable_special_priority() and jo_vdp2_enable_special_blend())
- jo_vdp2_enable_special_priority(const jo_scroll_screen screens) -> void: The special colors of the screens are drawn one priority above the others pixels of the screen (a window or lights of a background over the screen just above it, the sprites behind a part of the...
- jo_vdp2_disable_special_priority(const jo_scroll_screen screens) -> void: The screens have one priority again (see jo_vdp2_enable_special_priority())
- jo_vdp2_enable_special_blend(const jo_scroll_screen screens) -> void: Only the special colors of the screens are mixed (jo_vdp2_enable_blend()): the other pixels are opaque (the windows of a building, the water of a map)
- jo_vdp2_disable_special_blend(const jo_scroll_screen screens) -> void: All the pixels of the screens are mixed again (see jo_vdp2_enable_special_blend())
- JO_VDP2_SHADOW_COLOR: The color of a shadow: a polygon or the pixels of a palette sprite drawn with it darken the screens under them by half (see jo_vdp2_enable_shadow()). The sprite itself is not shown
- jo_vdp2_enable_shadow(const jo_scroll_screen screens) -> void: The shadows darken these screens
- jo_vdp2_disable_shadow(void) -> void: No screen is darkened by the shadows (see jo_vdp2_enable_shadow())
- jo_vdp2_enable_mosaic(const jo_scroll_screen screens, const int width, const int height) -> void: Enable the mosaic effect (big pixels)
- jo_vdp2_disable_mosaic(void) -> void: Disable the mosaic effect (see jo_vdp2_enable_mosaic())
- jo_vdp2_get_registers(void) -> const unsigned short *: The values the engine gave to the VDP2 registers (most of them can't be read from the VDP2): the next VBLANK copies the new values to the VDP2
- jo_vdp2_restore(void) -> void: Give the VDP2 back to the engine after the game wrote its registers and its VRAM by itself (a video in full screen): the registers again as the engine set them (at the next VBLANK), the VRAM cleared,...
- jo_vdp2_start_framebuffer(const bool bits16, const int palette_id, int * const pitch) -> void *: Show a frame buffer: a bitmap of NBG0 in the whole VRAM of the VDP2, that the CPUs draw (a video, a software renderer, an effect drawn pixel by pixel). The other backgrounds are hidden (their VRAM is...
- jo_vdp2_stop_framebuffer(void) -> void: Hide the frame buffer (jo_vdp2_start_framebuffer()): the registers of the engine again, the VRAM cleared, the font of jo_printf() and the back screen color drawn again (see jo_vdp2_restore()): the...
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.
- JO_WATER_MAX_WAVES: Waves at most in the swell
- JO_WATER_MAX_LEVELS: Levels at most
- JO_WATER_MAX_CELLS: Quads on a side of a level at most
- jo_water_wave: A wave of the swell (a sine along a direction)
- jo_water_level: A level of the grid
- jo_water_steps: Gouraud steps per channel (16: the color as it is)
- jo_water_config: Configuration of the water (jo_water_default_config(), then change what you need)
- jo_water_point: Height and slopes of the surface at a point (see jo_water_sample())
- typedef struct s_jo_water jo_water: The water (see jo_water_create())
- jo_water_default_config(jo_water_config * const config) -> void: A configuration that works: 4 levels (quads of 8, 16, 32, 64 units), the swell JO_WATER_SWELL_CHOPPY, the look JO_WATER_LOOK_DEFAULT
- jo_water_look_kind: The standard looks of the water (its color and the light of its waves, see jo_water_config_look())
- jo_water_config_look(jo_water_config * const config, const jo_water_look_kind look) -> void: Set a standard look in a configuration: color, shallow, deep, sky, slope_light_min, slope_light_max, glint (the rest as it is; for a water already made: then jo_water_set_look())
- jo_water_look_blend(const jo_water_look_kind look) -> int: The mix of the water with the bottom of the sea that goes with a standard look (see jo_water_blend_with_bottom())
- jo_water_blend_with_bottom(const int blend) -> void: The water seen through: the VDP2 mixes the RGB pixels of the sprites (the water, the objects under it, see jo_water_add_model()) with the screen behind them (the bottom of the sea: RBG0 for...
- jo_water_swell_kind: The standard swells (see jo_water_swell()): waves of 130 to 700 units, for quads of 16 to 64 units near the camera (jo_water_config.levels: a wave is drawn on the levels with min_cells_per_wave quads...
- jo_water_swell(jo_water_wave * const waves, const jo_water_swell_kind swell) -> int: A standard swell (its directions not along the grid of the water)
- jo_water_create(const jo_water_config * const config) -> jo_water *: Create the water: load the textures, create the grid
- jo_water_free(jo_water * const w) -> void: Free the water: its memory, its gouraud tables (given back when they are the last sprites), its objects (jo_water_add_model(), jo_water_add_mesh(): forgotten, their jo_water_object too)
- jo_water_update(jo_water * const w, const int frame, const int x, const int y, const int z, const jo_angle heading) -> void: Move the waves to the time of the frame and the grid around the camera, compute the heights and the light
- jo_water_draw(jo_water * const w) -> void: Draw the water (after jo_3d_camera_look_at())
- jo_water_draw_with(jo_water * const w, void (*objects)(void), void (*objects_on_slave)(void)) -> void: Draw the water and the objects on it: the master CPU draws some objects while the slave CPU draws the water near the camera, then other objects (the time of the drawing on both CPUs: the slave CPU...
- jo_water_quad_side(const jo_water * const w, const int x, const int z) -> int: Side of the quads of the water drawn at a point (the finest level that covers it, see jo_water_config.levels): an object seen through the water (under it) is sorted nearer than the point where it is...
- jo_water_height(const jo_water * const w, const int x, const int z) -> jo_fixed: Height of the surface at a point (the waves, the splashes, the wave fronts at the time of jo_water_update())
- jo_water_drawn_height(const jo_water * const w, const int x, const int z) -> jo_fixed: Height of the surface as it is drawn at a point (the vertices of the finest level that covers it, interpolated): cheap (no sine), for many points (along a line of sight); the waves...
- jo_water_wave_height(const jo_water * const w, const int x, const int z) -> jo_fixed: Height of the waves at a point, without the splashes and the wave fronts (faster than jo_water_height(): many points, for instance along a line of sight)
- jo_water_sample(const jo_water * const w, const int x, const int z, jo_water_point * const point) -> void: Height and slopes of the surface at a point: for an object on the water (its height, its tilt)
- jo_water_floating: An object that falls in the water and floats on the waves (a crate, a barrel, a buoy): see jo_water_float()
- jo_water_floating_init(jo_water_floating * const f, const int x, const int z, const int height, const int half, const int sink) -> void: Start an object above the water (it falls, see jo_water_float())
- jo_water_float(jo_water * const w, jo_water_floating * const f) -> void: Move a floating object (once per frame, after jo_water_update()): it falls (gravity), splashes in the water (a ring of waves as high as its speed, see jo_water_drop()), then floats: a damped spring...
- jo_water_set_waves(jo_water * const w, const jo_water_wave * const waves, const int count) -> void: Change the swell (a calm sea, a storm, the wind turns)
- jo_water_set_swell(jo_water * const w, const jo_fixed scale) -> void: Strength of the swell: the heights of the waves x scale (a storm that grows, a calm that comes)
- jo_water_drop(jo_water * const w, const int x, const int z, const int height) -> void: An object falls in the water: a ring of waves goes away from the point (near the camera only)
- jo_water_wave_front(jo_water * const w, const int x, const int z, const jo_angle direction, const int height, const int width) -> void: A straight wave (2 crests, the second one the highest) that goes from a point in a direction: it grows, then fades out (a half sine over config.front_life frames; near the camera only)
- jo_water_foam(jo_water * const w, const int x, const int z, const int radius, const int life) -> void: Foam on the water (a trail, a wake, a splash): a disc of the foam grid (cells of 8 units around the camera, 1024 units: the foam out of it is lost), white at once, it fades out in life frames (the...
- jo_water_set_depth_map(jo_water * const w, const unsigned char * const map, const int size, const int shift, const int x, const int z) -> void: The depth of the water around (a map of bytes: 0 the shore, 255 deep): the shallow water is lighter (config.shore), the waves break on the shore (config.surf)
- jo_water_foam_at(const jo_water * const w, const int x, const int z) -> int: Foam at a point (0 to 255, see jo_water_foam())
- jo_water_set_sun(jo_water * const w, const jo_angle azimuth, const jo_angle elevation) -> void: Position of the sun (the light, the glints, the spot)
- jo_water_set_textured(jo_water * const w, const bool textured) -> void: The foam texture or not (see jo_water_config.textured)
- jo_water_get_config(const jo_water * const w) -> const jo_water_config *: The configuration of the water (read only: the look can be changed with jo_water_set_look())
- jo_water_seen_color(const jo_water * const w, const jo_color object, const int amount) -> jo_color: The color of the water seen from above (its color with the light of config.shallow: the face of a wave toward the camera), 5 to 21 steps per channel (a gouraud of 16 +/- 5 stays in 0 to 31): the...
- jo_water_set_look(jo_water * const w, const jo_water_config * const look) -> void: Change the look (the colors and the light: color, shallow, deep, sky, slope_light_min/max, glint, spot, spot_distance, caustics, reflection, foam_white, foam_color, shore, shallow_depth, surf,...
- typedef struct s_jo_water_object jo_water_object: An object under the water (see jo_water_add_model())
- JO_WATER_MAX_OBJECTS: Objects under the water at most
- JO_WATER_MAX_ABOVE: Objects above the water given in a frame at most (see jo_water_add_above())
- jo_water_add_model(jo_water * const w, jo_3d_model * const model, const int amount, const int far, jo_water_object ** const objects) -> int: Put a model under the water: an object per group of the model (OBJ o or g: a rock, the foot of a pillar, a part of a wreck; the whole model if it has no group). Its colors become its colors seen...
- jo_water_add_mesh(jo_water * const w, jo_3d_mesh * const mesh, const int first, const int count, const int amount, const int far) -> jo_water_object *: Put polygons of a mesh under the water (see jo_water_add_model()): a mesh made by the program, its points changed in any frame (see jo_water_reshape())
- jo_water_place(jo_water_object * const o, const int x, const int y, const int z, const jo_angle heading) -> void: Place the space of an object (the space of the points of its mesh): the world by default
- jo_water_show(jo_water_object * const o, const bool shown, const unsigned int hidden) -> void: Show or hide an object, hide some of its polygons
- jo_water_reshape(jo_water_object * const o) -> void: The points of the mesh of an object changed: its size and its depth again (after jo_water_show(): only the polygons drawn)
- jo_water_set_far(jo_water_object * const o, const int far) -> void: Change the distance where an object is not drawn any more (units: |dx| + |dz|)
- jo_water_add_above(jo_water * const w, const int x, const int y, const int z, const int radius, const int key_offset) -> void: An object above the water in front of which the objects under the water stay (a jet ski, a buoy, a boat): an object under the water that it covers on the screen is sorted behind it. Call it each...
- typedef struct s_jo_water_dip jo_water_dip: An object on the water whose polygons under the surface are seen through the water (the hull of a boat, of a jet ski: see jo_water_add_dip())
- JO_WATER_DIP_LEVELS: Depth levels of a jo_water_dip at most
- jo_water_add_dip(jo_water * const w, jo_3d_mesh * const mesh, const int levels, const short * const amounts, const jo_fixed * const depths, const int palette_offset) -> jo_water_dip *: Prepare a floating object: its polygons under the surface take their colors seen through the water, deeper: more of the water (see jo_water_dip_mesh()); its own attributes are kept for the polygons...
- jo_water_dip_mesh(jo_water_dip * const d, const jo_fixed surface, const jo_angle pitch, const jo_angle roll) -> void: Set the colors of the polygons of a floating object from the depth of their middles under the surface (call it before it is drawn)
- jo_water_free_dip(jo_water_dip * const d) -> void: Free a floating object (jo_water_add_dip(), JO_NULL: nothing)
weapon.h: Weapons of the player
In the makefile of the game: JO_COMPILE_WITH_FS_MODULE, on by default.