ps2sdk
1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
|
#include <kernel.h>
#include <stdlib.h>
#include <tamtypes.h>
#include <math3d.h>
#include <packet.h>
#include <dma_tags.h>
#include <gif_tags.h>
#include <gs_psm.h>
#include <dma.h>
#include <graph.h>
#include <draw.h>
#include <draw3d.h>
#include "flower.c"
#include "mesh_data.c"
Go to the source code of this file.
Functions | |
void | init_gs (framebuffer_t *frame, zbuffer_t *z, texbuffer_t *texbuf) |
void | init_drawing_environment (framebuffer_t *frame, zbuffer_t *z) |
void | load_texture (texbuffer_t *texbuf) |
void | setup_texture (texbuffer_t *texbuf) |
int | render (framebuffer_t *frame, zbuffer_t *z) |
int | main (int argc, char **argv) |
Variables | |
unsigned char | flower [] |
VECTOR | object_position = { 0.00f, 0.00f, 0.00f, 1.00f } |
VECTOR | object_rotation = { 0.00f, 0.00f, 0.00f, 1.00f } |
VECTOR | camera_position = { 0.00f, 0.00f, 100.00f, 1.00f } |
VECTOR | camera_rotation = { 0.00f, 0.00f, 0.00f, 1.00f } |
void init_drawing_environment | ( | framebuffer_t * | frame, |
zbuffer_t * | z | ||
) |
Definition at line 68 of file texture.c.
References packet_t::data, DMA_CHANNEL_GIF, dma_channel_send_normal(), dma_wait_fast(), draw_finish(), draw_primitive_xyoffset(), draw_setup_environment(), packet, packet_free(), packet_init(), and PACKET_NORMAL.
Referenced by main().
void init_gs | ( | framebuffer_t * | frame, |
zbuffer_t * | z, | ||
texbuffer_t * | texbuf | ||
) |
Definition at line 41 of file texture.c.
References framebuffer_t::address, zbuffer_t::address, texbuffer_t::address, DRAW_ENABLE, zbuffer_t::enable, GRAPH_ALIGN_BLOCK, GRAPH_ALIGN_PAGE, graph_initialize(), graph_vram_allocate(), GS_PSM_24, GS_PSM_32, GS_ZBUF_32, framebuffer_t::height, framebuffer_t::mask, zbuffer_t::mask, zbuffer_t::method, framebuffer_t::psm, texbuffer_t::psm, framebuffer_t::width, texbuffer_t::width, zbuffer_t::zsm, and ZTEST_METHOD_GREATER_EQUAL.
Referenced by main().
void load_texture | ( | texbuffer_t * | texbuf | ) |
Definition at line 93 of file texture.c.
References texbuffer_t::address, packet_t::data, DMA_CHANNEL_GIF, dma_channel_send_chain(), dma_wait_fast(), draw_texture_flush(), draw_texture_transfer(), flower, GS_PSM_24, packet, packet_free(), packet_init(), PACKET_NORMAL, and texbuffer_t::width.
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 294 of file texture.c.
References dma_channel_fast_waits(), DMA_CHANNEL_GIF, dma_channel_initialize(), init_drawing_environment(), init_gs(), load_texture(), NULL, render(), setup_texture(), and SleepThread().
int render | ( | framebuffer_t * | frame, |
zbuffer_t * | z | ||
) |
Definition at line 153 of file texture.c.
References color_t::a, prim_t::antialiasing, color_t::b, prim_t::blending, calculate_vertices(), camera_position, camera_rotation, prim_t::colorfix, colours, context, coordinates, create_local_screen(), create_local_world(), create_view_screen(), create_world_view(), packet_t::data, DMA_CHANNEL_GIF, dma_channel_send_normal(), dma_wait_fast(), draw_clear(), draw_convert_rgbq(), draw_convert_st(), draw_convert_xyz(), DRAW_DISABLE, draw_disable_tests(), DRAW_ENABLE, draw_enable_tests(), draw_finish(), draw_prim_end(), draw_prim_start(), DRAW_STQ_REGLIST, draw_wait_finish(), prim_t::fogging, color_t::g, graph_aspect_ratio(), graph_wait_vsync(), framebuffer_t::height, local_screen, local_world, prim_t::mapping, prim_t::mapping_type, object_position, object_rotation, packet_init(), PACKET_NORMAL, packets, points, points_count, prim, PRIM_MAP_ST, PRIM_SHADE_GOURAUD, PRIM_TRIANGLE, PRIM_UNFIXED, color_t::q, color_t::r, color_t::rgbaq, rgbaq, prim_t::shading, temp_vertices, prim_t::type, texel_t::uv, vertex_count, vertices, view_screen, framebuffer_t::width, world_view, xyz_t::xyz, and xyz.
Referenced by main().
void setup_texture | ( | texbuffer_t * | texbuf | ) |
Definition at line 112 of file texture.c.
References clutbuffer_t::address, lod_t::calculation, clut, CLUT_NO_LOAD, CLUT_STORAGE_MODE1, texinfo_t::components, packet_t::data, DMA_CHANNEL_GIF, dma_channel_send_normal(), dma_wait_fast(), draw_log2(), draw_texture_sampling(), draw_texturebuffer(), texinfo_t::function, texinfo_t::height, texbuffer_t::info, lod_t::k, lod_t::l, clutbuffer_t::load_method, lod, LOD_MAG_NEAREST, LOD_MIN_NEAREST, LOD_USE_K, lod_t::mag_filter, lod_t::max_level, lod_t::min_filter, packet, packet_free(), packet_init(), PACKET_NORMAL, clutbuffer_t::psm, clutbuffer_t::start, clutbuffer_t::storage_mode, TEXTURE_COMPONENTS_RGB, TEXTURE_FUNCTION_DECAL, and texinfo_t::width.
Referenced by main().
VECTOR camera_position = { 0.00f, 0.00f, 100.00f, 1.00f } |
VECTOR camera_rotation = { 0.00f, 0.00f, 0.00f, 1.00f } |
|
extern |
Referenced by load_texture().
VECTOR object_position = { 0.00f, 0.00f, 0.00f, 1.00f } |