MTek-GDL 0.100.4-muffintrap
Loading...
Searching...
No Matches
Data Structures | Functions | Variables
gdl::wii Namespace Reference

Wii specific functions, structs and global variables. More...

Data Structures

struct  TEX2f32
 UV texture coordinate. More...
 
struct  VERT2s16
 2D vertex coordinate. More...
 
struct  VERT3f32
 3D vertex coordinate. More...
 

Functions

void RevBytes (void *var, int size)
 Reverses the byte order of a variable.
 
bool IsComponentCableUsed ()
 Checks whether or not a Component Video cable is used.
 
bool IsWidescreen ()
 
bool IsProgressive ()
 
bool IsLowResMode ()
 
void SetNonInterlaced (bool nonInterlaced)
 Sets the video output to either be interlaced or non-interlaced.
 
void StartFadeoutExit ()
 Makes the library perform a program exit with a fade-out.
 
void DoProgramExit ()
 Makes the library exit as fast as possible.
 
void _ResetExit ()
 
void _PowerOffExit ()
 
void SetAutoFlush (bool flush)
 Texture flusing mode.
 
void SetTexAllocMode (bool allocMode)
 Sets which memory area the next texture will be allocated in.
 

Variables

GXRModeObj * rmode
 Pointer to video and renderer settings (see GXRModeObj for details).
 
voidgp_fifo = NULL
 Pointer to GP FIFO buffer where GP commands are stored and sent to the GP.
 
voidFB [2] = {NULL,NULL}
 K1 pointers to the display framebuffers, pixel format is in YUV2 format.
 
GXRModeObj * conRMode = NULL
 Console rmode settings.
 
voidconFB = NULL
 Console screen framebuffer.
 
short ActiveFB = 0
 Active framebuffer page index.
 
voidUpscaleBuff = NULL
 Pointer for upscale texture buffer for upscaling 240p to a 480p framebuffer (since progressive scan only supports 480/576 vertical resolution).
 
GXTexObj UpscaleTexObj
 Texture object for the upscale buffer.
 
bool LowResolutionMode = false
 Low-resolution mode flag.
 
bool ProgressiveScanMode = false
 
bool WidescreenMode = false
 Widescreen mode flag.
 
bool AutoFlush = false
 Automatic texture flush flag (for gdl::Texture::PokePixel()).
 
bool TexAllocMode = gdl::MEM1
 Allocation mode for texture and image classes.
 
bool OpenGXMode = false
 OpenGX is used flag.
 
Mtx44 ProjMtx
 Global projection matrix used by the library's graphics functions.
 
Mtx ModelMtx
 Global model matrix object used by the library's graphics functions.
 
Mtx ViewMtx
 Global view matrix object used by the library's graphics functions.
 
bool DoExitSequence = false
 Exit sequence flag (for built-in power off/reset handling).
 
float DoExitCount = 0
 Exit sequence counter (for power off/reset).
 
bool ExitType = 0
 Exit type (0: Power off, 1: Soft Reset back to Homebrew Channel).
 
float CPUdelta = 1.f
 CPU delta time.
 
float GPUdelta = 1.f
 GPU delta time.
 
bool ScreenCapIssued = false
 Screen capture issue flag (set by the Image Handling Module)
 
char * ScreenCapFileName = NULL
 Screen capture file name (set by the Image Handling Module)
 
ImageCapFuncScreenCapFunc = NULL
 Screen capture function pointer (set by the Image Handling Module)
 
InputPollFunc * PollKeyboardCallback = NULL
 Keyboard poll function callback (set by the keyboard portion of the Input Module)
 
const char * LastMusicFile =NULL
 Pointer to string of last music file played.
 
float UserMusicVolume =100.f
 User music volume.
 
float MasterMusicVolume =100.f
 Master music volume.
 
float MasterSfxVolume =100.f
 Master sounds volume.
 
bool ProgressiveMode
 Progressive scan mode flag.
 

Detailed Description

Wii specific functions, structs and global variables.

Note
Be wary of this if you plan to make your game or engine cross-platform compatible as these objects/variables are not available in the other ports. Use the GDL_PLATFORM_WII macro to detect which port of the library was used to compile your project.

Function Documentation

◆ DoProgramExit()

void gdl::wii::DoProgramExit ( )

Makes the library exit as fast as possible.

Closes the video display and quits the program

◆ IsComponentCableUsed()

bool gdl::wii::IsComponentCableUsed ( )

Checks whether or not a Component Video cable is used.

This function will return a non-zero value if a Component Cable is connected to the console. This is useful for projects that uses the low-resolution video mode mode and you want to implement a non-interlaced mode test when your program is first run on a console not set to Progressive Scan to test whether or not the user's TV supports non-interlaced video through Component video.

Note
When implementing a non-interlaced mode test dialog, you must prompt the user to either wait for a certain period of time (10 seconds is ideal) or press a certain button to revert back to interlaced mode if the user's TV does not support non-interlaced mode through Component video. However, the video test is not necessary if the console is running in Progressive Scan mode.

◆ IsLowResMode()

bool gdl::wii::IsLowResMode ( )

Checks whether or not the console is set in a low display resolution.

Note
Call this function only after gdl::InitSystem() is already called.
Returns
Non-zero if the system is running in widescreen otherwise its in a standard 4:3 aspect ratio.

◆ IsProgressive()

bool gdl::wii::IsProgressive ( )

Checks whether or not the console is set to display in progressive scan mode.

Note
Call this function only after gdl::InitSystem() is already called.
Returns
Non-zero if the system is running in progressive scan mode otherwise it is running in interlaced or non-interlaced (low-res) mode.

◆ IsWidescreen()

bool gdl::wii::IsWidescreen ( )

Checks whether or not the console is set to display in widescreen.

Note
Call this function only after gdl::InitSystem() is already called.
Returns
Non-zero if the system is running in a low display resolution otherwise its running in standard resolution.

◆ RevBytes()

void gdl::wii::RevBytes ( void var,
int  size 
)

Reverses the byte order of a variable.

Reverses the byte order of 16-bit and 32-bit variables useful when handling little-endian binary data.

Parameters
[in,out]*varPointer to variable to reverse byte order.
[in]sizeSize of variable in bytes (for convenience, use sizeof()).

◆ SetNonInterlaced()

void gdl::wii::SetNonInterlaced ( bool  nonInterlaced)

Sets the video output to either be interlaced or non-interlaced.

This function switches between a non-interlaced video more or an interlaced video mode on-the-fly useful for implementing a non-interlaced compatibility test of the user's TV as not all TVs support non-interlaced video through component.

Note
This function will only work in low-resolution, non-progressive mode since non-interlaced mode is most ideal for it. If the console is set in progressive scan, the screen is upscaled internally to 480p.
Parameters
[in]nonInterlacedIf true, the video output will become non-interlaced otherwise the video output will be made interlaced.

◆ StartFadeoutExit()

void gdl::wii::StartFadeoutExit ( )

Makes the library perform a program exit with a fade-out.

This function will work only during a gdl::PrepDisplay() and gdl::Display() loop. It pretty much does the same thing that would happen if you press reset on the console.

Variable Documentation

◆ CPUdelta

float gdl::wii::CPUdelta = 1.f

CPU delta time.

Similar to gdl::Delta but contains the delta time it took between a gdl::PrepDisplay() and gdl::Display() pair CPU-wise. It does not read the exact CPU usage but a rough estimation of it useful for profiling/benchmarking.

You may want to keep this value to stay less than 1.0f if you want to maintain 60FPS.

◆ GPUdelta

float gdl::wii::GPUdelta = 1.f

GPU delta time.

Similar to gdl::Delta but contains the delta time it took for the GPU to finish rendering a frame when gdl::Display() is called. It does not read the exact GPU usage but a rough estimation of it useful for profiling/benchmarking.

You may want to keep this value to stay less than 1.0f if you want to maintain 60FPS.

◆ ModelMtx

Mtx gdl::wii::ModelMtx

Global model matrix object used by the library's graphics functions.

Modifying these will also affect the library's graphics routines. Load the model matrix to the GX with the GX_LoadPosMtxImm() function.

◆ ProjMtx

Mtx44 gdl::wii::ProjMtx

Global projection matrix used by the library's graphics functions.

Modifying this does not really affect the library's graphics routines as it is not directly applied to the GX when calling most graphics functions. Load the projection matrix to the GX with the GX_LoadProjectionMtx() function.

◆ rmode

GXRModeObj * gdl::wii::rmode

Pointer to video and renderer settings (see GXRModeObj for details).

Modifying this does not really affect the library's graphics routines as it is not directly applied to the video encoder when calling most graphics functions. Used mostly for getting the exact framebuffer resolution.