*Video widescreen fix when set up in cfg

This commit is contained in:
dimok321 2010-09-19 08:13:06 +00:00
parent 344a81962f
commit 2547b9a2a5
6 changed files with 18 additions and 48 deletions

View File

@ -2,8 +2,8 @@
<app version="1"> <app version="1">
<name> USB Loader GX</name> <name> USB Loader GX</name>
<coder>USB Loader GX Team</coder> <coder>USB Loader GX Team</coder>
<version>1.0 r952</version> <version>1.0 r953</version>
<release_date>201009182328</release_date> <release_date>201009190727</release_date>
<short_description>Loads games from USB-devices</short_description> <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. <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. The interactive GUI is completely controllable with WiiMote, Classic Controller or GC Controller.

File diff suppressed because one or more lines are too long

View File

@ -55,27 +55,17 @@ extern "C"
#include "wad/nandtitle.h" #include "wad/nandtitle.h"
extern bool geckoinit; extern bool geckoinit;
extern bool textVideoInit;
extern char headlessID[8]; extern char headlessID[8];
NandTitle titles; NandTitle titles;
/* Constants */
#define CONSOLE_XCOORD 260
#define CONSOLE_YCOORD 115
#define CONSOLE_WIDTH 340
#define CONSOLE_HEIGHT 218
PartList partitions; PartList partitions;
u8 dbvideo = 0;
int main( int argc, char *argv[] ) int main( int argc, char *argv[] )
{ {
MEM2_init( 48 ); MEM2_init( 48 );
setlocale( LC_ALL, "en.UTF-8" ); setlocale( LC_ALL, "en.UTF-8" );
geckoinit = InitGecko(); 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. InitVideo();
//with videoinit before CFG load, i get black box around my picture
__exception_setreload( 20 ); __exception_setreload( 20 );
printf( "\tStarting up\n" ); printf( "\tStarting up\n" );
@ -115,6 +105,7 @@ int main( int argc, char *argv[] )
gettextCleanUp(); gettextCleanUp();
printf( "\tLoading configuration..." ); printf( "\tLoading configuration..." );
CFG_Load(); CFG_Load();
VIDEO_SetWidescreen(CFG.widescreen);
printf( "done\n" ); printf( "done\n" );
SDCard_deInit();// unmount SD for reloading IOS SDCard_deInit();// unmount SD for reloading IOS
@ -137,7 +128,7 @@ int main( int argc, char *argv[] )
printf( "\tWaiting for USB:\n" ); printf( "\tWaiting for USB:\n" );
if ( MountWBFS() < 0 ) if ( MountWBFS() < 0 )
{ {
printf( "ERROR: No WBFS drive mounted.\n" ); printf( "ERROR: No WBFS drive mounted.\n" );
sleep( 5 ); sleep( 5 );
exit( 0 ); exit( 0 );
} }

View File

@ -68,7 +68,6 @@ extern u8 shutdown;
extern u8 reset; extern u8 reset;
extern s32 gameSelected, gameStart; extern s32 gameSelected, gameStart;
extern u8 boothomebrew; extern u8 boothomebrew;
extern u8 dbvideo;
/**************************************************************************** /****************************************************************************
@ -355,9 +354,6 @@ int MainMenu( int menu )
StopGX(); StopGX();
gettextCleanUp(); gettextCleanUp();
if ( dbvideo )
InitVideodebug ();
if ( mountMethod == 3 ) if ( mountMethod == 3 )
{ {
struct discHdr *header = gameList[gameSelected]; struct discHdr *header = gameList[gameSelected];

View File

@ -138,13 +138,6 @@ InitVideo ()
VIDEO_Init(); VIDEO_Init();
vmode = VIDEO_GetPreferredMode( NULL ); // get default video mode 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 ); VIDEO_Configure ( vmode );
screenheight = 480; screenheight = 480;
@ -172,31 +165,21 @@ InitVideo ()
// A console is always useful while debugging // A console is always useful while debugging
console_init ( xfb[0], 80, 100, 500, 350, vmode->fbWidth * 2 ); 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(); if ( widescreen )
GXRModeObj *vmode = VIDEO_GetPreferredMode( NULL ); // get default video mode {
// 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 ); 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 * StopGX
@ -219,7 +202,6 @@ void StopGX()
***************************************************************************/ ***************************************************************************/
void Menu_Render() void Menu_Render()
{ {
whichfb ^= 1; // flip framebuffer whichfb ^= 1; // flip framebuffer
GX_SetZMode( GX_TRUE, GX_LEQUAL, GX_TRUE ); GX_SetZMode( GX_TRUE, GX_LEQUAL, GX_TRUE );
GX_SetColorUpdate( GX_TRUE ); GX_SetColorUpdate( GX_TRUE );

View File

@ -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 ); 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 ); void Menu_DrawRectangle( f32 x, f32 y, f32 width, f32 height, GXColor color, u8 filled );
s32 TakeScreenshot( const char *path ); s32 TakeScreenshot( const char *path );
void VIDEO_SetWidescreen(bool widescreen);
extern int screenheight; extern int screenheight;
extern int screenwidth; extern int screenwidth;