PS2SDK
PS2 Homebrew Libraries
graph.h
Go to the documentation of this file.
1 
6 #ifndef __GRAPH_H__
7 #define __GRAPH_H__
8 
9 #include <graph_vram.h>
10 
11 // Sets screen mode
13 #define GRAPH_MODE_AUTO 0
14 
15 #define GRAPH_MODE_NTSC 1
16 
17 #define GRAPH_MODE_PAL 2
18 
19 #define GRAPH_MODE_HDTV_480P 3
20 
21 #define GRAPH_MODE_HDTV_576P 4
22 
23 #define GRAPH_MODE_HDTV_720P 5
24 
25 #define GRAPH_MODE_HDTV_1080I 6
26 
27 #define GRAPH_MODE_VGA_640_60 7
28 
29 #define GRAPH_MODE_VGA_640_72 8
30 
31 #define GRAPH_MODE_VGA_640_75 9
32 
33 #define GRAPH_MODE_VGA_640_85 10
34 
35 #define GRAPH_MODE_VGA_800_56 11
36 
37 #define GRAPH_MODE_VGA_800_60 12
38 
39 #define GRAPH_MODE_VGA_800_72 13
40 
41 #define GRAPH_MODE_VGA_800_75 14
42 
43 #define GRAPH_MODE_VGA_800_85 15
44 
45 #define GRAPH_MODE_VGA_1024_60 16
46 
47 #define GRAPH_MODE_VGA_1024_70 17
48 
49 #define GRAPH_MODE_VGA_1024_75 18
50 
51 #define GRAPH_MODE_VGA_1024_85 19
52 
53 #define GRAPH_MODE_VGA_1280_60 20
54 
55 #define GRAPH_MODE_VGA_1280_75 21
56 
57 #define GRAPH_MODE_NONINTERLACED 0
58 #define GRAPH_MODE_INTERLACED 1
59 
60 #define GRAPH_MODE_FIELD 0
61 #define GRAPH_MODE_FRAME 1
62 
63 #define GRAPH_FIELD_EVEN 0
64 #define GRAPH_FIELD_ODD 1
65 
67 #define GRAPH_DISABLE 0
68 #define GRAPH_ENABLE 1
69 
71 #define GRAPH_GCONT_RGB 0
72 #define GRAPH_GCONT_YCRCB 1
73 
74 #define GRAPH_CMOD_NTSC 2
75 #define GRAPH_CMOD_PAL 3
76 
78 #define GRAPH_VALUE_RC1 0
79 #define GRAPH_VALUE_ALPHA 1
80 
82 #define GRAPH_RC1_ALPHA 0
83 #define GRAPH_RC2_ALPHA 1
84 
86 #define GRAPH_BLEND_RC2 0
87 #define GRAPH_BLEND_BGCOLOR 1
88 
89 typedef struct {
90  int x,y;
91  int width, height;
92  int mode;
93 } GRAPH_MODE;
94 
95 extern GRAPH_MODE graph_mode[];
96 
97 #ifdef __cplusplus
98 extern "C" {
99 #endif
100 
102 extern int graph_initialize(int fbp, int width, int height, int psm, int x, int y);
103 
105 extern int graph_get_region(void);
106 
108 extern float graph_aspect_ratio(void);
109 
111 extern void graph_enable_output(void);
112 
114 extern void graph_disable_output(void);
115 
117 extern int graph_set_mode(int interlace, int mode, int ffmd, int flicker_filter);
118 
120 extern int graph_set_screen(int x, int y, int width, int height);
121 
123 extern void graph_set_framebuffer_filtered(int fbp, int width, int psm, int x, int y);
124 
126 extern void graph_set_framebuffer(int context, int fbp, int width, int psm, int x, int y);
127 
129 extern void graph_set_bgcolor(unsigned char r, unsigned char g, unsigned char b);
130 
132 extern void graph_set_output(int rc1, int rc2, int alpha_select, int alpha_output, int blend_method, unsigned char alpha);
133 
135 extern int graph_add_vsync_handler(int (*vsync_callback)(int cause));
136 
138 extern void graph_remove_vsync_handler(int callback_id);
139 
141 extern void graph_wait_hsync(void);
142 
144 extern void graph_wait_vsync(void);
145 
147 extern int graph_check_vsync(void);
148 
150 extern void graph_start_vsync(void);
151 
153 extern int graph_shutdown(void);
154 
166 
167 #ifdef __cplusplus
168 }
169 #endif
170 
171 #endif /* __GRAPH_H__ */
graph_wait_hsync
void graph_wait_hsync(void)
Definition: graph.c:74
graph_wait_vsync
void graph_wait_vsync(void)
Definition: graph.c:99
graph_remove_vsync_handler
void graph_remove_vsync_handler(int callback_id)
Definition: graph.c:46
graph_check_vsync
int graph_check_vsync(void)
Definition: graph.c:85
graph_shutdown
int graph_shutdown(void)
Definition: graph_mode.c:433
graph_get_region
int graph_get_region(void)
Definition: graph_mode.c:114
graph_vram.h
graph_start_vsync
void graph_start_vsync(void)
Definition: graph.c:92
graph_set_framebuffer_filtered
void graph_set_framebuffer_filtered(int fbp, int width, int psm, int x, int y)
Definition: graph_mode.c:268
graph_set_output
void graph_set_output(int rc1, int rc2, int alpha_select, int alpha_output, int blend_method, unsigned char alpha)
Definition: graph_mode.c:304
GRAPH_MODE
Definition: graph.h:89
graph_enable_output
void graph_enable_output(void)
Definition: graph_mode.c:315
graph_aspect_ratio
float graph_aspect_ratio(void)
Definition: graph_mode.c:402
graph_initialize
int graph_initialize(int fbp, int width, int height, int psm, int x, int y)
Definition: graph.c:6
graph_set_framebuffer
void graph_set_framebuffer(int context, int fbp, int width, int psm, int x, int y)
Definition: graph_mode.c:278
graph_set_bgcolor
void graph_set_bgcolor(unsigned char r, unsigned char g, unsigned char b)
Definition: graph_mode.c:297
graph_set_screen
int graph_set_screen(int x, int y, int width, int height)
Definition: graph_mode.c:186
graph_disable_output
void graph_disable_output(void)
Definition: graph_mode.c:333
graph_add_vsync_handler
int graph_add_vsync_handler(int(*vsync_callback)(int cause))
Definition: graph.c:29
graph_set_mode
int graph_set_mode(int interlace, int mode, int ffmd, int flicker_filter)
Definition: graph_mode.c:130