All I was saying is that hard coding it to 4096 instead of 512 might make it try to read 4096 bytes out of every sector it reads from every drive. That way it might work fine with newer 4k sector drives but it might get an error if it tries to keep reading past the end of a 512b sector since it doesn't know to stop at 512 anymore. If this is the case, it wouldn't be a "512b-only" vs a "multisized" version but a "512b-only" version vs a "4k only" version.
In that case, in order to really make it a "multisized" version it would need some extra code to help it choose which value to set instead of just a hardcoded value. I wouldn't think it would make that big of a size difference once compiled but the only way to find out, yes, would be writing the code up and compiling it.
Also, haven't looked at the code that much but just from your mentioning it, WORD might just be the cluster size. That's the first thing I can think of that would it into a 2-byte value since the maximum supported is 32k for DM and 64k for DML.
May be we misunderstand each other.
But looking on code I see exactly 2 abilities already in codebase:
- to use 512b sector size;
- to autodetect sector size.
Autodetecton actualy look at sector size parameter in volume "header" while mounting them, hard-coded algorithm simply ignored sector size parameter from volume.
There are no complex "espionage" to "guess" correct sector size, just reading them.
And it look like no overhead in autodetection coz You always need to mount volume before use it.
So what next?
There are two ways to enable 4k sectors without much code rewriting:
- replace 512b with 4k in "hardcoded" part of sources;
- enabling autodetection.
Personaly me will be happy with single autodetection DiosMios .wad as well as with two separate .wad-s hardcoded for 512b and 4k each.
All I need is experienced person who will build any sort of 4k-enabled .wad (autodetection preffered) and check it fits into available memory.
I will test its ability to access my 4k-sector HDD myself and report success or failure to the public.
By the way, WORD is alway 2 bytes in C, I sure, as well as BYTE is exactly 1 byte, DWORD is four and QWORD is eight.