From 60f6ffcc701c4175e31d90f950fb34f6b07a1712 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Fri, 1 Feb 2013 00:36:51 -0500 Subject: When starting CATSFC, assume the backlights are both on, so don't delay 100 milliseconds and set both backlights to on. --- source/nds/gui.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/nds/gui.h') diff --git a/source/nds/gui.h b/source/nds/gui.h index 87c14e4..482ceec 100644 --- a/source/nds/gui.h +++ b/source/nds/gui.h @@ -124,7 +124,7 @@ extern GAME_CONFIG game_config; /****************************************************************************** ******************************************************************************/ extern void gui_init(u32 lang_id); -extern u32 menu(u16 *original_screen); +extern u32 menu(u16 *original_screen, bool8 FirstInvocation); extern void game_disableAudio(); extern void game_set_frameskip(); extern void set_cpu_clock(u32 num); -- cgit v1.2.3 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. --- source/nds/gui.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/nds/gui.h') 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); -- cgit v1.2.3 From 02f8184fe07d99cceb85f4abd3ef0e5e3765b5ea Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Sat, 2 Feb 2013 17:37:51 -0500 Subject: Make it easier to change the "high" and "low" CPU frequencies, as well as to switch to the user's chosen frequency for the game. Conflicts: source/nds/ds2_main.c source/nds/entry.cpp source/nds/gui.c --- source/nds/gui.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/nds/gui.h') diff --git a/source/nds/gui.h b/source/nds/gui.h index 0b91758..b2eae62 100644 --- a/source/nds/gui.h +++ b/source/nds/gui.h @@ -129,7 +129,9 @@ 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 void LowFrequencyCPU(); +extern void HighFrequencyCPU(); +extern void GameFrequencyCPU(); extern int load_language_msg(char *filename, u32 language); #ifdef __cplusplus -- cgit v1.2.3 From 9b75c09a7fd7c78d8c42077478e796672fae5c1b Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Sun, 3 Feb 2013 06:25:12 -0500 Subject: Force waiting for a screen to be transferred (update mode 1) because otherwise the next screen can go into DMA. Use channel 1 instead of channel 5, which must be busy for some reason. --- source/nds/gui.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/nds/gui.h') diff --git a/source/nds/gui.h b/source/nds/gui.h index b2eae62..9df2ad2 100644 --- a/source/nds/gui.h +++ b/source/nds/gui.h @@ -24,7 +24,11 @@ #include "fs_api.h" #include "gcheat.h" +#ifdef DS2_DMA +#define UP_SCREEN_UPDATE_METHOD 1 +#else #define UP_SCREEN_UPDATE_METHOD 0 +#endif #define DOWN_SCREEN_UPDATE_METHOD 2 #define MAX_GAMEPAD_MAP 16 -- cgit v1.2.3 From b3a7f8f1fceddcd45ec62bcbf75ba128e4f84f5a Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Sun, 3 Feb 2013 19:26:34 -0500 Subject: Synchronise the controller status more spread out inside a rendered frame: * before rendering a background; * before rendering sprites; * while rendering more than 128 samples of audio at once ("Prefer fluid video"); * after every 16 scanlines of CPU execution instead of every 1; * while waiting for an audio buffer to become available; * while killing time between frames with fast-forward disabled. Controller presses and releases are now combined in a DS button bitfield using a shorter 32-bit algorithm. See entry.cpp:NDSSFCAccumulateJoypad and #define ACCUMULATE_JOYPAD in the source. This is still not suitable for playing platformers frame-perfectly, but it's much better than half a second of latency to press or release a button, and one still needs to press buttons a bit more than just light taps. I'd say 50 milliseconds is the latency now. Platformers requiring more precision can be played with frameskip 0. DMA does not require double-buffered displaying, so synchronise the controller more often by disabling double-buffered displaying again. --- source/nds/gui.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source/nds/gui.h') diff --git a/source/nds/gui.h b/source/nds/gui.h index 9df2ad2..b2eae62 100644 --- a/source/nds/gui.h +++ b/source/nds/gui.h @@ -24,11 +24,7 @@ #include "fs_api.h" #include "gcheat.h" -#ifdef DS2_DMA -#define UP_SCREEN_UPDATE_METHOD 1 -#else #define UP_SCREEN_UPDATE_METHOD 0 -#endif #define DOWN_SCREEN_UPDATE_METHOD 2 #define MAX_GAMEPAD_MAP 16 -- cgit v1.2.3 From 3cd1e0327898acf0bd09a035c7a68c7362bb07c0 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Tue, 5 Feb 2013 16:05:16 -0500 Subject: Change the upper screen updates to be double-buffered. Require that one audio buffer be free (1 out of 4). --- source/nds/gui.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/nds/gui.h') diff --git a/source/nds/gui.h b/source/nds/gui.h index b2eae62..e8302eb 100644 --- a/source/nds/gui.h +++ b/source/nds/gui.h @@ -24,7 +24,7 @@ #include "fs_api.h" #include "gcheat.h" -#define UP_SCREEN_UPDATE_METHOD 0 +#define UP_SCREEN_UPDATE_METHOD 1 #define DOWN_SCREEN_UPDATE_METHOD 2 #define MAX_GAMEPAD_MAP 16 -- cgit v1.2.3 From f2adea7bb2250876df3d1b6e076a6b5380c6b13e Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Tue, 5 Feb 2013 19:39:09 -0500 Subject: Force both manual and automatic frameskipping to be at or above 2. Resets the default value for all games which previously had this value configured. --- source/nds/gui.h | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'source/nds/gui.h') diff --git a/source/nds/gui.h b/source/nds/gui.h index e8302eb..b390b69 100644 --- a/source/nds/gui.h +++ b/source/nds/gui.h @@ -50,7 +50,24 @@ struct _GAME_CONFIG { u32 clock_speed_number; u32 Reserved0; - u32 frameskip_value; + /* + * PreviouslyUsed_20130205_1 was formerly known as 'frameskip_value'; + * its values were in [0, 10]. 0 was automatic frameskipping and + * [1, 10] were mapped to skip 0 to 9 frames respectively. + * Version 1.29 changes the value range for 'frameskip_value' to + * [0, 8], with 0 as automatic frameskipping and [1, 10] to skip 2 to + * 9 frames. + * Change rationale: Frame skip values under 2 cause too much + * communication between the DSTwo and the DS, therefore the DS cannot + * timely send controller information. + * If this variable were to be used as is, the meaning of the option + * would be changed for values in [1, 8], and values in [9, 10] would + * cause undefined behavior, including crashes. + * THIS VALUE IS NOT GUARANTEED TO BE RESERVED AND SET TO 0. + * DO NOT USE THIS VALUE FOR ANY PURPOSE OTHER THAN EXACTLY THE ONE + * FOR WHICH IT WAS INTENDED. + */ + u32 PreviouslyUsed_20130205_1; u32 graphic; u32 enable_audio; u32 Reserved1; @@ -60,7 +77,8 @@ struct _GAME_CONFIG u32 HotkeyTemporaryFastForward; u32 HotkeyToggleSound; u32 SoundSync; - u32 Reserved2[44]; + u32 frameskip_value; + u32 Reserved2[43]; }; typedef enum -- cgit v1.2.3 From 9e87a7a2b2659785bc05266fbb3292b60aecdf27 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Wed, 6 Feb 2013 00:34:01 -0500 Subject: Implement automatic CPU frequency switching, which improves battery life if playing games that don't use all of the MIPS CPU. If all of it is indeed needed, then the game will constantly play at 396 MHz. --- source/nds/gui.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'source/nds/gui.h') diff --git a/source/nds/gui.h b/source/nds/gui.h index b390b69..df1bff9 100644 --- a/source/nds/gui.h +++ b/source/nds/gui.h @@ -48,7 +48,25 @@ struct _EMU_CONFIG struct _GAME_CONFIG { - u32 clock_speed_number; + /* + * PreviouslyUsed_20130205_2 was formerly known as + * 'clock_speed_number'; its values were in [0, 5]. [0, 5] were mapped + * to 240, 300, 336, 360, 384 and 394 MHz respectively. + * Version 1.29 changes the value range for 'clock_speed_number' to + * [0, 6], with 0 as an automatic CPU speed setting. + * Change rationale: The default value becomes 0 instead of 5. + * If this variable were to be used as is, the meaning of the default + * value would change. Games which had a configuration file before + * 1.29 would be using the older default of 5 (394 MHz), the meaning + * of which would become 384 MHz instead of "staying the default". + * Games which did not have a configuration file before 1.29 would be + * using the correct default. + * This would confuse users or cause undue hassle. + * THIS VALUE IS NOT GUARANTEED TO BE RESERVED AND SET TO 0. + * DO NOT USE THIS VALUE FOR ANY PURPOSE OTHER THAN EXACTLY THE ONE + * FOR WHICH IT WAS INTENDED. + */ + u32 PreviouslyUsed_20130205_2; u32 Reserved0; /* * PreviouslyUsed_20130205_1 was formerly known as 'frameskip_value'; @@ -78,7 +96,8 @@ struct _GAME_CONFIG u32 HotkeyToggleSound; u32 SoundSync; u32 frameskip_value; - u32 Reserved2[43]; + u32 clock_speed_number; + u32 Reserved2[42]; }; typedef enum -- cgit v1.2.3 From 772e24ae503310eb1ee0d5ed5061eebb138e5808 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Wed, 6 Feb 2013 03:46:48 -0500 Subject: Reinstate frame skipping options 0 and 1, but keep the new meaning (>= 2 equivalent skip level) for automatic frame skipping. Remove the automatic CPU frequency option, which was making audio emit 0.25 second of silence every so often. --- source/nds/gui.h | 53 ++++++++++++++--------------------------------------- 1 file changed, 14 insertions(+), 39 deletions(-) (limited to 'source/nds/gui.h') diff --git a/source/nds/gui.h b/source/nds/gui.h index df1bff9..6bb9ed8 100644 --- a/source/nds/gui.h +++ b/source/nds/gui.h @@ -48,44 +48,9 @@ struct _EMU_CONFIG struct _GAME_CONFIG { - /* - * PreviouslyUsed_20130205_2 was formerly known as - * 'clock_speed_number'; its values were in [0, 5]. [0, 5] were mapped - * to 240, 300, 336, 360, 384 and 394 MHz respectively. - * Version 1.29 changes the value range for 'clock_speed_number' to - * [0, 6], with 0 as an automatic CPU speed setting. - * Change rationale: The default value becomes 0 instead of 5. - * If this variable were to be used as is, the meaning of the default - * value would change. Games which had a configuration file before - * 1.29 would be using the older default of 5 (394 MHz), the meaning - * of which would become 384 MHz instead of "staying the default". - * Games which did not have a configuration file before 1.29 would be - * using the correct default. - * This would confuse users or cause undue hassle. - * THIS VALUE IS NOT GUARANTEED TO BE RESERVED AND SET TO 0. - * DO NOT USE THIS VALUE FOR ANY PURPOSE OTHER THAN EXACTLY THE ONE - * FOR WHICH IT WAS INTENDED. - */ - u32 PreviouslyUsed_20130205_2; + u32 clock_speed_number; u32 Reserved0; - /* - * PreviouslyUsed_20130205_1 was formerly known as 'frameskip_value'; - * its values were in [0, 10]. 0 was automatic frameskipping and - * [1, 10] were mapped to skip 0 to 9 frames respectively. - * Version 1.29 changes the value range for 'frameskip_value' to - * [0, 8], with 0 as automatic frameskipping and [1, 10] to skip 2 to - * 9 frames. - * Change rationale: Frame skip values under 2 cause too much - * communication between the DSTwo and the DS, therefore the DS cannot - * timely send controller information. - * If this variable were to be used as is, the meaning of the option - * would be changed for values in [1, 8], and values in [9, 10] would - * cause undefined behavior, including crashes. - * THIS VALUE IS NOT GUARANTEED TO BE RESERVED AND SET TO 0. - * DO NOT USE THIS VALUE FOR ANY PURPOSE OTHER THAN EXACTLY THE ONE - * FOR WHICH IT WAS INTENDED. - */ - u32 PreviouslyUsed_20130205_1; + u32 frameskip_value; u32 graphic; u32 enable_audio; u32 Reserved1; @@ -95,8 +60,18 @@ struct _GAME_CONFIG u32 HotkeyTemporaryFastForward; u32 HotkeyToggleSound; u32 SoundSync; - u32 frameskip_value; - u32 clock_speed_number; + /* + * PreviouslyUsed_20130206_1 was for a second meaning of + * frameskip_value that is now dropped. + * THIS VALUE IS NOT GUARANTEED TO BE RESERVED AND SET TO 0. + */ + u32 PreviouslyUsed_20130206_1; + /* + * PreviouslyUsed_20130206_2 was for a second meaning of + * clock_speed_number that is now dropped. + * THIS VALUE IS NOT GUARANTEED TO BE RESERVED AND SET TO 0. + */ + u32 PreviouslyUsed_20130206_2; u32 Reserved2[42]; }; -- cgit v1.2.3 From ebf48b1bf77d0093277640fd514877b3b26baeac Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Wed, 6 Feb 2013 15:51:23 -0500 Subject: Yeah... Despite the audio optimisations, sound still crackles with display double-buffering. Disable that, again. --- source/nds/gui.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/nds/gui.h') diff --git a/source/nds/gui.h b/source/nds/gui.h index 6bb9ed8..290a927 100644 --- a/source/nds/gui.h +++ b/source/nds/gui.h @@ -24,7 +24,7 @@ #include "fs_api.h" #include "gcheat.h" -#define UP_SCREEN_UPDATE_METHOD 1 +#define UP_SCREEN_UPDATE_METHOD 0 #define DOWN_SCREEN_UPDATE_METHOD 2 #define MAX_GAMEPAD_MAP 16 -- cgit v1.2.3