Talk:Developer tips

From WiiBrew
(Redirected from Talk:Developer Tips)
Jump to navigation Jump to search

Where does this number 678 come from to achieve a PAL 16:9 aspect ratio screen? I want to write similar code for NTSC.

#define VI_MAX_WIDTH_PAL 720
#define VI_MAX_HEIGHT_PAL 574

Looking at video_types.h I calculate 16*574/9 = 1020 for PAL and 16*480/9 = 852 NTSC EDTV. Also TV pixels are non-square. Any ideas? CarstenK 19:28, 6 August 2008 (CEST)

The 678 number was found by experimentation with my Widescreen LCD TV - 678 stretches the 640 pixel wide framebuffer to just touch the edge of my screen. Other people's TVs may vary. It doesn't have anything to do with a 16:9 aspect ratio, you still need to use the GX matrices to squash a 16:9 view into a 4:3 framebuffer. --Pepsiman 14:37, 7 August 2008 (CEST)
The link above is great, thanks for sharing. It explains in easy (as in you won't get away with less complex explanations) words how and why you have to map your image to the framebuffer to get a filled screen with round circles. Some helper functions and an example would save every casual developer weeks of messing with magic values to get a nice picture on their TV. Btw, PAL 16:9 with square pixels is 1024x576, as the 576 scan lines is the fix part.
Like you said the 678 is a variable that depends on each users TV set. If you want a fixed number take the safe action and safe title area to figure out where to place important stuff.
To make conversion more interesting 720x576 / 720x480 is a tiny bit wider than 4:3.
--Dekarl 17:32, 4 November 2008 (UTC)

Return to Wii Menu w/o health check

Does anyone know the code to return to the Wii Menu like Nintendo channels and games (and now the Homwbrew Channel)? I'm talking about where it shows the shape of the channels and then fades away, and a few seconds later the Wii Menu pops up without going through the health check.
Any help would be appreciated. --Shadow1643 00:14, 30 October 2008 (UTC)

See <ogc/wiilaunch.h>-- more specifically, WII_ReturnToMenu(); (Note: you will need a git/cvs copy of libogc). --Rhys 01:02, 30 October 2008 (UTC)
Just recompiling with git libogc does it. Marcan 01:34, 30 October 2008 (UTC)

The projection matrix commands take 4x4 matrices!

After a few hours wasted debugging, I realized that a lot of tutorials and code are wrong in using a standard 'Mtx' variable for projection matrices. It should be a Mtx44! Check the headers. Official Nintendo docs say so too (though the official SDK uses slightly different function names): "Unlike other MTX functions, MTXPerspective, MTXFrustum and MTXOrtho all operate on 4x4 matrices." This is annoying because it will obviously still compile the other way, but corrupt memory, which in my case, led to a very hard-to-track-down crash. I thought I'd tell you guys here in case it will help avoid some problems. :) Happy coding! --PunMaster 00:15, 6 December 2008 (UTC)

Anyone mind if I put a paraphrased version of this on the actual page? I think people might benifit from this little "find". --PunMaster 05:23, 20 December 2008 (UTC)
If it is helpful, nobody will stop you. Remember, "be bold", right? Flark 06:04, 21 December 2008 (UTC)