Bug fixing round & add some emummc menus

Notable bugs fixed:
- pkg1id is now also used as foldername during fw dump
- Clearing of screen in _recursive functions is no longer hardcoded
- Folders get the correct file attributes
- first 16 MiB of partition during partitioning gets cleared now
This commit is contained in:
Such Meme, Many Skill
2020-01-30 23:53:27 +01:00
parent 9885308bce
commit eb8652c6ec
10 changed files with 75 additions and 28 deletions

View File

@@ -6113,6 +6113,8 @@ FRESULT f_fdisk (
DWORD sz_disk, p_sect, b_cyl, b_sect;
FRESULT res;
BYTE *empty_buff;
empty_buff = ff_memcalloc(sizeof(BYTE), 16384);
stat = disk_initialize(pdrv);
if (stat & STA_NOINIT) return FR_NOT_READY;
@@ -6167,8 +6169,13 @@ FRESULT f_fdisk (
st_dword(p + 12, p_sect); /* Number of sectors */
/* Next partition */
b_sect += p_sect;
for (int cursect = 0; cursect < 1024; cursect++){
disk_write(pdrv, empty_buff, b_sect + (32 * cursect), 32);
}
}
st_word(p, 0xAA55); /* MBR signature (always at offset 510) */
ff_memfree(empty_buff);
/* Write it to the MBR */
res = (disk_write(pdrv, buf, 0, 1) == RES_OK && disk_ioctl(pdrv, CTRL_SYNC, 0) == RES_OK) ? FR_OK : FR_DISK_ERR;

View File

@@ -321,6 +321,7 @@ DWORD ff_wtoupper (DWORD uni); /* Unicode upper-case conversion */
#endif
#if FF_USE_LFN == 3 /* Dynamic memory allocation */
void* ff_memalloc (UINT msize); /* Allocate memory block */
void* ff_memcalloc (UINT msize, UINT amount);
void ff_memfree (void* mblock); /* Free memory block */
#endif

View File

@@ -23,6 +23,10 @@ void* ff_memalloc ( /* Returns pointer to the allocated memory block (null if no
return malloc(msize); /* Allocate a new memory block with POSIX API */
}
void* ff_memcalloc (UINT msize, UINT amount){
return calloc(amount, msize);
}
/*------------------------------------------------------------------------*/
/* Free a memory block */