diff options
author | Karl Kurbjun <kkurbjun@gmail.com> | 2007-04-18 07:41:31 +0000 |
---|---|---|
committer | Karl Kurbjun <kkurbjun@gmail.com> | 2007-04-18 07:41:31 +0000 |
commit | c3dcc87aa494934943769b70fd752af1271d196a (patch) | |
tree | 56cd61160f29c22ee3fa67ee9bc3e020013aa051 /apps/plugins/rockboy/rockboy.c | |
parent | 521d6a5e1f1dc3a08700b22db5b203920c9f3bda (diff) | |
download | rockbox-c3dcc87aa494934943769b70fd752af1271d196a.tar.gz rockbox-c3dcc87aa494934943769b70fd752af1271d196a.zip |
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
Diffstat (limited to 'apps/plugins/rockboy/rockboy.c')
-rw-r--r-- | apps/plugins/rockboy/rockboy.c | 24 |
1 files changed, 14 insertions, 10 deletions
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) | |||
65 | return rb->memcpy(dst, src, size); | 65 | return rb->memcpy(dst, src, size); |
66 | } | 66 | } |
67 | 67 | ||
68 | void setmallocpos(void *pointer) | ||
69 | { | ||
70 | audio_bufferpointer = pointer; | ||
71 | audio_buffer_free = audio_bufferpointer - audio_bufferbase; | ||
72 | } | ||
73 | |||
74 | void setoptions (void) | 68 | void setoptions (void) |
75 | { | 69 | { |
76 | int fd; | 70 | int fd; |
@@ -197,9 +191,18 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
197 | rb->splash(HZ*3, "Play gameboy ROM file! (.gb/.gbc)"); | 191 | rb->splash(HZ*3, "Play gameboy ROM file! (.gb/.gbc)"); |
198 | return PLUGIN_OK; | 192 | return PLUGIN_OK; |
199 | } | 193 | } |
200 | 194 | if(rb->audio_status()) | |
201 | audio_bufferbase = audio_bufferpointer | 195 | { |
202 | = rb->plugin_get_audio_buffer((int *)&audio_buffer_free); | 196 | audio_bufferbase = audio_bufferpointer |
197 | = rb->plugin_get_buffer((int *)&audio_buffer_free); | ||
198 | plugbuf=true; | ||
199 | } | ||
200 | else | ||
201 | { | ||
202 | audio_bufferbase = audio_bufferpointer | ||
203 | = rb->plugin_get_audio_buffer((int *)&audio_buffer_free); | ||
204 | plugbuf=false; | ||
205 | } | ||
203 | #if MEM <= 8 && !defined(SIMULATOR) | 206 | #if MEM <= 8 && !defined(SIMULATOR) |
204 | /* loaded as an overlay plugin, protect from overwriting ourselves */ | 207 | /* loaded as an overlay plugin, protect from overwriting ourselves */ |
205 | if ((unsigned)(plugin_start_addr - (unsigned char *)audio_bufferbase) | 208 | if ((unsigned)(plugin_start_addr - (unsigned char *)audio_bufferbase) |
@@ -226,7 +229,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
226 | rb->splash(HZ/2, errormsg); | 229 | rb->splash(HZ/2, errormsg); |
227 | return PLUGIN_ERROR; | 230 | return PLUGIN_ERROR; |
228 | } | 231 | } |
229 | pcm_close(); | 232 | if(!rb->audio_status()) |
233 | pcm_close(); | ||
230 | rb->splash(HZ/2, "Shutting down"); | 234 | rb->splash(HZ/2, "Shutting down"); |
231 | 235 | ||
232 | savesettings(); | 236 | savesettings(); |