DS-Homebrew/libslim

SD cluster size incorrectly detected

Opened this issue · 3 comments

While testing libslim in TWLMenu++, when launching a game, it says the SD cluster size isn't 32KB.

relevant lines:

#define BPB_SecPerClus 13 /* Cluster size [sector] (BYTE) */

buf->f_bfree = nclust * fat->csize;

return fs->database + (LBA_t)fs->csize * clst; /* Start sector number of the cluster */

Maybe we need to manually set this..? How does TWLMenu++/nds-bootstrap determine cluster size

It checks for f_bsize:

if (f_bsize < (32 << 10))

Which is configured here:

#define ELM_SS(fs) ((fs)->ssize)

buf->f_bsize = ELM_SS(fat);

#define FF_MAX_SS 512

Probably need to set this so the equation balances properly, could possibly be a source of bugs with libslim