diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/firmware_flash.c | 14 | ||||
-rw-r--r-- | apps/plugins/rockbox_flash.c | 14 |
2 files changed, 28 insertions, 0 deletions
diff --git a/apps/plugins/firmware_flash.c b/apps/plugins/firmware_flash.c index 7353a3e8c6..8f7f187607 100644 --- a/apps/plugins/firmware_flash.c +++ b/apps/plugins/firmware_flash.c | |||
@@ -608,6 +608,13 @@ void DoUserDialog(char* filename) | |||
608 | 608 | ||
609 | rb->lcd_setfont(FONT_SYSFIXED); | 609 | rb->lcd_setfont(FONT_SYSFIXED); |
610 | 610 | ||
611 | /* this can only work if Rockbox runs in DRAM, not flash ROM */ | ||
612 | if ((UINT8*)rb >= FB && (UINT8*)rb < FB + 4096*1024) /* 4 MB max */ | ||
613 | { /* we're running from flash */ | ||
614 | rb->splash(HZ*3, true, "Not from ROM"); | ||
615 | return; /* exit */ | ||
616 | } | ||
617 | |||
611 | /* test if the user is running the correct plugin for this box */ | 618 | /* test if the user is running the correct plugin for this box */ |
612 | if (!CheckPlatform(PLATFORM_ID, *(UINT16*)(FB + VERSION_ADR))) | 619 | if (!CheckPlatform(PLATFORM_ID, *(UINT16*)(FB + VERSION_ADR))) |
613 | { | 620 | { |
@@ -829,6 +836,13 @@ void DoUserDialog(char* filename) | |||
829 | tCheckROM result; | 836 | tCheckROM result; |
830 | bool is_romless; | 837 | bool is_romless; |
831 | 838 | ||
839 | /* this can only work if Rockbox runs in DRAM, not flash ROM */ | ||
840 | if ((UINT8*)rb >= FB && (UINT8*)rb < FB + 4096*1024) /* 4 MB max */ | ||
841 | { /* we're running from flash */ | ||
842 | rb->splash(HZ*3, true, "Not from ROM"); | ||
843 | return; /* exit */ | ||
844 | } | ||
845 | |||
832 | /* test if the user is running the correct plugin for this box */ | 846 | /* test if the user is running the correct plugin for this box */ |
833 | if (!CheckPlatform(PLATFORM_ID, *(UINT16*)(FB + VERSION_ADR))) | 847 | if (!CheckPlatform(PLATFORM_ID, *(UINT16*)(FB + VERSION_ADR))) |
834 | { | 848 | { |
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) | |||
603 | 603 | ||
604 | rb->lcd_setfont(FONT_SYSFIXED); | 604 | rb->lcd_setfont(FONT_SYSFIXED); |
605 | 605 | ||
606 | /* this can only work if Rockbox runs in DRAM, not flash ROM */ | ||
607 | if ((UINT8*)rb >= FB && (UINT8*)rb < FB + 4096*1024) /* 4 MB max */ | ||
608 | { /* we're running from flash */ | ||
609 | rb->splash(HZ*3, true, "Not from ROM"); | ||
610 | return; /* exit */ | ||
611 | } | ||
612 | |||
606 | /* "allocate" memory */ | 613 | /* "allocate" memory */ |
607 | sector = rb->plugin_get_buffer(&memleft); | 614 | sector = rb->plugin_get_buffer(&memleft); |
608 | if (memleft < SECTORSIZE) /* need buffer for a flash sector */ | 615 | if (memleft < SECTORSIZE) /* need buffer for a flash sector */ |
@@ -801,6 +808,13 @@ void DoUserDialog(char* filename, bool show_greet) | |||
801 | int memleft; | 808 | int memleft; |
802 | UINT32 crc; | 809 | UINT32 crc; |
803 | 810 | ||
811 | /* this can only work if Rockbox runs in DRAM, not flash ROM */ | ||
812 | if ((UINT8*)rb >= FB && (UINT8*)rb < FB + 4096*1024) /* 4 MB max */ | ||
813 | { /* we're running from flash */ | ||
814 | rb->splash(HZ*3, true, "Not from ROM"); | ||
815 | return; /* exit */ | ||
816 | } | ||
817 | |||
804 | /* "allocate" memory */ | 818 | /* "allocate" memory */ |
805 | sector = rb->plugin_get_buffer(&memleft); | 819 | sector = rb->plugin_get_buffer(&memleft); |
806 | if (memleft < SECTORSIZE) /* need buffer for a flash sector */ | 820 | if (memleft < SECTORSIZE) /* need buffer for a flash sector */ |