From d4dd98e8c180532f24de342482e54f28874f06ef Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Fri, 1 Feb 2013 20:09:24 -0500 Subject: Add an option that controls which element should be more fluid, per game: video or audio. This makes most games playable, but the player can choose to get fluid audio instead of fluid video in sound-test modes or games with epic soundtracks. --- CATSFC/system/language.msg | 22 ++++++++++++++++++++-- README.md | 18 ++++++++++++++++++ source/nds/entry.cpp | 12 ++++++++++++ source/nds/gui.c | 13 ++++++++++--- source/nds/gui.h | 4 +++- source/nds/message.h | 19 +++++++++++-------- 6 files changed, 74 insertions(+), 14 deletions(-) diff --git a/CATSFC/system/language.msg b/CATSFC/system/language.msg index 126c8c2..4ae6ee6 100644 --- a/CATSFC/system/language.msg +++ b/CATSFC/system/language.msg @@ -33,6 +33,12 @@ Tools Options #MSG_MAIN_MENU_EXIT Exit +#FMT_VIDEO_AUDIO_FLUIDITY_PREFERENCE +Fluidity %s +#MSG_VIDEO_AUDIO_FLUIDITY_PREFER_VIDEO +Prefer fluid video +#MSG_VIDEO_AUDIO_FLUIDITY_PREFER_AUDIO +Prefer fluid audio #FMT_VIDEO_ASPECT_RATIO Aspect ratio %s #FMT_VIDEO_FAST_FORWARD @@ -40,7 +46,7 @@ Fast-forward %s #FMT_VIDEO_FRAME_SKIPPING Frame skipping %s #FMT_AUDIO_SOUND -Sound %s +Sound %s #FMT_SAVED_STATE_CREATE Create saved state %d #FMT_SAVED_STATE_LOAD @@ -227,6 +233,12 @@ STARTCHINESESIM 综合设置 #MSG_MAIN_MENU_EXIT 退出模拟器 +#FMT_VIDEO_AUDIO_FLUIDITY_PREFERENCE +Fluidity %s +#MSG_VIDEO_AUDIO_FLUIDITY_PREFER_VIDEO +Prefer fluid video +#MSG_VIDEO_AUDIO_FLUIDITY_PREFER_AUDIO +Prefer fluid audio #FMT_VIDEO_ASPECT_RATIO 画面 %s #FMT_VIDEO_FAST_FORWARD @@ -421,8 +433,14 @@ Outils Options #MSG_MAIN_MENU_EXIT Quitter +#FMT_VIDEO_AUDIO_FLUIDITY_PREFERENCE +Fluidité %s +#MSG_VIDEO_AUDIO_FLUIDITY_PREFER_VIDEO +Préférer la vidéo fluide +#MSG_VIDEO_AUDIO_FLUIDITY_PREFER_AUDIO +Préférer l'audio fluide #FMT_VIDEO_ASPECT_RATIO -Format d'image %s +Format d'image %s #FMT_VIDEO_FAST_FORWARD Avance rapide %s #FMT_VIDEO_FRAME_SKIPPING diff --git a/README.md b/README.md index 9877d3b..8b90366 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,24 @@ It is recommended to start with frame skipping 4 (Show 1 frame every 5) and go to 3 or 2 if the game doesn't run with major slowdowns with them. If you don't like the slowdowns, return to frame skipping 4 or -. +# Fluidity + +Fluidity is an option you can find under the Video & audio menu in a game. +By default, video fluidity is preferred over audio fluidity in games. + +* Preferring video fluidity makes audio skip certain notes, up to + 23 milliseconds, in order to render more video. In many games, this + difference is not audible. + Use this option if you want to play games that require precise controls or + fluid imagery more than precise audio emulation. You can also use this option + when watching game introductions, endings and cutscenes. +* Preferring audio fluidity makes video skip certain images, up to + 166 milliseconds, in order to render audio closer to 32,000 times per second. + Use this option if you want to play games mainly for their soundtracks, or in + a game's sound test mode. You can also use this option to experiment with the + green berry glitch in Super Mario World that makes TIME go over and under 100 + units constantly and makes the music play very fast. + # Hotkeys You can set buttons to press to perform certain actions. For each action, diff --git a/source/nds/entry.cpp b/source/nds/entry.cpp index a55c10d..1cf31df 100644 --- a/source/nds/entry.cpp +++ b/source/nds/entry.cpp @@ -350,6 +350,18 @@ void game_set_frameskip() Settings.SkipFrames = game_config.frameskip_value - 1 /* 1 -> 0 and so on */; } } + +void game_set_fluidity() +{ + if( game_config.SoundSync == 1) + { + Settings.SoundSync = TRUE; + } + else + { + Settings.SoundSync = FALSE; + } +} void init_sfc_setting(void) { diff --git a/source/nds/gui.c b/source/nds/gui.c index b529b9f..b6bd0f4 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -2814,6 +2814,8 @@ u32 menu(u16 *screen, bool8 FirstInvocation) char *frameskip_options[] = { (char*)&msg[MSG_VIDEO_FRAME_SKIPPING_AUTOMATIC], (char*)&msg[MSG_VIDEO_FRAME_SKIPPING_0], (char*)&msg[MSG_VIDEO_FRAME_SKIPPING_1], (char*)&msg[MSG_VIDEO_FRAME_SKIPPING_2], (char*)&msg[MSG_VIDEO_FRAME_SKIPPING_3], (char*)&msg[MSG_VIDEO_FRAME_SKIPPING_4], (char*)&msg[MSG_VIDEO_FRAME_SKIPPING_5], (char*)&msg[MSG_VIDEO_FRAME_SKIPPING_6], (char*)&msg[MSG_VIDEO_FRAME_SKIPPING_7], (char*)&msg[MSG_VIDEO_FRAME_SKIPPING_8], (char*)&msg[MSG_VIDEO_FRAME_SKIPPING_9], (char*)&msg[MSG_VIDEO_FRAME_SKIPPING_10] }; + char *fluidity_options[] = { (char*)&msg[MSG_VIDEO_AUDIO_FLUIDITY_PREFER_VIDEO], (char*)&msg[MSG_VIDEO_AUDIO_FLUIDITY_PREFER_AUDIO] }; + char *on_off_options[] = { (char*)&msg[MSG_GENERAL_OFF], (char*)&msg[MSG_GENERAL_ON] }; char *sound_seletion[] = { (char*)&msg[MSG_AUDIO_MUTED], (char*)&msg[MSG_AUDIO_ENABLED] }; @@ -2838,8 +2840,11 @@ u32 menu(u16 *screen, bool8 FirstInvocation) /* 03 */ STRING_SELECTION_OPTION(game_disableAudio, NULL, &msg[FMT_AUDIO_SOUND], sound_seletion, &game_enable_audio, 2, NULL, ACTION_TYPE, 3), - /* 04 */ 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, 4) + /* 04 */ STRING_SELECTION_OPTION(game_set_fluidity, NULL, &msg[FMT_VIDEO_AUDIO_FLUIDITY_PREFERENCE], fluidity_options, + &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) }; MAKE_MENU(graphics, NULL, NULL, NULL, NULL, 0, 0); @@ -4253,6 +4258,7 @@ void init_game_config(void) clock_speed_number = 5; 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.backward = 0; //time backward disable game_config.backward_time = 2; //time backward granularity 1s @@ -4306,7 +4312,8 @@ void load_game_config_file(void) fread(&game_config, 1, sizeof(GAME_CONFIG), fp); clock_speed_number = game_config.clock_speed_number; - Settings.SkipFrames = (game_config.frameskip_value == 0 ? AUTO_FRAMERATE : game_config.frameskip_value - 1 /* 1 -> 0 and so on */); + game_set_frameskip(); + game_set_fluidity(); } fclose(fp); diff --git a/source/nds/gui.h b/source/nds/gui.h index 482ceec..0b91758 100644 --- a/source/nds/gui.h +++ b/source/nds/gui.h @@ -59,7 +59,8 @@ struct _GAME_CONFIG u32 HotkeyReturnToMenu; u32 HotkeyTemporaryFastForward; u32 HotkeyToggleSound; - u32 Reserved2[45]; + u32 SoundSync; + u32 Reserved2[44]; }; typedef enum @@ -127,6 +128,7 @@ extern void gui_init(u32 lang_id); extern u32 menu(u16 *original_screen, bool8 FirstInvocation); extern void game_disableAudio(); extern void game_set_frameskip(); +extern void game_set_fluidity(); extern void set_cpu_clock(u32 num); extern int load_language_msg(char *filename, u32 language); diff --git a/source/nds/message.h b/source/nds/message.h index 0aff8d9..3eb9e74 100644 --- a/source/nds/message.h +++ b/source/nds/message.h @@ -31,6 +31,9 @@ enum MSG MSG_MAIN_MENU_TOOLS, MSG_MAIN_MENU_OPTIONS, MSG_MAIN_MENU_EXIT, + FMT_VIDEO_AUDIO_FLUIDITY_PREFERENCE, + MSG_VIDEO_AUDIO_FLUIDITY_PREFER_VIDEO, + MSG_VIDEO_AUDIO_FLUIDITY_PREFER_AUDIO, FMT_VIDEO_ASPECT_RATIO, FMT_VIDEO_FAST_FORWARD, FMT_VIDEO_FRAME_SKIPPING, @@ -41,8 +44,8 @@ enum MSG FMT_CHEAT_PAGE, MSG_CHEAT_LOAD_FROM_FILE, MSG_TOOLS_SCREENSHOT_GENERAL, - MSG_TOOLS_GLOBAL_HOTKEY_GENERAL, // currently unused - MSG_TOOLS_GAME_HOTKEY_GENERAL, // currently unused + MSG_TOOLS_GLOBAL_HOTKEY_GENERAL, + MSG_TOOLS_GAME_HOTKEY_GENERAL, FMT_OPTIONS_LANGUAGE, FMT_OPTIONS_CPU_FREQUENCY, MSG_OPTIONS_CARD_CAPACITY, @@ -50,12 +53,12 @@ enum MSG MSG_OPTIONS_VERSION, MSG_SCREENSHOT_CREATE, MSG_SCREENSHOT_BROWSE, - MSG_HOTKEY_MAIN_MENU, // currently unused - MSG_HOTKEY_TEMPORARY_FAST_FORWARD, // currently unused - MSG_HOTKEY_SOUND_TOGGLE, // currently unused - MSG_PROGRESS_HOTKEY_WAITING_FOR_KEYS, // currently unused - MSG_HOTKEY_DELETE_WITH_A, // currently unused - MSG_HOTKEY_CANCEL_WITH_B, // currently unused + MSG_HOTKEY_MAIN_MENU, + MSG_HOTKEY_TEMPORARY_FAST_FORWARD, + MSG_HOTKEY_SOUND_TOGGLE, + MSG_PROGRESS_HOTKEY_WAITING_FOR_KEYS, + MSG_HOTKEY_DELETE_WITH_A, + MSG_HOTKEY_CANCEL_WITH_B, MSG_LOAD_GAME_RECENTLY_PLAYED, MSG_LOAD_GAME_FROM_CARD, MSG_LOAD_GAME_MENU_TITLE, -- cgit v1.2.3