Skip to content

Version 1.01

Choose a tag to compare

@xtremespb xtremespb released this 11 Jan 16:01
· 107 commits to main since this release
a9da7a4

Thanks to @DnCraptor: updates mii_floppy.h to ensure ASM/C struct alignment. The changes include:

  1. Added pragma pack directive - Wrapped the mii_floppy_t struct with #pragma pack(push, 1) to enforce byte-level packing
  2. Separated bitfields - Split write_protected and id into separate uint8_t declarations instead of combining them
  3. Added padding fields - Introduced _pad1 and _pad2 arrays to align struct members to specific byte offsets
  4. 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.)
  5. 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.