PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
vblank.h
Go to the documentation of this file.
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
7# Licenced under Academic Free License version 2.0
8# Review ps2sdk README & LICENSE files for further details.
9*/
10
16#ifndef __VBLANK_H__
17#define __VBLANK_H__
18
19#include <irx.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25typedef struct vblank_ll_
26{
27 struct vblank_ll_ *next;
28 struct vblank_ll_ *prev;
30
31typedef struct vblank_item_
32{
33 vblank_ll_t ll;
34 int priority;
35 int (*callback)(void *userdata);
36 void *userdata;
38
39typedef struct vblank_internals_
40{
41 int ef;
42 int item_count;
43 vblank_ll_t list_00;
44 vblank_ll_t list_11;
45 vblank_ll_t list_free;
46 vblank_item_t list_items[16];
48
49vblank_internals_t *GetVblankInternalData(void);
50
51void WaitVblankStart();
52void WaitVblankEnd();
53void WaitVblank();
54void WaitNonVblank();
55
56int RegisterVblankHandler(int startend, int priority, int (*handler)(void *),
57 void *arg);
58int ReleaseVblankHandler(int startend, int (*handler)(void *));
59
60#define vblank_IMPORTS_start DECLARE_IMPORT_TABLE(vblank, 1, 1)
61#define vblank_IMPORTS_end END_IMPORT_TABLE
62
63#define I_WaitVblankStart DECLARE_IMPORT(4, WaitVblankStart)
64#define I_WaitVblankEnd DECLARE_IMPORT(5, WaitVblankEnd)
65#define I_WaitVblank DECLARE_IMPORT(6, WaitVblank)
66#define I_WaitNonVblank DECLARE_IMPORT(7, WaitNonVblank)
67#define I_RegisterVblankHandler DECLARE_IMPORT(8, RegisterVblankHandler)
68#define I_ReleaseVblankHandler DECLARE_IMPORT(9, ReleaseVblankHandler)
69
70#ifdef __cplusplus
71}
72#endif
73
74#endif /* __VBLANK_H__ */