Skip to content

Commit 52c525a

Browse files
authored
Video: add support for RGB/VGA output (#167)
* video: refactor magic register writes into named functions * video: add generic RGB mode flag and allow re-configuring encoder Previously, the encoder was configured only once during VIDEO_Init(), and would not be re-configured when VIDEO_Configure(mode) was called. Since we can switch from a non-RGB to an RGB mode, we need to be able to reconfigure the encoder at configure-time. This commit extends the mode-switching mechanism to also allow scheduling for encoder setting changes at run-time. Moreover, since there are more RGB video modes than EURGB60, we extend the mode struct with a flag to indicate whether the mode is RGB or not or not for easy internal use. Adding it to the VI_TVMODE enumeration was also considered, but decided against since it would break the VIDEO_GetCurrentTvMode() ABI for EURGB60 modes. * video: fix encoder setup for RGB video modes * video: add RGB 480p progressive mode This mode was used in the Wii arcade board (RVA-001). Detecting it for use with VIDEO_GetPreferredMode() would require some logic involving reading /title/00000001/00000002/data/RVA.txt since that is the main method used to detect the board instead of SC. Due to the relative clumsiness involved I decided to leave it out for now.
1 parent 2e3a91e commit 52c525a

3 files changed

Lines changed: 315 additions & 55 deletions

File tree

gc/ogc/gx_struct.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ typedef struct _gx_rmodeobj {
6565
u16 viWidth;
6666
u16 viHeight;
6767
u32 xfbMode;
68+
u8 rgb;
6869
u8 field_rendering;
6970
u8 aa;
7071
u8 sample_pattern[12][2];

gc/ogc/video_types.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ distribution.
107107
#define VI_MAX_WIDTH_EURGB60 VI_MAX_WIDTH_NTSC
108108
#define VI_MAX_HEIGHT_EURGB60 VI_MAX_HEIGHT_NTSC
109109

110+
#define VI_MAX_WIDTH_DEBUG VI_MAX_WIDTH_NTSC
111+
#define VI_MAX_HEIGHT_DEBUG VI_MAX_HEIGHT_NTSC
112+
110113
#define VIDEO_PadFramebufferWidth(width) ((u16)(((u16)(width) + 15) & ~15)) /*!< macro to pad the width to a multiple of 16 */
111114

112115
/*!
@@ -133,6 +136,7 @@ distribution.
133136
#define VI_TVMODE_MPAL_PROG VI_TVMODE(VI_MPAL, VI_PROGRESSIVE)
134137

135138
#define VI_TVMODE_DEBUG_INT VI_TVMODE(VI_DEBUG, VI_INTERLACE)
139+
#define VI_TVMODE_DEBUG_PROG VI_TVMODE(VI_DEBUG, VI_PROGRESSIVE)
136140

137141
#define VI_TVMODE_DEBUG_PAL_INT VI_TVMODE(VI_DEBUG_PAL, VI_INTERLACE)
138142
#define VI_TVMODE_DEBUG_PAL_DS VI_TVMODE(VI_DEBUG_PAL, VI_NON_INTERLACE)
@@ -191,6 +195,9 @@ extern GXRModeObj TVEurgb60Hz480IntAa;
191195
extern GXRModeObj TVEurgb60Hz480Prog;
192196
extern GXRModeObj TVEurgb60Hz480ProgSoft;
193197
extern GXRModeObj TVEurgb60Hz480ProgAa;
198+
extern GXRModeObj TVRgb480Prog; /*!< Video and render mode configuration for 480 lines,progressive,singlefield RGB mode */
199+
extern GXRModeObj TVRgb480ProgSoft;
200+
extern GXRModeObj TVRgb480ProgAa;
194201

195202
/*!
196203
* @}

0 commit comments

Comments
 (0)