From 37183be69ce68e3f9ecaf12ce668d7e21229d8f0 Mon Sep 17 00:00:00 2001 From: Mustapha Senhaji Date: Fri, 20 Feb 2009 23:14:09 +0000 Subject: FS#9901 by Joshua Simmons for the Goban plugin: Goban overlay for the Archos targets. This is a first try to enable this plugin for low memory targets like our old archoses :) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20069 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/goban/sgf_storage.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'apps/plugins/goban/sgf_storage.c') diff --git a/apps/plugins/goban/sgf_storage.c b/apps/plugins/goban/sgf_storage.c index 8afc3ea80f..7ee0848543 100644 --- a/apps/plugins/goban/sgf_storage.c +++ b/apps/plugins/goban/sgf_storage.c @@ -326,7 +326,7 @@ setup_sgf (void) if (total_storage_size < MIN_STORAGE_BUFFER_SIZE) { - rb->splash (2 * HZ, "Stopping music playback to get more space"); + rb->splash (1 * HZ, "Stopping music playback to get more space"); DEBUGF ("storage_buffer_size < MIN!!: %d\n", (int) total_storage_size); temp_buffer = rb->plugin_get_audio_buffer (&size); @@ -335,7 +335,7 @@ setup_sgf (void) if (total_storage_size < MIN_STORAGE_BUFFER_SIZE) { - rb->splash (5 * HZ, "Low memory. Large files may not load."); + rb->splash (1 * HZ, "Low memory. Large files may not load."); DEBUGF ("storage_buffer_size < MIN!!!!: %d\n", (int) total_storage_size); @@ -387,6 +387,15 @@ setup_storage_buffer (char *temp_buffer, size_t size) unsigned int index = 0; int temp; +#if PLUGIN_BUFFER_SIZE < 0x10000 && !defined(SIMULATOR) + /* loaded as an overlay plugin, protect from overwriting ourselves */ + if (plugin_start_addr >= (unsigned char *) temp_buffer && + plugin_start_addr < (unsigned char *) temp_buffer + size) + { + size = plugin_start_addr - (unsigned char *) temp_buffer; + } +#endif + while (1) { if (index >= sizeof (storage_initialized) / -- cgit v1.2.3