diff --git a/src/core/nsf.c b/src/core/nsf.c index 7bed98020..de2036465 100644 --- a/src/core/nsf.c +++ b/src/core/nsf.c @@ -324,6 +324,7 @@ BYTE nsf_load_rom(void) { nsf.adr.load = (flags[LOAD_ADR_HI] << 8) | flags[LOAD_ADR_LO]; nsf.adr.init = (flags[INIT_ADR_HI] << 8) | flags[INIT_ADR_LO]; nsf.adr.play = (flags[PLAY_ADR_HI] << 8) | flags[PLAY_ADR_LO]; + nsf.info.use_fade = FALSE; if ((nsf.songs.total == 0) || (nsf.adr.load < 0x6000) || (nsf.adr.init < 0x6000) || (nsf.adr.play < 0x6000)) { free(rom.data); @@ -976,6 +977,8 @@ void nsf_controls_mouse_in_gui(int x_mouse, int y_mouse) { } return; } + } + if (nsf.info.use_fade) { x = NSF_GUI_OPTIONS_3_PPUX; if (((x_mouse >= x) && (x_mouse <= (x + w))) && ((y_mouse >= y) && (y_mouse <= (y + h)))) { cfg->nsf_player_nsf_fadeout = !cfg->nsf_player_nsf_fadeout; @@ -1585,7 +1588,7 @@ static void nsf_draw_controls(void) { } if (force_draw || (sfadeout != cfg->nsf_player_nsf_fadeout)) { nsf_print_option(NSF_GUI_OPTIONS_3_PPUX, NSF_GUI_OPTIONS_BOX_PPUY, - uL("Fadeout"), nsf.info_song && nsf.current_song.fade, cfg->nsf_player_nsf_fadeout); + uL("Fadeout"), nsf.info.use_fade, cfg->nsf_player_nsf_fadeout); sfadeout = cfg->nsf_player_nsf_fadeout; } } diff --git a/src/core/nsf.h b/src/core/nsf.h index 7672b171d..391cfef00 100644 --- a/src/core/nsf.h +++ b/src/core/nsf.h @@ -132,6 +132,7 @@ typedef struct _nsf { uTCHAR *copyright; uTCHAR *ripper; uTCHAR *text; + BYTE use_fade; } info; struct _nsf_play_speed { WORD ntsc; diff --git a/src/core/nsfe.c b/src/core/nsfe.c index a2334a8d9..341db4a5b 100644 --- a/src/core/nsfe.c +++ b/src/core/nsfe.c @@ -110,6 +110,7 @@ BYTE nsfe_load_rom(void) { info.machine[DATABASE] = DEFAULT; memset(&nsf2, 0x00, sizeof(_nsf2)); + nsf.info.use_fade = FALSE; for (phase = NSFE_COUNT; phase <= NSFE_READ; phase++) { rom.position = 4; @@ -528,6 +529,7 @@ BYTE nsfe_fade(_rom_mem *rom, BYTE phase) { rom_mem_memcpy(&song->fade, rom, 4); nsf.chunk.length -= 4; + nsf.info.use_fade = TRUE; } rom->position += nsf.chunk.length;