PS2SDK
PS2 Homebrew Libraries
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 extern unsigned char draw_log2(unsigned int x);
77 
79 extern qword_t *draw_framebuffer(qword_t *q, int context, framebuffer_t *frame);
80 
82 extern qword_t *draw_zbuffer(qword_t *q, int context, zbuffer_t *zbuffer);
83 
85 extern qword_t *draw_texturebuffer(qword_t *q, int context, texbuffer_t *texbuffer, clutbuffer_t *clut);
86 
88 extern qword_t *draw_clutbuffer(qword_t *q, int context, int psm, clutbuffer_t *clut);
89 
91 extern 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__ */
draw_zbuffer
qword_t * draw_zbuffer(qword_t *q, int context, zbuffer_t *zbuffer)
Definition: draw_environment.c:45
clutbuffer_t
Definition: draw_buffers.h:63
s_info
Definition: xprintf.c:78
draw_texturebuffer
qword_t * draw_texturebuffer(qword_t *q, int context, texbuffer_t *texbuffer, clutbuffer_t *clut)
Definition: draw_environment.c:57
texinfo_t
Definition: draw_buffers.h:33
framebuffer_t
Definition: draw_buffers.h:40
zbuffer_t
Definition: draw_buffers.h:48
tamtypes.h
draw_clutbuffer
qword_t * draw_clutbuffer(qword_t *q, int context, int psm, clutbuffer_t *clut)
Definition: draw_environment.c:77
draw_clut_offset
qword_t * draw_clut_offset(qword_t *q, int cbw, int u, int v)
Definition: draw_environment.c:95
draw_log2
unsigned char draw_log2(unsigned int x)
Definition: draw.c:349
draw_framebuffer
qword_t * draw_framebuffer(qword_t *q, int context, framebuffer_t *frame)
Definition: draw_environment.c:33
texbuffer_t
Definition: draw_buffers.h:56