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/display.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/display.h') diff --git a/source/display.h b/source/display.h index 8e65885..d00c5ed 100644 --- a/source/display.h +++ b/source/display.h @@ -97,6 +97,9 @@ void S9xGraphicsMode (); char *S9xParseArgs (char **argv, int argc); void S9xParseArg (char **argv, int &index, int argc); void S9xExtraUsage (); +#ifdef ACCUMULATE_JOYPAD +void NDSSFCAccumulateJoypad (); +#endif uint32 S9xReadJoypad (int which1_0_to_4); bool8 S9xReadMousePosition (int which1_0_to_1, int &x, int &y, uint32 &buttons); bool8 S9xReadSuperScopePosition (int &x, int &y, uint32 &buttons); -- cgit v1.2.3