From c3dcc87aa494934943769b70fd752af1271d196a Mon Sep 17 00:00:00 2001 From: Karl Kurbjun Date: Wed, 18 Apr 2007 07:41:31 +0000 Subject: Allow rockboy to run while music is playing with smaller roms. Works on players that do not use the IRAM macros. Only tested on the Gigabeat as I think that is the only player that will run rockboy well with music. Also simplified the sound and reduced the code size a bit. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13199 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/rockboy/rockboy.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'apps/plugins/rockboy/rockboy.c') diff --git a/apps/plugins/rockboy/rockboy.c b/apps/plugins/rockboy/rockboy.c index 1534173114..3fbe1fd8e1 100644 --- a/apps/plugins/rockboy/rockboy.c +++ b/apps/plugins/rockboy/rockboy.c @@ -65,12 +65,6 @@ void* memcpy(void* dst, const void* src, size_t size) return rb->memcpy(dst, src, size); } -void setmallocpos(void *pointer) -{ - audio_bufferpointer = pointer; - audio_buffer_free = audio_bufferpointer - audio_bufferbase; -} - void setoptions (void) { int fd; @@ -197,9 +191,18 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) rb->splash(HZ*3, "Play gameboy ROM file! (.gb/.gbc)"); return PLUGIN_OK; } - - audio_bufferbase = audio_bufferpointer - = rb->plugin_get_audio_buffer((int *)&audio_buffer_free); + if(rb->audio_status()) + { + audio_bufferbase = audio_bufferpointer + = rb->plugin_get_buffer((int *)&audio_buffer_free); + plugbuf=true; + } + else + { + audio_bufferbase = audio_bufferpointer + = rb->plugin_get_audio_buffer((int *)&audio_buffer_free); + plugbuf=false; + } #if MEM <= 8 && !defined(SIMULATOR) /* loaded as an overlay plugin, protect from overwriting ourselves */ if ((unsigned)(plugin_start_addr - (unsigned char *)audio_bufferbase) @@ -226,7 +229,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) rb->splash(HZ/2, errormsg); return PLUGIN_ERROR; } - pcm_close(); + if(!rb->audio_status()) + pcm_close(); rb->splash(HZ/2, "Shutting down"); savesettings(); -- cgit v1.2.3