diff --git a/source/ngc/fceugx.c b/source/ngc/fceugx.c index 082f8ca..19fe883 100644 --- a/source/ngc/fceugx.c +++ b/source/ngc/fceugx.c @@ -148,6 +148,7 @@ int main(int argc, char *argv[]) setFrameTimer(); // set frametimer method before emulation FCEUI_SetVidSystem(GCSettings.timing); + SetPalette(); FCEUI_SetSoundQuality(1); // 0 - low, 1 - high, 2 - high (alt.) ResetVideo_Emu(); diff --git a/source/ngc/gcvideo.c b/source/ngc/gcvideo.c index abaedd4..f57300a 100644 --- a/source/ngc/gcvideo.c +++ b/source/ngc/gcvideo.c @@ -23,6 +23,8 @@ #include "menudraw.h" #include "images/nesback.h" +extern void FCEU_ResetPalette(void); + extern unsigned int SMBTimer; int FDSTimer = 0; u32 FrameTimer = 0; @@ -499,7 +501,7 @@ InitGCVideo () /* we have component cables, but the preferred mode is interlaced * why don't we switch into progressive? * on the Wii, the user can do this themselves on their Wii Settings */ - if(VIDEO_HaveComponentCable() && vmode == &TVNtsc480IntDf) + if(VIDEO_HaveComponentCable()) vmode = &TVNtsc480Prog; #endif @@ -507,6 +509,10 @@ InitGCVideo () if (vmode->viTVMode == VI_TVMODE_NTSC_PROG) progressive = true; + // widescreen fix + vmode->viWidth = 678; + vmode->viXOrigin = (VI_MAX_WIDTH_PAL - 678) / 2; + // configure VI VIDEO_Configure (vmode); @@ -846,6 +852,31 @@ void FCEUD_GetPalette(unsigned char i, unsigned char *r, unsigned char *g, *b = pcpalette[i].b; } +void SetPalette() +{ + if ( GCSettings.currpal == 0 ) + { + // Do palette reset + FCEU_ResetPalette(); + } + else + { + // Now setup this palette + unsigned char i,r,g,b; + + for ( i = 0; i < 64; i++ ) + { + r = palettes[GCSettings.currpal-1].data[i] >> 16; + g = ( palettes[GCSettings.currpal-1].data[i] & 0xff00 ) >> 8; + b = ( palettes[GCSettings.currpal-1].data[i] & 0xff ); + FCEUD_SetPalette( i, r, g, b); + FCEUD_SetPalette( i+64, r, g, b); + FCEUD_SetPalette( i+128, r, g, b); + FCEUD_SetPalette( i+192, r, g, b); + } + } +} + struct st_palettes palettes[] = { /* The default NES palette must be the first entry in the array */ { "loopy", "Loopy's NES palette", diff --git a/source/ngc/gcvideo.h b/source/ngc/gcvideo.h index 51bb0c9..342dac5 100644 --- a/source/ngc/gcvideo.h +++ b/source/ngc/gcvideo.h @@ -21,12 +21,13 @@ void RenderFrame(unsigned char *XBuf); void setFrameTimer(); void zoom (float speed); void zoom_reset (); +void SetPalette(); // color palettes #define MAXPAL 12 struct st_palettes { - char *name, *desc; + char name[32], desc[32]; unsigned int data[64]; }; diff --git a/source/ngc/menu.c b/source/ngc/menu.c index 1597f45..f737f13 100644 --- a/source/ngc/menu.c +++ b/source/ngc/menu.c @@ -39,7 +39,6 @@ extern void ResetNES(void); extern void PowerNES(void); -extern void FCEU_ResetPalette(void); extern int menu; extern bool romLoaded; @@ -172,28 +171,6 @@ VideoOptions () case 2: // palette if ( ++GCSettings.currpal > MAXPAL ) GCSettings.currpal = 0; - - if ( GCSettings.currpal == 0 ) - { - // Do palette reset - FCEU_ResetPalette(); - } - else - { - // Now setup this palette - unsigned char i,r,g,b; - - for ( i = 0; i < 64; i++ ) - { - r = palettes[GCSettings.currpal-1].data[i] >> 16; - g = ( palettes[GCSettings.currpal-1].data[i] & 0xff00 ) >> 8; - b = ( palettes[GCSettings.currpal-1].data[i] & 0xff ); - FCEUD_SetPalette( i, r, g, b); - FCEUD_SetPalette( i+64, r, g, b); - FCEUD_SetPalette( i+128, r, g, b); - FCEUD_SetPalette( i+192, r, g, b); - } - } break; case 3: