guOrtho() and GX_SetViewport() February 25, 2009 12:51AM | Registered: 15 years ago Posts: 32 |
Re: guOrtho() and GX_SetViewport() February 25, 2009 11:28AM | Registered: 15 years ago Posts: 62 |
Re: guOrtho() and GX_SetViewport() February 26, 2009 01:21AM | Registered: 15 years ago Posts: 32 |
//50/60Hz? if(rMode->xfbHeight == 528) PAL60 = false; else PAL60 = true; //widescreen? if (CONF_GetAspectRatio() == CONF_ASPECT_16_9) widescreen = true; else widescreen = false; /* Widescreen patch by CashMan's Productions (http://www.CashMan-Productions.fr.nf) */ if (widescreen) { // aspectRatio = 16.0f / 9.0f; rMode->viWidth = 678; rMode->viXOrigin = (VI_MAX_WIDTH_NTSC - 678)/2; } else { ... screenWidth = rMode->fbWidth; //note: fbWidth is always 640 screenHeight = rMode->efbHeight; ...
/*------------*/ //3D GX_SetVtxAttrFmt (GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0); /*------------*/ //2D GX_SetVtxAttrFmt (GX_VTXFMT0, GX_VA_POS, GX_POS_XY, GX_F32, 0); ... guOrtho(perspective, 0,rMode->viHeight-1, 0,rMode->viWidth-1, 0,300); GX_LoadProjectionMtx(perspective, GX_ORTHOGRAPHIC); GX_SetViewport(-64,-64,rMode->viWidth+64,rMode->viHeight+64,0,1); ... //here is a test box (outline) representing max visible area on my monitor (I will adjust this after testing elsewhere) if(widescreen) { if(PAL60) DrawQuad(76, 69, screenWidth-90, screenHeight-81, (GXColor){0xff,0xff,0xff,0xff}, false); else DrawQuad(77, 58, screenWidth-93, screenHeight-58, (GXColor){0xff,0xff,0xff,0xff}, false); } else { if(PAL60) DrawQuad(59, 69, screenWidth-65, screenHeight-81, (GXColor){0xff,0xff,0xff,0xff}, false); else DrawQuad(59, 58, screenWidth-69, screenHeight-58, (GXColor){0xff,0xff,0xff,0xff}, false); }