34 Commits

Author SHA1 Message Date
Nebuleon Fumika
d1a7bf5eb5 Fully integrate BassAceGold's libraries, finally. The README still states that 1.2 is required to overwrite 0.13's stuff; really, 0.13 is needed only for gcc. So the sequence goes 0.13's gcc -> 1.2 -> BassAceGold's libraries -> make libds2a.a.
DMA function names changed to match BassAceGold's.
2013-02-04 23:45:44 -05:00
Nebuleon Fumika
1c9094d99f Release 1.28 after disabling the controller status sync hack. 2013-02-04 05:57:53 -05:00
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
461f240655 Fix a name clash between Snes9x's dma.h and the DS2 dma.h by renaming the DS2 dma.h to ds2_dma.h.
Add preliminary support for drawing emulated screens with DS2 DMA.
2013-02-03 05:59:48 -05:00
Nebuleon Fumika
88135c52f8 Remove unneeded volatility, enabling more optimisations. Sound volatility is #define'd away, GUI volatility is simply removed. 2013-01-19 20:28:17 -05:00
Nebuleon Fumika
0d5be16895 Revert "Reinstate timer-interrupt audio."
This reverts commit 944d9a729455de435c3d200752308ceedf250196.

Conflicts:

	source/nds/entry.cpp
2013-01-18 03:33:14 -05:00
Nebuleon Fumika
944d9a7294 Reinstate timer-interrupt audio.
This reverts commit 0d048d05ee50625f15d5235d362df6ee71903fc5.
2013-01-17 18:52:22 -05:00
Nebuleon Fumika
eb40d91070 Delete server.cpp and netplay.cpp. 2013-01-13 14:17:20 -05:00
Nebuleon Fumika
0d048d05ee Revert timer-interrupt audio, but not optimisations done since then. Get the controller status every scanline again. 2013-01-13 05:00:47 -05:00
Nebuleon Fumika
7eb79c076d Peel loops, aka only unroll loops if their number of iterations is a compile-time constant. 2013-01-12 03:48:20 -05:00
Nebuleon Fumika
75690d5e91 Loop unrolling sucks. It was adding loads of instructions per audio sample. 2013-01-12 03:15:28 -05:00
Nebuleon Fumika
40d30e35ca Remove redundant writes to support reverse stereo. Define FOREVER_FORWARD_STEREO. 2013-01-12 01:09:59 -05:00
Nebuleon Fumika
7896e83aa9 Stop constantly testing for 16-bit and stereo in sound handlers. Define FOREVER_16_BIT_SOUND and FOREVER_STEREO and use them throughout the code.
This is essentially commit 6b36e79013d4c9273a96a9783a2bccdb516f174a, but for sound instead of graphics.
2013-01-11 19:22:59 -05:00
Nebuleon Fumika
65f1ead0e7 Revert "Reinstate FAST_ALIGNED_LSB_WORD_ACCESS for 24-bit jumps." That's in port.h now.
This reverts commit 3dd99ccae465c370613ded10794749d6253bfe8c.
2013-01-08 16:24:57 -05:00
Nebuleon Fumika
3dd99ccae4 Reinstate FAST_ALIGNED_LSB_WORD_ACCESS for 24-bit jumps. 2013-01-08 16:01:22 -05:00
Nebuleon Fumika
cdd85a7ce6 Reinstate SNES Open Bus. It was making Secret of Mana's introduction screen sound like a NES with a rusty audio controller. 2013-01-08 15:55:55 -05:00
Nebuleon Fumika
e070871850 Remove Open Bus again. Stop synchronising controls so often, now that the audio variable latency problem is fixed. 2013-01-08 15:10:13 -05:00
Nebuleon Fumika
378f5a0e3f Release 1.13. 2013-01-02 01:43:11 -05:00
Nebuleon Fumika
c43b58481f Remove unused files. This reduces the plugin's size by 214 KB.
unicode.c, unicode.h, charsets.c, charsets.h: UTF-8 is universally used in CATSFC. Drop unused support for GBK/SJIS encodings.
2013-01-01 21:31:25 -05:00
Nebuleon Fumika
73f8077a2a Release 1.12. 2012-12-31 23:52:52 -05:00
Nebuleon Fumika
2c5b72137b 'make release' is now a thing. It makes the .zip file for a release. 2012-12-30 16:32:30 -05:00
Nebuleon Fumika
e036c88be6 Merge branch 'optimisation' 2012-12-24 01:25:23 -05:00
Nebuleon Fumika
d1fe64aef0 Various optimisations in the CPU emulation.
Run the opcode as a tail call from the address calculation. This cuts on the needed return instructions.

Pass the opcode address as a parameter; this keeps it in a register most of the time and avoids memory stores.
2012-12-23 16:13:54 -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
Nebuleon Fumika
a0d0c5e7a5 Eliminate the latency of button press recognition, which was bad enough to lose keys entirely sometimes, and could otherwise delay a button press or release by 200 ms.
This was the entire reason I created the fork, and I finally did it! It syncs the controls every scanline of a frame, which costs about 60,000 MIPS instructions per frame to deal with. Luckily, the processor runs at 396 MHz, which means the cost of checking the controls is 1% of the CPU's power.
2012-12-21 03:50:10 -05:00
Nebuleon Fumika
8085880130 Remove the SNES Open Bus behaviour by default. Also simplify translation again.
SNES Open Bus is a quirk of the memory subsystem that allow reads of invalid addresses to return the last byte read from memory. However, it is seldom needed by a game, and it costs 1 to 3 MIPS instructions per SNES instruction to emulate.

If you need SNES Open Bus, you can remove -DNO_OPEN_BUS from the Makefile.
2012-12-20 18:14:24 -05:00
Nebuleon Fumika
83426640a6 Add back the -mlong-calls optimisation. It shortens the plugin's code a bit. 2012-12-20 02:01:07 -05:00
Nebuleon Fumika
65b56543ab Raise the CPU's clock speed to 396 MHz while loading ROMs.
Also raise the CPU's clock speed to 396 MHz by default, instead of 360 MHz, when emulating a ROM.
2012-12-19 01:30:30 -05:00
Nebuleon Fumika
6bab708c22 Delete offsets.cpp, which is for a standalone tool that is unrelated to the emulator. 2012-12-19 00:28:32 -05:00
Nebuleon Fumika
e708c127fa Un-inline a bunch of stuff.
With the MIPS instruction cache, this means that two consecutive SNES CPU instructions using e.g. the same addressing style or the same opcode have a chance that the second one will use the first one's code and that it will be cached.
2012-12-18 22:53:49 -05:00
Nebuleon Fumika
b935574e53 Remove more unneeded files. 2012-12-17 22:42:09 -05:00
Nebuleon Fumika
3b2e1bcf79 Makefile overhaul. 2012-12-17 22:30:29 -05:00
Nebuleon Fumika
43bcd26dca Optimise for size. Allow the build process to use multiple CPU cores with make -jN. 2012-12-17 19:55:41 -05:00
Kitty Draper
d40ae99422 first commit 2011-03-05 21:39:25 -05:00