Reverted GX FIFO breakage.
[libogc.git] / gc / ogc / video.h
blob500391efab142cb2add9700aeee79ea53fe66e77
1 /*-------------------------------------------------------------
3 video.h -- VIDEO subsystem
5 Copyright (C) 2004
6 Michael Wiedenbauer (shagkur)
7 Dave Murphy (WinterMute)
9 This software is provided 'as-is', without any express or implied
10 warranty. In no event will the authors be held liable for any
11 damages arising from the use of this software.
13 Permission is granted to anyone to use this software for any
14 purpose, including commercial applications, and to alter it and
15 redistribute it freely, subject to the following restrictions:
17 1. The origin of this software must not be misrepresented; you
18 must not claim that you wrote the original software. If you use
19 this software in a product, an acknowledgment in the product
20 documentation would be appreciated but is not required.
22 2. Altered source versions must be plainly marked as such, and
23 must not be misrepresented as being the original software.
25 3. This notice may not be removed or altered from any source
26 distribution.
28 -------------------------------------------------------------*/
31 #ifndef __VIDEO_H__
32 #define __VIDEO_H__
34 /*!
35 * \file video.h
36 * \brief VIDEO subsystem
38 */
40 #include <gctypes.h>
41 #include "gx_struct.h"
42 #include "video_types.h"
44 #ifdef __cplusplus
45 extern "C" {
46 #endif /* __cplusplus */
49 /*!
50 * \typedef void (*VIRetraceCallback)(u32 retraceCnt)
51 * \brief function pointer typedef for the user's retrace callback
52 * \param[in] retraceCnt current retrace count
54 typedef void (*VIRetraceCallback)(u32 retraceCnt);
56 typedef void (*VIPositionCallback)(u32 posX,u32 posY);
58 void* VIDEO_GetNextFramebuffer();
59 void* VIDEO_GetCurrentFramebuffer();
62 /*!
63 * \fn void VIDEO_Init()
64 * \brief Initializes the VIDEO subsystem. This call should be done in the early stages of your main()
66 * \return none
68 void VIDEO_Init();
71 /*!
72 * \fn void VIDEO_Flush()
73 * \brief Flush the shadow registers to the drivers video registers.
75 * \return none
77 void VIDEO_Flush();
80 /*!
81 * \fn void VIDEO_SetBlack(boolean black)
82 * \brief Blackout the VIDEO interface.
84 * \param[in] black Boolean flag to determine whether to blackout the VI or not.
86 * \return none
88 void VIDEO_SetBlack(boolean black);
91 /*!
92 * \fn u32 VIDEO_GetNextField()
93 * \brief Get the next field in DS mode.
95 * \return \ref vi_fielddef "field"
97 u32 VIDEO_GetNextField();
100 /*!
101 * \fn u32 VIDEO_GetCurrentLine()
102 * \brief Get current video line
104 * \return linenumber
106 u32 VIDEO_GetCurrentLine();
109 /*!
110 * \fn u32 VIDEO_GetCurrentTvMode()
111 * \brief Get current configured TV mode
113 * \return \ref vi_standardtypedef "tvmode"
115 u32 VIDEO_GetCurrentTvMode();
118 /*!
119 * \fn void VIDEO_Configure(GXRModeObj *rmode)
120 * \brief Configure the VI with the given render mode object
122 * \param[in] rmode pointer to the video/render mode \ref gxrmode_obj "configuration".
124 * \return none
126 void VIDEO_Configure(GXRModeObj *rmode);
129 /*!
130 * \fn void VIDEO_ClearFrameBuffer(GXRModeObj *rmode,void *fb,u32 color)
131 * \brief Clear the given framebuffer.
133 * \param[in] rmode pointer to a GXRModeObj, specifying the mode.
134 * \param[in] fb pointer to the startaddress of the framebuffer to clear.
135 * \param[in] color YUYUV value to use for clearing.
137 * \return none
139 void VIDEO_ClearFrameBuffer(GXRModeObj *rmode,void *fb,u32 color);
142 /*!
143 * \fn void VIDEO_WaitVSync(void)
144 * \brief Wait on the next vertical retrace
146 * \return none
148 void VIDEO_WaitVSync(void);
151 /*!
152 * \fn void VIDEO_SetNextFramebuffer(void *fb)
153 * \brief Set the framebuffer for the next VI register update.
155 * \return none
157 void VIDEO_SetNextFramebuffer(void *fb);
160 /*!
161 * \fn void VIDEO_SetNextRightFramebuffer(void *fb)
162 * \brief Set the right framebuffer for the next VI register update. This is used for 3D Gloves for instance.
164 * \return none
166 void VIDEO_SetNextRightFramebuffer(void *fb);
169 /*!
170 * \fn VIRetraceCallback VIDEO_SetPreRetraceCallback(VIRetraceCallback callback)
171 * \brief Set the Pre-Retrace callback function. This function is called within the video interrupt handler before the VI registers will be updated.
173 * \param[in] callback pointer to the callback function which is called at pre-retrace.
175 * \return Old pre-retrace callback or NULL
177 VIRetraceCallback VIDEO_SetPreRetraceCallback(VIRetraceCallback callback);
180 /*!
181 * \fn VIRetraceCallback VIDEO_SetPostRetraceCallback(VIRetraceCallback callback)
182 * \brief Set the Post-Retrace callback function. This function is called within the video interrupt handler after the VI registers are updated.
184 * \param[in] callback pointer to the callback function which is called at post-retrace.
186 * \return Old post-retrace callback or NULL
188 VIRetraceCallback VIDEO_SetPostRetraceCallback(VIRetraceCallback callback);
191 /*!
192 * \fn u32 VIDEO_HaveComponentCable(void)
193 * \brief Check for a component cable. This function returns 1 when a Component (YPbPr) cable is connected.
195 * \return 1 if a component cable is connected, 0 otherwise
197 u32 VIDEO_HaveComponentCable(void);
199 GXRModeObj * VIDEO_GetPreferredMode(GXRModeObj *mode);
201 #ifdef __cplusplus
203 #endif /* __cplusplus */
205 #endif