wendelscardua / miroh

NES game made for Ludum Dare 54; and its sequel/spin-off, made for NESdev Compo 2023
https://wendelscardua.itch.io/miroh-jr
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

Check bits order inside structures #137

Closed wendelscardua closed 9 months ago

wendelscardua commented 9 months ago
  static const constexpr struct {
    bool display_unicorn : 1;
    bool display_polyomino : 1;
    u8 duration : 6;
  } 

In this case, how are these members stored on the byte ? I'd like duration to be the lowest 6 bits, to avoid shifting

wendelscardua commented 9 months ago

yeah, I want the opposite; the fields are ordered from the lowest to highest