ps2sdk
1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
|
#include <dma_tags.h>
#include <gif_tags.h>
#include <gs_privileged.h>
#include <gs_gp.h>
#include <gs_psm.h>
#include <draw.h>
#include <draw2d.h>
Go to the source code of this file.
Functions | |
qword_t * | draw_setup_environment (qword_t *q, int context, framebuffer_t *frame, zbuffer_t *z) |
qword_t * | draw_disable_tests (qword_t *q, int context, zbuffer_t *z) |
qword_t * | draw_enable_tests (qword_t *q, int context, zbuffer_t *z) |
qword_t * | draw_clear (qword_t *q, int context, float x, float y, float width, float height, int r, int g, int b) |
qword_t * | draw_finish (qword_t *q) |
void | draw_wait_finish (void) |
qword_t * | draw_texture_flush (qword_t *q) |
qword_t * | draw_texture_transfer (qword_t *q, void *src, int width, int height, int psm, int dest, int dest_width) |
unsigned char | draw_log2 (unsigned int x) |
qword_t* draw_clear | ( | qword_t * | q, |
int | context, | ||
float | x, | ||
float | y, | ||
float | width, | ||
float | height, | ||
int | r, | ||
int | g, | ||
int | b | ||
) |
Clear the screen based on the screen's origin, width, and height using the defined color.
Definition at line 148 of file draw.c.
References rect_t::color, context, draw_rect_filled_strips(), GIF_REG_AD, GIF_SET_TAG, GS_REG_PRMODE, GS_REG_PRMODECONT, GS_SET_PRMODE, GS_SET_PRMODECONT, GS_SET_RGBAQ, PACK_GIFTAG, PRIM_OVERRIDE_DISABLE, PRIM_OVERRIDE_ENABLE, color_t::rgbaq, rect_t::v0, rect_t::v1, vertex_t::x, x, vertex_t::y, y, and vertex_t::z.
Referenced by clear_screen(), main(), render(), and run_demo().
Disable pixel testing defaults
Definition at line 120 of file draw.c.
References ATEST_KEEP_FRAMEBUFFER, ATEST_METHOD_NOTEQUAL, context, DRAW_DISABLE, DRAW_ENABLE, GIF_FLG_PACKED, GIF_REG_AD, GIF_SET_TAG, GS_REG_TEST, GS_SET_TEST, PACK_GIFTAG, and ZTEST_METHOD_ALLPASS.
Referenced by clear_screen(), and render().
Enable pixel testing defaults
Definition at line 134 of file draw.c.
References ATEST_KEEP_FRAMEBUFFER, ATEST_METHOD_NOTEQUAL, context, DRAW_DISABLE, DRAW_ENABLE, GIF_FLG_PACKED, GIF_REG_AD, GIF_SET_TAG, GS_REG_TEST, GS_SET_TEST, zbuffer_t::method, and PACK_GIFTAG.
Referenced by clear_screen(), and render().
Signal that drawing is finished
Definition at line 188 of file draw.c.
References GIF_FLG_PACKED, GIF_REG_AD, GIF_SET_TAG, GS_REG_FINISH, and PACK_GIFTAG.
Referenced by clear_screen(), draw_init_env(), flip_buffers(), init_drawing_environment(), render(), and run_demo().
unsigned char draw_log2 | ( | unsigned int | x | ) |
Returns the power of 2 needed for texture width and height
Definition at line 348 of file draw.c.
References x.
Referenced by InitCB(), run_demo(), set_lod_clut_prim_tex_buff(), and setup_texture().
qword_t* draw_setup_environment | ( | qword_t * | q, |
int | context, | ||
framebuffer_t * | frame, | ||
zbuffer_t * | z | ||
) |
Sets up the drawing environment based on the framebuffer and zbuffer settings
Definition at line 11 of file draw.c.
References framebuffer_t::address, zbuffer_t::address, blend_t::alpha, ALPHA_CORRECT_RGBA16, ALPHA_CORRECT_RGBA32, ALPHA_EXPAND_NORMAL, ATEST_KEEP_FRAMEBUFFER, ATEST_METHOD_NOTEQUAL, BLEND_ALPHA_SOURCE, BLEND_COLOR_DEST, BLEND_COLOR_SOURCE, blend_t::color1, blend_t::color2, blend_t::color3, atest_t::compval, context, DRAW_DISABLE, DRAW_ENABLE, zbuffer_t::enable, atest_t::enable, dtest_t::enable, ztest_t::enable, blend_t::fixed_alpha, ftoi4, GIF_FLG_PACKED, GIF_REG_AD, GIF_SET_TAG, GS_DISABLE, GS_ENABLE, GS_PSM_16, GS_PSM_16S, GS_REG_ALPHA, GS_REG_CLAMP, GS_REG_COLCLAMP, GS_REG_DIMX, GS_REG_DTHE, GS_REG_FBA, GS_REG_FOGCOL, GS_REG_FRAME, GS_REG_PABE, GS_REG_PRMODECONT, GS_REG_SCISSOR, GS_REG_TEST, GS_REG_TEXA, GS_REG_XYOFFSET, GS_REG_ZBUF, GS_SET_ALPHA, GS_SET_CLAMP, GS_SET_COLCLAMP, GS_SET_DIMX, GS_SET_DTHE, GS_SET_FBA, GS_SET_FOGCOL, GS_SET_FRAME, GS_SET_PABE, GS_SET_PRMODECONT, GS_SET_SCISSOR, GS_SET_TEST, GS_SET_TEXA, GS_SET_XYOFFSET, GS_SET_ZBUF, framebuffer_t::height, texwrap_t::horizontal, atest_t::keep, framebuffer_t::mask, zbuffer_t::mask, texwrap_t::maxu, texwrap_t::maxv, zbuffer_t::method, atest_t::method, ztest_t::method, texwrap_t::minu, texwrap_t::minv, PACK_GIFTAG, dtest_t::pass, PRIM_OVERRIDE_DISABLE, framebuffer_t::psm, texwrap_t::vertical, framebuffer_t::width, WRAP_CLAMP, zbuffer_t::zsm, and ZTEST_METHOD_ALLPASS.
Referenced by draw_init_env(), init_drawing_environment(), and main().
Flush the texture cache
Definition at line 208 of file draw.c.
References DMATAG_END, GIF_FLG_PACKED, GIF_REG_AD, GIF_SET_TAG, GS_REG_TEXFLUSH, and PACK_GIFTAG.
Referenced by init_texture(), load_texture(), and send_texture().
qword_t* draw_texture_transfer | ( | qword_t * | q, |
void * | src, | ||
int | width, | ||
int | height, | ||
int | psm, | ||
int | dest, | ||
int | dest_width | ||
) |
Creates a dma chain filled with image information
Definition at line 223 of file draw.c.
References DMATAG_CNT, DMATAG_REF, GIF_BLOCK_SIZE, GIF_FLG_PACKED, GIF_REG_AD, GIF_SET_TAG, GS_PSM_16, GS_PSM_16S, GS_PSM_24, GS_PSM_32, GS_PSM_4, GS_PSM_4HH, GS_PSM_4HL, GS_PSM_8, GS_PSM_8H, GS_PSMZ_16, GS_PSMZ_16S, GS_PSMZ_24, GS_PSMZ_32, GS_REG_BITBLTBUF, GS_REG_TRXDIR, GS_REG_TRXPOS, GS_REG_TRXREG, GS_SET_BITBLTBUF, GS_SET_TRXDIR, GS_SET_TRXPOS, GS_SET_TRXREG, and PACK_GIFTAG.
Referenced by init_texture(), load_texture(), and send_texture().
void draw_wait_finish | ( | void | ) |
Wait until finish event occurs
Definition at line 200 of file draw.c.
References GS_REG_CSR.
Referenced by clear_screen(), flip_buffers(), init_drawing_environment(), render(), and run_demo().