#include <revolution/gx.h> f32 GXGetYScaleFactor( u16 efbHeight, u16 xfbHeight );
| efbHeight | Height of embedded frame buffer (EFB). Ranges from 2 to 528. Should be a multiple of 2. |
|---|---|
| xfbHeight | Height of the requested XFB. Range from 2 to 1024. This needs to be equal to or greater than efbHeight. |
Returns a Y scale factor that can be used as an argument in the GXSetDispCopyYScale function.
This function calculates an appropriate Y scale factor value for the GXSetDispCopyYScale function, based on the height of embedded frame buffer (EFB) and the height of external framebuffer (XFB) you intend to use.
This scale factor can be roughly approximated by the following equation:
yscale = (f32)xfbHeight / (f32)efbHeight;Using this equation, however, may sometimes be a source of rounding errors when the value is sent to the hardware register, and you may not get the exact number of lines to copy that you intended. We recommend using this function to calculate accurate Y scale factors.
Note: It is still possible that you cannot get the number of actual XFB lines you desired because of the hardware restriction. (For example, you cannot get scaled 528 lines XFB from 480 lines EFB.) For such cases, this function returns a scale factor that makes the number of lines that is feasible and as close as possible to the original xfbHeight argument. However, this line number will never be greater than the original height, xfbHeight. If you try 480 to 528 scaling, the number of actual lines becomes 527.)
The number of actual lines copied is gotten as the return value of the GXSetDispCopyYScale function. You may also use the GXGetNumXfbLines function.
GXSetDispCopyYScale, GXGetNumXfbLines
2006/03/01 Initial version.
CONFIDENTIAL