From 18e56b68fd90e19b699a17320646c9628f97f160 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Sat, 9 Feb 2013 23:41:06 -0500 Subject: Add retro sound as a setting in all languages except Chinese. --- source/nds/entry.cpp | 17 ++++++++++++++--- source/nds/gui.c | 22 ++++++++++++++-------- source/nds/gui.h | 4 +++- source/nds/message.h | 1 + 4 files changed, 32 insertions(+), 12 deletions(-) (limited to 'source') diff --git a/source/nds/entry.cpp b/source/nds/entry.cpp index c4cc389..ec1be4e 100644 --- a/source/nds/entry.cpp +++ b/source/nds/entry.cpp @@ -405,6 +405,20 @@ void game_set_fluidity() Settings.SoundSync = FALSE; } } + +void game_set_retro(void) +{ + if (game_config.RetroSound == 1) + { + Settings.InterpolatedSound = FALSE; + S9xSetEightBitConsoleSound (TRUE); + } + else + { + Settings.InterpolatedSound = TRUE; + S9xSetEightBitConsoleSound (FALSE); + } +} void init_sfc_setting(void) { @@ -426,9 +440,6 @@ void init_sfc_setting(void) Settings.APUEnabled = Settings.NextAPUEnabled = TRUE; Settings.FixFrequency = 1; - S9xSetEightBitConsoleSound (TRUE); - - Settings.H_Max = SNES_CYCLES_PER_SCANLINE; Settings.SkipFrames = AUTO_FRAMERATE; Settings.ShutdownMaster = TRUE; diff --git a/source/nds/gui.c b/source/nds/gui.c index 9e69d48..2137a28 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -2816,7 +2816,10 @@ u32 menu(u16 *screen, bool8 FirstInvocation) &game_config.SoundSync, 2, NULL, ACTION_TYPE, 4), /* 05 */ STRING_SELECTION_OPTION(game_set_frameskip, NULL, &msg[FMT_VIDEO_FRAME_SKIPPING], frameskip_options, - &game_config.frameskip_value, 12 /* auto (0) and 0..10 (1..11) make 12 option values */, NULL, ACTION_TYPE, 5) + &game_config.frameskip_value, 12 /* auto (0) and 0..10 (1..11) make 12 option values */, NULL, ACTION_TYPE, 5), + + /* 06 */ STRING_SELECTION_OPTION(game_set_retro, NULL, &msg[FMT_AUDIO_RETRO_SOUND], on_off_options, + &game_config.RetroSound, 2, NULL, ACTION_TYPE, 6) }; MAKE_MENU(graphics, NULL, NULL, NULL, NULL, 0, 0); @@ -4281,6 +4284,7 @@ void init_game_config(void) game_config.graphic = 3; // By default, have a good-looking aspect ratio game_config.frameskip_value = 0; // Automatic frame skipping game_config.SoundSync = 0; // Prefer fluid images by default + game_config.RetroSound = 0; // Correct sound by default (else 8-bit) game_config.backward = 0; //time backward disable game_config.backward_time = 2; //time backward granularity 1s @@ -4312,18 +4316,18 @@ void load_game_config_file(void) char *pt; //Set default - init_game_config(); + init_game_config(); sprintf(game_config_filename, "%s/%s", DEFAULT_CFG_DIR, gamepak_name); pt= strrchr(game_config_filename, '.'); if(NULL == pt) - return; + goto finalise; *pt= 0; strcat(game_config_filename, "_0.rts"); fp = fopen(game_config_filename, "r"); - if(NULL == fp) - return; + if(NULL == fp) + goto finalise; //Check file header pt= game_config_filename; @@ -4332,12 +4336,14 @@ void load_game_config_file(void) if (!strncmp(pt, GAME_CONFIG_HEADER, GAME_CONFIG_HEADER_SIZE)) { fread(&game_config, 1, sizeof(GAME_CONFIG), fp); - - game_set_frameskip(); - game_set_fluidity(); } fclose(fp); + +finalise: ; + game_set_frameskip(); + game_set_fluidity(); + game_set_retro(); } /*-------------------------------------------------------- diff --git a/source/nds/gui.h b/source/nds/gui.h index 290a927..9b37462 100644 --- a/source/nds/gui.h +++ b/source/nds/gui.h @@ -72,7 +72,8 @@ struct _GAME_CONFIG * THIS VALUE IS NOT GUARANTEED TO BE RESERVED AND SET TO 0. */ u32 PreviouslyUsed_20130206_2; - u32 Reserved2[42]; + u32 RetroSound; + u32 Reserved2[41]; }; typedef enum @@ -141,6 +142,7 @@ extern u32 menu(u16 *original_screen, bool8 FirstInvocation); extern void game_disableAudio(); extern void game_set_frameskip(); extern void game_set_fluidity(); +extern void game_set_retro(); extern void LowFrequencyCPU(); extern void HighFrequencyCPU(); extern void GameFrequencyCPU(); diff --git a/source/nds/message.h b/source/nds/message.h index bab9292..a166528 100644 --- a/source/nds/message.h +++ b/source/nds/message.h @@ -38,6 +38,7 @@ enum MSG FMT_VIDEO_FAST_FORWARD, FMT_VIDEO_FRAME_SKIPPING, FMT_AUDIO_SOUND, + FMT_AUDIO_RETRO_SOUND, FMT_SAVED_STATE_CREATE, FMT_SAVED_STATE_LOAD, MSG_SAVED_STATE_DELETE_GENERAL, -- cgit v1.2.3