Move logs to retro_load_game and cleanup
This commit is contained in:
@@ -199,6 +199,8 @@ FILE *FCEUD_UTF8fopen(const char *n, const char *m)
|
|||||||
#define MAXPAL 17 /* raw palette # */
|
#define MAXPAL 17 /* raw palette # */
|
||||||
static int use_ntsc = 0;
|
static int use_ntsc = 0;
|
||||||
static int external_palette_exist = 0;
|
static int external_palette_exist = 0;
|
||||||
|
extern int ipalette;
|
||||||
|
extern int ntsccol;
|
||||||
|
|
||||||
struct st_palettes {
|
struct st_palettes {
|
||||||
char name[32];
|
char name[32];
|
||||||
@@ -618,26 +620,25 @@ static void retro_set_custom_palette(void)
|
|||||||
ntsccol = 0;
|
ntsccol = 0;
|
||||||
use_raw_palette = false;
|
use_raw_palette = false;
|
||||||
|
|
||||||
if (current_palette == 0 || current_palette > MAXPAL || (GameInfo->type == GIT_VSUNI))
|
if (current_palette == 0 || current_palette > MAXPAL
|
||||||
|
|| (GameInfo->type == GIT_VSUNI))
|
||||||
{
|
{
|
||||||
if (current_palette > MAXPAL && GameInfo->type != GIT_VSUNI)
|
if (current_palette > MAXPAL && GameInfo->type != GIT_VSUNI)
|
||||||
{
|
{
|
||||||
if (external_palette_exist)
|
if (external_palette_exist)
|
||||||
ipalette = 1;
|
ipalette = 1;
|
||||||
else
|
|
||||||
{
|
|
||||||
FCEU_PrintError("nes.pal not found in system directory.\n");
|
|
||||||
FCEU_PrintError("Using default palette instead.\n");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GameInfo->type == GIT_VSUNI)
|
if (current_palette == 0)
|
||||||
FCEU_PrintError("Cannot use custom palette with VS. System.\n");
|
ntsccol = use_ntsc;
|
||||||
|
|
||||||
if (current_palette == 0 && use_ntsc)
|
FCEU_ResetPalette(); /* Do palette reset. Priority will be:
|
||||||
ntsccol = 1;
|
* -ipalette : sets external palette
|
||||||
|
* -ntsccol : sets ntsc to default palette.
|
||||||
FCEU_ResetPalette(); /* Do palette reset*/
|
* If none of the above are true, then
|
||||||
|
* default palette will be used.
|
||||||
|
* VS.System should always use default palette.
|
||||||
|
*/
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1610,8 +1611,14 @@ bool retro_load_game(const struct retro_game_info *game)
|
|||||||
FCEUI_SetInput(0, SI_GAMEPAD, &JSReturn[0], 0);
|
FCEUI_SetInput(0, SI_GAMEPAD, &JSReturn[0], 0);
|
||||||
FCEUI_SetInput(1, SI_GAMEPAD, &JSReturn[0], 0);
|
FCEUI_SetInput(1, SI_GAMEPAD, &JSReturn[0], 0);
|
||||||
|
|
||||||
FCEU_LoadGamePalette(); /* check and load external palette nes.pal... */
|
external_palette_exist = ipalette;
|
||||||
external_palette_exist = ipalette; /* save status if found or not */
|
if (external_palette_exist)
|
||||||
|
FCEU_printf("nes.pal loaded from system directory.\n");
|
||||||
|
else
|
||||||
|
FCEU_PrintError("Cannot find nes.pal from system directory.\n");
|
||||||
|
|
||||||
|
if (GameInfo->type == GIT_VSUNI)
|
||||||
|
FCEU_PrintError("VS.System rom loaded, will use default palette.\n");
|
||||||
|
|
||||||
retro_set_custom_palette();
|
retro_set_custom_palette();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user