DS-Homebrew / libslim

libelm revival using FatFs 0.14 with libfat compatible API
BSD 3-Clause "New" or "Revised" License
11 stars 4 forks source link

SD cluster size incorrectly detected #7

Open RocketRobz opened 3 years ago

RocketRobz commented 3 years ago

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

chyyran commented 2 years ago

relevant lines:

https://github.com/DS-Homebrew/libslim/blob/4d1b958cc6dd8f8f13ab092ac0867642f2f480bb/libslim/source/ff.c#L125 https://github.com/DS-Homebrew/libslim/blob/4d1b958cc6dd8f8f13ab092ac0867642f2f480bb/libslim/source/elm.c#L627 https://github.com/DS-Homebrew/libslim/blob/4d1b958cc6dd8f8f13ab092ac0867642f2f480bb/libslim/source/ff.c#L1200

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

RocketRobz commented 2 years ago

It checks for f_bsize:

if (f_bsize < (32 << 10))
chyyran commented 2 years ago

Which is configured here:

https://github.com/DS-Homebrew/libslim/blob/4d1b958cc6dd8f8f13ab092ac0867642f2f480bb/libslim/source/elm.c#L57 https://github.com/DS-Homebrew/libslim/blob/4d1b958cc6dd8f8f13ab092ac0867642f2f480bb/libslim/source/elm.c#L623 https://github.com/DS-Homebrew/libslim/blob/4d1b958cc6dd8f8f13ab092ac0867642f2f480bb/libslim/source/ffconf.h#L201

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