sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Loading...
Searching...
No Matches
graph.h File Reference
#include <graph_vram.h>

Go to the source code of this file.

Macros

#define GRAPH_MODE_AUTO   0
#define GRAPH_MODE_NTSC   1
#define GRAPH_MODE_PAL   2
#define GRAPH_MODE_HDTV_480P   3
#define GRAPH_MODE_HDTV_576P   4
#define GRAPH_MODE_HDTV_720P   5
#define GRAPH_MODE_HDTV_1080I   6
#define GRAPH_MODE_VGA_640_60   7
#define GRAPH_MODE_VGA_640_72   8
#define GRAPH_MODE_VGA_640_75   9
#define GRAPH_MODE_VGA_640_85   10
#define GRAPH_MODE_VGA_800_56   11
#define GRAPH_MODE_VGA_800_60   12
#define GRAPH_MODE_VGA_800_72   13
#define GRAPH_MODE_VGA_800_75   14
#define GRAPH_MODE_VGA_800_85   15
#define GRAPH_MODE_VGA_1024_60   16
#define GRAPH_MODE_VGA_1024_70   17
#define GRAPH_MODE_VGA_1024_75   18
#define GRAPH_MODE_VGA_1024_85   19
#define GRAPH_MODE_VGA_1280_60   20
#define GRAPH_MODE_VGA_1280_75   21
#define GRAPH_MODE_NONINTERLACED   0
#define GRAPH_MODE_INTERLACED   1
#define GRAPH_MODE_FIELD   0
#define GRAPH_MODE_FRAME   1
#define GRAPH_FIELD_EVEN   0
#define GRAPH_FIELD_ODD   1
#define GRAPH_DISABLE   0
#define GRAPH_ENABLE   1
#define GRAPH_GCONT_RGB   0
#define GRAPH_GCONT_YCRCB   1
#define GRAPH_CMOD_NTSC   2
#define GRAPH_CMOD_PAL   3
#define GRAPH_VALUE_RC1   0
#define GRAPH_VALUE_ALPHA   1
#define GRAPH_RC1_ALPHA   0
#define GRAPH_RC2_ALPHA   1
#define GRAPH_BLEND_RC2   0
#define GRAPH_BLEND_BGCOLOR   1

Functions

int graph_initialize (int fbp, int width, int height, int psm, int x, int y)
int graph_get_region (void)
float graph_aspect_ratio (void)
void graph_enable_output (void)
void graph_disable_output (void)
int graph_set_mode (int interlace, int mode, int ffmd, int flicker_filter)
int graph_set_screen (int x, int y, int width, int height)
void graph_set_framebuffer_filtered (int fbp, int width, int psm, int x, int y)
void graph_set_framebuffer (int context, int fbp, int width, int psm, int x, int y)
void graph_set_bgcolor (unsigned char r, unsigned char g, unsigned char b)
void graph_set_output (int rc1, int rc2, int alpha_select, int alpha_output, int blend_method, unsigned char alpha)
int graph_add_vsync_handler (int(*vsync_callback)(int cause))
void graph_remove_vsync_handler (int callback_id)
void graph_wait_hsync (void)
void graph_wait_vsync (void)
int graph_check_vsync (void)
void graph_start_vsync (void)
int graph_shutdown (void)

Detailed Description

Graph library

Definition in file graph.h.

Macro Definition Documentation

◆ GRAPH_BLEND_BGCOLOR

#define GRAPH_BLEND_BGCOLOR   1

Definition at line 88 of file graph.h.

◆ GRAPH_BLEND_RC2

#define GRAPH_BLEND_RC2   0

Alpha blending method

Definition at line 87 of file graph.h.

◆ GRAPH_CMOD_NTSC

#define GRAPH_CMOD_NTSC   2

Definition at line 75 of file graph.h.

◆ GRAPH_CMOD_PAL

#define GRAPH_CMOD_PAL   3

Definition at line 76 of file graph.h.

◆ GRAPH_DISABLE

#define GRAPH_DISABLE   0

Generic use

Definition at line 68 of file graph.h.

◆ GRAPH_ENABLE

#define GRAPH_ENABLE   1

Definition at line 69 of file graph.h.

◆ GRAPH_FIELD_EVEN

#define GRAPH_FIELD_EVEN   0

Definition at line 64 of file graph.h.

◆ GRAPH_FIELD_ODD

#define GRAPH_FIELD_ODD   1

Definition at line 65 of file graph.h.

