aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorNebuleon Fumika2013-02-06 00:43:21 -0500
committerNebuleon Fumika2013-02-06 00:43:21 -0500
commit8c5f5ba1823ac57f78ef6bec72fca93c45d0d2fa (patch)
tree1f16a96b3580b05e242196353d7c4785dc537770 /source
parent9e87a7a2b2659785bc05266fbb3292b60aecdf27 (diff)
downloadsnesemu-8c5f5ba1823ac57f78ef6bec72fca93c45d0d2fa.tar.gz
snesemu-8c5f5ba1823ac57f78ef6bec72fca93c45d0d2fa.tar.bz2
snesemu-8c5f5ba1823ac57f78ef6bec72fca93c45d0d2fa.zip
Document the auto CPU behavior a bit.
Diffstat (limited to 'source')
-rw-r--r--source/nds/entry.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/nds/entry.cpp b/source/nds/entry.cpp
index 08e95cb..5cca41e 100644
--- a/source/nds/entry.cpp
+++ b/source/nds/entry.cpp
@@ -642,6 +642,18 @@ static unsigned int sync_next = 0;
static unsigned int skip_rate= 0;
+/*
+ * Automatic CPU frequency support is here.
+ * Whenever, after one downclock determination interval, each frame rendered
+ * during it has been rendered at least as early as CPU_DOWNCLOCK_EARLY_TIME,
+ * lower the CPU frequency in response.
+ * If at least one frame has been early, but not early enough, the CPU
+ * frequency stays stable.
+ * If at least one frame has been late, the CPU will have be switched back
+ * to 396 MHz.
+ * This improves battery life to a certain extent.
+ */
+
#define CPU_DOWNCLOCK_EARLY_TIME 293 /* 1 = 42.667 us. 391 = 16.67 ms */
#define CPU_DOWNCLOCK_DETERMINATION_INTERVAL 46874 /* 23437 = 1 s */