ps2sdk  1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
draw_buffers.h
Go to the documentation of this file.
1 
6 #ifndef __DRAW_BUFFERS_H__
7 #define __DRAW_BUFFERS_H__
8 
9 #include <tamtypes.h>
10 
12 #define TEXTURE_COMPONENTS_RGB 0
13 #define TEXTURE_COMPONENTS_RGBA 1
14 
16 #define TEXTURE_FUNCTION_MODULATE 0
17 #define TEXTURE_FUNCTION_DECAL 1
18 #define TEXTURE_FUNCTION_HIGHLIGHT 2
19 #define TEXTURE_FUNCTION_HIGHLIGHT2 3
20 
22 #define CLUT_STORAGE_MODE1 0
23 #define CLUT_STORAGE_MODE2 1
24 
26 #define CLUT_NO_LOAD 0
27 #define CLUT_LOAD 1
28 #define CLUT_LOAD_COPY_CBP0 2
29 #define CLUT_LOAD_COPY_CBP1 3
30 #define CLUT_COMPARE_CBP0 4
31 #define CLUT_COMPARE_CBP1 5
32 
33 typedef struct {
34  unsigned char width;
35  unsigned char height;
36  unsigned char components;
37  unsigned char function;
38 } texinfo_t;
39 
40 typedef struct {
41  unsigned int address;
42  unsigned int width;
43  unsigned int height;
44  unsigned int psm;
45  unsigned int mask;
47 
48 typedef struct {
49  unsigned int enable;
50  unsigned int method;
51  unsigned int address;
52  unsigned int zsm;
53  unsigned int mask;
54 } zbuffer_t;
55 
56 typedef struct {
57  unsigned int address;
58  unsigned int width;
59  unsigned int psm;
61 } texbuffer_t;
62 
63 typedef struct {
64  unsigned int address;
65  unsigned int psm;
66  unsigned int storage_mode;
67  unsigned int start;
68  unsigned int load_method;
69 } clutbuffer_t;
70 
71 #ifdef __cplusplus
72 extern "C" {
73 #endif
74 
76 unsigned char draw_log2(unsigned int x);
77 
80 
82 qword_t *draw_zbuffer(qword_t *q, int context, zbuffer_t *zbuffer);
83 
86 
89 
91 qword_t *draw_clut_offset(qword_t *q, int cbw, int u, int v);
92 
93 #ifdef __cplusplus
94 }
95 #endif
96 
97 #endif /* __DRAW_BUFFERS_H__ */
u8 context
Definition: main.c:71
clutbuffer_t clut
Definition: main.c:80
unsigned char draw_log2(unsigned int x)
Definition: draw.c:348
qword_t * draw_clut_offset(qword_t *q, int cbw, int u, int v)
qword_t * draw_texturebuffer(qword_t *q, int context, texbuffer_t *texbuffer, clutbuffer_t *clut)
qword_t * draw_zbuffer(qword_t *q, int context, zbuffer_t *zbuffer)
qword_t * draw_clutbuffer(qword_t *q, int context, int psm, clutbuffer_t *clut)
qword_t * draw_framebuffer(qword_t *q, int context, framebuffer_t *frame)
s32 x
Definition: libmouse.c:34
unsigned int load_method
Definition: draw_buffers.h:68
unsigned int start
Definition: draw_buffers.h:67
unsigned int storage_mode
Definition: draw_buffers.h:66
unsigned int psm
Definition: draw_buffers.h:65
unsigned int address
Definition: draw_buffers.h:64
unsigned int address
Definition: draw_buffers.h:41
unsigned int height
Definition: draw_buffers.h:43
unsigned int psm
Definition: draw_buffers.h:44
unsigned int mask
Definition: draw_buffers.h:45
unsigned int width
Definition: draw_buffers.h:42
unsigned int address
Definition: draw_buffers.h:57
unsigned int width
Definition: draw_buffers.h:58
unsigned int psm
Definition: draw_buffers.h:59
texinfo_t info
Definition: draw_buffers.h:60
unsigned char height
Definition: draw_buffers.h:35
unsigned char components
Definition: draw_buffers.h:36
unsigned char width
Definition: draw_buffers.h:34
unsigned int mask
Definition: draw_buffers.h:53
unsigned int method
Definition: draw_buffers.h:50
unsigned int address
Definition: draw_buffers.h:51
unsigned int enable
Definition: draw_buffers.h:49
unsigned int zsm
Definition: draw_buffers.h:52