1
0
Fork 0
forked from len0rd/rockbox

Added a check to prevent the flash plugins being used (and crashing) if Rockbox runs directly in flash ROM. (You need to RoLo a .ajz before re-flashing.)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4906 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jörg Hohensohn 2004-07-20 22:54:04 +00:00
parent 0258287e57
commit 69697aefe8
2 changed files with 28 additions and 0 deletions

View file

@ -608,6 +608,13 @@ void DoUserDialog(char* filename)
rb->lcd_setfont(FONT_SYSFIXED); 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 */
}
/* test if the user is running the correct plugin for this box */ /* test if the user is running the correct plugin for this box */
if (!CheckPlatform(PLATFORM_ID, *(UINT16*)(FB + VERSION_ADR))) if (!CheckPlatform(PLATFORM_ID, *(UINT16*)(FB + VERSION_ADR)))
{ {
@ -829,6 +836,13 @@ void DoUserDialog(char* filename)
tCheckROM result; tCheckROM result;
bool is_romless; bool is_romless;
/* 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 */
}
/* test if the user is running the correct plugin for this box */ /* test if the user is running the correct plugin for this box */
if (!CheckPlatform(PLATFORM_ID, *(UINT16*)(FB + VERSION_ADR))) if (!CheckPlatform(PLATFORM_ID, *(UINT16*)(FB + VERSION_ADR)))
{ {

View file

@ -603,6 +603,13 @@ void DoUserDialog(char* filename, bool show_greet)
rb->lcd_setfont(FONT_SYSFIXED); 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 */ /* "allocate" memory */
sector = rb->plugin_get_buffer(&memleft); sector = rb->plugin_get_buffer(&memleft);
if (memleft < SECTORSIZE) /* need buffer for a flash sector */ if (memleft < SECTORSIZE) /* need buffer for a flash sector */
@ -801,6 +808,13 @@ void DoUserDialog(char* filename, bool show_greet)
int memleft; int memleft;
UINT32 crc; 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 */ /* "allocate" memory */
sector = rb->plugin_get_buffer(&memleft); sector = rb->plugin_get_buffer(&memleft);
if (memleft < SECTORSIZE) /* need buffer for a flash sector */ if (memleft < SECTORSIZE) /* need buffer for a flash sector */