|
46 | 46 | // Inverse of the VI_TVMODE macro |
47 | 47 | #define VI_FORMAT_FROM_MODE(tvmode) (tvmode >> 2) |
48 | 48 |
|
| 49 | +/* A video mode with a 320 width; we'll build it programmatically. */ |
| 50 | +static GXRModeObj s_mode320; |
| 51 | + |
49 | 52 | static const GXRModeObj *s_ntsc_modes[] = { |
50 | 53 | &TVNtsc240Ds, |
51 | 54 | &TVNtsc480Prog, |
@@ -127,6 +130,19 @@ static void add_supported_modes(SDL_VideoDisplay *display, u32 tv_format) |
127 | 130 | return; |
128 | 131 | } |
129 | 132 |
|
| 133 | + /* All libogc video modes are 640 pixel wide, even the 240p ones. While |
| 134 | + * this can be useful for some applications, others might prefer a video |
| 135 | + * mode with less elongated pixels, such as 320x240. Therefore, let's |
| 136 | + * create one: we take the first video mode in the array (which has always |
| 137 | + * a height of approximately 240p) and we use it as template to build the |
| 138 | + * "mode320": we just set the fbWidth field to 320: the VI interface will |
| 139 | + * take care of the horizontal scale for us. */ |
| 140 | + memcpy(&s_mode320, gx_modes[0], sizeof(s_mode320)); |
| 141 | + s_mode320.fbWidth = 320; |
| 142 | + init_display_mode(&mode, &s_mode320); |
| 143 | + SDL_AddDisplayMode(display, &mode); |
| 144 | + |
| 145 | + /* Now add all the "standard" modes from libogc */ |
130 | 146 | while (*gx_modes) { |
131 | 147 | init_display_mode(&mode, *gx_modes); |
132 | 148 | SDL_AddDisplayMode(display, &mode); |
|
0 commit comments