summaryrefslogtreecommitdiffstats
path: root/apps/plugins/rockbox_flash.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/rockbox_flash.c')
-rw-r--r--apps/plugins/rockbox_flash.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/apps/plugins/rockbox_flash.c b/apps/plugins/rockbox_flash.c
index 25a97ea25c..3bb8476b43 100644
--- a/apps/plugins/rockbox_flash.c
+++ b/apps/plugins/rockbox_flash.c
@@ -603,6 +603,13 @@ void DoUserDialog(char* filename, bool show_greet)
rb->lcd_setfont(FONT_SYSFIXED);
+ /* this can only work if Rockbox runs in DRAM, not flash ROM */
+ if ((UINT8*)rb >= FB && (UINT8*)rb < FB + 4096*1024) /* 4 MB max */
+ { /* we're running from flash */
+ rb->splash(HZ*3, true, "Not from ROM");
+ return; /* exit */
+ }
+
/* "allocate" memory */
sector = rb->plugin_get_buffer(&memleft);
if (memleft < SECTORSIZE) /* need buffer for a flash sector */
@@ -801,6 +808,13 @@ void DoUserDialog(char* filename, bool show_greet)
int memleft;
UINT32 crc;
+ /* this can only work if Rockbox runs in DRAM, not flash ROM */
+ if ((UINT8*)rb >= FB && (UINT8*)rb < FB + 4096*1024) /* 4 MB max */
+ { /* we're running from flash */
+ rb->splash(HZ*3, true, "Not from ROM");
+ return; /* exit */
+ }
+
/* "allocate" memory */
sector = rb->plugin_get_buffer(&memleft);
if (memleft < SECTORSIZE) /* need buffer for a flash sector */