summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichiel Van Der Kolk <not.valid@email.address>2005-03-03 13:50:09 +0000
committerMichiel Van Der Kolk <not.valid@email.address>2005-03-03 13:50:09 +0000
commit95819727ebf8fe66ebdf0384f098d6790ecc2cd2 (patch)
treedfdb066462dbbd9c03b1232df127edbd72706732
parent0cecadd07491002dec27571f8a64efaf6c38dbb2 (diff)
downloadrockbox-95819727ebf8fe66ebdf0384f098d6790ecc2cd2.zip
rockbox-95819727ebf8fe66ebdf0384f098d6790ecc2cd2.tar.gz
rockbox-95819727ebf8fe66ebdf0384f098d6790ecc2cd2.tar.bz2
rockbox-95819727ebf8fe66ebdf0384f098d6790ecc2cd2.tar.xz
Functions and data into iram mode for iriver, seems faster.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6112 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/rockboy/cpu.c2
-rw-r--r--apps/plugins/rockboy/cpu.h4
-rw-r--r--apps/plugins/rockboy/lcd.c2
-rw-r--r--apps/plugins/rockboy/lcd.h2
-rw-r--r--apps/plugins/rockboy/rockboy.c9
-rw-r--r--apps/plugins/rockboy/rockmacros.h10
6 files changed, 24 insertions, 5 deletions
diff --git a/apps/plugins/rockboy/cpu.c b/apps/plugins/rockboy/cpu.c
index 44a870a..d4831e8 100644
--- a/apps/plugins/rockboy/cpu.c
+++ b/apps/plugins/rockboy/cpu.c
@@ -17,7 +17,7 @@
#endif
-struct cpu cpu;
+struct cpu cpu IDATA_ATTR;
diff --git a/apps/plugins/rockboy/cpu.h b/apps/plugins/rockboy/cpu.h
index 22d58b0..eab4979 100644
--- a/apps/plugins/rockboy/cpu.h
+++ b/apps/plugins/rockboy/cpu.h
@@ -35,7 +35,7 @@ void timer_advance(int cnt);
void lcdc_advance(int cnt);
void sound_advance(int cnt);
void cpu_timers(int cnt);
-int cpu_emulate(int cycles);
-
+int cpu_emulate(int cycles) ICODE_ATTR;
+int cpu_step(int max) ICODE_ATTR;
#endif
diff --git a/apps/plugins/rockboy/lcd.c b/apps/plugins/rockboy/lcd.c
index 6351cb9..8cb1b7a 100644
--- a/apps/plugins/rockboy/lcd.c
+++ b/apps/plugins/rockboy/lcd.c
@@ -16,7 +16,7 @@
struct lcd lcd;
-struct scan scan;
+struct scan scan IDATA_ATTR;
#define BG (scan.bg)
#define WND (scan.wnd)
diff --git a/apps/plugins/rockboy/lcd.h b/apps/plugins/rockboy/lcd.h
index 9442b56..4911f85 100644
--- a/apps/plugins/rockboy/lcd.h
+++ b/apps/plugins/rockboy/lcd.h
@@ -55,7 +55,7 @@ extern struct scan scan;
-void updatepatpix(void);
+void updatepatpix(void) ICODE_ATTR;
void tilebuf(void);
void bg_scan(void);
void wnd_scan(void);
diff --git a/apps/plugins/rockboy/rockboy.c b/apps/plugins/rockboy/rockboy.c
index c9788e2..ca48fc2 100644
--- a/apps/plugins/rockboy/rockboy.c
+++ b/apps/plugins/rockboy/rockboy.c
@@ -38,6 +38,12 @@ const struct {
};
#endif
+#ifdef USE_IRAM
+extern char iramcopy[];
+extern char iramstart[];
+extern char iramend[];
+#endif
+
/* here is a global api struct pointer. while not strictly necessary,
it's nice not to have to pass the api pointer in all function calls
in the plugin */
@@ -114,6 +120,9 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
/* if you are using a global api pointer, don't forget to copy it!
otherwise you will get lovely "I04: IllInstr" errors... :-) */
rb = api;
+#ifdef USE_IRAM
+ memcpy(iramstart, iramcopy, iramend-iramstart);
+#endif
shut=0;
cleanshut=0;
mp3_bufferbase=mp3_bufferpointer=0;
diff --git a/apps/plugins/rockboy/rockmacros.h b/apps/plugins/rockboy/rockmacros.h
index 63f9b10..6cc0523 100644
--- a/apps/plugins/rockboy/rockmacros.h
+++ b/apps/plugins/rockboy/rockmacros.h
@@ -57,12 +57,22 @@ void ev_poll(void);
#define open(a,b) rb->sim_open((a),(b))
#undef lseek
#define lseek(a,b,c) rb->sim_lseek((a),(b),(c))
+#define ICODE_ATTR
+#define IDATA_ATTR
#else /* !SIMULATOR */
#define opendir(a) rb->opendir((a))
#define closedir(a) rb->closedir((a))
#define mkdir(a,b) rb->mkdir((a),(b))
#define open(a,b) rb->open((a),(b))
#define lseek(a,b,c) rb->lseek((a),(b),(c))
+#if CONFIG_KEYPAD == IRIVER_H100_PAD
+#define ICODE_ATTR __attribute__ ((section(".icode")))
+#define IDATA_ATTR __attribute__ ((section(".idata")))
+#define USE_IRAM 1
+#else
+#define ICODE_ATTR
+#define IDATA_ATTR
+#endif
#endif /* !SIMULATOR */
#define strcat(a,b) rb->strcat((a),(b))