mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-11 14:12:26 -05:00
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
This commit is contained in:
parent
91f572c3b5
commit
2e88a90c0b
1 changed files with 11 additions and 11 deletions
|
|
@ -67,17 +67,6 @@ void *my_malloc(size_t size)
|
||||||
{
|
{
|
||||||
void *alloc;
|
void *alloc;
|
||||||
|
|
||||||
if (!audio_bufferbase)
|
|
||||||
{
|
|
||||||
audio_bufferbase = audio_bufferpointer
|
|
||||||
= rb->plugin_get_audio_buffer(&audio_buffer_free);
|
|
||||||
#if MEM <= 8 && !defined(SIMULATOR)
|
|
||||||
/* loaded as an overlay, protect from overwriting ourselves */
|
|
||||||
if ((unsigned)(ovl_start_addr - (unsigned char *)audio_bufferbase)
|
|
||||||
< audio_buffer_free)
|
|
||||||
audio_buffer_free = ovl_start_addr - (unsigned char *)audio_bufferbase;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
if (size + 4 > audio_buffer_free)
|
if (size + 4 > audio_buffer_free)
|
||||||
return 0;
|
return 0;
|
||||||
alloc = audio_bufferpointer;
|
alloc = audio_bufferpointer;
|
||||||
|
|
@ -108,6 +97,17 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
rb->splash(HZ*3, true, "Play gameboy ROM file! (.gb/.gbc)");
|
rb->splash(HZ*3, true, "Play gameboy ROM file! (.gb/.gbc)");
|
||||||
return PLUGIN_OK;
|
return PLUGIN_OK;
|
||||||
}
|
}
|
||||||
|
if (!audio_bufferbase) {
|
||||||
|
audio_bufferbase = audio_bufferpointer
|
||||||
|
= rb->plugin_get_audio_buffer(&audio_buffer_free);
|
||||||
|
#if MEM <= 8 && !defined(SIMULATOR)
|
||||||
|
/* loaded as an overlay, protect from overwriting ourselves */
|
||||||
|
if ((unsigned)(ovl_start_addr - (unsigned char *)audio_bufferbase)
|
||||||
|
< audio_buffer_free)
|
||||||
|
audio_buffer_free = ovl_start_addr - (unsigned char *)audio_bufferbase;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef USE_IRAM
|
#ifdef USE_IRAM
|
||||||
memcpy(iramstart, iramcopy, iramend-iramstart);
|
memcpy(iramstart, iramcopy, iramend-iramstart);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue