summaryrefslogtreecommitdiff
path: root/apps/plugins/pacbox/pacbox.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2006-11-18 02:18:29 +0000
committerMichael Sevakis <jethead71@rockbox.org>2006-11-18 02:18:29 +0000
commitacc29d95be85c9cfd0d8f74dda813d7d1082e2ec (patch)
tree81fdd154d122b393d6254968cba5bc90b63e4741 /apps/plugins/pacbox/pacbox.c
parente2a262ee258769136eadc58c2bc8e3aa53db1a71 (diff)
downloadrockbox-acc29d95be85c9cfd0d8f74dda813d7d1082e2ec.tar.gz
rockbox-acc29d95be85c9cfd0d8f74dda813d7d1082e2ec.zip
SWCODEC/IRAM: Save voice IRAM when a plugin initializes its IRAM. Defines two macros for declaring and initializing IRAM. Plugins should use these instead. See mp3_encoder, doom, etc. for details. Further tweaks in buffer restoration after other use. Hiding of some interfaces that should only be used by buffer management.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11544 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/pacbox/pacbox.c')
-rw-r--r--apps/plugins/pacbox/pacbox.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/apps/plugins/pacbox/pacbox.c b/apps/plugins/pacbox/pacbox.c
index 7c2d1e21ca..62f5bcd413 100644
--- a/apps/plugins/pacbox/pacbox.c
+++ b/apps/plugins/pacbox/pacbox.c
@@ -29,14 +29,7 @@
29#include "lib/configfile.h" 29#include "lib/configfile.h"
30 30
31PLUGIN_HEADER 31PLUGIN_HEADER
32 32PLUGIN_IRAM_DECLARE
33#ifdef USE_IRAM
34extern char iramcopy[];
35extern char iramstart[];
36extern char iramend[];
37extern char iedata[];
38extern char iend[];
39#endif
40 33
41struct plugin_api* rb; 34struct plugin_api* rb;
42 35
@@ -370,21 +363,10 @@ static int gameProc( void )
370enum plugin_status plugin_start(struct plugin_api* api, void* parameter) 363enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
371{ 364{
372 (void)parameter; 365 (void)parameter;
373#ifdef USE_IRAM
374 void* audiobuf;
375 int audiosize;
376#endif
377 366
378 rb = api; 367 rb = api;
379 368
380#ifdef USE_IRAM 369 PLUGIN_IRAM_INIT(rb)
381 /* We need to stop audio playback in order to use IRAM, so we grab
382 the audio buffer - but we don't use it. */
383 audiobuf = rb->plugin_get_audio_buffer(&audiosize);
384
385 rb->memcpy(iramstart, iramcopy, iramend-iramstart);
386 rb->memset(iedata, 0, iend - iedata);
387#endif
388 370
389#ifdef HAVE_ADJUSTABLE_CPU_FREQ 371#ifdef HAVE_ADJUSTABLE_CPU_FREQ
390 rb->cpu_boost(true); 372 rb->cpu_boost(true);