diff options
author | Daniel Stenberg <daniel@haxx.se> | 2005-06-28 21:19:40 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2005-06-28 21:19:40 +0000 |
commit | 2e88a90c0b2e9dae693fa331dd85b82e6cf78257 (patch) | |
tree | d78e210e370ce9230e9416aeaf8427706125f7ad /apps/plugins/rockboy/rockboy.c | |
parent | 91f572c3b5feff8311fbb8b930fafbe53cc2a530 (diff) | |
download | rockbox-2e88a90c0b2e9dae693fa331dd85b82e6cf78257.tar.gz rockbox-2e88a90c0b2e9dae693fa331dd85b82e6cf78257.zip |
Request the audio buffer _before_ using any iram. By doing it in this order,
the music has stopped when we use the plugin iram area - which is shared with
the codecs!
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6904 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/rockboy/rockboy.c')
-rw-r--r-- | apps/plugins/rockboy/rockboy.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/apps/plugins/rockboy/rockboy.c b/apps/plugins/rockboy/rockboy.c index 1b4c0c7a7d..88984f91b0 100644 --- a/apps/plugins/rockboy/rockboy.c +++ b/apps/plugins/rockboy/rockboy.c | |||
@@ -67,17 +67,6 @@ void *my_malloc(size_t size) | |||
67 | { | 67 | { |
68 | void *alloc; | 68 | void *alloc; |
69 | 69 | ||
70 | if (!audio_bufferbase) | ||
71 | { | ||
72 | audio_bufferbase = audio_bufferpointer | ||
73 | = rb->plugin_get_audio_buffer(&audio_buffer_free); | ||
74 | #if MEM <= 8 && !defined(SIMULATOR) | ||
75 | /* loaded as an overlay, protect from overwriting ourselves */ | ||
76 | if ((unsigned)(ovl_start_addr - (unsigned char *)audio_bufferbase) | ||
77 | < audio_buffer_free) | ||
78 | audio_buffer_free = ovl_start_addr - (unsigned char *)audio_bufferbase; | ||
79 | #endif | ||
80 | } | ||
81 | if (size + 4 > audio_buffer_free) | 70 | if (size + 4 > audio_buffer_free) |
82 | return 0; | 71 | return 0; |
83 | alloc = audio_bufferpointer; | 72 | alloc = audio_bufferpointer; |
@@ -108,6 +97,17 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
108 | rb->splash(HZ*3, true, "Play gameboy ROM file! (.gb/.gbc)"); | 97 | rb->splash(HZ*3, true, "Play gameboy ROM file! (.gb/.gbc)"); |
109 | return PLUGIN_OK; | 98 | return PLUGIN_OK; |
110 | } | 99 | } |
100 | if (!audio_bufferbase) { | ||
101 | audio_bufferbase = audio_bufferpointer | ||
102 | = rb->plugin_get_audio_buffer(&audio_buffer_free); | ||
103 | #if MEM <= 8 && !defined(SIMULATOR) | ||
104 | /* loaded as an overlay, protect from overwriting ourselves */ | ||
105 | if ((unsigned)(ovl_start_addr - (unsigned char *)audio_bufferbase) | ||
106 | < audio_buffer_free) | ||
107 | audio_buffer_free = ovl_start_addr - (unsigned char *)audio_bufferbase; | ||
108 | #endif | ||
109 | } | ||
110 | |||
111 | #ifdef USE_IRAM | 111 | #ifdef USE_IRAM |
112 | memcpy(iramstart, iramcopy, iramend-iramstart); | 112 | memcpy(iramstart, iramcopy, iramend-iramstart); |
113 | #endif | 113 | #endif |