dagargo / emu3fs

Linux kernel module for the E-Mu EIII and EIV sampler filesystems

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing little-endian conversion?

raybellis opened this issue · comments

emu3fs/super.c

Line 351 in 04adb9a

info->clusters = parameters[9] / (e3sb[0x28] >= 5 ? 2 : 1);

This happens to work on Intel machines which are little endian but looks like it would fail on a big-endian Linux machine (odd though that E-Mu chose a little endian format when the machines were mostly big endian).

Hi @raybellis!

I totally forgot about this, sorry.

I have added a conversion for the parameter you mentioned. In fact, I replaced all the cpu_to_le32 occurrences with le32_to_cpu, which is the right function to use.

As I do not have a non LE machine, I have added some tests to check if everything works as expected on other systems easily.

And thanks for your suggestion.

No worries! FWIW, your code has been very useful in helping me understand the format so that I could build the disc image browser at https://emu.tools/. I didn't add E3 sample preview yet, but I'll get around to that at some point.

The E4 series uses a very similar FS structure, albeit with a more complicated directory structure to allow for the one level deep nesting. Unlike the E3 / ESI series, though, the banks are themselves just plain E4B files that follow the IFF specification.

Glad to hear this project is useful!
Good luck with yours!