KallistiOS  ##version##
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
vblank.h
Go to the documentation of this file.
1 /* KallistiOS ##version##
2 
3  dc/vblank.h
4  Copyright (C)2003 Dan Potter
5 
6 */
7 
8 /** \file dc/vblank.h
9  \brief VBlank handler registration.
10 
11  This file allows functions to be registered to be called on each vblank
12  interrupt that occurs. This gives a way to schedule small functions that
13  must occur regularly, without using threads.
14 
15  \author Dan Potter
16 */
17 
18 #ifndef __DC_VBLANK_H
19 #define __DC_VBLANK_H
20 
21 #include <sys/cdefs.h>
22 __BEGIN_DECLS
23 
24 #include <dc/asic.h>
25 
26 /** \brief Add a vblank handler.
27 
28  This function adds a handler to the vblank handler list. The function will
29  be called at the start of every vblank period with the same parameters that
30  were passed to the IRQ handler for vblanks.
31 
32  \param hnd The handler to add.
33  \return The handle id on success, or <0 on failure.
34 */
36 
37 /** \brief Remove a vblank handler.
38 
39  This function removes the specified handler from the vblank handler list.
40 
41  \param handle The handle id to remove (returned by
42  vblank_handler_add() when the handler was added).
43  \retval 0 On success.
44  \retval -1 On failure.
45 */
46 int vblank_handler_remove(int handle);
47 
48 /* \cond */
49 /** Initialize the vblank handler. This must be called after the asic module
50  is initialized. */
51 int vblank_init();
52 
53 /** Shut down the vblank handler. */
54 int vblank_shutdown();
55 /* \endcond */
56 
57 __END_DECLS
58 
59 #endif /* __DC_VBLANK_H */
60 
int vblank_handler_remove(int handle)
Remove a vblank handler.
Dreamcast ASIC event handling support.
void(* asic_evt_handler)(uint32 code)
ASIC event handler type.
Definition: asic.h:146
int vblank_handler_add(asic_evt_handler hnd)
Add a vblank handler.