VIDEO_GetPreferredMode...again
June 10, 2012 06:08PM
Help - with the latest libs, anyone know if we still need to tweak the results from VIDEO_GetPreferredMode to get the most from the visible display.

I'm thinking the latest lib now has TVPal576IntDfScale, so this code bellow may now be outdated.
I.e. I used to do something like this, but I've just refresh to the latest libs and found this may now break things.

GXRModeObj* WiiManager::GetBestVideoMode()
{
	GXRModeObj* vmode = VIDEO_GetPreferredMode(NULL); // get default video mode

	bool pal = false;

	if (vmode == &TVPal528IntDf)  // this may now be stupid, since I've just found something that will compile for the moment!
	{
		pal = true;
		vmode = &TVPal576IntDfScale; //&TVPal574IntDfScale;  ....574 removed fro libs, Ive just used the new 576
	}

	if (CONF_GetAspectRatio() == CONF_ASPECT_16_9)
	{
	      vmode->viWidth = 678;  // probably top limit for stretching the display onto your TV
	}
	//else
	//{
	//		vmode->viWidth = 672;  // not tested...this may work ok
	//}


	if (pal)
	{
		vmode->viXOrigin = (VI_MAX_WIDTH_PAL - vmode->viWidth) / 2;
		vmode->viYOrigin = (VI_MAX_HEIGHT_PAL - vmode->viHeight) / 2;
	}
	else
	{
		vmode->viXOrigin = (VI_MAX_WIDTH_NTSC - vmode->viWidth) / 2;
		vmode->viYOrigin = (VI_MAX_HEIGHT_NTSC - vmode->viHeight) / 2;
	}

	s8 hoffset = 0;

	if (CONF_GetDisplayOffsetH(&hoffset) == 0)
		vmode->viXOrigin += hoffset;

	return vmode;
}



Edited 1 time(s). Last edit at 06/25/2012 08:00PM by Titmouse.
Re: VIDEO_GetPreferredMode...again
June 10, 2012 08:04PM
people have been asking this question for YEARS!!! I never really understood it.
Re: VIDEO_GetPreferredMode...again
June 10, 2012 10:19PM
After posting I've looked at the libs source, noticed my code could do odd things since VIDEO_GetPreferredMode can return these;

Component Cable: TVNtsc480Prog,TVEurgb60Hz480Prog,TVPal576ProgScale,TVMpal480Prog
Without Component Cable: TVNtsc480IntDf,TVEurgb60Hz480IntDf,TVPal576IntDfScale,TVMpal480IntDf


Think I'll run some tests with a edge border test graphic to see if at least 5% of the edge can be seen.
I'll test in all display modes with and without component cable, on flat screen and old style TV.


Will post the results here at some point - If anyones already done this please let me know.
Re: VIDEO_GetPreferredMode...again
June 10, 2012 11:42PM
You can remove the "if (vmode == &TVPal528IntDf)" section, since that mode is no longer returned as a preferred mode (the scaled mode is used instead).

The 576 line modes have some issues, I strongly advise not to manually adjust the vi settings at all if they are going to be used. Although according to the libogc devs it's either all in my head or only my wiis that have this problem... even though the official SDK states that only up to 574 lines are supported. If there was no problem with 576 lines you would think Nintendo would have supported it...
Re: VIDEO_GetPreferredMode...again
June 25, 2012 07:59PM
Using this example now (stops the left/right border showing a dead space by stretching)
678 is a tried and tested value, works well for me as a starting default.

GXRModeObj* WiiManager::GetBestVideoMode()
{
	GXRModeObj* vmode = VIDEO_GetPreferredMode(NULL); // get default video mode
	if (CONF_GetAspectRatio() == CONF_ASPECT_16_9)
	{
		vmode->viWidth = 678;
		vmode->viXOrigin = (VI_MAX_WIDTH_NTSC - 678)/2;
	}
	return vmode;
}
Re: VIDEO_GetPreferredMode...again
June 25, 2012 08:21PM
So you are using a 16:9 widescreen tv and what cables and tv settings are you using?
Re: VIDEO_GetPreferredMode...again
June 25, 2012 09:15PM
Component cable plugged into a Samsung HD 1080p, does look nice! (so no real need for tv settings, wii settings are on HDTV 480p / wide)
(In the past I did use 678 on CRT TV with good results, via scart RGB)

Owen, what results do you get with the new code above (better with or without for left/right borders only)?
One quick way to test your display is to add 4 extra wii screen pointers relative to the original (centre) pointer.
i.e. hack in 4 extra wiimote pointers at these (x,y) coords
-320,-240
+320,-240
-320,+240
+320,+240

If you can't see a 1/4 of each pointer when the original one is centered your screen is stretch too far.

I'm just trying to address the width, the libs defaults for height look over generous, I lose allot from the top/bottom of the screen. But I use the 5% rule about not displaying important text in that edge area.
Sorry, only registered users may post in this forum.

Click here to login