Commit graph

12 commits

Author SHA1 Message Date
Nebuleon Fumika
b3a7f8f1fc 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.
2013-02-03 19:26:34 -05:00
Nebuleon Fumika
f385752705 memcpy vs memmove: memmove correctly handles overlapping source and destination memory buffers, but is slower than memcpy in many implementations. When memory buffers don't overlap, memcpy may be more efficient.
The DS2 SDK is such an implementation, so change many memmoves into memcpys.
2013-02-01 00:33:30 -05:00
Nebuleon Fumika
87680e69f5 Handle a game switching BG modes in the middle of a frame, to hi-res and to lo-res. This fixes Seiken Densetsu 3. 2013-01-14 23:35:53 -05:00
Nebuleon Fumika
736484548e Attempt to optimise the ADD background drawing mode so it's playable on automatic frameskip in games like Super Metroid. It doesn't work well.
See the video for this bug at <http://www.youtube.com/watch?v=sUWjVxAD9Q8>.
2013-01-10 18:01:32 -05:00
Nebuleon Fumika
6df0031bdb Mess with Mode 5 some more. Secret of Mana's menu sprite is fixed; however, as of commit 3cd20e203f (still not fixed in this commit!), Donkey Kong Country's Rareware icon is split by black columns. 2013-01-05 02:19:00 -05:00
Nebuleon Fumika
7c1327bd24 Move all CPU cycle calculations into cpuops.cpp. 2013-01-04 23:12:10 -05:00
Nebuleon Fumika
3cd20e203f Render double-width-res tiles from Background Mode 5 as half-width tiles. This makes the menu text in Secret of Mana readable.
Sprites in Background Mode 5 are still messed up. At least they're at the right X coordinate, roughly...
2013-01-01 03:53:45 -05:00
Nebuleon Fumika
b7867f01cc Memory access optimisations in sprite rendering. 2012-12-30 14:34:12 -05:00
Nebuleon Fumika
d1d0c81af8 Rendering optimisations.
tile.cpp: Optimise the common case of drawing an unclipped but possibly flipped 8x8 tile. Instead of calling WRITE_4PIXELS16 16 times, each performing setup and teardown, move the loop into DrawTile16.

tile.h, tile.cpp, gfx.h, gfx.cpp: End the use of global variable GFX.ScreenColors to pass around the current frame's palette. This saves on memory stores/loads.
2012-12-30 00:20:45 -05:00
Nebuleon Fumika
6b36e79013 Speed up rendering by an unknown amount.
gfx.cpp, others: Avoid always checking for Settings.SixteenBit if FOREVER_16_BIT is defined.

port.h: Define FOREVER_16_BIT below PIXEL_FORMAT.
2012-12-27 18:02:03 -05:00
Nebuleon Fumika
a194b85003 Preliminary Snes9x-based cheat code support. Not tested, because the file selection interface freezes when it gets to the folder containing Mightymo's cheat files, whereas it did not do this before with the converted Mightymo cheats. (335 files -> 679, though.) 2012-12-22 22:16:55 -05:00
Kitty Draper
d40ae99422 first commit 2011-03-05 21:39:25 -05:00