mirror of
https://github.com/dborth/fceugx.git
synced 2025-01-07 14:28:18 +01:00
fix palettes, widescreen correction
This commit is contained in:
parent
b5297f450e
commit
c8aeaea342
@ -148,6 +148,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
setFrameTimer(); // set frametimer method before emulation
|
setFrameTimer(); // set frametimer method before emulation
|
||||||
FCEUI_SetVidSystem(GCSettings.timing);
|
FCEUI_SetVidSystem(GCSettings.timing);
|
||||||
|
SetPalette();
|
||||||
FCEUI_SetSoundQuality(1); // 0 - low, 1 - high, 2 - high (alt.)
|
FCEUI_SetSoundQuality(1); // 0 - low, 1 - high, 2 - high (alt.)
|
||||||
ResetVideo_Emu();
|
ResetVideo_Emu();
|
||||||
|
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
#include "menudraw.h"
|
#include "menudraw.h"
|
||||||
#include "images/nesback.h"
|
#include "images/nesback.h"
|
||||||
|
|
||||||
|
extern void FCEU_ResetPalette(void);
|
||||||
|
|
||||||
extern unsigned int SMBTimer;
|
extern unsigned int SMBTimer;
|
||||||
int FDSTimer = 0;
|
int FDSTimer = 0;
|
||||||
u32 FrameTimer = 0;
|
u32 FrameTimer = 0;
|
||||||
@ -499,7 +501,7 @@ InitGCVideo ()
|
|||||||
/* we have component cables, but the preferred mode is interlaced
|
/* we have component cables, but the preferred mode is interlaced
|
||||||
* why don't we switch into progressive?
|
* why don't we switch into progressive?
|
||||||
* on the Wii, the user can do this themselves on their Wii Settings */
|
* on the Wii, the user can do this themselves on their Wii Settings */
|
||||||
if(VIDEO_HaveComponentCable() && vmode == &TVNtsc480IntDf)
|
if(VIDEO_HaveComponentCable())
|
||||||
vmode = &TVNtsc480Prog;
|
vmode = &TVNtsc480Prog;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -507,6 +509,10 @@ InitGCVideo ()
|
|||||||
if (vmode->viTVMode == VI_TVMODE_NTSC_PROG)
|
if (vmode->viTVMode == VI_TVMODE_NTSC_PROG)
|
||||||
progressive = true;
|
progressive = true;
|
||||||
|
|
||||||
|
// widescreen fix
|
||||||
|
vmode->viWidth = 678;
|
||||||
|
vmode->viXOrigin = (VI_MAX_WIDTH_PAL - 678) / 2;
|
||||||
|
|
||||||
// configure VI
|
// configure VI
|
||||||
VIDEO_Configure (vmode);
|
VIDEO_Configure (vmode);
|
||||||
|
|
||||||
@ -846,6 +852,31 @@ void FCEUD_GetPalette(unsigned char i, unsigned char *r, unsigned char *g,
|
|||||||
*b = pcpalette[i].b;
|
*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[] = {
|
struct st_palettes palettes[] = {
|
||||||
/* The default NES palette must be the first entry in the array */
|
/* The default NES palette must be the first entry in the array */
|
||||||
{ "loopy", "Loopy's NES palette",
|
{ "loopy", "Loopy's NES palette",
|
||||||
|
@ -21,12 +21,13 @@ void RenderFrame(unsigned char *XBuf);
|
|||||||
void setFrameTimer();
|
void setFrameTimer();
|
||||||
void zoom (float speed);
|
void zoom (float speed);
|
||||||
void zoom_reset ();
|
void zoom_reset ();
|
||||||
|
void SetPalette();
|
||||||
|
|
||||||
// color palettes
|
// color palettes
|
||||||
#define MAXPAL 12
|
#define MAXPAL 12
|
||||||
|
|
||||||
struct st_palettes {
|
struct st_palettes {
|
||||||
char *name, *desc;
|
char name[32], desc[32];
|
||||||
unsigned int data[64];
|
unsigned int data[64];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -39,7 +39,6 @@
|
|||||||
|
|
||||||
extern void ResetNES(void);
|
extern void ResetNES(void);
|
||||||
extern void PowerNES(void);
|
extern void PowerNES(void);
|
||||||
extern void FCEU_ResetPalette(void);
|
|
||||||
|
|
||||||
extern int menu;
|
extern int menu;
|
||||||
extern bool romLoaded;
|
extern bool romLoaded;
|
||||||
@ -172,28 +171,6 @@ VideoOptions ()
|
|||||||
case 2: // palette
|
case 2: // palette
|
||||||
if ( ++GCSettings.currpal > MAXPAL )
|
if ( ++GCSettings.currpal > MAXPAL )
|
||||||
GCSettings.currpal = 0;
|
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;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
|
Loading…
Reference in New Issue
Block a user