mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-04 18:45:05 +01:00
*Video widescreen fix when set up in cfg
This commit is contained in:
parent
344a81962f
commit
2547b9a2a5
@ -2,8 +2,8 @@
|
||||
<app version="1">
|
||||
<name> USB Loader GX</name>
|
||||
<coder>USB Loader GX Team</coder>
|
||||
<version>1.0 r952</version>
|
||||
<release_date>201009182328</release_date>
|
||||
<version>1.0 r953</version>
|
||||
<release_date>201009190727</release_date>
|
||||
<short_description>Loads games from USB-devices</short_description>
|
||||
<long_description>USB Loader GX is a libwiigui based USB iso loader with a wii-like GUI. You can install games to your HDDs and boot them with shorter loading times.
|
||||
The interactive GUI is completely controllable with WiiMote, Classic Controller or GC Controller.
|
||||
|
File diff suppressed because one or more lines are too long
@ -55,27 +55,17 @@ extern "C"
|
||||
#include "wad/nandtitle.h"
|
||||
|
||||
extern bool geckoinit;
|
||||
extern bool textVideoInit;
|
||||
extern char headlessID[8];
|
||||
|
||||
NandTitle titles;
|
||||
|
||||
/* Constants */
|
||||
#define CONSOLE_XCOORD 260
|
||||
#define CONSOLE_YCOORD 115
|
||||
#define CONSOLE_WIDTH 340
|
||||
#define CONSOLE_HEIGHT 218
|
||||
|
||||
PartList partitions;
|
||||
u8 dbvideo = 0;
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
MEM2_init( 48 );
|
||||
setlocale( LC_ALL, "en.UTF-8" );
|
||||
geckoinit = InitGecko();
|
||||
InitVideo(); //TODO: some sort of magic is done in the CFG_Load() ( maybe stff with CONF_ ). if videoinit is after cfg load, my full screen is used.
|
||||
//with videoinit before CFG load, i get black box around my picture
|
||||
InitVideo();
|
||||
__exception_setreload( 20 );
|
||||
|
||||
printf( "\tStarting up\n" );
|
||||
@ -115,6 +105,7 @@ int main( int argc, char *argv[] )
|
||||
gettextCleanUp();
|
||||
printf( "\tLoading configuration..." );
|
||||
CFG_Load();
|
||||
VIDEO_SetWidescreen(CFG.widescreen);
|
||||
printf( "done\n" );
|
||||
|
||||
SDCard_deInit();// unmount SD for reloading IOS
|
||||
@ -137,7 +128,7 @@ int main( int argc, char *argv[] )
|
||||
printf( "\tWaiting for USB:\n" );
|
||||
if ( MountWBFS() < 0 )
|
||||
{
|
||||
printf( "ERROR: No WBFS drive mounted.\n" );
|
||||
printf( "ERROR: No WBFS drive mounted.\n" );
|
||||
sleep( 5 );
|
||||
exit( 0 );
|
||||
}
|
||||
|
@ -68,7 +68,6 @@ extern u8 shutdown;
|
||||
extern u8 reset;
|
||||
extern s32 gameSelected, gameStart;
|
||||
extern u8 boothomebrew;
|
||||
extern u8 dbvideo;
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
@ -355,9 +354,6 @@ int MainMenu( int menu )
|
||||
StopGX();
|
||||
gettextCleanUp();
|
||||
|
||||
if ( dbvideo )
|
||||
InitVideodebug ();
|
||||
|
||||
if ( mountMethod == 3 )
|
||||
{
|
||||
struct discHdr *header = gameList[gameSelected];
|
||||
|
@ -138,13 +138,6 @@ InitVideo ()
|
||||
VIDEO_Init();
|
||||
vmode = VIDEO_GetPreferredMode( NULL ); // get default video mode
|
||||
|
||||
// widescreen fix
|
||||
if ( CFG.widescreen )
|
||||
{
|
||||
vmode->viWidth = VI_MAX_WIDTH_PAL - 12;
|
||||
vmode->viXOrigin = ( ( VI_MAX_WIDTH_PAL - vmode->viWidth ) / 2 ) + 2;
|
||||
}
|
||||
|
||||
VIDEO_Configure ( vmode );
|
||||
|
||||
screenheight = 480;
|
||||
@ -172,31 +165,21 @@ InitVideo ()
|
||||
// A console is always useful while debugging
|
||||
console_init ( xfb[0], 80, 100, 500, 350, vmode->fbWidth * 2 );
|
||||
}
|
||||
static unsigned int *xfbDB = NULL;
|
||||
|
||||
void InitVideodebug ()
|
||||
void VIDEO_SetWidescreen(bool widescreen)
|
||||
{
|
||||
VIDEO_Init();
|
||||
GXRModeObj *vmode = VIDEO_GetPreferredMode( NULL ); // get default video mode
|
||||
if ( widescreen )
|
||||
{
|
||||
// widescreen fix
|
||||
vmode->viWidth = VI_MAX_WIDTH_PAL - 12;
|
||||
vmode->viXOrigin = ( ( VI_MAX_WIDTH_PAL - vmode->viWidth ) / 2 ) + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
VIDEO_GetPreferredMode( NULL );
|
||||
}
|
||||
|
||||
// widescreen fix
|
||||
VIDEO_Configure ( vmode );
|
||||
|
||||
// Allocate the video buffers
|
||||
xfbDB = ( u32 * ) MEM_K0_TO_K1 ( SYS_AllocateFramebuffer ( vmode ) );
|
||||
|
||||
// A console is always useful while debugging
|
||||
console_init ( xfbDB, 20, 64, vmode->fbWidth, vmode->xfbHeight, vmode->fbWidth * 2 );
|
||||
|
||||
// Clear framebuffers etc.
|
||||
VIDEO_ClearFrameBuffer ( vmode, xfbDB, COLOR_BLACK );
|
||||
VIDEO_SetNextFramebuffer ( xfbDB );
|
||||
|
||||
VIDEO_SetBlack ( FALSE );
|
||||
VIDEO_Flush ();
|
||||
VIDEO_WaitVSync ();
|
||||
if ( vmode->viTVMode & VI_NON_INTERLACE )
|
||||
VIDEO_WaitVSync ();
|
||||
}
|
||||
/****************************************************************************
|
||||
* StopGX
|
||||
@ -219,7 +202,6 @@ void StopGX()
|
||||
***************************************************************************/
|
||||
void Menu_Render()
|
||||
{
|
||||
|
||||
whichfb ^= 1; // flip framebuffer
|
||||
GX_SetZMode( GX_TRUE, GX_LEQUAL, GX_TRUE );
|
||||
GX_SetColorUpdate( GX_TRUE );
|
||||
|
@ -22,6 +22,7 @@ void Menu_DrawTPLImg( f32 xpos, f32 ypos, f32 zpos, f32 width, f32 height, GXTex
|
||||
f32 degrees, f32 scaleX, f32 scaleY, u8 alpha, int XX1, int YY1, int XX2, int YY2, int XX3, int YY3, int XX4, int YY4 );
|
||||
void Menu_DrawRectangle( f32 x, f32 y, f32 width, f32 height, GXColor color, u8 filled );
|
||||
s32 TakeScreenshot( const char *path );
|
||||
void VIDEO_SetWidescreen(bool widescreen);
|
||||
|
||||
extern int screenheight;
|
||||
extern int screenwidth;
|
||||
|
Loading…
Reference in New Issue
Block a user