◆ GRAPH_GCONT_RGB

#define GRAPH_GCONT_RGB   0

Smode1 parameters

Definition at line 72 of file graph.h.

◆ GRAPH_GCONT_YCRCB

#define GRAPH_GCONT_YCRCB   1

Definition at line 73 of file graph.h.

◆ GRAPH_MODE_AUTO

#define GRAPH_MODE_AUTO   0

Automatic NTSC or PAL mode setting.

Definition at line 14 of file graph.h.

◆ GRAPH_MODE_FIELD

#define GRAPH_MODE_FIELD   0

Definition at line 61 of file graph.h.

◆ GRAPH_MODE_FRAME

#define GRAPH_MODE_FRAME   1

Definition at line 62 of file graph.h.

◆ GRAPH_MODE_HDTV_1080I

#define GRAPH_MODE_HDTV_1080I   6

1920 x 1080

Definition at line 26 of file graph.h.

◆ GRAPH_MODE_HDTV_480P

#define GRAPH_MODE_HDTV_480P   3

720 x 480

Definition at line 20 of file graph.h.

◆ GRAPH_MODE_HDTV_576P

#define GRAPH_MODE_HDTV_576P   4

656 x 576

Definition at line 22 of file graph.h.

◆ GRAPH_MODE_HDTV_720P

#define GRAPH_MODE_HDTV_720P   5

1280 x 720

Definition at line 24 of file graph.h.

◆ GRAPH_MODE_INTERLACED

#define GRAPH_MODE_INTERLACED   1

Definition at line 59 of file graph.h.

◆ GRAPH_MODE_NONINTERLACED

#define GRAPH_MODE_NONINTERLACED   0

Definition at line 58 of file graph.h.

◆ GRAPH_MODE_NTSC

#define GRAPH_MODE_NTSC   1

256 x 224 to 640 x 448

Definition at line 16 of file graph.h.

◆ GRAPH_MODE_PAL

#define GRAPH_MODE_PAL   2

256 x 256 to 640 x 512

Definition at line 18 of file graph.h.

◆ GRAPH_MODE_VGA_1024_60

#define GRAPH_MODE_VGA_1024_60   16

1024 x 768 @ 60hz

Definition at line 46 of file graph.h.

◆ GRAPH_MODE_VGA_1024_70

#define GRAPH_MODE_VGA_1024_70   17

1024 x 768 @ 70hz

Definition at line 48 of file graph.h.

◆ GRAPH_MODE_VGA_1024_75

#define GRAPH_MODE_VGA_1024_75   18

1024 x 768 @ 75hz

Definition at line 50 of file graph.h.

◆ GRAPH_MODE_VGA_1024_85

#define GRAPH_MODE_VGA_1024_85   19

1024 x 768 @ 85hz

Definition at line 52 of file graph.h.

◆ GRAPH_MODE_VGA_1280_60

#define GRAPH_MODE_VGA_1280_60   20

1280 x 1024 @ 60hz

Definition at line 54 of file graph.h.

◆ GRAPH_MODE_VGA_1280_75

#define GRAPH_MODE_VGA_1280_75   21

1280 x 1024 @ 75hz

Definition at line 56 of file graph.h.

◆ GRAPH_MODE_VGA_640_60

#define GRAPH_MODE_VGA_640_60   7

640 x 480 @ 60hz

Definition at line 28 of file graph.h.

◆ GRAPH_MODE_VGA_640_72

#define GRAPH_MODE_VGA_640_72   8

640 x 480 @ 72hz

Definition at line 30 of file graph.h.

◆ GRAPH_MODE_VGA_640_75

#define GRAPH_MODE_VGA_640_75   9

640 x 480 @ 75hz

Definition at line 32 of file graph.h.

◆ GRAPH_MODE_VGA_640_85

#define GRAPH_MODE_VGA_640_85   10

640 x 480 @ 85hz

Definition at line 34 of file graph.h.

◆ GRAPH_MODE_VGA_800_56

#define GRAPH_MODE_VGA_800_56   11

800 x 600 @ 56hz

Definition at line 36 of file graph.h.

◆ GRAPH_MODE_VGA_800_60

#define GRAPH_MODE_VGA_800_60   12

800 x 600 @ 60hz

Definition at line 38 of file graph.h.

◆ GRAPH_MODE_VGA_800_72

#define GRAPH_MODE_VGA_800_72   13

800 x 600 @ 72hz

