Widescreen mode previouly working...

Post Reply
EvilTroopa
Posts: 4
Joined: Thu Jan 20, 2011 1:25 am

Widescreen mode previouly working...

Post by EvilTroopa » Sun May 01, 2011 8:22 pm

Hi there.

I used to do some fake widescreen on a previous version on libogc.
It worked like that (GRRLIB stuff in it, as I submitted it to GRRLIB) :

Code: Select all

//first
if (CONF_GetAspectRatio() == CONF_ASPECT_16_9) {
	GRRLIB_ScreenWidth = 16.0f*((f32)rmode->xfbHeight)/9.0f;
}

...

//then
guOrtho(ortho, 0, GRRLIB_ScreenHeight, 0, GRRLIB_ScreenWidth, 0, 1000.0f);
GX_LoadProjectionMtx(ortho, GX_ORTHOGRAPHIC);
//or
guPerspective(m, fov, (f32)GRRLIB_ScreenWidth/(f32)GRRLIB_ScreenHeight, minDist, maxDist);
GX_LoadProjectionMtx(m, GX_PERSPECTIVE);

GX_SetViewport(0, 0, GRRLIB_ScreenWidth, GRRLIB_ScreenHeight, 0.0f, 1.0f);
GX_SetScissor(0, 0, GRRLIB_ScreenWidth, GRRLIB_ScreenHeight);
The process was :
- Having a wide projection scaled on the regular 640x480 framebuffer
- Having this framebuffer scaled again to screen as the wii is configured on 16/9 mode.

But that stuff isn't working anymore.
I don't really get why, as I didn't see any change concerning it in the changelog.
Now I miss the right part of the wide screen, no scale applied on the left side.
So I guess the projection matrix is ok, but all the scaling process seems to be missing now.
I also tried to change

Code: Select all

GX_SetDispCopySrc(0, 0, rmode->fbWidth, rmode->efbHeight);
to

Code: Select all

GX_SetDispCopySrc(0, 0, GRRLIB_ScreenWidth, GRRLIB_ScreenHeight);
but it crashes and points to cache.c line 126. Something about LCAlloc/LCAllocTags, and I really don't know what it's all about.

That's my problem.
So if anyone has a clue on how to make that work again, it would be really appreciated. :)

EvilTroopa

EvilTroopa
Posts: 4
Joined: Thu Jan 20, 2011 1:25 am

Re: Widescreen mode previouly working...

Post by EvilTroopa » Thu May 05, 2011 8:05 pm

OK I'm an idiot...

I added 2 lines that weren't on my first wide version, and that do that wierd zoom/cut on the screen :

Code: Select all

GX_SetViewport(0, 0, GRRLIB_ScreenWidth, GRRLIB_ScreenHeight, 0.0f, 1.0f);
GX_SetScissor(0, 0, GRRLIB_ScreenWidth, GRRLIB_ScreenHeight);
These must keep the original width and height : 640x480.
It works fine now !

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests