This is more of a discussion and not an issue but I didn't see the discussion tab for this repo. Feel free to close/move/whatever this :)
I wonder if EvmuRootBlock::extraBlock should be renamed. It's described here https://github.com/gyrovorbis/libevmu/blob/libgimbal-refactor/lib/api/evmu/fs/evmu_fat.h#L146 as the location of the extra block and is filled with the value 200.
My reasoning comes from how the rest of the block locations are specified by the block number closest to the end of the file. Like rootBlock is 255, fatBlock is 254, and -- most notably -- dirBlock is 253. The first two are only 1 block long, so they describe both the start and end block number simultaneously. But for dirBlock it's 13 blocks long and specified by the block number closest to the end of the file and not the beginning.
Data files are also written starting at the end of the file, so it seems to be the convention for everything in these files with the single exception of game files.
I had a lot of issues as I was writing my code for these files because I kept wanting to start at block numbers closest to the beginning of the file because that's what seemed natural to me. But my code became simpler when I stuck with the convention of always beginning closest to the end of the file.
So in this case I wonder if the values at extraBlock and extraSize are better understood as the size of the user area rather and the size of the extra area than the block number of the extra area (except breaking convention and numbering it starting closest to the beginning of the file) and then the size of the extra area.
Maybe consider calling it userSize or something instead and updating the comment?
Anyway, this is just a thought and something I ran into coding my stuff. I don't feel particularly strongly about it and I'm happy however you decide to proceed!
This is more of a discussion and not an issue but I didn't see the discussion tab for this repo. Feel free to close/move/whatever this :)
I wonder if
EvmuRootBlock::extraBlockshould be renamed. It's described here https://github.com/gyrovorbis/libevmu/blob/libgimbal-refactor/lib/api/evmu/fs/evmu_fat.h#L146 as the location of the extra block and is filled with the value200.My reasoning comes from how the rest of the block locations are specified by the block number closest to the end of the file. Like
rootBlockis255,fatBlockis254, and -- most notably --dirBlockis253. The first two are only 1 block long, so they describe both the start and end block number simultaneously. But fordirBlockit's 13 blocks long and specified by the block number closest to the end of the file and not the beginning.Data files are also written starting at the end of the file, so it seems to be the convention for everything in these files with the single exception of game files.
I had a lot of issues as I was writing my code for these files because I kept wanting to start at block numbers closest to the beginning of the file because that's what seemed natural to me. But my code became simpler when I stuck with the convention of always beginning closest to the end of the file.
So in this case I wonder if the values at
extraBlockandextraSizeare better understood as the size of the user area rather and the size of the extra area than the block number of the extra area (except breaking convention and numbering it starting closest to the beginning of the file) and then the size of the extra area.Maybe consider calling it
userSizeor something instead and updating the comment?Anyway, this is just a thought and something I ran into coding my stuff. I don't feel particularly strongly about it and I'm happy however you decide to proceed!