Definition at line 40 of file graph.h.

◆ GRAPH_MODE_VGA_800_75

#define GRAPH_MODE_VGA_800_75   14

800 x 600 @ 75hz

Definition at line 42 of file graph.h.

◆ GRAPH_MODE_VGA_800_85

#define GRAPH_MODE_VGA_800_85   15

800 x 600 @ 85hz

Definition at line 44 of file graph.h.

◆ GRAPH_RC1_ALPHA

#define GRAPH_RC1_ALPHA   0

Alpha output value

Definition at line 83 of file graph.h.

◆ GRAPH_RC2_ALPHA

#define GRAPH_RC2_ALPHA   1

Definition at line 84 of file graph.h.

◆ GRAPH_VALUE_ALPHA

#define GRAPH_VALUE_ALPHA   1

Definition at line 80 of file graph.h.

◆ GRAPH_VALUE_RC1

#define GRAPH_VALUE_RC1   0

Alpha Blending value to use

Definition at line 79 of file graph.h.

Function Documentation

◆ graph_add_vsync_handler()

int graph_add_vsync_handler ( int(* vsync_callback )(int cause))
extern

Add a vsync interrupt handler

Definition at line 29 of file graph.c.

◆ graph_aspect_ratio()

float graph_aspect_ratio ( void )
extern

Returns an aspect ratio calculated from system setting, width, and height

Definition at line 411 of file graph_mode.c.

◆ graph_check_vsync()

int graph_check_vsync ( void )
extern

Checks if a vertical sync event is currently generated.

Definition at line 85 of file graph.c.

◆ graph_disable_output()

void graph_disable_output ( void )
extern

Turns off the read circuits.

Definition at line 342 of file graph_mode.c.

◆ graph_enable_output()

void graph_enable_output ( void )
extern

Sets a default output method.

Definition at line 324 of file graph_mode.c.

◆ graph_get_region()

int graph_get_region ( void )
extern

Retrieves the PS2's region for automatic mode selection.

Definition at line 123 of file graph_mode.c.

◆ graph_initialize()

int graph_initialize ( int fbp,
int width,
int height,
int psm,
int x,
int y )
extern

Initializes a default NTSC/PAL mode with default settings.

Definition at line 6 of file graph.c.

◆ graph_remove_vsync_handler()

void graph_remove_vsync_handler ( int callback_id)
extern

Remove a vsync interrupt handler

Definition at line 46 of file graph.c.

◆ graph_set_bgcolor()

void graph_set_bgcolor ( unsigned char r,
unsigned char g,
unsigned char b )
extern

Sets the background color for merge circuit.

Definition at line 306 of file graph_mode.c.

◆ graph_set_framebuffer()

void graph_set_framebuffer ( int context,
int fbp,
int width,
int psm,
int x,
int y )
extern

Sets the framebuffer attributes for the read circuits.

Definition at line 287 of file graph_mode.c.

◆ graph_set_framebuffer_filtered()

void graph_set_framebuffer_filtered ( int fbp,
int width,
int psm,
int x,
int y )
extern

Sets the framebuffer attributes for the read circuits with filter.

Definition at line 277 of file graph_mode.c.

◆ graph_set_mode()

int graph_set_mode ( int interlace,
int mode,
int ffmd,
int flicker_filter )
extern

Sets the graphics mode.

Definition at line 139 of file graph_mode.c.

◆ graph_set_output()

void graph_set_output ( int rc1,
int rc2,
int alpha_select,
int alpha_output,
int blend_method,
unsigned char alpha )
extern

Sets the read circuits and merge cicuit.

Definition at line 313 of file graph_mode.c.

◆ graph_set_screen()

int graph_set_screen ( int x,
int y,
int width,
int height )
extern

Sets the screen dimensions for the read circuits.

Definition at line 195 of file graph_mode.c.

◆ graph_shutdown()

int graph_shutdown ( void )
extern

Shut down the graphics library and hardware.

Definition at line 440 of file graph_mode.c.

◆ graph_start_vsync()

void graph_start_vsync ( void )
extern

Starts a vertical sync event and returns immediately.

Definition at line 92 of file graph.c.

◆ graph_wait_hsync()

void graph_wait_hsync ( void )
extern

Starts a horizontal sync event and waits

Definition at line 74 of file graph.c.

◆ graph_wait_vsync()

void graph_wait_vsync ( void )
extern

Starts a vertical sync event and waits.

Definition at line 99 of file graph.c.