Repository navigation
Version 1.01
Thanks to @DnCraptor: updates mii_floppy.h to ensure ASM/C struct alignment. The changes include:
- Added pragma pack directive - Wrapped the mii_floppy_t struct with #pragma pack(push, 1) to enforce byte-level packing
- Separated bitfields - Split write_protected and id into separate uint8_t declarations instead of combining them
- Added padding fields - Introduced _pad1 and _pad2 arrays to align struct members to specific byte offsets
- Added offset comments - Documented the exact byte offsets for key fields (bit_timing at 1, motor at 2, qtrack at 4, bit_position at 8, random at 16, etc.)
- Added static assertions - Added compile-time checks (_Static_assert) to verify that bit_position is at offset 8 and random is at offset 16, ensuring the struct layout matches expected ABI (Application Binary Interface)
These changes ensure that the C struct memory layout matches the assembly code's expectations, preventing offset mismatches between the two implementations.