1 /*-------------------------------------------------------------
3 video.h -- VIDEO subsystem
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
28 -------------------------------------------------------------*/
36 * \brief VIDEO subsystem
41 #include "gx_struct.h"
42 #include "video_types.h"
46 #endif /* __cplusplus */
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();
63 * \fn void VIDEO_Init()
64 * \brief Initializes the VIDEO subsystem. This call should be done in the early stages of your main()
72 * \fn void VIDEO_Flush()
73 * \brief Flush the shadow registers to the drivers video registers.
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.
88 void VIDEO_SetBlack(boolean black
);
92 * \fn u32 VIDEO_GetNextField()
93 * \brief Get the next field in DS mode.
95 * \return \ref vi_fielddef "field"
97 u32
VIDEO_GetNextField();
101 * \fn u32 VIDEO_GetCurrentLine()
102 * \brief Get current video line
106 u32
VIDEO_GetCurrentLine();
110 * \fn u32 VIDEO_GetCurrentTvMode()
111 * \brief Get current configured TV mode
113 * \return \ref vi_standardtypedef "tvmode"
115 u32
VIDEO_GetCurrentTvMode();
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".
126 void VIDEO_Configure(GXRModeObj
*rmode
);
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.
139 void VIDEO_ClearFrameBuffer(GXRModeObj
*rmode
,void *fb
,u32 color
);
143 * \fn void VIDEO_WaitVSync(void)
144 * \brief Wait on the next vertical retrace
148 void VIDEO_WaitVSync(void);
152 * \fn void VIDEO_SetNextFramebuffer(void *fb)
153 * \brief Set the framebuffer for the next VI register update.
157 void VIDEO_SetNextFramebuffer(void *fb
);
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.
166 void VIDEO_SetNextRightFramebuffer(void *fb
);
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
);
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
);
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
);
203 #endif /* __cplusplus */