Video mode stuff

Add your suggestions for toolchain improvements here.
Post Reply
dontwantanick
Posts: 19
Joined: Tue Dec 30, 2008 5:44 pm

Video mode stuff

Post by dontwantanick » Thu Feb 19, 2009 7:58 pm

I spend some time with video modes used by games and here are some results which may help to improve libogc:

1. If i want to use the video mode "TVNtsc480Int", i have to add this to my source:
extern GXRModeObj TVNtsc480Int;
while i don't need anything similar for all other video modes

2. I only found these video modes inside games, i guess these are something like "the standard video modes":

TVNtsc480IntDf
TVNtsc480Prog

TVPal528IntDf
TVPal528Prog*
TVPal528ProgSoft*
TVPal528ProgUnknown*

TVMpal480IntDf
TVMpal480Prog*

TVEurgb60Hz480IntDf
TVEurgb60Hz480Prog

3. Here are the missing GXRModeObj:

GXRModeObj TVPal528Prog =
{
6, // viDisplayMode
640, // fbWidth
528, // efbHeight
528, // xfbHeight
(VI_MAX_WIDTH_PAL - 640)/2, // viXOrigin
(VI_MAX_HEIGHT_PAL - 528)/2, // viYOrigin
640, // viWidth
528, // viHeight
VI_XFBMODE_SF, // xFBmode
GX_FALSE, // field_rendering
GX_FALSE, // aa

// sample points arranged in increasing Y order
{
{6,6},{6,6},{6,6}, // pix 0, 3 sample points, 1/12 units, 4 bits each
{6,6},{6,6},{6,6}, // pix 1
{6,6},{6,6},{6,6}, // pix 2
{6,6},{6,6},{6,6} // pix 3
},

// vertical filter[7], 1/64 units, 6 bits each
{
0, // line n-1
0, // line n-1
21, // line n
22, // line n
21, // line n
0, // line n+1
0 // line n+1
}

};

GXRModeObj TVPal528ProgSoft =
{
6, // viDisplayMode
640, // fbWidth
528, // efbHeight
528, // xfbHeight
(VI_MAX_WIDTH_PAL - 640)/2, // viXOrigin
(VI_MAX_HEIGHT_PAL - 528)/2, // viYOrigin
640, // viWidth
528, // viHeight
VI_XFBMODE_SF, // xFBmode
GX_FALSE, // field_rendering
GX_FALSE, // aa

// sample points arranged in increasing Y order
{
{6,6},{6,6},{6,6}, // pix 0, 3 sample points, 1/12 units, 4 bits each
{6,6},{6,6},{6,6}, // pix 1
{6,6},{6,6},{6,6}, // pix 2
{6,6},{6,6},{6,6} // pix 3
},

// vertical filter[7], 1/64 units, 6 bits each
{
8, // line n-1
8, // line n-1
10, // line n
12, // line n
10, // line n
8, // line n+1
8 // line n+1
}

};

GXRModeObj TVPal528ProgUnknown =
{
6, // viDisplayMode
640, // fbWidth
264, // efbHeight
524, // xfbHeight
(VI_MAX_WIDTH_PAL - 640)/2, // viXOrigin
(VI_MAX_HEIGHT_PAL - 528)/2, // viYOrigin
640, // viWidth
524, // viHeight
VI_XFBMODE_SF, // xFBmode
GX_FALSE, // field_rendering
GX_TRUE, // aa

// sample points arranged in increasing Y order
{
{3,2},{9,6},{3,10}, // pix 0, 3 sample points, 1/12 units, 4 bits each
{3,2},{9,6},{3,10}, // pix 1
{9,2},{3,6},{9,10}, // pix 2
{9,2},{3,6},{9,10} // pix 3
},

// vertical filter[7], 1/64 units, 6 bits each
{
4, // line n-1
8, // line n-1
12, // line n
16, // line n
12, // line n
8, // line n+1
4 // line n+1
}

};

GXRModeObj TVMpal480Prog =
{
10, // viDisplayMode
640, // fbWidth
480, // efbHeight
480, // xfbHeight
(VI_MAX_WIDTH_NTSC - 640)/2, // viXOrigin
(VI_MAX_HEIGHT_NTSC - 480)/2, // viYOrigin
640, // viWidth
480, // viHeight
VI_XFBMODE_SF, // xFBmode
GX_FALSE, // field_rendering
GX_FALSE, // aa

// sample points arranged in increasing Y order
{
{6,6},{6,6},{6,6}, // pix 0, 3 sample points, 1/12 units, 4 bits each
{6,6},{6,6},{6,6}, // pix 1
{6,6},{6,6},{6,6}, // pix 2
{6,6},{6,6},{6,6} // pix 3
},

// vertical filter[7], 1/64 units, 6 bits each
{
0, // line n-1
0, // line n-1
21, // line n
22, // line n
21, // line n
0, // line n+1
0 // line n+1
}
};


PS: Yes in most PAL games there are 3(!) different video modes for PAL576p, while there's only 1 for all others each.

Eke
Posts: 64
Joined: Sat Mar 01, 2008 11:01 am

Re: Video mode stuff

Post by Eke » Tue Mar 03, 2009 10:54 am

Well, technically, the GXRModeObj is very flexible, you can configure the size of the video output as you want so you could have as many Video modes as you want (which is the case for PAL because the maximal height on screen is LARGER than the maximal height available in the rendering framebuffer, so they added scaled and unscaled video modes)

Those listed in libogc are the most common ones and the same as used in legit Wii applications...

Have you tried these modes on a Wii ?
Because I'm quite sure there is no support for Progressive 50Hz on PAL Wii (at least, there is no option in the system menu for that) so those are most probably unused functions left in games from an old SDK version

the third "unknown" one is anti-aliased progressiv PAL btw

libogc is however missing a lot from the whole MPAL_ video mode package
the following functions should indeed be available:
extern GXRModeObj TVMPal240Ds;
extern GXRModeObj TVMPalDsAa;
extern GXRModeObj TVMPal240Int;
extern GXRModeObj TVMpal240IntAa;
extern GXRModeObj TVMpal480Int;
extern GXRModeObj TVMpal480IntAa;
extern GXRModeObj TVMpal480Prog;
extern GXRModeObj TVMpal480ProgSoft;
extern GXRModeObj TVMpal480ProgAa;
but in reality, those ones can easily be retrieved as they are exactly the same as their NTSC or EURGB60 counterparts, except fom the viDisplayMode field, which should be using VI_TVMODE_MPAL_xxx parameters instead

MPAL is only used is some part of the world though (Brasil only ?) and *should* be compatible with NTSC

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 0 guests