aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorNebuleon Fumika2013-01-12 20:30:30 -0500
committerNebuleon Fumika2013-01-12 20:30:30 -0500
commit59612aa01775eaaec8c33f2b101948db423cabaa (patch)
tree673b6869807129e29b3d72bede9df0920e488f8c /source
parent7eb79c076d3ee35cd7e010c80dd85aace97a285b (diff)
downloadsnes9x2005-59612aa01775eaaec8c33f2b101948db423cabaa.tar.gz
snes9x2005-59612aa01775eaaec8c33f2b101948db423cabaa.tar.bz2
snes9x2005-59612aa01775eaaec8c33f2b101948db423cabaa.zip
ds2sound.h: Set the interrupt interval to 15.36 milliseconds and explain why.
Diffstat (limited to 'source')
-rw-r--r--source/nds/ds2sound.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/nds/ds2sound.h b/source/nds/ds2sound.h
index 544a670..d8cfe09 100644
--- a/source/nds/ds2sound.h
+++ b/source/nds/ds2sound.h
@@ -6,7 +6,15 @@
#define DS2_BUFFER_SIZE_7 1024 /* tested working, slow because of upsampling */
// In microseconds.
-#define INTERRUPT_TIME_4 4000 /* tested working */
+// (512 samples / 22050 samples/sec) = 23000 microseconds.
+// The value needs to be:
+// * not too low, because then every time a new batch of close to 512 samples
+// is created anew, and that's EXPENSIVE.
+// * not too high, because then missing the end of the buffer creates audible
+// underflows.
+// * not exactly 16667 (NTSC 60 FPS) or 20000 (PAL 50 FPS), because then
+// the automatic frame skipper will be extremely messed up.
+#define INTERRUPT_TIME_4 15360 /* 15360 tested working */
#define INTERRUPT_TIME_5 8000 /* like the SNES! tested working, but slow */
#define INTERRUPT_TIME_6 4000 /* tested working, slow because of upsampling */
#define INTERRUPT_TIME_7 4000 /* tested working, slow because of upsampling */