![]() |
Jo Engine 2026.11.1
Jo Sega Saturn Engine
|
VDP1 command table handling. More...
Go to the source code of this file.
Data Structures | |
| struct | jo_vdp1_command |
| VDP1 command (32 bytes). More... | |
| struct | jo_vdp1_sprite_attribute |
| Sprite attribute. More... | |
| struct | jo_vdp1_sprite_position |
| Sprite position (internal usage). More... | |
| struct | jo_vdp1_window |
| 3D window (internal usage) More... | |
Macros | |
| #define | JO_VDP1_MAX_COMMANDS |
| Maximum commands per frame (sprites, polygons, the headers of the windows). Each one costs 36 bytes of RAM per command buffer (2 buffers with the second CPU) + 4 bytes for the sort; the 3D of the slave CPU can write JO_VDP1_MAX_COMMANDS - 40 commands. | |
| #define | JO_VDP1_CMD_NORMAL_SPRITE |
| VDP1 command types (CMDCTRL). | |
| #define | JO_VDP1_CMD_SCALED_SPRITE |
| #define | JO_VDP1_CMD_DISTORTED_SPRITE |
| #define | JO_VDP1_CMD_POLYGON |
| #define | JO_VDP1_CMD_POLYLINE |
| #define | JO_VDP1_CMD_LINE |
| #define | JO_VDP1_CMD_USER_CLIP |
| #define | JO_VDP1_CMD_SYSTEM_CLIP |
| #define | JO_VDP1_CMD_LOCAL_COORD |
| #define | JO_VDP1_CMD_SKIP_ASSIGN |
| #define | JO_VDP1_CMD_END |
| #define | JO_VDP1_FUNCTION_SPRITE |
| Normal sprite. | |
| #define | JO_VDP1_FUNCTION_TEXTURE |
| Textured polygon (distorted sprite). | |
| #define | JO_VDP1_FUNCTION_POLYGON |
| Polygon. | |
| #define | JO_VDP1_FUNCTION_POLYLINE |
| Polyline. | |
| #define | JO_VDP1_FUNCTION_LINE |
| Line. | |
| #define | JO_VDP1_FUNCTION_USER_CLIP |
| User clipping area. | |
| #define | JO_VDP1_FUNCTION_SYSTEM_CLIP |
| System clipping area. | |
| #define | JO_VDP1_FUNCTION_LOCAL_COORDINATES |
| Local coordinates. | |
| #define | JO_VDP1_DIRECTION_FUNCTION_MASK |
| Drawing function mask of the direction attribute. | |
| #define | JO_VDP1_DIRECTION_FLIP_MASK |
| Flip mask of the direction attribute (CMDCTRL layout). | |
| #define | JO_VDP1_H_FLIP |
| Horizontal flip bit of the direction attribute (CMDCTRL layout). | |
| #define | JO_VDP1_MSB_ON |
| Write the MSB of the frame buffer (shadow). | |
| #define | JO_VDP1_HIGH_SPEED_SHRINK |
| High speed shrink. | |
| #define | JO_VDP1_NO_WINDOW |
| No clipping window. | |
| #define | JO_VDP1_WINDOW_IN |
| Draw inside the user clipping area. | |
| #define | JO_VDP1_WINDOW_OUT |
| Draw outside the user clipping area. | |
| #define | JO_VDP1_MESH |
| Mesh (screen door). | |
| #define | JO_VDP1_NO_MESH |
| No mesh. | |
| #define | JO_VDP1_END_CODE_DISABLE |
| Disable end code (texture). | |
| #define | 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()). | |
| #define | JO_VDP1_TRANSPARENT_PIXEL_DISABLE |
| Disable transparent pixel (texture). | |
| #define | JO_VDP1_COLOR_MODE_16_BANK |
| Texture color mode: 16 colors (color bank). | |
| #define | JO_VDP1_COLOR_MODE_16_LOOKUP |
| Texture color mode: 16 colors (lookup table). | |
| #define | JO_VDP1_COLOR_MODE_64_BANK |
| Texture color mode: 64 colors (color bank). | |
| #define | JO_VDP1_COLOR_MODE_128_BANK |
| Texture color mode: 128 colors (color bank). | |
| #define | JO_VDP1_COLOR_MODE_256_BANK |
| Texture color mode: 256 colors (color bank). | |
| #define | JO_VDP1_COLOR_MODE_RGB |
| Texture color mode: RGB (32768 colors). | |
| #define | JO_VDP1_COLOR_MODE_MASK |
| Color mode mask. | |
| #define | JO_VDP1_COLOR_CALC_REPLACE |
| Color calculation: replace. | |
| #define | JO_VDP1_COLOR_CALC_SHADOW |
| Color calculation: shadow. | |
| #define | JO_VDP1_COLOR_CALC_HALF_LUMINANCE |
| Color calculation: half luminance. | |
| #define | JO_VDP1_COLOR_CALC_HALF_TRANSPARENT |
| Color calculation: half transparent. | |
| #define | JO_VDP1_COLOR_CALC_GOURAUD |
| Color calculation: gouraud shading. | |
| #define | JO_VDP1_COLOR_CALC_MASK |
| Color calculation mask. | |
| #define | JO_VDP1_NO_GOURAUD |
| No gouraud table. | |
| #define | JO_VDP1_NO_PALETTE |
| No palette (color). | |
| #define | JO_VDP1_TEXTURE_SIZE_SHIFT_16_COLORS |
| Texture size shift for 16 colors textures (4 bits per pixel). | |
| #define | JO_VDP1_TEXTURE_SIZE_SHIFT_256_COLORS |
| Texture size shift for 64, 128 and 256 colors textures (8 bits per pixel). | |
| #define | JO_VDP1_TEXTURE_SIZE_SHIFT_32K_COLORS |
| Texture size shift for RGB textures (16 bits per pixel). | |
| #define | JO_VDP1_OPTION_USE_TEXTURE |
| Option (bits 16-23 of the direction attribute): the polygon is textured. | |
| #define | JO_VDP1_SPRITE_NO_FLIP |
| Textured sprite without flip. | |
| #define | JO_VDP1_SPRITE_H_FLIP |
| Textured sprite with horizontal flip. | |
| #define | JO_VDP1_SPRITE_V_FLIP |
| Textured sprite with vertical flip. | |
| #define | JO_VDP1_SPRITE_HV_FLIP |
| Textured sprite with horizontal and vertical flip. | |
| #define | JO_VDP1_POLYGON |
| Flat color polygon. | |
| #define | JO_VDP1_POLYLINE |
| Flat color polyline. | |
| #define | JO_VDP1_LINE |
| Flat color line. | |
| #define | JO_VDP1_DIRECTION_COMMAND(DIRECTION) |
| Command bits of a direction attribute (drawing function and flip). | |
| #define | JO_VDP1_DIRECTION_OPTIONS(DIRECTION) |
| Options of a direction attribute (JO_VDP1_OPTION_USE_TEXTURE). | |
| #define | JO_VDP1_DIRECTION_DRAW_MODE(DIRECTION) |
| Draw mode bits of a direction attribute (JO_VDP1_END_CODE_DISABLE, JO_VDP1_TRANSPARENT_PIXEL_DISABLE). | |
| #define | JO_VDP1_SPRITE_ATTRIBUTE(TEXTURE, COLOR, GOURAUD, DRAW_MODE, DIRECTION) |
| Sprite attribute initializer. | |
| #define | JO_VDP1_LIGHT_TABLE_OFFSET |
| Gouraud tables used for 3D lighting (32 brightness levels, 16 is neutral). | |
| #define | 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). | |
| #define | JO_VDP1_CLIP_GOURAUD_TABLE_COUNT |
| Gouraud tables of the clipped and subdivided 3D polygons (8 bytes each). | |
| #define | JO_VDP1_WINDOW_COUNT |
| 3D windows (internal usage) | |
| #define | JO_VDP1_MAX_KEY |
| Biggest depth key. | |
Functions | |
| void | __jo_vdp1_init (void) |
| Initialize the VDP1 (internal usage). | |
| void | __jo_vdp1_end_frame (void) |
| Sort the commands of the frame and copy them into the VDP1 VRAM (internal usage). | |
| void | __jo_vdp1_vblank (void) |
| Display the last complete command table (internal usage, called during VBLANK-IN). | |
| unsigned int | __jo_vdp1_frame_tag (void) |
| Number of the frame being built (internal usage): the VDP2 changes that must match the image of this frame are kept with this number and applied when it is displayed (see __jo_vdp1_displayed_frame_changed()). | |
| bool | __jo_vdp1_displayed_frame_changed (unsigned int *const tag) |
| Called during the VBLANK, after __jo_vdp1_vblank() (internal usage, a VBLANK callback): the image of an other frame is displayed from this field. | |
| void | jo_vdp1_redraw_last_frame (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_command * | __jo_vdp1_add_command (const jo_fixed z) |
| Allocate a command for the current frame (internal usage). | |
| jo_vdp1_command * | __jo_vdp1_reserve_commands (const unsigned int count, unsigned short **keys, unsigned int *reserved) |
| Reserve commands for the current frame (internal usage). | |
| unsigned short * | __jo_vdp1_commit_commands_without_window (const unsigned int used) |
| Add the first commands reserved by __jo_vdp1_reserve_commands() to the frame, their windows written by the caller (internal usage: the slave CPU copies its commands, see jo_3d_slave_end()). | |
| void | __jo_vdp1_commit_commands (const unsigned int used) |
| Add the first commands reserved by __jo_vdp1_reserve_commands() to the frame (internal usage). | |
| static __jo_force_inline unsigned short | __jo_vdp1_sort_key (const jo_fixed z) |
| Depth key of a command (internal usage). | |
| bool | __jo_vdp1_set_attribute (jo_vdp1_command *cmd, const jo_vdp1_sprite_attribute *attr) |
| Fill the drawing part of a command from a sprite attribute (internal usage). | |
| static __jo_force_inline void | __jo_vdp1_update_near_clip (void) |
| Compute the near clipping distance (internal usage). | |
| static __jo_force_inline jo_fixed | __jo_vdp1_near_clip (void) |
| Near clipping distance (internal usage). | |
| bool | __jo_vdp1_draw_sprite (const jo_vdp1_sprite_position *const pos, const jo_vdp1_sprite_attribute *const attr, const jo_angle angle) |
| Draw a sprite on the screen (internal usage). | |
| bool | __jo_vdp1_draw_sprite_hv (const jo_vdp1_sprite_position *const pos, const jo_vdp1_sprite_attribute *const attr, const jo_angle angle) |
| Draw a sprite on the screen with different horizontal and vertical scale (internal usage). | |
| bool | __jo_vdp1_draw_sprite_4p (const jo_pos2D_fixed *const points, const jo_fixed z, const jo_vdp1_sprite_attribute *const attr) |
| Draw a sprite or a polygon using 4 points (internal usage). | |
| bool | __jo_vdp1_write_sprite_4p (jo_vdp1_command *const cmd, const jo_pos2D_fixed *const points, const jo_fixed z, const jo_vdp1_sprite_attribute *const attr, const int window) |
| Write the command of a sprite using 4 points in a command table of the caller (internal usage: the slave CPU, see jo_3d_slave_draw_standing_sprite()). | |
| void | __jo_sprite_attributes_of (jo_vdp1_sprite_attribute *attr, const int sprite_id, const jo_sprite_attributes *const state) |
| Attribute of a sprite with some sprite attributes (internal usage: the slave CPU uses its copy of them, see jo_3d_slave_begin()). | |
| bool | __jo_vdp1_draw_sprite_3d (const jo_vdp1_sprite_position *const pos, const jo_vdp1_sprite_attribute *const attr, const jo_angle angle) |
| Draw a sprite in the 3D space using the current matrix (internal usage). | |
| void | __jo_vdp1_set_window (const short left, const short top, const short right, const short bottom, const short zlimit, const short center_x, const short center_y) |
| Set the current 3D window (internal usage). | |
| static __jo_force_inline void | __jo_vdp1_select_window (const int window) |
| Select the 3D window used by the next commands (internal usage). | |
| int | jo_vdp1_command_count (void) |
| VDP1 commands of the last frame (the polygons, their parts, the sprites: see jo_vdp1_command_max()). | |
| int | __jo_vdp1_frame_command_count (void) |
| VDP1 commands of the frame being made by the master CPU, read without the cache (internal usage: the budget of the subdivisions, see 3d.c; the commands of the slave CPU are added at jo_3d_slave_end()). | |
| int | jo_vdp1_command_max (void) |
| Most VDP1 commands in a frame (the next ones are not drawn). | |
Variables | |
| jo_vdp1_window | __jo_vdp1_windows [(3)] |
| int | __jo_vdp1_current_window |
| Current 3D window (internal usage). | |
| jo_fixed | __jo_vdp1_projection_distance |
| Projection distance in Q16.16 (internal usage, see jo_3d_perspective_angle()). | |
| unsigned short | __jo_vdp1_display_level |
| Near clipping divisor (internal usage, see jo_3d_display_level()). | |
| int | __jo_vdp1_depth_bias |
| Depth added to the keys of the commands (see jo_3d_set_depth_bias()). | |
| short | __jo_vdp1_system_clip_right |
| Right of the system clipping area (internal usage). | |
| short | __jo_vdp1_system_clip_bottom |
| Bottom of the system clipping area (internal usage). | |
| jo_fixed | __jo_vdp1_near_z |
| Near clipping distance (internal usage, see __jo_vdp1_near_clip()). | |
| bool | __jo_vdp1_wireframe |
| Wireframe mode (internal usage, see jo_3d_set_wireframe()). | |
VDP1 command table handling.
| struct jo_vdp1_command |
| struct jo_vdp1_sprite_attribute |
| struct jo_vdp1_sprite_position |
| struct jo_vdp1_window |
3D window (internal usage)
| Data Fields | ||
|---|---|---|
| short | bottom | |
| short | center_x | |
| short | center_y | |
| unsigned short | clip_mode | |
| short | left | |
| short | right | |
| short | top | |
| jo_fixed | zlimit | |
| #define JO_VDP1_CLIP_GOURAUD_TABLE_COUNT |
Gouraud tables of the clipped and subdivided 3D polygons (8 bytes each).
| #define 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).
| #define JO_VDP1_CMD_DISTORTED_SPRITE |
| #define JO_VDP1_CMD_END |
| #define JO_VDP1_CMD_LINE |
| #define JO_VDP1_CMD_LOCAL_COORD |
| #define JO_VDP1_CMD_NORMAL_SPRITE |
VDP1 command types (CMDCTRL).
| #define JO_VDP1_CMD_POLYGON |
| #define JO_VDP1_CMD_POLYLINE |
| #define JO_VDP1_CMD_SCALED_SPRITE |
| #define JO_VDP1_CMD_SKIP_ASSIGN |
| #define JO_VDP1_CMD_SYSTEM_CLIP |
| #define JO_VDP1_CMD_USER_CLIP |
| #define JO_VDP1_COLOR_CALC_GOURAUD |
Color calculation: gouraud shading.
| #define JO_VDP1_COLOR_CALC_HALF_LUMINANCE |
Color calculation: half luminance.
| #define JO_VDP1_COLOR_CALC_HALF_TRANSPARENT |
Color calculation: half transparent.
| #define JO_VDP1_COLOR_CALC_MASK |
Color calculation mask.
| #define JO_VDP1_COLOR_CALC_REPLACE |
Color calculation: replace.
| #define JO_VDP1_COLOR_CALC_SHADOW |
Color calculation: shadow.
| #define JO_VDP1_COLOR_MODE_128_BANK |
Texture color mode: 128 colors (color bank).
| #define JO_VDP1_COLOR_MODE_16_BANK |
Texture color mode: 16 colors (color bank).
| #define JO_VDP1_COLOR_MODE_16_LOOKUP |
Texture color mode: 16 colors (lookup table).
| #define JO_VDP1_COLOR_MODE_256_BANK |
Texture color mode: 256 colors (color bank).
| #define JO_VDP1_COLOR_MODE_64_BANK |
Texture color mode: 64 colors (color bank).
| #define JO_VDP1_COLOR_MODE_MASK |
Color mode mask.
| #define JO_VDP1_COLOR_MODE_RGB |
Texture color mode: RGB (32768 colors).
| #define JO_VDP1_DIRECTION_COMMAND | ( | DIRECTION | ) |
Command bits of a direction attribute (drawing function and flip).
| DIRECTION | JO_VDP1_SPRITE_NO_FLIP, JO_VDP1_POLYGON, etc |
| #define JO_VDP1_DIRECTION_DRAW_MODE | ( | DIRECTION | ) |
Draw mode bits of a direction attribute (JO_VDP1_END_CODE_DISABLE, JO_VDP1_TRANSPARENT_PIXEL_DISABLE).
| DIRECTION | JO_VDP1_SPRITE_NO_FLIP, JO_VDP1_POLYGON, etc |
| #define JO_VDP1_DIRECTION_FLIP_MASK |
Flip mask of the direction attribute (CMDCTRL layout).
| #define JO_VDP1_DIRECTION_FUNCTION_MASK |
Drawing function mask of the direction attribute.
| #define JO_VDP1_DIRECTION_OPTIONS | ( | DIRECTION | ) |
Options of a direction attribute (JO_VDP1_OPTION_USE_TEXTURE).
| DIRECTION | JO_VDP1_SPRITE_NO_FLIP, JO_VDP1_POLYGON, etc |
| #define JO_VDP1_END_CODE_DISABLE |
Disable end code (texture).
| #define JO_VDP1_FUNCTION_LINE |
Line.
| #define JO_VDP1_FUNCTION_LOCAL_COORDINATES |
Local coordinates.
| #define JO_VDP1_FUNCTION_POLYGON |
Polygon.
| #define JO_VDP1_FUNCTION_POLYLINE |
Polyline.
| #define JO_VDP1_FUNCTION_SPRITE |
Normal sprite.
| #define JO_VDP1_FUNCTION_SYSTEM_CLIP |
System clipping area.
| #define JO_VDP1_FUNCTION_TEXTURE |
Textured polygon (distorted sprite).
| #define JO_VDP1_FUNCTION_USER_CLIP |
User clipping area.
| #define JO_VDP1_H_FLIP |
Horizontal flip bit of the direction attribute (CMDCTRL layout).
| #define JO_VDP1_HIGH_SPEED_SHRINK |
High speed shrink.
| #define JO_VDP1_LIGHT_TABLE_OFFSET |
Gouraud tables used for 3D lighting (32 brightness levels, 16 is neutral).
| #define JO_VDP1_LINE |
Flat color line.
| #define JO_VDP1_MAX_COMMANDS |
Maximum commands per frame (sprites, polygons, the headers of the windows). Each one costs 36 bytes of RAM per command buffer (2 buffers with the second CPU) + 4 bytes for the sort; the 3D of the slave CPU can write JO_VDP1_MAX_COMMANDS - 40 commands.
| #define JO_VDP1_MAX_KEY |
Biggest depth key.
| #define JO_VDP1_MESH |
Mesh (screen door).
| #define JO_VDP1_MSB_ON |
Write the MSB of the frame buffer (shadow).
| #define JO_VDP1_NO_GOURAUD |
No gouraud table.
| #define JO_VDP1_NO_MESH |
No mesh.
| #define JO_VDP1_NO_PALETTE |
No palette (color).
| #define JO_VDP1_NO_WINDOW |
No clipping window.
| #define JO_VDP1_OPTION_USE_TEXTURE |
Option (bits 16-23 of the direction attribute): the polygon is textured.
| #define JO_VDP1_POLYGON |
Flat color polygon.
| #define JO_VDP1_POLYLINE |
Flat color polyline.
| #define 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()).
| #define JO_VDP1_SPRITE_ATTRIBUTE | ( | TEXTURE, | |
| COLOR, | |||
| GOURAUD, | |||
| DRAW_MODE, | |||
| DIRECTION ) |
Sprite attribute initializer.
| TEXTURE | Sprite id |
| COLOR | RGB color or palette |
| GOURAUD | Gouraud table address / 8 (JO_VDP1_NO_GOURAUD) |
| DRAW_MODE | JO_VDP1_COLOR_MODE_xxx | JO_VDP1_COLOR_CALC_xxx | ... |
| DIRECTION | JO_VDP1_SPRITE_NO_FLIP, JO_VDP1_POLYGON, etc |
| #define JO_VDP1_SPRITE_H_FLIP |
Textured sprite with horizontal flip.
| #define JO_VDP1_SPRITE_HV_FLIP |
Textured sprite with horizontal and vertical flip.
| #define JO_VDP1_SPRITE_NO_FLIP |
Textured sprite without flip.
| #define JO_VDP1_SPRITE_V_FLIP |
Textured sprite with vertical flip.
| #define JO_VDP1_TEXTURE_SIZE_SHIFT_16_COLORS |
Texture size shift for 16 colors textures (4 bits per pixel).
| #define JO_VDP1_TEXTURE_SIZE_SHIFT_256_COLORS |
Texture size shift for 64, 128 and 256 colors textures (8 bits per pixel).
| #define JO_VDP1_TEXTURE_SIZE_SHIFT_32K_COLORS |
Texture size shift for RGB textures (16 bits per pixel).
| #define JO_VDP1_TRANSPARENT_PIXEL_DISABLE |
Disable transparent pixel (texture).
| #define JO_VDP1_WINDOW_COUNT |
3D windows (internal usage)
Number of 3D windows: near (default), far, and a second far window (see jo_3d_select_window())
| #define JO_VDP1_WINDOW_IN |
Draw inside the user clipping area.
| #define JO_VDP1_WINDOW_OUT |
Draw outside the user clipping area.
| void __jo_sprite_attributes_of | ( | jo_vdp1_sprite_attribute * | attr, |
| const int | sprite_id, | ||
| const jo_sprite_attributes *const | state ) |
Attribute of a sprite with some sprite attributes (internal usage: the slave CPU uses its copy of them, see jo_3d_slave_begin()).
| attr | Attribute (output) |
| sprite_id | Sprite Id |
| state | Sprite attributes |
| jo_vdp1_command * __jo_vdp1_add_command | ( | const jo_fixed | z | ) |
Allocate a command for the current frame (internal usage).
| z | Depth used to sort the commands (bigger = farther) |
| void __jo_vdp1_commit_commands | ( | const unsigned int | used | ) |
Add the first commands reserved by __jo_vdp1_reserve_commands() to the frame (internal usage).
| used | Command count |
| unsigned short * __jo_vdp1_commit_commands_without_window | ( | const unsigned int | used | ) |
Add the first commands reserved by __jo_vdp1_reserve_commands() to the frame, their windows written by the caller (internal usage: the slave CPU copies its commands, see jo_3d_slave_end()).
| used | Command count |
| bool __jo_vdp1_displayed_frame_changed | ( | unsigned int *const | tag | ) |
Called during the VBLANK, after __jo_vdp1_vblank() (internal usage, a VBLANK callback): the image of an other frame is displayed from this field.
| tag | Output: number of the frame displayed (see __jo_vdp1_frame_tag()) |
| bool __jo_vdp1_draw_sprite | ( | const jo_vdp1_sprite_position *const | pos, |
| const jo_vdp1_sprite_attribute *const | attr, | ||
| const jo_angle | angle ) |
Draw a sprite on the screen (internal usage).
| pos | Position relative to the center of the current window, depth and scale (scale_x, negative scale: perspective scale) |
| attr | Sprite attribute |
| angle | Rotation |
| bool __jo_vdp1_draw_sprite_3d | ( | const jo_vdp1_sprite_position *const | pos, |
| const jo_vdp1_sprite_attribute *const | attr, | ||
| const jo_angle | angle ) |
Draw a sprite in the 3D space using the current matrix (internal usage).
| pos | Position in the 3D space and scale (scale_x) |
| attr | Sprite attribute |
| angle | Rotation |
| bool __jo_vdp1_draw_sprite_4p | ( | const jo_pos2D_fixed *const | points, |
| const jo_fixed | z, | ||
| const jo_vdp1_sprite_attribute *const | attr ) |
Draw a sprite or a polygon using 4 points (internal usage).
| points | 4 points relative to the center of the current window (clockwise from the top left corner) |
| z | Depth |
| attr | Sprite attribute |
| bool __jo_vdp1_draw_sprite_hv | ( | const jo_vdp1_sprite_position *const | pos, |
| const jo_vdp1_sprite_attribute *const | attr, | ||
| const jo_angle | angle ) |
Draw a sprite on the screen with different horizontal and vertical scale (internal usage).
| pos | Position relative to the center of the current window, depth and scales (negative scale: perspective scale) |
| attr | Sprite attribute |
| angle | Rotation |
| void __jo_vdp1_end_frame | ( | void | ) |
Sort the commands of the frame and copy them into the VDP1 VRAM (internal usage).
| int __jo_vdp1_frame_command_count | ( | void | ) |
VDP1 commands of the frame being made by the master CPU, read without the cache (internal usage: the budget of the subdivisions, see 3d.c; the commands of the slave CPU are added at jo_3d_slave_end()).
| unsigned int __jo_vdp1_frame_tag | ( | void | ) |
Number of the frame being built (internal usage): the VDP2 changes that must match the image of this frame are kept with this number and applied when it is displayed (see __jo_vdp1_displayed_frame_changed()).
| void __jo_vdp1_init | ( | void | ) |
Initialize the VDP1 (internal usage).
|
static |
Near clipping distance (internal usage).
| jo_vdp1_command * __jo_vdp1_reserve_commands | ( | const unsigned int | count, |
| unsigned short ** | keys, | ||
| unsigned int * | reserved ) |
Reserve commands for the current frame (internal usage).
| count | Wanted command count |
| keys | Output: depth keys of the reserved commands (see __jo_vdp1_sort_key()) |
| reserved | Output: reserved command count (less than count if the table is full) |
|
static |
Select the 3D window used by the next commands (internal usage).
| window | 0 (near window), 1 (far window) or 2 (second far window) |
| bool __jo_vdp1_set_attribute | ( | jo_vdp1_command * | cmd, |
| const jo_vdp1_sprite_attribute * | attr ) |
Fill the drawing part of a command from a sprite attribute (internal usage).
| cmd | VDP1 command |
| attr | Sprite attribute |
| void __jo_vdp1_set_window | ( | const short | left, |
| const short | top, | ||
| const short | right, | ||
| const short | bottom, | ||
| const short | zlimit, | ||
| const short | center_x, | ||
| const short | center_y ) |
Set the current 3D window (internal usage).
| left | Left clipping position (screen pixels) |
| top | Top clipping position (screen pixels) |
| right | Right clipping position (screen pixels) |
| bottom | Bottom clipping position (screen pixels) |
| zlimit | Far clipping distance |
| center_x | Horizontal position of the projection center (screen pixels) |
| center_y | Vertical position of the projection center (screen pixels) |
|
static |
Depth key of a command (internal usage).
| z | Depth (bigger = farther) |
|
static |
Compute the near clipping distance (internal usage).
| void __jo_vdp1_vblank | ( | void | ) |
Display the last complete command table (internal usage, called during VBLANK-IN).
| bool __jo_vdp1_write_sprite_4p | ( | jo_vdp1_command *const | cmd, |
| const jo_pos2D_fixed *const | points, | ||
| const jo_fixed | z, | ||
| const jo_vdp1_sprite_attribute *const | attr, | ||
| const int | window ) |
Write the command of a sprite using 4 points in a command table of the caller (internal usage: the slave CPU, see jo_3d_slave_draw_standing_sprite()).
| cmd | Command (its sort key is written by the caller) |
| points | 4 points relative to the center of the window (clockwise from the top left corner) |
| z | Depth |
| attr | Sprite attribute |
| window | Window (its center and its far limit) |
| int jo_vdp1_command_count | ( | void | ) |
VDP1 commands of the last frame (the polygons, their parts, the sprites: see jo_vdp1_command_max()).
| int jo_vdp1_command_max | ( | void | ) |
Most VDP1 commands in a frame (the next ones are not drawn).
| void jo_vdp1_redraw_last_frame | ( | 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).
|
extern |
Current 3D window (internal usage).
|
extern |
Depth added to the keys of the commands (see jo_3d_set_depth_bias()).
|
extern |
Near clipping divisor (internal usage, see jo_3d_display_level()).
|
extern |
Near clipping distance (internal usage, see __jo_vdp1_near_clip()).
|
extern |
Projection distance in Q16.16 (internal usage, see jo_3d_perspective_angle()).
|
extern |
Bottom of the system clipping area (internal usage).
|
extern |
Right of the system clipping area (internal usage).
|
extern |
|
extern |
Wireframe mode (internal usage, see jo_3d_set_wireframe()).